query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Gets a service by id.
public function get($id) { return $this->controller->get($id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getServiceById($id)\n {\n return Service::find($id);\n }", "public static function getService($id)\n {\n return self::getManager()->getService($id);\n }", "public function getService($id)\n {\n return $this->getContainer()->get($id);\n }", "function getService($id) {\n // id du service\n $id = strtolower($id);\n // si le service existe déjà on le retourne\n if (isset($this->services[$id]))\n return $this->services[$id];\n else {\n // sinon on le charge\n $class = ucfirst($id) . \"Service\";\n $filename = \"services/\" . $class . \".php\";\n if (file_exists($filename)) {\n include($filename);\n $this->services[$id] = new $class($this);\n return $this->services[$id];\n }\n }\n // enfin, si on a rien retourné, c'est qu'on a rien trouvé\n Application::addMessage(0, \"error\", \"Impossible de charger le service \" . $id);\n return null;\n }", "public function getOne($id)\n {\n return ServiceModel::findOrFail($id);\n }", "public function getServiceForNodeId($id){\n\t\t\treturn $this->getServiceForNode($this->getNodeById($id));\n\t\t}", "public static function getService($id = 0) {\n $service = ORM::forTable('service')->findOne($id);\n\n if ($service === 0) {\n $service = Admin::createService();\n return $service;\n }\n\n if (!$service) {\n throw new Exception('Unable to find Service record for id = ' . $id);\n }\n\n return $service;\n }", "public function getServiceById(int $id)\n {\n\n $req = $this->pdo->prepare('SELECT * FROM services WHERE id = :id');\n\n $req->bindValue(':id', (int) $id);\n $req->execute();\n\n $services = $req->fetch();\n\n return $services;\n\n }", "function get_service($id) {\n\t\t$conn = db_connect();\n\t\t$result = $conn->query(\"select service_name from services where id=\".$id);\n\t\tif (!$result)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$row=$result->fetch_row();\n\t\tif($row)\n\t\t{\n\t\t\treturn $row[0];\n\t\t}\n\t}", "public function getservice($id)\n {\n return Service::where('country_id',$id)->get();\n }", "public function get($id)\n {\n Assert::integerish($id, __METHOD__ . ' expects $id to be an integer');\n return $this->call('GET', \"/shipping/services/{$id}.json\");\n }", "public function service_get($id)\n {\n $em = $this->doctrine->em;\n /** @var \\Entities\\Service $service */\n $service = $em->find('Entities\\Service', $id);\n $user = $this->getCurrentUser();\n if ($service) {\n $service->getAuthor()->getUsername();\n $service->getPositions()->toArray();\n $service->setVisits($service->getVisits() + 1);\n $service->visit_at = new DateTime(\"now\");\n $em->persist($service);\n $em->flush();\n if ($user) {\n $service->relateUserData($user, $em);\n $service->loadRelatedUserData($user);\n }\n $service->subcategoriesList = $service->getSubcategories()->toArray();\n $service->loadRelatedData($user, null, site_url());\n }\n\n $result[\"data\"] = $service;\n $this->set_response($result, REST_Controller::HTTP_OK);\n }", "abstract protected function getService($id);", "public function find(string $id): ServiceHolder;", "public function offsetGet($id)\n {\n $service = parent::offsetGet($id);\n\n return $this->injectOptionalDependencies($service);\n }", "public function offsetGet($id)\n\t{\n\t\tif (!isset($this->services[$id])) {\n\t\t\tthrow new FontoException(\"No service is registered with name $id\");\n\t\t}\n\n\t\treturn is_callable($this->services[$id]) ? $this->services[$id]($this) : $this->services[$id];\n\t}", "private function getServiceFromId(int $serviceId)\n {\n if (is_null($this->stmtService)) {\n $this->stmtService = $this->backendInstance->db->prepare(\n \"SELECT $this->attributesSelect\n FROM service\n LEFT JOIN extended_service_information\n ON extended_service_information.service_service_id = service.service_id\n WHERE service_id = :service_id AND service_activate = '1'\"\n );\n }\n $this->stmtService->bindParam(':service_id', $serviceId, PDO::PARAM_INT);\n $this->stmtService->execute();\n $results = $this->stmtService->fetchAll(PDO::FETCH_ASSOC);\n $this->serviceCache[$serviceId] = array_pop($results);\n }", "protected function get($id)\n {\n return $this->container->get($id);\n }", "public function show($id)\n {\n $service = Service::findOrFail($id);\n return response()->json($service);\n }", "protected function getService($id = null)\n {\n if (null === $id) {\n $id = preg_replace('/controller$/', '', join('.', array_slice(explode('.', str_replace('\\\\', '.', strtolower(get_class($this)))), -2)));\n }\n\n return $this->get('app.'.$id);\n }", "public function get($id)\n {\n return $this->container->get($id);\n }", "public function get( $id )\n {\n return $this->injector->get( $id );\n }", "public function show($id)\n {\n $service = Service::find($id);\n return response()->json([\n 'service' => $service\n ], 200);\n }", "public function getService($serviceID): ServiceEntry\n {\n return $this->serviceEntries[$serviceID];\n }", "public function get_user_services_by_id($id)\n\t{\n\t\t$query = $this->db->get_where('user_services', array('user_services_id' => $id));\n\t\treturn $query;\n\t}", "public function get_service_by_id($id = FALSE) {\n\t\tif ($id === FALSE) {\n\t\t\treturn 0; \n\t\t}\n\t\t\n\t\t$this->db->select('*');\n\t\t$this->db->from('services s');\n\t\t$this->db->join('beneficiaries b', 'b.ben_id = s.ben_id');\n\t\t$this->db->where(\"s.service_id = '$id' and s.trash = '0'\"); //omit trash = 0 to be able to 'undo' trash one last time?\n\t\t$query = $this->db->get();\t\t\n\n\t\t$s = $query->row_array();\n\t\t\n\t\tif (isset($s)) {\n\t\t\tif ($s != '') {\n\t\t\t\t\t\n\t\t\t\t\t//get beneficiary details\n\t\t\t\t\t$x = $this->beneficiaries_model->get_beneficiary_by_id($s['ben_id']);\n\t\t\t\t\t$s = array_merge($s, $x);\n\t\t\t\t\t\n\t\t\t\t\t//get requestor details\n\t\t\t\t\t$y = $this->beneficiaries_model->get_beneficiary_by_id($s['req_ben_id']);\n\t\t\t\t\t\t$s['req_fname'] = $y['fname'];\n\t\t\t\t\t\t$s['req_mname'] = $y['mname'];\n\t\t\t\t\t\t$s['req_lname'] = $y['lname'];\n\t\t\t\t\t\n\t\t\t}\n\n\t\t\treturn $s; \n\t\t}\n\t\telse{\n\n\t\t\treturn 0;\n\t\t}\n\n\t}", "public function getService(string $serviceId, array $arguments = []): Service;", "public function get($id) {\n if (Framework::isValidID($id)) {\n try {\n return $this->getResponseObject(Connect\\ServiceProduct::fetch($id));\n }\n catch(Connect\\ConnectAPIErrorBase $e) {\n try {\n return $this->getResponseObject(Connect\\ServiceCategory::fetch($id));\n }\n catch(Connect\\ConnectAPIErrorBase $e) {\n // pass\n }\n }\n }\n return $this->getResponseObject(null, null, new \\RightNow\\Libraries\\ResponseError(null, null, null, \"Invalid ID: No such Service Product or Category with ID = '$id'\"));\n }", "public function show($id)\n {\n $service = Service::findOrFail($id);\n\n return response()->json([\n 'service' => new \\App\\Http\\Resources\\Service($service)\n ]);\n }", "public function get(string $id);", "public function readService(int $id) {\n $service = $this->userServiceManager->getService($id);\n\n if(!is_null($service)) {\n $userProfile = $this->userProfileManager->getUserProfile($service->getUser());\n $this->addCss([\n 'services.css',\n 'forms.css',\n 'search.css',\n ]);\n $this->addJavaScript($this->javaScripts);\n $this->showView('service/servicePage', [\n 'service' => $service,\n 'userProfile' => $userProfile,\n ]);\n }\n else {\n $this->redirectTo('index');\n }\n }", "public function find($id)\n {\n return $this->service->find($id);\n }", "public function getById(string $id);", "public function get($idService)\n {\n $idService = (int) $idService;\n $requete = 'SELECT * FROM services WHERE idService = ? ';\n $stmt = $this->_pdo->prepare($requete);\n $stmt->execute(array($idService));\n $result = $stmt->fetch(PDO::FETCH_OBJ);\n if (!$result) {\n $result = ['idService' => $idService, 'idFournisseur' => '',\n 'titreService' => '',\n 'desShortService' => '', 'desService' => '',\n 'idCategorie' => '', 'actService' => '',\n 'prixService' => '', 'promService' => '',\n 'refeService' => '', 'refeEfeService' => '',\n 'datLimService' => '', 'pochetteService' => '',\n 'autService' => ''];\n }\n return $result;\n }", "public function getServices($id) {\n $dql = \"SELECT se FROM Service se\n JOIN se.serviceType st\n WHERE st.id = :id\";\n $services = $this->em->createQuery($dql)\n ->setParameter('id', $id)\n ->getResult();\n return $services;\n }", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function getService($service_id = \"\") {\n\t\t$user = $this->auth->user();\n\n\t\tif(!$user) {\n\t\t\treturn CustomResponsesHandler::response([\n\t\t\t\t\"code\" => 401,\n\t\t\t\t\"message\" => \"Permisos denegados para el cliente\",\n\t\t\t\t\"response\" => null\n\t\t\t]);\n\t\t} else {\n\t\t\tif($service_id != \"\" and $service_id != null) {\n\t\t\t\t$service = ServicesOrder::join('user_addresses', 'user_addresses.id', '=', 'services_orders.address')\n\t\t\t\t\t->where('services_orders.id_client', $user->id)\n\t\t\t\t\t->where('services_orders.status', '!=', 6)\n\t\t\t\t\t->where('services_orders.id', '=', $service_id)\n\t\t\t\t\t->first(['services_orders.*', 'user_addresses.address', 'user_addresses.latitude', 'user_addresses.longitude']);\n\t\t\t\t$documents = ServicesDocuments::join('documents', 'documents.id', '=', 'services2documents.document_id')->where('service_id', $service_id)->get(['documents.id', 'folio', 'location', 'type', 'alias', 'notes', 'subtype', 'picture_path', 'expedition', 'expiration', 'documents.created_at']);\n\n\t\t\t\tif($service) {\n\t\t\t\t\treturn CustomResponsesHandler::response([\n\t\t\t\t\t\t\"code\" => 200,\n\t\t\t\t\t\t\"message\" => \"Detalle de servicio\",\n\t\t\t\t\t\t\"response\" => array(\"service\" => $service, \"documents\" => $documents)\n\t\t\t\t\t]);\n\t\t\t\t} else {\n\t\t\t\t\treturn CustomResponsesHandler::response([\n\t\t\t\t\t\t\"code\" => 202,\n\t\t\t\t\t\t\"message\" => \"No se encontró el servicio\",\n\t\t\t\t\t\t\"response\" => null\n\t\t\t\t\t]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn CustomResponsesHandler::response([\n\t\t\t\t\t\"code\" => 400,\n\t\t\t\t\t\"message\" => \"Error en los parametros, id_service es requerido\",\n\t\t\t\t\t\"response\" => null\n\t\t\t\t]);\n\t\t\t}\n\t\t}\n\t}", "public static function get($id)\n {\n \treturn FactoryAbastract::dao(get_called_class())->findById($id);\n }", "public function getById( $id );", "public function get($id)\n {\n return $this->_Get_operation->call(['id' => $id]);\n }", "public function getById($id) {\n return $this->getBy(id, \"id\");\n }", "public function getServiceType($id) {\n $dql = \"SELECT s FROM ServiceType s\n WHERE s.id = :id\";\n\n $serviceType = $this->em\n ->createQuery($dql)\n ->setParameter('id', $id)\n ->getSingleResult();\n\n return $serviceType;\n }", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function get($id)\n {\n return $this->getContainer()->get($id);\n }", "public function getSingleton(string $serviceId): mixed;", "private function get($id){\n global $kernel;\n if ('AppCache' == get_class($kernel)) {\n $kernel = $kernel->getKernel();\n }\n return $kernel->getContainer()->get($id);\n }", "public function get( $id );", "public function show($id)\n {\n //\n $service = Service::find($id);\n if($service)\n {\n return response()->json([\n 'success' => true,\n 'data' => $service\n ]);\n }\n return response()->json([\n 'success' => false,\n 'message' => 'Service not found'\n ]);\n }", "public function getById($id)\n {\n return $this->getBy('id', (int)$id);\n }", "public function show($id)\n {\n $data = Service::find($id);\n return response()->json($data);\n }", "public function listsServicesByIdGet($service_id)\r\n {\r\n $response = Services::findOrFail($service_id);\r\n return response()->json($response,200);\r\n }", "public function get($id) {\r\n\treturn $this->getRepository()->find($id);\r\n }", "protected function get($id)\n {\n return $this->container[$id];\n }", "public function getById(int $id);", "function get_service_name($id){\n $answer=$GLOBALS['connect']->query(\"SELECT name FROM SERVICES WHERE id='$id'\");\n $data=$answer->fetch();\n return $data[\"name\"];\n }", "public function servicessub_get($id)\n {\n $em = $this->doctrine->em;\n// $subcategory = $em->find('Entities\\Sub',$id);\n $subcategoriesRepo = $em->getRepository('Entities\\Subcategory');\n\n $subcategory = $subcategoriesRepo->find($id);\n// $subcategory->services->doInitialize();\n if ($subcategory) {\n $response[\"desc\"] = \"Servicios pertenecientes a la subcategoria: $subcategory->title\";\n $services = $subcategory->getServices()->toArray();\n $user = $this->getCurrentUser();\n foreach ($services as $service) {\n $service->loadRelatedData(null, null, site_url());\n if ($user) {\n $service->loadRelatedUserData($user);\n }\n }\n $category = $subcategory->getCategory();\n $response[\"category\"] = array();\n $response[\"category\"][] = $category->getTitle();\n $response[\"subcategory\"] = array();\n $response[\"subcategory\"][] = $subcategory->getTitle();\n $response[\"data\"] = $services;\n } else {\n $response[\"desc\"] = \"Subcategoria no encontrada\";\n }\n $this->set_response($response, REST_Controller::HTTP_OK);\n }", "public static function getById($id)\n {\n return self::where('id', $id)->first();\n }", "public function get($id)\n {\n return $this->repository->find($id);\n }", "public function get($id)\n {\n return $this->repository->find($id);\n }", "public function get($id)\n {\n return $this->repository->find($id);\n }", "public function serv($id){\n \n $requete = $this->db->query(\"SELECT * FROM serviceMairie where serv_id= ?\", $id);\n $serv = $requete->row();\n return $serv; \n }", "public function get($id)\n\t{\n\t\tif (isset($this->factories[$id])) {\n\t\t\treturn $this->factories[$id];\n\t\t}\n\t\tif (!isset($this->instances[$id])) {\n\t\t\tif (isset($this->registry[$id])) {\n\t\t\t\t$this->instances[$id] = $this->registry[$id]($this);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->instances[$id] = $this->resolve($id);\n\t\t\t}\n\t\t}\n\t\treturn $this->instances[$id];\n\t}", "public function get($id) {\n\t}", "public function get($serviceName);", "public function show($id)\n {\n $validator = \\Validator::make(\n ['id' => $id],\n array(\n 'id' => 'required|exists:countries,id|integer',\n ),\n [\n 'id' => __(\"validation.required\"),\n ]\n );\n if($validator->fails()) {\n return response()->json($validator)->setStatusCode(400);\n }else {\n\n return new ServicesApi($this->services->findOrFail($id));\n }\n\n }", "public function getById($id)\n {\n return self::where('id', (int) $id)->first();\n }", "public function findServiceById($service_id) {\n if (!empty($service_id)) {\n return $this->findService(array(\"service_uuid\" => $service_id));\n }\n return false;\n }", "public function GetById( $id )\n {\n return $this->genericRepository->GetById( $id );\n }" ]
[ "0.83600056", "0.8302826", "0.798701", "0.78603953", "0.7747362", "0.77324957", "0.76872957", "0.761023", "0.75621134", "0.75500023", "0.7517377", "0.7512003", "0.74015737", "0.72782236", "0.7266655", "0.7264024", "0.70749736", "0.705532", "0.70444566", "0.6991116", "0.6965109", "0.6942732", "0.6936046", "0.6902361", "0.68816423", "0.6872736", "0.68403953", "0.68368965", "0.68358785", "0.6801388", "0.6792808", "0.6771762", "0.6747157", "0.672442", "0.66666096", "0.663796", "0.663796", "0.663796", "0.663796", "0.663796", "0.663796", "0.663796", "0.663796", "0.663796", "0.663796", "0.663796", "0.663796", "0.663796", "0.663796", "0.663796", "0.663796", "0.663796", "0.663796", "0.663796", "0.663796", "0.6618495", "0.6595782", "0.6593346", "0.6590558", "0.65859115", "0.6571957", "0.65680075", "0.65680075", "0.65680075", "0.65680075", "0.65680075", "0.65680075", "0.65680075", "0.65680075", "0.65680075", "0.65680075", "0.65680075", "0.65680075", "0.65680075", "0.65680075", "0.65680075", "0.65612054", "0.6534742", "0.651132", "0.6488817", "0.64803725", "0.6477972", "0.6477504", "0.6460533", "0.6460409", "0.64603996", "0.64554936", "0.6455461", "0.6409727", "0.6407782", "0.63976824", "0.63976824", "0.63976824", "0.63920677", "0.63846457", "0.6378564", "0.6344611", "0.6336347", "0.63342786", "0.63316846", "0.6329536" ]
0.0
-1
Gets the currently configured entity manager, or the one specified
public function getEntityManager($name = null) { return $this->controller->getEntityManager($name); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getEntityManager()\n {\n $em = $this->getServiceLocator()->get('doctrine.entitymanager.orm_default');\n return $em;\n }", "public function getEntityManager() {\n\t\tif (null === $this->em) {\n\t\t\t$this->em = $this->getServiceLocator()\n\t\t\t\t\t->get('doctrine.entitymanager.orm_default');\n\t\t}\n\t\treturn $this->em;\n\t}", "public function getManager() {\n return $this->em;\n }", "public function getEntityManager()\n {\n return $this->container->get('doctrine')->getManager($this->emName);\n }", "protected function entityManager() {\n\t\treturn $this->serviceLocator->get('Doctrine\\ORM\\EntityManager');\n\t}", "public function getEntityManager($emName = null);", "public function getEntityManager()\n {\n if (null === $this->em) {\n $this->em = $this->getServiceLocator()\n ->get('doctrine.entitymanager.orm_default');\n }\n return $this->em;\n }", "public function getEntityManager()\n {\n return $this['orm.em'];\n }", "protected function getEM() {\n return $this->getDoctrine()->getEntityManager();\n }", "public function getManager($name = null)\n {\n return $this->entityManager;\n }", "public function getEntityManager($name = null) {\r\n\t\treturn $this->context->getState('entityManager');\r\n\t}", "public function getEntityManager()\r\n {\r\n if (null === $this->em) {\r\n $this->em = $this->getServiceLocator()->get('Doctrine\\ORM\\EntityManager') ;\r\n }\r\n return $this->em;\r\n }", "private function getEntityManager()\n {\n if ($this->em === null) {\n $this->em = $this->container->get('doctrine')->getManager();\n }\n return $this->em;\n }", "protected function getObjectManager()\n {\n return $this->managerRegistry->getManager($this->managerName);\n }", "protected function getEntityManager()\n {\n return $this->getContainer()->get('doctrine')->getManager();\n }", "protected function getEntityManager()\n {\n return $this->getContainer()->get('doctrine.orm.entity_manager');\n }", "public function getEntityManager()\n {\n return $this\n ->container\n ->get('doctrine')\n ->getManager();\n }", "public function getManager()\n {\n return $this->manager;\n }", "public function getManager()\n {\n return $this->manager;\n }", "public function getManager()\n {\n return $this->manager;\n }", "public function getEntityManager()\n {\n if (null === $this->em)\n {\n $this->em = $this->getServiceLocator()->get('Doctrine\\ORM\\EntityManager');\n }\n return $this->em;\n }", "public function getObjectManager()\n {\n return $this->entityManager;\n }", "public function getEntityManager($name = null)\n {\n $name = $name ? $name : 'doctrine.orm.entity_manager';\n return $this->get($name);\n }", "public function getManager() {\n return $this->manager;\n }", "protected function getManager()\n {\n return $this->manager;\n }", "protected function getEntityManager()\n {\n return $this->entityManager;\n }", "protected function getEntityManager()\n {\n return $this->em;\n }", "public function getEntityManager()\n {\n return $this->entityManager;\n }", "public function getEntityManager()\n {\n return $this->entityManager;\n }", "public function getEntityManager()\n {\n return $this->em;\n }", "public function getEntityManager()\n{\nif (null === $this->em) {\n$this->em = $this->getServiceLocator()\n->get('doctrine.entitymanager.orm_default');\n}\nreturn $this->em;\n}", "public function getEntityManager()\n\t{\n\t\treturn $this->em;\n\t}", "public function getEntityManager()\n {\n if (null === $this->entityManager) {\n $this->entityManager = $this->getServiceLocator()->get('Doctrine\\ORM\\EntityManager');\n }\n return $this->entityManager;\n }", "public function getEntityManager();", "public function getEntityManager(){\n return $this->entityManager;\n }", "protected function getEntityManager()\n {\n if (null === $this->entityManager) {\n $this->setEntityManager($this->getServiceLocator()->get('Doctrine\\ORM\\EntityManager'));\n }\n return $this->entityManager;\n }", "public function getObjectManager(){\n return $this->entityManager;\n }", "public static function getEntityManager() {\n if (!self::$_entityManager) {\n global $kernel;\n self::$_entityManager = $kernel->getContainer()->get('doctrine')->getManager();\n }\n return self::$_entityManager;\n }", "public function getDefaultManagerName()\n {\n return $this->entityManager;\n }", "public function getORM(): EntityManager\n {\n return $this->orm;\n }", "public function getEntityManager($name = null)\n {\n return $this->getDoctrine()->getManager($name);\n }", "public function getEntityManager()\n {\n if (null === $this->entityManager)\n $this->setEntityManager($this->getServiceManager()->get('Doctrine\\ORM\\EntityManager'));\n return $this->entityManager;\n }", "public function getObjectManager(): mixed\n {\n return $this->objectManager;\n }", "private function getManagerServiceId()\n {\n return 'doctrine.orm.entity_manager';\n }", "public function getEntityManager()\n {\n if (!isset($this->entityManager)) {\n $this->recreateEntityManager();\n }\n return $this->entityManager;\n }", "public function getEm()\n {\n if( null === $this->em )\n $this->em = $this->getServiceLocator()->get('Doctrine\\ORM\\EntityManager');\n\n return $this->em;\n\n }", "public function getObjectManager() {\n\t\tif(($this->objectManager instanceof \\TYPO3\\CMS\\Extbase\\Object\\ObjectManager) === false) {\n\t\t\t$this->objectManager = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(\\TYPO3\\CMS\\Extbase\\Object\\ObjectManager::class);\n\t\t}\n\n\t\treturn $this->objectManager;\n\t}", "public function getObjectManager() {\n\t\tif(($this->objectManager instanceof \\TYPO3\\CMS\\Extbase\\Object\\ObjectManager) === false) {\n\t\t\t$this->objectManager = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Extbase\\\\Object\\\\ObjectManager');\n\t\t}\n\n\t\treturn $this->objectManager;\n\t}", "public static function getEntityManager()\n {\n $factory = new \\Source44\\Doctrine\\Factory();\n return $factory->createEntityManager();\n }", "protected function getEm()\n {\n return $this->entityManager;\n }", "public function getEntityManager($name = self::DEFAULT_ENTITYMANAGER_NAME) {\n\t\t\n\t\tif (empty($name)) {\n\t\t\tthrow new Exception(\"Entity Manager alias name should be set\");\n\t\t} elseif (isset($this->_entityManagers[$name])) {\n\t\t\tthrow new Exception(\"Entity Manager '{$name}' is not set\");\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "public function getEntityManager($name = null)\n {\n // TODO: Implement getEntityManager() method.\n }", "public function getEntityManager()\n {\n $this->entityManager = $this->refreshEntityManager($this->entityManager);\n\n return $this->entityManager;\n }", "public function entity()\n {\n return Manager::class;\n }", "protected function getDoctrine_Orm_DefaultManagerConfiguratorService()\n {\n return $this->services['doctrine.orm.default_manager_configurator'] = new \\Doctrine\\Bundle\\DoctrineBundle\\ManagerConfigurator(array(), array());\n }", "protected function getDoctrine_Orm_DefaultManagerConfiguratorService()\n {\n return $this->services['doctrine.orm.default_manager_configurator'] = new \\Doctrine\\Bundle\\DoctrineBundle\\ManagerConfigurator(array(), array());\n }", "protected function getIntentionManager()\n {\n return $this->get('intention.execution_manager');\n }", "public static function getManager($entityClass) {\n\t\tif (!isset(self::$managers[$entityClass])) {\n\t\t\tself::$managers[$entityClass] = new EntityManager($entityClass);\n\t\t}\n\t\treturn self::$managers[$entityClass];\n\t}", "public function getObjectManager()\r\n {\r\n return $this->objectManager;\r\n }", "protected function getObjectManager()\n {\n return $this->objectManager;\n }", "public function getObjectManager()\n {\n return $this->objectManager;\n }", "public function getObjectManager()\n {\n return $this->objectManager;\n }", "public function getObjectManager()\n {\n return $this->objectManager;\n }", "public function getObjectManager()\n {\n return $this->objectManager;\n }", "public function getDatabaseManager(): DatabaseManager\n {\n return $this->manager;\n }", "protected function getEntityManager()\n {\n if (null === $this->entityManager) {\n $this->entityManager = clone self::$container->get('doctrine.orm.entity_manager');\n }\n return $this->entityManager;\n }", "protected function getObjectManager()\n {\n return $this->_objectManager;\n }", "private function getUserManager() {\n return $this->get('seip.user_manager');\n }", "public function getManagerForClass($class)\n {\n return $this->entityManager;\n }", "protected function getEm($name = null){\n return $this->getDoctrine()->getManager($name);\n }", "public function manager()\n {\n \treturn $this->hasOne(manager::class);\n }", "public function getManager()\n {\n return $this->hasOne(User::class, ['id' => 'manager_id']);\n }", "protected function getManager($manager)\n {\n switch ($manager) {\n case 'cms':\n return \\Winter\\User\\Classes\\AuthManager::instance();\n case 'backend':\n return \\Backend\\Classes\\AuthManager::instance();\n }\n\n throw new ApplicationException('Invalid manager provided. Must be either \"cms\" or \"backend\".');\n }", "public static function entityManager($name = 'default')\n {\n if (isset(self::$entityManagers[$name])) {\n return self::$entityManagers[$name];\n }\n $databaseConnection = self::connection($name)->getDbalConnection();\n\n if (Configuration::get('app.env') == 'development') {\n $cache = new ArrayCache();\n } else { // @codeCoverageIgnore\n $cache = new FilesystemCache(Configuration::get('app.cache')); // @codeCoverageIgnore\n }\n\n $config = new \\Doctrine\\ORM\\Configuration();\n $config->setMetadataCacheImpl($cache);\n $driver = $config->newDefaultAnnotationDriver([APPPATH . 'Entity'], false);\n\n $config->setMetadataDriverImpl($driver);\n $config->setQueryCacheImpl($cache);\n\n $proxyDir = APPPATH . 'Proxy';\n $proxyNamespace = 'App\\Proxy';\n\n $config->setProxyDir($proxyDir);\n $config->setProxyNamespace($proxyNamespace);\n Autoloader::register($proxyDir, $proxyNamespace);\n\n $loggerChain = new LoggerChain();\n if (Configuration::get('app.env') == 'development') {\n $config->setAutoGenerateProxyClasses(true);\n\n $loggerChain->addLogger(new DoctrineLogBridge(\\Logger::getInstance()->getMonologInstance()));\n $loggerChain->addLogger(DebugBarHelper::getInstance()->getDebugStack());\n } else { // @codeCoverageIgnore\n $config->setAutoGenerateProxyClasses(false); // @codeCoverageIgnore\n }\n $em = EntityManager::create($databaseConnection, $config);\n\n $em->getConnection()->getConfiguration()->setSQLLogger($loggerChain);\n $em->getConfiguration()->setSQLLogger($loggerChain);\n\n self::$entityManagers[$name] = $em;\n return $em;\n }", "public function getConnection()\n {\n $eManager = $this->getServiceLocator();\n $entityManager = $eManager->get('doctObjMngr');\n return $entityManager;\n }", "static protected function getConfigurationManager()\n\t{\n\t\tif (!is_null(static::$configurationManager)) {\n\t\t\treturn static::$configurationManager;\n\t\t}\n\t\t$objectManager = GeneralUtility::makeInstance(ObjectManager::class);\n\t\t$configurationManager = $objectManager->get(ConfigurationManagerInterface::class);\n\t\tstatic::$configurationManager = $configurationManager;\n\t\treturn $configurationManager;\n\t}", "public function getManager($name = null)\n {\n // TODO: Implement getManager() method.\n }", "protected function getUserManager() {\n return $this->get('fos_user.user_manager');\n }", "public function getManager(): Gutenberg\n {\n return $this->manager;\n }", "public function detectOrm()\n {\n $orm = sfConfig::get('app_sfSimpleGoogleSitemap_orm', self::ORM_AUTO);\n\n if ($orm == self::ORM_AUTO) // auto detection\n {\n $orm = self::ORM_PROPEL; // by default it is propel\n\n // detects if DbFinderPlugin exists\n $path = sfConfig::get('sf_plugins_dir').'/DbFinderPlugin';\n if (file_exists($path)) // check if we have DbFinder installed\n {\n $orm = self::ORM_DB_FINDER;\n }\n }\n\n return $orm;\n }", "public function getEm()\n {\n return $this->em;\n }", "public function getServiceManager ()\n {\n return $this->serviceManager;\n }", "public function getServiceManager()\r\n\t{\r\n\t\treturn $this->serviceManager;\r\n\t}", "public function getDefaultEntityManagerName()\n {\n // TODO: Implement getDefaultEntityManagerName() method.\n }", "public function getServiceManager()\n\t{\n\t\treturn $this->serviceManager;\n\t}", "public function isManager()\r\n {\r\n \treturn $this->manager;\r\n }", "protected function getServiceManager()\n {\n return $this->serviceManager;\n }", "public function getServiceManager()\n {\n return $this->serviceManager;\n }", "public function getServiceManager()\n {\n return $this->serviceManager;\n }", "public function getServiceManager()\n {\n return $this->serviceManager;\n }", "public function getServiceManager()\n {\n return $this->serviceManager;\n }", "public function getServiceManager()\n {\n return $this->serviceManager;\n }", "public function getServiceManager()\n {\n return $this->serviceManager;\n }", "public function getServiceManager()\n {\n return $this->serviceManager;\n }", "protected function getUserManager() {\n return $this->container->get('fos_user.user_manager');\n }", "public function getServiceManager()\n {\n return $this->sm;\n }", "public function getObjectManager();", "public function getObjectManager();", "private function getArrangementProgramManager() {\n return $this->get('seip.arrangement_program.manager');\n }", "public final function getSystemDoctrineService(): DoctrineService\n {\n return $this->systemDoctrineService;\n }" ]
[ "0.7568049", "0.7422228", "0.74169356", "0.73875535", "0.73736644", "0.7323293", "0.73194313", "0.72521865", "0.71806544", "0.7152181", "0.71416456", "0.7133759", "0.71307755", "0.70813674", "0.70787555", "0.706512", "0.7061525", "0.7052547", "0.7052547", "0.7052547", "0.70387757", "0.70386004", "0.702792", "0.7001785", "0.69885856", "0.69734514", "0.6949876", "0.6949079", "0.6949079", "0.69442827", "0.69250137", "0.69042975", "0.6889859", "0.6848358", "0.68378574", "0.6821624", "0.6804973", "0.6778457", "0.67730963", "0.67637336", "0.67522204", "0.67452633", "0.6650298", "0.66416943", "0.6640741", "0.6639696", "0.6602063", "0.6572702", "0.65447104", "0.6544408", "0.6516642", "0.65154165", "0.6513602", "0.64793324", "0.6434594", "0.6434594", "0.64051366", "0.6396219", "0.6389638", "0.63707995", "0.6363049", "0.6363049", "0.6363049", "0.6363049", "0.6359719", "0.6345627", "0.63326234", "0.6316548", "0.62933964", "0.6284596", "0.6254526", "0.6249929", "0.6237867", "0.62304753", "0.6209885", "0.6206489", "0.6171613", "0.6145991", "0.6140129", "0.6128135", "0.61204207", "0.60676146", "0.60585314", "0.6050136", "0.6048783", "0.60303324", "0.6028595", "0.60226244", "0.60226244", "0.60226244", "0.60226244", "0.60226244", "0.60226244", "0.60226244", "0.5993444", "0.59707016", "0.5962358", "0.5962358", "0.59214884", "0.59148985" ]
0.6994942
24
Returns an implementation of DaoInterface. If using Doctrine2 it would be a subclass of EntityRepository, if using Doctrine1 it would be a subclass of Doctrine_Table
public function getRepository($entityName, $entityManagerName = null) { return $this->controller->getRepository($entityName, $entityManagerName); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function dao()\n {\n global $container;\n return $container->getService(\"dao\");\n }", "public function getDaoRepository()\n {\n return app()->make('App\\Dao\\\\' . $this->getModelName());\n }", "public function getDao()\n {\n return parent::getDao();\n }", "public function getDao()\n\t{\n\t\treturn parent::getDao();\n\t}", "public function getDao()\n\t{\n\t\treturn parent::getDao();\n\t}", "public function getBaseDaoClassName(): string;", "protected function getDoctrineDriver()\n {\n return class_exists(Version::class) ? new DoctrineDriver : new SQLiteDriver;\n }", "public function getImplements() {\n return array(\n 'pdoMap_Dao_IAdapter',\n $this->getGeneratedInterface()\n );\n }", "public function dao($name = null)\n {\n if ($name === null) {\n if ($this->dao === null) {\n $this->dao = $this->getService($this->daoName);\n }\n\n return $this->dao;\n } else {\n return $this->getService($name);\n }\n }", "public function getRepository(): TableRepository;", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Domain');\n }", "public function create($className, FactoryOptions $options)\n {\n switch ($options->getFramework())\n {\n case \"ZendFramework\":\n $this->frameworkClass = \"Zend_Db_Table\";\n case \"Yii\":\n $this->frameworkClass = \"CActiveRecord\";\n case \"Doctrine2\":\n $this->frameworkClass = \"Doctrine\\ORM\\EntityRepository\";\n case \"DummyFramework\":\n $this->frameworkClass = \"FrameworkDao\";\n default :\n throw new DaoFactoryUnknownFrameworkException();\n }\n \n $fullClassName = $this->validateClass($this->getClassName($className, $options));\n \n $dao = new $fullClassName();\n \n if(count($options->getInterfaces()) > 0)\n {\n foreach($options->getInterfaces() as $interface) {\n if(!($dao instanceof $interface)) {\n throw new DaoFactoryInterfaceNotImplementedException();\n }\n }\n }\n \n return $dao;\n }", "public function getRepository()\n {\n return $this->getEntityManager()->getRepository($this->getEntityClassName());\n }", "protected function getRepository()\n {\n return $this->entityManager->getRepository($this->getEntityClass());\n }", "protected function getDoctrineDriver()\n {\n return new DoctrineDriver;\n }", "protected function getDoctrineDriver()\n {\n return new DoctrineDriver;\n }", "protected function getDoctrineDriver()\n {\n return new DoctrineDriver;\n }", "public function getDaoClassName(): string;", "public function getDatabase(): DatabaseInterface;", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Designaciones');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('DesignacionesEmpleados');\n }", "public function getExtends() {\n return 'pdoMap_Dao_Adapter';\n }", "public function getDao(){\n\t\tif($app = \\Smally\\Application::getInstance()){\n\t\t\treturn $app->getFactory()->getDao($this->getVoName());\n\t\t}\n\t\treturn null;\n\t}", "public function getRepository(): EntityRepository;", "public function getDAO() \n {//--------------->> getDAO()\n return $this->_DAO;\n }", "public function getRepository(string $className): IRepository;", "public function getRepository(EntityManagerInterface $entityManager, $entityName);", "public static function getInstance()\r\n {\r\n return Doctrine_Core::getTable('Hospital');\r\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable(\"Order\");\n }", "public function getById(int $id): EntityInterface\n {\n }", "public function getRepository()\n {\n return $this->manager->getRepository($this->class);\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Company');\n }", "public static function getInstance()\r\r\n {\r\r\n return Doctrine_Core::getTable('PaqueteUsuario');\r\r\n }", "public function findById(int $id): ?OrmModelInterface\n {\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Ordered');\n }", "protected function entityManager() {\n\t\treturn $this->serviceLocator->get('Doctrine\\ORM\\EntityManager');\n\t}", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Default_Model_Doctrine_Service');\n }", "public static function getEntityManager()\n {\n $factory = new \\Source44\\Doctrine\\Factory();\n return $factory->createEntityManager();\n }", "public function getInstanceDao()\n {\n if (!is_object($this->dao)) {\n $this->dao = new Ticket($this->db);\n }\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Proyecto');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Proyecto');\n }", "public function getRepository() : RepositoryInterface {\n\n if(null === $this->repository) {\n\n $quizModuleService = new ModuleService(new Meta(), new View());\n $this->repository = new Repository($this->getConfig(), $quizModuleService);\n }\n\n return $this->repository;\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Peticion');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('DevProducto');\n }", "protected function getAdapterMetadataRepo()\n {\n return $this->em->getRepository(AdapterMetadata::class);\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Producto');\n }", "function getDaoObject() {\r\n\t\treturn $this->getOptionsSet()->getOptions(self::OPTION_DAO_OBJECT);\r\n\t}", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Companies_Model_Company');\n }", "private function _generateDao($table)\n {\n $this->_getLogger()->debug(\n 'Generating DAO class for table \"' . $table . '\"'\n );\n \t\n if (!isset($this->_schema[$table])) {\n throw new ZendExt_Tool_Generator_Exception(\n 'The asked table does not exists (' . $table . ')'\n );\n }\n\n $className = $this->_getClassName($this->_opts->namespace, $table);\n $name = $this->_getPascalCase($table);\n\n $class = new Zend_CodeGenerator_Php_Class();\n $class->setName($className)\n ->setExtendedClass('ZendExt_Db_Dao_Abstract')\n ->setProperty(\n array(\n 'name' => '_tableClass',\n 'visibility' => 'protected',\n 'defaultValue' => $this->_getClassName(\n $this->_opts->tablenamespace,\n $name\n )\n )\n )\n ->setMethod(\n array(\n 'name' => '__construct',\n 'docblock' => new Zend_CodeGenerator_Php_Docblock(\n array(\n 'shortDescription' => 'DAO for ' . $name,\n 'tags' => array(\n new Zend_CodeGenerator_Php_Docblock_Tag_Return(\n array('datatype' => 'ZendExt_Db_Dao_Abstract') // TODO : Constantes?\n )\n )\n )\n ),\n 'body' => $this->_generateConstructBody($name)\n )\n );\n\n $desc = ucfirst($table) . ' DAO.';\n $doc = $this->_generateClassDocblock($desc, $className);\n\n $class->setDocblock($doc);\n $file = new Zend_CodeGenerator_Php_File();\n\n $file->setClass($class);\n $file->setDocblock($this->_generateFileDocblock($desc, $className));\n\n $this->_saveFile($file->generate(), $className);\n \n }", "public static function create()\n {\n $isDevMode = true;\n $proxyDir = null;\n $cache = null;\n $useSimpleAnnotationReader = false;\n $config = Setup::createAnnotationMetadataConfiguration([__DIR__ . \"/../\"], $isDevMode, $proxyDir, $cache, $useSimpleAnnotationReader);\n // or if you prefer yaml or XML\n //$config = Setup::createXMLMetadataConfiguration(array(__DIR__.\"/config/xml\"), $isDevMode);\n //$config = Setup::createYAMLMetadataConfiguration(array(__DIR__.\"/config/yaml\"), $isDevMode);\n\n // database configuration parameters\n $conn = require __DIR__.'/../../config/doctrine.php';\n\n // obtaining the entity manager\n $entityManager = EntityManager::create($conn, $config);\n\n return $entityManager;\n }", "public function getServiceListingDAO($type) {\r\n \r\n // use case statement here\r\n if ($type == 'mysql') {\r\n return new ServiceListingDAOImpl();\r\n } else {\r\n return new ServiceListingDAOImpl();\r\n }\r\n }", "private function getPlatformMock()\n {\n $mockBuilder = $this->getMockBuilder('Doctrine\\DBAL\\Platforms\\MySqlPlatform');\n $mockedMethods = ['getBinaryTypeDeclarationSQL'];\n // MockBuilder::setMethods() was deprecated in favour of MockBuilder::onlyMethods() in PHPUnit v7.5.x\n method_exists($mockBuilder, 'onlyMethods')\n ? $mockBuilder->onlyMethods($mockedMethods)\n : $mockBuilder->setMethods($mockedMethods);\n return $mockBuilder->getMockForAbstractClass();\n }", "protected function getDoctrine()\n {\n $config = $this->getMockAnnotatedConfig();\n $dm = \\Doctrine\\ODM\\MongoDB\\DocumentManager::create(null, $config);\n\n return $this->doctrine = m::mock(array(\n 'getManager' => $dm,\n 'getManagers' => array($dm),\n 'getManagerForClass' => $dm\n ));\n\n // $conn = array(\n // 'driver' => 'pdo_sqlite',\n // 'memory' => true,\n // // 'path' => __DIR__.'/../db.sqlite',\n // );\n\n // $config = $this->getMockAnnotatedConfig();\n // $em = EntityManager::create($conn, $config);\n\n // $entities = array(\n // 'Khepin\\\\Fixture\\\\Entity\\\\Car',\n // 'Khepin\\\\Fixture\\\\Entity\\\\Driver'\n // );\n\n // $schema = array_map(function($class) use ($em) {\n // return $em->getClassMetadata($class);\n // }, $entities);\n\n // $schemaTool = new SchemaTool($em);\n // $schemaTool->dropSchema(array());\n // $schemaTool->createSchema($schema);\n // return $this->doctrine = m::mock(array(\n // 'getEntityManager' => $em,\n // 'getManager' => $em,\n // )\n // );\n }", "public function getEntityRepository()\n {\n return $this->entityRepository;\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('ServicioPago');\n }", "private function getEntityManagerMock(): EntityManagerInterface\n {\n return $this->createMock(EntityManagerInterface::class);\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('OtraInformacion');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('WebsitePracticeArea');\n }", "public function getConnection()\n {\n $eManager = $this->getServiceLocator();\n $entityManager = $eManager->get('doctObjMngr');\n return $entityManager;\n }", "public static function getInstance()\r\n {\r\n return Doctrine_Core::getTable('order');\r\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Cal');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('HsHrEmployee');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Sesion');\n }", "public function getInterface();", "public function repository()\n {\n return GenreRepositoryInterface::class;\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('PolozkyObj');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Pizarra');\n }", "public static function getInstance(MetaDataConfig $config = null)\n {\n if (false === ($config instanceof MySQLConfig)) {\n throw new \\InvalidArgumentException('Config must be an instance of MySQLConfig');\n }\n\n return new MySQLMetaDataDAO(\n $config->getConnection(),\n $config\n );\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('PsEmployee');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Observation');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Viaje');\n }", "public function getDatabasePlatform()\n {\n if ($this->platform === null) {\n $this->platform = $this->detectDatabasePlatform();\n $this->platform->setEventManager($this->_eventManager);\n }\n\n return $this->platform;\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Cosmetico');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Motivo');\n }", "public static function entityManager($name = 'default')\n {\n if (isset(self::$entityManagers[$name])) {\n return self::$entityManagers[$name];\n }\n $databaseConnection = self::connection($name)->getDbalConnection();\n\n if (Configuration::get('app.env') == 'development') {\n $cache = new ArrayCache();\n } else { // @codeCoverageIgnore\n $cache = new FilesystemCache(Configuration::get('app.cache')); // @codeCoverageIgnore\n }\n\n $config = new \\Doctrine\\ORM\\Configuration();\n $config->setMetadataCacheImpl($cache);\n $driver = $config->newDefaultAnnotationDriver([APPPATH . 'Entity'], false);\n\n $config->setMetadataDriverImpl($driver);\n $config->setQueryCacheImpl($cache);\n\n $proxyDir = APPPATH . 'Proxy';\n $proxyNamespace = 'App\\Proxy';\n\n $config->setProxyDir($proxyDir);\n $config->setProxyNamespace($proxyNamespace);\n Autoloader::register($proxyDir, $proxyNamespace);\n\n $loggerChain = new LoggerChain();\n if (Configuration::get('app.env') == 'development') {\n $config->setAutoGenerateProxyClasses(true);\n\n $loggerChain->addLogger(new DoctrineLogBridge(\\Logger::getInstance()->getMonologInstance()));\n $loggerChain->addLogger(DebugBarHelper::getInstance()->getDebugStack());\n } else { // @codeCoverageIgnore\n $config->setAutoGenerateProxyClasses(false); // @codeCoverageIgnore\n }\n $em = EntityManager::create($databaseConnection, $config);\n\n $em->getConnection()->getConfiguration()->setSQLLogger($loggerChain);\n $em->getConfiguration()->setSQLLogger($loggerChain);\n\n self::$entityManagers[$name] = $em;\n return $em;\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Revista');\n }", "public function repository(): RepositoryContract;", "abstract protected function getDoctrine(): ManagerRegistry;", "public function getSqliteEntityManager()\n {\n $cache = new \\Doctrine\\Common\\Cache\\ArrayCache();\n\n $reader = new AnnotationReader($cache);\n $mappingDriver = new \\Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver($reader, array(\n __DIR__.'/Fixtures/Entity',\n ));\n\n $config = \\Doctrine\\ORM\\Tools\\Setup::createAnnotationMetadataConfiguration(array());\n\n $config->setMetadataDriverImpl($mappingDriver);\n $config->setMetadataCacheImpl($cache);\n $config->setQueryCacheImpl($cache);\n $config->setProxyDir(sys_get_temp_dir());\n $config->setProxyNamespace('Proxy');\n $config->setAutoGenerateProxyClasses(true);\n $config->setClassMetadataFactoryName('Doctrine\\ORM\\Mapping\\ClassMetadataFactory');\n $config->setDefaultRepositoryClassName('Doctrine\\ORM\\EntityRepository');\n\n $conn = array(\n 'driver' => 'pdo_sqlite',\n 'memory' => true,\n );\n\n $em = EntityManager::create($conn, $config);\n\n return $em;\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('comune');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('TbQuestoes');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Floor');\n }", "protected function _dao()\r\n\t\t{\r\n\t\t\t((!is_object($this->_dao)) ? $this->_dao = init_class(DAO_NAME) : '');\r\n\t\t}", "public function getDriver(): PDODriverInterface;", "protected function getDoctrineHydrator()\n {\n return $this->getServiceLocator()\n ->get('HydratorManager')\n ->get('DoctrineModule\\Stdlib\\Hydrator\\DoctrineObject');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Actividad');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Type');\n }", "protected function getMetadataDriverImplementation()\n {\n return new AnnotationDriver(\n $_ENV['annotation_reader'],\n __DIR__.'/../Fixture/Document'\n );\n }", "public function getRepository($className);", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Account');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Parroquia');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('EiScenarioExecutable');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Type_depot');\n }", "public static function getAdaptableClass()\n {\n return DMySQL::class;\n }", "public static function getAdaptableClass()\n {\n return DMySQL::class;\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Imprimante');\n }", "public function getGeneratedInterface() {\n\t\t\treturn 'I'.ucfirst($this->name).'Adapter';\t\n\t\t}", "private function _getDAO(){\n\t\tif(is_null($this->dao)){\n\t\t\t$this->dao = Database::getDAO(self::DAO);\n\t\t}\n\t\treturn true;\n\t}", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Affilateprogram_Model_Doctrine_PartnerOrders');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('AppInfo');\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('Horario_atencion');\n }" ]
[ "0.60435057", "0.5945918", "0.58177453", "0.5735128", "0.5735128", "0.5518975", "0.5481307", "0.54749805", "0.54723626", "0.542795", "0.53897524", "0.53317624", "0.5325224", "0.5289077", "0.5273979", "0.5273979", "0.5273979", "0.52501047", "0.52462065", "0.52458644", "0.5220214", "0.5212758", "0.51781726", "0.5170808", "0.50909287", "0.5077628", "0.50497574", "0.50490195", "0.5047594", "0.5034356", "0.5031432", "0.5021674", "0.50180835", "0.50133383", "0.50073504", "0.5001858", "0.49886933", "0.49865153", "0.49760938", "0.49755505", "0.49755505", "0.49700674", "0.4958874", "0.49452302", "0.4937682", "0.4935399", "0.49332994", "0.4926149", "0.4915179", "0.49145228", "0.49015734", "0.4898176", "0.48913506", "0.48844832", "0.4880657", "0.48722234", "0.48690093", "0.4866197", "0.48655158", "0.4861333", "0.48588136", "0.48529723", "0.48481527", "0.483932", "0.48317885", "0.48164707", "0.48116434", "0.48099875", "0.4807544", "0.48069897", "0.48042756", "0.47940803", "0.47922567", "0.4782465", "0.47802165", "0.47664022", "0.47656456", "0.47643283", "0.47602502", "0.47560948", "0.47535554", "0.47491255", "0.47468954", "0.4746189", "0.4743345", "0.47408777", "0.4736714", "0.47342017", "0.47303414", "0.4729741", "0.47280446", "0.47252038", "0.4711569", "0.47046068", "0.47046068", "0.4703479", "0.46985388", "0.46935707", "0.46919787", "0.46911067", "0.46908703" ]
0.0
-1
Gets the security token. This is the authentication object, not the user entity. The symfony 1 equivalent is the myUser class (which is an sfUser)
public function getToken() { return $this->controller->getToken(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSecurityToken()\n {\n return $this->token;\n }", "public function getUser()\n {\n if (null === $token = $this->securityContext->getToken()) {\n return;\n }\n\n if (!is_object($user = $token->getUser())) {\n return;\n }\n\n return $user;\n }", "public function getUser()\n {\n if (!$this->stokenStorage) {\n throw new \\LogicException('The SecurityBundle is not registered in your application.');\n }\n\n if (null === $token = $this->stokenStorage->getToken()) {\n return;\n }\n\n if (!is_object($user = $token->getUser())) {\n // e.g. anonymous authentication\n return;\n }\n\n return $user;\n }", "protected function getSecurityToken() {\n\t\treturn new \\SecurityToken(self::SECURITY_TOKEN_NAME);\n\t}", "public function getToken()\n {\n return $this->getApplication()->getSecurityContext()->getToken();\n }", "public static function getSecurityToken()\n {\n return Utilities::getSecurityToken();\n }", "public function getUser()\n {\n if (!$this->security) {\n throw new \\LogicException('The SecurityBundle is not registered in your application.');\n }\n\n if (null === $token = $this->security->getToken()) {\n return;\n }\n\n if (!is_object($user = $token->getUser())) {\n return;\n }\n\n return $user;\n }", "public function getToken()\n {\n return $this->getSecurityContext()->getToken();\n }", "public static function get_token() {\n global $USER;\n $sid = session_id();\n return self::get_token_for_user($USER->id, $sid);\n }", "public function getUser()\n {\n return $this->getToken()->getUser();\n }", "public function getAuthenticatedUser()\n {\n return JWTAuth::parseToken()->authenticate();\n }", "protected function getUser()\n {\n if (!$this->container->has('security.token_storage')) {\n throw new \\LogicException('The SecurityBundle is not registered in your application.');\n }\n\n if (null === $token = $this->container->get('security.token_storage')->getToken()) {\n return;\n }\n\n if (!is_object($user = $token->getUser())) {\n // e.g. anonymous authentication\n return;\n }\n\n return $user;\n }", "public function getAuthenticationToken()\n {\n return $this->authenticationToken;\n }", "public function getSecurityContext();", "public function user()\n {\n\n //Check if the user exists\n if (! is_null($this->user)) {\n return $this->user;\n }\n\n //Retrieve token from request and authenticate\n return $this->getTokenForRequest();\n }", "public function user()\n {\n if (!$this->user) {\n $identifier = $this->getToken();\n $this->user = $this->provider->retrieveByToken($identifier, '');\n }\n return $this->user;\n }", "protected function getUser()\n {\n if (!$this->container->has('security.token_storage')) {\n throw new \\LogicException('The SecurityBundle is not registered in your application. Try running \"composer require symfony/security-bundle\".');\n }\n\n if (null === $token = $this->container->get('security.token_storage')->getToken()) {\n return null;\n }\n\n if (!\\is_object($user = $token->getUser())) {\n // e.g. anonymous authentication\n return null;\n }\n\n return $user;\n }", "private function getAuthenticatedUser()\r\n {\r\n $tokenStorage = $this->container->get('security.token_storage');\r\n return $tokenStorage->getToken()->getUser();\r\n }", "private function getAuthenticatedUser()\r\n {\r\n $tokenStorage = $this->container->get('security.token_storage');\r\n return $tokenStorage->getToken()->getUser();\r\n }", "function getUserFromToken() {\n\t\treturn $this->_storage->loadUserFromToken();\n\t}", "protected function getUser()\n {\n return $this->container->get('security.context')->getToken()->getUser();\n }", "public function user()\n {\n if ($this->user !== null) {\n return $this->user;\n }\n\n try{\n if ($token = $this->handle->getToken()) {\n $this->user = $this->provider->retrieveById($token->getId());\n if(get_class($this->user()) !== $token->getClass()){\n $this->user = null;\n }\n }\n }catch (TokenException $exception){\n\n }\n\n\n return $this->user;\n }", "public function getLoggedUser()\n {\n if (null === $token = $this->securityContext->getToken()) {\n return null;\n }\n\n if (!is_object($user = $token->getUser())) {\n return null;\n }\n\n return $user;\n }", "public function getUserToken()\n {\n return !is_null($this->authToken) ? $this->authToken : $this->cookieHelper->getRequestCookie('auth');\n }", "public function getUser() {\n if (!$token = $this->getToken()) {\n return null;\n }\n\n $user = $token->getUser();\n if (!is_object($user)) {\n return null;\n }\n\n return $user;\n }", "public function getToken()\n {\n // if the user isn't authenticated simply return null\n $services = $this->services;\n if (!$services->get('permissions')->is('authenticated')) {\n return null;\n }\n\n // if we don't have a token; make one\n $session = $services->get('session');\n $container = new SessionContainer(static::CSRF_CONTAINER, $session);\n if (!$container['token']) {\n $session->start();\n $container['token'] = (string) new Uuid;\n $session->writeClose();\n }\n\n return $container['token'];\n }", "public function getApiUser()\n {\n return $this->security->getToken()->getUser()->getUser();\n }", "public function getSecurityToken()\n {\n return ($this->_widgetEditor->getForm() ? $this->_widgetEditor->getForm()->getSecurityToken() : null);\n }", "public function getUtente() {\n $user = null;\n $securityHandler = $this->getSecurityHandler();\n if ($securityHandler !== null) {\n if ($securityHandler->getContainer() === null) {\n $securityHandler->setContainer($this->container);\n }\n $user = $securityHandler->getUser();\n } else {\n $securityContext = $this->get('security.context');\n if ($securityContext !== null) {\n $securityToken = $securityContext->getToken();\n if ($securityToken !== null) {\n $user = $securityToken->getUser();\n }\n }\n }\n return $user;\n }", "public function getAuthenticatedUser()\n {\n try {\n if ( !$user = JWTAuth::parseToken()->authenticate() ) {\n return response()->json(['user_not_found'], 404);\n }\n } catch ( TokenExpiredException $e ) {\n return response()->json(['token_expired'], $e->getStatusCode());\n } catch ( TokenInvalidException $e ) {\n return response()->json(['token_invalid'], $e->getStatusCode());\n } catch ( JWTException $e ) {\n return response()->json(['token_absent'], $e->getStatusCode());\n }\n\n // The token is valid and we have found the user via the sub claim\n return $user;\n }", "public function getAuthenticationTokenContext();", "public function getAuthenticatedUser()\n {\n try {\n\n if (! $user = JWTAuth::parseToken()->authenticate()) {\n return response()->json(['user_not_found'], 404);\n }\n\n } catch (Tymon\\JWTAuth\\Exceptions\\TokenExpiredException $e) {\n\n return response()->json(['token_expired'], $e->getStatusCode());\n\n } catch (Tymon\\JWTAuth\\Exceptions\\TokenInvalidException $e) {\n\n return response()->json(['token_invalid'], $e->getStatusCode());\n\n } catch (Tymon\\JWTAuth\\Exceptions\\JWTException $e) {\n\n return response()->json(['token_absent'], $e->getStatusCode());\n\n }\n\n // El token es correcto y devuelve los datos del usuario\n return $user['original'];\n }", "public function getToken()\n {\n return $this->em\n ->getRepository('InnmindAppBundle:ResourceToken')\n ->findOneBy([\n 'uuid' => $this->token,\n 'uri' => $this->uri\n ]);\n }", "public function userByToken();", "public function getTokenObject() {\n\n\t\treturn $this->TokenObject;\n\t}", "public function getAuthenticatedUser()\n {\n $token = JWTAuth::getToken();\n if (!$token)\n return false;\n\n try {\n $user = JWTAuth::parseToken()->authenticate();\n if (!$user) {\n return response()->json(['user_not_found'], 404);\n }\n\n } catch (Tymon\\JWTAuth\\Exceptions\\TokenExpiredException $e) {\n\n return response()->json(['token_expired'], $e->getStatusCode());\n\n } catch (Tymon\\JWTAuth\\Exceptions\\TokenInvalidException $e) {\n\n return response()->json(['token_invalid'], $e->getStatusCode());\n\n } catch (Tymon\\JWTAuth\\Exceptions\\JWTException $e) {\n\n return response()->json(['token_absent'], $e->getStatusCode());\n\n }\n\n // the token is valid and we have found the user via the sub claim\n return $user;\n }", "protected function getAuthenticatedToken()\n {\n $token = $this->getMock('Symfony\\Component\\Security\\Core\\Authentication\\Token\\TokenInterface');\n\n return $token;\n }", "public function getAuthenticatedUser()\n {\n try {\n\n if (! $user = JWTAuth::parseToken()->authenticate()) {\n return response()->json(['user_not_found'], 404);\n }\n\n } catch (Tymon\\JWTAuth\\Exceptions\\TokenExpiredException $e) {\n\n return response()->json(['token_expired'], $e->getStatusCode());\n\n } catch (Tymon\\JWTAuth\\Exceptions\\TokenInvalidException $e) {\n\n return response()->json(['token_invalid'], $e->getStatusCode());\n\n } catch (Tymon\\JWTAuth\\Exceptions\\JWTException $e) {\n\n return response()->json(['token_absent'], $e->getStatusCode());\n\n }\n\n // the token is valid and we have found the user via the sub claim\n return response()->json(compact('user'));\n }", "public function getOAuthToken()\n {\n return $this->oauthToken->getToken();\n }", "protected function getUser()\n {\n $token = $this->securityContext->getToken();\n if ($token) {\n $user = $token->getUser();\n if ($user instanceof UserInterface) {\n return $user;\n }\n }\n\n return null;\n }", "protected function getToken()\n {\n // We have a stateless app without sessions, so we use the cache to\n // retrieve the temp credentials for man in the middle attack\n // protection\n $key = 'oauth_temp_'.$this->request->input('oauth_token');\n $temp = $this->cache->get($key, '');\n\n return $this->server->getTokenCredentials(\n $temp,\n $this->request->input('oauth_token'),\n $this->request->input('oauth_verifier')\n );\n }", "public function authToken() : ?UserRepository\\TokenInterface\n {\n if (!isset($this->data['auth_token'])) {\n return null;\n }\n\n return new TokenModel(json_decode($this->data['auth_token'], true));\n }", "public function getId()\n {\n return $this->app['security']->getToken()->getUser()->getId();\n }", "public function user()\n {\n return $this->authUserService__();\n }", "public function getUser()\n {\n return $this->getAuth()->getIdentity();\n }", "public function user() {\n\t\tif ( ! is_null($this->user)) return $this->user;\n\t\treturn $this->user = $this->retrieve($this->token);\n\t}", "public function getToken()\n {\n if ($this->token instanceof UsernameToken) {\n return $this->token;\n }\n\n return false;\n }", "function __get_auth_token() {\n\n if ($this->auth_token === null) {\n\n $this->auth_token =\n $this->__create_auth_token($this->email,\n $this->password,\n $this->auth_account_type,\n $this->auth_service);\n\n }\n\n return $this->auth_token;\n\n}", "public function get(TokenInterface $token)\n {\n if (!$token->isAuthenticated()) {\n throw new AuthenticationException('Unable to retrieve user for unauthenticated token');\n }\n\n return new User($token->user(), array('role1', 'role2'), array('right1', 'right2', 'right3'));\n }", "public function getUser()\n {\n return $this->getContext()->getUser();\n }", "protected function getCurrentUser()\n {\n $user = null;\n if (!is_null($this->tokenStorage->getToken())) {\n $user = $this->tokenStorage->getToken()->getUser();\n }\n\n return $user;\n }", "protected function getToken()\n {\n if (!$this->isStateless()) {\n $temp = $this->request->getSession()->get('oauth.temp');\n\n return $this->server->getTokenCredentials(\n $temp, $this->request->get('oauth_token'), $this->request->get('oauth_verifier')\n );\n } else {\n $temp = unserialize($_COOKIE['oauth_temp']);\n\n return $this->server->getTokenCredentials(\n $temp, $this->request->get('oauth_token'), $this->request->get('oauth_verifier')\n );\n }\n }", "public function getAuthenticatedUser()\n {\n try {\n if (! $user = JWTAuth::parseToken()->authenticate()) {\n return response()->json(['Usuario no encontrado'], 404);\n }\n } catch (Tymon\\JWTAuth\\Exceptions\\TokenExpiredException $e) {\n return response()->json(['Token expirado'], 403);\n } catch (Tymon\\JWTAuth\\Exceptions\\TokenInvalidException $e) {\n //return response()->json(['Token invalido'], 403);\n $error = 'Token invalido';\n return response()->json(array(\n 'ERROR' => $error\n ), 403);\n } catch (Tymon\\JWTAuth\\Exceptions\\JWTException $e) {\n return response()->json(['Falta incluir un token'], 401);\n }\n return response()->json(compact('user'));\n }", "public function getLoggedInUser()\n {\n $securityContext = $this->container->get('security.context');\n $consultant = $securityContext->getToken()->getUser();\n return $consultant;\n }", "public function getUser()\n {\n return $this->accessToken->getUser();\n }", "public function auth()\n {\n if ($this->validate()) {\n $token = new Token();\n $token->user_id = $this->getUser()->id;\n $token->generateToken(time() + 3600 * 24);\n\n if ($token->save()) {\n $token::deleteAll(['and', 'user_id = :user_id', ['not in', 'token', $token->token]],\n [':user_id' => $token->user_id]);\n\n return $token;\n }\n }\n\n return null;\n }", "public function getSecurityIdentity()\n {\n return $this->securityIdentity;\n }", "public function obtainCurrentToken(): Token\n {\n if (null === $this->currentToken || ! $this->currentToken->isValid()) {\n $this->currentToken = $this->authenticate();\n }\n return $this->currentToken;\n }", "public function getToken() {\n return $this->token;\n }", "public static function inst()\n {\n if (!self::$inst) {\n self::$inst = new SecurityToken();\n }\n\n return self::$inst;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken() {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getUserWithToken(String $token)\n {\n $user = $this->user::where('api_token', $token)->first();\n\n if (!isset($user)) {\n throw new AuthenticationException();\n }\n return $user;\n }", "public function getToken()\r\n {\r\n return $this->token;\r\n }", "public function getToken()\r\n {\r\n return $this->token;\r\n }", "public function getAuthenticatedUser()\n {\n // get the web-user\n $user = Auth::guard()->user();\n\n // get the api-user\n if(!isset($user) && $user == null) {\n $user = Auth::guard('api')->user();\n }\n return $user;\n }", "public function getAuthenticatedUser()\n {\n $user = $this->securityContext->getToken()->getUser();\n\n if (!$user instanceof UserInterface) {\n throw new AccessDeniedException('The user must be logged in and implement UserInterface');\n }\n\n return $user;\n }", "public function getUser()\n {\n return $this->container->get('user')->getUser();\n }", "public function getToken ()\n {\n return $this->token;\n }", "protected function getUser() :? User {\n\t\t $token = $this->tokenStorage->getToken();\n\n\t\t if ( $token === null ) {\n\t\t\t return $token;\n\t\t }\n\n\t\t $user = $token->getUser();\n\n\t\t if ( ! $user instanceof User ) {\n\t\t\t\t return null;\n\t\t }\n\n\t\t return $user;\n\t }", "public function authenticatedUser()\n {\n try {\n if (!$user = JWTAuth::parseToken()->authenticate()) {\n return response()->json(['user_not_found'], 404);\n }\n } catch (TokenExpiredException $e) {\n return response()->json(['token_expired'], $e->getStatusCode());\n } catch (TokenInvalidException $e) {\n return response()->json(['token_invalid'], $e->getStatusCode());\n } catch (JWTException $e) {\n return response()->json(['token_absent'], $e->getStatusCode());\n }\n // the token is valid and we have found the user via the sub claim\n return response()->json(compact('user'));\n }", "private function getLoggedInUser()\n {\n if (null !== $token = $this->securityContext->getToken()) {\n return $token->getUser();\n }\n\n return null;\n }", "public function getToken(string $userToken): ?Token;", "public static function getToken() {\n return session(\"auth_token\", \"\");\n }", "public function getAuthenticatedUser()\n {\n return response()->json($this->guard('api')->user());\n }", "public function getToken() {\n return $this->accessToken;\n }", "public static function authenticateUsingToken ($token)\n {\n return self::$user = User::findByToken($token);\n }", "private function checkToken()\n {\n\t\ttry {\n\t\t\t$user = JWTAuth::GetJWTUser();\n\t\t\t$this->token = JWTAuth::CheckJWTToken($user->id);\n return $user;\n } catch (\\UnexpectedValueException $e) {\n return $this->sendResponse($e->getMessage());\n }\n }", "public function getAuthUser()\n {\n $user = JWTAuth::authenticate(JWTAuth::getToken());\n\n return response()->json(['user' => $user]);\n }", "public function getToken()\n {\n return $this->accessToken;\n }", "public function getToken() {\n\t\treturn $this->jwt;\n\t}", "public function getToken() {\n\n\t\treturn $this->Token;\n\t}", "public function getToken() {\n\t\treturn $this->_token;\n\t}", "public function getTokenAttribute()\n {\n return JWTAuth::fromUser($this);\n }", "protected function getUser() :? User {\n\t\t$token = $this->tokenStorage->getToken();\n\n\t\tif ( $token === null ) {\n\t\t\treturn $token;\n\t\t}\n\n\t\t$user = $token->getUser();\n\n\t\tif ( ! $user instanceof User ) {\n\t\t\t\treturn null;\n\t\t}\n\n\t\treturn $user;\n\t}", "public function getSessionToken()\n {\n return $this->provider->accessToken;\n }" ]
[ "0.7346638", "0.73238796", "0.7301415", "0.7200625", "0.71047395", "0.7095944", "0.7090677", "0.7042413", "0.6978999", "0.6904979", "0.69046503", "0.6864112", "0.6792402", "0.67580855", "0.6756681", "0.67498076", "0.67440015", "0.6731624", "0.6731624", "0.6679385", "0.66569763", "0.6604583", "0.65920717", "0.6535074", "0.6530887", "0.65284204", "0.64595467", "0.64586407", "0.6437641", "0.643075", "0.6418455", "0.6378838", "0.6336955", "0.63008785", "0.6268967", "0.6216123", "0.6200782", "0.6197636", "0.6144173", "0.61421573", "0.61201155", "0.6098091", "0.60865265", "0.60788697", "0.6077069", "0.60711026", "0.60593677", "0.60574037", "0.6051622", "0.6050815", "0.6044043", "0.6036615", "0.6033826", "0.6026508", "0.60226804", "0.60150766", "0.600034", "0.5997583", "0.59747356", "0.5962862", "0.5962501", "0.5960088", "0.59579784", "0.59579784", "0.59579784", "0.59579784", "0.59579784", "0.59579784", "0.59579784", "0.59579784", "0.59579784", "0.59579784", "0.59579784", "0.59579784", "0.59579784", "0.59579784", "0.59579784", "0.5954823", "0.59501415", "0.59501415", "0.59479207", "0.5935255", "0.5923872", "0.59141093", "0.5910559", "0.59104085", "0.5904577", "0.5896373", "0.58913875", "0.58861685", "0.5886048", "0.58775514", "0.587685", "0.5874411", "0.5870498", "0.5867689", "0.58670723", "0.58635616", "0.58571345", "0.585481", "0.584637" ]
0.0
-1
Gets the user entity. This is an actual model class. The symfony 1 equivalent is sfGuardUser.
public function getUser() { return $this->controller->getUser(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUser() : UserEntity\n\t{\n\t\treturn $this->user;\n\t}", "public function getUser(): UserEntity\n {\n return $this->user;\n }", "public function user() {\n if ($this->User === null)\n $this->User = $this->getEntity(\"User\", $this->get(\"user_id\"));\n return $this->User;\n }", "public function getUserInstance()\n {\n $entity = null;\n\n if ($this instanceof \\User) {\n $entity = $this;\n } elseif ($this instanceof \\PortalUser) {\n $this->setPortalId();\n $entity = $this->getRelated('User');\n } else {\n $entity = $this->getPortalUser()->getRelated('User');\n }\n\n $this->checkJoin($this, $entity);\n\n return $entity;\n }", "public function getClassUser(){\n if (!$this->_classUser instanceof User) {\n $this->_classUser = new User($this);\n }\n return $this->_classUser;\n }", "public function getsfGuardUser()\n {\n if ($sfGuardUser = sfGuardUserPeer::retrieveByPK($this->getCreatedBy()))\n {\n return $sfGuardUser;\n }\n else\n {\n // anonymous\n $sfGuardUser = new sfGuardUser();\n $sfGuardUser->setId(0);\n $sfGuardUser->setUsername('anonymous');\n\n return $sfGuardUser;\n }\n }", "public function getUserObject() {\n\n try {\n\n $user = Doctrine::getTable('User')\n ->find($this->getUserId());\n\n return $user;\n\n } catch (Exception $e) {\n\n throw new Exception($e->getMessage());\n }\n }", "public function getUserEntityClass();", "protected function getUserModel() {\n return new User();\n }", "public function user()\n {\n $this->checkTimeouts();\n\n if (! $this->session->has('socialite_token')) return null;\n if ($this->session->has('google_guard_user')) return $this->session->get('google_guard_user');\n\n try {\n $user = Socialite::driver('google')->userFromToken($this->session->get('socialite_token'));\n } catch (\\Exception $e) {\n }\n\n if (! isset($user) || ! $user) return $this->flushSession();\n\n $userModel = $this->hydrateUserModel($user);\n $this->session->put('google_guard_user', $userModel);\n\n return $userModel;\n }", "public function getUser()\n {\n if (!$this->security) {\n throw new \\LogicException('The SecurityBundle is not registered in your application.');\n }\n\n if (null === $token = $this->security->getToken()) {\n return;\n }\n\n if (!is_object($user = $token->getUser())) {\n return;\n }\n\n return $user;\n }", "public function getUser()\n\t{\n\t\tif ($this->_user === false) {\n\t\t\t$model = User::findIdentityByEmail($this->email);\n\n\t\t\tif ($model and ($model->role == User::ROLE_USER or $model->role == User::ROLE_ADMINISTRATOR)) {\n\t\t\t\t$this->_user = $model;\n\t\t\t}\n\t\t}\n\n\t\treturn $this->_user;\n\t}", "function model()\n {\n return User::class;\n }", "public function getUser() : User\n {\n return $this->user;\n }", "public function getUser(): User\n {\n return $this->user;\n }", "public function getUser()\n {\n if (!$this->stokenStorage) {\n throw new \\LogicException('The SecurityBundle is not registered in your application.');\n }\n\n if (null === $token = $this->stokenStorage->getToken()) {\n return;\n }\n\n if (!is_object($user = $token->getUser())) {\n // e.g. anonymous authentication\n return;\n }\n\n return $user;\n }", "public function model()\n {\n return User::class;\n }", "public function getUser()\n {\n if (null === $token = $this->securityContext->getToken()) {\n return;\n }\n\n if (!is_object($user = $token->getUser())) {\n return;\n }\n\n return $user;\n }", "public function getUserModel()\n {\n return $this->getController()->getServiceLocator()->get('User\\Model\\User');\n }", "public function getIdentity() : ? UserEntity\n {\n return $this->identity;\n }", "protected function getUser()\n {\n if (!$this->container->has('security.token_storage')) {\n throw new \\LogicException('The SecurityBundle is not registered in your application.');\n }\n\n if (null === $token = $this->container->get('security.token_storage')->getToken()) {\n return;\n }\n\n if (!is_object($user = $token->getUser())) {\n // e.g. anonymous authentication\n return;\n }\n\n return $user;\n }", "protected function getUser()\n {\n return $this->user_provider->getHydratedUser();\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function model()\n {\n return User::class;\n }", "public function getUser()\n {\n if (is_null($this->_user)) {\n $this->setUser(new User([\n 'username' => $this->username,\n 'email' => $this->email,\n 'status_id' => Status::STATUS_INACTIVE,\n 'privacity' => $this->privacity\n ]));\n }\n\n return $this->_user;\n }", "protected function getUserModel()\n {\n $config = $this->app->make('config');\n\n if (is_null($guard = $config->get('auth.defaults.guard'))) {\n return null;\n }\n\n if (is_null($provider = $config->get(\"auth.guards.{$guard}.provider\"))) {\n return null;\n }\n\n $model = $config->get(\"auth.providers.{$provider}.model\");\n\n // The standard auth config that ships with Laravel references the\n // Eloquent User model in the above config path. However, users\n // are free to reference anything there - so we check first.\n if (is_subclass_of($model, EloquentModel::class)) {\n return $model;\n }\n }", "public function getGuardUser()\r\n {\r\n if (!$this->user && $id = $this->getAttribute('user_id', null, 'sfGuardSecurityUser'))\r\n {\r\n $this->user = Doctrine_Core::getTable('sfGuardUser')->find($id);\r\n\r\n if (!$this->user)\r\n {\r\n // the user does not exist anymore in the database\r\n $this->signOut();\r\n\r\n throw new sfException('The user does not exist anymore in the database.');\r\n }\r\n }\r\n\r\n return $this->user;\r\n }", "protected function model()\n {\n return User::class;\n }", "public function getModel()\n\t{\n\t\treturn new User;\n\t}", "public function getUser() {\n if ( !$this->user ) {\n $this->user = new User( $this->data->from, $this->proxy );\n }\n return $this->user;\n }", "public function getGuardUser() {\n if (!$this->user && $id = $this->getAttribute('user_id', null, 'sfGuardSecurityUser')) {\n $this->user = Doctrine_Core::getTable('sfGuardUser')->find($id);\n\n if (!$this->user) {\n // the user does not exist anymore in the database\n $this->signOut();\n\n throw new sfException('The user does not exist anymore in the database.');\n }\n }\n\n return $this->user;\n }", "public function getUser() {\r\n\r\n if (self::$user === null)\r\n $this->refreshIdentity();\r\n\r\n return self::$user;\r\n }", "public function getUser()\r\n {\r\n /** @var User $user */\r\n $user = $this->getToken()->getUser();\r\n if (!is_object($user) && is_string($user) && $user == 'anon.') {\r\n $user = new User();\r\n $user->setUsername(\"anon.\");\r\n }\r\n return $user;\r\n }", "public function _getUser()\n {\n $this->selftest();\n return $this->objectUser;\n }", "public function getUser()\n {\n $user = User::find()->byPhone($this->phone)->one();\n\n if ($user == null) {\n $user = new User();\n $user->phone = $this->phone;\n $user->name = $this->name;\n $user->role = User::ROLE_USER;\n\n }\n\n $user->regenerateApiToken();\n $user->code = $this->generateRandomString();\n\n return $user;\n }", "public function getUser() {\n\t\tif (empty($this->user)) {\n\t\t\t$this->user = $this->usersTable->findById($this->userId);\n\t\t}\n\t\t\n\t\treturn $this->user;\n\t}", "public function user()\n {\n return $this->morphTo();\n }", "public function user(){\n\t\treturn $this->belongsto('App\\Entities\\User\\User');\n\t}", "public static function getInstance() {\n return Doctrine_Core::getTable('sfGuardUser');\n }", "public static function getInstance() {\n return Doctrine_Core::getTable('sfGuardUser');\n }", "public function getMorphClass()\n {\n return User::class;\n }", "public function getMorphClass()\n {\n return User::class;\n }", "public function user()\n {\n $user = $this->authService->user();\n if(class_exists($this->userResourceClass)) {\n $this->userResourceClass::withoutWrapping();\n return new $this->userResourceClass($user);\n }\n return $user;\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('sfGuardUser');\n }", "public function resolveUser() {\n $user = User::model()->findByAttributes(array('emailAddress' => $this->email));\n if(!($user instanceof User)){\n $profile = Profile::model()->findByAttributes(array('emailAddress' => $this->email));\n if($profile instanceof Profile) {\n $user = $profile->user;\n }\n }\n return $user;\n }", "public function getMe(): \\Sumrak\\TelegramBot\\Entity\\User\n {\n $response = $this->apiAdapter->call('getMe');\n\n return $this->serializer->deserialize(\n \\Sumrak\\TelegramBot\\Entity\\User::class,\n $response\n );\n }", "public function getUser(): User;", "public function user()\n {\n return new User($this);\n }", "public function getUser()\n {\n if ($this->_user === false) {\n $this->_user = User::findByUsername($this->email);\n }\n return $this->_user;\n }", "function getUser()\n {\n if (empty($this->user_id))\n return $this->_user = null;\n if (empty($this->_user) || $this->_user->user_id != $this->user_id) {\n $this->_user = $this->getDi()->userTable->load($this->user_id);\n }\n return $this->_user;\n }", "public function getUser()\n {\n if ($this->_user === false) {\n $this->_user = self::findOne(['login' => $this->login]);\n if($this->_user[attributes] === null) {\n self::findOne(['email' => $this->login]);\n }\n }\n\n return $this->_user;\n }", "public function view(string $uid): UserEntity\n {\n return $this->userRepository->findByUid($uid);\n }", "public function getUser() {\n\t\treturn $this->getTable('User')->find($this->user_id);\n\t}", "public function User()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->hasOne(User::className(), ['id' => 'userId'])->one();\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('sfGuardUser');\n }", "public function getUser() : object\n {\n $user = new User();\n $user->setDb($this->db);\n $user->find(\"id\", $this->username);\n\n return $user;\n }", "public function user()\n {\n if (!$this->user && ($redaxoUser = $this->getRedaxoUser())) {\n $this->user = $this->retrieveUserByRedaxoUser($redaxoUser);\n }\n\n return $this->user;\n }", "public function user()\n {\n return $this->morphOne(User::class, 'userable');\n }", "public function user()\n {\n return $this->morphOne(User::class, 'userable');\n }", "public function user()\n {\n\n //Check if the user exists\n if (! is_null($this->user)) {\n return $this->user;\n }\n\n //Retrieve token from request and authenticate\n return $this->getTokenForRequest();\n }", "public function getUser()\n {\n if ($this->_user === false) {\n $this->_user = mgcms\\db\\User::find()->andWhere(['or', ['username' => $this->username], ['email' => $this->username]])->one();\n }\n\n return $this->_user;\n }", "public function getUser()\n {\n return $this->hasOne(User::className(), ['id' => 'uid']);\n }", "public static function user() {\n $userClass = config('auth.providers.users.model');\n\n return new $userClass;\n }", "public function index(): UserEntity\n {\n return \\Auth::user();\n }", "public function user()\n {\n if (!$this->user) {\n $identifier = $this->getToken();\n $this->user = $this->provider->retrieveByToken($identifier, '');\n }\n return $this->user;\n }", "public function getUserModel() {\n\t\treturn ($this->isAdmin()) ? Mage::getSingleton('admin/user') : Mage::getSingleton('customer/customer');\n\t}", "public function user()\n {\n // check if user is already loaded, if not, we fetch it from database\n if ($this->_user) {\n return $this->_user;\n } else {\n $users = new Application_Model_DbTable_Users();\n if ($user = $users->findById($this->_user_id)) {\n $this->_user = $user;\n return $user ;\n } else {\n throw new Exception(\"Can't fetch user data\");\n }\n }\n }", "public function getUser()\n {\n return $this->get(self::_USER);\n }", "public function getUser()\n {\n return $this->get(self::_USER);\n }", "public function getUser()\n {\n return $this->get(self::_USER);\n }", "public function getUser()\n {\n return $this->get(self::_USER);\n }", "protected function getUser()\n {\n if ($this->_user === null) {\n $this->_user = User::findIdentity(Yii::$app->user->id);\n }\n\n return $this->_user;\n }", "function model()\n\t{\n\t\treturn \\App\\Models\\User::class;\n\t}", "public static function getUserModel()\n {\n return static::getModel('Users');\n }", "public function getMeProfile(): User\n {\n return $this->service->getAuthUser();\n }", "public function getUser()\n {\n if ($this->user === null) {\n $this->user = Yii::$app->user->getIdentity();\n }\n\n return $this->user;\n }", "public function getUser()\n {\n if (! $this->user) {\n $this->exchange();\n }\n\n return $this->user;\n }", "public function getUser() {\n\t\treturn User::find($this->user_id);\n\t}", "public static function userModel()\n {\n return static::$userModel;\n }", "public function getUser()\n {\n if ($this->user === null) {\n // if we have not already determined this and cached the result.\n $this->user = $this->getUserFromAvailableData();\n }\n\n return $this->user;\n }", "public function getOwner(): User\n {\n return $this->user;\n }" ]
[ "0.7604079", "0.75819194", "0.71282274", "0.68445253", "0.68435377", "0.6757669", "0.67488384", "0.67486906", "0.6693391", "0.6648656", "0.6638227", "0.66067386", "0.66049355", "0.6601123", "0.65321887", "0.65275276", "0.6523886", "0.65090406", "0.64949524", "0.64872485", "0.64586806", "0.6431079", "0.64039004", "0.64039004", "0.64039004", "0.64039004", "0.64039004", "0.64039004", "0.64039004", "0.64039004", "0.64039004", "0.64039004", "0.64039004", "0.64039004", "0.64039004", "0.64039004", "0.64039004", "0.64039004", "0.64039004", "0.64039004", "0.64039004", "0.64039004", "0.64039004", "0.63991636", "0.639739", "0.6393651", "0.6387477", "0.6378838", "0.63686186", "0.63633966", "0.6344004", "0.63259137", "0.6293769", "0.62863034", "0.62721163", "0.6263899", "0.6255063", "0.62473184", "0.623999", "0.6236162", "0.6236162", "0.6222236", "0.6214482", "0.6211083", "0.61990595", "0.6197995", "0.6194784", "0.6193372", "0.61917", "0.619064", "0.6187481", "0.61820793", "0.6166702", "0.61652434", "0.6157521", "0.6154861", "0.61476505", "0.6141795", "0.6141795", "0.61358047", "0.61338085", "0.6131966", "0.6122309", "0.61196125", "0.61184055", "0.6110518", "0.61078817", "0.6100466", "0.6100466", "0.6100466", "0.6100466", "0.6098253", "0.60876125", "0.6084757", "0.60846025", "0.6079841", "0.60795426", "0.6068599", "0.6067992", "0.6062415", "0.6057035" ]
0.0
-1
END TIMESHEET / /
function Waiting( $id ) { $this->getMenu() ; $this->data['id'] = $id ; $this->data['back'] = $this->data['site'] .'/timesheet/waitingApproval'; $this->data['table'] = $this->timesheetModel->getTimesheetActiveStatus($id); $this->load->view('timesheet_waiting_detail',$this->data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function close_timesheet($timesheet)\n\t{\n\t\t$date = Carbon::now();\n\n\t\t$this->CI->timecard_model->timecard_update(\n\t\t\t$timesheet->id,\n\t\t\t$date->format('h'),\n\t\t\t$date->format('i'),\n\t\t\t$date->format('A'),\n\t\t\t$timesheet->user_id\n\t\t);\n\t}", "private function endMonthSpacers()\n\t{\n\t\tif((8 - $this->weekDayNum) >= '1') {\n\t\t\t$this->calWeekDays .= \"\\t\\t<td colspan=\\\"\".(8 - $this->weekDayNum).\"\\\" class=\\\"spacerDays\\\">&nbsp;</td>\\n\";\n\t\t\t$this->outArray['lastday'] = (8 - $this->weekDayNum);\t\t\t\n\t\t}\n\t}", "public function testCreateTimesheet()\n {\n }", "function\tendTable() {\n\n\t\t/**\n\t\t *\n\t\t */\n\t\t$frm\t=\t$this->myDoc->currMasterPage->getFrameByFlowName( \"Auto\") ;\n\t\tfor ( $actRow=$this->myTable->getFirstRow( BRow::RTFooterTE) ; $actRow !== FALSE ; $actRow=$this->myTable->getNextRow()) {\n\t\t\t$this->punchTableRow( $actRow) ;\n\t\t}\n\t\t$frm->currVerPos\t+=\t$this->myTable->currVerPos ;\n\t\t$frm->currVerPos\t+=\t1.5 ;\t\t// now add the height of everythign we have output'\n\n\t\t/**\n\t\t * if there's less than 20 mm on this page\n\t\t *\tgoto next page\n\t\t */\n//\t\t$remHeight\t=\t$frm->skipLine(\t$this->myTablePar) ;\n//\t\tif ( $remHeight < mmToPt( $this->saveZone)) {\n//\t\t\t$this->tableFoot() ;\n//\t\t\t$this->myDoc->newPage() ;\n//\t\t\t$this->tableHead() ;\n//\t\t}\n\t}", "function testTimeSheet()\n{\n\tcreateClient('The Business', '1993-06-20', 'LeRoy', 'Jenkins', '1234567890', '[email protected]', 'The streets', 'Las Vegas', 'NV');\n\n\t//Create Project to assign task\n\tcreateProject('The Business', 'Build Website', 'Build a website for the Business.');\n\tcreateProject('The Business', 'Fix CSS', 'Restyle the website');\n\n\t//Create Tasks\n\tcreateTask('The Business', 'Build Website', 'Start the Project', 'This is the first task for Build Website.');\n\tcreateTask('The Business', 'Build Website', 'Register domain name', 'Reserach webservices and make a good url');\n\tcreateTask('The Business', 'Fix CSS', 'Start the Project', 'Dont be lazy');\n\n\t//Create Developer to record time\n\tcreateEmployee('SE', 'b.zucker', 'Developer', 'bz', 'Brent', 'Zucker', '4045801384', '[email protected]', 'Columbia St', 'Milledgeville', 'GA');\n\n\t//Create TimeSheet Entry\n\tcreateTimeSheet('b.zucker', 'The Business', 'Build Website', 'Start the Project', '2015-03-02 10-30-00', '2015-03-02 15-30-00');\n\t\n\t//prints out timesheet\n\techo \"<h3>TimeSheet</h3>\";\n\ttest(\"SELECT * FROM TimeSheet\");\n\n\t//deletes the timesheet\n\tdeleteTimeSheet('b.zucker', 'The Business', 'Build Website', 'Start the Project', '2015-03-02 10-30-00', '2015-03-02 15-30-00');\n\n\t//deletes the tasks\n\tdeleteTask('The Business', 'Build Website', 'Start the Project');\n\tdeleteTask('The Business', 'Build Website', 'Register domain name');\n\tdeleteTask('The Business', 'Fix CSS', 'Start the Project');\n\n\t//deletes the projects\n\tdeleteProject('The Business', 'Fix CSS');\n\tdeleteProject('The Business', 'Build Website');\n\t\n\t//deletes the client\n\tdeleteClient('The Business');\n\n\t//deletes employee\n\tdeleteEmployee('b.zucker');\n}", "function end_table() {\n if ($this->_cellopen) {\n $this->end_cell();\n }\n // Close any open table rows\n if ($this->_rowopen) {\n $this->end_row();\n }\n ?></table><?php\n echo \"\\n\";\n\n $this->reset_table();\n }", "function Footer(){\n $this->SetY(-12);\n\n $this->Cell(0,5,'Page '.$this->PageNo(),0,0,'L');\n $this->Cell(0,5,iconv( 'UTF-8','cp874','วันที่พิมพ์ :'.date('d').'/'.date('m').'/'.(date('Y')+543)),0,0,\"R\");\n}", "public function register_end()\n {\n echo \"Ended the Action \";\n date_default_timezone_set('Europe/Berlin');\n //Array that keeps the localtime \n $arrayt = localtime();\n //calculates seconds rn for further use\n $timeRN = $arrayt[0] + ($arrayt[1] * 60) + ($arrayt[2] * 60 * 60); //in seconds\n\n $jsondecode = file_get_contents($this->save);\n $decoded = json_decode($jsondecode, true);\n for ($i = 0; $i < count($decoded); $i++) {\n if ($decoded[$i][0]['Endtime'] == NULL) {\n $decoded[$i][0]['Endtime'] = $timeRN;\n $encoded = json_encode($decoded);\n file_put_contents($this->save, $encoded);\n }\n }\n }", "function update_end()\n {\n }", "public function endRun(): void\n {\n $file = $this->getLogDir() . 'timeReport.json';\n $data = is_file($file) ? json_decode(file_get_contents($file), true) : [];\n $data = array_replace($data, $this->timeList);\n file_put_contents($file, json_encode($data, JSON_PRETTY_PRINT));\n }", "public function close_sheet($columns) {\n echo \"</table>\";\n }", "public function sectionEnd() {}", "public function sectionEnd() {}", "public function timeManagement() {\n\t\t$pageTitle = 'Time Management';\n\t\t// $stylesheet = '';\n\n\t\tinclude_once SYSTEM_PATH.'/view/header.php';\n\t\tinclude_once SYSTEM_PATH.'/view/academic-help/time-management.php';\n\t\tinclude_once SYSTEM_PATH.'/view/footer.php';\n\t}", "function Footer()\n {\n $this->SetY(-12);\n $this->SetFont('Arial','B',5); \n $this->Cell(505,10,utf8_decode(\"TI. Fecha de creación: \").date(\"d-m-Y H:i\").\" \".\"Pag \".$this->PageNo(),0,0,'C'); \n }", "function Footer()\n {\n $this->SetY(-12);\n $this->SetFont('Arial','B',5); \n $this->Cell(505,10,utf8_decode(\"TI. Fecha de creación: \").date(\"d-m-Y H:i\").\" \".\"Pag \".$this->PageNo(),0,0,'C'); \n }", "public function close_sheet($columns) {\n echo \"]\";\n }", "function\ttableFoot() {\n\n\t\t/**\n\t\t *\n\t\t */\n\t\t$frm\t=\t$this->myDoc->currMasterPage->getFrameByFlowName( \"Auto\") ;\n\t\tif ( $this->myDoc->pageNr >= 1) {\n\t\t\tfor ( $actRow=$this->myTable->getFirstRow( BRow::RTFooterCT) ; $actRow !== FALSE ; $actRow=$this->myTable->getNextRow()) {\n\t\t\t\tif ( $actRow->isEnabled()) {\n\t\t\t\t\t$this->punchTableRow( $actRow) ;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$frm->currVerPos\t+=\t1.5 ;\t\t// now add the height of everything we have output'\n\t\t}\n\t\tfor ( $actRow=$this->myTable->getFirstRow( BRow::RTFooterPE) ; $actRow !== FALSE ; $actRow=$this->myTable->getNextRow()) {\n\t\t\t$this->punchTableRow( $actRow) ;\n\t\t}\n\t\t$frm->currVerPos\t+=\t1.5 ;\t\t// now add the height of everythign we have output'\n\t}", "public function whereTime() {\n\t\t$pageTitle = 'Where Does Time Go';\n\t\t// $stylesheet = '';\n\n\t\tinclude_once SYSTEM_PATH.'/view/header.php';\n\t\tinclude_once SYSTEM_PATH.'/view/academic-help/tmsub-where-time.php';\n\t\tinclude_once SYSTEM_PATH.'/view/footer.php';\n\t}", "public function Footer()\n {\n $this->SetFont('Arial', 'I', 8);\n $this->SetY(-15);\n $this->Write(4, 'Dokumen ini dicetak secara otomatis menggunakan sistem terkomputerisasi');\n\n $time = \"Dicetak pada tanggal \" . date('d-m-Y H:i:s') . \" WIB\";\n\n $this->SetX(-150);\n $this->Cell(0, 4, $time, 0, 0, 'R');\n }", "function createWorkbook($recordset, $StartDay, $EndDay)\n{\n\n global $objPHPExcel;\n $objPHPExcel->createSheet(1);\n $objPHPExcel->createSheet(2);\n\n $objPHPExcel->getDefaultStyle()->getFont()->setSize(7);\n\n // Set document properties\n $objPHPExcel->getProperties()->setCreator(\"HTC\")\n ->setLastModifiedBy(\"HTC\")\n ->setTitle(\"HTC - State Fair Schedule \" . date(\"Y\"))\n ->setSubject(\"State Fair Schedule \" . date(\"Y\"))\n ->setDescription(\"State Fair Schedule \" . date(\"Y\"));\n\n addHeaders($StartDay, $EndDay);\n addTimes($StartDay,$EndDay);\n // Add some data\n addWorksheetData($recordset);\n\n\n // adding data required for spreadsheet to work properly\n addStaticData();\n\n // Rename worksheet\n $objPHPExcel->setActiveSheetIndex(2)->setTitle('Overnight');\n $objPHPExcel->setActiveSheetIndex(1)->setTitle('Night');\n $objPHPExcel->setActiveSheetIndex(0)->setTitle('Morning');\n\n\n\n $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');\n\n $objWriter->save('../Export/excel/Schedule' . date(\"Y\") . '.xls');\n\n return 'Schedule' . date(\"Y\") . '.xls';\n\n}", "public function _end_block()\n\t{\n\t\t//echo '</table>';\n\t}", "function FooterRR()\n {\n //Posición: a 2 cm del final\n $this->Ln();\n $this->SetY(-12);\n $this->SetFont('Arial','B',6);\n //Número de página\n $this->Cell(190,4,'Sistema de Control de Ventas y Facturacion \"BOUTIQUE DE ZAPATERIA\"','T',0,'L');\n $this->AliasNbPages();\n $this->Cell(0,4,'Pagina '.$this->PageNo(),'T',1,'R');\n }", "public function timeWorkshop() {\n\t\t$pageTitle = 'Time Management Strategies Workshop';\n\t\t// $stylesheet = '';\n\n\t\tinclude_once SYSTEM_PATH.'/view/header.php';\n\t\tinclude_once SYSTEM_PATH.'/view/academic-help/owsub-time.php';\n\t\tinclude_once SYSTEM_PATH.'/view/footer.php';\n\t}", "function end();", "public function testUpdateTimesheet()\n {\n }", "public function timesheetAction()\r\n {\r\n $project = $this->projectService->getProject($this->_getParam('projectid'));\r\n $client = $this->clientService->getClient($this->_getParam('clientid'));\r\n \r\n if (!$project && !$client) {\r\n return;\r\n }\r\n \r\n if ($project) {\r\n $start = date('Y-m-d', strtotime($project->started) - 86400);\r\n $this->view->tasks = $this->projectService->getSummaryTimesheet(null, null, $project->id, null, null, $start, null);\r\n } else {\r\n $start = date('Y-m-d', strtotime($client->created));\r\n $this->view->tasks = $this->projectService->getSummaryTimesheet(null, null, null, $client->id, null, $start, null);\r\n }\r\n\r\n $this->renderRawView('timesheet/ajax-timesheet-summary.php');\r\n }", "function actionbar_end(){\n\techo '</td></tr>';\n\techo '</thead>';\n\techo '</table>';\n\techo '</div>';\n}", "public function Footer(){\n $this->SetFont('Arial','',8);\n $date = new Date();\n $this->SetTextColor(100);\n $this->SetFillColor(245);\n $this->SetY(-10);\n $str = \"Elaborado Por Mercurio\";\n $x = $this->GetStringWidth($str);\n $this->Cell($x+10,5,$str,'T',0,'L');\n $this->Cell(0,5,'Pagina '.$this->PageNo().' de {nb}','T',1,'R');\n }", "public function Footer(){\n // Posición: a 1,5 cm del final\n $this->SetY(-20);\n // Arial italic 8\n $this->AddFont('Futura-Medium');\n $this->SetFont('Futura-Medium','',10);\n $this->SetTextColor(50,50,50);\n // Número de págin\n $this->Cell(3);\n $this->Cell(0,3,utf8_decode('Generado por GetYourGames'),0,0,\"R\");\n $this->Ln(4);\n $this->Cell(3);\n $this->Cell(0,3,utf8_decode(date(\"d-m-Y g:i a\").' - Página ').$this->PageNo(),0,0,\"R\");\n\n }", "protected function end() {\n // must have space after it\n return 'END ';\n }", "public function endCurrentRound(){\n global $tpl, $lng, $ilCtrl, $ilTabs;\n\n $ilTabs->activateTab(\"showCurrentRound\");\n\n $this->object->endCurrentRound();\n $ilCtrl->redirect($this, \"showCurrentRound\");\n }", "public function getDateTimeObjectEnd();", "abstract public function bootEndTabSet();", "public function finish()\n {\n parent::finish();\n \n // this widget must have a parent, and it's subject must be a participant\n if( is_null( $this->parent ) || 'participant' != $this->parent->get_subject() )\n throw new exc\\runtime(\n 'Appointment widget must have a parent with participant as the subject.', __METHOD__ );\n\n $db_participant = new db\\participant( $this->parent->get_record()->id );\n \n // determine the time difference\n $db_address = $db_participant->get_first_address();\n $time_diff = is_null( $db_address ) ? NULL : $db_address->get_time_diff();\n\n // need to add the participant's timezone information as information to the date item\n $site_name = bus\\session::self()->get_site()->name;\n if( is_null( $time_diff ) )\n $note = 'The participant\\'s time zone is not known.';\n else if( 0 == $time_diff )\n $note = sprintf( 'The participant is in the same time zone as the %s site.',\n $site_name );\n else if( 0 < $time_diff )\n $note = sprintf( 'The participant\\'s time zone is %s hours ahead of %s\\'s time.',\n $time_diff,\n $site_name );\n else if( 0 > $time_diff )\n $note = sprintf( 'The participant\\'s time zone is %s hours behind %s\\'s time.',\n abs( $time_diff ),\n $site_name );\n\n $this->add_item( 'datetime', 'datetime', 'Date', $note );\n\n // create enum arrays\n $modifier = new db\\modifier();\n $modifier->where( 'active', '=', true );\n $modifier->order( 'rank' );\n $phones = array();\n foreach( $db_participant->get_phone_list( $modifier ) as $db_phone )\n $phones[$db_phone->id] = $db_phone->rank.\". \".$db_phone->number;\n \n // create the min datetime array\n $start_qnaire_date = $this->parent->get_record()->start_qnaire_date;\n $datetime_limits = !is_null( $start_qnaire_date )\n ? array( 'min_date' => substr( $start_qnaire_date, 0, -9 ) )\n : NULL;\n\n // set the view's items\n $this->set_item( 'participant_id', $this->parent->get_record()->id );\n $this->set_item( 'phone_id', '', false, $phones );\n $this->set_item( 'datetime', '', true, $datetime_limits );\n\n $this->set_variable( \n 'is_supervisor', \n 'supervisor' == bus\\session::self()->get_role()->name );\n\n $this->finish_setting_items();\n }", "function Footer()\n {\n date_default_timezone_set('UTC+1');\n //Date\n $tDate = date('F j, Y, g:i:s a');\n // Position at 1.5 cm from bottom\n $this->SetY(-15);\n // Arial italic 8\n $this->SetFont('Arial', 'I', 12);\n // Text color in gray\n $this->SetTextColor(128);\n // Page number\n $this->Cell(0, 10,utf8_decode('Page ' . $this->PageNo().' \n CHUYC \n '.$tDate.'\n +237 693 553 454\n '.$this->Image(SITELOGO, 189, 280, 10, 10,'', URLROOT)), 0, 0, 'L');\n }", "function createHourLogSheet($name, $data, &$workBook, $ambs){\n\t$file = 0;\n\t$excel = 1;\n\n\t$cols = array('Log ID', 'Date', 'Date Logged', 'Ambassador', 'Event Name', 'Hours', 'People', 'Schools', 'Experience', 'Questions', 'Would make your job better', 'Improvements you could make');\n\t$entries = array('id', 'eventDate', 'logTime', 'ambassador', 'eventName', 'hours', 'peopleInteracted', 'otherSchools', 'experience', 'questions', 'madeJobBetter', 'improvements');\n\n\t$numSemesterTours = count($data);\n\tif($excel)\n\t\t$tourSheet = & $workBook->add_worksheet($name. ' Hours');\n\tif($file)\n\t\tfwrite($f, \"\\nWorksheet: $name Tours\\n\");\n\t$numCols = count($cols);\n\n\t//Set the column widths\n\tfor($col = 0; $col < $numCols; $col++){\n\t\t$colName = $cols[$col];\n\t\t$colRef = $entries[$col];\t\n\t\t$maxWidth = getTextWidth($colName);\n\t\tif($excel)\n\t\t\t$tourSheet->write_string(0, $col, $colName);\n\t\tif($file)\n\t\t\tfwrite($f, \"Row: 0, Col: $col, $colRef: $colName, width:$maxWidth\\t\");\n\n\t\tfor($logNum = 0; $logNum < $numSemesterTours; $logNum++){\n\t\t\t$text = $data[$logNum][$colRef];\n\t\t\tif($colRef == 'ambassador')\n\t\t\t{\n\t\t\t\t$text = $ambs[\"$text\"]['name'];\n\t\t\t}\n\t\t\t$width = getTextWidth($text);\n\t\t\tif($width > $maxWidth){\n\t\t\t\t$maxWidth = $width;\n\t\t\t}\n\t\t\t/*\n\t\t\t //formats do not work at the moment\n\t\t\t if($col == 0){\n\t\t\t\t$tourSheet->set_row($logNum + 1, NULL, $formatOffset + ($tour % 2));\n\t\t\t}\n\t\t\t*/\n\t\t}\n\t\tif($file)\n\t\t\tfwrite($f, \"\\n\");\n\t\tif($excel)\n\t\t\t$tourSheet->set_column($col, $col, $maxWidth * (2.0/3.0));\n\t}\n\n\t//Now we just add all the logs to the right page\n\tfor($col = 0; $col < $numCols; $col++){\n\t\t$colRef = $entries[$col];\n\t\tfor($logNum = 0; $logNum < $numSemesterTours; $logNum++){\n\t\t\t$text = $data[$logNum][$colRef];\n\t\t\tif($colRef == 'ambassador')\n\t\t\t{\n\t\t\t\t$text = $ambs[\"$text\"]['name'];\n\t\t\t}\n if(is_numeric($text)){\n \tif ($colRef == 'hours') {\n $tourSheet->write_number($logNum + 1, $col, floatval($text));\n }\n else {\n\t\t\t\t $tourSheet->write_number($logNum + 1, $col, intval($text));\n }\n\t\t\t} else {\n\t\t\t\t$tourSheet->write_string($logNum + 1, $col, $text);\n\t\t\t}\n\t\t}\n\t}\n}", "private function add_events()\r\n {\r\n $events = $this->events;\r\n foreach ($events as $time => $items)\r\n {\r\n $column = date('H', $time) / $this->hour_step + 1;\r\n foreach ($items as $item)\r\n {\r\n $content = $item['content'];\r\n $row = $item['index'] + 1;\r\n \r\n $cell_content = $this->getCellContents($row, $column);\r\n $cell_content .= $content;\r\n $this->setCellContents($row, $column, $cell_content);\r\n }\r\n }\r\n \r\n }", "function endTable()\n {\n if (! $this->tableIsOpen)\n die('ERROR: TABLE IS NOT STARTED');\n \n $this->documentBuffer .= \"</table>\\n\";\n \n $this->tableIsOpen = false;\n $this->tableLastRow = 0;\n }", "public function createAppointmentEndTime()\n {\n $dateTime = strtotime(\"+\" . $this->getEndTimeslot()->getWeight() * 900 . \" seconds\", $this->getAppointmentDate()->format('U'));\n $currentDateTime = new \\DateTime();\n $currentDateTime->setTimestamp($dateTime);\n $this->setHiddenAppointmentEndTime($currentDateTime);\n return;\n }", "public function endMaintenancePeriod() : void\n {\n $this->getHesAdminDb()->update('\n UPDATE maintenance_periods SET end_time = now() WHERE end_time IS NULL\n ');\n }", "public function hasEndtime(){\n return $this->_has(8);\n }", "Public function end()\n\t{\n\t\t$this->endTimer = microtime(TRUE);\n\t}", "public function end(): void\n {\n }", "function doc_end () {\r\n\t}", "public function getEnd() {}", "public function endRoundStart() {\n\t\t$this->displayTeamScoreWidget(false);\n\t}", "function Footer(){\n\t\t$this->Cell(190,0,'','T',1,'',true);\n\t\t\n\t\t//Go to 1.5 cm from bottom\n\t\t$this->SetY(-15);\n\t\t\t\t\n\t\t$this->SetFont('Arial','',8);\n\t\t\n\t\t//width = 0 means the cell is extended up to the right margin\n\t\t$this->Cell(0,10,'Page '.$this->PageNo().\" / {pages}\",0,0,'C');\n\t}", "function mkMonthFoot(){\nreturn \"</table>\\n\";\n}", "abstract public function bootEndTab();", "public function ga_calendar_time_slots()\n {\n // Timezone\n $timezone = ga_time_zone();\n\n // Service & Provider ID\n $current_date = isset($_POST['current_month']) ? esc_html($_POST['current_month']) : '';\n $service_id = isset($_POST['service_id']) ? (int) $_POST['service_id'] : 0;\n $provider_id = isset($_POST['provider_id']) && 'ga_providers' == get_post_type($_POST['provider_id']) ? (int) $_POST['provider_id'] : 0;\n $form_id = isset($_POST['form_id']) ? (int) $_POST['form_id'] : 0;\n\n if ('ga_services' == get_post_type($service_id) && ga_valid_date_format($current_date)) {\n # ok\n } else {\n wp_die('Something went wrong.');\n }\n\n // Date Caption\n $date = new DateTime($current_date, new DateTimeZone($timezone));\n\n // Generate Slots\n $ga_calendar = new GA_Calendar($form_id, $date->format('n'), $date->format('Y'), $service_id, $provider_id);\n echo $ga_calendar->calendar_time_slots($date);\n wp_die();\n }", "function table_end(){\n\techo '</table>';\n}", "function eo_the_end($format='d-m-Y',$id=''){\n\techo eo_get_the_end($format,$id);\n}", "function Footer()\n\t{\n\t\t$this->SetY(-15);\n\t\t// Select Arial italic B\n\t\t$this->setfont('Arial','I',14);\n\t\t$this->cell(250,8,\"Proyecto Final, copyright &copy; 2019\",0,0,'c');\n\t\t// Print centered page numbre\n\t\t$this->Cell(0,10,'Pag.'.$this->PageNo(),0,0,'c');\n\t}", "function tablecell_close() {\n $this->doc .= '</td>';\n }", "public function Footer(){\n $this->SetY(-15);\n $this->SetFont('Arial','I',6);\n $this->Cell(0,5,'\"ESTA FACTURA CONTRIBUYE AL DESARROLLO DEL PAIS, EL USO ILICITO DE ESTA SERA SANCIONADO DE ACUERDO A LEY\"',0,0,'C');\n $this->Ln(5);\n $this->Cell(0,5,'Ley No 453: Tienes derecho a un trato equitativo sin discriminacion en la oferta de servicios.',0,0,'C');\n }", "private function endLap() {\n $lapCount = count( $this->laps ) - 1;\n if ( count( $this->laps ) > 0 ) {\n $this->laps[$lapCount]['end'] = $this->getCurrentTime();\n $this->laps[$lapCount]['total'] = $this->laps[$lapCount]['end'] - $this->laps[$lapCount]['start'];\n }\n }", "public function get_endtime()\n {\n }", "public function getEnd();", "function close() {\n\n if($this->time_start)\n $this->prn(\"\\nTime spent: \"\n .$this->endTimer().\" seconds\");\n\n if($this->format != \"plain\") \n $this->prn(\"\\n======================= \"\n .\"end logrecord ============================\\n\");\n\n $this->quit();\n }", "public function endTabs() {\n\t\t\treturn \"\"; \n\t\t}", "public function end();", "public function end();", "public function end();", "public function end();", "public function end()\n {\n }", "function Footer(){\n ($this->kriteria=='neraca')?$this->SetY(-10):$this->SetY(-15);\n //Arial italic 8\n $this->SetFont('Arial','i',7);\n if($this->kriteria=='faktur'){\n $this->Cell(150,10,'Berlaku sebagai faktur pajak sesuai Peraturan Menkeu No. 38/PMK.03/2010',0,0,'L');\n }else{\n $this->Cell(0,10,'Print Date :'.date('d F Y'),0,0,'C');\n }\n $this->Cell(0,10,'Page '.$this->PageNo().' of {nb}',0,0,'R');\n}", "function Footer()\n {\n //$year = date('Y');\n //$footertext = sprintf($this->xfootertext, '');\n $this->SetY(-15);\n //$this->SetFont('', '', 5);\n //$this->SetTextColor(0, 0, 0);\n //$this->SetFont($this->xfooterfont,'',$this->xfooterfontsize);\n $this->writeHTML($this->xfootertext, true, false, true, false, '');\n //$this->Cell(0,8, $footertext,'T',3,'L');\n }", "function stats_end(){\n echo \"</table>\\n\";\n echo \"</TD></TR></TABLE>\\n\";\n echo \"</TD></TR></TABLE></CENTER>\\n\";\n echo \"<BR>\\n\";\n}", "function Footer()\n{\n $this->SetY(-15);\n //Select Arial italic 8\n\t$this->Cell(0,10,' '.$this->PageNo(),0,0,'R');\n}", "public function index() {\n $currentDate = (new Datetime())->format('Y-m-d');\n \t$timesheets = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->get();\n \t$schedule = Schedule::whereDate('start_date','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->get();\n \t//Get total time worked\n \t$hours = 0;\n \tforeach ($timesheets as $timesheet) {\n\t \t$date1 = new Datetime($timesheet->start_time);\n\t\t\t$date2 = new Datetime($timesheet->end_time);\n\t\t\t$diff = $date2->diff($date1);\n\n $hours = $hours + (($diff->h * 60) + $diff->i);\n \t}\n //Get total breaks\n $breaks = 0;\n $first_timesheet = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->first();\n $last_timesheet = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->latest()->first();\n if($first_timesheet){\n $date1 = new Datetime($first_timesheet->start_time);\n $date2 = new Datetime($last_timesheet->end_time);\n $diff = $date2->diff($date1);\n $breaks = (($diff->h * 60) + $diff->i) - $hours;\n }\n\n $worked = $this->hoursandmins($hours);\n $breaks = $this->hoursandmins($breaks);\n // First Punch In in current day\n $first_punch_in = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->first();\n return view('attendance/index', ['timesheets'=>$timesheets, 'schedule'=>$schedule, 'first_punch_in'=>$first_punch_in, 'worked'=>$worked, 'breaks'=>$breaks, 'first_timesheet'=>$first_timesheet, 'last_timesheet'=>$last_timesheet]);\n }", "abstract protected function doEnd();", "function Footer()\n\t{\n\t $this->SetY(-15);\n\t //Arial italic 8\n\t $this->SetFont('Arial','I',7);\n\t //Page number\n\t $this->Cell(0,10,utf8_decode('PlatSource © '.date('Y')),0,0,'L');\n\t $this->Cell(0,10,utf8_decode('Página ').$this->PageNo().' de {nb}',0,0,'R');\n\t}", "public function endPage() {}", "function end()\n\t{\n\t\t$this->over = true;\n\t}", "public function end() {}", "public function end() {}", "public function end() {}", "public function footer() {\n\t}", "function Footer()\r\n {\r\n $this->SetY(-15);\r\n //courier italic 8\r\n $this->SetFont('courier','I',8);\r\n //Page number\r\n $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');\r\n $this->SetX(5);\r\n $this->SetFont('courier','I',6);\r\n\r\n $this->Cell(0,10,'Tanggal Cetak : '.date(\"d/m/Y\"),0,0,'L');\r\n $this->SetY($this->GetY()+3);\r\n $this->Cell(0,10,'Cetak Oleh : '.$this->printby,0,0,'L');\r\n }", "function Footer()\n\t{\n\t\t$this->SetY(-13);\n\t\t// Arial italic 8\n\t\t$this->SetFont('Arial','I',8);\n\t\t// Page number\n\t\t$this->Cell(0,10,'Designed by winnie(+254701008108)',0,0,'C');\n\t\t$this->SetY(-18);\n\t\t$this->Cell(0,10,'www.veranevents.com',0,0,'C');\n\t}", "public function ended();", "public function eighth_hour_clockout($timesheet)\n\t{\n\t\t$sent_already = $this->CI->clockout_notifications_model->exists(\n\t\t\t$timesheet->user_id,\n\t\t\t'CLOCKOUT_FIRST_8HOUR_WARNING'\n\t\t);\n\n\t\tif ($sent_already) return false;\n\n\t\t// Send notification to managers\n\t\t$this->CI->cfpslack_library->notify(\n\t\t\tsprintf(\n\t\t\t\t$this->CI->config->item('eighth_hour_5min_clockout'),\n\t\t\t\t$this->CI->user_model->get_name($timesheet->user_id),\n\t\t\t\t$timesheet->workorder_id,\n\t\t\t\t$timesheet->id\n\t\t\t)\n\t\t);\n\n\t\t// SMS the user\n\t\t$this->CI->sms_library->send(\n\t\t\t$timesheet->user_id,\n\t\t\t$this->CI->config->item('eighth_hour_sms'),\n\t\t\t$timesheet->workorder_id\n\t\t);\n\n\t\t// Mark sending\n\t\t$this->CI->clockout_notifications_model->create(\n\t\t\t$timesheet->user_id,\n\t\t\t'CLOCKOUT_FIRST_8HOUR_WARNING',\n\t\t\t$timesheet->id\n\t\t);\n\n\t\treturn true;\n\t}", "function section_end(){\n\techo '</div>';\n\techo '</div>';\n}", "public function addTableFooter() {\n\t\t// auto width\n\t\tforeach ($this->tableParams['auto_width'] as $col)\n\t\t\t$this->xls->getActiveSheet()->getColumnDimensionByColumn($col)->setAutoSize(true);\n\t\t// filter (has to be set for whole range)\n\t\tif (count($this->tableParams['filter']))\n\t\t\t$this->xls->getActiveSheet()->setAutoFilter(PHPExcel_Cell::stringFromColumnIndex($this->tableParams['filter'][0]).($this->tableParams['header_row']).':'.PHPExcel_Cell::stringFromColumnIndex($this->tableParams['filter'][count($this->tableParams['filter']) - 1]).($this->tableParams['header_row'] + $this->tableParams['row_count']));\n\t\t// wrap\n\t\tforeach ($this->tableParams['wrap'] as $col)\n\t\t\t$this->xls->getActiveSheet()->getStyle(PHPExcel_Cell::stringFromColumnIndex($col).($this->tableParams['header_row'] + 1).':'.PHPExcel_Cell::stringFromColumnIndex($col).($this->tableParams['header_row'] + $this->tableParams['row_count']))->getAlignment()->setWrapText(true);\n\t}", "public function end_turn()\n\t{\n\t\t//\t\tpropre a la classe\n\t}", "public function footer()\n {\n }", "function Footer() {\r\n $this->SetY(-15);\r\n // Set font\r\n $this->SetFont('Helvetica', 'I', 12);\r\n // Page number\r\n $this->Cell(0, 10, 'PvMax Summary | Schletter Inc. | (888) 608 - 0234', 0, false, 'C', 0, '', 0, false, 'T', 'M');\r\n}", "public function checkTimeEnd(): bool;", "public function setEndDateTime($timestamp);", "function weekviewFooter()\n\t {\n\t // Read the hours_lock id\n\t $periodid = $this->m_postvars[\"periodid\"];\n\t $viewdate = $this->m_postvars['viewdate'];\n $viewuser = $this->m_postvars['viewuser'];\n\n\t // If the periodid isnt numeric, then throw an error, no action can be\n // taken so no buttons are added to the footer.\n\t if (!is_numeric($periodid))\n\t {\n\t atkerror(\"Posted periodid isn't numeric\");\n\t return \"\";\n\t }\n\n\t // Retrieve the hours_lock record for the specified periodid\n\t $hourslocknode = &atkGetNode(\"timereg.hours_lock\");\n $hourlocks = $hourslocknode->selectDb(\"hours_lock.id='\".$periodid.\"'\n AND (hours_lock.userid='\".$viewuser.\"'\n OR hours_lock.userid IS NULL)\");\n atk_var_dump($hourlocks);\n\n // Don't display any buttons if there are no hourlocks found\n if (count($hourlocks)==0)\n {\n return \"\";\n }\n\n // Determine the approval status\n $hourlockapproved = ($hourlocks[0][\"approved\"]==1);\n\n $output = '<br />' . sprintf(atktext(\"hours_approve_thestatusofthisperiodis\"), $this->m_lockmode) . \": \";\n if ($hourlockapproved)\n {\n $output.= '<font color=\"#009900\">' . atktext(\"approved\") . '</font><br /><br />';\n }\n else\n {\n $output.= '<font color=\"#ff0000\">' . atktext(\"not_approved_yet\") . '</font><br /><br />';\n }\n\n // Add an approve or disapprove button to the weekview\n\t if (!$hourlockapproved)\n\t {\n\t $output.= atkButton(atktext(\"approve\"),\n dispatch_url(\"timereg.hours_approve\",\"approve\",\n array(\"periodid\"=>$periodid,\n \"viewuser\"=>$viewuser,\n \"viewdate\"=>$viewdate)),\n SESSION_NESTED) . \"&nbsp;&nbsp;\";\n\t }\n\t $output.= atkButton(atktext(\"disapprove\"),\n dispatch_url(\"timereg.hours_approve\",\"disapprove\",\n array(\"periodid\"=>$periodid,\n \"viewuser\"=>$viewuser,\n \"viewdate\"=>$viewdate)),\n SESSION_NESTED);\n\n\t // Return the weekview including button\n\t return $output;\n\t }", "function Footer()\n\t{\n\t\t$this->SetY(-15);\n\t\t// Arial italic 8\n\t\t$this->SetFont('Arial','b',8);\n\t\t\n\t\t$this->Cell(30,1,\"----------------------------------------\",0,0,'C');\n\t\t$this->Cell(210,1,'',0,0);\n\t\t// $this->Cell(30,1,\"----------------------------------------\",0,0,'C');\n\t\t// $this->Cell(50,1,'',0,0);\n\t\t$this->Cell(30,1,\"----------------------------------------\",0,1,'C');\n\t\t\n\t\t$this->Cell(30,4,\"Prepared/Class Teacher\",0,0,'C');\n\t\t// $this->Cell(50,4,'',0,0);\n\t\t// $this->Cell(30,4,\"Controlar of Examination\",0,0,'C');\n\t\t$this->Cell(210,4,'',0,0);\n\t\t$this->Cell(30,4,\"Principal/VP\",0,1,'C');\n\t\t\n\t\t$this->Cell(50,4,date(\"d-m-y h:i:s A\"),0,0,'L');\n\t\t// Page number\n\t\t//$this->Cell(140,4,''.$this->PageNo().'/{nb}',0,0,'C');\n\t}", "function eo_schedule_end($format='d-m-Y',$id=''){\n\techo eo_get_schedule_end($format,$id);\n}", "function cera_grimlock_footer() {\n\t\tdo_action( 'grimlock_prefooter', array(\n\t\t\t'callback' => 'cera_grimlock_prefooter_callback',\n\t\t) );\n\n\t\tdo_action( 'grimlock_footer', array(\n\t\t\t'callback' => 'cera_grimlock_footer_callback',\n\t\t) );\n\t}", "public function close() {\n $time_end = $this->time_end;\n if (!$time_end) {\n $time_end = time();\n }\n $this->time_end = $time_end;\n \n $this->save(); //duration will be calculated on save\n }", "function section_end()\n\t\t{\n\t\t\t$output = '</div>'; // <!--end ace_control-->\n\t\t\t$output .= '<div class=\"ace_clear\"></div>';\n\t\t\t$output .= '</div>'; //<!--end ace_control_container-->\n\t\t\t$output .= '</div>'; //<!--end ace_section-->\n\t\t\treturn $output;\n\t\t}", "function _putDateSchedules0502s($pdf, $font, $date1, $date2, $y) {\n if (!empty($date1)) {\n $y1 = date('Y', strtotime($date1)) - 1988;\n $m1 = date('n', strtotime($date1));\n $d1 = date('j', strtotime($date1));\n\n $pdf->SetFont($font, null, 9, true);\n $pdf->SetXY(32.4, $y);\n $pdf->MultiCell(10, 5, $y1, 0, 'C');\n $pdf->SetXY(41.4, $y);\n $pdf->MultiCell(10, 5, $m1, 0, 'C');\n $pdf->SetXY(49, $y);\n $pdf->MultiCell(10, 5, $d1, 0, 'C');\n }\n\n if (!empty($date2)) {\n $y2 = date('Y', strtotime($date2)) - 1988;\n $m2 = date('n', strtotime($date2));\n $d2 = date('j', strtotime($date2));\n\n $pdf->SetFont($font, null, 9, true);\n $pdf->SetXY(32.4, $y + 3);\n $pdf->MultiCell(10, 5, $y2, 0, 'C');\n $pdf->SetXY(41.4, $y + 3);\n $pdf->MultiCell(10, 5, $m2, 0, 'C');\n $pdf->SetXY(49, $y + 3);\n $pdf->MultiCell(10, 5, $d2, 0, 'C');\n }\n }", "function footer() {\n $this->SetY(-15);\n // Select Arial italic 8\n $this->SetFont('Arial', 'I', 8);\n // Print current and total page numbers\n $this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C');\n }", "public function setEndtime($endtime){\n $this->_endtime = $endtime;\n }", "public function mytimesheet($start = null, $end = null)\n\t{\n\n\t\t$me = (new CommonController)->get_current_user();\n\t\t// $auth = Auth::user();\n\t\t//\n\t\t// $me = DB::table('users')\n\t\t// ->leftJoin( DB::raw('(select Max(Id) as maxid,TargetId from files where Type=\"User\" Group By TargetId) as max'), 'max.TargetId', '=', 'users.Id')\n\t\t// ->leftJoin('files', 'files.Id', '=', DB::raw('max.`maxid` and files.`Type`=\"User\"'))\n\t\t// // ->leftJoin('accesscontrols', 'accesscontrols.UserId', '=', 'users.Id')\n\t\t// ->where('users.Id', '=',$auth -> Id)\n\t\t// ->first();\n\n\t\t// $showleave = DB::table('leaves')\n\t\t// ->leftJoin('leavestatuses', 'leaves.Id', '=', 'leavestatuses.LeaveId')\n\t\t// ->leftJoin('users as applicant', 'leaves.UserId', '=', 'applicant.Id')\n\t\t// ->leftJoin('accesscontrols', 'accesscontrols.UserId', '=', 'applicant.Id')\n\t\t// ->leftJoin('users as approver', 'leavestatuses.UserId', '=', 'approver.Id')\n\t\t// ->select('leaves.Id','applicant.Name','leaves.Leave_Type','leaves.Leave_Term','leaves.Start_Date','leaves.End_Date','leaves.Reason','leaves.created_at as Application_Date','approver.Name as Approver','leavestatuses.Leave_Status as Status','leavestatuses.updated_at as Review_Date','leavestatuses.Comment')\n\t\t// ->where('accesscontrols.Show_Leave_To_Public', '=', 1)\n\t\t// ->orderBy('leaves.Id','desc')\n\t\t// ->get();\n\t\t$d=date('d');\n\n\t\tif ($start==null)\n\t\t{\n\n\t\t\tif($d>=21)\n\t\t\t{\n\n\t\t\t\t$start=date('d-M-Y', strtotime('first day of this month'));\n\t\t\t\t$start = date('d-M-Y', strtotime($start . \" +20 days\"));\n\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\t$start=date('d-M-Y', strtotime('first day of last month'));\n\t\t\t\t$start = date('d-M-Y', strtotime($start . \" +20 days\"));\n\n\t\t\t}\n\t\t}\n\n\t\tif ($end==null)\n\t\t{\n\t\t\tif($d>=21)\n\t\t\t{\n\n\t\t\t\t$end=date('d-M-Y', strtotime('first day of next month'));\n\t\t\t\t$end = date('d-M-Y', strtotime($end . \" +19 days\"));\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\t$end=date('d-M-Y', strtotime('first day of this month'));\n\t\t\t\t$end = date('d-M-Y', strtotime($end . \" +19 days\"));\n\n\t\t\t}\n\n\t\t}\n\n\t\t$mytimesheet = DB::table('timesheets')\n\t\t->select('timesheets.Id','timesheets.UserId','timesheets.Latitude_In','timesheets.Longitude_In','timesheets.Latitude_Out','timesheets.Longitude_Out','timesheets.Date',DB::raw('\"\" as Day'),'holidays.Holiday','timesheets.Site_Name','timesheets.Check_In_Type','leaves.Leave_Type','leavestatuses.Leave_Status',\n\t\t'timesheets.Time_In','timesheets.Time_Out','timesheets.Leader_Member','timesheets.Next_Person','timesheets.State','timesheets.Work_Description','timesheets.Remarks','approver.Name as Approver','timesheetstatuses.Status','leaves.Leave_Type','timesheetstatuses.Comment','timesheetstatuses.updated_at as Updated_At','files.Web_Path')\n\t\t->leftJoin( DB::raw('(select Max(Id) as maxid,TargetId from files where Type=\"Timesheet\" Group By TargetId) as maxfile'), 'maxfile.TargetId', '=', 'timesheets.Id')\n\t\t->leftJoin('files', 'files.Id', '=', DB::raw('maxfile.`maxid` and files.`Type`=\"Timesheet\"'))\n\t\t->leftJoin( DB::raw('(select Max(Id) as maxid,TimesheetId from timesheetstatuses Group By TimesheetId) as max'), 'max.TimesheetId', '=', 'timesheets.Id')\n\t\t->leftJoin('timesheetstatuses', 'timesheetstatuses.Id', '=', DB::raw('max.`maxid`'))\n\t\t->leftJoin('users as approver', 'timesheetstatuses.UserId', '=', 'approver.Id')\n\t\t// ->leftJoin('leaves','leaves.UserId','=',DB::raw('timesheets.Id AND str_to_date(timesheets.Date,\"%d-%M-%Y\") Between str_to_date(leaves.Start_Date,\"%d-%M-%Y\") and str_to_date(leaves.End_Date,\"%d-%M-%Y\")'))\n\t\t->leftJoin('leaves','leaves.UserId','=',DB::raw($me->UserId.' AND str_to_date(timesheets.Date,\"%d-%M-%Y\") Between str_to_date(leaves.Start_Date,\"%d-%M-%Y\") and str_to_date(leaves.End_Date,\"%d-%M-%Y\")'))\n\t\t->leftJoin( DB::raw('(select Max(Id) as maxid,LeaveId from leavestatuses Group By LeaveId) as maxleave'), 'maxleave.LeaveId', '=', 'leaves.Id')\n\t\t->leftJoin('leavestatuses', 'leavestatuses.Id', '=', DB::raw('maxleave.`maxid`'))\n\t\t->leftJoin('holidays',DB::raw('1'),'=',DB::raw('1 AND str_to_date(timesheets.Date,\"%d-%M-%Y\") Between str_to_date(holidays.Start_Date,\"%d-%M-%Y\") and str_to_date(holidays.End_Date,\"%d-%M-%Y\")'))\n\t\t->where('timesheets.UserId', '=', $me->UserId)\n\t\t->where(DB::raw('str_to_date(timesheets.Date,\"%d-%M-%Y\")'), '>=', DB::raw('str_to_date(\"'.$start.'\",\"%d-%M-%Y\")'))\n\t\t->where(DB::raw('str_to_date(timesheets.Date,\"%d-%M-%Y\")'), '<=', DB::raw('str_to_date(\"'.$end.'\",\"%d-%M-%Y\")'))\n\t\t->orderBy('timesheets.Id','desc')\n\t\t->get();\n\n\t\t$user = DB::table('users')->select('users.Id','StaffId','Name','Password','User_Type','Company_Email','Personal_Email','Contact_No_1','Contact_No_2','Nationality','Permanent_Address','Current_Address','Home_Base','DOB','NRIC','Passport_No','Gender','Marital_Status','Position','Emergency_Contact_Person',\n\t\t'Emergency_Contact_No','Emergency_Contact_Relationship','Emergency_Contact_Address','files.Web_Path')\n\t\t// ->leftJoin('files', 'files.TargetId', '=', DB::raw('users.`Id` and files.`Type`=\"User\"'))\n\t\t->leftJoin( DB::raw('(select Max(Id) as maxid,TargetId from files where Type=\"User\" Group By Type,TargetId) as max'), 'max.TargetId', '=', 'users.Id')\n\t\t->leftJoin('files', 'files.Id', '=', DB::raw('max.`maxid` and files.`Type`=\"User\"'))\n\t\t->where('users.Id', '=', $me->UserId)\n\t\t->first();\n\n\t\t$arrDate = array();\n\t\t$arrDate2 = array();\n\t\t$arrInsert = array();\n\n\t\tforeach ($mytimesheet as $timesheet) {\n\t\t\t# code...\n\t\t\tarray_push($arrDate,$timesheet->Date);\n\t\t}\n\n\t\t$startTime = strtotime($start);\n\t\t$endTime = strtotime($end);\n\n\t\t// Loop between timestamps, 1 day at a time\n\t\tdo {\n\n\t\t\t if (!in_array(date('d-M-Y', $startTime),$arrDate))\n\t\t\t {\n\t\t\t\t array_push($arrDate2,date('d-M-Y', $startTime));\n\t\t\t }\n\n\t\t\t $startTime = strtotime('+1 day',$startTime);\n\n\t\t} while ($startTime <= $endTime);\n\n\t\tforeach ($arrDate2 as $date) {\n\t\t\t# code...\n\t\t\tarray_push($arrInsert,array('UserId'=>$me->UserId, 'Date'=> $date, 'updated_at'=>date('Y-m-d H:i:s')));\n\n\t\t}\n\n\t\tDB::table('timesheets')->insert($arrInsert);\n\n\t\t$options= DB::table('options')\n\t\t->whereIn('Table', [\"users\",\"timesheets\"])\n\t\t->orderBy('Table','asc')\n\t\t->orderBy('Option','asc')\n\t\t->get();\n\n // $mytimesheet = DB::table('timesheets')\n // ->leftJoin('users as submitter', 'timesheets.UserId', '=', 'submitter.Id')\n // ->select('timesheets.Id','submitter.Name','timesheets.Timesheet_Name','timesheets.Date','timesheets.Remarks')\n // ->where('timesheets.UserId', '=', $me->UserId)\n\t\t\t// ->orderBy('timesheets.Id','desc')\n // ->get();\n\n\t\t\t// $hierarchy = DB::table('users')\n\t\t\t// ->select('L2.Id as L2Id','L2.Name as L2Name','L2.Timesheet_1st_Approval as L21st','L2.Timesheet_2nd_Approval as L22nd',\n\t\t\t// 'L3.Id as L3Id','L3.Name as L3Name','L3.Timesheet_1st_Approval as L31st','L3.Timesheet_2nd_Approval as L32nd')\n\t\t\t// ->leftJoin(DB::raw(\"(select users.Id,users.Name,users.SuperiorId,accesscontrols.Timesheet_1st_Approval,accesscontrols.Timesheet_2nd_Approval,accesscontrols.Timesheet_Final_Approval from users left join accesscontrols on users.Id=accesscontrols.UserId) as L2\"),'L2.Id','=','users.SuperiorId')\n\t\t\t// ->leftJoin(DB::raw(\"(select users.Id,users.Name,users.SuperiorId,accesscontrols.Timesheet_1st_Approval,accesscontrols.Timesheet_2nd_Approval,accesscontrols.Timesheet_Final_Approval from users left join accesscontrols on users.Id=accesscontrols.UserId) as L3\"),'L3.Id','=','L2.SuperiorId')\n\t\t\t// ->where('users.Id', '=', $me->UserId)\n\t\t\t// ->get();\n\t\t\t//\n\t\t\t// $final = DB::table('users')\n\t\t\t// ->select('users.Id','users.Name')\n\t\t\t// ->leftJoin('accesscontrols', 'accesscontrols.UserId', '=', 'users.Id')\n\t\t\t// ->where('Timesheet_Final_Approval', '=', 1)\n\t\t\t// ->get();\n\n\t\t\treturn view('mytimesheet', ['me' => $me, 'user' =>$user, 'mytimesheet' => $mytimesheet,'start' =>$start,'end'=>$end,'options' =>$options]);\n\n\t\t\t//return view('mytimesheet', ['me' => $me,'showleave' =>$showleave, 'mytimesheet' => $mytimesheet, 'hierarchy' => $hierarchy, 'final' => $final]);\n\n\t}", "function setEndTime($event, $time) {\n Timer::timers($event, array(\n 'stop' => $time, \n 'stopped' => true\n ));\n }" ]
[ "0.65322995", "0.6298868", "0.60511255", "0.6043513", "0.601076", "0.5812151", "0.5717676", "0.5702646", "0.5678614", "0.56716615", "0.5619121", "0.5584026", "0.5584026", "0.5536504", "0.54904646", "0.54904646", "0.5489724", "0.5480168", "0.5474358", "0.5464492", "0.5460504", "0.54585695", "0.5427565", "0.5427244", "0.5424557", "0.53999835", "0.5397317", "0.5386715", "0.53841573", "0.5384091", "0.5382271", "0.5379997", "0.53563786", "0.53561914", "0.5353985", "0.53373104", "0.5323556", "0.5322376", "0.5320435", "0.5312455", "0.53074086", "0.53004843", "0.5286321", "0.52744365", "0.5266576", "0.5261457", "0.5251875", "0.5250977", "0.52463734", "0.5237061", "0.52366596", "0.52234477", "0.5221038", "0.52181244", "0.5217292", "0.5216995", "0.5215886", "0.52123004", "0.51970595", "0.51960117", "0.51885116", "0.51830983", "0.51830983", "0.51830983", "0.51830983", "0.51795065", "0.5172304", "0.51541346", "0.51510185", "0.5143558", "0.51301706", "0.5126703", "0.5124706", "0.5116702", "0.51140094", "0.5109431", "0.5109431", "0.5109431", "0.50938475", "0.50918823", "0.5075051", "0.50722396", "0.5071969", "0.5066839", "0.5062899", "0.5051987", "0.5046849", "0.5039795", "0.50378317", "0.5036104", "0.5033868", "0.50306267", "0.5028336", "0.5027102", "0.50262755", "0.502148", "0.50118566", "0.50085676", "0.50068426", "0.50041056", "0.49974006" ]
0.0
-1
END TIMESHEET WEEKLY VIEW / /
function Approved( $id ) { $this->getMenu() ; $this->data['id'] = $id ; $this->data['back'] = $this->data['site'] .'/timesheet/approvedTimesheet'; $this->data['table'] = $this->timesheetModel->getTimesheetActiveStatus($id); //$this->data['table'] = $this->timesheetModel->getTimesheetActiveStatusX($id); $this->load->view('timesheet_approved_detail',$this->data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function endMonthSpacers()\n\t{\n\t\tif((8 - $this->weekDayNum) >= '1') {\n\t\t\t$this->calWeekDays .= \"\\t\\t<td colspan=\\\"\".(8 - $this->weekDayNum).\"\\\" class=\\\"spacerDays\\\">&nbsp;</td>\\n\";\n\t\t\t$this->outArray['lastday'] = (8 - $this->weekDayNum);\t\t\t\n\t\t}\n\t}", "public static function weekly() {return new ScheduleViewMode(2);}", "function weekviewHeader()\n {\n }", "private static function printWeeks($startDate, $endDate, $formNum, $id)\r\n {\r\n $newDate = self::splitDates($startDate,$endDate);//retrive array of monday dates\r\n $divs =\"\";\r\n $numDates = count($newDate);\r\n if($numDates===0){//no future mondays meaning end date and start date only range of values\r\n $futuredate= new DateTime($startDate);\r\n $startDate= $futuredate->format(\"Y-m-d\");\r\n $displayStart = $futuredate->format(\"M d,Y\");//format date for route get hive\r\n $futuredate= new DateTime($endDate);\r\n $displayEnd= $futuredate->format(\"M d,Y\");\r\n $divs = \"<li class='list-group-item'><a href='viewform?form=\".$formNum. \"&weekStart=\".$startDate.\"&weekEnd=\".\r\n $futuredate->format(\"Y-m-d\").\"&id=\".$id.\"'>\". $displayStart.\r\n \" - \". $displayEnd.\"</a></li>\" . $divs;\r\n } else{//multiple weeks\r\n\r\n //display start day to saturday\r\n $futuredate= new DateTime($startDate);\r\n $startDate = new DateTime($startDate);\r\n $startDate= $startDate->format(\"Y-m-d\");\r\n if($futuredate->format('N')!=1)// if start date does not fall on a monday create first div\r\n {\r\n $displayStart = $futuredate->format(\"M d,Y\");//format date for route get hive\r\n $futuredate= $futuredate->modify('next sunday');\r\n $displayEnd= $futuredate->format(\"M d,Y\");\r\n $divs = \"<li class='list-group-item'><a href='viewform?form=\".$formNum. \"&weekStart=\".$startDate.\"&weekEnd=\".\r\n $futuredate->format(\"Y-m-d\").\"&id=\".$id.\"'>\". $displayStart.\r\n \" - \". $displayEnd.\"</a></li>\" . $divs;\r\n }\r\n //display all but last week\r\n for($i=0; $i<count($newDate)-1; $i++)\r\n {\r\n $futuredate = new DateTime($newDate[$i]);//convert date time object to be converted to next saturday\r\n $displayStart = $futuredate->format(\"M d,Y\");//format date for route get hive\r\n $futuredate->modify('next sunday');//grab saturday of the weeks monday date provided\r\n $futuredate->format(\"Y-m-d\");//format for route get hive\r\n\r\n $displayEnd =$futuredate->format(\"M d,Y\");//format for html example (October 31, 2018)\r\n //put together href utilizing all the information provided\r\n $divs = \"<li class='list-group-item'><a href='viewform?form=\".$formNum. \"&weekStart=\".$newDate[$i].\"&weekEnd=\".\r\n $futuredate->format(\"Y-m-d\").\"&id=\".$id.\"'>\". $displayStart.\r\n \" - \". $displayEnd.\"</a></li>\" . $divs;\r\n }\r\n\r\n //print last week making end date forms end date\r\n $futuredate = new DateTime($newDate[count($newDate)-1]);//convert date time object to be converted to next saturday\r\n $displayStart = $futuredate->format(\"M d,Y\");//format date for route get hive\r\n $futuredate= new DateTime($endDate);//grab saturday of the weeks monday date provided\r\n\r\n $futuredate->format(\"Y-m-d\");//format for route get hive\r\n\r\n $displayEnd =$futuredate->format(\"M d,Y\");//format for html example (October 31, 2018)\r\n //put together href utilizing all the information provided\r\n $divs = \"<li class='list-group-item'><a href='viewform?form=\".$formNum. \"&weekStart=\".$newDate[count($newDate)-1].\"&weekEnd=\".\r\n $futuredate->format(\"Y-m-d\").\"&id=\".$id.\"'>\". $displayStart.\r\n \" - \". $displayEnd.\"</a></li>\" . $divs;\r\n\r\n }\r\n return $divs;\r\n }", "public function indexAction()\r\n {\r\n \tini_set('memory_limit', '64M');\r\n $validFormats = array('weekly');\r\n $format = 'weekly'; // $this->_getParam('format', 'weekly');\r\n \r\n if (!in_array($format, $validFormats)) {\r\n $this->flash('Format not valid');\r\n $this->renderView('error.php');\r\n return;\r\n }\r\n\r\n $reportingOn = 'Dynamic';\r\n \r\n // -1 will mean that by default, just choose all timesheet records\r\n $timesheetid = -1;\r\n\r\n // Okay, so if we were passed in a timesheet, it means we want to view\r\n // the data for that timesheet. However, if that timesheet is locked, \r\n // we want to make sure that the tasks being viewed are ONLY those that\r\n // are found in that locked timesheet.\r\n $timesheet = $this->byId();\r\n\r\n $start = null;\r\n $end = null;\r\n $this->view->showLinks = true;\r\n $cats = array();\r\n\r\n if ($timesheet) {\r\n $this->_setParam('clientid', $timesheet->clientid);\r\n $this->_setParam('projectid', $timesheet->projectid);\r\n if ($timesheet->locked) {\r\n $timesheetid = $timesheet->id;\r\n $reportingOn = $timesheet->title;\r\n } else {\r\n $timesheetid = 0; \r\n $reportingOn = 'Preview: '.$timesheet->title;\r\n }\r\n if (is_array($timesheet->tasktype)) {\r\n \t$cats = $timesheet->tasktype;\r\n } \r\n\r\n $start = date('Y-m-d 00:00:01', strtotime($timesheet->from));\r\n $end = date('Y-m-d 23:59:59', strtotime($timesheet->to)); \r\n $this->view->showLinks = false;\r\n } else if ($this->_getParam('category')){\r\n \t$cats = array($this->_getParam('category'));\r\n }\r\n \r\n \r\n $project = $this->_getParam('projectid') ? $this->byId($this->_getParam('projectid'), 'Project') : null;\r\n\t\t\r\n\t\t$client = null;\r\n\t\tif (!$project) {\r\n \t$client = $this->_getParam('clientid') ? $this->byId($this->_getParam('clientid'), 'Client') : null;\r\n\t\t}\r\n\t\t\r\n $user = $this->_getParam('username') ? $this->userService->getUserByField('username', $this->_getParam('username')) : null;\r\n \r\n\t\t$this->view->user = $user;\r\n\t\t$this->view->project = $project;\r\n\t\t$this->view->client = $client ? $client : ( $project ? $this->byId($project->clientid, 'Client'):null);\r\n\t\t$this->view->category = $this->_getParam('category');\r\n \r\n if (!$start) {\r\n\t // The start date, if not set in the parameters, will be just\r\n\t // the previous monday\r\n\t $start = $this->_getParam('start', $this->calculateDefaultStartDate());\r\n\t // $end = $this->_getParam('end', date('Y-m-d', time()));\r\n\t $end = $this->_getParam('end', date('Y-m-d 23:59:59', strtotime($start) + (6 * 86400)));\r\n }\r\n \r\n // lets normalise the end date to make sure it's of 23:59:59\r\n\t\t$end = date('Y-m-d 23:59:59', strtotime($end));\r\n\r\n $this->view->title = $reportingOn;\r\n \r\n $order = 'endtime desc';\r\n if ($format == 'weekly') {\r\n $order = 'starttime asc';\r\n }\r\n\r\n $this->view->taskInfo = $this->projectService->getTimesheetReport($user, $project, $client, $timesheetid, $start, $end, $cats, $order);\r\n \r\n // get the hierachy for all the tasks in the task info. Make sure to record how 'deep' the hierarchy is too\r\n\t\t$hierarchies = array();\r\n\r\n\t\t$maxHierarchyLength = 0;\r\n\t\tforeach ($this->view->taskInfo as $taskinfo) {\r\n\t\t\tif (!isset($hierarchies[$taskinfo->taskid])) {\r\n\t\t\t\t$task = $this->projectService->getTask($taskinfo->taskid);\r\n\t\t\t\t$taskHierarchy = array();\r\n\t\t\t\tif ($task) {\r\n\t\t\t\t\t$taskHierarchy = $task->getHierarchy();\r\n\t\t\t\t\tif (count($taskHierarchy) > $maxHierarchyLength) {\r\n\t\t\t\t\t\t$maxHierarchyLength = count($taskHierarchy);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$hierarchies[$taskinfo->taskid] = $taskHierarchy;\r\n\t\t\t} \r\n\t\t}\r\n\t\r\n\t\t$this->view->hierarchies = $hierarchies;\r\n\t\t$this->view->maxHierarchyLength = $maxHierarchyLength;\r\n\r\n $this->view->startDate = $start;\r\n $this->view->endDate = $end;\r\n $this->view->params = $this->_getAllParams();\r\n $this->view->dayDivision = za()->getConfig('day_length', 8) / 4; // za()->getConfig('day_division', 2);\r\n $this->view->divisionTolerance = za()->getConfig('division_tolerance', 20);\r\n \r\n $outputformat = $this->_getParam('outputformat');\r\n if ($outputformat == 'csv') {\r\n \t$this->_response->setHeader(\"Content-type\", \"text/csv\");\r\n\t $this->_response->setHeader(\"Content-Disposition\", \"inline; filename=\\\"timesheet.csv\\\"\");\r\n\r\n\t echo $this->renderRawView('timesheet/csv-export.php');\r\n } else {\r\n\t\t\tif ($this->_getParam('_ajax')) {\r\n\t\t\t\t$this->renderRawView('timesheet/'.$format.'-report.php');\r\n\t\t\t} else {\r\n\t\t\t\t$this->renderView('timesheet/'.$format.'-report.php');\r\n\t\t\t}\r\n }\r\n }", "function weekviewFooter()\n\t {\n\t // Read the hours_lock id\n\t $periodid = $this->m_postvars[\"periodid\"];\n\t $viewdate = $this->m_postvars['viewdate'];\n $viewuser = $this->m_postvars['viewuser'];\n\n\t // If the periodid isnt numeric, then throw an error, no action can be\n // taken so no buttons are added to the footer.\n\t if (!is_numeric($periodid))\n\t {\n\t atkerror(\"Posted periodid isn't numeric\");\n\t return \"\";\n\t }\n\n\t // Retrieve the hours_lock record for the specified periodid\n\t $hourslocknode = &atkGetNode(\"timereg.hours_lock\");\n $hourlocks = $hourslocknode->selectDb(\"hours_lock.id='\".$periodid.\"'\n AND (hours_lock.userid='\".$viewuser.\"'\n OR hours_lock.userid IS NULL)\");\n atk_var_dump($hourlocks);\n\n // Don't display any buttons if there are no hourlocks found\n if (count($hourlocks)==0)\n {\n return \"\";\n }\n\n // Determine the approval status\n $hourlockapproved = ($hourlocks[0][\"approved\"]==1);\n\n $output = '<br />' . sprintf(atktext(\"hours_approve_thestatusofthisperiodis\"), $this->m_lockmode) . \": \";\n if ($hourlockapproved)\n {\n $output.= '<font color=\"#009900\">' . atktext(\"approved\") . '</font><br /><br />';\n }\n else\n {\n $output.= '<font color=\"#ff0000\">' . atktext(\"not_approved_yet\") . '</font><br /><br />';\n }\n\n // Add an approve or disapprove button to the weekview\n\t if (!$hourlockapproved)\n\t {\n\t $output.= atkButton(atktext(\"approve\"),\n dispatch_url(\"timereg.hours_approve\",\"approve\",\n array(\"periodid\"=>$periodid,\n \"viewuser\"=>$viewuser,\n \"viewdate\"=>$viewdate)),\n SESSION_NESTED) . \"&nbsp;&nbsp;\";\n\t }\n\t $output.= atkButton(atktext(\"disapprove\"),\n dispatch_url(\"timereg.hours_approve\",\"disapprove\",\n array(\"periodid\"=>$periodid,\n \"viewuser\"=>$viewuser,\n \"viewdate\"=>$viewdate)),\n SESSION_NESTED);\n\n\t // Return the weekview including button\n\t return $output;\n\t }", "private function isWeekend() \n {\n return (date('N') >= 6);\n }", "public function index()\n {\n $user = Auth::user();\n $data['user'] = $user;\n $settings = $user->settings;\n Carbon::setWeekStartsAt(0);\n Carbon::setWeekEndsAt(6);\n\n // TODO: get this from config\n $start_time = '06:30';\n $end_time = '19:30';\n\n $today = new Carbon($this->choose_start);\n $today2 = new Carbon($this->choose_start);\n $today3 = new Carbon($this->choose_start);\n // $today4 = new Carbon($this->choose_start);\n // $today5 = new Carbon($this->choose_start);\n $today6 = new Carbon($this->choose_start);\n\n $data['start'] = $today6->startOfWeek();\n\n $days = array();\n $days_to_add = 7 * ($settings->weeks - 2);\n $end = $today2->startOfWeek()->setDate(\n $today->year,\n $today->month,\n $today->format('d') > 15 ?\n $today3->endOfMonth()->format('d') :\n 15\n )->addDays($days_to_add);\n\n $data['end_of_period'] = $end->copy()->endOfWeek()->format('Y-m-d');\n $data['end'] = $end;\n\n $added_range = false;\n $next_range = array();\n if ((new Carbon)->day >= 13 && (new Carbon)->day <= 15) {\n $added_range = true;\n $next_range['start'] = (new Carbon)->setDate((new Carbon)->year, (new Carbon)->month, 16)->startOfWeek();\n $next_range['start_of_period'] = (new Carbon)->setDate((new Carbon)->year, (new Carbon)->month, 16);\n $next_range['end'] = (new Carbon)->startOfWeek()->setDate((new Carbon)->year, (new Carbon)->month, $today3->endOfMonth()->format('d'));\n $next_range['end_of_period'] = (new Carbon)->startOfWeek()->setDate((new Carbon)->year, (new Carbon)->month, $today3->endOfMonth()->format('d'))->endOfWeek()->format('Y-m-d');\n } elseif ((new Carbon)->day >= 28 && (new Carbon)->day <= 31) {\n $added_range = true;\n $year = (new Carbon)->year + ((new Carbon)->month == 12?1:0); // Set year as next year if this month is December (12)\n $next_range['start'] = (new Carbon)->setDate($year, (new Carbon)->addMonthNoOverflow(1)->format(\"m\"), 1)->startOfWeek();\n $next_range['start_of_period'] = (new Carbon)->setDate($year, (new Carbon)->addMonthNoOverflow(1)->format(\"m\"), 1);\n $next_range['end'] = (new Carbon)->startOfWeek()->setDate($year, (new Carbon)->addMonthNoOverflow(1)->format(\"m\"), 15);\n $next_range['end_of_period'] = (new Carbon)->startOfWeek()->setDate($year, (new Carbon)->addMonthNoOverflow(1)->format(\"m\"), 15)->endOfWeek()->format('Y-m-d');\n }\n\n $data['days_a'] = $this->get_days($data);\n $data['days_b'] = $this->get_days($next_range);\n\n $data['days'] = [__('Su'), __('Mo'), __('Tu'), __('We'), __('Th'), __('Fr'), __('Sa')];\n $time_line = [];\n $time = new Carbon($start_time);\n while ($time->format('H:i') <= $end_time) {\n $time_line[] = $time->format('H:i');\n $time->addMinutes(60);\n }\n $data['time_line'] = $time_line;\n\n $user = auth()->user();\n if (isset($user) && isset($user->settings))\n if ($user->settings->is_admin)\n return view('admin.home');\n else\n return view('home', $data);\n }", "public function dayview()\n\t{\n\t\t$input = JFactory::getApplication()->input;\n\t\t$db = JFactory::getDbo();\n\t\t$view = $this->getView('pbbooking','html');\n\n\t\t$dateparam = $input->get('dateparam',date_create(\"now\",new DateTimeZone(PBBOOKING_TIMEZONE))->format(DATE_ATOM),'string');\n\t\t$view->dateparam = date_create($dateparam,new DateTimezone(PBBOOKING_TIMEZONE));\n\t\t$cals = $db->setQuery('select * from #__pbbooking_cals')->loadObjectList();\n\t\t$config = $db->setQuery('select * from #__pbbooking_config')->loadObject();\n\t\t$opening_hours = json_decode($config->trading_hours,true);\n\t\t$start_time_arr = str_split($opening_hours[(int)$view->dateparam->format('w')]['open_time'],2);\n\t\t$end_time_arr = str_split($opening_hours[(int)$view->dateparam->format('w')]['close_time'],2);\n\n\t\t$view->cals = array();\n\t\t$view->opening_hours = $opening_hours[(int)$view->dateparam->format('w')];\n\t\t$view->day_dt_start = date_create($dateparam,new DateTimezone(PBBOOKING_TIMEZONE));\n\t\t$view->day_dt_end = date_create($dateparam,new DateTimezone(PBBOOKING_TIMEZONE));\n\t\t$view->day_dt_start->setTime($start_time_arr[0],$start_time_arr[1],0);\n\t\t$view->day_dt_end->setTime($end_time_arr[0],$end_time_arr[1],0);\n\t\t$view->config = $config;\n\n\t\t//step back one time slot on $view->day_dt_end\n\t\t$view->dt_last_slot = clone $view->day_dt_end;\n\t\t$view->dt_last_slot->modify('- '.$config->time_increment.' minutes');\n\n\t\tforeach ($cals as $i=>$cal) {\n\t\t\t$view->cals[$i] = new Calendar();\n\t\t\t$view->cals[$i]->loadCalendarFromDbase(array($cal->id)); \n\t\t}\n\n\t\t$view->setLayout('dayview');\n\t\t$view->display();\n\t\t\n\t}", "function spanien_office_hours_formatter_default($vars) {\n $output = '';\n $counter = 0;\n $items = array();\n $first = variable_get('date_first_day', 0); \n $field = field_info_field($vars['field']['field_name']);\n $element = $vars['element'];\n $weekdays = array(0 => t('Sunday'), 1 => t('Monday'), 2 => t('Tuesday'), 3 => t('Wednesday'), 4 => t('Thursday'), 5 => t('Friday'), 6 => t('Saturday') );\n\n foreach (element_children($element) as $key => $arraykey) {\n $item = $element[$arraykey];\n $day = (int)($item['day'] / 2); // Keys are 0+1 for sunday, 2+3 for monday, etc. Each day may have normal hours + extra hours.\n if (isset($day)) {\n $strhrs = _office_hours_mil_to_tf(check_plain($item['starthours'])); \n $endhrs = _office_hours_mil_to_tf(check_plain($item['endhours']));\n if ($field['settings']['hoursformat']) {\n $strhrs = _office_hours_convert_to_ampm($strhrs);\n $endhrs = _office_hours_convert_to_ampm($endhrs);\n }\n $items[$day][] = array('strhrs' => $strhrs, 'endhrs' => $endhrs) ; //we're aggregating hours for days together.\n } \n }\n\n // add the closed days again, to 1) sort by first_day_of_week and 2) toggle show on/off\n foreach ($weekdays as $key => $day) {\n if (!array_key_exists($key, $items)) {\n $items[$key][]= array('closed' => 'closed'); //silly, but we need this as an array because we can't use a string offset later\n }\n }\n ksort($items);\n $items = date_week_days_ordered($items);\n $weekdays = date_week_days_ordered($weekdays);\n\n foreach ($items as $day => $hours) {\n $counter++;\n $dayname = $weekdays[$day];\n $closed = '';\n $regular = '';\n $additional = '';\n if ( isset($hours[0]['closed']) ) {\n if ( !empty($field['settings']['showclosed']) ) { // don't output unnecessary fields\n $closed = '<span class=\"oh-display-hours\">' . t('Closed') . '</span>'; \n }\n }\n else {\n $strhrs1 = $hours[0]['strhrs'];\n $endhrs1 = $hours[0]['endhrs'];\n $regular = '<span class=\"oh-display-hours\">' . $strhrs1 . ' - ' . $endhrs1 . '</span>';\n if (isset($hours[1])) {\n $strhrs2 = $hours[1]['strhrs'];\n $endhrs2 = $hours[1]['endhrs'];\n $additional = '<span class=\"oh-display-sep\">' . t('and') . '</span><span class=\"oh-display-hours\">' . $strhrs2 . ' - ' . $endhrs2 . '</span>';\n } \n }\n\n $output_line = $closed . $regular . $additional ;\n $odd_even = 'odd';\n if ($counter % 2 == 0) {\n $odd_even = 'even';\n }\n if (!empty($output_line)) {\n $output .= '<div class=\"oh-display ' . $odd_even . '\"><span class=\"oh-display-day\">' . $dayname . ':</span> ' . $output_line . '</div>'; \n }\n }\n \n return $output;\n}", "public function timesheetAction()\r\n {\r\n $project = $this->projectService->getProject($this->_getParam('projectid'));\r\n $client = $this->clientService->getClient($this->_getParam('clientid'));\r\n \r\n if (!$project && !$client) {\r\n return;\r\n }\r\n \r\n if ($project) {\r\n $start = date('Y-m-d', strtotime($project->started) - 86400);\r\n $this->view->tasks = $this->projectService->getSummaryTimesheet(null, null, $project->id, null, null, $start, null);\r\n } else {\r\n $start = date('Y-m-d', strtotime($client->created));\r\n $this->view->tasks = $this->projectService->getSummaryTimesheet(null, null, null, $client->id, null, $start, null);\r\n }\r\n\r\n $this->renderRawView('timesheet/ajax-timesheet-summary.php');\r\n }", "private function getWeekDays()\n {\n $time = date('Y-m-d', strtotime($this->year . '-' . $this->month . '-' . $this->day));\n if ($this->view == 'week') {\n $sunday = strtotime('last sunday', strtotime($time . ' +1day'));\n $day = date('j', $sunday);\n $startingDay = date('N', $sunday);\n $cnt = 6;\n }\n if ($this->view == 'day') {\n $day = $this->day;\n $cnt = 0;\n }\n\n $this->week_days = array();\n $mlen = $this->daysMonth[intval($this->month) - 1];\n if ($this->month == 2 && ((($this->year % 4) == 0) && ((($this->year % 100) != 0) || (($this->year % 400) == 0)))) {\n $mlen = $mlen + 1;\n }\n $h = \"<tr class='\" . $this->labelsClass . \"'>\";\n $h .= \"<td>&nbsp;</td>\";\n for ($j = 0; $j <= $cnt; $j++) {\n $cs = $cnt == 0 ? 3 : 1;\n $h .= \"<td colspan='$cs'>\";\n if ($this->view == 'day') {\n $getDayNumber = date('w', strtotime($time));\n } else {\n $getDayNumber = $j;\n }\n if ($day <= $mlen) {\n } else {\n $day = 1;\n }\n $h .= $this->dayLabels[$getDayNumber] . ' ';\n $h .= intval($day);\n $this->week_days[] = $day;\n $day++;\n $h .= \"</td>\";\n }\n\n $h .= \"</tr>\";\n return $h;\n }", "private function buildBodyDay()\n {\n\n $events = $this->events;\n $h = \"\";\n for ($i = $this->start_hour; $i < $this->end_hour; $i++) {\n for ($t = 0; $t < 2; $t++) {\n $h .= \"<tr>\";\n $min = $t == 0 ? \":00\" : \":30\";\n $h .= \"<td class='$this->timeClass'>\" . date('g:ia', strtotime($i . $min)) . \"</td>\";\n for ($k = 0; $k < 1; $k++) {\n $wd = $this->week_days[$k];\n $time_r = $this->year . '-' . $this->month . '-' . $wd . ' ' . $i . ':00:00';\n $min = $t == 0 ? '' : '+30 minute';\n $time_1 = strtotime($time_r . $min);\n $time_2 = strtotime(date('Y-m-d H:i:s', $time_1) . '+30 minute');\n $dt = date('Y-m-d H:i:s', $time_1);\n $h .= \"<td colspan='3' data-datetime='$dt'>\";\n $h .= $this->dateWrap[0];\n\n $hasEvent = false;\n foreach ($events as $key => $event) {\n //EVENT TIME AND DATE\n $time_e = strtotime($key);\n if ($time_e >= $time_1 && $time_e < $time_2) {\n $hasEvent = true;\n $h .= $this->buildEvents(false, $event);\n }\n }\n $h .= !$hasEvent ? '&nbsp;' : '';\n $h .= $this->dateWrap[1];\n $h .= \"</td>\";\n }\n $h .= \"</tr>\";\n }\n }\n $h .= \"</tbody>\";\n $h .= \"</table>\";\n\n $this->html .= $h;\n }", "public function index() {\n $currentDate = (new Datetime())->format('Y-m-d');\n \t$timesheets = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->get();\n \t$schedule = Schedule::whereDate('start_date','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->get();\n \t//Get total time worked\n \t$hours = 0;\n \tforeach ($timesheets as $timesheet) {\n\t \t$date1 = new Datetime($timesheet->start_time);\n\t\t\t$date2 = new Datetime($timesheet->end_time);\n\t\t\t$diff = $date2->diff($date1);\n\n $hours = $hours + (($diff->h * 60) + $diff->i);\n \t}\n //Get total breaks\n $breaks = 0;\n $first_timesheet = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->first();\n $last_timesheet = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->latest()->first();\n if($first_timesheet){\n $date1 = new Datetime($first_timesheet->start_time);\n $date2 = new Datetime($last_timesheet->end_time);\n $diff = $date2->diff($date1);\n $breaks = (($diff->h * 60) + $diff->i) - $hours;\n }\n\n $worked = $this->hoursandmins($hours);\n $breaks = $this->hoursandmins($breaks);\n // First Punch In in current day\n $first_punch_in = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->first();\n return view('attendance/index', ['timesheets'=>$timesheets, 'schedule'=>$schedule, 'first_punch_in'=>$first_punch_in, 'worked'=>$worked, 'breaks'=>$breaks, 'first_timesheet'=>$first_timesheet, 'last_timesheet'=>$last_timesheet]);\n }", "public function isWeekend($date);", "function displayWeeks($list,$task,$level,$fromPeriod,$toPeriod) {\n\n\tif ($fromPeriod==-1) { return \"\"; }\n\n\t$s=new CDate($fromPeriod);\n\t$e=new CDate($toPeriod);\n\t$sw=getBeginWeek($s); \t//intval($s->Format(\"%U\"));\n\t$ew=getEndWeek($e); //intval($e->Format(\"%U\"));\n\n\t$st=new CDate($task->task_start_date);\n\t$et=new CDate($task->task_end_date);\n\t$stw=getBeginWeek($st); //intval($st->Format(\"%U\"));\n\t$etw=getEndWeek($et); //intval($et->Format(\"%U\"));\n\n\t//print \"week from: $stw, to: $etw<br>\\n\";\n\n\t$row=\"\";\n\tfor($i=$sw;$i<=$ew;$i++) {\n\t\tif ($i>=$stw and $i<$etw) {\n\t\t\t$color=\"blue\";\n\t\t\tif ($level==0 and hasChildren($list,$task)) { $color=\"#C0C0FF\"; }\n\t\t\telse if ($level==1 and hasChildren($list,$task)) { $color=\"#9090FF\"; }\n\t\t\t$row.=\"<td nowrap=\\\"nowrap\\\" bgcolor=\\\"$color\\\">\";\n\t\t}\n\t\telse {\n\t\t\t$row.=\"<td nowrap=\\\"nowrap\\\">\";\n\t\t}\n\t\t$row.=\"&#160&#160</td>\";\n\t}\n\nreturn $row;\n}", "function nth_weekly_schedule($action,$id,$start,$end,$day,$non_workdays,$nth_value=1)\n {\n $params = array($start,$end,$day);\n $results = array();\n $this->_where = $this->_where.' AND `cal_day_of_week` = ?';\n switch ($non_workdays){\n case 1:\n $sched_date = 'next_work_day';\n break;\n case 2:\n $sched_date = 'prev_work_day';\n break;\n case 0:\n $sched_date = 'cal_date';\n $this->_where = $this->_where.' AND `cal_is_weekday` = ?';\n array_push($params,1);\n break;\n }\n $sql = 'SELECT `cal_date` AS `report_date`, '.$sched_date.' AS `sched_date`,`cal_is_work_day` FROM `calendar__bank_holiday_offsets` ';\n $sql = $sql.$this->_where;\n \n $query = $this->_db->query($sql,$params);\n //echo $nth_value;\n \n if($query->count()){\n $results = $query->results();\n $results = ($nth_value > 1 || $non_workdays == 0 ? $this->nth_date($results,$nth_value):$results);\n if($action == 'preview') {\n return $results;\n } else if ($action == 'commit') {\n $this->commit_schedule($results,$id);\n }\n }\n }", "public function getIndex()\n\t{\n\t\t\n\t\t//Get the user id of the currently logged in user\n $userId = Sentry::getUser()->id;\n //Current Date\n\t\t$day = date(\"Y-m-d\");\n //Get tasks list for the user\n\t\t$tasks = $this->timesheet->getIndex($userId);\n //Get the entries\n\t\t$entries = $this->timesheet->getEntries($day,$userId);\n //Current Week\n\t\t$week = $this->timesheet->getWeek($day);\n\t\treturn \\View::make('dashboard.timesheet.view')\n\t\t\t\t\t\t->with('week',$week)\n\t\t\t\t\t\t->with('selectedDate',$day)\n\t\t\t\t\t\t->with('entries', $entries)\n\t\t\t\t\t\t->with('tasks',$tasks);\n\t}", "function update_week(){\n\t\t$time = array('id'=>1, 'ending_date' => date('Y-m-d'));\n\t\treturn $this->save($time);\n\t}", "public function skipWeekend()\r\n {\r\n if ($this->getDayOfWeek() == 7)\r\n {\r\n $this->addDay(1);\r\n }\r\n else if ($this->getDayOfWeek() == 6)\r\n {\r\n $this->addDay(2);\r\n }\r\n }", "function get_last_week($end_date) {\n\n //$today = new date('Y-m-d') ;\n //@testing\n $today = '2016-09-16';\n $end_date = ($end_date > $today) ? $today : $end_date;\n return $this->get_week_sat($end_date);\n }", "public function isWeekend()\n {\n return $this->carbon()->isWeekend();\n }", "function SI_getWeeksHits() {\n\tglobal $SI_tables,$tz_offset;\n\t\n\t$dt = strtotime(gmdate(\"j F Y\",time()+(((gmdate('I'))?($tz_offset+1):$tz_offset)*3600)));\n\t$dt = $dt-(3600*2); // The above is off by two hours. Don't know why yet...\n\t\n\t$tmp = \"\";\n\t$dt_start = time();\n\t\n\t$tmp = \"<table cellpadding=\\\"0\\\" cellspacing=\\\"0\\\" border=\\\"0\\\">\\n\";\n\t$tmp .= \"\\t<tr><th colspan=\\\"2\\\">Hits in the last week</th></tr>\\n\";\n\t$tmp .= \"\\t<tr><td class=\\\"accent\\\">Day</td><td class=\\\"accent last\\\">Hits</td></tr>\\n\";\n\t\n\tfor ($i=0; $i<7; $i++) {\n\t\t$dt_stop = $dt_start;\n\t\t$dt_start = $dt - ($i * 60 * 60 * 24);\n\t\t$day = ($i)?gmdate(\"l, j M Y\",$dt_start):\"Today, \".gmdate(\"j M Y\",$dt_start);\n\t\t$query = \"SELECT COUNT(*) AS 'total' FROM $SI_tables[stats] WHERE dt > $dt_start AND dt <=$dt_stop\";\n\t\tif ($result = mysql_query($query)) {\n\t\t\tif ($count = mysql_fetch_array($result)) {\n\t\t\t\t$tmp .= \"\\t<tr><td>$day</td><td class=\\\"last\\\">$count[total]</td></tr>\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t$tmp .= \"</table>\";\n\treturn $tmp;\n\t}", "function MakeCalendarGrid(){\n //get our days\n $intMonthDays = cal_days_in_month(CAL_GREGORIAN, $this->intMonth, $this->intYear);\n $intDayCounter = 0;\n $arrMonthAttributes = array('colspan'=>'7');\n //make our parent calendar table\n $objCalendarParent = $this->objCalendar->AddChildNode($this->objCalendar->objHTML,'', 'table');\n //let's make our header\n $objHeaderRow = $this->objCalendar->AddChildNode($objCalendarParent,'', 'tr');\n //establish our base attributes\n for($intWeekDay=0;$intWeekDay<7;$intWeekDay++){\n $strDay = date('l', strtotime(\"Sunday +{$intWeekDay} days\"));\n $this->objCalendar->AddChildNode($objHeaderRow,$strDay, 'th',array('class'=>'weekday'));\n }\n //get the starting date\n $intMonthStart = date('N', strtotime($this->intYear.'-'.$this->intMonth.'-1'));\n $intMonthStart++;\n //avoid empty rows\n if($intMonthStart == 8)\n $intMonthStart = 1;\n //make our days now\n for($intDay=1;$intDay<($intMonthDays + $intMonthStart);$intDay++){\n $arrDateAttributes = array('onclick'=>'SelectDay(this);');\n if($intDayCounter === 0){\n //make our new week\n $objWeekRow = $this->objCalendar->AddChildNode($objCalendarParent,'', 'tr');\n $arrDateAttributes['class'] = 'calendarday weekend';\n }\n else if($intDayCounter === 6)\n $arrDateAttributes['class'] = 'calendarday weekend';\n else if($intDay == date('j'))\n $arrDateAttributes['class'] = 'calendarday today';\n else\n $arrDateAttributes['class'] = 'calendarday weekday';\n $intDayCounter++;\n //reset our week now\n if($intDayCounter == 7)\n $intDayCounter = 0;\n if($intDay < $intMonthStart){\n unset($arrDateAttributes['onclick']);\n $this->objCalendar->AddChildNode($objWeekRow,'&nbsp;', 'td',$arrDateAttributes);\n continue 1;\n }\n $arrDateAttributes['id'] = ($intDay - ($intMonthStart - 1)).'-'.$this->arrCalendarProperties['calendarid'];\n //make our day now\n $this->objCalendar->AddChildNode($objWeekRow,($intDay - ($intMonthStart - 1)), 'td',$arrDateAttributes);\n }\n return TRUE;\n }", "public function getIsWeekend() {\r\n if(($this->mode == self::$modeDay) && (date('N', $this->timestamp) >= 6)) {\r\n return TRUE;\r\n } \r\n\r\n return FALSE;\r\n }", "function getLast2Weeks($end) {\n $day_week_ago = date(\"Y-m-d\", time() - 60 * 60 * 24 * 15);\n\n $query = \"SELECT date, hour, price FROM np_data WHERE (date BETWEEN '$day_week_ago' AND '$end')\";\n $result = $this->link->query($query);\n if ($result->num_rows == 0) {\n echo \"Error: No results\";\n return;\n }\n while ($row = $result->fetch_array()) {\n $resultStruct['Rows'][$row['hour']]['Columns'][$row['date']]['Value'] = $row['price'];\n }\n /* free result set */\n $result->close();\n return $resultStruct;\n }", "public function week()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$disable = array(\n\t\t\t'categories',\n\t\t\t'category_fields',\n\t\t\t'custom_fields',\n\t\t\t'member_data',\n\t\t\t'pagination',\n\t\t\t'trackbacks'\n\t\t);\n\n\t\t$params = array(\n\t\t\tarray(\n\t\t\t\t'name' => 'category',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'site_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'min_value' => 1,\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'default' => $this->data->get_site_id()\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'calendar_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'calendar_name',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'event_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'event_name',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'event_limit',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'status',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'default' => 'open'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'date_range_start',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'date'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'time_range_start',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'time',\n\t\t\t\t'default' => '0000'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'time_range_end',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'time',\n\t\t\t\t'default' => '2400'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'enable',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'default' => '',\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'allowed_values' => $disable\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'first_day_of_week',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'default' => $this->first_day_of_week\n\t\t\t)\n\t\t);\n\n\t\t//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t// -------------------------------------\n\t\t// Need to modify the starting date?\n\t\t// -------------------------------------\n\n\t\t$this->first_day_of_week = $this->P->value('first_day_of_week');\n\n\t\tif ($this->P->value('date_range_start') === FALSE)\n\t\t{\n\t\t\t$this->P->set('date_range_start', $this->CDT->datetime_array());\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->CDT->change_date(\n\t\t\t\t$this->P->value('date_range_start', 'year'),\n\t\t\t\t$this->P->value('date_range_start', 'month'),\n\t\t\t\t$this->P->value('date_range_start', 'day')\n\t\t\t);\n\t\t}\n\n\t\t$drs_dow = $this->P->value('date_range_start', 'day_of_week');\n\n\t\tif ($drs_dow != $this->first_day_of_week)\n\t\t{\n\t\t\tif ($drs_dow > $this->first_day_of_week)\n\t\t\t{\n\t\t\t\t$offset = ($drs_dow - $this->first_day_of_week);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$offset = (7 - ($this->first_day_of_week - $drs_dow));\n\t\t\t}\n\n\t\t\t$this->P->set('date_range_start', $this->CDT->add_day(-$offset));\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Define parameters specific to this calendar view\n\t\t// -------------------------------------\n\n\t\t$this->CDT->change_ymd($this->P->value('date_range_start', 'ymd'));\n\t\t$this->P->set('date_range_end', $this->CDT->add_day(6));\n\t\t$this->P->set('pad_short_weeks', FALSE);\n\n\t\t// -------------------------------------\n\t\t// Define our tagdata\n\t\t// -------------------------------------\n\n\t\t$find = array(\n\t\t\t'EVENTS_PLACEHOLDER',\n\t\t\t'{/',\n\t\t\t'{',\n\t\t\t'}'\n\t\t);\n\n\t\t$replace = array(\n\t\t\tee()->TMPL->tagdata,\n\t\t\tLD.T_SLASH,\n\t\t\tLD,\n\t\t\tRD\n\t\t);\n\n\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t$find,\n\t\t\t$replace,\n\t\t\t$this->view(\n\t\t\t\t'week.html',\n\t\t\t\tarray(),\n\t\t\t\tTRUE,\n\t\t\t\t$this->sc->addon_theme_path . 'templates/week.html'\n\t\t\t)\n\t\t);\n\n\t\t// -------------------------------------\n\t\t// Tell TMPL what we're up to\n\t\t// -------------------------------------\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'events'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['events'] = TRUE;\n\t\t}\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'display_each_hour'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['display_each_hour'] = TRUE;\n\t\t}\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'display_each_day'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['display_each_day'] = TRUE;\n\t\t}\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'display_each_week'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['display_each_week'] = TRUE;\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// If you build it, they will know what's going on.\n\t\t// -------------------------------------\n\n\t\t$this->parent_method = __FUNCTION__;\n\n\t\treturn $this->build_calendar();\n\t}", "public function isWeekend($date) {\r\n $weekDay = date('w', strtotime($date));\r\n return ($weekDay == 0 || $weekDay == 6);\r\n}", "public function index($view='week',$ref_datetime=false){\n\n $view = strtolower($view);\n\n if(!in_array($view,array('day','week','month','list'))){\n $this->_setFlash('Invalid view specified.');\n return $this->redirect($this->referer(array('action' => 'index')));\n }\n\n if($ref_datetime === false)\n $ref_datetime = time();\n\n $start_datetime = false;\n $end_datetime = false;\n $viewDescription = false;\n\n //Adjust start date/time based on the current reference time\n if($view == 'day'){\n $start_datetime = strtotime('today midnight', $ref_datetime);\n $end_datetime = strtotime('tomorrow midnight', $start_datetime);\n $previous_datetime = strtotime('yesterday midnight', $start_datetime);\n $next_datetime = $end_datetime;\n $viewDescription = date('M, D j',$start_datetime);\n }\n elseif($view == 'week') {\n $start_datetime = strtotime('Monday this week', $ref_datetime);\n $end_datetime = strtotime('Monday next week', $start_datetime);\n $previous_datetime = strtotime('Monday last week', $start_datetime);\n $next_datetime = $end_datetime;\n $viewDescription = date('M j', $start_datetime) . \" - \" . date('M j', $end_datetime-1);\n }\n elseif($view == 'month') {\n $start_datetime = strtotime('first day of this month', $ref_datetime);\n $end_datetime = strtotime('first day of next month', $start_datetime);\n $previous_datetime = strtotime('first day of last month', $start_datetime);\n $next_datetime = $end_datetime;\n $viewDescription = date('F \\'y', $start_datetime);\n }\n else { //list\n $start_datetime = strtotime('first day of January this year', $ref_datetime);\n $end_datetime = strtotime('first day of January next year', $start_datetime);\n $previous_datetime = strtotime('first day of January last year', $start_datetime);\n $next_datetime = $end_datetime;\n $viewDescription = date('Y', $start_datetime);\n }\n\n $start_datetime_db = date('Y-m-d H:i:s', $start_datetime);\n $end_datetime_db = date('Y-m-d H:i:s', $end_datetime);\n\n $entries = $this->CalendarEntry->find('all',array(\n 'contain' => array(),\n 'conditions' => array(\n 'OR' => array(\n array(\n 'start >=' => $start_datetime_db,\n 'start < ' => $end_datetime_db\n ),\n array(\n 'end >=' => $start_datetime_db,\n 'end <' => $end_datetime_db\n )\n )\n ),\n 'order' => array(\n 'start' => 'desc'\n )\n ));\n\n //Group entries appropriately\n $grouped_entries = array(); \n $group_offset = false;\n $group_index = 0;\n if($view == 'day'){\n //Group by hour\n $group_offset = self::HOUR_SECONDS;\n }\n elseif($view == 'week'){\n //Group by day\n $group_offset = self::DAY_SECONDS;\n }\n elseif($view == 'month'){\n //Group by week\n $group_offset = self::WEEK_SECONDS;\n }\n else {\n //Group by month\n $group_offset = self::DAY_SECONDS*31; //31 days in Jan\n }\n $group_starttime = $start_datetime;\n $group_endtime = $start_datetime + $group_offset - 1;\n while($group_starttime < $end_datetime){\n $grouped_entries[$group_index] = array(\n 'meta' => array(\n 'starttime' => $group_starttime,\n 'endtime' => $group_endtime\n ),\n 'items' => array()\n );\n foreach($entries as $entry){\n $entry_starttime = strtotime($entry['CalendarEntry']['start']);\n $entry_endtime = strtotime($entry['CalendarEntry']['end']);\n if($entry_starttime >= $group_starttime && $entry_starttime < $group_endtime){\n $grouped_entries[$group_index]['items'][] = $entry;\n continue;\n }\n if($entry_endtime > $group_starttime && $entry_endtime < $group_endtime){\n $grouped_entries[$group_index]['items'][] = $entry;\n }\n }\n $group_index++;\n\n if($view == 'list'){\n $group_starttime = $group_endtime + 1;\n $group_endtime = strtotime('first day of next month', $group_starttime) - 1;\n }\n else {\n $group_starttime += $group_offset;\n $group_endtime += $group_offset;\n if($group_endtime > $end_datetime)\n $group_endtime = $end_datetime-1;\n }\n }\n\n $this->set(array(\n 'view' => $view,\n 'viewDescription' => $viewDescription,\n 'calendarItems' => $grouped_entries,\n 'currentDatetime' => $start_datetime,\n 'previousDatetime' => $previous_datetime,\n 'nextDatetime' => $next_datetime\n ));\n }", "public function countLastWeek()\n\t{\n\t\t$fromDate = Carbon::parse('Monday last week')->toDateString();\n\t\t// ambil tanggal di hari terakhir dalam minggu kemarin\n\t\t$tillDate = Carbon::parse('Monday last week')->endOfWeek()->toDateString();\n\t\treturn $this->model\n\t\t\t\t\t->whereBetween('tgl', [$fromDate, $tillDate])\t\t\n\t\t\t\t\t->count();\n\t}", "public function index()\n\t{\n\n $n = Input::has('n') ? Input::get('n'): 1 ;\n $day = date('w');\n $member = Confide::user()->youthMember ;\n\n $week_start = date('Y-m-d', strtotime('+'.($n*7-$day+1).' days'));\n\n\n $week_end = date('Y-m-d', strtotime('+'.(6-$day+$n*7).' days'));\n $shifts = $member->shifts()->whereRaw('date <= ? and date >= ?' , array($week_end ,$week_start))->get();\n\n $tds = array();\n if($shifts->count())\n {\n foreach($shifts as $shift)\n {\n array_push($tds ,\"td.\".($shift->time).($shift->gate).($shift->date->toDateString()));\n }\n }\n if(Request::ajax())\n {\n if ($n == 0)\n {\n return Response::json(['flag' => false ,'msg' => 'Không thể đăng ký cho tuần hiện tại']);\n }\n if($n > 3)\n {\n return Response::json(['flag' => false ,'msg' => 'Không thể đăng ký cho qúa 3 tuần ']);\n\n }\n $html = View::make('shift.partial.table', array('day' => $day , 'n' => $n ) )->render();\n return Response::json(['flag' => true ,'msg' => 'success' , 'html' => $html ,'tds' =>$tds]);\n\n }\n\n return View::make('shift.index',array('day' => $day , 'n' => $n ,'tds' => $tds));\n\n// var_dump($day);\n// var_dump($week_end);\n// var_dump($week_start_0);\n// var_dump($week_start_1);\n// var_dump($test);\n\t}", "function this_every($temp_day_of_week,$checkday,$res2,$remdt,$lastdayofmonth,$firstdayofmonth,$visits)\n{\n\n\tmysql_data_seek($res2,0); // returns the resultset pointer to the first row\n\tdo\n\t{\n\t\t$resultset = MySQL_Fetch_Array($res2);\n\t\tif($resultset[\"dday\"]== $checkday)\n\t\t{\n\t\t\tif($resultset[\"type\"] == \"2\")\n\t\t\t{\n \n\t\t\t\t//return '<p class=&#34;event&#34;>'.$resultset[\"tsta\"].'-'.$resultset[\"tsto\"].'<br />'.$resultset[\"header\"].'</p>';\n \n if($resultset[\"tsta\"]!='' && $resultset[\"tsto\"]!='')\n {\n\n return '<p />'.$resultset[\"tsta\"].'-'.$resultset[\"tsto\"].': '.$resultset[\"header\"].'</p>';\n }\n else if($resultset[\"tsta\"]!='')\n {\n return '<p >'.$resultset[\"tsta\"].': '.$resultset[\"header\"].'</p>';\n }\n else\n {\n return '<p >'.$resultset[\"header\"].'</p>';\n }\n\t\t\t}\n\t\t\telseif($resultset[\"type\"] == \"3\")\n\t\t\t{\n\n\n $newkty = $resultset[\"kty\"];\n\n\n\t\t\t\tif($newkty == 10)\n\t\t\t\t{\n\n\t\t\t\t\t$newkty = 0;\n\t\t\t\t\t$day_in_week= $firstdayofmonth;\n\t\t\t\t\t$foundfirst = false;\n\n\n\t\t\t\t\tfor($enumerator= 1; $enumerator<= $lastdayofmonth; $enumerator++)\n\t\t\t\t\t{\n\n\t\t\t\t\t\tif($day_in_week == $resultset[\"dday\"])\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t$newkty++;\n\t\t\t\t\t\t\t$foundfirst=true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($day_in_week == 0 && $foundfirst== false)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$newkty++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$day_in_week = ($day_in_week+1)%7;\n\n\n\n\n\t\t\t\t\t}\n\n\n\t\t\t\t}\n\t\t\t\telse if($checkday < $remdt)\n\t\t\t\t{\n\n\t\t\t\t\t$newkty = $newkty + 1;\n\n\n\t\t\t\t}\n\n\t\t\t\tif($newkty == $temp_day_of_week)\n\t\t\t\t{\n\n\t\t\t\t\t$bgb = $resultset[\"colo\"];\n\t\t\t\t\tif(!$bgb)\n\t\t\t\t\t{\n\t\t\t\t\t\t$bgb = \"#E1E1E1\";\n\t\t\t\t\t}\n\n \n\t\t\t\t\t//return '<p class=&#34;event&#34;>'.$resultset[\"tsta\"].'-'.$resultset[\"tsto\"].'<br />'.$resultset[\"header\"].'</p><hr />';\n //return '<p />'.$resultset[\"tsta\"].'-'.$resultset[\"tsto\"].'<br />'.$resultset[\"header\"].'</p><hr />';\n if($resultset[\"tsta\"]!='' && $resultset[\"tsto\"]!='')\n {\n\n return '<p />'.$resultset[\"tsta\"].'-'.$resultset[\"tsto\"].': '.$resultset[\"header\"].'</p>';\n }\n else if($resultset[\"tsta\"]!='')\n {\n return '<p >'.$resultset[\"tsta\"].': '.$resultset[\"header\"].'</p>';\n }\n else\n {\n return '<p >'.$resultset[\"header\"].'</p>';\n }\n\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{}\n\t\t}\n\t}\n\twhile($resultset);\n\n}", "function createWorkbook($recordset, $StartDay, $EndDay)\n{\n\n global $objPHPExcel;\n $objPHPExcel->createSheet(1);\n $objPHPExcel->createSheet(2);\n\n $objPHPExcel->getDefaultStyle()->getFont()->setSize(7);\n\n // Set document properties\n $objPHPExcel->getProperties()->setCreator(\"HTC\")\n ->setLastModifiedBy(\"HTC\")\n ->setTitle(\"HTC - State Fair Schedule \" . date(\"Y\"))\n ->setSubject(\"State Fair Schedule \" . date(\"Y\"))\n ->setDescription(\"State Fair Schedule \" . date(\"Y\"));\n\n addHeaders($StartDay, $EndDay);\n addTimes($StartDay,$EndDay);\n // Add some data\n addWorksheetData($recordset);\n\n\n // adding data required for spreadsheet to work properly\n addStaticData();\n\n // Rename worksheet\n $objPHPExcel->setActiveSheetIndex(2)->setTitle('Overnight');\n $objPHPExcel->setActiveSheetIndex(1)->setTitle('Night');\n $objPHPExcel->setActiveSheetIndex(0)->setTitle('Morning');\n\n\n\n $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');\n\n $objWriter->save('../Export/excel/Schedule' . date(\"Y\") . '.xls');\n\n return 'Schedule' . date(\"Y\") . '.xls';\n\n}", "public function eighth_hour_clockout($timesheet)\n\t{\n\t\t$sent_already = $this->CI->clockout_notifications_model->exists(\n\t\t\t$timesheet->user_id,\n\t\t\t'CLOCKOUT_FIRST_8HOUR_WARNING'\n\t\t);\n\n\t\tif ($sent_already) return false;\n\n\t\t// Send notification to managers\n\t\t$this->CI->cfpslack_library->notify(\n\t\t\tsprintf(\n\t\t\t\t$this->CI->config->item('eighth_hour_5min_clockout'),\n\t\t\t\t$this->CI->user_model->get_name($timesheet->user_id),\n\t\t\t\t$timesheet->workorder_id,\n\t\t\t\t$timesheet->id\n\t\t\t)\n\t\t);\n\n\t\t// SMS the user\n\t\t$this->CI->sms_library->send(\n\t\t\t$timesheet->user_id,\n\t\t\t$this->CI->config->item('eighth_hour_sms'),\n\t\t\t$timesheet->workorder_id\n\t\t);\n\n\t\t// Mark sending\n\t\t$this->CI->clockout_notifications_model->create(\n\t\t\t$timesheet->user_id,\n\t\t\t'CLOCKOUT_FIRST_8HOUR_WARNING',\n\t\t\t$timesheet->id\n\t\t);\n\n\t\treturn true;\n\t}", "function wfCalendarRefresh()\n{\n global $wgRequest, $wgTitle, $wgScriptPath;\n // this is the \"refresh\" code that allows the calendar to switch time periods\n $v = $wgRequest->getValues();\n if (isset($v[\"calendar_info\"]))\n {\n $today = getdate(); // today\n $temp = explode(\"`\", $v[\"calendar_info\"]); // calling calendar info (name, title, etc..)\n\n // set the initial values\n $month = $temp[0];\n $day = $temp[1];\n $year = $temp[2];\n $title = $temp[3];\n $name = $temp[4];\n\n // the yearSelect and monthSelect must be on top... the onChange triggers\n // whenever the other buttons are clicked\n if (isset($v[\"yearSelect\"]))\n $year = $v[\"yearSelect\"];\n if (isset($v[\"monthSelect\"]))\n $month = $v[\"monthSelect\"];\n\n if (isset($v[\"yearBack\"]))\n --$year;\n if (isset($v[\"yearForward\"]))\n ++$year;\n\n if (isset($v[\"today\"]))\n {\n $day = $today['mday'];\n $month = $today['mon'];\n $year = $today['year'];\n }\n\n if (isset($v[\"monthBack\"]))\n {\n $year = ($month == 1 ? --$year : $year);\n $month = ($month == 1 ? 12 : --$month);\n }\n\n if (isset($v[\"monthForward\"]))\n {\n $year = ($month == 12 ? ++$year : $year);\n $month = ($month == 12 ? 1 : ++$month);\n }\n\n if (isset($v[\"weekBack\"]))\n {\n $arr = getdate(mktime(12, 0, 0, $month, $day-7, $year));\n $month = $arr['mon'];\n $day = $arr['mday'];\n $year = $arr['year'];\n }\n\n if (isset($v[\"weekForward\"]))\n {\n $arr = getdate(mktime(12, 0, 0, $month, $day+7, $year));\n $month = $arr['mon'];\n $day = $arr['mday'];\n $year = $arr['year'];\n }\n\n if (wfCalendarIsValidMode($v[\"viewSelect\"]))\n $mode = $v[\"viewSelect\"];\n\n $p = \"cal\".crc32(\"$title $name\");\n $v = sprintf(\"%04d-%02d-%02d-%s\", $year, $month, $day, $mode);\n\n // reload the page... clear any purge commands that may be in it from an ical load...\n $url = $wgTitle->getFullUrl(array($p => $v));\n header(\"Location: \" . $url);\n exit;\n }\n}", "public function hasEndMonth() {\n return $this->_has(7);\n }", "function getSumWeek($values)\n {\n if(!$values['Week']['is_empty'])\n {\n $total_hours_week = 0;\n $total_minutes_week = 0;\n $total_mileages_week = 0;\n $total_tolls_week = 0;\n \n $return = array();\n \n foreach($values['Day'] as $day)\n {\n if(!$day['is_empty'])\n {\n /*******hours*******/\n $hours = 0;\n $minutes = 0;\n foreach($day['DailyTime'] as $daily_time)\n {\n $hours=(int)$hours+$daily_time['hours'];\n $minutes=(int)$minutes+$daily_time['minutes'];\n }\n $hours+=(int)($minutes/60);\n $minutes=$minutes%60;\n if($minutes==0)$minutes=\"00\";\n \n if(strlen($minutes) == 1) $minutes = '0'.$minutes;\n $return['hours'][$day['id']] = $hours.\":\".$minutes;\n \n $total_hours_week+= $hours;\n $total_minutes_week+= $minutes;\n \n /**********mileages*********/\n $mileages = 0;\n foreach($day['DailyMileage'] as $daily_mileage)\n {\n $mult = $daily_mileage['round_trip'] ? 2 : 1;\n $find = false;\n foreach($daily_mileage['FromLocation']['StartMile'] as $miles)\n {\n if($miles['location_end'] == $daily_mileage['ToLocation']['id'])\n {\n $mileages+= $miles['distance'] * $mult;\n $find = true;\n }\n }\n foreach($daily_mileage['FromLocation']['EndMile'] as $miles)\n {\n if($miles['location_start'] == $daily_mileage['ToLocation']['id'] && !$find)\n {\n $mileages+= $miles['distance'] * $mult;\n $find = true;\n }\n }\n }\n $mileages+=$day['additional_mileage'];\n $return['mileages'][$day['id']] = $mileages;\n\t\t\t\t\n $total_mileages_week+= $mileages;\n \n /**********tolls***********/\n $total_tolls_week+=$day['tolls'];\n }\n else\n {\n $return['hours'][$day['id']] = '';\n $return['mileages'][$day['id']] = 0;\n }\n }\n\t\t\t\n\t\t\t $total_hours_week+=(int)($total_minutes_week/60);\n $total_minutes_week= $total_minutes_week%60;\n\t\t\t\t\n if(strlen($total_minutes_week) == 1) $total_minutes_week = '0'.$total_minutes_week;\n $return['hours']['total'] = $total_hours_week.\":\".$total_minutes_week;\n $return['mileages']['total'] = $total_mileages_week;\n $return['tolls']['total'] = $total_tolls_week;\n \n return $return;\n }\n else\n return false;\n }", "public function testCreateTimesheet()\n {\n }", "function haltIncrementation()\n {\n return ( //it must be a saturday\n date('N', $this->workTime) == 7\n && // AND the month has changed\n (\n intval(date('m', $this->workTime + 86400))\n !=\n intval(date('m', intval($_GET['currT'])))\n || // OR we only ever wanted to see a week anyway\n $_GET['weekOrMonth'] == 'week'\n || // OR the last day of the month is a Saturday\n date('t', intval($_GET['currT'])) == date('d', intval($this->workTime))\n )\n );\n }", "public function getDateEntries()\n\t{\n\t\t//Get Date\n\t\t$dateSubmit = \\Input::get('eventDate_submit');\n\t\t//Get Week\n\t\t$week = $this->timesheet->getWeek($dateSubmit);\n\t\t//Get the user id of the currently logged in user\n\t\t$userId = \\Sentry::getUser()->id;\n\t\t//Get Tasks List\n\t\t$tasks = $this->timesheet->getIndex($userId);\n\t\t//Get Entries\n\t\t$entries = $this->timesheet->getEntries($dateSubmit,$userId);\n\t\treturn \\View::make('dashboard.timesheet.view')\n\t\t\t\t\t->with('week',$week)\n\t\t\t\t\t->with('tasks',$tasks)\n\t\t\t\t\t->with('selectedDate',$dateSubmit)\n\t\t\t\t\t->with('entries', $entries);\n\t}", "function eo_the_end($format='d-m-Y',$id=''){\n\techo eo_get_the_end($format,$id);\n}", "public function mytimesheet($start = null, $end = null)\n\t{\n\n\t\t$me = (new CommonController)->get_current_user();\n\t\t// $auth = Auth::user();\n\t\t//\n\t\t// $me = DB::table('users')\n\t\t// ->leftJoin( DB::raw('(select Max(Id) as maxid,TargetId from files where Type=\"User\" Group By TargetId) as max'), 'max.TargetId', '=', 'users.Id')\n\t\t// ->leftJoin('files', 'files.Id', '=', DB::raw('max.`maxid` and files.`Type`=\"User\"'))\n\t\t// // ->leftJoin('accesscontrols', 'accesscontrols.UserId', '=', 'users.Id')\n\t\t// ->where('users.Id', '=',$auth -> Id)\n\t\t// ->first();\n\n\t\t// $showleave = DB::table('leaves')\n\t\t// ->leftJoin('leavestatuses', 'leaves.Id', '=', 'leavestatuses.LeaveId')\n\t\t// ->leftJoin('users as applicant', 'leaves.UserId', '=', 'applicant.Id')\n\t\t// ->leftJoin('accesscontrols', 'accesscontrols.UserId', '=', 'applicant.Id')\n\t\t// ->leftJoin('users as approver', 'leavestatuses.UserId', '=', 'approver.Id')\n\t\t// ->select('leaves.Id','applicant.Name','leaves.Leave_Type','leaves.Leave_Term','leaves.Start_Date','leaves.End_Date','leaves.Reason','leaves.created_at as Application_Date','approver.Name as Approver','leavestatuses.Leave_Status as Status','leavestatuses.updated_at as Review_Date','leavestatuses.Comment')\n\t\t// ->where('accesscontrols.Show_Leave_To_Public', '=', 1)\n\t\t// ->orderBy('leaves.Id','desc')\n\t\t// ->get();\n\t\t$d=date('d');\n\n\t\tif ($start==null)\n\t\t{\n\n\t\t\tif($d>=21)\n\t\t\t{\n\n\t\t\t\t$start=date('d-M-Y', strtotime('first day of this month'));\n\t\t\t\t$start = date('d-M-Y', strtotime($start . \" +20 days\"));\n\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\t$start=date('d-M-Y', strtotime('first day of last month'));\n\t\t\t\t$start = date('d-M-Y', strtotime($start . \" +20 days\"));\n\n\t\t\t}\n\t\t}\n\n\t\tif ($end==null)\n\t\t{\n\t\t\tif($d>=21)\n\t\t\t{\n\n\t\t\t\t$end=date('d-M-Y', strtotime('first day of next month'));\n\t\t\t\t$end = date('d-M-Y', strtotime($end . \" +19 days\"));\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\t$end=date('d-M-Y', strtotime('first day of this month'));\n\t\t\t\t$end = date('d-M-Y', strtotime($end . \" +19 days\"));\n\n\t\t\t}\n\n\t\t}\n\n\t\t$mytimesheet = DB::table('timesheets')\n\t\t->select('timesheets.Id','timesheets.UserId','timesheets.Latitude_In','timesheets.Longitude_In','timesheets.Latitude_Out','timesheets.Longitude_Out','timesheets.Date',DB::raw('\"\" as Day'),'holidays.Holiday','timesheets.Site_Name','timesheets.Check_In_Type','leaves.Leave_Type','leavestatuses.Leave_Status',\n\t\t'timesheets.Time_In','timesheets.Time_Out','timesheets.Leader_Member','timesheets.Next_Person','timesheets.State','timesheets.Work_Description','timesheets.Remarks','approver.Name as Approver','timesheetstatuses.Status','leaves.Leave_Type','timesheetstatuses.Comment','timesheetstatuses.updated_at as Updated_At','files.Web_Path')\n\t\t->leftJoin( DB::raw('(select Max(Id) as maxid,TargetId from files where Type=\"Timesheet\" Group By TargetId) as maxfile'), 'maxfile.TargetId', '=', 'timesheets.Id')\n\t\t->leftJoin('files', 'files.Id', '=', DB::raw('maxfile.`maxid` and files.`Type`=\"Timesheet\"'))\n\t\t->leftJoin( DB::raw('(select Max(Id) as maxid,TimesheetId from timesheetstatuses Group By TimesheetId) as max'), 'max.TimesheetId', '=', 'timesheets.Id')\n\t\t->leftJoin('timesheetstatuses', 'timesheetstatuses.Id', '=', DB::raw('max.`maxid`'))\n\t\t->leftJoin('users as approver', 'timesheetstatuses.UserId', '=', 'approver.Id')\n\t\t// ->leftJoin('leaves','leaves.UserId','=',DB::raw('timesheets.Id AND str_to_date(timesheets.Date,\"%d-%M-%Y\") Between str_to_date(leaves.Start_Date,\"%d-%M-%Y\") and str_to_date(leaves.End_Date,\"%d-%M-%Y\")'))\n\t\t->leftJoin('leaves','leaves.UserId','=',DB::raw($me->UserId.' AND str_to_date(timesheets.Date,\"%d-%M-%Y\") Between str_to_date(leaves.Start_Date,\"%d-%M-%Y\") and str_to_date(leaves.End_Date,\"%d-%M-%Y\")'))\n\t\t->leftJoin( DB::raw('(select Max(Id) as maxid,LeaveId from leavestatuses Group By LeaveId) as maxleave'), 'maxleave.LeaveId', '=', 'leaves.Id')\n\t\t->leftJoin('leavestatuses', 'leavestatuses.Id', '=', DB::raw('maxleave.`maxid`'))\n\t\t->leftJoin('holidays',DB::raw('1'),'=',DB::raw('1 AND str_to_date(timesheets.Date,\"%d-%M-%Y\") Between str_to_date(holidays.Start_Date,\"%d-%M-%Y\") and str_to_date(holidays.End_Date,\"%d-%M-%Y\")'))\n\t\t->where('timesheets.UserId', '=', $me->UserId)\n\t\t->where(DB::raw('str_to_date(timesheets.Date,\"%d-%M-%Y\")'), '>=', DB::raw('str_to_date(\"'.$start.'\",\"%d-%M-%Y\")'))\n\t\t->where(DB::raw('str_to_date(timesheets.Date,\"%d-%M-%Y\")'), '<=', DB::raw('str_to_date(\"'.$end.'\",\"%d-%M-%Y\")'))\n\t\t->orderBy('timesheets.Id','desc')\n\t\t->get();\n\n\t\t$user = DB::table('users')->select('users.Id','StaffId','Name','Password','User_Type','Company_Email','Personal_Email','Contact_No_1','Contact_No_2','Nationality','Permanent_Address','Current_Address','Home_Base','DOB','NRIC','Passport_No','Gender','Marital_Status','Position','Emergency_Contact_Person',\n\t\t'Emergency_Contact_No','Emergency_Contact_Relationship','Emergency_Contact_Address','files.Web_Path')\n\t\t// ->leftJoin('files', 'files.TargetId', '=', DB::raw('users.`Id` and files.`Type`=\"User\"'))\n\t\t->leftJoin( DB::raw('(select Max(Id) as maxid,TargetId from files where Type=\"User\" Group By Type,TargetId) as max'), 'max.TargetId', '=', 'users.Id')\n\t\t->leftJoin('files', 'files.Id', '=', DB::raw('max.`maxid` and files.`Type`=\"User\"'))\n\t\t->where('users.Id', '=', $me->UserId)\n\t\t->first();\n\n\t\t$arrDate = array();\n\t\t$arrDate2 = array();\n\t\t$arrInsert = array();\n\n\t\tforeach ($mytimesheet as $timesheet) {\n\t\t\t# code...\n\t\t\tarray_push($arrDate,$timesheet->Date);\n\t\t}\n\n\t\t$startTime = strtotime($start);\n\t\t$endTime = strtotime($end);\n\n\t\t// Loop between timestamps, 1 day at a time\n\t\tdo {\n\n\t\t\t if (!in_array(date('d-M-Y', $startTime),$arrDate))\n\t\t\t {\n\t\t\t\t array_push($arrDate2,date('d-M-Y', $startTime));\n\t\t\t }\n\n\t\t\t $startTime = strtotime('+1 day',$startTime);\n\n\t\t} while ($startTime <= $endTime);\n\n\t\tforeach ($arrDate2 as $date) {\n\t\t\t# code...\n\t\t\tarray_push($arrInsert,array('UserId'=>$me->UserId, 'Date'=> $date, 'updated_at'=>date('Y-m-d H:i:s')));\n\n\t\t}\n\n\t\tDB::table('timesheets')->insert($arrInsert);\n\n\t\t$options= DB::table('options')\n\t\t->whereIn('Table', [\"users\",\"timesheets\"])\n\t\t->orderBy('Table','asc')\n\t\t->orderBy('Option','asc')\n\t\t->get();\n\n // $mytimesheet = DB::table('timesheets')\n // ->leftJoin('users as submitter', 'timesheets.UserId', '=', 'submitter.Id')\n // ->select('timesheets.Id','submitter.Name','timesheets.Timesheet_Name','timesheets.Date','timesheets.Remarks')\n // ->where('timesheets.UserId', '=', $me->UserId)\n\t\t\t// ->orderBy('timesheets.Id','desc')\n // ->get();\n\n\t\t\t// $hierarchy = DB::table('users')\n\t\t\t// ->select('L2.Id as L2Id','L2.Name as L2Name','L2.Timesheet_1st_Approval as L21st','L2.Timesheet_2nd_Approval as L22nd',\n\t\t\t// 'L3.Id as L3Id','L3.Name as L3Name','L3.Timesheet_1st_Approval as L31st','L3.Timesheet_2nd_Approval as L32nd')\n\t\t\t// ->leftJoin(DB::raw(\"(select users.Id,users.Name,users.SuperiorId,accesscontrols.Timesheet_1st_Approval,accesscontrols.Timesheet_2nd_Approval,accesscontrols.Timesheet_Final_Approval from users left join accesscontrols on users.Id=accesscontrols.UserId) as L2\"),'L2.Id','=','users.SuperiorId')\n\t\t\t// ->leftJoin(DB::raw(\"(select users.Id,users.Name,users.SuperiorId,accesscontrols.Timesheet_1st_Approval,accesscontrols.Timesheet_2nd_Approval,accesscontrols.Timesheet_Final_Approval from users left join accesscontrols on users.Id=accesscontrols.UserId) as L3\"),'L3.Id','=','L2.SuperiorId')\n\t\t\t// ->where('users.Id', '=', $me->UserId)\n\t\t\t// ->get();\n\t\t\t//\n\t\t\t// $final = DB::table('users')\n\t\t\t// ->select('users.Id','users.Name')\n\t\t\t// ->leftJoin('accesscontrols', 'accesscontrols.UserId', '=', 'users.Id')\n\t\t\t// ->where('Timesheet_Final_Approval', '=', 1)\n\t\t\t// ->get();\n\n\t\t\treturn view('mytimesheet', ['me' => $me, 'user' =>$user, 'mytimesheet' => $mytimesheet,'start' =>$start,'end'=>$end,'options' =>$options]);\n\n\t\t\t//return view('mytimesheet', ['me' => $me,'showleave' =>$showleave, 'mytimesheet' => $mytimesheet, 'hierarchy' => $hierarchy, 'final' => $final]);\n\n\t}", "static function isWeekend($date) {\n \treturn (date('N', $date) >= 5);\n\t}", "function getEndDateWeek($week, $year) {\n \n $dto = new DateTime();\n $dto->setISODate($year, $week);\n $ret['week_start'] = $dto->format('Y-m-d');\n $dto->modify('+6 days');\n $ret['week_end'] = $dto->format('Y-m-d');\n \n $ultimo_dia_semana = $dto->format('Y-m-d');\n return $ultimo_dia_semana;\n \n}", "function week($week,$date){\nglobal $maand,$week,$language,$m,$d,$y,$ld,$fd,$viewweekok,$searchweekok,$popupevent,$popupeventwidth,$popupeventheight;\n\nif ($viewweekok == 1){\n\nif (!$date){\n$year = $y;\n$month = $m;\n$day = $d;\n}\nelse{\n$year = substr($date,0,4);\n$month = substr($date,5,2);\n$day = substr($date,8,2);\n}\n\n// weeknummer\nfunction weekNumber($dag,$maand,$jaar)\n{\n $a = (14-$maand)/12;\n settype($a,\"integer\");\n $y = $jaar+4800-$a;\n settype($y,\"integer\");\n $m = $maand + 12*$a - 3;\n settype($m,\"integer\");\n $J = $dag + (153*$m+2)/5 + $y*365 + $y/4 - $y/100 + $y/400 - 32045;\n $d4 = ($J+31741 - ($J % 7)) % 146097 % 36524 % 1461;\n $L = $d4/1460;\n $d1 = (($d4-$L) % 365) + $L;\n $WeekNumber = ($d1/7)+1;\n settype($WeekNumber,\"integer\");\n return $WeekNumber;\n}\n\n$deesweek = mktime(0,0,0,date(\"d\"), date(\"m\"), date(\"Y\"));\n$weeknummer = weekNumber($day,$month,$year);\n$laatsteweek = ($weeknummer + 10);\nif ($laatsteweek > 52){\n $laatsteweek = $laatsteweek - 52;\n}\n\n// eerste dag van de week\nfunction firstDayOfWeek($year,$month,$day){\n global $fd;\n $dayOfWeek=date(\"w\");\n $sunday_offset=$dayOfWeek * 60 * 60 * 24;\n $fd = date(\"Y-m-d\", mktime(0,0,0,$month,$day+1,$year) - $sunday_offset);\n return $fd;\n}\nfirstDayOfWeek($year,$month,$day);\n\n// laatste dag van de week\nfunction lastDayOfWeek($year,$month,$day){\n global $ld;\n $dayOfWeek=date(\"w\");\n $saturday_offset=(6-$dayOfWeek) * 60 * 60 * 24 ;\n $ld = date(\"Y-m-d\", mktime(0,0,0,$month,$day+1,$year) + $saturday_offset);\n return $ld;\n}\nlastDayOfWeek($year,$month,$day);\n\nif (($date) && ($date != date(\"Y-m-d\"))){\necho \"<a href=calendar.php?op=week&date=\".date(\"Y-m-d\", mktime(0,0,0,$month,$day-7,$year)).\"><== \".translate(\"prevweek\").\"</a> - \";\n}\necho \"<a href=calendar.php?op=week&date=\".date(\"Y-m-d\", mktime(0,0,0,$month,$day+7,$year)).\">\".translate(\"nextweek\").\" ==> </a>\";\n\n// zin met datum begin van weeknummer en datum eind weeknummer\necho \"<br><br>\".translate(\"eventsthisweek\");\n$fdy = substr($fd,0,4);\n$fdm = substr($fd,5,2);\nif (substr($fdm,0,1) == \"0\"){\n $fdm = str_replace(\"0\",\"\",$fdm);}\n$fdd = substr($fd,8,2);\necho $fdd.\" \".$maand[$fdm].\" \".$fdy;\necho \" \".translate(\"till\").\" \";\n$ldy = substr($ld,0,4);\n$ldm = substr($ld,5,2);\nif (substr($ldm,0,1) == \"0\"){\n $ldm = str_replace(\"0\",\"\",$ldm);}\n$ldd = substr($ld,8,2);\necho $ldd.\" \".$maand[$ldm].\" \".$ldy;\necho \" (\".translate(\"weeknr\").\" : \".$weeknummer.\")\";\n\n// en nu de evenementen eruit halen :)\n$ld = date(\"Y-m-d\", mktime(0,0,0,$ldm,$ldd+1,$ldy));\necho \"<br><br>\";\nwhile ($fd != $ld){\n$fdy = substr($fd,0,4);\n$fdm = substr($fd,5,2);\nif (substr($fdm,0,1) == \"0\"){\n $fdm = str_replace(\"0\",\"\",$fdm);}\n$fdd = substr($fd,8,2);\n$query = \"select id,title,description,url,cat_name,day,month,year from events left join calendar_cat on events.cat=calendar_cat.cat_id where day='$fdd' and month='$fdm' and year='$fdy' and approved='1' order by title ASC\";\n//echo $query.\"<br>\";\n$result = mysql_query($query);\n while ($row = mysql_fetch_object($result)){\n echo \"<li><b><U>\".stripslashes($row->title).\"</u></b><font size=-1> (\".$row->day.\" \".$row->month.\" \".$row->year.\")</font><br>\";\n echo translate(\"cat\").\" : \".$row->cat_name.\"<br>\";\n $de = str_replace(\"<br>\",\"\",$row->description);\n $de = str_replace(\"<br />\",\"\",$row->description);\n echo substr(stripslashes($de),0,100).\" ...\";\n echo \"<br>\";\n if ($popupevent == 1)\n echo \"<a href=\\\"#\\\" onclick=\\\"MM_openBrWindow('cal_popup.php?op=view&id=\".$row->id.\"','Calendar','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=\".$popupeventwidth.\",height=\".$popupeventheight.\"')\\\">\";\n else\n echo \"<a href=calendar.php?op=view&id=\".$row->id.\">\";\n echo translate(\"readmore\").\"</a>\";\n echo \"<br><br>\";\n }\n$fd = date(\"Y-m-d\", mktime(0,0,0,$fdm,$fdd+1,$fdy));\n}\nif ($searchweekok == 1)\n\tsearch();\n}\nelse{\n echo translate(\"disabled\");\n}\n}", "function getReportLastWeek(){\n global $db;\n \n $get = getWeekSale();//Pulls most recent week from purchasing table\n $week = $get['week'];\n \n $stmt=$db->prepare(\"SELECT week, SUM(expense) AS 'expense', SUM(revenue) AS 'revenue' FROM invoices WHERE week = :week\");\n \n $binds=array(\n \":week\"=>$week\n );\n $results= false;\n if($stmt->execute($binds) && $stmt->rowCount()>0){\n $results = $stmt->fetch(PDO::FETCH_ASSOC);\n }\n return $results;\n }", "public function index($date = null)\n {\n $user = Auth::user();\n $workouts = $user->workouts;\n $currentWeek = $user->currentWeek;\n\n //will be checking against this to fix problem where refreshing takes users to previous or next weeks\n $pageWasRefreshed = isset($_SERVER['HTTP_CACHE_CONTROL']) && $_SERVER['HTTP_CACHE_CONTROL'] === 'max-age=0';\n\n if($date && !$pageWasRefreshed){ \n switch($date){\n case 'previous':\n $currentWeek--;\n $user->update(['currentWeek' => $currentWeek]);\n break;\n case 'next':\n $currentWeek++;\n $user->update(['currentWeek' => $currentWeek]);\n break;\n case 'current':\n $currentWeek = date('W');\n $user->update(['currentWeek' => $currentWeek]);\n break;\n }\n }\n\n //Use Currentweek to delegate weeks\n //Refactor this\n\n $dto = new DateTime();\n $ret['monday'] = $dto->setISODate(date('Y'), $currentWeek)->format('Y-m-d');\n $ret['sunday'] = $dto->modify('+6 days')->format('Y-m-d'); \n\n $monday = $ret['monday'];\n $sunday = $ret['sunday'];\n $weekof = $monday;\n \n $mondayWorkout = $this->findWorkout('Monday', $monday, $sunday, $workouts);\n $tuesdayWorkout = $this->findWorkout('Tuesday', $monday, $sunday, $workouts);\n $wednesdayWorkout = $this->findWorkout('Wednesday', $monday, $sunday, $workouts);\n $thursdayWorkout = $this->findWorkout('Thursday', $monday, $sunday, $workouts);\n $fridayWorkout = $this->findWorkout('Friday', $monday, $sunday, $workouts);\n // $saturdayWorkout = $this->findWorkout('Saturday', $monday, $sunday, $workouts);\n // $sundayWorkout = $this->findWorkout('Sunday', $monday, $sunday, $workouts);\n\n if($mondayWorkout){\n $mondayExercises = $mondayWorkout->exercises;\n }\n if($tuesdayWorkout){\n $tuesdayExercises = $tuesdayWorkout->exercises;\n }\n if($wednesdayWorkout){\n $wednesdayExercises = $wednesdayWorkout->exercises;\n }\n if($thursdayWorkout){\n $thursdayExercises = $thursdayWorkout->exercises;\n }\n if($fridayWorkout){\n $fridayExercises = $fridayWorkout->exercises;\n }\n // if($saturdayWorkout){\n // $saturdayExercises = $saturdayWorkout->exercises;\n // } \n // if($sundayWorkout){\n // $sundayExercises = $sundayWorkout->exercises;\n // }\n // \n \n //get the exercises of last week and current day for dashboard\n //for comparison week to week\n \n $lastweekDate = date('Y-m-d', strtotime('-1 week'));\n $lastweekWorkout = $workouts->where('week', $lastweekDate)->first();\n \n if($lastweekWorkout){\n $lastweekExercises = $lastweekWorkout->exercises;\n }\n\n return view('home', compact('weekof', \n 'lastweekWorkout', 'lastweekExercises',\n 'mondayExercises', 'mondayWorkout',\n 'tuesdayExercises', 'tuesdayWorkout',\n 'wednesdayExercises', 'wednesdayWorkout',\n 'thursdayExercises', 'thursdayWorkout',\n 'fridayExercises', 'fridayWorkout'//,\n // 'saturdayExercises', 'saturdayWorkout',\n // 'sundayExercises', 'sundayWorkout'\n ));\n }", "function calendar_week_mod($num)\n {\n }", "function handleCalendar( $showID, $dates=null, $venueWPID=\"\", $mobile = false ) {\n $monthVal;\n if ( $dates == null ) {\n\n $showID = $_POST['data']['showID'];\n \n $monthVal = $_POST['data']['monthVal'];\n\n $venueWPID = $_POST['data']['venueVal'];\n \n $mobile = isset($_POST['data']['mobile'])? true : false;\n \n // grab \"week\" variable from $_POST, if set, use that to build start and end dates, else call \"getDates\"\n $week = $_POST['data']['week'];\n\n $today = new DateTime('today');\n // if there's no week value, and the selected month matches current month, choose current week\n if ( $week == \"\" && $today->format('n') - 1 == $monthVal ) {\n $start = new DateTime();\n $start->setISODate( $today->format('Y'), $today->format('W'), 0);\n $week = $start->format('Y-m-d');\n }\n\n //echo \"Week is $week\";\n if ( $week != '' ) {\n $trashDate = new DateTime( $week );\n $dates['start'] = new DateTime( $trashDate->format( 'Y-m-d' ) );\n $trashDate->modify( \"+6 days\" );\n $dates['end'] = new DateTime( $trashDate->format( 'Y-m-d' ) );\n } else if ( $week == '' ) {\n // check if current month matches selected month, select current week if so\n $today = new DateTime();\n if ( $today->format('n')-1 == $monthVal) {\n $week = $today->format('W');\n //printDat($week);\n }\n $dates = getDates( $week, $monthVal );\n }\n //var_dump($dates);\n //wp_die();\n }\n\n /*echo \"<pre>\";\n print_r($dates);\n echo \"</pre>\";*/\n\n // set previous and next week variables\n $prevWeek = new DateTime( $dates[\"start\"]->format(\"Y-m-d\") );\n $prevWeek->modify( \"-1 week\" );\n $nextWeek = new DateTime( $dates[\"start\"]->format(\"Y-m-d\") );\n $nextWeek->modify( \"+1 week\" );\n \n $fullEvents = getShowEvents( $showID, $venueWPID, $dates['start']->format( \"Y-m-d\" ), $dates['end']->format( \"Y-m-d\" ) );\n\n if($mobile){\n return array(\n 'events' => $fullEvents,\n 'week' => $nextWeek\n );\n }\n /*echo \"<pre>\";\n print_r($fullEvents);\n echo \"</pre>\";*/\n\n // for each event, create a new array containing their ID, day of the week and time; push that into events array\n $events;\n foreach( $fullEvents as $event ) {\n $daDate = new DateTime( $event->time );\n $toInsert = array (\n \"id\" => $event->id,\n \"hour\" => $daDate->format( 'G' ),\n \"minute\"=> $daDate->format( 'i' ),\n \"day\" => $daDate->format( 'w' )\n );\n $events[] = $toInsert;\n }\n\n\n // new DateTime to hold current start date...will be used to iterate over and populate the day headers without messing with the dates array\n $currWeek = new DateTime( $dates['start']->format(\"Y-m-d\") );\n \n //start building out the HTML that will display the calendar\n $html = \"<div class='cal-nav'><a id='prev-week-btn'><input type='hidden' id='prev-week' value='\" . $prevWeek->format('Y-m-d') . \"' /><img src='\" . get_template_directory_uri() . \"/library/assets/icons/dotted-arrow.png' /></a>\";\n $html .= \"<span id='date-range'>\" . $dates['start']->format('M j') . \" - \" . $dates['end']->format( 'M j' ) . \"</span>\";\n $html .= \"<a id='next-week-btn'><input type='hidden' id='next-week' value='\" . $nextWeek->format('Y-m-d') . \"' /><img src='\" . get_template_directory_uri() . \"/library/assets/icons/dotted-arrow.png' /></a></div>\";\n $html .= \"<table id='events-calendar'><tr class='days-heading'>\";\n\n // while loop to create the day of the week headers (complete month/day indications)\n $cntr = 0;\n while( $cntr < 7 ) {\n $html .= \"<td>\" . $currWeek->format( 'D n/j' ) . \"</td>\";\n $currWeek->modify( '+1 day' );\n $cntr++;\n }\n $html .= \"</tr>\"; // finish off the day headings row\n\n // another loop, this one to populate in events on each day\n $cntr = 0;\n $html .= \"<tr>\";\n if ( isset( $events ) ) {\n while( $cntr < 7 ) {\n $html .= \"<td>\";\n\n // cycle through events array, grabbing any for current day (based on \"day\" value)\n foreach( $events as $event ) {\n\n $url = home_url( '/' ) . \"tickets/?eventID=\" . $event['id'];\n if( $event['day'] == $cntr ) {\n // build time variable, including converting from 24 hour to 12 hour time\n if ( $event['hour'] > 12 ) {\n $time = $event['hour']-12 . \":\" . $event['minute'] . \" PM\";\n } else {\n $time = $event['hour'] . \":\" . $event['minute'] . \" AM\";\n }\n \n $html .= \"<a href='\" . $url . \"' class='show-time' id='\" . $event['id'] . \"' >\" . $time . \"</a>\";\n }\n }\n $html .= \"</td>\";\n $cntr++;\n }\n } else {\n $html .= \"<td colspan='7'>No events for this week</td>\";\n }\n $html .= \"</tr>\";\n\n $html .= \"<tr><td colspan='7' style='height: 50px'> </td></tr>\";\n\n $html .= \"</table>\";\n\n\n echo $html;\n\n if( $_POST ) {\n wp_die();\n }\n}", "public function set_location_trading_hour_days(){}", "function event_grid_view() {\n\tsp_calendar_grid();\n}", "function season_by_week($season_start, $season_end, $type=\"schedule\", $sport_id=1, $week_current=0, $conference_id=0)\n{\n $season_start = strtotime($season_start);\n $season_end = strtotime($season_end);\n $seconds_in_a_week = 604800;\n \n // How many weeks are in a season?\n $season_weeks = round(( $season_end - $season_start ) / $seconds_in_a_week);\n \n $this_week = round(( time() - $season_start ) / $seconds_in_a_week);\n if ( $this_week < 0 ) $this_week = 0;\n\n switch ( strtolower($type) )\n {\n case \"schedule\":\n $week_start = $this_week;\n break;\n case \"results\":\n $week_start = 0;\n $season_weeks = $this_week;\n break;\n default:\n \n $week_start = 0;\n break;\n }\n\n\n //echo \"<dd>Weeks: $season_weeks</dd>\";\n //echo \"<dd>This week: $this_week</dd>\";\n //echo \"<dd>Week start: $week_start</dd>\";\n \n if ( $conference_id > 0 )\n {\n $conference_link = \"&ConferenceID=$conference_id\";\n }\n \n // Loop through the weeks, put the dates in an array.\n $return = \"\";\n for ( $i = $week_start; $i <= $season_weeks; $i ++ )\n {\n $week_display = $i + 1;\n $timestamp = $season_start + ( $seconds_in_a_week * $i );\n $week[$i] = week_generate($timestamp);\n \n $link = \"/home.html?site=default&tpl=Schedule&Sport=\" . $sport_id . \"&SearchDate=\" . date(\"m/d/Y\", $week[$i][0]) . \"&SearchDateEnd=\" . date(\"m/d/Y\", $week[$i][1]) . \"&start=0&count=250&Week=\" . $week_display . $conference_link;\n \n \n \n if ( $week_current == $week_display )\n {\n $return .= $week_display . \" \";\n }\n else\n {\n $return .= \"<a href=\" . $link . \" class=pageNumberLink>\" . $week_display . \"</a> \";\n }\n \n }\n return $return;\n}", "public static function daily() {return new ScheduleViewMode(1);}", "function get_weekday_stats(){\n if(!DashboardCommon::is_su()) return null;\n \n $sat = strtotime(\"last saturday\");\n $sat = date('w', $sat) == date('w') ? $sat + 7 * 86400 : $sat;\n $fri = strtotime(date(\"Y-m-d\", $sat) . \" +6 days\");\n $from = date(\"Y-m-d\", $sat);//for current week only\n $to = date(\"Y-m-d\", $fri);//for current week only\n $sql = \"SELECT DAYNAME(atr.call_start) as dayname,count(*) as total \n FROM week_days wd \n LEFT JOIN ( SELECT * FROM calls WHERE call_start >= '\" . $this->from . \"' AND call_start <= '\" . $this->to . \"') atr\n ON wd.week_day_num = DAYOFWEEK(atr.call_start)\n GROUP BY\n DAYOFWEEK(atr.call_start)\";\n\n $this_week_rec = DashboardCommon::db()->Execute($sql);\n $saturday = $sunday = $monday = $tuesday = $wednesday = 0;\n $thursday = $friday = 0;\n// $data = array();\n// while (!$this_week_rec->EOF) {\n// $k = $this_week_rec->fields['dayname'];\n// $data[$k]= $this_week_rec->fields['total'];\n// $this_week_rec->MoveNext();\n// }\n// \n// return array_keys($data, max($data));\n\n while (!$this_week_rec->EOF) {\n $daynames = $this_week_rec->fields['dayname'];\n $totalcalls = $this_week_rec->fields['total'];\n if ($daynames == 'Saturday') {\n $saturday = $this_week_rec->fields['total'];\n }\n if ($daynames == 'Sunday') {\n $sunday = $this_week_rec->fields['total'];\n }\n if ($daynames == 'Monday') {\n $monday = $this_week_rec->fields['total'];\n }\n if ($daynames == 'Tuesday') {\n $tuesday = $this_week_rec->fields['total'];\n }\n if ($daynames == 'Wednesday') {\n $wednesday = $this_week_rec->fields['total'];\n }\n if ($daynames == 'Thursday') {\n $thursday = $this_week_rec->fields['total'];\n }\n if ($daynames == 'Friday') {\n $friday = $this_week_rec->fields['total'];\n }\n\n $this_week_rec->MoveNext();\n }\n\n $arr = array('Saturday' => $saturday,\n 'Sunday' => $sunday,\n 'Monday' => $monday,\n 'Tuesday' => $tuesday,\n 'Wednesday' => $wednesday,\n 'Thursday' => $thursday,\n 'Friday' => $friday\n );\n $max_day = array_keys($arr, max($arr));\n \n $avg_calltime_sql = \"SELECT sum(duration) as total_call_time, count(*) as total_records, \n sum(duration) / count(*) as avg_time\n FROM \n (\n SELECT call_end-call_start as duration\n FROM calls\n WHERE call_start >= '\".$this->from.\"' AND call_start <= '\".$this->to.\"'\n ) as dt\";\n $avg_calltime_res = DashboardCommon::db()->Execute($avg_calltime_sql);\n \n \n return array('weekday'=>$max_day[0],'avg_call_time'=>$avg_calltime_res->fields['avg_time']);\n \n }", "function checkWeeks() {\n\t\tglobal $weeklyhours; \n\t\t\n\t\tforeach ( $this->weeklyAnalysis as &$week ) {\n\t\t\tif ( $week['total'] < $weeklyhours ) {\n\t\t\t\t$week['complete'] = 0; \t\t\t\t\t\t\t// set this week incomplete\n\t\t\t\t$this->complete = 0; \t\t\t\t\t\t\t// set entire analysis to incomplete\n\t\t\t}\n\t\t\telse $week['complete'] = 1;\n\t\t\t\t\n\t\t}\n\t}", "public function get_timetable() {\n $week = $this->qc->timetable_get_week();\n $days = array();\n\n for ($i=2; $i < count($week); $i++) {\n $day = $this->qc->timetable_get_day($week[$i]);\n array_push($days, $day);\n }\n }", "public function action_index()\n\t{\n\t\t$type = 'week';\n\n\t\t$settings = array\n\t\t(\n\t\t\t'_label' => 'Week 1',\n\t\t\t'_namespace' => 'mmi',\n\t\t\t'class' => 'week',\n\t\t\t'id' => 'week1',\n\t\t\t'required' => 'required',\n\t\t\t'step' => 3,\n\t\t\t'value' => '1970-W01'\n\t\t);\n\t\t$field = MMI_Form_Field::factory($type, $settings);\n\t\t$this->_form->add_field($field);\n\t\tif ($this->debug)\n\t\t{\n\t\t\tMMI_Debug::dump($field->render(), $type.' (step 3)');\n\t\t}\n\n\t\t$settings = array_merge($settings, array\n\t\t(\n\t\t\t'_after' => '2010-W10',\n\t\t\t'_before' => '2010-W01',\n\t\t\t'_label' => 'Week 2',\n\t\t\t'id' => 'week2',\n\t\t\t'max' => '2010-W10',\n\t\t\t'min' => '2010-W01',\n\t\t\t'required' => FALSE,\n\t\t\t'step' => 1,\n\t\t\t'value' => '',\n\t\t));\n\t\t$field = MMI_Form_Field::factory($type, $settings);\n\t\t$this->_form->add_field($field);\n\t\tif ($this->debug)\n\t\t{\n\t\t\tMMI_Debug::dump($field->render(), $type.' (min 2010-W01; max 2010-W10; step 1)');\n\t\t}\n\n\t\t$settings = array_merge($settings, array\n\t\t(\n\t\t\t'_before' => '2010-W10',\n\t\t\t'_label' => 'Week 3',\n\t\t\t'id' => 'week3',\n\t\t\t'min' => '2010-W10',\n\t\t\t'step' => 2,\n\t\t));\n\t\tunset($settings['_after'], $settings['max']);\n\t\t$field = MMI_Form_Field::factory($type, $settings);\n\t\t$this->_form->add_field($field);\n\t\tif ($this->debug)\n\t\t{\n\t\t\tMMI_Debug::dump($field->render(), $type.' (min 2010-W10; step 2)');\n\t\t}\n\n\t\t$settings = array_merge($settings, array\n\t\t(\n\t\t\t'_after' => '2010-W30',\n\t\t\t'_label' => 'Week 4',\n\t\t\t'id' => 'week4',\n\t\t\t'max' => '2010-W30',\n\t\t\t'step' => 4,\n\t\t));\n\t\tunset($settings['_before'], $settings['min']);\n\t\t$field = MMI_Form_Field::factory($type, $settings);\n\t\t$this->_form->add_field($field);\n\t\tif ($this->debug)\n\t\t{\n\t\t\tMMI_Debug::dump($field->render(), $type.' (max 2010-W30; step 4)');\n\t\t}\n\t}", "public function date_range_report()\n\t{\n\t\t$this->data['crystal_report']=$this->reports_personnel_schedule_model->crystal_report_view();\n\t\t$this->data['company_list'] = $this->reports_personnel_schedule_model->company_list();\n\t\t$this->load->view('employee_portal/report_personnel/schedule/date_range_report',$this->data);\n\t}", "public function homework_feed() {\n\t\t\t// ->wherePivot('complete', '=', 'false')->orWherePivot('updated_at', '>', Carbon::now()->subMinutes(15))\n\t\t\t$items = $this->homework()->orderBy('end', 'ASC')->where('end', '>', date(\"Y-m-d H:i:s\", time() - 60 * 60 * 24 * 7))->where('start', '<', date(\"Y-m-d H:i:s\", time() + 60 * 60 * 24 * 7))->get();\n\t\t\t$headings = [];\n\n\t\t\tforeach ($items as $value) {\n\t\t\t\t$now = Carbon::now();\n\t\t\t\t$index = static::time_index($value->end, $now);\n\t\t\t\t$heading = static::time_heading($value->end, $now);\n\n\t\t\t\tif (!isset($headings[$index]))\n\t\t\t\t\t$headings[$index] = [\n\t\t\t\t\t\t'heading' => $heading,\n\t\t\t\t\t\t'items' => []\n\t\t\t\t\t];\n\n\t\t\t\t$headings[$index]['items'][] = $value;\n\t\t\t}\n\n\t\t\tksort($headings);\n\n\t\t\treturn $headings;\n\t\t}", "function lastDayOfWeek($year,$month,$day){\n global $ld;\n $dayOfWeek=date(\"w\");\n $saturday_offset=(6-$dayOfWeek) * 60 * 60 * 24 ;\n $ld = date(\"Y-m-d\", mktime(0,0,0,$month,$day+1,$year) + $saturday_offset);\n return $ld;\n}", "function isWeekend($date) {\n return (date('N', strtotime($date)) >= 6);\n }", "function prim_options_weeks() {\n $weeks = array(\n 'w1' => t('1'),\n 'w2' => t('2'),\n 'w3' => t('3'),\n 'w4' => t('4'),\n 'w5' => t('5'),\n 'w6' => t('6'),\n 'w7' => t('7'),\n 'w8' => t('8'),\n 'w9' => t('9'),\n 'w10' => t('10'),\n 'w11' => t('11'),\n 'w12' => t('12'),\n 'w13' => t('13'),\n 'w14' => t('14'),\n 'w15' => t('15'),\n 'w16' => t('16'),\n 'w17' => t('17'),\n 'w18' => t('18'),\n 'w19' => t('19'),\n 'w20' => t('20'),\n 'w21' => t('21'),\n 'w22' => t('22'),\n 'w23' => t('23'),\n 'w24' => t('24'),\n 'w25' => t('25'),\n 'w26' => t('26'),\n 'w27' => t('27'),\n 'w28' => t('28'),\n 'w29' => t('29'),\n 'w30' => t('30'),\n 'w31' => t('31'),\n 'w32' => t('32'),\n 'w33' => t('33'),\n 'w34' => t('34'),\n 'w35' => t('35'),\n 'w36' => t('36'),\n 'w37' => t('37'),\n 'w38' => t('38'),\n 'w39' => t('39'),\n 'w40' => t('40'),\n 'w41' => t('41'),\n 'w42' => t('42'),\n 'w43' => t('43'),\n 'w44' => t('44'),\n 'w45' => t('45'),\n 'w46' => t('46'),\n 'w47' => t('47'),\n 'w48' => t('48'),\n 'w49' => t('49'),\n 'w50' => t('50'),\n 'w51' => t('51'),\n 'w52' => t('52'),\n 'w53' => t('53'),\n );\n\n return $weeks;\n}", "function my_add_weekly( $schedules ) {\n // add a 'weekly' schedule to the existing set\n $schedules['3_hours'] = array(\n 'interval' => 10800,\n 'display' => __('Every 3 Hours - (Flipkart API call)')\n );\n return $schedules;\n }", "public function index()\n {\n $user = $this->getUser();\n $from = $this->request->getStringParam('from', date('Y-m-d'));\n $to = $this->request->getStringParam('to', date('Y-m-d', strtotime('next week')));\n $timetable = $this->timetable->calculate($user['id'], new DateTime($from), new DateTime($to));\n\n $this->response->html($this->helper->layout->user('timetable:timetable/index', array(\n 'user' => $user,\n 'timetable' => $timetable,\n 'values' => array(\n 'from' => $from,\n 'to' => $to,\n 'plugin' => 'timetable',\n 'controller' => 'timetable',\n 'action' => 'index',\n 'user_id' => $user['id'],\n ),\n )));\n }", "public function fillTime($dayNum,$branch_id,$serv,$org_user,$date)\n { \n //Flag T Check If It Is ShiftNight\n $nightFlag=0;\n //Query To Get Working Hours Of Specific Day Of Specific Branch\n $sqlGetsch=\"SELECT * FROM work_hours WHERE branch_id=? AND day=?\";\n $values=array($branch_id,$dayNum);\n $sch=$this->getInfo($sqlGetsch,$values);\n \n //Query To Get The Average Time Of Service\n $sqlGetServiceID=\"SELECT app_time_avg FROM service WHERE service_id=?\";\n $values=array($serv);\n $getAvg=$this->getInfo($sqlGetServiceID,$values);\n $avgTime=$getAvg[0]['app_time_avg'];\n $avg='+'.$avgTime.' minutes';\n \n //Check If It Is Night Shifts\n if($sch[0]['startA']>\"12:00\" && $sch[0]['endB']>=\"00:00\" && $sch[0]['endB']<=\"12:00\")\n {\n $nightFlag=1;\n $freeTime1 = $this->create_time_range($sch[0]['startA'], \"23:59\" , $avg);\n //To Add Avg And Avoid Duplication Cell\n $time = strtotime(end($freeTime1));\n $avoidTime = date(\"H:i\", strtotime($avg, $time));\n $freeTime2 = $this->create_time_range($avoidTime, $sch[0]['endB'] , $avg);\n $freeTime = array_merge($freeTime1, $freeTime2);\n }\n else // So It Is Morning Shifts\n {\n $freeTime = $this->create_time_range($sch[0]['startA'], $sch[0]['endB'], $avg);\n }\n \n $minTime='-'.$avgTime.' minutes'; //To Get Out The Dates That Are Less Than the Average Appointment Time\n \n //loop To Take out all The Break Time \n for($i=0;$i<count($freeTime);$i++)\n {\n if(isset($freeTime[$i]))//If this index exists\n {\n $t = date(\"H:i\",strtotime($freeTime[$i]));\n $time = strtotime($sch[0]['endA']);\n $endA = date(\"H:i\", strtotime($minTime, $time));\n $startB = date(\"H:i\",strtotime($sch[0]['startB']));\n if($startB==\"00:00\")\n $startB=\"23:59\";\n $time = strtotime($sch[0]['endB']);\n $endB = date(\"H:i\", strtotime($minTime, $time));\n if($t>=$endA && $t<$startB)\n unset($freeTime[$i]);\n }\n }\n //Query To Get All The Appointment Of Specific Day Of Specific Branch With Specific Service\n $sqlGetAllApp=\"SELECT appointment_time FROM appointment WHERE branch_id=? AND service_id=? AND appointment_date=?\";\n $values=array($branch_id,$serv,$date);\n $apps=$this->getInfo($sqlGetAllApp,$values);\n\n\n //loop To Take out all The Exists Time \n for($i=0;$i<count($freeTime);$i++)\n {\n if(isset($freeTime[$i]))//If this index exists\n {\n $t = date(\"H:i\",strtotime($freeTime[$i]));\n foreach($apps as $p)\n {\n $time = date(\"H:i\",strtotime($p['appointment_time']));\n if($t==$time)\n unset($freeTime[$i]);\n }\n }\n }\n //IF Its NightShift So We Remove ALl The Queues In The Next Day\n if($nightFlag==1)\n {\n $newDate=date($date);\n $newDate++;\n //Query To Get All The Appointment Of Specific Day Of Specific Branch With Specific Service\n $sqlGetAllApp=\"SELECT appointment_time FROM appointment WHERE branch_id=? AND service_id=? AND appointment_date=?\";\n $values=array($branch_id,$serv,$newDate);\n $apps=$this->getInfo($sqlGetAllApp,$values);\n\n\n //loop To Take out all The Exists Time \n for($i=0;$i<count($freeTime);$i++)\n {\n if(isset($freeTime[$i]))//If this index exists\n {\n $t = date(\"H:i\",strtotime($freeTime[$i]));\n foreach($apps as $p)\n {\n $time = date(\"H:i\",strtotime($p['appointment_time']));\n if($t==$time)\n unset($freeTime[$i]);\n }\n }\n }\n }\n \n //Paste The Selection List Code Of Time Except The Last One\n foreach($freeTime as $time)\n {\n if($time!=end($freeTime))//Except the ending time\n {\n $startAp = date(\"H:i\",strtotime($time));\n ?> \n <option value=\"<?php echo $startAp; ?>\"><?php echo $startAp; ?></option>\n <?php\n \n }\n }\n }", "public function timeWorkshop() {\n\t\t$pageTitle = 'Time Management Strategies Workshop';\n\t\t// $stylesheet = '';\n\n\t\tinclude_once SYSTEM_PATH.'/view/header.php';\n\t\tinclude_once SYSTEM_PATH.'/view/academic-help/owsub-time.php';\n\t\tinclude_once SYSTEM_PATH.'/view/footer.php';\n\t}", "function displayWeekEn(){\n $displayWeekEnQuery = $this->db->prepare(\n 'SELECT \n `dateStart`\n , `dateEnd`\n , `id_ap29f_dateRace` AS `raceId`\n FROM \n `ap29f_race`\n INNER JOIN \n `ap29f_dateRace` ON `ap29f_race`.`id_ap29f_dateRace` = `ap29f_dateRace`.`id`\n WHERE \n `id_ap29f_dateRace` = :id'\n );\n //data retourne un tableau d'objet\n $displayWeekEnQuery->bindValue(':id', $this->id, PDO::PARAM_STR);\n $displayWeekEnQuery->execute();\n return $displayWeekEnQuery->fetch(PDO::FETCH_OBJ);\n }", "protected function compileWeeks()\n\t{\n\t\t$intDaysInMonth = date('t', $this->Date->monthBegin);\n\t\t$intFirstDayOffset = date('w', $this->Date->monthBegin) - $this->cal_startDay;\n\n\t\tif ($intFirstDayOffset < 0)\n\t\t{\n\t\t\t$intFirstDayOffset += 7;\n\t\t}\n\n\t\t$intColumnCount = -1;\n\t\t$intNumberOfRows = ceil(($intDaysInMonth + $intFirstDayOffset) / 7);\n\t\t$arrAllEvents = $this->getAllEvents($this->iso_arrEventIDs, $this->cal_calendar, $this->Date->monthBegin, $this->Date->monthEnd);\n\t\t\n\t\t$arrDays = array();\n\n\t\t// Compile days\n\t\tfor ($i=1; $i<=($intNumberOfRows * 7); $i++)\n\t\t{\n\t\t\t$intWeek = floor(++$intColumnCount / 7);\n\t\t\t$intDay = $i - $intFirstDayOffset;\n\t\t\t$intCurrentDay = ($i + $this->cal_startDay) % 7;\n\n\t\t\t$strWeekClass = 'week_' . $intWeek;\n\t\t\t$strWeekClass .= ($intWeek == 0) ? ' first' : '';\n\t\t\t$strWeekClass .= ($intWeek == ($intNumberOfRows - 1)) ? ' last' : '';\n\n\t\t\t$strClass = ($intCurrentDay < 2) ? ' weekend' : '';\n\t\t\t$strClass .= ($i == 1 || $i == 8 || $i == 15 || $i == 22 || $i == 29 || $i == 36) ? ' col_first' : '';\n\t\t\t$strClass .= ($i == 7 || $i == 14 || $i == 21 || $i == 28 || $i == 35 || $i == 42) ? ' col_last' : '';\n\n\t\t\t// Empty cell\n\t\t\tif ($intDay < 1 || $intDay > $intDaysInMonth)\n\t\t\t{\n\t\t\t\t$arrDays[$strWeekClass][$i]['label'] = '&nbsp;';\n\t\t\t\t$arrDays[$strWeekClass][$i]['class'] = 'days empty' . $strClass ;\n\t\t\t\t$arrDays[$strWeekClass][$i]['events'] = array();\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$intKey = date('Ym', $this->Date->tstamp) . ((strlen($intDay) < 2) ? '0' . $intDay : $intDay);\n\t\t\t$strClass .= ($intKey == date('Ymd')) ? ' today' : '';\n\n\t\t\t// Mark the selected day (see #1784)\n\t\t\tif ($intKey == $this->Input->get('day'))\n\t\t\t{\n\t\t\t\t$strClass .= ' selected';\n\t\t\t}\n\n\t\t\t// Inactive days\n\t\t\tif (empty($intKey) || !isset($arrAllEvents[$intKey]))\n\t\t\t{\n\t\t\t\t$arrDays[$strWeekClass][$i]['label'] = $intDay;\n\t\t\t\t$arrDays[$strWeekClass][$i]['class'] = 'days' . $strClass;\n\t\t\t\t$arrDays[$strWeekClass][$i]['events'] = array();\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$arrEvents = array();\n\n\t\t\t// Get all events of a day\n\t\t\tforeach ($arrAllEvents[$intKey] as $v)\n\t\t\t{\n\t\t\t\tforeach ($v as $vv)\n\t\t\t\t{\n\t\t\t\t\t$arrEvents[] = $vv;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$arrDays[$strWeekClass][$i]['label'] = $intDay;\n\t\t\t$arrDays[$strWeekClass][$i]['class'] = 'days active' . $strClass;\n\t\t\t\n\t\t\t$arrDays[$strWeekClass][$i]['href'] = $this->strUrl . ($GLOBALS['TL_CONFIG']['disableAlias'] ? '?id=' . $this->Input->get('id') . '&amp;' : '?') . 'day=' . $intKey;\n\t\t\t\n\t\t\t$arrDays[$strWeekClass][$i]['title'] = sprintf(specialchars($GLOBALS['TL_LANG']['MSC']['cal_events']), count($arrEvents));\n\t\t\t$arrDays[$strWeekClass][$i]['events'] = $arrEvents;\n\t\t}\n\n\t\treturn $arrDays;\n\t}", "public function index($hall, $day)\n {\n $resultArray = \\App\\ScheduleItem::where('day', date_create(\"2018-05-$day\")->format('Y-m-d'))\n ->where('published', '1')\n ->where('break', '0')\n ->where('message', null)\n ->orderBy('start_time')\n ->get()\n ->groupBy('hall');\n\n if (isset($resultArray[$hall])) {\n $scheduleItemsByHall[$hall] = $resultArray[$hall];\n unset($resultArray[$hall]);\n foreach ($resultArray as $indexHall => $item) {\n $scheduleItemsByHall[$indexHall] = $item;\n }\n } else {\n $scheduleItemsByHall = $resultArray;\n }\n return view('talks-overview.talks-overview', compact('scheduleItemsByHall'));\n }", "function wc_marketplace_date2() {\n global $wmp;\n $wmp->output_report_date2();\n }", "function weekly_summary() {\r\n\t global $wpdb;\r\n\r\n $img_base = $this->plugin_url. 'images/';\r\n\r\n\t //count total\r\n $current_total = $wpdb->get_var(\"SELECT COUNT(*) FROM {$wpdb->base_prefix}pro_sites WHERE expire > '\" . time() . \"'\");\r\n\r\n\t $date = date(\"Y-m-d\", strtotime( \"-1 week\" ) );\r\n\t $last_total = $wpdb->get_var(\"SELECT supporter_count FROM {$wpdb->base_prefix}pro_sites_daily_stats WHERE date >= '$date' ORDER BY date ASC LIMIT 1\");\r\n\r\n\t if ($current_total > $last_total) {\r\n\t $active_diff = \"<img src='{$img_base}green-up.gif'><span style='font-size: 18px; font-family: arial;'>\" . number_format_i18n($current_total-$last_total) . \"</span>\";\r\n\t } else if ($current_total < $last_total) {\r\n\t $active_diff = \"<img src='{$img_base}red-down.gif'><span style='font-size: 18px; font-family: arial;'>\" . number_format_i18n(-($current_total-$last_total)) . \"</span>\";\r\n\t } else {\r\n\t $active_diff = \"<span style='font-size: 18px; font-family: arial;'>\" . __('no change', 'psts') . \"</span>\";\r\n\t }\r\n\r\n\t $text = sprintf(__('%s active Pro Sites %s since last week', 'psts'), \"<p><span style='font-size: 24px; font-family: arial;'>\" . number_format_i18n($current_total) . \"</span><span style='color: rgb(85, 85, 85);'>\", \"</span>$active_diff<span style='color: rgb(85, 85, 85);'>\") . \"</span></p>\";\r\n\r\n\t //activity stats\r\n\t $week_start = strtotime( \"-1 week\" );\r\n $week_start_date = date('Y-m-d', $week_start);\r\n\t $this_week['total_signups'] = $wpdb->get_var(\"SELECT COUNT(*) FROM {$wpdb->base_prefix}pro_sites_signup_stats WHERE action = 'signup' AND time_stamp >= '$week_start_date'\");\r\n\t $this_week['upgrades'] = $wpdb->get_var(\"SELECT COUNT(*) FROM {$wpdb->base_prefix}pro_sites_signup_stats WHERE action = 'upgrade' AND time_stamp >= '$week_start_date'\");\r\n\t $this_week['cancels'] = $wpdb->get_var(\"SELECT COUNT(*) FROM {$wpdb->base_prefix}pro_sites_signup_stats WHERE action = 'cancel' AND time_stamp >= '$week_start_date'\");\r\n\r\n\t $week_end = $week_start;\r\n\t $week_start = strtotime( \"-1 week\", $week_start );\r\n $week_start_date = date('Y-m-d', $week_start);\r\n $week_end_date = date('Y-m-d', $week_end);\r\n\t $last_week['total_signups'] = $wpdb->get_var(\"SELECT COUNT(*) FROM {$wpdb->base_prefix}pro_sites_signup_stats WHERE action = 'signup' AND time_stamp >= '$week_start_date' AND time_stamp < '$week_end_date'\");\r\n\t $last_week['upgrades'] = $wpdb->get_var(\"SELECT COUNT(*) FROM {$wpdb->base_prefix}pro_sites_signup_stats WHERE action = 'upgrade' AND time_stamp >= '$week_start_date' AND time_stamp < '$week_end_date'\");\r\n\t $last_week['cancels'] = $wpdb->get_var(\"SELECT COUNT(*) FROM {$wpdb->base_prefix}pro_sites_signup_stats WHERE action = 'cancel' AND time_stamp >= '$week_start_date' AND time_stamp < '$week_end_date'\");\r\n\r\n\t if ($this_week['total_signups'] > $last_week['total_signups']) {\r\n\t $diff = \"<img src='{$img_base}green-up.gif'><span style='font-size: 18px; font-family: arial;'>\" . number_format_i18n($this_week['total_signups']-$last_week['total_signups']) . \"</span>\";\r\n\t } else if ($this_week['total_signups'] < $last_week['total_signups']) {\r\n\t $diff = \"<img src='{$img_base}red-down.gif'><span style='font-size: 18px; font-family: arial;'>\" . number_format_i18n(-($this_week['total_signups']-$last_week['total_signups'])) . \"</span>\";\r\n\t } else {\r\n\t $diff = \"<span style='font-size: 18px; font-family: arial;'>\" . __('no change', 'psts') . \"</span>\";\r\n\t }\r\n\r\n $text .= sprintf(__('%s new signups this week %s compared to last week', 'psts'), \"\\n<p><span style='font-size: 24px; font-family: arial;'>\" . number_format_i18n($this_week['total_signups']) . \"</span><span style='color: rgb(85, 85, 85);'>\", \"</span>$diff<span style='color: rgb(85, 85, 85);'>\") . \"</span></p>\";\r\n\r\n\t if ($this_week['upgrades'] > $last_week['upgrades']) {\r\n\t $diff = \"<img src='{$img_base}green-up.gif'><span style='font-size: 18px; font-family: arial;'>\" . number_format_i18n($this_week['upgrades']-$last_week['upgrades']) . \"</span>\";\r\n\t } else if ($this_week['upgrades'] < $last_week['upgrades']) {\r\n\t $diff = \"<img src='{$img_base}red-down.gif'><span style='font-size: 18px; font-family: arial;'>\" . number_format_i18n(-($this_week['upgrades']-$last_week['upgrades'])) . \"</span>\";\r\n\t } else {\r\n\t $diff = \"<span style='font-size: 18px; font-family: arial;'>\" . __('no change', 'psts') . \"</span>\";\r\n\t }\r\n\r\n\t\t$text .= sprintf(__('%s upgrades this week %s compared to last week', 'psts'), \"\\n<p><span style='font-size: 24px; font-family: arial;'>\" . number_format_i18n($this_week['upgrades']) . \"</span><span style='color: rgb(85, 85, 85);'>\", \"</span>$diff<span style='color: rgb(85, 85, 85);'>\") . \"</span></p>\";\r\n\r\n\t if ($this_week['cancels'] > $last_week['cancels']) {\r\n\t $diff = \"<img src='{$img_base}red-up.gif'><span style='font-size: 18px; font-family: arial;'>\" . number_format_i18n($this_week['cancels']-$last_week['cancels']) . \"</span>\";\r\n\t } else if ($this_week['cancels'] < $last_week['cancels']) {\r\n\t $diff = \"<img src='{$img_base}green-down.gif'><span style='font-size: 18px; font-family: arial;'>\" . number_format_i18n(-($this_week['cancels']-$last_week['cancels'])) . \"</span>\";\r\n\t } else {\r\n\t $diff = \"<span style='font-size: 18px; font-family: arial;'>\" . __('no change', 'psts') . \"</span>\";\r\n\t }\r\n\r\n\t $text .= sprintf(__('%s cancelations this week %s compared to last week', 'psts'), \"\\n<p><span style='font-size: 24px; font-family: arial;'>\" . number_format_i18n($this_week['cancels']) . \"</span><span style='color: rgb(85, 85, 85);'>\", \"</span>$diff<span style='color: rgb(85, 85, 85);'>\") . \"</span></p>\";\r\n\r\n\t return $text;\r\n\t}", "function rabe_broadcast_times( $term_id ) {\n\n\t// Get broadcast object\n\t$broadcast = get_broadcast_by( 'id', $term_id );\n\t\n\t// Only run, when event-organiser is installed\n\tif ( ! function_exists( 'eo_get_events' ) ) return;\n\n\t$events = eo_get_events(\n\t\tarray(\n\t\t\t'posts_per_page'\t=> 10,\n\t\t\t'event_start_after'\t=> 'now',\n\t\t\t'tax_query'\t\t\t=> array(\n\t\t\t\tarray(\n\t\t\t\t\t'taxonomy' => 'broadcast',\n\t\t\t\t\t'field' => 'slug',\n\t\t\t\t\t'terms' => $broadcast->slug,\n\t\t\t\t),\n\t\t\t)\n\t\t)\n\t);\n\tif ( $events ) { ?>\n\t\t<div class=\"title\">\n\t\t\t<?php echo __( 'Next broadcasts', 'rabe' ); ?>\n\t\t</div>\n\t\t<div class=\"broadcast-times\">\n\t\t\t<ul id=\"eo-upcoming-dates\" class=\"more-dates\">\n\t\t\t<?php\n\n\t\t\tforeach ( $events as $event ) {\n\t\t\t\t// FIXME: Is this really needed?\n\t\t\t\t// setlocale( LC_TIME, 'de_CH' );\n\t\t\t\tprintf(\n\t\t\t\t'<li>%s, %s - %s</li>',\n\t\t\t\t\teo_get_the_start( 'D, j.n.', $event->ID, null, $event->occurrence_id ),\n\t\t\t\t\teo_get_the_start( get_option( 'time_format' ), $event->ID, null, $event->occurrence_id ),\n\t\t\t\t\teo_get_the_end( get_option( 'time_format' ), $event->ID, null, $event->occurrence_id )\n\t\t\t\t);\n\t\t\t}\n\t\t\t?>\n\t\t\t</ul>\n\t\t\t\t\n\t\t\t<?php\n\t \t\t\t//With the ID 'eo-upcoming-dates', JS will hide all but the next 5 dates, with options to show more.\n\t\t\twp_enqueue_script( 'eo_front' );\n\t\t\twp_reset_postdata();\n\t\t\t?>\n\t\t</div>\n\t\t<?php\n\t}\n\twp_reset_query();\n}", "public function fifth_hour_clockout($timesheet)\n\t{\n\t\t$sent_already = $this->CI->clockout_notifications_model->exists(\n\t\t\t$timesheet->user_id,\n\t\t\t'LUNCH'\n\t\t);\n\n\t\tif ($sent_already) return false;\n\n\t\t// Check if the user created a lunch timecard themselves\n\t\tif ($this->CI->timecard_model->user_took_lunch($timesheet->user_id)) return false;\n\n\t\t// Send notification to managers\n\t\t$this->CI->cfpslack_library->notify(\n\t\t\tsprintf(\n\t\t\t\t$this->CI->config->item('fifth_hour_admin'),\n\t\t\t\t$this->CI->user_model->get_name($timesheet->user_id),\n\t\t\t\t$timesheet->workorder_id,\n\t\t\t\t$timesheet->id\n\t\t\t)\n\t\t);\n\n\t\t// SMS the user\n\t\t$this->CI->sms_library->send(\n\t\t\t$timesheet->user_id,\n\t\t\t$this->CI->config->item('fifth_hour_sms'),\n\t\t\t$timesheet->workorder_id\n\t\t);\n\n\t\t// Mark sending\n\t\t$this->CI->clockout_notifications_model->create(\n\t\t\t$timesheet->user_id,\n\t\t\t'LUNCH',\n\t\t\t$timesheet->id\n\t\t);\n\n\t\treturn true;\n\t}", "public static function getFirstAndLastDaysOfTheWeek(){\n $date = new \\DateTime('2020-09-01');\n $week = [];\n for($i = 1; $i <= 50; $i++){\n $date = $date->modify('this week');\n $week[$i]['start'] = $date->modify('this week')->format('Y-m-d');\n $week[$i]['end'] = $date->modify('this week + 6 days')->format('Y-m-d');\n $date = $date->modify('+ 1 day');\n }\n return $week;\n }", "public function index()\n {\n $timesheets = Timesheet::all();\n\n return view('timesheets.index')->with('timesheets', $timesheets);\n }", "public function getDayOfTheWeek();", "public function detailedtimesheetAction()\r\n {\r\n $project = $this->projectService->getProject($this->_getParam('projectid'));\r\n $client = $this->clientService->getClient($this->_getParam('clientid'));\r\n $task = $this->projectService->getTask($this->_getParam('taskid'));\r\n $user = $this->userService->getUserByField('username', $this->_getParam('username'));\r\n\t\t\r\n if (!$project && !$client && !$task && !$user) {\r\n return;\r\n }\r\n\r\n\t\tif ($task) { \r\n $this->view->records = $this->projectService->getDetailedTimesheet(null, $task->id);\r\n } else if ($project) {\r\n \r\n $start = null;\r\n $this->view->records = $this->projectService->getDetailedTimesheet(null, null, $project->id);\r\n } else if ($client) {\r\n \r\n $start = null;\r\n $this->view->records = $this->projectService->getDetailedTimesheet(null, null, null, $client->id);\r\n } else if ($user) {\r\n\t\t\t$this->view->records = $this->projectService->getDetailedTimesheet($user);\r\n\t\t}\r\n\r\n\t\t$this->view->task = $task;\r\n $this->renderRawView('timesheet/ajax-timesheet-details.php');\r\n }", "public function add_week($arr_task_id = '')\n\t {\n\t \techo '<pre>';\n\t \tif($arr_task_id == '' || $arr_task_id == array()){\n\t \t\treturn false;\n\t \t}else{\n\t\t \t//task info\n\t\t\t$where['task_id'] = $arr_task_id;\n\t\t\t//$where['task_id'] = 1424;//test,frequency based on week, 3 times per week\n\t\t\t//$where['task_id'] = 1607;//test,frequency based on week, 3 times per week, Collin\n\t\t\t//$where['task_id'] = 1423;//test,frequency based on week, 2 times per week\n\t\t\t//$where['task_id'] = 1609;//test,frequency based on week, 1 time per 2 weeks\n\t\t\t//$where['task_id'] = 1610;//test,frequency based on month, 2 times per 3 months\n\t\t\t//$where['task_id'] = 1797;//test\n\n\t\t\t$task_res = $this->task_model->lists($this->task_lists_fields, $where, $like, $json = true, $orderby, $page, $pagesize);\n\n\t\t\t$total_cycle = 0;\n\t\t\t//assign year and week to schedule\n\t\t\tforeach($task_res['result'] as $res){\n\n\t\t\t\t//var_dump($res->cycle/(52*$res->year), $res->cycle/(54*$res->year), $res->year);\n\n\t\t\t\t//frequency based on month or week, if it's week then 99.999999% is debris, cycles per year inclues: 26, 52, 104, 156,,, 27, 54, 108, 162\n\t\t\t\tif(is_int($res->cycle/(52*$res->year)) || is_int($res->cycle/(54*$res->year)) || $res->cycle/(52*$res->year) == 0.5 || $res->cycle/(54*$res->year) == 0.5){//by week\n\t\t\t\t\t\n\t\t\t\t\t$ini_dayyyyyyy = date('w', strtotime($res->bdate));\n\t\t\t\t\t$ini_date = date('N',strtotime($res->bdate)) == 1 ? $res->bdate : date('Y-m-d',strtotime('+ '.(8-$ini_dayyyyyyy).' days', strtotime($res->bdate)));//set initial date to next Monday. Cities don't allow debirs work on Sunday\n\t\t\t\t\t\n\n\n\t\t\t\t\t$frequencyPerWeek = $res->cycle/(52*$res->year) ? $res->cycle/(52*$res->year) : $res->cycle/(54*$res->year) ; \n\t\t\t\t\t$addMaxDate = $frequencyPerWeek == 0.5 ? 13 : 6;//calculate maxdate, when one time per 2 weeks, the period will be 2 weeks; otherwise it's 1 week\n\n\n\t\t\t\t\tfor( $i=1; $i <= $res->cycle ; $i++){\n\t\t\t\t\t\t/*if($ini_month <= 12){\n\t\t\t\t\t\t\t$modi_year = $ini_year;\n\t\t\t\t\t\t\t$modi_week = $ini_week;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$modi_year = $ini_year = $ini_year + 1;\n\t\t\t\t\t\t\t$modi_week = $ini_week = $ini_week - 12;\n\t\t\t\t\t\t}*/\n\n\t\t\t\t\t\t$mindate = $ini_date;\n\t\t\t\t\t\t$maxdate = date('Y-m-d', strtotime(\"+ \".$addMaxDate.\" days\", strtotime($mindate)));\n\n\t\t\t\t\t\tswitch ($frequencyPerWeek) {//cycle per week\n\t\t\t\t\t\t\tcase 3 :\n\n\t\t\t\t\t\t\t\tif($i % 3 == 1){\n\t\t\t\t\t\t\t\t\t$work_weekday = $ini_date;\n\t\t\t\t\t\t\t\t}elseif($i % 3 == 2){\n\t\t\t\t\t\t\t\t\t$work_weekday = date('Y-m-d', strtotime('+ 2 days', strtotime($ini_date)));\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t$work_weekday = date('Y-m-d', strtotime('+ 4 days', strtotime($ini_date)));\n\n\t\t\t\t\t\t\t\t\t$ini_date = date('Y-m-d', strtotime('+ 7 days', strtotime($ini_date)));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\tif($i == 1 ) $ini_date = date('Y-m-d', strtotime('+ 1 days', strtotime($ini_date)));//starts on Tuesday\n\n\t\t\t\t\t\t\t\tif($i % 2 == 1){\n\t\t\t\t\t\t\t\t\t$work_weekday = $ini_date;\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t$work_weekday = date('Y-m-d', strtotime('+ 2 days', strtotime($ini_date)));\n\n\t\t\t\t\t\t\t\t\t$ini_date = date('Y-m-d', strtotime('+ 7 days', strtotime($ini_date)));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\t$work_weekday = $ini_date;\n\n\t\t\t\t\t\t\t\t$ini_date = date('Y-m-d', strtotime('+ 7 days', strtotime($ini_date)));\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 0.5:\n\t\t\t\t\t\t\t\t$work_weekday = $ini_date;\n\n\t\t\t\t\t\t\t\t$ini_date = date('Y-m-d', strtotime('+ 14 days', strtotime($ini_date)));\n\t\t\t\t\t\t\t\tbreak;\n\n\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t$this->redirect(BASE_URL().'task/add_csv','ask IT (week mod)'.$res->cycle);exit;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$insert_data['mindate'] = $mindate;\n\t\t\t\t\t\t$insert_data['maxdate'] = $maxdate;\n\t\t\t\t\t\t$insert_data['schedule_year'] = date('Y', strtotime($work_weekday));\n\t\t\t\t\t\t$insert_data['schedule_month'] = date('n', strtotime($work_weekday));\n\t\t\t\t\t\t$insert_data['schedule_week'] = date('N', strtotime($work_weekday)) != 7 ? ltrim(date('W', strtotime($work_weekday)), '0') : ltrim(date('W', strtotime($work_weekday)), '0') + 1;//week starts from Sunday\n\t\t\t\t\t\t$insert_data['schedule_date'] = $work_weekday;\n\t\t\t\t\t\t$insert_data['task_id'] = $res->task_id;\n\t\t\t\t\t\t$insert_data['addtime'] = date('Y-m-d H:i:s');\n\n\t\t\t\t\t\t//$insert_data['ini_month'] = $ini_month;//test\n\t\t\t\t\t\t//$insert_data['cycle'] = $res->cycle;//test\n\t\t\t\t\t\t//$insert_data['total_year'] = $res->year;//test\n\t\t\t\t\t\t//$insert_data['total_month'] = $res->month;//test\n\n\t\t\t\t\t\t$insert_week[] = $insert_data;\t\t\n\t\t\t\t\t}\n\n\t\t\t\t}else{//by month\n\n\t\t\t\t\t$ini_year = date('Y',strtotime($res->bdate));\n\t\t\t\t\t$ini_month = date('n',strtotime($res->bdate));\n\n\t\t\t\t\t//only for harris county\n\t\t\t\t\tif($res->contract_id == 11 && $res->cycle == 18){\n\t\t\t\t\t\t$ini_year = 2017;\n\t\t\t\t\t\t$ini_month = 3;\n\t\t\t\t\t}\n\n\t\t\t\t\t//settttttttingggggggggg\n\t\t\t\t\t$settle_to_next_week_1 = 4;//Thursday\n\t\t\t\t\t$settle_to_next_week_14 = $settle_to_next_week_1 - 1;//one day before $settle_to_next_week_1\n\n\t\t\t\t\t//var_dump($ini_year,$ini_month);//testing\n\t\t\t\t\tfor( $i=1; $i <= $res->cycle ; $i++){\n\t\t\t\t\t\tif($ini_month <= 12){\n\t\t\t\t\t\t\t$modi_year = $ini_year;\n\t\t\t\t\t\t\t$modi_month = $ini_month;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$modi_year = $ini_year = $ini_year + 1;\n\t\t\t\t\t\t\t$modi_month = $ini_month = $ini_month - 12;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\n\t\t\t\t\t\tswitch ($res->cycle/$res->month) {//cycle per month\n\n\t\t\t\t\t\t\t//case 12://cycle per year\n\t\t\t\t\t\t\tcase 1://cycle per month\n\n\t\t\t\t\t\t\t\t$work_weekday = $modi_year.'-'.$modi_month.'-01';\n\n\t\t\t\t\t\t\t\t$settle_to_next_week = $settle_to_next_week_1;\n\n\t\t\t\t\t\t\t\t//one month period\n\t\t\t\t\t\t\t\t$insert_data['mindate'] = date('Y-m-01', strtotime($work_weekday));\n\t\t\t\t\t\t\t\t$insert_data['maxdate'] = date('Y-m-t', strtotime($work_weekday));\n\n\t\t\t\t\t\t\t\t$ini_month ++;\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//case 18://cycle per year\n\t\t\t\t\t\t\tcase 1.5://cycle per month\n\t\t\t\t\t\t\t\tif($i % 3 == 1){\n\n\t\t\t\t\t\t\t\t\t$work_weekday = $modi_year.'-'.$modi_month.'-01';\n\n\t\t\t\t\t\t\t\t\t$settle_to_next_week = $settle_to_next_week_1;\n\n\t\t\t\t\t\t\t\t\t//two months period\n\t\t\t\t\t\t\t\t\t$insert_data['mindate'] = date('Y-m-01', strtotime($work_weekday));\n\t\t\t\t\t\t\t\t\t$insert_data['maxdate'] = date('Y-m-t', strtotime('+ 1 month', strtotime($work_weekday)));\n\n\t\t\t\t\t\t\t\t}elseif($i % 3 == 2){\n\n\t\t\t\t\t\t\t\t\t$work_weekday = $modi_year.'-'.$modi_month.'-14';\n\n\t\t\t\t\t\t\t\t\t$settle_to_next_week = $settle_to_next_week_14;\n\n\t\t\t\t\t\t\t\t\t//two months period\n\t\t\t\t\t\t\t\t\t$insert_data['mindate'] = date('Y-m-01', strtotime($work_weekday));\n\t\t\t\t\t\t\t\t\t$insert_data['maxdate'] = date('Y-m-t', strtotime('+ 1 month', strtotime($work_weekday)));\n\n\t\t\t\t\t\t\t\t\t$ini_month ++;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}else{\n\n\t\t\t\t\t\t\t\t\t$work_weekday = $modi_year.'-'.$modi_month.'-01';\n\n\t\t\t\t\t\t\t\t\t$settle_to_next_week = $settle_to_next_week_1;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//two months period\n\t\t\t\t\t\t\t\t\t$insert_data['mindate'] = date('Y-m-01', strtotime('- 1 month', strtotime($work_weekday)));\n\t\t\t\t\t\t\t\t\t$insert_data['maxdate'] = date('Y-m-t', strtotime($work_weekday));\n\n\t\t\t\t\t\t\t\t\t$ini_month ++;\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t//case 24://cycle per year\n\t\t\t\t\t\t\tcase 2://cycle per month\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif($i % 2 == 1){\n\n\t\t\t\t\t\t\t\t\t$work_weekday = $modi_year.'-'.$modi_month.'-01';\n\n\t\t\t\t\t\t\t\t\t$settle_to_next_week = $settle_to_next_week_1;\n\n\t\t\t\t\t\t\t\t\t//first 2 weeks of the month\n\t\t\t\t\t\t\t\t\t$insert_data['mindate'] = date('Y-m-01', strtotime($work_weekday));\n\t\t\t\t\t\t\t\t\t$insert_data['maxdate'] = date('Y-m-d', strtotime('+ 14 days', strtotime($work_weekday)));\n\n\t\t\t\t\t\t\t\t}else{\n\n\t\t\t\t\t\t\t\t\t$work_weekday = $modi_year.'-'.$modi_month.'-14';\n\n\t\t\t\t\t\t\t\t\t$settle_to_next_week = $settle_to_next_week_14;\n\n\t\t\t\t\t\t\t\t\t//last 2 weeks of the month\n\t\t\t\t\t\t\t\t\t$insert_data['mindate'] = date('Y-m-d', strtotime($work_weekday));\n\t\t\t\t\t\t\t\t\t$insert_data['maxdate'] = date('Y-m-t', strtotime($work_weekday));\n\n\t\t\t\t\t\t\t\t\t$ini_month ++;\n\n\t\t\t\t\t\t\t\t}\t\n\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault://months per cycle: 2,3,4,6,\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//$ini_month += 12 * $res->year / $res->cycle ;//per year\n\t\t\t\t\t\t\t\t$month_per_cycle = $res->month / $res->cycle ;//month per cycle\n\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif($res->contract_id == 85 && $res->cycle == 18){//only for harris county\n\t\t\t\t\t\t\t\t\t$work_weekday = $modi_year.'-'.$modi_month.'-01';//1st week\n\t\t\t\t\t\t\t\t\t//if(date(\"N\", strtotime($work_weekday)) >= $settle_to_next_week_1) $work_weekday = date('Y-m-d', strtotime('+1 week',strtotime($work_weekday)));\n\n\t\t\t\t\t\t\t\t\t$settle_to_next_week = $settle_to_next_week_1;\n\n\t\t\t\t\t\t\t\t\t$ini_month += 1 ;\n\n\t\t\t\t\t\t\t\t\t$insert_data['mindate'] = date('Y-m-01', strtotime($work_weekday));\n\t\t\t\t\t\t\t\t\t$insert_data['maxdate'] = date('Y-m-t', strtotime($work_weekday));\n\t\t\t\t\t\t\t\t\t//break;\n\t\t\t\t\t\t\t\t}elseif(is_int($month_per_cycle)){\n\n\t\t\t\t\t\t\t\t\t$work_weekday = $modi_year.'-'.$modi_month.'-14' ;\n\n\t\t\t\t\t\t\t\t\t$settle_to_next_week = $settle_to_next_week_14;\n\n\t\t\t\t\t\t\t\t\t$ini_month += $month_per_cycle ;\n\n\t\t\t\t\t\t\t\t\t//months period\n\t\t\t\t\t\t\t\t\t$insert_data['mindate'] = date('Y-m-01', strtotime($work_weekday));\n\t\t\t\t\t\t\t\t\t$insert_data['maxdate'] = date('Y-m-t', strtotime(\"+ \".($month_per_cycle - 1).\" months\", strtotime($work_weekday)));\n\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}elseif($month_per_cycle = 1.5){//twice per 3 months\n\n\t\t\t\t\t\t\t\t\t$work_weekday = $modi_year.'-'.$modi_month.'-01' ;\n\n\t\t\t\t\t\t\t\t\t$settle_to_next_week = $settle_to_next_week_1;\n\n\t\t\t\t\t\t\t\t\t$insert_data['mindate'] = date('Y-m-01', strtotime($work_weekday));\n\t\t\t\t\t\t\t\t\t$insert_data['maxdate'] = date('Y-m-t', strtotime(\"+ 1 months\", strtotime($work_weekday)));\n\n\t\t\t\t\t\t\t\t\tif($i % 2 == 1){\n\t\t\t\t\t\t\t\t\t\t$ini_month += 1 ;\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t$ini_month += 2 ;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t$this->redirect(BASE_URL().'task/add_csv','ask IT (month mod)'.$res->cycle);exit;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$dayyyy = date('w', strtotime($work_weekday));\n\t\t\t\t\t\tif($res->task_id == 446)var_dump($work_weekday);\n\t\t\t\t\t\t//when schedule is after $settle_to_next_week, set up to next Sunday\n\t\t\t\t\t\tif(date(\"w\", strtotime($work_weekday)) >= $settle_to_next_week) $work_weekday = date('Y-m-d', strtotime('+ '.(7 - $dayyyy).' days',strtotime($work_weekday)));\n\n\t\t\t\t\t\t//when date is 14, set up to previous Sunday\n\t\t\t\t\t\tif(date(\"d\", strtotime($work_weekday)) == 14) {\n\t\t\t\t\t\t\t$work_weekday = date('Y-m-d', strtotime('- '.$dayyyy.' days',strtotime($work_weekday)));\n\t\t\t\t\t\t\t$insert_data['mindate'] = date('Y-m-d', strtotime($work_weekday));\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\n\t\t\t\t\t\t$insert_data['schedule_year'] = $modi_year;\n\t\t\t\t\t\t$insert_data['schedule_month'] = $modi_month;\n\t\t\t\t\t\t$insert_data['schedule_week'] = date('N', strtotime($work_weekday)) != 7 ? ltrim(date('W', strtotime($work_weekday)), '0') : ltrim(date('W', strtotime($work_weekday)), '0') + 1;//week starts from Sunday\n\t\t\t\t\t\t$insert_data['schedule_date'] = $work_weekday;\n\t\t\t\t\t\t$insert_data['task_id'] = $res->task_id;\n\t\t\t\t\t\t$insert_data['unit_price'] = $res->unit_price;\n\t\t\t\t\t\t$insert_data['addtime'] = date('Y-m-d H:i:s');\n\n\t\t\t\t\t\t$insert_data['ini_month'] = $ini_month;//test\n\t\t\t\t\t\t$insert_data['cycle'] = $res->cycle;//test\n\t\t\t\t\t\t$insert_data['total_year'] = $res->year;//test\n\t\t\t\t\t\t$insert_data['total_month'] = $res->month;//test\n\n\t\t\t\t\t\t$insert_week[] = $insert_data;\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//echo $res->task_id; echo \"&nbsp;\"; echo $total_cycle += $res->cycle; echo '<br>'; \n\t\t\t\tunset($modi_year);\n\t\t\t\tunset($modi_month);\n\t\t\t\tunset($date_week3);\n\t\t\t\tunset($insert_data);\n\t\t\t}\n\t\t\t//echo \"<pre>\";\n\t\t\t//var_dump($insert_week);exit;\n\n\t\t\t//insert into schedule, and update task ifweek\n\t\t\t$insert_res = $this->schedule_model->add_batch($insert_week);\n\n\t\t\tif($insert_res){\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t \t}\n\t \t\n\t }", "function showWeek53($cyear) {\r\n\t$ShowWeek53 = false ;\r\n\t$weeknum = weekNumber(31,12,$cyear) ;\r\n\tif ($weeknum>52) $ShowWeek53 = $weeknum ;\r\n\tsettype($ShowWeek53,\"integer\");\r\n\treturn $ShowWeek53 ;\r\n}", "function todaysactivities()\n {\n $variables = array();\n $userdetails = $this->userInfo();\n $paitent_id = $userdetails['user_id'];\n $day = $this->getPaitentCurrentDay($paitent_id);\n $day = ($day % 7) + 1;\n $variables['currday'] = $day;\n\n $video = $this->getPaitentVideoByDay($paitent_id, $day);\n $total_count = count($video);\n $variables['total_items'] = $total_count;\n //print_r($video);\n\n $this->output = $this->build_template($this->get_template('todaysactivities'), $variables);\n }", "public function close_timesheet($timesheet)\n\t{\n\t\t$date = Carbon::now();\n\n\t\t$this->CI->timecard_model->timecard_update(\n\t\t\t$timesheet->id,\n\t\t\t$date->format('h'),\n\t\t\t$date->format('i'),\n\t\t\t$date->format('A'),\n\t\t\t$timesheet->user_id\n\t\t);\n\t}", "function nextWeek(){ return $this->_getDate(7);\t}", "public function getDateEndWeek($date=null){\n\t\t$dateNew = date(\"Y-m-d H:i:s\",strtotime('sunday this week', strtotime($date)));\n\t\treturn $dateNew;\n\t}", "public static function hour()\n\t{\n\t\t$reservations = \\Model_Lessontime::find(\"all\", [\n\t\t\t\"where\" => [\n\t\t\t\t[\"deleted_at\", 0],\n\t\t\t\t[\"status\", 1],\n\t\t\t\t[\"freetime_at\", \"<=\", time() + 3600],\n\t\t\t\t[\"freetime_at\", \">=\", time()],\n\t\t\t]\n\t\t]);\n\n\t\tforeach($reservations as $reservation){\n\n\t\t\t// for teacher\n\t\t\t$url = \"http://game-bootcamp.com/teachers/top\";\n\n\t\t\t$body = \\View::forge(\"email/teachers/reminder_1hour\",[\"url\" => $url]);\n\t\t\t$sendmail = \\Email::forge(\"JIS\");\n\t\t\t$sendmail->from(\\Config::get(\"statics.info_email\"),\\Config::get(\"statics.info_name\"));\n\t\t\t$sendmail->to($reservation->teacher->email);\n\t\t\t$sendmail->subject(\"Your lesson will start.\");\n\t\t\t$sendmail->html_body(htmlspecialchars_decode($body));\n\n\t\t\t$sendmail->send();\n\n\t\t\t// for student\n\t\t\t$url = \"http://game-bootcamp.com/students/top\";\n\n\t\t\t$body = \\View::forge(\"email/students/reminder_1hour\",[\"url\" => $url]);\n\t\t\t$sendmail = \\Email::forge(\"JIS\");\n\t\t\t$sendmail->from(\\Config::get(\"statics.info_email\"),\\Config::get(\"statics.info_name\"));\n\t\t\t$sendmail->to($reservation->student->email);\n\t\t\t$sendmail->subject(\"Your lesson will start.\");\n\t\t\t$sendmail->html_body(htmlspecialchars_decode($body));\n\n\t\t\t$sendmail->send();\n\t\t}\n\t}", "public function createAppointmentEndTime()\n {\n $dateTime = strtotime(\"+\" . $this->getEndTimeslot()->getWeight() * 900 . \" seconds\", $this->getAppointmentDate()->format('U'));\n $currentDateTime = new \\DateTime();\n $currentDateTime->setTimestamp($dateTime);\n $this->setHiddenAppointmentEndTime($currentDateTime);\n return;\n }", "public function actionIndex($week = '', $id = null)\n {\n try {\n if ($id) {\n if (Yii::$app->user->id != $id) {\n if (!AuthHelper::isAdmin()) {\n throw new UnauthorizedHttpException();\n }\n }\n } else {\n $id = Yii::$app->user->id;\n }\n $date = new DateTime();\n $dateStr = $date->format(Constants::DATE_FORMAT);\n if (!empty($week)) {\n $dateStr = $week;\n $date = DateTime::createFromFormat(Constants::DATE_FORMAT, $dateStr); \n }\n $dayOfWeek = $date->format('N');//1 Monday, 7: Sunday \n $fromStr = date(Constants::DATE_DISPLAY_FORMAT, strtotime($dateStr.' -'.($dayOfWeek - 1).' day'));\n $fromDate = date(Constants::DATE_FORMAT, strtotime($dateStr.' -'.($dayOfWeek - 1).' day'));\n $previousDate = date(Constants::DATE_FORMAT, strtotime($dateStr.' -'.$dayOfWeek.' day'));\n $toStr = date(Constants::DATE_DISPLAY_FORMAT, strtotime($dateStr.' +'.(7 - $dayOfWeek).' day'));\n $nextDate = date(Constants::DATE_FORMAT, strtotime($dateStr.' +'.(8 - $dayOfWeek).' day'));\n Yii::trace(\"dayOfWeek $dayOfWeek - From $fromStr - To $toStr\");\n \n $searchModel = new TimetableSearch();\n $params = Yii::$app->request->queryParams;\n $params['TimetableSearch']['week'] = $fromDate;\n $params['TimetableSearch']['user_id'] = $id;\n $dataProvider = $searchModel->search($params);\n\n if ($dataProvider->getCount() == 0) {\n $dataProvider = new EmptyDataProvider(new Timetable());\n }\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'fromStr' => $fromStr,\n 'toStr' => $toStr,\n 'fromDate' => $fromDate,\n 'previousDate' => $previousDate,\n 'nextDate' => $nextDate,\n ]);\n } catch (Exception $ex) {\n throw new InvalidArgumentException();\n } \n }", "public function printTalkRoster($week) {\n\n\t\ttry {\n\t\t\tif (empty($week)) {\n\t\t\t\tthrow new \\Exception('Week is missing.');\n\t\t\t}\n\t\t\t$start_date = Carbon::parse($week)->startOfWeek();\n\t\t\t$end_date = $start_date->copy()->addDays(6);\n\n\t\t\t$user = \\Auth::User();\n\n\t\t\t$station_id = $user->station->id;\n\n\t\t\t$talk_shows = \\App\\ConnectContent::where('content_type_id', ContentType::GetTalkContentTypeID())\n\t\t\t\t->where('station_id', $station_id)\n\t\t\t\t->where('start_date', '<', $end_date)\n\t\t\t\t->where('end_date', '>', $start_date)\n\t\t\t\t->get();\n\n\t\t\t$events = [];\n\n\t\t\tforeach($talk_shows as $talk_show) {\n\t\t\t\t$event['id'] = $talk_show['id'];\n\t\t\t\t$event['title'] = $talk_show['what'];\n\t\t\t\t$event['start'] = $talk_show['start_time'];\n\t\t\t\t$event['end'] = $talk_show['end_time'];\n\t\t\t\t$event['who'] = $talk_show['who'];\n\n\t\t\t\t$dow = [];\n\t\t\t\tif($talk_show['content_weekday_0']) {\n\t\t\t\t\t$dow[] = 0;\n\t\t\t\t}\n\t\t\t\tif($talk_show['content_weekday_1']) {\n\t\t\t\t\t$dow[] = 1;\n\t\t\t\t}\n\t\t\t\tif($talk_show['content_weekday_2']) {\n\t\t\t\t\t$dow[] = 2;\n\t\t\t\t}\n\t\t\t\tif($talk_show['content_weekday_3']) {\n\t\t\t\t\t$dow[] = 3;\n\t\t\t\t}\n\t\t\t\tif($talk_show['content_weekday_4']) {\n\t\t\t\t\t$dow[] = 4;\n\t\t\t\t}\n\t\t\t\tif($talk_show['content_weekday_5']) {\n\t\t\t\t\t$dow[] = 5;\n\t\t\t\t}\n\t\t\t\tif($talk_show['content_weekday_6']) {\n\t\t\t\t\t$dow[] = 6;\n\t\t\t\t}\n\n\t\t\t\t$event['dow'] = $dow;\n\t\t\t\t$event['is_ready'] = $talk_show['is_ready'];\n\t\t\t\t$event['className'] = $talk_show['is_ready'] ? '' : 'not-ready';\n\t\t\t\t$range['start'] = $talk_show->start_date;\n\t\t\t\t$range['end'] = $talk_show->end_date;\n\t\t\t\t$event['ranges'] = array($range);\n\t\t\t\t$event['url'] = 'javascript:void(0)';\n\n\t\t\t\t$events[] = $event;\n\t\t\t}\n\n\t\t\t$content = ConnectContent::findOrFail(3623);\n\n\t\t\tif ($content->content_type_id != ContentType::GetMaterialInstructionContentTypeID()) {\n\t\t\t\tthrow new \\Exception('Content type is Invalid.');\n\t\t\t}\n//\n//\t\t\t$pdf = \\App::make('dompdf.wrapper');\n//\n//\t\t\t$pdf->loadView('pdf.talkroster', array('content' => $content));\n\n\t\t\treturn view('pdf.talkroster')->with('content', $content)\n\t\t\t\t->with('talk_shows', $talk_shows);\n\n//\t\t\treturn $pdf->download($content->getPrintFileName());\n\n\t\t\t//return view('pdf.materialInstruction')->with('content', $content);\n\n\t\t} catch (\\Exception $ex){\n\t\t\t\\Log::error($ex);\n\t\t\treturn response($ex->getMessage(), 500);\n\t\t}\n\n\t}", "function LoadWeek($WeekNumber)\n {\n //Construction du tableau\n $days = array('lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi','samedi','dimanche');\n\n //Semaine en cours\n $week = ($WeekNumber == 'current')? date('W') : $WeekNumber;\n $year = date('Y');\n echo $StartDate = Date::GetFirstDay($week, $year);\n\n //Affichage de la semaine et des controles de selection\n $html = $this->GetTool($week);\n\n $html .= \"<div class='content-panel'>\";\n //Tableau de la semaine\n $html .= \"<table id='taAgenda' class='calendar'>\";\n\n //Entete\n $html .= '<tr>';\n $html .= '<td class=\"subTitle\"></td>';\n\n //\n $dateDay = array();\n foreach($days as $day)\n {\n //Creation de la date actuelle\n $dateDay[] = $StartDate;\n\n $html .=\t'<th class=\"subTitle\">'.$this->Core->GetCode($day);\n $html .= '<span class=\"calendar date\">'.$StartDate.'</span>';\n $html .= '</th>';\n\n $StartDate = Date::AddDay($StartDate, 1);\n }\n\n //Creation des lignes\n $html .= '</tr>';\n\n //recuperation des evenements de l'utilisateur\n echo \"DateStart : \" . $DateStart = Date::AddDay($dateDay[0],-1, true);\n echo \"Date End :\" . $DateEnd = Date::AddDay($dateDay[0],7, true);\n\n $AgendaEvent = new AgendaEvent($this->Core);\n $AgendaEvent->AddArgument(new Argument(\"Apps\\Agenda\\Entity\\AgendaEvent\", \"UserId\", EQUAL, $this->Core->User->IdEntite));\n $AgendaEvent->AddArgument(new Argument(\"Apps\\Agenda\\Entity\\AgendaEvent\", \"DateStart\", MORE, $DateStart));\n $AgendaEvent->AddArgument(new Argument(\"Apps\\Agenda\\Entity\\AgendaEvent\", \"DateEnd\", LESS, $DateEnd));\n $EventsUser = $AgendaEvent->GetByArg();\n\n //Recuperation Des évenement ou l'utilisateur est invités\n $EventInvits = AgendaEvent::GetInvitation($this->Core, $this->Core->User->IdEntite, $DateStart, $DateEnd);\n\n for($hours=0; $hours < 24; $hours++)\n {\n $html .= '<tr>';\n\n if($hours < 10)\n {\n $hours = \"0\".$hours;\n }\n\n $html .= '<td>'.$hours.':00</td>';\n\n //Parcourt des jours\n //foreach($dateDay as $day)\n for($d = 0; $d < count($dateDay) ; $d++ )\n {\n //Charge un tableau avec touts les rendez-vous\n $drawCell = true;\n\n //Parcourt des rendez-vous de l'utilisateur\n if(count($EventsUser) > 0)\n {\n foreach($EventsUser as $event)\n {\n echo \"DATE :\" . $event->DateStart->Value . \"\" . $dateDay[$d].' '.$hours.':00:00';\n \n //Evenement qui commence dans la cellule\n if($event->DateStart->Value == $dateDay[$d].' '.$hours.':00:00' )\n {\n //Dimension de l'evenement\n $rowSpan = DateHelper::GetDiffHour($event->DateStart->Value, $event->DateEnd->Value);\n $colSpan = DateHelper::GetDiffDay($event->DateStart->Value, $event->DateEnd->Value);\n\n\n //Affichage de la cellule\n $html .=\t '<td id=\"'.$dateDay[$d].'!'.$hours.'\" >';\n $html .= $this->GetEvent($event, $colSpan, $rowSpan);\n $html.='</td>';\n\n $drawCell = false;\n }\n }\n }\n\n //Evenements invités\n if(count($EventInvits) > 0)\n {\n foreach($EventInvits as $event)\n {\n //Evenement qui commence dans la cellule\n if($event->Event->Value->DateStart->Value == $dateDay[$d].' '.$hours.':00:00' )\n {\n //Dimension de l'evenement\n $rowSpan = DateHelper::GetDiffHour($event->Event->Value->DateStart->Value, $event->Event->Value->DateEnd->Value);\n $colSpan = DateHelper::GetDiffDay($event->Event->Value->DateStart->Value, $event->Event->Value->DateEnd->Value);\n\n //Affichage de la cellule\n //$html .=\t '<td id=\"'.$day.'!'.$hours.'\" colspan=\"'.$colSpan.'\" rowspan=\"'.$rowSpan.'\" >';\n $html .=\t '<td id=\"'.$dateDay[$d].'!'.$hours.'\" >';\n\n $html .=\t$this->GetInvit($event, $colSpan, $rowSpan);\n $html.='</td>';\n\n $drawCell = false;\n }\n }\n }\n\n //La cellule n'a pas d'évenement\n if($drawCell)\n {\n $html .=\t '<td id=\"'.$dateDay[$d].'!'.$hours.'\"></td>';\n }\n }\n\n $html .= '</tr>';\n }\n $html .= \"</table'>\";\n\n $html .= \"</div>\";\n\n echo $html;\n }", "function analyzeTimeline() {\n\t\tglobal $timestart; \n\t\t$now = new DateTime; \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t$now->modify('+1 week'); \t\t\t\t\t\t\t\t\t\t\t\t\t\t// add a week, so the current week is not cut off\n\t\t\n\n\t\t// weekly data\n\t\t$this->weeklyAnalysis = array(); \n\t\t$start = clone $timestart;\n\t\t\n\t\twhile ( $start < $now ) {\n\t\t\t$Y = $start->format(\"Y\");\n\t\t\t$w = $start->format(\"W\"); \n\t\t\t\n\t\t\t// total\n\t\t\t$this->weeklyAnalysis[$Y.'-'.$w]['week'] = $Y.'-'.$w;\n\t\t\t$this->weeklyAnalysis[$Y.'-'.$w]['total'] = 0;\t\t\t\t\t\t\t\t// amount of hours worked\n\t\t\t$this->weeklyAnalysis[$Y.'-'.$w]['jobcount'] = 0;\t\t\t\t\t\t\t// amount of jobs recorded\t\n\t\t\t$this->weeklyAnalysis[$Y.'-'.$w]['jobs'] = array();\t\t\t\t\t\t\t// list of jobs recorded\n\t\t\t\n\t\t\tforeach ( $this->maplings as $id => $data ) {\t\t\t\t\t\t\t\t// loop through mapped hours\n\t\t\t\tif ( $data['year'] == $Y && $data['cal_week'] == $w ) {\n\t\t\t\t\t$this->weeklyAnalysis[$Y.'-'.$w]['total'] += $data['amount'];\n\t\t\t\t\t$this->weeklyAnalysis[$Y.'-'.$w]['jobcount'] += 1;\n\t\t\t\t\t$this->weeklyAnalysis[$Y.'-'.$w]['jobs'][] = $id;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// split by filters\n\t\t\tforeach ($this->filters as $filtersection => $items ) {\n\t\t\t\tforeach ( $items as $item ) {\n\t\t\t\t\t$this->weeklyAnalysis[$Y.'-'.$w][$filtersection][$item] = 0;\n\t\t\t\t\tforeach ( $this->maplings as $mapling ) {\t\t\t\t\t\t\n\t\t\t\t\t\tif ( $mapling['year'] == $Y && $mapling['cal_week'] == $w && $mapling[$filtersection]['id'] == $item ) {\n\t\t\t\t\t\t\t$this->weeklyAnalysis[$Y.'-'.$w][$filtersection][$item] += $mapling['amount'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$start->modify(\"+1 week\");\n\t\t}\t\n\t\t\n\t\t// monthly data\n\t\t$this->monthlyAnalysis = array(); \n\t\t$start = clone $timestart;\n\t\t\n\t\twhile ( $start < $now ) {\n\t\t\t$Y = $start->format(\"Y\"); \n\t\t\t$m = $start->format(\"m\");\n\t\t\t\n\t\t\t// total\n\t\t\tforeach ( $this->maplings as $mapling ) {\n\t\t\t\tif ( $mapling['year'] == $Y && $mapling['month'] == $m ) {\n\t\t\t\t\t$this->monthlyAnalysis[$Y.'-'.$m]['total'] += $mapling['amount'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t// split by filters\n\t\t\tforeach ($this->filters as $filtersection => $items ) {\n\t\t\t\tforeach ( $items as $item ) {\n\t\t\t\t\tforeach ( $this->maplings as $mapling ) {\n\t\t\t\t\t\tif ( $mapling['year'] == $Y && $mapling['month'] == $m && $mapling[$filtersection]['id'] == $item ) {\n\t\t\t\t\t\t\t$this->monthlyAnalysis[$Y . '-' .$m][$filtersection][$item] += $mapling['amount'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$start->modify(\"+1 month\");\n\t\t}\t\n\t}", "public function index()\n {\n\n return view('organization::week_holiday.week_holiday',[\n 'day_names'=>DayName::all()\n ]);\n }", "static function getDataForWeekView($records, $dayHeaders) {\n global $user;\n global $i18n;\n\n $dataArray = array();\n $includeNotes = $user->isOptionEnabled('week_notes');\n\n // Construct the first row for a brand new entry.\n $dataArray[] = array('row_id' => null,'label' => $i18n->get('form.week.new_entry').':'); // Insert row.\n // Insert empty cells with proper control ids.\n for ($i = 0; $i < 7; $i++) {\n $control_id = '0_'. $dayHeaders[$i];\n $dataArray[0][$dayHeaders[$i]] = array('control_id' => $control_id, 'tt_log_id' => null,'duration' => null);\n }\n if ($includeNotes) {\n // Construct the second row for daily comments for a brand new entry.\n $dataArray[] = array('row_id' => null,'label' => $i18n->get('label.notes').':'); // Insert row.\n // Insert empty cells with proper control ids.\n for ($i = 0; $i < 7; $i++) {\n $control_id = '1_'. $dayHeaders[$i];\n $dataArray[1][$dayHeaders[$i]] = array('control_id' => $control_id, 'tt_log_id' => null,'note' => null);\n }\n }\n\n // Iterate through records and build $dataArray cell by cell.\n foreach ($records as $record) {\n // Create row id without suffix.\n $row_id_no_suffix = ttWeekViewHelper::makeRowIdentifier($record);\n // Handle potential multiple records with the same attributes by using a numerical suffix.\n $suffix = 0;\n $row_id = $row_id_no_suffix.'_'.$suffix;\n $day_header = substr($record['date'], 8); // Day number in month.\n while (ttWeekViewHelper::cellExists($row_id, $day_header, $dataArray)) {\n $suffix++;\n $row_id = $row_id_no_suffix.'_'.$suffix;\n }\n // Find row.\n $pos = ttWeekViewHelper::findRow($row_id, $dataArray);\n if ($pos < 0) {\n // Insert row for durations.\n $dataArray[] = array('row_id' => $row_id,'label' => ttWeekViewHelper::makeRowLabel($record));\n $pos = ttWeekViewHelper::findRow($row_id, $dataArray);\n // Insert empty cells with proper control ids.\n for ($i = 0; $i < 7; $i++) {\n $control_id = $pos.'_'. $dayHeaders[$i];\n $dataArray[$pos][$dayHeaders[$i]] = array('control_id' => $control_id, 'tt_log_id' => null,'duration' => null);\n }\n // Insert row for comments.\n if ($includeNotes) {\n $dataArray[] = array('row_id' => $row_id.'_notes','label' => $i18n->get('label.notes').':');\n $pos++;\n // Insert empty cells with proper control ids.\n for ($i = 0; $i < 7; $i++) {\n $control_id = $pos.'_'. $dayHeaders[$i];\n $dataArray[$pos][$dayHeaders[$i]] = array('control_id' => $control_id, 'tt_log_id' => null,'note' => null);\n }\n $pos--;\n }\n }\n // Insert actual cell data from $record (one cell only).\n $dataArray[$pos][$day_header] = array('control_id' => $pos.'_'. $day_header, 'tt_log_id' => $record['id'],'duration' => $record['duration']);\n // Insert existing comment from $record into the comment cell.\n if ($includeNotes) {\n $pos++;\n $dataArray[$pos][$day_header] = array('control_id' => $pos.'_'. $day_header, 'tt_log_id' => $record['id'],'note' => $record['comment']);\n }\n }\n return $dataArray;\n }", "function calendar_scrub(array $item) {\n $cal_type = \"google\";\n $cal_id = isset($item['id']) ? $item['id'] : \"n/a\";\n $cal_url = isset($item['htmlLink']) ? $item['htmlLink'] : \"n/a\";\n\n $g_start = isset($item['start']['dateTime'])\n ? $item['start']['dateTime']\n : (isset($item['start']['date'])\n ? $item['start']['date'] \n // . \"T00:00:00\"\n // . date(\"P\", strtotime($item['start']['date']))\n : \"00-00-00T00:00:00-00:00\");\n\n $g_end = isset($item['end']['dateTime'])\n ? $item['end']['dateTime']\n : (isset($item['end']['date'])\n ? $item['end']['date'] \n // . \"T00:00:00\"\n // . date(\"P\", strtotime($item['end']['date']))\n : \"00-00-00T00:00:00-00:00\");\n\n /**\n * is this an all day event? (open + close are dates, not dateTimes)\n */\n\n $all_day = isset($item['start']['date']) && isset($item['end']['date'])\n ? true : false;\n\n /**\n * descriptors\n */\n\n $title = isset($item['summary']) ? $item['summary'] : \"\";\n $info = isset($item['description']) ? $item['description'] : \"\"; \n \n /**\n * formatted date + times\n * (all-day events are nulled )\n */\n\n $day = date(DAY_FORMAT, strtotime($g_start));\n $f_start = !$all_day ? date(HOUR_FORMAT, strtotime($g_start)) : null;\n $f_end = !$all_day ? date(HOUR_FORMAT, strtotime($g_end)) : null;\n\n if ( !$all_day ) {\n\n /**\n * some odds 'n ends for finals week\n */\n\n // we'll never open at midnight, so we'll treat this as the beginning\n // of the end of 24-hours\n if ( preg_match(\"/00:00:00/\", $g_start)) {\n $display_time = \"Close at \" . $f_end;\n }\n\n // 11:59 is a little too specific for our closing hour and will begin\n // our finals week\n elseif ( preg_match(\"/23:59:00/\", $g_end) ) {\n $display_time = $f_start . \" - \" . \"Begin 24 Hours\";\n } \n\n // normally, we'll display time as \"9:00 am - 5:00 pm\"\n else {\n $display_time = $f_start . \" - \" . $f_end;\n }\n } \n\n /**\n * if we're dealing with all-day events, null out the formatted start + end\n * and use the title (eg. \"Closed\") for the display time\n */\n\n else {\n $display_time = $title;\n $f_start = $f_end = null;\n }\n\n $out = array(\n \"title\" => $title,\n \"info\" => $info,\n \"day\" => $day,\n \"all_day\" => $all_day,\n \"dateTime\" => array(\n \"start\" => $g_start,\n \"end\" => $g_end,\n ),\n \"formatted\" => array(\n \"start\" => $f_start,\n \"end\" => $f_end\n ),\n \"display\" => $display_time\n );\n\n // only display calendar meta info if we want to\n if (defined('DISPLAY_CALENDAR_META') && DISPLAY_CALENDAR_META === true) {\n $out['calendar'] = array(\n \"type\" => $cal_type,\n \"id\" => $cal_id,\n \"url\" => $cal_url\n );\n }\n\n return $out;\n}", "public function changeWeek($next_date)\n{\n try {\n $start_date=Carbon::parse($next_date)->addDay(1);\n $date = Carbon::parse($next_date)->addDay(1);\n\n\n $end_date=Carbon::parse($start_date)->addDay(7);\n $this_week= $week_number = $end_date->weekOfYear;\n\n $period = CarbonPeriod::create($start_date, $end_date);\n\n\n $dates=[];\n foreach ($period as $date){\n $dates[] = $date->format('Y-m-d');\n\n }\n\n $login_id = Auth::user()->id;\n $teachers = SmStaff::where('active_status', 1)->where('user_id',$login_id)->where('role_id', 4)->where('school_id', Auth::user()->school_id)->first();\n\n $user = Auth::user();\n $class_times = SmClassTime::where('academic_id', getAcademicId())->where('school_id', Auth::user()->school_id)->orderBy('period', 'ASC')->get();\n $teacher_id =$teachers->id;\n $sm_weekends = SmWeekend::where('school_id', Auth::user()->school_id)->orderBy('order', 'ASC')->where('active_status', 1)->get();\n\n $data = [];\n $data['message'] = 'operation Successful';\n return ApiBaseMethod::sendResponse($data, null);\n\n } catch (Exception $e) {\n return ApiBaseMethod::sendError('operation Failed');\n }\n\n}", "public function index()\n {\n $user = Auth::user();\n\n $data = array();\n // Agenda 時間区切り\n $timeDelemiter = $user->clinic->appointmentTableSetting->time_delimiter;\n // デフォルト\n if (empty($timeDelemiter)) {\n $timeDelemiter = 30;\n }\n $data['slotDuration'] = Carbon::createFromTime(0, $timeDelemiter, 0)->toTimeString();\n\n // 昼休み\n $lunchbreaks = $user->clinic->clinicLunchbreak;\n $lunchbreaksTimes = $lunchbreaks->times;\n $data['holidaysForLunchbreak'] = array();\n $data['timesLunchbreak'] = array();\n\n // Business Hours(週)\n $data['businessHours'] = array();\n\n $baseStart = $user->clinic->clinicTime->base['start'];\n $baseEnd = $user->clinic->clinicTime->base['end'];\n\n // デフォルト\n if (empty($baseStart)) {\n $baseStart = '09:00';\n }\n if (empty($baseEnd)) {\n $baseEnd = '19:00';\n }\n\n $minTime = Carbon::createFromTimeString($baseStart);\n $maxTime = Carbon::createFromTimeString($baseEnd);\n\n $times = $user->clinic->clinicTime->times;\n if (!empty($times) && count($times) > 0) {\n $weekNumbers = array('sun' => 0, 'mon' => 1, 'tue' => 2, 'wed' => 3, 'thu' => 4, 'fri' => 5, 'sat' => 6);\n foreach ($weekNumbers as $key => $value) {\n $time = $times[$key];\n if (!empty($time['start']) && !empty($time['end'])) {\n $data['businessHours'][] = array(\n 'dow' => [$value],\n 'start' => $time['start'],\n 'end' => $time['end']\n );\n\n $minTime = $minTime->min(Carbon::createFromTimeString($time['start']));\n $maxTime = $maxTime->max(Carbon::createFromTimeString($time['end']));\n } else {\n $data['businessHours'][] = array(\n 'dow' => [$value],\n 'start' => $baseStart,\n 'end' => $baseEnd\n );\n }\n\n // お昼休み\n $lunchtime = $lunchbreaksTimes[$key];\n if (!empty($lunchtime['start']) && !empty($lunchtime['end'])) {\n $data['timesLunchbreak'][$value]['start'] = $lunchtime['start'];\n $data['timesLunchbreak'][$value]['end'] = $lunchtime['end'];\n } else {\n $data['timesLunchbreak'][$value]['start'] = $lunchbreaks->base['start'];\n $data['timesLunchbreak'][$value]['end'] = $lunchbreaks->base['end'];\n }\n }\n } else {\n $data['businessHours'][] = array(\n 'dow' => [0, 1, 2, 3, 4, 5, 6],\n 'start' => $baseStart,\n 'end' => $baseEnd\n );\n }\n\n // Min Time, Max Time\n $data['minTime'] = $minTime->subHours(2)->format('H:00:00');\n $data['maxTime'] = $maxTime->addHours(2)->format('H:00:00');\n\n // ユニット\n $unitNumber = $user->clinic->unit_number;\n // デフォルト\n if (empty($unitNumber)) {\n $unitNumber = 3;\n }\n\n $displayUnitNumber = $user->clinic->appointmentTableSetting->display_unit_number;\n $unitNames = explode(',', $user->clinic->appointmentTableSetting->unit_names);\n\n // デフォルト\n if (empty($displayUnitNumber)) {\n $displayUnitNumber = $unitNumber;\n }\n if (empty($user->clinic->appointmentTableSetting->unit_names)) {\n $unitNames = array();\n }\n\n $resources = array();\n if (count($unitNames) >= $displayUnitNumber) {\n $resources = array_slice($unitNames, 0, $displayUnitNumber);\n } else {\n $resources = $unitNames;\n for ($i = count($unitNames) + 1; $i <= $displayUnitNumber; $i++) {\n $resources[] = 'ユニット' . $i;\n }\n }\n\n $data['resources'] = array();\n for ($i = 0; $i < count($resources); $i++) {\n $resource = array(\n 'id' => $i,\n 'title' => $resources[$i]\n );\n if ($i >= $unitNumber) {\n $resource['businessHours'] = array(\n 'start' => '00:00',\n 'end' => '00:00',\n );\n }\n $data['resources'][] = $resource;\n }\n\n\n $events = array();\n\n // 休診日\n $holidays = $user->clinic->clinicHolidays;\n foreach ($holidays as $holiday) {\n // Month View\n $monthEvent = array();\n $monthEvent['title'] = config('const.holiday.' . $holiday->type . '.title');\n $monthEvent['start'] = $holiday->start;\n $monthEvent['color'] = config('const.holiday.' . $holiday->type . '.color');\n $monthEvent['editable'] = false;\n $events[] = $monthEvent;\n\n // Agenda View\n $agendaEvent = array();\n $start = new Carbon($holiday->start);\n\n // 午前休、午後休みの終了、開始時間の取得\n $amMax = $lunchbreaks->base['end'];\n $pmMin = $lunchbreaks->base['start'];\n if (count($lunchbreaks->times) > 0) {\n $week = strtolower($start->format('D'));\n if (!empty($lunchbreaks->times[$week]['start']) && !empty($lunchbreaks->times[$week]['end'])) {\n $amMax = $lunchbreaks->times[$week]['end'];\n $pmMin = $lunchbreaks->times[$week]['start'];\n }\n }\n\n switch ($holiday->type) {\n case config('const.holiday.full.key'):\n $agendaEvent['start'] = $start->format('Y-m-d 00:00:00');\n $agendaEvent['end'] = $start->format('Y-m-d 23:59:59');\n break;\n case config('const.holiday.am.key'):\n $agendaEvent['start'] = $start->format('Y-m-d 00:00:00');\n $agendaEvent['end'] = $start->format('Y-m-d ' . $amMax . ':00');\n break;\n case config('const.holiday.pm.key'):\n $agendaEvent['start'] = $start->format('Y-m-d ' . $pmMin . ':00');\n $agendaEvent['end'] = $start->format('Y-m-d 23:59:59');\n break;\n }\n $agendaEvent['backgroundColor'] = config('const.holiday.' . $holiday->type . '.color');\n $agendaEvent['rendering'] = 'background';\n $events[] = $agendaEvent;\n\n $data['holidaysForLunchbreak'][] = $start->format('Y-m-d');\n }\n\n // 予約\n $appointments = DB::table('appointments')\n ->join('patients', 'appointments.patient_id', '=', 'patients.id')\n ->join('treatments', 'appointments.treatment_id', '=', 'treatments.id')\n ->select(\n 'appointments.unit as resourceId',\n 'patients.name as title',\n 'appointments.start',\n 'appointments.end',\n 'treatments.color as backgroundColor',\n DB::raw(\"'#fff' as borderColor\"),\n DB::raw(\"'#212121' as textColor\")\n )\n ->where('appointments.clinic_id', '=', $user->clinic->id)\n ->get()->toArray();\n\n $data['appointments'] = array_merge($events, $appointments);\n\n\n return $data;\n }", "function weekviewTitle($userid, $viewtime)\n {\n $employeenode = &atkGetNode(\"employee.employee\");\n $employees = $employeenode->selectDb(\"person.id=\" . $userid);\n $employeedesc = (count($employees) > 0) ? $employees[0][\"firstname\"].\" \".$employees[0][\"lastname\"] : \"\";\n\n return sprintf(atktext(\"title_hoursapprove_weekview\"), $employeedesc, strftime(\"%V, %Y\",$viewtime));\n }", "public static function instance() {\n\t\treturn tribe( 'tec.customizer.month-week-view' );\n\t}", "function find_start_of_week()\n {\n $this->move_to_start_of_day();\n $this->move_to_start_of_day();\n while ($this->get_day_of_week()>0)\n {\n $this->move_forward_n_days(-1);\n }\n }", "public function whereTime() {\n\t\t$pageTitle = 'Where Does Time Go';\n\t\t// $stylesheet = '';\n\n\t\tinclude_once SYSTEM_PATH.'/view/header.php';\n\t\tinclude_once SYSTEM_PATH.'/view/academic-help/tmsub-where-time.php';\n\t\tinclude_once SYSTEM_PATH.'/view/footer.php';\n\t}", "public function changeWeek(Request $request,$next_date){\n\n $start_date=Carbon::parse($next_date)->addDay(1);\n $date = Carbon::parse($next_date)->addDay(1);\n\n \n $end_date=Carbon::parse($start_date)->addDay(7);\n $this_week= $week_number = $end_date->weekOfYear;\n \n $period = CarbonPeriod::create($start_date, $end_date);\n \n\n $dates=[];\n foreach ($period as $date){\n $dates[] = $date->format('Y-m-d');\n \n }\n \n if (ApiBaseMethod::checkUrl($request->fullUrl())) {\n $user_id = $id;\n } else {\n $user = Auth::user();\n\n if ($user) {\n $user_id = $user->id;\n } else {\n $user_id = $request->user_id;\n }\n }\n\n $student_detail = SmStudent::where('user_id', $user_id)->first();\n //return $student_detail;\n $class_id = $student_detail->class_id;\n $section_id = $student_detail->section_id;\n\n $sm_weekends = SmWeekend::orderBy('order', 'ASC')->where('active_status', 1)->where('school_id',Auth::user()->school_id)->get();\n\n $class_times = SmClassTime::where('type', 'class')->where('academic_id', getAcademicId())->where('school_id',Auth::user()->school_id)->get();\n\n if (ApiBaseMethod::checkUrl($request->fullUrl())) {\n $data = [];\n $data['student_detail'] = $student_detail->toArray();\n $weekenD = SmWeekend::all();\n foreach ($weekenD as $row) {\n $data[$row->name] = DB::table('sm_class_routine_updates')\n ->select('sm_class_times.period', 'sm_class_times.start_time', 'sm_class_times.end_time', 'sm_subjects.subject_name', 'sm_class_rooms.room_no')\n ->join('sm_classes', 'sm_classes.id', '=', 'sm_class_routine_updates.class_id')\n ->join('sm_sections', 'sm_sections.id', '=', 'sm_class_routine_updates.section_id')\n ->join('sm_class_times', 'sm_class_times.id', '=', 'sm_class_routine_updates.class_period_id')\n ->join('sm_subjects', 'sm_subjects.id', '=', 'sm_class_routine_updates.subject_id')\n ->join('sm_class_rooms', 'sm_class_rooms.id', '=', 'sm_class_routine_updates.room_id')\n\n ->where([\n ['sm_class_routine_updates.class_id', $class_id], ['sm_class_routine_updates.section_id', $section_id], ['sm_class_routine_updates.day', $row->id],\n ])->where('sm_class_routine_updates.academic_id', getAcademicId())->where('sm_classesschool_id',Auth::user()->school_id)->get();\n }\n\n return ApiBaseMethod::sendResponse($data, null);\n }\n\n return view('lesson::student.student_lesson_plan', compact('dates','this_week','class_times', 'class_id', 'section_id', 'sm_weekends'));\n \n }", "function calculateWeeklyNextExecutionDate($taskLastOccurenceDate,$taskTotalOccurenceCount,$taskStartDate, $taskEveryNumofWeeks, $taskWeekDayArray, $taskExeNumOfTimesInWeek, $taskTaskEndAfterOccurrences, $taskTaskEndByDate){ \r\r\n $today=date(\"Y-m-d\");\r\r\n $wkintervalday= $taskExeNumOfTimesInWeek * ($taskEveryNumofWeeks -1);\r\r\n $taskStartDate=date('Y-m-d', strtotime($taskStartDate));\r\r\n // $taskLastOccurenceDate=date('Y-m-d', strtotime($taskLastOccurenceDate));\r\r\n \r\r\n \r\r\n if($taskLastOccurenceDate!=\"0000-00-00\"){\r\r\n $taskNextExeChkDate= $taskLastOccurenceDate; \r\r\n }else{\r\r\n $taskNextExeChkDate= $taskStartDate; \r\r\n }\r\r\n $taskNextOccurenceDate=\"0000-00-00\";\r\r\n $datetime= strtotime($taskNextExeChkDate);\r\r\n $nxtChkDtYear= date(\"Y\",$datetime);\r\r\n $nxtChkDtWkNum= date(\"W\",$datetime);\r\r\n $nxtChkDtNum= date(\"N\",$datetime);\r\r\n $exdate=date(\"d-m\",$datetime); \r\r\n \r\r\n $currWkNum= date(\"W\");\r\r\n $currYear= date(\"Y\");\r\r\n \r\r\n \r\r\n // echo \"<br/> CHK DATE WK NUM : \".$nxtChkDtWkNum;\r\r\n // echo \"<br/> CURR DATE WK NUM : \".$currWkNum;\r\r\n if(($nxtChkDtWkNum >= $currWkNum && $nxtChkDtYear==$currYear) || ( $nxtChkDtYear > $currYear) || ($nxtChkDtWkNum == 1)){\r\r\n $is_exe_this_week=1;\r\r\n $week_exe_count=0; \r\r\n if(($exdate==\"31-12\" || $exdate==\"30-12\" || $exdate==\"29-12\" || $exdate==\"28-12\" || $exdate==\"27-12\" || $exdate==\"26-12\") && $nxtChkDtNum==1 && $taskLastOccurenceDate!=\"0000-00-00\"){\r\r\n $nxtChkDtYear=$nxtChkDtYear+1;\r\r\n }\r\r\n if($nxtChkDtNum==7){\r\r\n $stWknum=$nxtChkDtWkNum+($taskEveryNumofWeeks);\r\r\n if($stWknum < 10){\r\r\n $stWknum=\"0\".$stWknum;\r\r\n }\r\r\n $taskNextExeChkDate=date(\"Y-m-d\",strtotime(date(\"Y-m-d\", strtotime($nxtChkDtYear.'W'.$stWknum)))) ;\r\r\n }else{\r\r\n $taskNextExeChkDate=date(\"Y-m-d\",strtotime(date(\"Y-m-d\", strtotime($nxtChkDtYear.'W'.$nxtChkDtWkNum)))) ; \r\r\n }\r\r\n \r\r\n \r\r\n \r\r\n }else{\r\r\n $wkdiff= $currWkNum- $nxtChkDtWkNum;\r\r\n $stWknum=$nxtChkDtWkNum+($taskEveryNumofWeeks);\r\r\n // echo \"<br/> NXT DATE WK NUM : \".$stWknum; \r\r\n if($stWknum < 10){\r\r\n $stWknum=\"0\".$stWknum;\r\r\n }\r\r\n $taskNextExeChkDate=date(\"Y-m-d\",strtotime(date(\"Y-m-d\", strtotime(date(\"Y\").'W'.$stWknum)))) ;\r\r\n $is_exe_this_week=1; \r\r\n $week_exe_count=0; \r\r\n }\r\r\n \r\r\n // echo \"<br/> ** TASK START WK DATE : \".$taskNextExeChkDate;\r\r\n \r\r\n for($i=0; $i<= (7*$taskEveryNumofWeeks*2); $i++){\r\r\n $date = strtotime(date(\"Y-m-d\", strtotime($taskNextExeChkDate)) . \" +\".$i.\" day\"); \r\r\n $exeDate= date('Y-m-d', $date); \r\r\n $exeDateDay= date(\"N\",$date); \r\r\n if($taskWeekDayArray[$exeDateDay]==1){\r\r\n $is_executed=1;\r\r\n }else{\r\r\n $is_executed=0; \r\r\n } \r\r\n \r\r\n // $is_executed=isWeekDayExecution($exeDateDay); \r\r\n // echo \"<br/> Chk Date ---> \".$exeDate.\" : \";\r\r\n if($is_executed==1){ \r\r\n if($is_exe_this_week==1 ){ $week_exe_count++; \r\r\n \r\r\n if($week_exe_count == $taskExeNumOfTimesInWeek){\r\r\n if($wkintervalday==0) {\r\r\n $is_exe_this_week=1; \r\r\n }else{\r\r\n $is_exe_this_week=0; \r\r\n }\r\r\n \r\r\n $week_exe_count=0; \r\r\n } \r\r\n \r\r\n if($exeDate<= $taskLastOccurenceDate) {\r\r\n continue;\r\r\n }\r\r\n if($exeDate >= $today && $exeDate >= $taskStartDate) {\r\r\n $taskNextOccurenceDate=$exeDate; \r\r\n if($taskTaskEndAfterOccurrences!=0 && $taskTotalOccurenceCount >= $taskTaskEndAfterOccurrences){\r\r\n // $task_is_done=1; \r\r\n $taskNextOccurenceDate=\"0000-00-00\";\r\r\n }else if($taskTaskEndByDate!=\"0000-00-00\" && $exeDate > $taskTaskEndByDate){ \r\r\n $taskNextOccurenceDate=\"0000-00-00\";\r\r\n }\r\r\n break; \r\r\n } \r\r\n \r\r\n // echo \"<br/> ====> IS exe in this \".$is_exe_this_week.\" wk count \".$week_exe_count; \r\r\n \r\r\n }else{\r\r\n $week_exe_count++; \r\r\n if($week_exe_count >= $wkintervalday){\r\r\n $is_exe_this_week=1;\r\r\n $week_exe_count=0; \r\r\n } \r\r\n // echo \"<br/> ====> IS exe in this \".$is_exe_this_week.\" wk count \".$week_exe_count; \r\r\n }\r\r\n \r\r\n } \r\r\n \r\r\n } \r\r\n \r\r\n return $taskNextOccurenceDate;\r\r\n }", "function haltDecrementation()\n {\n return ( //THIS BLOCK TEST WHETHER THE CURRENT DAY IS A SUNDAY\n date('N', intval($this->workTime)) == 7\n && // THIS BLOCK CHECKS THAT THE DATE HAS ASCENDED IN DECREMENTATION\n // MEANING THAT WE HAVE ENTERED A NEW MONTH\n (\n intval(date('m', $this->workTime - 86400))\n !=\n intval(date('m', intval($_GET['currT'])))\n || // IF IT WAS JUST A WEEK VIEW, WE WILL STOP NOW.\n $_GET['weekOrMonth'] == 'week'\n )\n );\n }" ]
[ "0.643709", "0.5988453", "0.5879011", "0.5832369", "0.5821373", "0.58051527", "0.57774204", "0.574716", "0.5718438", "0.5610183", "0.55869424", "0.5572372", "0.55563325", "0.55196416", "0.5507984", "0.5499121", "0.5481568", "0.54571956", "0.5453474", "0.54475176", "0.5409839", "0.5379928", "0.53383124", "0.5336709", "0.53248006", "0.5324073", "0.53205305", "0.53068817", "0.5292169", "0.52897817", "0.5268603", "0.5268164", "0.5256182", "0.5255729", "0.5253666", "0.5246313", "0.52261156", "0.5217504", "0.5212631", "0.52108103", "0.5210123", "0.52099794", "0.5206767", "0.5206446", "0.5202175", "0.519707", "0.5192888", "0.5189248", "0.5173367", "0.51719016", "0.5164729", "0.5150228", "0.5148338", "0.514764", "0.5146154", "0.513931", "0.51271653", "0.5113276", "0.5106462", "0.5101136", "0.5098717", "0.5097931", "0.5082537", "0.50802994", "0.50788623", "0.50758857", "0.5075738", "0.5070024", "0.5065924", "0.5060525", "0.5057717", "0.50555193", "0.5050501", "0.5046326", "0.50450927", "0.5039955", "0.5035864", "0.5034513", "0.5031415", "0.502998", "0.50281465", "0.5025748", "0.50240785", "0.50077486", "0.50060296", "0.50021535", "0.50000024", "0.49972638", "0.49961442", "0.49891686", "0.49855828", "0.4981922", "0.49792024", "0.49785247", "0.49756828", "0.4975401", "0.49699652", "0.4968755", "0.4963951", "0.49504074", "0.4943565" ]
0.0
-1
END TIMESHEET PROJECT EDIT
function getSearchPosting() { $search = array( 'date_start' => $this->input->post('date_from'), 'date_end' => $this->input->post('date_to')); $this->session->set_userdata($search); redirect($this->input->server('HTTP_REFERER'),301); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function timesheetYear(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mytask=0, $perioduser='')\n{\n\tglobal $bc, $langs;\n\tglobal $form, $projectstatic, $taskstatic;\n\tglobal $periodyear, $displaymode ;\n\n\tglobal $transfertarray;\n\n\t$lastprojectid=0;\n\t$totalcol = array();\n\t$totalline = 0;\n\t$var=true;\n\n\t$numlines=count($lines);\n\tfor ($i = 0 ; $i < $numlines ; $i++)\n\t{\n\t\tif ($parent == 0) $level = 0;\n\n\t\tif ($lines[$i]->fk_parent == $parent)\n\t\t{\n\n\t\t\t// Break on a new project\n\t\t\tif ($parent == 0 && $lines[$i]->fk_project != $lastprojectid)\n\t\t\t{\n\t\t\t\t$totalprojet = array();\n\t\t\t\t$var = !$var;\n\t\t\t\t$lastprojectid=$lines[$i]->fk_project;\n\t\t\t}\n\n\t\t\tprint \"<tr \".$bc[$var].\">\\n\";\n\t\t\t// Ref\n\t\t\tprint '<td>';\n\t\t\t$taskstatic->fetch($lines[$i]->id);\n\t\t\t$taskstatic->label=$lines[$i]->label.\" (\".dol_print_date($lines[$i]->date_start,'day').\" - \".dol_print_date($lines[$i]->date_end,'day').')'\t;\n\t\t\t//print $taskstatic->getNomUrl(1);\n\t\t\tprint $taskstatic->getNomUrl(1,($showproject?'':'withproject'));\n\t\t\tprint '</td>';\n\n\t\t\t// Progress\n\t\t\tprint '<td align=\"right\">';\n\t\t\tprint $lines[$i]->progress.'% ';\n\t\t\tprint $taskstatic->getLibStatut(3);\n\t\t\t\n\t\t\tif ($taskstatic->fk_statut == 3)\n\t\t\t\t$transfertarray[] = $lines[$i]->id;\n\n\t\t\tprint '</td>';\n\n\t\t\t$totalline = 0;\n\t\t\tfor ($month=1;$month<= 12 ;$month++)\n\t\t\t{\n\t\t\t\t$szvalue = fetchSumMonthTimeSpent($taskstatic->id, $month, $periodyear, $perioduser, $displaymode);\n\t\t\t\t$totalline+=$szvalue;\n\t\t\t\t$totalprojet[$month]+=$szvalue;\n\t\t\t\tif ($displaymode==0)\n\t\t\t\t\tprint '<td align=right>'.($szvalue ? convertSecondToTime($szvalue, 'allhourmin'):\"\").'</td>';\n\t\t\t\telse\n\t\t\t\t\tprint '<td align=right>'.($szvalue ? price($szvalue):\"\").'</td>';\n\t\t\t\t// le nom du champs c'est à la fois le jour et l'id de la tache\n\t\t\t}\n\t\t\tif ($displaymode==0)\n\t\t\t\tprint '<td align=right>'.($totalline ? convertSecondToTime($totalline, 'allhourmin'):\"\").'</td>';\n\t\t\telse\n\t\t\t\tprint '<td align=right>'.($totalline ? price($totalline):\"\").'</td>';\n\n\n\t\t\t$inc++;\n\t\t\t$level++;\n\t\t\tif ($lines[$i]->id) timesheetYear($inc, $lines[$i]->id, $lines, $level, $projectsrole, $tasksrole, $mytask, $perioduser);\n\t\t\t$level--;\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//$level--;\n\t\t}\n\t}\n\t\n\tif ($level == 0)\n\t{\n\t\tprint \"<tr class='liste_total'>\\n\";\n\t\tprint '<td colspan=2 align=right><b>Total</b></td>';\n\t\tprint '</td>';\n\t\t$totalline = 0;\n\t\tfor ($month=1;$month<= 12 ;$month++)\n\t\t{\n\t\t\t// on affiche le total du projet\n\t\t\tif ($displaymode==0)\n\t\t\t\tprint '<td align=right>'.($totalgen[$month] ? convertSecondToTime($totalgen[$month], 'allhourmin'):\"\").'</td>';\n\t\t\telse\n\t\t\t\tprint '<td align=right>'.($totalgen[$month] ? price($totalgen[$month]):\"\").'</td>';\n\n\t\t\t$totalline+=$totalgen[$month];\n\t\t}\n\t\t// on affiche le total du projet\n\t\tif ($displaymode==0)\n\t\t\tprint '<td align=right>'.($totalline ? convertSecondToTime($totalline, 'allhourmin'):\"\").'</td>';\n\t\telse\n\t\t\tprint '<td align=right>'.($totalline ? price($totalline):\"\").'</td>';\n\n\t\tprint \"</tr>\\n\";\n\t}\n\treturn $inc;\n}", "function testTimeSheet()\n{\n\tcreateClient('The Business', '1993-06-20', 'LeRoy', 'Jenkins', '1234567890', '[email protected]', 'The streets', 'Las Vegas', 'NV');\n\n\t//Create Project to assign task\n\tcreateProject('The Business', 'Build Website', 'Build a website for the Business.');\n\tcreateProject('The Business', 'Fix CSS', 'Restyle the website');\n\n\t//Create Tasks\n\tcreateTask('The Business', 'Build Website', 'Start the Project', 'This is the first task for Build Website.');\n\tcreateTask('The Business', 'Build Website', 'Register domain name', 'Reserach webservices and make a good url');\n\tcreateTask('The Business', 'Fix CSS', 'Start the Project', 'Dont be lazy');\n\n\t//Create Developer to record time\n\tcreateEmployee('SE', 'b.zucker', 'Developer', 'bz', 'Brent', 'Zucker', '4045801384', '[email protected]', 'Columbia St', 'Milledgeville', 'GA');\n\n\t//Create TimeSheet Entry\n\tcreateTimeSheet('b.zucker', 'The Business', 'Build Website', 'Start the Project', '2015-03-02 10-30-00', '2015-03-02 15-30-00');\n\t\n\t//prints out timesheet\n\techo \"<h3>TimeSheet</h3>\";\n\ttest(\"SELECT * FROM TimeSheet\");\n\n\t//deletes the timesheet\n\tdeleteTimeSheet('b.zucker', 'The Business', 'Build Website', 'Start the Project', '2015-03-02 10-30-00', '2015-03-02 15-30-00');\n\n\t//deletes the tasks\n\tdeleteTask('The Business', 'Build Website', 'Start the Project');\n\tdeleteTask('The Business', 'Build Website', 'Register domain name');\n\tdeleteTask('The Business', 'Fix CSS', 'Start the Project');\n\n\t//deletes the projects\n\tdeleteProject('The Business', 'Fix CSS');\n\tdeleteProject('The Business', 'Build Website');\n\t\n\t//deletes the client\n\tdeleteClient('The Business');\n\n\t//deletes employee\n\tdeleteEmployee('b.zucker');\n}", "public function timesheetAction()\r\n {\r\n $project = $this->projectService->getProject($this->_getParam('projectid'));\r\n $client = $this->clientService->getClient($this->_getParam('clientid'));\r\n \r\n if (!$project && !$client) {\r\n return;\r\n }\r\n \r\n if ($project) {\r\n $start = date('Y-m-d', strtotime($project->started) - 86400);\r\n $this->view->tasks = $this->projectService->getSummaryTimesheet(null, null, $project->id, null, null, $start, null);\r\n } else {\r\n $start = date('Y-m-d', strtotime($client->created));\r\n $this->view->tasks = $this->projectService->getSummaryTimesheet(null, null, null, $client->id, null, $start, null);\r\n }\r\n\r\n $this->renderRawView('timesheet/ajax-timesheet-summary.php');\r\n }", "public function testCreateTimesheet()\n {\n }", "public function close_timesheet($timesheet)\n\t{\n\t\t$date = Carbon::now();\n\n\t\t$this->CI->timecard_model->timecard_update(\n\t\t\t$timesheet->id,\n\t\t\t$date->format('h'),\n\t\t\t$date->format('i'),\n\t\t\t$date->format('A'),\n\t\t\t$timesheet->user_id\n\t\t);\n\t}", "function turnitintooltwo_show_edit_course_end_date_form() {\n $output = html_writer::tag(\"div\", get_string('newenddatedesc', 'turnitintooltwo'), array(\"id\" => \"edit_end_date_desc\"));\n\n $elements = array();\n $dateoptions = array('startyear' => date( 'Y', strtotime( '-6 years' )), 'stopyear' => date( 'Y', strtotime( '+6 years' )));\n $elements[] = array('date_selector', 'new_course_end_date',\n get_string('newcourseenddate', 'turnitintooltwo'), '', $dateoptions);\n $elements[] = array('hidden', 'tii_course_id', '');\n $elements[] = array('hidden', 'tii_course_title', '');\n $elements[] = array('button', 'save_end_date', get_string('savecourseenddate', 'turnitintooltwo'));\n\n $customdata[\"elements\"] = $elements;\n $customdata[\"hide_submit\"] = true;\n $customdata[\"disable_form_change_checker\"] = true;\n $optionsform = new turnitintooltwo_form('', $customdata);\n\n return html_writer::tag('div', $output.$optionsform->display(), array('class' => 'mod_turnitintooltwo_edit_course_end_date_form'));\n}", "function timesheetLines(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mytask=0, $perioduser='')\n{\n\tglobal $bc, $langs;\n\tglobal $form, $projectstatic, $taskstatic;\n\tglobal $periodyear, $periodmonth, $nbdaymonth, $displaymode ;\n\n\tglobal $transfertarray;\n\n\t$lastprojectid=0;\n\n\t$totalcol = array();\n\t$totalline = 0;\n\n\t$var=true;\n\t\n\t$numlines=count($lines);\n\tfor ($i = 0 ; $i < $numlines ; $i++)\n\t{\n\t\tif ($parent == 0) $level = 0;\n\n\t\tif ($lines[$i]->fk_parent == $parent)\n\t\t{\n\n\t\t\t// Break on a new project\n\t\t\tif ($parent == 0 && $lines[$i]->fk_project != $lastprojectid)\n\t\t\t{\n\t\t\t\t$totalprojet = array();\n\t\t\t\t$var = !$var;\n\t\t\t\t$lastprojectid=$lines[$i]->fk_project;\n\t\t\t}\n\n\t\t\tprint \"<tr \".$bc[$var].\">\\n\";\n\t\t\t// Ref\n\t\t\tprint '<td>';\n\t\t\t$taskstatic->fetch($lines[$i]->id);\n\t\t\t$taskstatic->label=$lines[$i]->label.\" (\".dol_print_date($lines[$i]->date_start,'day').\" - \".dol_print_date($lines[$i]->date_end,'day').')'\t;\n\t\t\tprint $taskstatic->getNomUrl(1,($showproject?'':'withproject'));\n\t\t\tprint '</td>';\n\t\t\t// Progress\n\t\t\tprint '<td align=\"right\">';\n\t\t\tprint $lines[$i]->progress.'% ';\n\t\t\t// si transférable en facturation on conserve dans un tableau\n\t\t\tif ($taskstatic->fk_statut == 3)\n\t\t\t\t$transfertarray[] = $lines[$i]->id;\n\t\t\tprint $taskstatic->getLibStatut(3);\n\t\t\tprint '</td>';\n\t\t\t$totalline = 0;\n\t\t\tfor ($day=1;$day <= $nbdaymonth;$day++)\n\t\t\t{\n\t\t\t\t$curday=mktime(0, 0, 0, $periodmonth, $day, $periodyear);\n\t\t\t\t$bgcolor=\"\";\n\t\t\t\tif (date('N', $curday) == 6 || date('N', $curday) == 7)\n\t\t\t\t\t$bgcolor=\" bgcolor=grey \";\n\t\t\t\t\t\n\t\t\t\t$szvalue = fetchSumTimeSpent($taskstatic->id, $curday, $perioduser, $displaymode);\n\t\t\t\t\n\t\t\t\t$totalline+=$szvalue;\n\t\t\t\t$totalprojet[$day]+=$szvalue;\n\t\t\t\tif ($displaymode==0)\n\t\t\t\t\tprint '<td '.$bgcolor.' align=right>'.($szvalue ? convertSecondToTime($szvalue, 'allhourmin'):\"\").'</td>';\n\t\t\t\telse\n\t\t\t\t\tprint '<td '.$bgcolor.' align=right>'.($szvalue ? price($szvalue):\"\").'</td>';\n\t\t\t\t// le nom du champs c'est à la fois le jour et l'id de la tache\n\t\t\t}\n\t\t\t// total line\n\t\t\tif ($displaymode==0)\n\t\t\t\tprint '<td align=right>'.($totalline ? convertSecondToTime($totalline, 'allhourmin'):\"\").'</td>';\n\t\t\telse\n\t\t\t\tprint '<td align=right>'.($totalline ? price($totalline):\"\").'</td>';\n\n\n\t\t\t// Break on a new project\n\t\t\tif ($parent == 0 && $lines[$i+1]->fk_project != $lastprojectid)\n\t\t\t{\n\t\t\t\tprint \"<tr class='liste_total'>\\n\";\n\t\t\t\tprint '<td colspan=2 align=right><b>Total</b></td>';\n\t\t\t\tprint '</td>';\n\t\t\t\t$totalline = 0;\n\t\t\t\tfor ($day=1;$day <= $nbdaymonth;$day++)\n\t\t\t\t{\n\t\t\t\t\t$curday=mktime(0, 0, 0, $periodmonth, $day, $periodyear);\n\t\t\t\t\t$bgcolor=\"\";\n\t\t\t\t\tif (date('N', $curday) == 6 || date('N', $curday) == 7)\n\t\t\t\t\t\t$bgcolor=\" bgcolor=grey \";\n\t\t\t\t\t// on affiche le total du projet\n\t\t\t\t\tif ($displaymode==0)\n\t\t\t\t\t\tprint '<td '.$bgcolor.' align=right><b>'.($totalprojet[$day] ? convertSecondToTime($totalprojet[$day], 'allhourmin'):\"\").'</b></td>';\n\t\t\t\t\telse\n\t\t\t\t\t\tprint '<td '.$bgcolor.' align=right><b>'.($totalprojet[$day] ? price($totalprojet[$day]):\"\").'</b></td>';\n\t\t\t\t\t$totalline+=$totalprojet[$day];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// total line\n\t\t\t\tif ($displaymode==0)\n\t\t\t\t\tprint '<td align=right><b>'.($totalline ? convertSecondToTime($totalline, 'allhourmin'):\"\").'</b></td>';\n\t\t\t\telse\n\t\t\t\t\tprint '<td align=right><b>'.($totalline ? price($totalline):\"\").'</b></td>';\n\t\t\t\tprint \"</tr>\\n\";\n\t\t\t}\t\t\t\n\t\t\t$inc++;\n\t\t\t$level++;\n\t\t\tif ($lines[$i]->id) timesheetLines($inc, $lines[$i]->id, $lines, $level, $projectsrole, $tasksrole, $mytask, $perioduser);\n\t\t\t$level--;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//$level--;\n\t\t}\n\t}\n\n\treturn $inc;\n}", "function AfterEdit(&$values,$where,&$oldvalues,&$keys,$inline,&$pageObject)\n{\n\n\t\tglobal $conn;\n\n$attend_id=$values['attend_id'];\n\n//select shecdule ID from timetable\n$sql_at= \"SELECT scheduleID,courseID,date,(end_time-start_time) AS hour FROM schedule_timetable WHERE id='$attend_id'\";\n$query_at=db_query($sql_at,$conn);\n$row_at=db_fetch_array($query_at);\n\n$scheduleID=$row_at['scheduleID'];\n\n//select related schedule id from schedule\n$sql_at2= \"SELECT programID,batchID,groupID FROM schedule WHERE scheduleID='$scheduleID'\";\n$query_at2=db_query($sql_at2,$conn);\n$row_at2=db_fetch_array($query_at2);\n\n$program=$row_at2['programID'];\n$batch=$row_at2['batchID'];\n$class=$row_at2['groupID'];\n\n//update program , batch, class to student_attendance table\n$date=$row_at['date'];\n$hour=$row_at['hour'];\n$course=$row_at['courseID'];\n$id=$keys['id'];\n$sql_up= \"Update student_attendance set programID ='$program', batchID='$batch',class='$class',course='$course',date='$date',hour='$hour' where id='$id'\";\n$query_up=db_exec($sql_up,$conn);\n\n//query the total hour for this module\n$sql_th= \"SELECT total_hour FROM program_course WHERE programID='$program' && CourseID=$course\";\n$query_th=db_query($sql_th,$conn);\n$row_th=db_fetch_array($query_th);\n\n$totalhour=$row_th['total_hour'];\n//the percentage wight of absentee ( $hour/$totalhour)\n$weight_absent=($hour/$totalhour*100);\n\n//query current attendance status for this student, program , module\n$studentID=$values['StudentID'];\n$sql_at3=\"SELECT Attendance FROM student_course WHERE StudentID=$studentID AND programID=$program AND CourseID=$course\";\n$query_at3=db_query($sql_at3,$conn);\n$row_at3=db_fetch_array($query_at3);\n\n$current_attendance=$row_at3['Attendance'];\n//update student_course attendance\n\n$net_attendance=$current_attendance-$weight_absent;\n\n$sql_ups= \"Update student_course SET Attendance='$net_attendance' where StudentID='$studentID' && programID='$program' && CourseID=$course\";\n$query_ups=db_exec($sql_ups,$conn);\n;\t\t\n}", "public function finish()\n {\n parent::finish();\n \n // this widget must have a parent, and it's subject must be a participant\n if( is_null( $this->parent ) || 'participant' != $this->parent->get_subject() )\n throw new exc\\runtime(\n 'Appointment widget must have a parent with participant as the subject.', __METHOD__ );\n\n $db_participant = new db\\participant( $this->parent->get_record()->id );\n \n // determine the time difference\n $db_address = $db_participant->get_first_address();\n $time_diff = is_null( $db_address ) ? NULL : $db_address->get_time_diff();\n\n // need to add the participant's timezone information as information to the date item\n $site_name = bus\\session::self()->get_site()->name;\n if( is_null( $time_diff ) )\n $note = 'The participant\\'s time zone is not known.';\n else if( 0 == $time_diff )\n $note = sprintf( 'The participant is in the same time zone as the %s site.',\n $site_name );\n else if( 0 < $time_diff )\n $note = sprintf( 'The participant\\'s time zone is %s hours ahead of %s\\'s time.',\n $time_diff,\n $site_name );\n else if( 0 > $time_diff )\n $note = sprintf( 'The participant\\'s time zone is %s hours behind %s\\'s time.',\n abs( $time_diff ),\n $site_name );\n\n $this->add_item( 'datetime', 'datetime', 'Date', $note );\n\n // create enum arrays\n $modifier = new db\\modifier();\n $modifier->where( 'active', '=', true );\n $modifier->order( 'rank' );\n $phones = array();\n foreach( $db_participant->get_phone_list( $modifier ) as $db_phone )\n $phones[$db_phone->id] = $db_phone->rank.\". \".$db_phone->number;\n \n // create the min datetime array\n $start_qnaire_date = $this->parent->get_record()->start_qnaire_date;\n $datetime_limits = !is_null( $start_qnaire_date )\n ? array( 'min_date' => substr( $start_qnaire_date, 0, -9 ) )\n : NULL;\n\n // set the view's items\n $this->set_item( 'participant_id', $this->parent->get_record()->id );\n $this->set_item( 'phone_id', '', false, $phones );\n $this->set_item( 'datetime', '', true, $datetime_limits );\n\n $this->set_variable( \n 'is_supervisor', \n 'supervisor' == bus\\session::self()->get_role()->name );\n\n $this->finish_setting_items();\n }", "function eo_the_end($format='d-m-Y',$id=''){\n\techo eo_get_the_end($format,$id);\n}", "public function finishSectionEdit($end = null) {\n list($id, $start, $type, $title) = array_pop($this->sectionedits);\n if(!is_null($end) && $end <= $start) {\n return;\n }\n $this->doc .= \"<!-- EDIT$id \".strtoupper($type).' ';\n if(!is_null($title)) {\n $this->doc .= '\"'.str_replace('\"', '', $title).'\" ';\n }\n $this->doc .= \"[$start-\".(is_null($end) ? '' : $end).'] -->';\n }", "public function edit (){\n $connection = new database();\n $table = new simple_table_ops();\n\n $id = $_GET['id']; // timetable_id\n $content = \"<div class='link_button'>\n <a href='?controller=teachers&action=export'>Export to EXCEL</a>\n <a href='?controller=curricula&action=index'>Curricula</a>\n </div>\";\n\n $content .= \"<div class='third_left'>\";\n $content .='<p>You can configure the timetable for the following course:<p>';\n\n $sql = \"SELECT curricula.curriculum_id, CONCAT (teachers.nom, ' ', teachers.prenom, ' | ', teachers.nom_khmer, ' ', teachers.prenom_khmer, ' | ', sexes.sex) as teacher, subjects.subject, levels.level\n FROM curricula\n JOIN courses ON curricula.course_id = courses.course_id\n JOIN subjects ON curricula.subject_id = subjects.subject_id\n JOIN teachers ON teachers.teacher_id = curricula.teacher_id\n JOIN sexes ON teachers.sex_id = sexes.sex_id\n JOIN levels ON courses.level_id = levels.level_id\n JOIN timetables ON timetables.curriculum_id = curricula.curriculum_id\n WHERE timetables.timetable_id = {$_GET['id']}\";\n\n $curricula_data = $connection->query($sql);\n\n if ($connection->get_row_num() == 0) {\n header(\"Location: http://\".WEBSITE_URL.\"/index.php?controller=curricula&action=index\");\n }\n\n $curricula_data = $curricula_data[0];\n\n $content .='Teacher: '.$curricula_data['teacher'].'<br>';\n $content .='Subject: '.$curricula_data['subject'].'<br>';\n $content .='Level: '.$curricula_data['level'].'<br>';\n\n\n $columns = array ('start_time_id, end_time_id, weekday_id, classroom_id, timetable_period_id');\n\n $neat_columns = array ('Start Time', 'End Time', 'Week Day', 'Classroom', 'Time Period' , 'Update', 'Delete');\n // create curriculum_id array\n $sql = \"SELECT curriculum_id FROM timetables WHERE timetable_id = {$id}\";\n\n $curriculum_id_result = $connection->query($sql);\n $curriculum_id_array = $curriculum_id_result[0];\n\n // time_id, weekday_id, curriculum_id, classroom_id,\n $sql = 'SELECT time_id as start_time_id, time_class as time1 FROM time ORDER BY time_id ASC';\n $time1_result = $connection->query($sql);\n\n $sql = 'SELECT time_id as end_time_id, time_class as time2 FROM time ORDER BY time_id ASC';\n $time2_result = $connection->query($sql);\n\n $sql = 'SELECT weekday_id, weekday FROM weekdays ORDER BY weekday_id';\n $weekdays_result = $connection->query($sql);\n\n $sql = \"SELECT timetable_period_id, CONCAT(nom, ', from ', date_from, ' to ', date_to) as timetable_period FROM timetable_periods ORDER BY date_from\";\n $timetable_periods_result = $connection->query($sql);\n\n $sql = 'SELECT classroom_id, classroom FROM classrooms ORDER BY classroom ASC';\n $classrooms_result = $connection->query($sql);\n\n $drop_down = array(\n 'start_time_id' => array('start_time' => $time1_result),\n 'end_time_id' => array('end_time' => $time2_result),\n 'weekday_id' => array('weekday' => $weekdays_result),\n 'timetable_period_id'=>array('timetable_period'=> $timetable_periods_result),\n 'classroom_id' => array('classroom' => $classrooms_result)\n );\n\n /********************************************************************/\n /* CONFIGURES Form structure */\n\n $form = array(\n 'action' => '?controller=timetable&action=update&id='.$id,\n 'div' => \"class='solitary_input'\",\n 'div_button' => \"class='submit_button1'\",\n 'method' => 'post',\n 'action_links' => array(1 => array('delete', '?controller=timetable&action=delete&id=')),\n 'id' => 'top_form',\n 'elements' => array(\n 1 => array ('hidden' => $curriculum_id_array),\n 3 => array ('drop_down' => 'start_time_id'),\n 4 => array ('drop_down' => 'end_time_id'),\n 5 => array ('drop_down' => 'weekday_id'),\n 6 => array ('drop_down' => 'classroom_id'),\n 7 => array ('drop_down' => 'timetable_period_id'),\n 10 => array ('submit' => 'update')\n )\n );\n\n $table->set_top_form($form);\n\n $table->set_table_name('timetables');\n $table->set_id_column('timetable_id');\n\n $table->set_table_column_names($columns);\n $table->set_html_table_column_names($neat_columns);\n\n $table->set_values_form(); // set values found in database into form elements when building top_form\n $table->set_drop_down($drop_down);\n $table->set_form_array($form);\n\n $content .= \"</div>\";\n\n $content .= \" <div class='two_thirds_right'><table>\".$table->details().'</table></div>';\n $output['content'] = $content;\n return $output;\n }", "private function endMonthSpacers()\n\t{\n\t\tif((8 - $this->weekDayNum) >= '1') {\n\t\t\t$this->calWeekDays .= \"\\t\\t<td colspan=\\\"\".(8 - $this->weekDayNum).\"\\\" class=\\\"spacerDays\\\">&nbsp;</td>\\n\";\n\t\t\t$this->outArray['lastday'] = (8 - $this->weekDayNum);\t\t\t\n\t\t}\n\t}", "public function indexAction()\r\n {\r\n \tini_set('memory_limit', '64M');\r\n $validFormats = array('weekly');\r\n $format = 'weekly'; // $this->_getParam('format', 'weekly');\r\n \r\n if (!in_array($format, $validFormats)) {\r\n $this->flash('Format not valid');\r\n $this->renderView('error.php');\r\n return;\r\n }\r\n\r\n $reportingOn = 'Dynamic';\r\n \r\n // -1 will mean that by default, just choose all timesheet records\r\n $timesheetid = -1;\r\n\r\n // Okay, so if we were passed in a timesheet, it means we want to view\r\n // the data for that timesheet. However, if that timesheet is locked, \r\n // we want to make sure that the tasks being viewed are ONLY those that\r\n // are found in that locked timesheet.\r\n $timesheet = $this->byId();\r\n\r\n $start = null;\r\n $end = null;\r\n $this->view->showLinks = true;\r\n $cats = array();\r\n\r\n if ($timesheet) {\r\n $this->_setParam('clientid', $timesheet->clientid);\r\n $this->_setParam('projectid', $timesheet->projectid);\r\n if ($timesheet->locked) {\r\n $timesheetid = $timesheet->id;\r\n $reportingOn = $timesheet->title;\r\n } else {\r\n $timesheetid = 0; \r\n $reportingOn = 'Preview: '.$timesheet->title;\r\n }\r\n if (is_array($timesheet->tasktype)) {\r\n \t$cats = $timesheet->tasktype;\r\n } \r\n\r\n $start = date('Y-m-d 00:00:01', strtotime($timesheet->from));\r\n $end = date('Y-m-d 23:59:59', strtotime($timesheet->to)); \r\n $this->view->showLinks = false;\r\n } else if ($this->_getParam('category')){\r\n \t$cats = array($this->_getParam('category'));\r\n }\r\n \r\n \r\n $project = $this->_getParam('projectid') ? $this->byId($this->_getParam('projectid'), 'Project') : null;\r\n\t\t\r\n\t\t$client = null;\r\n\t\tif (!$project) {\r\n \t$client = $this->_getParam('clientid') ? $this->byId($this->_getParam('clientid'), 'Client') : null;\r\n\t\t}\r\n\t\t\r\n $user = $this->_getParam('username') ? $this->userService->getUserByField('username', $this->_getParam('username')) : null;\r\n \r\n\t\t$this->view->user = $user;\r\n\t\t$this->view->project = $project;\r\n\t\t$this->view->client = $client ? $client : ( $project ? $this->byId($project->clientid, 'Client'):null);\r\n\t\t$this->view->category = $this->_getParam('category');\r\n \r\n if (!$start) {\r\n\t // The start date, if not set in the parameters, will be just\r\n\t // the previous monday\r\n\t $start = $this->_getParam('start', $this->calculateDefaultStartDate());\r\n\t // $end = $this->_getParam('end', date('Y-m-d', time()));\r\n\t $end = $this->_getParam('end', date('Y-m-d 23:59:59', strtotime($start) + (6 * 86400)));\r\n }\r\n \r\n // lets normalise the end date to make sure it's of 23:59:59\r\n\t\t$end = date('Y-m-d 23:59:59', strtotime($end));\r\n\r\n $this->view->title = $reportingOn;\r\n \r\n $order = 'endtime desc';\r\n if ($format == 'weekly') {\r\n $order = 'starttime asc';\r\n }\r\n\r\n $this->view->taskInfo = $this->projectService->getTimesheetReport($user, $project, $client, $timesheetid, $start, $end, $cats, $order);\r\n \r\n // get the hierachy for all the tasks in the task info. Make sure to record how 'deep' the hierarchy is too\r\n\t\t$hierarchies = array();\r\n\r\n\t\t$maxHierarchyLength = 0;\r\n\t\tforeach ($this->view->taskInfo as $taskinfo) {\r\n\t\t\tif (!isset($hierarchies[$taskinfo->taskid])) {\r\n\t\t\t\t$task = $this->projectService->getTask($taskinfo->taskid);\r\n\t\t\t\t$taskHierarchy = array();\r\n\t\t\t\tif ($task) {\r\n\t\t\t\t\t$taskHierarchy = $task->getHierarchy();\r\n\t\t\t\t\tif (count($taskHierarchy) > $maxHierarchyLength) {\r\n\t\t\t\t\t\t$maxHierarchyLength = count($taskHierarchy);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$hierarchies[$taskinfo->taskid] = $taskHierarchy;\r\n\t\t\t} \r\n\t\t}\r\n\t\r\n\t\t$this->view->hierarchies = $hierarchies;\r\n\t\t$this->view->maxHierarchyLength = $maxHierarchyLength;\r\n\r\n $this->view->startDate = $start;\r\n $this->view->endDate = $end;\r\n $this->view->params = $this->_getAllParams();\r\n $this->view->dayDivision = za()->getConfig('day_length', 8) / 4; // za()->getConfig('day_division', 2);\r\n $this->view->divisionTolerance = za()->getConfig('division_tolerance', 20);\r\n \r\n $outputformat = $this->_getParam('outputformat');\r\n if ($outputformat == 'csv') {\r\n \t$this->_response->setHeader(\"Content-type\", \"text/csv\");\r\n\t $this->_response->setHeader(\"Content-Disposition\", \"inline; filename=\\\"timesheet.csv\\\"\");\r\n\r\n\t echo $this->renderRawView('timesheet/csv-export.php');\r\n } else {\r\n\t\t\tif ($this->_getParam('_ajax')) {\r\n\t\t\t\t$this->renderRawView('timesheet/'.$format.'-report.php');\r\n\t\t\t} else {\r\n\t\t\t\t$this->renderView('timesheet/'.$format.'-report.php');\r\n\t\t\t}\r\n }\r\n }", "public function timeWorkshop() {\n\t\t$pageTitle = 'Time Management Strategies Workshop';\n\t\t// $stylesheet = '';\n\n\t\tinclude_once SYSTEM_PATH.'/view/header.php';\n\t\tinclude_once SYSTEM_PATH.'/view/academic-help/owsub-time.php';\n\t\tinclude_once SYSTEM_PATH.'/view/footer.php';\n\t}", "public function detailedtimesheetAction()\r\n {\r\n $project = $this->projectService->getProject($this->_getParam('projectid'));\r\n $client = $this->clientService->getClient($this->_getParam('clientid'));\r\n $task = $this->projectService->getTask($this->_getParam('taskid'));\r\n $user = $this->userService->getUserByField('username', $this->_getParam('username'));\r\n\t\t\r\n if (!$project && !$client && !$task && !$user) {\r\n return;\r\n }\r\n\r\n\t\tif ($task) { \r\n $this->view->records = $this->projectService->getDetailedTimesheet(null, $task->id);\r\n } else if ($project) {\r\n \r\n $start = null;\r\n $this->view->records = $this->projectService->getDetailedTimesheet(null, null, $project->id);\r\n } else if ($client) {\r\n \r\n $start = null;\r\n $this->view->records = $this->projectService->getDetailedTimesheet(null, null, null, $client->id);\r\n } else if ($user) {\r\n\t\t\t$this->view->records = $this->projectService->getDetailedTimesheet($user);\r\n\t\t}\r\n\r\n\t\t$this->view->task = $task;\r\n $this->renderRawView('timesheet/ajax-timesheet-details.php');\r\n }", "public function addtimeAction()\r\n {\r\n\t\t$date = $this->_getParam('start', date('Y-m-d'));\r\n\t\t$time = $this->_getParam('start-time');\r\n\r\n\t\tif (!$time) {\r\n\t\t\t$hour = $this->_getParam('start-hour');\r\n\t\t\t$min = $this->_getParam('start-min');\r\n\t\t\t$time = $hour.':'.$min;\r\n\t\t}\r\n\r\n\t\t$start = strtotime($date . ' ' . $time . ':00');\r\n $end = $start + $this->_getParam('total') * 3600;\r\n $task = $this->projectService->getTask($this->_getParam('taskid'));\r\n $user = za()->getUser();\r\n\r\n $this->projectService->addTimesheetRecord($task, $user, $start, $end);\r\n\r\n\t\t$this->view->task = $task;\r\n\t\t\r\n\t\tif ($this->_getParam('_ajax')) {\r\n\t\t\t$this->renderRawView('timesheet/timesheet-submitted.php');\r\n\t\t}\r\n }", "function eo_schedule_end($format='d-m-Y',$id=''){\n\techo eo_get_schedule_end($format,$id);\n}", "function show_project_timeline($project_id){\n\n$pr=new project($project_id);\n$work_arr=$pr->current_timeline($project_id);\nfor($t=0;$t<sizeof($work_arr);$t++){\n$task1=new task($work_arr[$t]['w_id']);\n$mb1=new member($task1->alloted_by);\n$mb2=new member($task1->alloted_to);\n// show the csss view for the resulting timeline \n?>\n\n<div class=\"sl-item sl-primary\">\n <div class=\"sl-content\">\n <small class=\"text-muted\"><?php echo $this->return_timespan($task1->starts_at);?></small>\n <p><?php echo $task1->title?></p>\n </div>\n</div>\n\n\n\n<?php \n}\n?>\n<a href=\"all-task.php?projectid=<?php echo $project_id;?>\" style=\"color:red\">All activities</a>\n<?php \n}", "public function editassigntimeAction()\n {\n $prevurl = getenv(\"HTTP_REFERER\");\n $user_params=$this->_request->getParams();\n $ftvrequest_obj = new Ep_Ftv_FtvRequests();\n $ftvpausetime_obj = new Ep_Ftv_FtvPauseTime();\n $requestId = $user_params['requestId'];\n $requestsdetail = $ftvrequest_obj->getRequestsDetails($requestId);\n\n ($user_params['editftvspentdays'] == '') ? $days=0 : $days=$user_params['editftvspentdays'];\n ($user_params['editftvspenthours'] == '') ? $hours=0 : $hours=$user_params['editftvspenthours'];\n ($user_params['editftvspentminutes'] == '') ? $minutes=0 : $minutes=$user_params['editftvspentminutes'];\n ($user_params['editftvspentseconds'] == '') ? $seconds=0 : $seconds=$user_params['editftvspentseconds'];\n\n /*if($user_params['addasigntime'] == 'addasigntime') ///when time changes in mail content in publish ao popup//\n {\n /*$editdate = date('Y-m-d', strtotime($user_params['editftvassigndate']));\n $edittime = date('H:i:s', strtotime($user_params['editftvassigntime']));\n $editdatetime =$editdate.\" \".$edittime;\n $data = array(\"assigned_at\"=>$editdatetime);////////updating\n $query = \"identifier= '\".$user_params['requestId'].\"'\";\n $ftvrequest_obj->updateFtvRequests($data,$query);\n $parameters['ftvType'] = \"chaine\";\n // $newseconds = $this->allToSeconds($user_params['editftvspentdays'],$user_params['editftvspenthours'],$user_params['editftvspentminutes'],$user_params['editftvspentseconds']);\n echo \"<br>\".$format = \"P\".$days.\"DT\".$hours.\"H\".$minutes.\"M\".$seconds.\"S\";\n echo \"<br>\".$requestsdetail[0]['assigned_at'];\n $time=new DateTime($requestsdetail[0]['assigned_at']);\n $time->sub(new DateInterval($format));\n echo \"<br>\".$assigntime = $time->format('Y-m-d H:i:s');\n $data = array(\"assigned_at\"=>$assigntime);////////updating\n echo $query = \"identifier= '\".$requestId.\"'\";\n $ftvrequest_obj->updateFtvRequests($data,$query);\n $this->_redirect($prevurl);\n }\n elseif($user_params['subasigntime'] == 'subasigntime')\n {\n $format = \"P\".$days.\"DT\".$hours.\"H\".$minutes.\"M\".$seconds.\"S\";\n $time=new DateTime($requestsdetail[0]['assigned_at']);\n $time->add(new DateInterval($format));\n $assigntime = $time->format('Y-m-d H:i:s');\n $data = array(\"assigned_at\"=>$assigntime);////////updating\n $query = \"identifier= '\".$requestId.\"'\";\n $ftvrequest_obj->updateFtvRequests($data,$query);\n $this->_redirect($prevurl);\n }*/\n $inpause = $ftvpausetime_obj->inPause($requestId);\n $requestsdetail[0]['inpause'] = $inpause;\n $ptimes = $ftvpausetime_obj->getPauseDuration($requestId);\n $assigntime = $requestsdetail[0]['assigned_at'];\n //echo $requestId; echo $requestsdetail[0]['assigned_at'];\n\n if(($requestsdetail[0]['status'] == 'done' || $inpause == 'yes') && $requestsdetail[0]['assigned_at'] != null)\n {\n if($requestsdetail[0]['status'] == \"closed\")\n $time1 = ($requestsdetail[0]['cancelled_at']); /// created time\n elseif ($requestsdetail[0]['status'] == \"done\")\n $time1 = ($requestsdetail[0]['closed_at']); /// created time\n else{\n if($inpause == 'yes') {\n $time1 = ($requestsdetail[0]['pause_at']);\n }else {\n $time1 = (date('Y-m-d H:i:s'));///curent time\n }\n }\n $pausedrequests = $ftvpausetime_obj->pausedRequest($requestId);\n if($pausedrequests == 'yes')\n {\n $time2 = $this->subDiffFromDate($requestId, $requestsdetail[0]['assigned_at']);\n }else{\n $time2 = $requestsdetail[0]['assigned_at'];\n }\n $difference = $this->timeDifference($time1, $time2);\n\n }elseif($requestsdetail[0]['assigned_at'] != null){\n $time1 = (date('Y-m-d H:i:s'));///curent time\n\n $pausedrequests = $ftvpausetime_obj->pausedRequest($requestId);\n if($pausedrequests == 'yes')\n {\n $updatedassigntime = $this->subDiffFromDate($requestId, $requestsdetail[0]['assigned_at']);\n }else{\n $updatedassigntime = $requestsdetail[0]['assigned_at'];\n }\n $time2 = $updatedassigntime;\n $difference = $this->timeDifference($time1, $time2);\n }\n ////when user trying to edit the time spent///\n if($user_params['editftvassignsubmit'] == 'editftvassignsubmit') ///when button submitted in popup//\n {\n $newseconds = $this->allToSeconds($days,$hours,$minutes,$seconds);\n $previousseconds = $this->allToSeconds($difference['days'],$difference['hours'],$difference['minutes'],$difference['seconds']);\n if($newseconds > $previousseconds){\n $diffseconds = $newseconds-$previousseconds;\n $difftime = $this->secondsTodayshours($diffseconds);\n $format = \"P\".$difftime['days'].\"DT\".$difftime['hours'].\"H\".$difftime['minutes'].\"M\".$difftime['seconds'].\"S\";\n $requestsdetail[0]['assigned_at'];\n $time=new DateTime($requestsdetail[0]['assigned_at']);\n $time->sub(new DateInterval($format));\n $assigntime = $time->format('Y-m-d H:i:s');\n $data = array(\"assigned_at\"=>$assigntime);////////updating\n $query = \"identifier= '\".$requestId.\"'\";\n $ftvrequest_obj->updateFtvRequests($data,$query);\n $this->_redirect($prevurl);\n }elseif($newseconds < $previousseconds){\n $diffseconds = $previousseconds-$newseconds;\n $difftime = $this->secondsTodayshours($diffseconds);\n $format = \"P\".$difftime['days'].\"DT\".$difftime['hours'].\"H\".$difftime['minutes'].\"M\".$difftime['seconds'].\"S\";\n $time=new DateTime($requestsdetail[0]['assigned_at']);\n $time->add(new DateInterval($format));\n $assigntime = $time->format('Y-m-d H:i:s');\n $data = array(\"assigned_at\"=>$assigntime);////////updating\n $query = \"identifier= '\".$requestId.\"'\";\n $ftvrequest_obj->updateFtvRequests($data,$query);\n $this->_redirect($prevurl);\n }else\n $this->_redirect($prevurl);\n }\n /*$this->_view->reqasgndate = date(\"d-m-Y\", strtotime($reqdetails[0]['assigned_at']));\n $this->_view->reqasgntime = date(\"g:i A\", strtotime($reqdetails[0]['assigned_at']));*/\n $this->_view->days = $difference['days'];\n $this->_view->hours = $difference['hours'];\n $this->_view->minutes = $difference['minutes'];\n $this->_view->seconds = $difference['seconds'];\n $this->_view->requestId = $user_params['requestId'];\n $this->_view->requestobject = $requestsdetail[0]['request_object'];\n $this->_view->current_duration= $difference['days'].\"j \".$difference['hours'].\"h \".$difference['minutes'].\"m \".$difference['seconds'].\"s \";\n\n $this->_view->extendparttime = 'no';\n $this->_view->extendcrtparttime = 'no';\n $this->_view->editftvassigntime = 'yes';\n $this->_view->nores = 'true';\n $this->_view->render(\"ongoing_extendtime_writer_popup\");\n\n }", "public function whereTime() {\n\t\t$pageTitle = 'Where Does Time Go';\n\t\t// $stylesheet = '';\n\n\t\tinclude_once SYSTEM_PATH.'/view/header.php';\n\t\tinclude_once SYSTEM_PATH.'/view/academic-help/tmsub-where-time.php';\n\t\tinclude_once SYSTEM_PATH.'/view/footer.php';\n\t}", "public function unlockAction()\r\n {\r\n $timesheet = $this->byId();\r\n $this->projectService->unlockTimesheet($timesheet);\r\n $this->redirect('timesheet', 'edit', array('clientid'=>$timesheet->clientid, 'projectid'=>$timesheet->projectid, 'id'=>$timesheet->id));\r\n }", "public function mytimesheet($start = null, $end = null)\n\t{\n\n\t\t$me = (new CommonController)->get_current_user();\n\t\t// $auth = Auth::user();\n\t\t//\n\t\t// $me = DB::table('users')\n\t\t// ->leftJoin( DB::raw('(select Max(Id) as maxid,TargetId from files where Type=\"User\" Group By TargetId) as max'), 'max.TargetId', '=', 'users.Id')\n\t\t// ->leftJoin('files', 'files.Id', '=', DB::raw('max.`maxid` and files.`Type`=\"User\"'))\n\t\t// // ->leftJoin('accesscontrols', 'accesscontrols.UserId', '=', 'users.Id')\n\t\t// ->where('users.Id', '=',$auth -> Id)\n\t\t// ->first();\n\n\t\t// $showleave = DB::table('leaves')\n\t\t// ->leftJoin('leavestatuses', 'leaves.Id', '=', 'leavestatuses.LeaveId')\n\t\t// ->leftJoin('users as applicant', 'leaves.UserId', '=', 'applicant.Id')\n\t\t// ->leftJoin('accesscontrols', 'accesscontrols.UserId', '=', 'applicant.Id')\n\t\t// ->leftJoin('users as approver', 'leavestatuses.UserId', '=', 'approver.Id')\n\t\t// ->select('leaves.Id','applicant.Name','leaves.Leave_Type','leaves.Leave_Term','leaves.Start_Date','leaves.End_Date','leaves.Reason','leaves.created_at as Application_Date','approver.Name as Approver','leavestatuses.Leave_Status as Status','leavestatuses.updated_at as Review_Date','leavestatuses.Comment')\n\t\t// ->where('accesscontrols.Show_Leave_To_Public', '=', 1)\n\t\t// ->orderBy('leaves.Id','desc')\n\t\t// ->get();\n\t\t$d=date('d');\n\n\t\tif ($start==null)\n\t\t{\n\n\t\t\tif($d>=21)\n\t\t\t{\n\n\t\t\t\t$start=date('d-M-Y', strtotime('first day of this month'));\n\t\t\t\t$start = date('d-M-Y', strtotime($start . \" +20 days\"));\n\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\t$start=date('d-M-Y', strtotime('first day of last month'));\n\t\t\t\t$start = date('d-M-Y', strtotime($start . \" +20 days\"));\n\n\t\t\t}\n\t\t}\n\n\t\tif ($end==null)\n\t\t{\n\t\t\tif($d>=21)\n\t\t\t{\n\n\t\t\t\t$end=date('d-M-Y', strtotime('first day of next month'));\n\t\t\t\t$end = date('d-M-Y', strtotime($end . \" +19 days\"));\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\t$end=date('d-M-Y', strtotime('first day of this month'));\n\t\t\t\t$end = date('d-M-Y', strtotime($end . \" +19 days\"));\n\n\t\t\t}\n\n\t\t}\n\n\t\t$mytimesheet = DB::table('timesheets')\n\t\t->select('timesheets.Id','timesheets.UserId','timesheets.Latitude_In','timesheets.Longitude_In','timesheets.Latitude_Out','timesheets.Longitude_Out','timesheets.Date',DB::raw('\"\" as Day'),'holidays.Holiday','timesheets.Site_Name','timesheets.Check_In_Type','leaves.Leave_Type','leavestatuses.Leave_Status',\n\t\t'timesheets.Time_In','timesheets.Time_Out','timesheets.Leader_Member','timesheets.Next_Person','timesheets.State','timesheets.Work_Description','timesheets.Remarks','approver.Name as Approver','timesheetstatuses.Status','leaves.Leave_Type','timesheetstatuses.Comment','timesheetstatuses.updated_at as Updated_At','files.Web_Path')\n\t\t->leftJoin( DB::raw('(select Max(Id) as maxid,TargetId from files where Type=\"Timesheet\" Group By TargetId) as maxfile'), 'maxfile.TargetId', '=', 'timesheets.Id')\n\t\t->leftJoin('files', 'files.Id', '=', DB::raw('maxfile.`maxid` and files.`Type`=\"Timesheet\"'))\n\t\t->leftJoin( DB::raw('(select Max(Id) as maxid,TimesheetId from timesheetstatuses Group By TimesheetId) as max'), 'max.TimesheetId', '=', 'timesheets.Id')\n\t\t->leftJoin('timesheetstatuses', 'timesheetstatuses.Id', '=', DB::raw('max.`maxid`'))\n\t\t->leftJoin('users as approver', 'timesheetstatuses.UserId', '=', 'approver.Id')\n\t\t// ->leftJoin('leaves','leaves.UserId','=',DB::raw('timesheets.Id AND str_to_date(timesheets.Date,\"%d-%M-%Y\") Between str_to_date(leaves.Start_Date,\"%d-%M-%Y\") and str_to_date(leaves.End_Date,\"%d-%M-%Y\")'))\n\t\t->leftJoin('leaves','leaves.UserId','=',DB::raw($me->UserId.' AND str_to_date(timesheets.Date,\"%d-%M-%Y\") Between str_to_date(leaves.Start_Date,\"%d-%M-%Y\") and str_to_date(leaves.End_Date,\"%d-%M-%Y\")'))\n\t\t->leftJoin( DB::raw('(select Max(Id) as maxid,LeaveId from leavestatuses Group By LeaveId) as maxleave'), 'maxleave.LeaveId', '=', 'leaves.Id')\n\t\t->leftJoin('leavestatuses', 'leavestatuses.Id', '=', DB::raw('maxleave.`maxid`'))\n\t\t->leftJoin('holidays',DB::raw('1'),'=',DB::raw('1 AND str_to_date(timesheets.Date,\"%d-%M-%Y\") Between str_to_date(holidays.Start_Date,\"%d-%M-%Y\") and str_to_date(holidays.End_Date,\"%d-%M-%Y\")'))\n\t\t->where('timesheets.UserId', '=', $me->UserId)\n\t\t->where(DB::raw('str_to_date(timesheets.Date,\"%d-%M-%Y\")'), '>=', DB::raw('str_to_date(\"'.$start.'\",\"%d-%M-%Y\")'))\n\t\t->where(DB::raw('str_to_date(timesheets.Date,\"%d-%M-%Y\")'), '<=', DB::raw('str_to_date(\"'.$end.'\",\"%d-%M-%Y\")'))\n\t\t->orderBy('timesheets.Id','desc')\n\t\t->get();\n\n\t\t$user = DB::table('users')->select('users.Id','StaffId','Name','Password','User_Type','Company_Email','Personal_Email','Contact_No_1','Contact_No_2','Nationality','Permanent_Address','Current_Address','Home_Base','DOB','NRIC','Passport_No','Gender','Marital_Status','Position','Emergency_Contact_Person',\n\t\t'Emergency_Contact_No','Emergency_Contact_Relationship','Emergency_Contact_Address','files.Web_Path')\n\t\t// ->leftJoin('files', 'files.TargetId', '=', DB::raw('users.`Id` and files.`Type`=\"User\"'))\n\t\t->leftJoin( DB::raw('(select Max(Id) as maxid,TargetId from files where Type=\"User\" Group By Type,TargetId) as max'), 'max.TargetId', '=', 'users.Id')\n\t\t->leftJoin('files', 'files.Id', '=', DB::raw('max.`maxid` and files.`Type`=\"User\"'))\n\t\t->where('users.Id', '=', $me->UserId)\n\t\t->first();\n\n\t\t$arrDate = array();\n\t\t$arrDate2 = array();\n\t\t$arrInsert = array();\n\n\t\tforeach ($mytimesheet as $timesheet) {\n\t\t\t# code...\n\t\t\tarray_push($arrDate,$timesheet->Date);\n\t\t}\n\n\t\t$startTime = strtotime($start);\n\t\t$endTime = strtotime($end);\n\n\t\t// Loop between timestamps, 1 day at a time\n\t\tdo {\n\n\t\t\t if (!in_array(date('d-M-Y', $startTime),$arrDate))\n\t\t\t {\n\t\t\t\t array_push($arrDate2,date('d-M-Y', $startTime));\n\t\t\t }\n\n\t\t\t $startTime = strtotime('+1 day',$startTime);\n\n\t\t} while ($startTime <= $endTime);\n\n\t\tforeach ($arrDate2 as $date) {\n\t\t\t# code...\n\t\t\tarray_push($arrInsert,array('UserId'=>$me->UserId, 'Date'=> $date, 'updated_at'=>date('Y-m-d H:i:s')));\n\n\t\t}\n\n\t\tDB::table('timesheets')->insert($arrInsert);\n\n\t\t$options= DB::table('options')\n\t\t->whereIn('Table', [\"users\",\"timesheets\"])\n\t\t->orderBy('Table','asc')\n\t\t->orderBy('Option','asc')\n\t\t->get();\n\n // $mytimesheet = DB::table('timesheets')\n // ->leftJoin('users as submitter', 'timesheets.UserId', '=', 'submitter.Id')\n // ->select('timesheets.Id','submitter.Name','timesheets.Timesheet_Name','timesheets.Date','timesheets.Remarks')\n // ->where('timesheets.UserId', '=', $me->UserId)\n\t\t\t// ->orderBy('timesheets.Id','desc')\n // ->get();\n\n\t\t\t// $hierarchy = DB::table('users')\n\t\t\t// ->select('L2.Id as L2Id','L2.Name as L2Name','L2.Timesheet_1st_Approval as L21st','L2.Timesheet_2nd_Approval as L22nd',\n\t\t\t// 'L3.Id as L3Id','L3.Name as L3Name','L3.Timesheet_1st_Approval as L31st','L3.Timesheet_2nd_Approval as L32nd')\n\t\t\t// ->leftJoin(DB::raw(\"(select users.Id,users.Name,users.SuperiorId,accesscontrols.Timesheet_1st_Approval,accesscontrols.Timesheet_2nd_Approval,accesscontrols.Timesheet_Final_Approval from users left join accesscontrols on users.Id=accesscontrols.UserId) as L2\"),'L2.Id','=','users.SuperiorId')\n\t\t\t// ->leftJoin(DB::raw(\"(select users.Id,users.Name,users.SuperiorId,accesscontrols.Timesheet_1st_Approval,accesscontrols.Timesheet_2nd_Approval,accesscontrols.Timesheet_Final_Approval from users left join accesscontrols on users.Id=accesscontrols.UserId) as L3\"),'L3.Id','=','L2.SuperiorId')\n\t\t\t// ->where('users.Id', '=', $me->UserId)\n\t\t\t// ->get();\n\t\t\t//\n\t\t\t// $final = DB::table('users')\n\t\t\t// ->select('users.Id','users.Name')\n\t\t\t// ->leftJoin('accesscontrols', 'accesscontrols.UserId', '=', 'users.Id')\n\t\t\t// ->where('Timesheet_Final_Approval', '=', 1)\n\t\t\t// ->get();\n\n\t\t\treturn view('mytimesheet', ['me' => $me, 'user' =>$user, 'mytimesheet' => $mytimesheet,'start' =>$start,'end'=>$end,'options' =>$options]);\n\n\t\t\t//return view('mytimesheet', ['me' => $me,'showleave' =>$showleave, 'mytimesheet' => $mytimesheet, 'hierarchy' => $hierarchy, 'final' => $final]);\n\n\t}", "public function recordAction()\r\n {\r\n $task = $this->projectService->getTask($this->_getParam('id'));\r\n \r\n $user = za()->getUser();\r\n \r\n $time = time();\r\n $record = $this->projectService->addTimesheetRecord($task, $user, $time, $time);\r\n\r\n $this->view->task = $task;\r\n $this->view->record = $record;\r\n $this->view->relatedFaqs = $this->tagService->getRelatedItems($task);\r\n \r\n $this->renderRawView('timesheet/record.php');\r\n }", "public function timeManagement() {\n\t\t$pageTitle = 'Time Management';\n\t\t// $stylesheet = '';\n\n\t\tinclude_once SYSTEM_PATH.'/view/header.php';\n\t\tinclude_once SYSTEM_PATH.'/view/academic-help/time-management.php';\n\t\tinclude_once SYSTEM_PATH.'/view/footer.php';\n\t}", "function weekviewFooter()\n\t {\n\t // Read the hours_lock id\n\t $periodid = $this->m_postvars[\"periodid\"];\n\t $viewdate = $this->m_postvars['viewdate'];\n $viewuser = $this->m_postvars['viewuser'];\n\n\t // If the periodid isnt numeric, then throw an error, no action can be\n // taken so no buttons are added to the footer.\n\t if (!is_numeric($periodid))\n\t {\n\t atkerror(\"Posted periodid isn't numeric\");\n\t return \"\";\n\t }\n\n\t // Retrieve the hours_lock record for the specified periodid\n\t $hourslocknode = &atkGetNode(\"timereg.hours_lock\");\n $hourlocks = $hourslocknode->selectDb(\"hours_lock.id='\".$periodid.\"'\n AND (hours_lock.userid='\".$viewuser.\"'\n OR hours_lock.userid IS NULL)\");\n atk_var_dump($hourlocks);\n\n // Don't display any buttons if there are no hourlocks found\n if (count($hourlocks)==0)\n {\n return \"\";\n }\n\n // Determine the approval status\n $hourlockapproved = ($hourlocks[0][\"approved\"]==1);\n\n $output = '<br />' . sprintf(atktext(\"hours_approve_thestatusofthisperiodis\"), $this->m_lockmode) . \": \";\n if ($hourlockapproved)\n {\n $output.= '<font color=\"#009900\">' . atktext(\"approved\") . '</font><br /><br />';\n }\n else\n {\n $output.= '<font color=\"#ff0000\">' . atktext(\"not_approved_yet\") . '</font><br /><br />';\n }\n\n // Add an approve or disapprove button to the weekview\n\t if (!$hourlockapproved)\n\t {\n\t $output.= atkButton(atktext(\"approve\"),\n dispatch_url(\"timereg.hours_approve\",\"approve\",\n array(\"periodid\"=>$periodid,\n \"viewuser\"=>$viewuser,\n \"viewdate\"=>$viewdate)),\n SESSION_NESTED) . \"&nbsp;&nbsp;\";\n\t }\n\t $output.= atkButton(atktext(\"disapprove\"),\n dispatch_url(\"timereg.hours_approve\",\"disapprove\",\n array(\"periodid\"=>$periodid,\n \"viewuser\"=>$viewuser,\n \"viewdate\"=>$viewdate)),\n SESSION_NESTED);\n\n\t // Return the weekview including button\n\t return $output;\n\t }", "public function endCurrentRound(){\n global $tpl, $lng, $ilCtrl, $ilTabs;\n\n $ilTabs->activateTab(\"showCurrentRound\");\n\n $this->object->endCurrentRound();\n $ilCtrl->redirect($this, \"showCurrentRound\");\n }", "public function getEdittimeline(){\n\n\t\t$room_type_id = Session::get('room_id');\n\t\t$service_id = Session::get('service_id');\n\n\t\t$start = Calendar::where('room_type_id','=',$room_type_id)\n\t\t\t\t\t->where('service_id','=',$service_id)\n\t\t\t\t\t->orderBy('start_date')\n\t\t\t\t\t->select('start_date')\n\t\t\t\t\t->first();\n\t\t$end = Calendar::where('room_type_id','=',$room_type_id)\n\t\t\t\t\t->where('service_id','=',$service_id)\n\t\t\t\t\t->orderBy('start_date', 'DESC')\n\t\t\t\t\t->select('start_date')\n\t\t\t\t\t->first();\n\t\treturn View::make('calendar.edittimeline')\n\t\t\t->with('room_type_id', $room_type_id)\n\t\t\t->with('service_id', $service_id )\n\t\t\t->with('start', $start)\n\t\t\t->with('end', $end);\n\t}", "public function edit()\n\t{\n\t//mnot finished\n\t\techo '<div id=\"content\">';\n\t\t$this->par->load(\"form2\",\"fb\");\n\t\t$fb = $this->par->fb;\n\t\t$fb->_init(false,\" id=\\\"forms\\\"\",false,true);//autofill=false, validate = true\n\t\t\n\t\t$params = array(\n\t\t\tarray(\n\t\t\t\t'label' => 'Project Name:',\n\t\t\t\t'name' => 'name',\n\t\t\t\t'rules' => 'required'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'label' => 'User ID',\n\t\t\t\t'name' => 'userID',\n\t\t\t\t'rules' => 'required'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'label' => 'Start Month',\n\t\t\t\t'type' => 'select',\n\t\t\t\t'name' => 'start_month',\n\t\t\t\t'rules' => 'required'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'label' => 'Start Day(e.g., 01)',\n\t\t\t\t'name' => 'start_day',\n\t\t\t\t'rules' => 'required'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'label' => 'Start Year',\n\t\t\t\t'type' => 'select',\n\t\t\t\t'name' => 'start_year',\n\t\t\t\t'rules' => 'required'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'label' => 'End Month',\n\t\t\t\t'type' => 'select',\n\t\t\t\t'name' => 'End_month',\n\t\t\t\t'rules' => 'required'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'label' => 'End Day(e.g., 01)',\n\t\t\t\t'name' => 'End_day',\n\t\t\t\t'rules' => 'required'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'label' => 'End Year',\n\t\t\t\t'type' => 'select',\n\t\t\t\t'name' => 'End_year',\n\t\t\t\t'rules' => 'required'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'label' => 'Possible Domain:',\n\t\t\t\t'name' => 'domain'\n\t\t\t),array(\n\t\t\t\t'label' => 'Possible Host:',\n\t\t\t\t'name' => 'host'\n\t\t\t)\n\t\t);\n\t\t\n\t\t$fb->set_select(\"start_month\",array(\"Jan\"=>1,\"Feb\"=>2,\"Mar\"=>3,\"Apr\"=>4,\"May\"=>5,\"Jun\"=>6,\"Jul\"=>7,\"Aug\"=>8,\"Sep\"=>9,\"Oct\"=>10,\"Nov\"=>11,\"Dec\"=>12));\n\t\t$year= date('Y');\n\t\t$fb->set_select(\"start_year\",array(($year-1)=>$year-1,($year)=>$year,($year+1)=>$year+1,($year+2)=>$year+2,($year+3)=>$year+3,($year+4)=>$year+4));\n\t\t$fb->set_select(\"End_month\",array(\"Jan\"=>1,\"Feb\"=>2,\"Mar\"=>3,\"Apr\"=>4,\"May\"=>5,\"Jun\"=>6,\"Jul\"=>7,\"Aug\"=>8,\"Sep\"=>9,\"Oct\"=>10,\"Nov\"=>11,\"Dec\"=>12));\n\t\t$year= date('Y');\n\t\t$fb->set_select(\"End_year\",array(($year-1)=>$year-1,($year)=>$year,($year+1)=>$year+1,($year+2)=>$year+2,($year+3)=>$year+3,($year+4)=>$year+4));\n\t\t\n\t\t$fb->set_inputs($params);\n\t\tif($fb->error == TRUE)\n\t\t{\n\t\t\t$fb->display();\n\t\t}\n\t\telse\n\t\t{\t\n $inputs = $fb->get_inputs();\n var_dump($inputs);\n\t\t\t$this->par->DB->update_projects($inputs);\n\t\t\t$this->view();\n\t\t}\t\n\t\techo '</div>';\n\t}", "public function ics_update()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$params = array(\n\t\t\tarray(\t'name' => 'category',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'site_id',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'min_value' => 1,\n\t\t\t\t\t'multi' => TRUE,\n\t\t\t\t\t'default' => $this->data->get_site_id()\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'calendar_id',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'min_value' => 1,\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'calendar_name',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'time_range_start',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'time'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'time_range_end',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'time'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'minute_interval',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'default' => 60\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'status',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE,\n\t\t\t\t\t'default' => 'open'\n\t\t\t\t\t)\n\t\t\t);\n\n\t\t//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t// -------------------------------------\n\t\t// If we are not currently in the time range, scram\n\t\t// -------------------------------------\n\n\t\t$time = date('Hi', time());\n\n\t\tif ($this->P->value('time_range_start', 'time') !== FALSE AND\n\t\t\t$this->P->value('time_range_start', 'time') > $time)\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: It is not time to update icalendar data yet.');\n\t\t\treturn;\n\t\t}\n\t\telse if ($this->P->value('time_range_end', 'time') !== FALSE AND\n\t\t\t\t$this->P->value('time_range_end', 'time') < $time)\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: The time to update icalendar data has passed.');\n\t\t\treturn;\n\t\t}\n\n\t\tif ($this->P->value('calendar_id') == '')\n\t\t{\n\t\t\t// -------------------------------------\n\t\t\t// For those who prefer names over numbers\n\t\t\t// -------------------------------------\n\n\t\t\tif ($this->P->value('calendar_name') != '')\n\t\t\t{\n\t\t\t\t$ids = $this->data->get_calendar_id_from_name($this->P->value('calendar_name'));\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Just a site ID -- get all calendars\n\t\t\t// -------------------------------------\n\n\t\t\telse\n\t\t\t{\n\t\t\t\t$ids = $this->data->get_calendars_by_site_id($this->P->value('site_id'));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$ids = explode('|', $this->P->value('calendar_id'));\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Only look at calendars that are due for an update\n\t\t// -------------------------------------\n\n\t\tif ( ! empty($ids) AND $this->P->value('minute_interval') !== FALSE)\n\t\t{\n\t\t\t$ids = $this->data->get_calendars_needing_update(\n\t\t\t\t$ids,\n\t\t\t\t$this->P->value('minute_interval')\n\t\t\t);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Leave if empty\n\t\t// -------------------------------------\n\n\t\tif (empty($ids))\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: Nobody is due for an update');\n\t\t\treturn;\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Go get those data!\n\t\t// -------------------------------------\n\n\t\t$this->actions();\n\n//ee()->TMPL->log_item('Calendar: Fetching data');\n\n\t\tforeach ($ids as $id)\n\t\t{\n\t\t\t$this->actions->import_ics_data($id);\n\t\t}\n\t}", "public function finish()\n {\n // make sure the datetime column isn't blank\n $columns = $this->get_argument( 'columns' );\n if( !array_key_exists( 'datetime', $columns ) || 0 == strlen( $columns['datetime'] ) )\n throw lib::create( 'exception\\notice', 'The date/time cannot be left blank.', __METHOD__ );\n \n foreach( $columns as $column => $value ) $this->get_record()->$column = $value;\n \n // do not include the user_id if this is a site appointment\n if( 0 < $this->get_record()->address_id ) $this->get_record()->user_id = NULL;\n \n if( !$this->get_record()->validate_date() )\n throw lib::create( 'exception\\notice',\n sprintf(\n 'The participant is not ready for a %s appointment.',\n 0 < $this->get_record()->address_id ? 'home' : 'site' ), __METHOD__ );\n \n // no errors, go ahead and make the change\n parent::finish();\n }", "static function add_eb_nom_end(): void {\r\n\t\tself::add_acf_inner_field(self::ebs, self::eb_nom_end, [\r\n\t\t\t'label' => 'Nomination period end',\r\n\t\t\t'type' => 'text',\r\n\t\t\t'instructions' => 'e.g. March 26 @ 11 p.m.',\r\n\t\t\t'required' => 1,\r\n\t\t\t'conditional_logic' => [\r\n\t\t\t\t[\r\n\t\t\t\t\t[\r\n\t\t\t\t\t\t'field' => self::qualify_field(self::eb_finished),\r\n\t\t\t\t\t\t'operator' => '!=',\r\n\t\t\t\t\t\t'value' => '1',\r\n\t\t\t\t\t],\r\n\t\t\t\t],\r\n\t\t\t],\r\n\t\t\t'wrapper' => [\r\n\t\t\t\t'width' => '',\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'id' => '',\r\n\t\t\t],\r\n\t\t]);\r\n\t}", "function approvedTimesheet($type=1, $pg=1, $limit=25) \t{\n\t\t$this->getMenu();\n\t\t$form = array();\n\t\tif($type==1) {\n\t\t\t$this->session->unset_userdata('client_no');\n\t\t\t$this->session->unset_userdata('client_name');\n\t\t\t$this->session->unset_userdata('project_no');\n\t\t}\n\t\telseif($type==2) {\n\t\t\t$this->session->unset_userdata('client_no');\n\t\t\t$this->session->unset_userdata('client_name');\n\t\t\t$this->session->unset_userdata('project_no');\n\t\t\t\n\t\t\tif($this->input->post('client_no')) \t\t$form['client_no'] = $this->input->post('client_no');\n\t\t\tif($this->input->post('client_name'))\t\t$form['client_name'] = $this->input->post('client_name');\n\t\t\tif($this->input->post('project_no'))\t\t$form['project_no'] = $this->input->post('project_no');\n\t\t\t$this->session->set_userdata($form);\n\t\t}\n\t\t\n\t\tif($this->session->userdata('client_no')) \t$form['client_no'] = $this->session->userdata('client_no');\n\t\tif($this->session->userdata('client_name')) $form['client_name'] = $this->session->userdata('client_name');\n\t\tif($this->session->userdata('project_no')) \t$form['project_no']\t = $this->session->userdata('project_no');\n\t\t\n\t\tif($limit) {\n\t\t\t$this->session->set_userdata('rpp', $limit);\n\t\t\t$this->rpp = $limit;\n\t\t}\n\t\t$limit\t\t= $limit ? $limit : $this->rpp;\n\t\t$this->data['done'] \t\t= $this->timesheetModel->getTimesheetDone();\n\t\n\t\t$this->load->view('timesheet_approvedTimesheet',$this->data); \n\t}", "public function getEndreservation($teetimeid){\n $this->layout->content = View::make('endreservation')->with('teetimeid', $teetimeid);\n }", "function portal_dashboard_calendar_widget() {\n\n\techo portal_output_project_calendar();\n\n}", "public function index(){\n\t \t@$this->loadModel(\"Dashboard\");\n global $session;\n $dashData = array();\n $dashData = $this->model->getDashboardStat();\n $this->view->oticketcount = $dashData['otcount'];\n $this->view->aticketcount = $dashData['atcount'];\n $this->view->oschedule = $dashData['oschedule'];\n $this->view->oworksheet = $dashData['oworksheet'];\n $this->view->clients = $dashData['clients'];\n $this->view->pendings = $dashData['openPend'];\n $this->view->cproducts = $dashData['cproducts'];\n $lastmonth = (int)date(\"n\")-1;\n $curmonth = date(\"n\");\n\n $this->view->monthreport = $this->model->getMonthlyReportFinance(\" Month(datecreated) ='\".$curmonth.\"' AND Year(datecreated)='\".date(\"Y\").\"'\");\n $this->view->lastmonthreport = $this->model->getLastMonthlyReportFinance(\" Month(datecreated) ='\".$lastmonth.\"' AND Year(datecreated)='\".date(\"Y\").\"'\");\n $this->view->thisquarter = $this->model->getThisQuaterReportFinance(\" Quarter(datecreated) ='\".self::date_quarter().\"' AND Year(datecreated)='\".date(\"Y\").\"'\");\n global $session;\n \n if($session->empright == \"Super Admin\"){\n\t\t $this->view->render(\"dashboard/index\");\n\t\t }elseif($session->empright == \"Customer Support Services\" || $session->empright == \"Customer Support Service\"){\n\t\t $this->view->render(\"support/index\");\n\t\t \n\t\t }elseif($session->empright == \"Customer Support Engineer\" || $session->empright == \"Customer Service Engineer\"){\n @$this->loadModel(\"Itdepartment\");\n global $session;\n $datan =\"\";\n $uri = new Url(\"\");\n //$empworkdata = $this->model->getWorkSheetEmployee($id,\"\");\n \n $ptasks = Worksheet::find_by_sql(\"SELECT * FROM work_sheet_form WHERE cse_emp_id =\".$_SESSION['emp_ident'] );\n // print_r($ptasks);\n //$empworkdata['worksheet'];\n $x=1;\n $datan .=\"<table width='100%'>\n <thead><tr>\n \t<th>S/N</th><th>Prod ID</th><th>Status</th><th>Emp ID</th><th>Issue</th><th>Date Generated </th><th></th><th></th>\n </tr>\n </thead>\n <tbody>\";\n if($ptasks){\n \n foreach($ptasks as $task){\n $datan .= \"<tr><td>$x</td><td>$task->prod_id</td><td>$task->status </td><td>$task->cse_emp_id</td><td>$task->problem</td><td>$task->sheet_date</td><td><a href='\".$uri->link(\"itdepartment/worksheetdetail/\".$task->id.\"\").\"'>View Detail</a></td><td></td></tr>\";\n $x++;\n }\n }else{\n $datan .=\"<tr><td colspan='8'></td></tr>\";\n } \n $datan .=\"</tbody></table>\";\n \n $mysched =\"<div id='transalert'>\"; $mysched .=(isset($_SESSION['message']) && !empty($_SESSION['message'])) ? $_SESSION['message'] : \"\"; $mysched .=\"</div>\";\n \n $psched = Schedule::find_by_sql(\"SELECT * FROM schedule WHERE status !='Closed' AND emp_id =\".$_SESSION['emp_ident'].\" ORDER BY id DESC\" );\n //print_r($psched);\n //$empworkdata['worksheet'];\n $x=1;\n $mysched .=\"<table width='100%'>\n <thead><tr>\n \t<th>S/N</th><th>Machine</th><th>Issue</th><th>Location</th><th>Task Type</th><th>Task Date </th><th></th><th></th><th></th>\n </tr>\n </thead>\n <tbody>\";\n if($psched){\n \n foreach($psched as $task){\n $mysched .= \"<tr><td>$x</td><td>$task->prod_name</td><td>$task->issue </td>\"; \n $machine = Cproduct::find_by_id($task->prod_id);\n \n $mysched .= \"<td>$machine->install_address $machine->install_city</td><td>$task->maint_type</td><td>$task->s_date</td><td>\";\n \n if($task->status == \"Open\"){\n $mysched .=\"<a scheddata='{$task->id}' class='acceptTask' href='#'>Accept Task</a>\";\n }\n if($task->status == \"In Progress\"){\n $mysched .=\"<a href='\".$uri->link(\"itdepartment/worksheetupdateEmp/\".$task->id.\"\").\"'>Get Work Sheet</a>\";\n }\n \n $mysched .=\"\n \n <div id='myModal{$task->id}' class='reveal-modal'>\n <h2>Accept Task </h2>\n <p class='lead'>Click on the button below to accept task! </p>\n <form action='?url=itdepartment/doAcceptTask' method='post'>\n <input type='hidden' value='{$task->id}' name='mtaskid' id='mtaskid' />\n <p><a href='#' data-reveal-id='secondModal' class='secondary button acceptTast' >Accept</a></p>\n </form>\n <a class='close-reveal-modal'>&#215;</a>\n</div>\n\n\n \n \n </td><td></td><td></td></tr>\";\n $x++;\n }\n }else{\n $mysched .=\"<tr><td colspan='8'>There is no task currently</td></tr>\";\n } \n $mysched .=\"</tbody></table>\";\n \n $this->view->oldtask = $datan;\n $this->view->schedule = $mysched;\n $this->view->mee = $this->model->getEmployee($_SESSION['emp_ident']);\n $this->view->render(\"itdepartment/staffaccount\");\n\t\t }else{\n\t\t $this->view->render(\"login/index\",true);\n\t\t }\n\t\t\n\t}", "public function index() {\n $currentDate = (new Datetime())->format('Y-m-d');\n \t$timesheets = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->get();\n \t$schedule = Schedule::whereDate('start_date','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->get();\n \t//Get total time worked\n \t$hours = 0;\n \tforeach ($timesheets as $timesheet) {\n\t \t$date1 = new Datetime($timesheet->start_time);\n\t\t\t$date2 = new Datetime($timesheet->end_time);\n\t\t\t$diff = $date2->diff($date1);\n\n $hours = $hours + (($diff->h * 60) + $diff->i);\n \t}\n //Get total breaks\n $breaks = 0;\n $first_timesheet = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->first();\n $last_timesheet = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->latest()->first();\n if($first_timesheet){\n $date1 = new Datetime($first_timesheet->start_time);\n $date2 = new Datetime($last_timesheet->end_time);\n $diff = $date2->diff($date1);\n $breaks = (($diff->h * 60) + $diff->i) - $hours;\n }\n\n $worked = $this->hoursandmins($hours);\n $breaks = $this->hoursandmins($breaks);\n // First Punch In in current day\n $first_punch_in = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->first();\n return view('attendance/index', ['timesheets'=>$timesheets, 'schedule'=>$schedule, 'first_punch_in'=>$first_punch_in, 'worked'=>$worked, 'breaks'=>$breaks, 'first_timesheet'=>$first_timesheet, 'last_timesheet'=>$last_timesheet]);\n }", "public function definition() {\n global $CFG, $PAGE;\n\n $mform =& $this->_form;\n\n //edit section\n $mform->addElement('header', 'configheader', get_string('exitingcrontitle', 'tool_servercron'));\n\n $existing = $this->_customdata['existingrecs'];\n $rows = '';\n\n if (count($existing)) {\n //set up heading for the table\n $row = html_writer::tag('th', get_string('minuteprompt', 'tool_servercron'),\n array('width' => '5%', 'style' => 'padding:5px; text-align:right'));\n\n $row .= html_writer::tag('th', get_string('hourprompt', 'tool_servercron'),\n array('width' => '5%', 'style' => 'padding:5px; text-align:right'));\n\n $row .= html_writer::tag('th', get_string('dayprompt', 'tool_servercron'),\n array('width' => '5%', 'style' => 'padding:5px; text-align:right'));\n\n $row .= html_writer::tag('th', get_string('monthprompt', 'tool_servercron'),\n array('width' => '5%', 'style' => 'padding:5px; text-align:right'));\n\n $row .= html_writer::tag('th', get_string('wdayprompt', 'tool_servercron'),\n array('width' => '5%', 'style' => 'padding:5px; text-align:right'));\n\n $row .= html_writer::tag('th', get_string('commandprompt', 'tool_servercron'),\n array('width' => '30%', 'style' => 'padding:5px; text-align:center'));\n\n $row .= html_writer::tag('th', get_string('actionsprompt', 'tool_servercron'),\n array('style' => 'padding:5px; text-align:center'));\n\n $row = html_writer::tag('tr', $row, array('width' => '100%'));\n $rows .= $row .\"\\n\";\n\n foreach ($existing as $exists) {\n // make up the edit line\n $row = html_writer::tag('td', $exists->minute, array('style' => 'text-align: right'));\n $row .= html_writer::tag('td', $exists->hour, array('style' => 'text-align: right'));\n $row .= html_writer::tag('td', $exists->day, array('style' => 'text-align: right'));\n $row .= html_writer::tag('td', $exists->month, array('style' => 'text-align: right'));\n $row .= html_writer::tag('td', $exists->wday, array('style' => 'text-align: right'));\n $row .= html_writer::tag('td', $exists->commandline);\n\n //editing links\n $row .= html_writer::start_tag('td', array('style' => 'padding:5px; text-align:center'));\n\n $row .= html_writer::tag('a', '['.get_string('editcronjob', 'tool_servercron').']',\n array('id' => 'svrcrn'.$exists->id,\n 'href' => $PAGE->url.\"?action=edit&cronjobid=\".$exists->id));\n\n $row .= '&nbsp;&nbsp;';\n\n $row .= html_writer::tag('a', '['.get_string('deletecronjob', 'tool_servercron').']',\n array('id' => 'svrcrn'.$exists->id, 'href' => $PAGE->url.\"?action=delete&cronjobid=\".$exists->id));\n\n $row .= html_writer::end_tag('td');\n\n $row = html_writer::tag('tr', $row);\n $rows .= $row .\"\\n\";\n }\n\n $mform->addElement('html', html_writer::tag('table', $rows, array('width' => '100%'))); //enclose in table\n } else {\n //if no rec id specified - then we have no records\n if (!$this->_customdata['cronjobid']) {\n $mform->addElement('html', html_writer::tag('p', get_string('noexistingcrons', 'tool_servercron')));\n }\n }\n\n $editing = false; //deafult not editing existing record\n if ($this->_customdata['cronjobid'] != 0) {\n $editing = true;\n }\n //new section\n if ($editing) {\n $mform->addElement('header', 'configheader', get_string('editcronstitle', 'tool_servercron') .' [' .\n $this->_customdata['cronjobid'] . ']' );\n } else {\n $mform->addElement('header', 'configheader', get_string('newcronstitle', 'tool_servercron'));\n }\n\n if (isset($this->_customdata['error'])) {\n $mform->addElement('html', '<h3 style=\"color: red\">'.$this->_customdata['error'].'</h3>');\n }\n\n //hidden field\n $mform->addElement('hidden', 'cronjobid', $this->_customdata['cronjobid'], array('id' => 'id_cronjobid'));//0=new\n // default action is save - have to check for cancel in php code to avoid reliance on JS\n $mform->addElement('hidden', 'action', 'save', array('id' => 'id_action'));\n\n $timingdets=array();\n\n $select = $mform->createElement('select', 'minute', get_string('minuteprompt', 'tool_servercron'),\n $this->_customdata['minutes']);\n $select->setMultiple(true);\n $timingdets[] = $select;\n\n $select = $mform->createElement('select', 'hour', get_string('hourprompt', 'tool_servercron'),\n $this->_customdata['hours']);\n $select->setMultiple(true);\n $timingdets[] = $select;\n\n $select = $mform->createElement('select', 'day', get_string('dayprompt', 'tool_servercron'),\n $this->_customdata['days']);\n $select->setMultiple(true);\n $timingdets[] = $select;\n\n $select = $mform->createElement('select', 'month', get_string('monthprompt', 'tool_servercron'),\n $this->_customdata['months']);\n $select->setMultiple(true);\n $timingdets[] = $select;\n\n $select = $mform->createElement('select', 'wday', get_string('wdayprompt', 'tool_servercron'),\n $this->_customdata['wdays']);\n $select->setMultiple(true);\n $timingdets[] = $select;\n\n //set the defaults for all the dropdowns as every *\n if (isset($this->_customdata['minute'])) {\n $mform->setDefault('minute', $this->_customdata['minute']);\n } else {\n $mform->setDefault('minute', -1);\n }\n\n if (isset($this->_customdata['hour'])) {\n $mform->setDefault('hour', $this->_customdata['hour']);\n } else {\n $mform->setDefault('hour', -1);\n }\n\n if (isset($this->_customdata['day'])) {\n $mform->setDefault('day', $this->_customdata['day']);\n } else {\n $mform->setDefault('day', -1);\n }\n\n if (isset($this->_customdata['month'])) {\n $mform->setDefault('month', $this->_customdata['month']);\n } else {\n $mform->setDefault('month', -1);\n }\n\n if (isset($this->_customdata['wday'])) {\n $mform->setDefault('wday', $this->_customdata['wday']);\n } else {\n $mform->setDefault('wday', -1);\n }\n\n //now add the group to the form\n $mform->addGroup($timingdets, 'timings', get_string('timingsprompt', 'tool_servercron'), array(' '), false);\n\n //servercron title\n $mform->addElement('text', 'commandline', get_string('commandprompt', 'tool_servercron'), array('size' => 100));\n $mform->setDefault('commandline', $this->_customdata['commandline']);\n $mform->setType('commandline', PARAM_TEXT);\n\n //buttons\n $buttonarray=array();\n $buttonarray[] = $mform->createElement('submit', 'save', get_string('cronjobsave', 'tool_servercron'));\n\n if ($editing) {\n $buttonarray[] = $mform->createElement('cancel', 'cancel', get_string('croneditcancel', 'tool_servercron'));\n }\n\n $buttonarray[] = $mform->createElement('reset', 'resetbutton', get_string('cronjobreset', 'tool_servercron'));\n $mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);\n\n }", "private function timingSection() {\n $this->_form->addElement('header', 'timing', get_string('timing', 'codeactivity')); \n \n $this->_form->addElement('date_time_selector', 'opendate', get_string('open_date', 'codeactivity'), self::$datefieldoptions);\n $this->_form->addHelpButton(\n 'opendate',\n 'open_date',\n 'codeactivity');\n $this->_form->addElement('date_time_selector', 'duedate', get_string('due_date', 'codeactivity'), self::$datefieldoptions);\n $this->_form->addHelpButton(\n 'duedate',\n 'due_date',\n 'codeactivity'); \n }", "public function listAction()\r\n {\r\n $pid = $this->_getParam('projectid');\r\n $where = array();\r\n if ($pid) {\r\n $where['projectid='] = $pid;\r\n }\r\n $cid = $this->_getParam('clientid');\r\n if ($cid) {\r\n $where['clientid='] = $cid;\r\n }\r\n \r\n $this->view->timesheets = $this->projectService->getTimesheets($where);\r\n \r\n $this->renderView('timesheet/list.php');\r\n }", "function time_entry_updated( $post_id ) {\n\tif ( wp_is_post_revision( $post_id ) ) {\n\t\treturn;\t\t\n\t}\n\t\n\n // If not time entry dont update\n\t$type1 = 'time_entry';\n\t if ( $type1 != $_POST['post_type'] ) {\n return;\n }\t\n\t\t\n\n\t$post_title = get_the_title( $post_id );\n\t$post_url = get_permalink( $post_id );\n\t//hrs invested\n\t$hrs_invested = 'field_53549855f0f97';\n\t$val1 = get_field_object($hrs_invested, $post_id, true);\n\n\t$field_key = \"field_53549855f0f97\";\n\t$field = get_field_object($field_key, $post_id);\n \n \t//clear values\n \t$totalhourspurchased = 0;\n\t$totalhoursinvested = 0;\n\t$history_hours_content = '';\n\t$myposts =NULL;\n\t\n\n\t\n\tglobal $wp_query;\n$args = array_merge( $wp_query->query_vars,array( 'post_type' => 'time_entry',\n\t\t'posts_per_page' => '-1' ) );\nquery_posts( $args );\t\n\twhile ( have_posts() ) : the_post();\n $history_hours_content.='<li><a href=\"'. get_permalink() .'\">'. get_the_title().':'.get_field('hours_invested').' hours</a></li>';\n\t$totalhoursinvested += get_field('hours_invested'); \n\tendwhile;\n\t\n\t\n\t\t\t\n\n\t//total hours purchased\n\n\n\tif( have_rows('prepaid_hours', 'options') ):\n\t\twhile ( have_rows('prepaid_hours', 'options') ) : the_row();\t\n\t\t\t$totalhourspurchased += get_sub_field('number_of_hours_purchased', 'options');\n\t\tendwhile;\n\t\t\telse :\n\t\t\tendif;\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\t\t\n\t$remainingtime = $totalhourspurchased-$totalhoursinvested;\t\t\n\tif (($remainingtime<=1)&&($remainingtime>0)) {\n\t\t email_low($remainingtime, $totalhourspurchased, $totalhoursinvested);\t\t\n\t} elseif ($remainingtime<=0) {\n\t\temail_zero($remainingtime, $totalhourspurchased, $totalhoursinvested);\n\t}\n\t \n\t\n\t\n}", "public function edit(TimeSheet $sheet)\n {\n return view('sheet.edit', ['sheets' => $sheet]);\n }", "function AfterAdd(&$values,&$keys,$inline,&$pageObject)\n{\n\n\t\tglobal $conn;\n\n$attend_id=$values['attend_id'];\n\n//select shecdule ID from timetable\n$sql_at= \"SELECT scheduleID,courseID,date,(end_time-start_time) AS hour FROM schedule_timetable WHERE id='$attend_id'\";\n$query_at=db_query($sql_at,$conn);\n$row_at=db_fetch_array($query_at);\n\n$scheduleID=$row_at['scheduleID'];\n\n//select related schedule id from schedule\n$sql_at2= \"SELECT programID,batchID,groupID FROM schedule WHERE scheduleID='$scheduleID'\";\n$query_at2=db_query($sql_at2,$conn);\n$row_at2=db_fetch_array($query_at2);\n\n$program=$row_at2['programID'];\n$batch=$row_at2['batchID'];\n$class=$row_at2['groupID'];\n\n//update program , batch, class to student_attendance table\n$date=$row_at['date'];\n$hour=$row_at['hour'];\n$course=$row_at['courseID'];\n$id=$keys['id'];\n$sql_up= \"Update student_attendance set programID ='$program', batchID='$batch',class='$class',course='$course',date='$date',hour='$hour' where id='$id'\";\n$query_up=db_exec($sql_up,$conn);\n\n//query the total hour for this module\n$sql_th= \"SELECT total_hour FROM program_course WHERE programID='$program' && CourseID=$course\";\n$query_th=db_query($sql_th,$conn);\n$row_th=db_fetch_array($query_th);\n\n$totalhour=$row_th['total_hour'];\n//the percentage wight of absentee ( $hour/$totalhour)\n$weight_absent=($hour/$totalhour*100);\n\n//query current attendance status for this student, program , module\n$studentID=$values['StudentID'];\n$sql_at3=\"SELECT Attendance FROM student_course WHERE StudentID=$studentID AND programID=$program AND CourseID=$course AND Exam_Remark IS NULL\";\n$query_at3=db_query($sql_at3,$conn);\n$row_at3=db_fetch_array($query_at3);\n\n$current_attendance=$row_at3['Attendance'];\n//update student_course attendance\n\n$net_attendance=$current_attendance-$weight_absent;\n\n$sql_ups= \"Update student_course SET Attendance='$net_attendance' where StudentID='$studentID' && programID='$program' && CourseID=$course AND Exam_Remark IS NULL\";\n$query_ups=db_exec($sql_ups,$conn);\n;\t\t\n}", "protected function editTaskAction() {}", "public function away_mode_end_time() {\n\n\t\t$current = current_time( 'timestamp' ); //The current time\n\n\t\t//if saved date is in the past update it to something in the future\n\t\tif ( isset( $this->settings['end'] ) && isset( $this->settings['enabled'] ) && $current < $this->settings['end'] ) {\n\t\t\t$end = $this->settings['end'];\n\t\t} else {\n\t\t\t$end = strtotime( date( 'n/j/y 6:00 \\a\\m', ( current_time( 'timestamp' ) + ( 86400 * 2 ) ) ) );\n\t\t}\n\n\t\t//Hour Field\n\t\t$content = '<select name=\"itsec_away_mode[away_end][hour]\" id=\"itsec_away_mode_away_mod_end_time\">';\n\n\t\tfor ( $i = 1; $i <= 12; $i ++ ) {\n\t\t\t$content .= '<option value=\"' . sprintf( '%02d', $i ) . '\" ' . selected( date( 'g', $end ), $i, false ) . '>' . $i . '</option>';\n\t\t}\n\n\t\t$content .= '</select>';\n\n\t\t//Minute Field\n\t\t$content .= '<select name=\"itsec_away_mode[away_end][minute]\" id=\"itsec_away_mode_away_mod_end_time\">';\n\n\t\tfor ( $i = 0; $i <= 59; $i ++ ) {\n\n\t\t\t$content .= '<option value=\"' . sprintf( '%02d', $i ) . '\" ' . selected( date( 'i', $end ), sprintf( '%02d', $i ), false ) . '>' . sprintf( '%02d', $i ) . '</option>';\n\t\t}\n\n\t\t$content .= '</select>';\n\n\t\t//AM/PM Field\n\t\t$content .= '<select name=\"itsec_away_mode[away_end][sel]\" id=\"itsec_away_mode\">';\n\t\t$content .= '<option value=\"am\" ' . selected( date( 'a', $end ), 'am', false ) . '>' . __( 'am', 'it-l10n-ithemes-security-pro' ) . '</option>';\n\t\t$content .= '<option value=\"pm\" ' . selected( date( 'a', $end ), 'pm', false ) . '>' . __( 'pm', 'it-l10n-ithemes-security-pro' ) . '</option>';\n\t\t$content .= '</select><br>';\n\t\t$content .= '<label for=\"itsec_away_mode_away_mod_end_time\"> ' . __( 'Set the time at which the admin dashboard should become available again.', 'it-l10n-ithemes-security-pro' ) . '</label>';\n\n\t\techo $content;\n\n\t}", "public function register_end()\n {\n echo \"Ended the Action \";\n date_default_timezone_set('Europe/Berlin');\n //Array that keeps the localtime \n $arrayt = localtime();\n //calculates seconds rn for further use\n $timeRN = $arrayt[0] + ($arrayt[1] * 60) + ($arrayt[2] * 60 * 60); //in seconds\n\n $jsondecode = file_get_contents($this->save);\n $decoded = json_decode($jsondecode, true);\n for ($i = 0; $i < count($decoded); $i++) {\n if ($decoded[$i][0]['Endtime'] == NULL) {\n $decoded[$i][0]['Endtime'] = $timeRN;\n $encoded = json_encode($decoded);\n file_put_contents($this->save, $encoded);\n }\n }\n }", "public function createAppointmentEndTime()\n {\n $dateTime = strtotime(\"+\" . $this->getEndTimeslot()->getWeight() * 900 . \" seconds\", $this->getAppointmentDate()->format('U'));\n $currentDateTime = new \\DateTime();\n $currentDateTime->setTimestamp($dateTime);\n $this->setHiddenAppointmentEndTime($currentDateTime);\n return;\n }", "function tripal_jobs_get_end_time($job){\n if($job->end_time > 0){\n $end = format_date($job->end_time);\n } else {\n $end = '';\n }\n return $end;\n}", "function update_end()\n {\n }", "public function endTask($id, $end){\n\t\t$startTime = dibi::fetchSingle(\"select [start_times] from [times] where [id_times] = %i\", $id);\n\t\treturn dibi::query(\"update [times] set [end_times] = %i\", $end, \", [duration_times]=%i\", round((time() - $startTime)/60) ,\"where [id_times] = %i\", $id);\n\t}", "public function reiniciaCompraTimeAction(){\n echo $this->view->MantenimientoTicketing->reiniciaCompraTime();\n }", "public function quickEdit() {\n if ($this->request->is('post')) {\n $rq_data = $this->request->data;\n $type = $rq_data['type'];\n\n if ($type == 2) {\n $ids = $rq_data['id'];\n $input = $rq_data['input'];\n $now = date('Y-m-d H:i:s');\n if ($this->Team->updateAll(array('name' => \"'$input'\", 'cdate' => \"'$now'\"), array('Team.id' => $ids))) {\n $this->Session->setFlash(__('プロジェクトのアップデートに成功しました。'), 'alert-box', array('class' => 'alert-success'));\n } else {\n $this->Session->setFlash(__('プロジェクトをアップデートすることはできません。'), 'alert-box', array('class' => 'alert-danger'));\n }\n } elseif ($type == 3) {\n $id = $rq_data['id'];\n $input = $rq_data['input'];\n $cr_data = $rq_data['cr_data'];\n $cr_date = date('Y-m-d H:i:s');\n// $this->Management->query(\"UPDATE management SET team_id = {$id}, update_date = '{$cr_date}' WHERE id = {$input}\");\n\n if ($this->Management->updateAll(array('team_id' => $id, 'update_date' => \"'{$cr_date}'\"), array('id' => $input))) {\n $this->Session->setFlash(__('プロジェクトのアップデートに成功しました。'), 'alert-box', array('class' => 'alert-success'));\n } else {\n $this->Session->setFlash(__('プロジェクトをアップデートすることはできません。'), 'alert-box', array('class' => 'alert-danger'));\n }\n } elseif ($type == 5) {\n $id = $rq_data['id'];\n $input = $rq_data['input'];\n if ($this->Team->save(array('id' => $id, 'code' => $input))) {\n $this->Session->setFlash(__('プロジェクトのアップデートに成功しました。'), 'alert-box', array('class' => 'alert-success'));\n } else {\n $this->Session->setFlash(__('プロジェクトをアップデートすることはできません。'), 'alert-box', array('class' => 'alert-danger'));\n }\n } elseif ($type == 6) {\n $ids = $rq_data['ids'];\n foreach ($ids as $v_id) {\n $visible = $this->Team->find('first', array(\n 'conditions' => array('id' => $v_id),\n 'fields' => array('valid')\n ));\n $status = ($visible['Team']['valid'] == 1) ? 0 : 1;\n\n if ($this->Team->save(array('id' => $v_id, 'valid' => $status))) {\n $this->Session->setFlash(__('プロジェクトのアップデートに成功しました。'), 'alert-box', array('class' => 'alert-success'));\n } else {\n $this->Session->setFlash(__('プロジェクトをアップデートすることはできません。'), 'alert-box', array('class' => 'alert-danger'));\n }\n }\n }\n\n echo json_encode(1);\n exit;\n }\n }", "function eo_get_schedule_end($format='d-m-Y',$id=''){\n\tglobal $post;\n\t$event = $post;\n\n\tif(isset($id)&&$id!='') $event = eo_get_by_postid($id);\n\n\t$date = esc_html($event->reoccurrence_end.' '.$event->StartTime);\n\n\tif(empty($date)||$date==\" \")\n\t\treturn false;\n\n\treturn eo_format_date($date,$format);\n}", "public function setEndtime($endtime){\n $this->_endtime = $endtime;\n }", "public function actionFinal() {\n if (Yii::app()->user->checkAccess('adminhead') && isset($_GET['projectOID'])) {\n\n $model = Project::model()->findByPk($_GET['projectOID']);\n\n $this->render('final', array('model' => $model, 'isFinal' => true));\n }\n }", "public function viewAction()\n {\n \t$idEmployee = EmployeeCatalog::getInstance()->getIdEmployeeByIdUser($this->getUser()->getBean()->getIdUser());\n \t$projects = ProjectCatalog::getInstance()->getIdProjectByIdEmployee($idEmployee); \t\n \tforeach ($projects as $project)\n \t{\n \t\t$tmp[]=$project['id_project'];\n\t\t}\n\t\t$stringProjects = implode(\",\",$tmp);\n\t\t$strProjects='\"';\t\n\t\t$strProjects.= implode(\",\",$tmp);\n\t\t$strProjects.='\"';\t\n\t\t$dates = TimetableHourCatalog::getInstance()->getDisctinctDateByIdProjects($stringProjects);\n \tforeach ($dates as $date)\n \t{\n \t\t$date = $date['date'];\n \t\t$statusTask= TimetableHourCatalog::getInstance()->getStatusByDate($date);\n \t\tif ($statusTask == 2)\n \t\t\t$dateArray2[] = $date;\n \t\tif ($statusTask == 3)\n \t\t\t$dateArray3[] = $date;\n \t\tif ($statusTask == 4)\n \t\t\t$dateArray4[] = $date;\n \t\tif ($statusTask == 1)\n \t\t\t$dateArray1[] = $date;\n\t\t}\t\t\n\t\t$datesStatus2=CalendarDayManager::getInstance()->getCalendarDays($dateArray2);\n\t\t$datesStatus3=CalendarDayManager::getInstance()->getCalendarDays($dateArray3);\n\t\t$datesStatus4=CalendarDayManager::getInstance()->getCalendarDays($dateArray4);\n\t\t$datesStatus1=CalendarDayManager::getInstance()->getCalendarDays($dateArray1);\n\t\t$this->view->daysStaus2= json_encode($datesStatus2);\n\t\t$this->view->daysStaus3= json_encode($datesStatus3);\n\t\t$this->view->daysStaus4= json_encode($datesStatus4);\n\t\t$this->view->daysStaus1= json_encode($datesStatus1); \n\t\t$this->view->projects = $strProjects; \t\t\n $this->setTitle('Calendario de Tareas');\n }", "function calmonthly_snippet2(&$params)\n{\necho \"<textarea id='calmonthly_snippet_edit' style='display:none;'>\";\ncalendar_getDataOfCategoryLookup();\ncalendar_outputTimeFieldsEdit($_REQUEST[\"editid1\"]);\necho \"</textarea>\";\n\n\n\n;\n}", "public function testUpdateTimesheet()\n {\n }", "public function editHours($times,$brID)\n {\n $values = array();\n //Update The Working Hours By The Values From Array Times\n foreach($times as $day)\n {\n $sqlUpdate=\"UPDATE work_hours SET startA= '\".$day[0].\"',endA= '\".$day[1].\"',startB='\".$day[2].\"',endB='\".$day[3].\"',dayOFF='\".$day[5].\"'\n WHERE branch_id ='\".$brID.\"' AND day ='\".$day[4].\"'\";\n $this->execute($sqlUpdate,$values);\n }\n }", "public function fillHours($brID)\n {\n //Query To Get The Old Data Of The Branch WorkingDay Hours\n $sql = \"SELECT * FROM work_hours WHERE branch_id=?\";\n $values=array($brID);\n $workDay=$this->getInfo($sql,$values);\n //Fill the Modal With The Working Hours Information Of Every Day From The DataBase Of The Branch That Represent Choosed\n ?>\n <thead>\n <tr>\n <!-- First column header is not rotated -->\n <th></th>\n <!-- Following headers are rotated -->\n <th class=\"rotate\"><div><span>פתיחת הסניף</span></div></th>\n <th class=\"rotate\"><div><span>הפסקה</span></div></th>\n <th class=\"rotate\"><div><span>סיום הפסקה</span></div></th>\n <th class=\"rotate\"><div><span>סגירת הסניף</span></div></th>\n </tr> \n </thead>\n <tbody>\n <tr>\n <th class=\"row-header\">ראשון</th>\n <td><input type=\"time\" class=\"editday\" value= \"<?php echo $workDay[0]['startA']; ?>\"></td>\n <td><input type=\"time\" class=\"editday\" value= \"<?php echo $workDay[0]['endA']; ?>\"></td>\n <td><input type=\"time\" class=\"editday\" value= \"<?php echo $workDay[0]['startB']; ?>\"></td>\n <td><input type=\"time\" class=\"editday\" value= \"<?php echo $workDay[0]['endB']; ?>\"></td>\n </tr>\n <tr>\n <th class=\"row-header\">שני</th>\n <td><input type=\"time\" class=\"editday\" value= \"<?php echo $workDay[1]['startA']; ?>\"></td>\n <td><input type=\"time\" class=\"editday\" value= \"<?php echo $workDay[1]['endA']; ?>\"></td>\n <td><input type=\"time\" class=\"editday\" value= \"<?php echo $workDay[1]['startB']; ?>\"></td>\n <td><input type=\"time\" class=\"editday\" value= \"<?php echo $workDay[1]['endB']; ?>\"></td>\n </tr>\n <tr>\n <th class=\"row-header\">שלישי</th>\n <td><input type=\"time\" class=\"editday\" value= \"<?php echo $workDay[2]['startA']; ?>\"></td>\n <td><input type=\"time\" class=\"editday\" value= \"<?php echo $workDay[2]['endA']; ?>\"></td>\n <td><input type=\"time\" class=\"editday\" value= \"<?php echo $workDay[2]['startB']; ?>\"></td>\n <td><input type=\"time\" class=\"editday\" value= \"<?php echo $workDay[2]['endB']; ?>\"></td>\n </tr>\n <tr>\n <th class=\"row-header\">רביעי</th>\n <td><input type=\"time\" class=\"editday\" value= \"<?php echo $workDay[3]['startA']; ?>\"></td>\n <td><input type=\"time\" class=\"editday\" value= \"<?php echo $workDay[3]['endA']; ?>\"></td>\n <td><input type=\"time\" class=\"editday\" value= \"<?php echo $workDay[3]['startB']; ?>\"></td>\n <td><input type=\"time\" class=\"editday\" value= \"<?php echo $workDay[3]['endB']; ?>\"></td>\n </tr>\n <tr>\n <th class=\"row-header\">חמישי</th>\n <td><input type=\"time\" class=\"editday\" value= \"<?php echo $workDay[4]['startA']; ?>\"></td>\n <td><input type=\"time\" class=\"editday\" value= \"<?php echo $workDay[4]['endA']; ?>\"></td>\n <td><input type=\"time\" class=\"editday\" value= \"<?php echo $workDay[4]['startB']; ?>\"></td>\n <td><input type=\"time\" class=\"editday\" value= \"<?php echo $workDay[4]['endB']; ?>\"></td>\n </tr>\n <tr>\n <th class=\"row-header\">שישי</th>\n <td><input type=\"time\" class=\"editday\" value= \"<?php echo $workDay[5]['startA']; ?>\"></td>\n <td><input type=\"time\" class=\"editday\" value= \"<?php echo $workDay[5]['endA']; ?>\"></td>\n <td><input type=\"time\" class=\"editday\" value= \"<?php echo $workDay[5]['startB']; ?>\"></td>\n <td><input type=\"time\" class=\"editday\" value= \"<?php echo $workDay[5]['endB']; ?>\"></td>\n </tr>\n <tr>\n <th class=\"row-header\">שבת</th>\n <td><input type=\"time\" class=\"editday\" value= \"<?php echo $workDay[6]['startA']; ?>\"></td>\n <td><input type=\"time\" class=\"editday\" value= \"<?php echo $workDay[6]['endA']; ?>\"></td>\n <td><input type=\"time\" class=\"editday\" value= \"<?php echo $workDay[6]['startB']; ?>\"></td>\n <td><input type=\"time\" class=\"editday\" value= \"<?php echo $workDay[6]['endB']; ?>\"></td>\n </tr>\n </tbody>\n <?php\n \n }", "public function endRoundStart() {\n\t\t$this->displayTeamScoreWidget(false);\n\t}", "public function timesheetAction(Employee $admin)\n {\n\t\t$validateForm = $this->createValidateForm($admin->getEmployee());\n\t\t$this->setActivity($admin->getEmployee()->getName().\" \".$admin->getEmployee()->getFirstname().\" timesheets are consulted\");\n $em = $this->getDoctrine()->getManager();\n $aTimesheets = $em->getRepository('BoAdminBundle:Timesheet')->getTsByEmployee($admin->getEmployee(),2);\n return $this->render('BoAdminBundle:Admin:timesheet.html.twig', array(\n 'employee' => $admin->getEmployee(),\n\t\t\t'validate_form' => $validateForm->createView(),\n\t\t\t'timesheets'=>$aTimesheets,\n\t\t\t'pm'=>\"personnel\",\n\t\t\t'sm'=>\"admin\",\n ));\n }", "function edit()\n\t{\n\t\t$db = JFactory::getDbo();\n\t\t\n\t\tif ($_SERVER['REQUEST_METHOD'] == \"GET\") {\n\t\t\t\n\t\t\t//render the edit form\n\t\t\t$view = $this->getView('manage','html');\n\t\t\t\n\t\t\t//load data\n\t\t\t$db->setQuery('select * from #__shbesuche_config');\n\t\t\t$view->config = $db->loadObject();\n\t\t\t$db->setQuery('select * from #__pbbooking_events where id = '.$db->escape(JRequest::getInt('id')));\n\t\t\t$view->event = $db->loadObject();\n\t\t\t$db->setQuery('select * from #__pbbooking_treatments');\n\t\t\t$view->services = $db->loadObjectList();\n\t\t\t$db->setQuery('select * from #__pbbooking_cals');\n\t\t\t$view->cals = $db->loadObjectList();\n\t\t\tif ($view->config->consolidated_view == 1) { \n\t\t\t\t$db->setQuery('select * from #__pbbooking_cals where out_cal = 1');\n\t\t\t\t$view->outcal = $db->loadObject();\n\t\t\t}\n\t\t\t//sort out openign and closing times\n\t\t\t$opening_hours = json_decode($view->config->trading_hours,true);\n\t\t\t$opening_time_arr = str_split($opening_hours[date_create($view->event->dtstart, new DateTimeZone(SHBESUCHE_TIMEZONE))->format('w')]['open_time'],2);\n\t\t\t$closing_time_arr = str_split($opening_hours[date_create($view->event->dtstart, new DateTimeZone(SHBESUCHE_TIMEZONE))->format('w')]['close_time'],2);\n\t\t\t$view->dt_start = date_create($view->event->dtstart,new DateTimeZone(SHBESUCHE_TIMEZONE));\n\t\t\t$view->dt_end = date_create($view->event->dtstart,new DateTimeZone(SHBESUCHE_TIMEZONE));\n\t\t\t$view->dt_start->setTime($opening_time_arr[0],$opening_time_arr[1]);\n\t\t\t$view->dt_end->setTime($closing_time_arr[0],$closing_time_arr[1]);\n\t\t\t\n\t\t\t//display the view\n\t\t\t$view->setLayout('edit_event');\n\t\t\tJToolbarHelper::save('edit',Jtext::_('COM_SHBESUCHE_SAVE_CHANGES'));\n\t\t\tJToolbarHelper::trash('delete',Jtext::_('COM_SHBESUCHE_DELETE_EVENT'),false);\n\t\t\tJToolbarHelper::custom('view_ical','view_ics','',Jtext::_('COM_SHBESUCHE_VIEW_ICS'),false);\n\t\t\tJToolbarHelper::cancel();\n\t\t\t$view->display();\n\t\t}\n\t\t\n\t\tif ($_SERVER['REQUEST_METHOD'] == \"POST\") {\n\t\t\t$db->setQuery('select * from #__pbbooking_events where id = '.$db->escape(JRequest::getInt('id')));\n\t\t\t$event = $db->loadObject();\n\t\t\t$db->setQuery('select * from #__pbbooking_treatments where id = '.$db->escape($event->service_id));\n\t\t\t$service = $db->loadObject();\n\t\t\t\n\t\t\t$treatment_time = JRequest::getVar('treatment-time');\n\t\t\t$times_arr = str_split($treatment_time,2);\n\t\t\t$dtstart = date_create(JRequest::getVar('date'),new DateTimeZone(SHBESUCHE_TIMEZONE));\n\t\t\t$dtstart->setTime((int)ltrim($times_arr[0],'0'),(int)ltrim($times_arr[1],'0'),0);\n\t\t\t$dtend = date_create($dtstart->format(DATE_ATOM),new DateTimeZone(SHBESUCHE_TIMEZONE));\n\t\t\t$dtend->modify('+'.$service->duration.' minutes');\n\t\t\t\n\t\t\t$event->summary = JRequest::getVar('summary');\n\t\t\t$event->description = JRequest::getVar('description');\n\t\t\t$event->dtstart = $dtstart->format('Y-m-d H:i:s');\n\t\t\t$event->dtend = $dtend->format('Y-m-d H:i:s');\n\n\n\t\t\tif ((int)$_POST['reccur'] == 1) {\n\t\t\t\t$event->r_int = JRequest::getVar('interval');\n\t\t\t\t$event->r_freq = JRequest::getVar('frequency');\n\t\t\t\t$event->r_end = JRequest::getVar('recur_end');\n \t\t\t}\t\n\n\t\t\tif (isset($_POST['cal_id'])) $event->cal_id = JRequest::getInt('cal_id');\n\t\t\tif ($db->updateObject('#__pbbooking_events',$event,'id')) {\n\t\t\t\t$this->setRedirect('index.php?option=com_pbbooking&controller=manage&date='.JRequest::getVar('date'),Jtext::_('COM_SHBESUCHE_EDIT_SUCCESS'));\n\t\t\t} else {\n\t\t\t\techo $db->getErrorMsg();\n\t\t\t}\n\t\t\t\n\t\t}\n\t\n\t}", "function toICS() {\r\n require_once BPSP_PLUGIN_DIR . '/schedules/iCalcreator.class.php';\r\n global $bp;\r\n define( 'ICAL_LANG', get_bloginfo( 'language' ) );\r\n \r\n $cal = new vcalendar();\r\n $cal->setConfig( 'unique_id', str_replace( 'http://', '', get_bloginfo( 'siteurl' ) ) );\r\n $cal->setConfig( 'filename', $bp->groups->current_group->slug );\r\n $cal->setProperty( 'X-WR-CALNAME', __( 'Calendar for: ', 'bpsp' ) . $bp->groups->current_group->name );\r\n $cal->setProperty( 'X-WR-CALDESC', $bp->groups->current_group->description );\r\n $cal->setProperty( 'X-WR-TIMEZONE', get_option('timezone_string') );\r\n \r\n $schedules = $this->has_schedules();\r\n $assignments = BPSP_Assignments::has_assignments();\r\n $entries = array_merge( $assignments, $schedules );\r\n foreach ( $entries as $entry ) {\r\n setup_postdata( $entry );\r\n \r\n $e = new vevent();\r\n \r\n if( $entry->post_type == \"schedule\" )\r\n $date = getdate( strtotime( $entry->start_date ) );\r\n elseif( $entry->post_type == \"assignment\" )\r\n $date = getdate( strtotime( $entry->post_date ) );\r\n $dtstart['year'] = $date['year'];\r\n $dtstart['month'] = $date['mon'];\r\n $dtstart['day'] = $date['mday'];\r\n $dtstart['hour'] = $date['hours'];\r\n $dtstart['min'] = $date['minutes'];\r\n $dtstart['sec'] = $date['seconds'];\r\n $e->setProperty( 'dtstart', $dtstart );\r\n \r\n $e->setProperty( 'description', get_the_content() . \"\\n\\n\" . $entry->permalink );\r\n \r\n if( !empty( $entry->location ) )\r\n $e->setProperty( 'location', $entry->location );\r\n \r\n if( $entry->post_type == \"assignment\" )\r\n $entry->end_date = $entry->due_date; // make assignments compatible with schedule parser\r\n \r\n if( !empty( $entry->end_date ) ) {\r\n $date = getdate( strtotime( $entry->end_date ) );\r\n $dtend['year'] = $date['year'];\r\n $dtend['month'] = $date['mon'];\r\n $dtend['day'] = $date['mday'];\r\n $dtend['hour'] = $date['hours'];\r\n $dtend['min'] = $date['minutes'];\r\n $dtend['sec'] = $date['seconds'];\r\n $e->setProperty( 'dtend', $dtend );\r\n } else\r\n $e->setProperty( 'duration', 0, 1, 0 ); // Assume it's an one day event\r\n \r\n $e->setProperty( 'summary', get_the_title( $entry->ID ) );\r\n $e->setProperty( 'status', 'CONFIRMED' );\r\n \r\n $cal->setComponent( $e );\r\n }\r\n \r\n header(\"HTTP/1.1 200 OK\");\r\n die( $cal->returnCalendar() );\r\n }", "public function edit_schedule($id='') //this is use for edit records start\n\t{\n $data['page'] = 'Schedule';\n\t\t$data['pagetitle']='Manage '.$data['page'].' | Edit '.$data['page'];\n\t\t$data['ckeditor']=false;\n\t\t$data['gridTable']=false;\n\t\t$this->form_validation->set_rules('stage_name', 'stage', 'required');\n\t\t$data['schedule']=$this->schedule->get_schedule_by_id($id);\n\t\t\n\t\tif($id!='')\n\t\t{\n\t\t\t$formSubmit = $this->input->post('Submit');\n\t\t\tif($formSubmit==\"Save\")\n\t\t\t{\n\t\t\t\t\n\t\t\t\t\tif($this->input->post('is_to_be_confirm')=='on')\n\t\t\t\t\t{\n\t\t\t\t\t\t$is_to_be_confirm=1;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$is_to_be_confirm=0;\n\t\t\t\t\t}\n\t\t\t\t\t$start_date=date('Y-m-d H:i',strtotime($this->input->post('start_date')));\n\t\t\t\t\t$end_date=date('Y-m-d H:i',strtotime($this->input->post('end_date')));\n\t\t\t\t\t$tblName = \"schedule\";\n\t\t\t\t\t$fieldName = \"schedule_id\";\n\t\t\t\t\t\n\t\t\t\t\t\tif($is_to_be_confirm==0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$tournament_group_id1_val=$this->input->post('tournament_group_id1');\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$tournament_group_id1_val=\"\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\tif($is_to_be_confirm==0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$tournament_group_id2_val=$this->input->post('tournament_group_id2');\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$tournament_group_id2_val=\"\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\tif($is_to_be_confirm==0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$team_id_1_val=$this->input->post('team_id_1');\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$team_id_1_val=\"\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($is_to_be_confirm==0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$team_id_2_val=$this->input->post('team_id_2');\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$team_id_2_val=\"\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t$data = array(\n\t\t\t\t\t\t\t\t'total_over_id' =>$this->input->post('total_over_id'),\n\t\t\t\t\t\t\t\t'tournament_group_id_1'=>$tournament_group_id1_val,\n\t\t\t\t\t\t\t\t'tournament_group_id_2'=>$tournament_group_id2_val,\n\t\t\t\t\t\t\t\t'team_id_1' =>$team_id_1_val,\n\t\t\t\t\t\t\t\t'team_id_2'=>$team_id_2_val,\n\t\t\t\t\t\t\t\t'stage_id' => $this->input->post('stage_id'),\n\t\t\t\t\t\t\t\t'venue_id' => $this->input->post('venue_id'),\n\t\t\t\t\t\t\t\t'start_date' =>$start_date,\n\t\t\t\t\t\t\t\t'end_date' =>$end_date,\n\t\t\t\t\t\t\t\t'is_to_be_confirm'=>$is_to_be_confirm\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$this->common->update_record($fieldName,$id,$tblName,$data);\n\t\t\t\t\t\t\t\t$this->session->set_flashdata('msg', 'Schedule has been updated successfully.');\n\t\t\t\t\t\t\t\tredirect('admin/schedule/','refresh'); //redirect in manage with msg\n\t\t\t}\n\t\t\t\n\t\t\t$data['tournament']=$this->tournament->get_tournament();\n\t\t\t$data['stage']=$this->schedule->get_stage();\n\t\t\t$data['matche']=$this->schedule->get_match($data['schedule']->tournament_id);\n\t\t\t$data['venue']=$this->schedule->get_venue();\n\t\t\t$data['over']=$this->schedule->get_over();\n\t\t\t$data['group']=$this->schedule->get_tournament_group($data['schedule']->tournament_id);\n\t\t\t$data['team_1']=$this->schedule->get_group_assign_teams($data['schedule']->tournament_group_id_1);\n\t\t\t$data['team_2']=$this->schedule->get_group_assign_teams($data['schedule']->tournament_group_id_2);\n\t\t\t$this->load->view('admin/controls/vwHeader');\n\t\t\t$this->load->view('admin/controls/vwLeft',$data);\n\t\t\t$this->load->view('admin/controls/vwFooterJavascript',$data);\n\t $this->load->view('admin/vwEditSchedule',$data);\n\t\t\t$this->load->view('admin/controls/vwFooter');\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n redirect('admin/schedule');\n }\n }", "public function edit(Workout $workout)\n {\n //\n }", "public function actionRemovewl(){\n\t\t\n $connection=yii::app()->db;\n\t\t $sqluodate=\"UPDATE memberplot SET WLSTATUS='0',WLDATE='' WHERE plot_id='\".$_GET['id'].\"'\";\n\t\t$sqlresult=$connection->createCommand($sqluodate);\n\t\t$sqlresult->execute();\n\t\t\t\t$connection = Yii::app()->db; \n\t\t$temp_projects_array = Yii::app()->session['projects_array'];\n\t\t$num_of_projects_counter = count($temp_projects_array);\t\n\t\t$num_of_projects_counter2 = $num_of_projects_counter;\n\t\t$sql1 = \"select * from projects where\";\n\t\t$num_of_projects_counter--;\n\t\twhile($num_of_projects_counter>-1)\n\t\t{\n\t\t\t$sql2[$num_of_projects_counter] = \" id=\".Yii::app()->session['projects_array'][$num_of_projects_counter]['project_id'];\n\t\t\t$num_of_projects_counter--;\n\t\t}\n\t\t\n\t\t$sql_project = $sql1;\n\t\t$sql_project = $sql_project.implode(' or',$sql2);\n\t\t$result_projects = $connection->createCommand($sql_project)->query() or mysql_error();\n\t\t$this->render('defaulter_list',array('projects'=>$result_projects));\n\t\t\n\t\t\t\t\t}", "function setEndDateAndTime($end_date = \"\", $end_time) \n\t{\n\t\t$y = ''; $m = ''; $d = ''; $h = ''; $i = ''; $s = '';\n\t\tif (preg_match(\"/(\\d{4})-(\\d{2})-(\\d{2})/\", $end_date, $matches))\n\t\t{\n\t\t\t$y = $matches[1];\n\t\t\t$m = $matches[2];\n\t\t\t$d = $matches[3];\n\t\t}\n\t\tif (preg_match(\"/(\\d{2}):(\\d{2}):(\\d{2})/\", $end_time, $matches))\n\t\t{\n\t\t\t$h = $matches[1];\n\t\t\t$i = $matches[2];\n\t\t\t$s = $matches[3];\n\t\t}\n\t\t$this->end_date = sprintf('%04d%02d%02d%02d%02d%02d', $y, $m, $d, $h, $i, $s);\n\t}", "public function finished(){\r\n $this->session->set_userdata('referred_from', current_url());\r\n $data['tasks'] = $this->TaskModel->getFinishedTasks($this->userId);\r\n $data['taskTitle'] = \"Finished Tasks\";\r\n $data['base_url'] = $this->base_url;\r\n $data['title'] = \"ICT Cloud | Admin | Tasks\";\r\n\r\n $data['finish'] = false;\r\n $data['delete'] = false;\r\n\r\n $data['menu'] = \"\";\r\n\r\n foreach($this->menu['Menu'] as $m)\r\n {\r\n $data['menu'] .= '<li>';\r\n $data['menu'] .= '<a href=\"'.$m['AppMenuLink'].'\"><i class=\"fa '.$m['AppMenuIcon'].' fa-fw\"></i> '.$m['AppMenuName'].'</a>';\r\n $data['menu'] .= '</li>';\r\n }\r\n\r\n $data['formTaskName'] = $this->formTaskName;\r\n $data['formOptions'] = $this->formOptions;\r\n $data['formSubmit'] = $this->formSubmit;\r\n $data['formTaskDescription'] = $this->formTaskDescription;\r\n $data['formEndDate'] = $this->formEndDate;\r\n\r\n $data['Groups'] = $this->adminGroups;\r\n\r\n $this->load_view(\"Task/TaskList\", $data);\r\n }", "function eo_get_the_end($format='d-m-Y',$id='',$occurrence=0){\n\tglobal $post;\n\t$event = $post;\n\n\tif(isset($id)&&$id!='') $event = eo_get_by_postid($id);\n\n\tif(empty($event)) return false;\n\n\t$date = esc_html($event->EndDate).' '.esc_html($event->FinishTime);\n\n\tif(empty($date)||$date==\" \")\n\t\treturn false;\n\n\treturn eo_format_date($date,$format);\n}", "public function edit($int_proj_no)\n {\t\n \n if(session()->get('user')->int_status==1)\n {\n $date=date('Y-m-d');\n \n $attendance=tbl_intern_attend::where('att_intern',session()->get('user')->int_no)->where('att_date',$date)->first();\n \n $interns=tbl_intern_attend::where('att_intern',session()->get('user')->int_no)->first();\n }\n elseif(session()->get('user')->int_status==-1){\n $date=date('Y-m-d');\n \n $attendance=tbl_intern_attend::where('att_intern',session()->get('user')->int_no)->where('att_date',$date)->first();\n \n $interns=tbl_intern_attend::where('att_intern',session()->get('user')->int_no)->first();\n }else{\n \n $date=date('Y-m-d');\n $attendance=tbl_intern_attend::where('att_intern',session()->get('user')->int_no)->where('att_date',$date)->first();\n \n $begin = new DateTime(session()->get('user')->int_join_date);\n $end = new DateTime($date);\n $daterange = new DatePeriod($begin, new DateInterval('P1D'), $end);\n \n foreach($daterange as $d)\n { \n if($d>$date)\n {\n $att=tbl_intern_attend::where('att_intern',session()->get('user')->int_no)->where('att_date',$d->format('Y-m-d'))->first();\n if($att==null)\n {\n $add=tbl_intern_attend::create([\n // 'att_marked_on'=>$request->input('att_marked_on'),\n 'att_intern'=>session()->get('user')->int_no,\n 'att_date'=>$d->format('Y-m-d'),\n 'att_marked_on'=>$d->format('Y-m-d'),\n 'att_in'=>\"00:00:00\",\n 'att_out'=>\"00:00:00\",\n 'att_holiday'=>\"1\",\n ]);\n }\n }\n else\n {\n break;\n }\n }\n }\n \n\n \n \n \n \n \n \n \n \n \n \n \n return view('discussionboard',compact('project','int_proj_no','attendance'));\n\n }", "public function edit(TimeSlot $timeSlot)\n {\n //\n }", "public function endMaintenancePeriod() : void\n {\n $this->getHesAdminDb()->update('\n UPDATE maintenance_periods SET end_time = now() WHERE end_time IS NULL\n ');\n }", "function ical() {\n \t$filter = ProjectUsers::getVisibleTypesFilter($this->logged_user, array(PROJECT_STATUS_ACTIVE), get_completable_project_object_types());\n if($filter) {\n $objects = ProjectObjects::find(array(\n \t\t 'conditions' => array($filter . ' AND completed_on IS NULL AND state >= ? AND visibility >= ?', STATE_VISIBLE, $this->logged_user->getVisibility()),\n \t\t 'order' => 'priority DESC',\n \t\t));\n\n \t\trender_icalendar(lang('Global Calendar'), $objects, true);\n \t\tdie();\n } elseif($this->request->get('subscribe')) {\n \tflash_error(lang('You are not able to download .ics file because you are not participating in any of the active projects at the moment'));\n \t$this->redirectTo('ical_subscribe');\n } else {\n \t$this->httpError(HTTP_ERR_NOT_FOUND);\n } // if\n }", "function touch_time($edit = 1, $for_post = 1, $tab_index = 0, $multi = 0)\n {\n }", "public function set_end_date()\n {\n if ($this->end_date === NULL && $this->start_date === NULL) {\n $this->formated_end_date = \"the game has not started yet\";\n } elseif($this->end_date === NULL && $this->start_date !== NULL) {\n $this->formated_end_date = \"the game is not finished yet\";\n } else {\n $end_date = Carbon::createFromTimestamp($this->end_date / 1000);\n $this->formated_end_date = $end_date->toDayDateTimeString();\n }\n return $this->formated_end_date; \n }", "function showEnd( $appctx )\n\t\t{\n\t\t$appctx->Moins() ;\n\t\t}", "function render_listinstancejobs_footer() {\n //get the current report shortname\n $report = $this->required_param('report', PARAM_ALPHAEXT);\n\n print_spacer();\n\n //button for scheduling a new instance\n print_single_button($this->get_url(), array('report' => $report), get_string('listinstancejobs_new', 'block_php_report'));\n\n echo '<hr>';\n print_spacer();\n\n //button for listing all reports\n print_single_button($this->get_url(), array('action' => 'list'), get_string('listinstancejobs_back_label', 'block_php_report'));\n }", "public function testGetTimesheet()\n {\n }", "function tab_project(){\n\tglobal $t_project_ids;\n\tglobal $f_version_id;\n\tglobal $t_version_type;\n\tstatic $i = 0;\n\n\n\t$f_columns = bug_list_columns('bug_list_columns_versions');\n\n\t$t_project_id = $t_project_ids[$i];\n\t$i++;\n\n\t/* get all project versions */\n\t$t_version_rows = version_get_all_rows($t_project_id, true, true);\n\n\tif($t_version_type == 'target_version')\n\t\t$t_version_rows = array_reverse($t_version_rows);\n\t\t\n\t$t_is_first_version = true;\n\n\t/* print sectin per version */\n\tforeach($t_version_rows as $t_version_row){\n\t\t$t_version_name = $t_version_row['version'];\n\t\t$t_released = $t_version_row['released'];\n\t\t$t_obsolete = $t_version_row['obsolete'];\n\n\t\t/* only show either released or unreleased versions */\n\t\tif(($t_version_type == 'target_version' && ($t_released || $t_obsolete)) || ($t_version_type != 'target_version' && !$t_released && !$t_obsolete))\n\t\t\tcontinue;\n\n\t\t/* Skip all versions except the specified one (if any) */\n\t\tif($f_version_id != -1 && $f_version_id != $t_version_row['id'])\n\t\t\tcontinue;\n\n\t\t/* query issue list */\n\t\t$t_issues_resolved = 0;\n\t\t$t_issue_ids = db_query_roadmap_info($t_project_id, $t_version_name, $t_version_type, $t_issues_resolved);\n\t\t$t_num_issues = count($t_issue_ids);\n\t\n\t\t/* print section */\n\t\tsection_begin('Version: ' . $t_version_name, !$t_is_first_version);\n\t\t\t/* print version description and progress */\n\t\t\tcolumn_begin('6-left');\n\n\t\t\t$t_progress = 0;\n\n\t\t\tif($t_num_issues > 0)\n\t\t\t\t$t_progress = (int)($t_issues_resolved * 100 / $t_num_issues);\n\n\t\t\t$t_release_date = date(config_get('short_date_format'), $t_version_row['date_order']);\n\n\t\t\tif(!$t_obsolete){\n\t\t\t\tif($t_released)\t$t_release_state = format_label('Released (' . $t_release_date . ')', 'label-success');\n\t\t\t\telse\t\t\t$t_release_state = format_label('Planned Release (' . $t_release_date . ')', 'label-info');\n\t\t\t}\n\t\t\telse\n\t\t\t\t$t_release_state = format_label('Obsolete (' . $t_release_date . ')', 'label-danger');\n\n\n\t\t\ttable_begin(array());\n\t\t\ttable_row(\n\t\t\t\tarray(\n\t\t\t\t\t$t_release_state,\n\t\t\t\t\tformat_progressbar($t_progress),\n\t\t\t\t\tformat_button_link($t_issues_resolved . ' of ' . $t_num_issues . ' issue(s) resolved', 'filter_apply.php', array('type' => 1, 'temporary' => 'y', FILTER_PROPERTY_PROJECT_ID => $t_project_id, FILTER_PROPERTY_TARGET_VERSION => $t_version_name), 'input-xxs')\n\t\t\t\t),\n\t\t\t\t'',\n\t\t\t\tarray('', 'width=\"100%\"', '')\n\t\t\t);\n\t\t\ttable_end();\n\n\t\t\t$t_description = $t_version_row['description'];\n\n\t\t\tif(!is_blank($t_description))\n\t\t\t\talert('warning', string_display($t_description));\n\n\t\t\tcolumn_end();\n\n\t\t\t/* print issues */\n\t\t\tcolumn_begin('6-right');\n\t\t\tactionbar_begin();\n\t\t\t\techo '<div class=\"pull-right\">';\n\t\t\t\t\t$t_menu = array(\n\t\t\t\t\t\tarray('label' => 'Select Columns', 'data' => array('link' => format_href('columns_select_page.php', column_select_input('bug_list_columns_versions', $f_columns, false, true, basename(__FILE__))), 'class' => 'inline-page-link')),\n\t\t\t\t\t);\n\n\t\t\t\t\tdropdown_menu('', $t_menu, '', '', 'dropdown-menu-right');\n\t\t\t\techo '</div>';\n\t\t\tactionbar_end();\n\n\t\t\tbug_list_print($t_issue_ids, $f_columns, 'table-condensed table-hover table-datatable no-border');\n\t\t\tcolumn_end();\n\t\tsection_end();\n\n\t\t$t_is_first_version = false;\n\t}\n\n\t/* print message if no versions have been shown */\n\tif($t_is_first_version){\n\t\techo '<p class=\"lead\">';\n\t\techo 'No Roadmap information available. Issues are included once projects have versions and issues have \"target version\" set.';\n\t\techo '</p>';\n\t}\n}", "public static function agenda() {return new ScheduleViewMode(8);}", "function show_next_calendar(){ \n \t\t\t$this->gen_contents['region_search'] \t= $_POST['region'];\n \t\t\t$this->gen_contents['subregion_search'] = $_POST['subregion'];\n $this->gen_contents['course_search'] = $_POST['course'];\n if($this->gen_contents['course_search']=='5'){\n $this->gen_contents['chp_search'] = $_POST['chp'];\n }\n $this->gen_contents[\"chp_list\"] = $this->config->item('chapter_list');\n $this->gen_contents[\"crse_color\"] = $this->config->item('course_color');\n \t\t\t// we call _date function to get all the details of calendar n its event\n\t\t\t$this->gen_contents = array_merge($this->gen_contents,$this->_date($_POST['timeid'],$_POST['course'],$_POST['region'],$_POST['subregion']));\n\t\t\t\n\t\t\t$this->load->view('user/career_event/schedule_calendar',$this->gen_contents);\n \t\t}", "public function details (){\n $connection = new database();\n $table = new simple_table_ops();\n\n $id = $_GET['id']; // timetable_id\n $content = \"<div class='link_button'>\n <a href='?controller=teachers&action=export'>Export to EXCEL</a>\n <a href='?controller=curricula&action=index'>Curricula</a>\n </div>\";\n\n $content .= \"<div class='third_left'>\";\n $content .='<p>You can configure the timetable for the following course:<p>';\n\n $sql = \"SELECT curricula.curriculum_id, CONCAT (teachers.nom, ' ', teachers.prenom, ' | ', teachers.nom_khmer, ' ', teachers.prenom_khmer, ' | ', sexes.sex) as teacher, subjects.subject, levels.level\n FROM curricula\n JOIN courses ON curricula.course_id = courses.course_id\n JOIN subjects ON curricula.subject_id = subjects.subject_id\n JOIN teachers ON teachers.teacher_id = curricula.teacher_id\n JOIN sexes ON teachers.sex_id = sexes.sex_id\n JOIN levels ON courses.level_id = levels.level_id\n JOIN timetables ON timetables.curriculum_id = curricula.curriculum_id\n WHERE timetables.timetable_id = {$_GET['id']}\";\n\n $curricula_data = $connection->query($sql);\n\n if ($connection->get_row_num() == 0) {\n header(\"Location: http://\".WEBSITE_URL.\"/index.php?controller=curricula&action=index\");\n }\n\n $curricula_data = $curricula_data[0];\n\n $content .='Teacher: '.$curricula_data['teacher'].'<br>';\n $content .='Subject: '.$curricula_data['subject'].'<br>';\n $content .='Level: '.$curricula_data['level'].'<br>';\n\n\n $columns = array ('start_time_id, end_time_id, weekday_id, classroom_id, timetable_period_id');\n\n $neat_columns = array ('Start Time', 'End Time', 'Week Day', 'Classroom', 'Time Period' , 'Update', 'Delete');\n\n // create curriculum_id array\n $sql = \"SELECT curriculum_id FROM timetables WHERE timetable_id = {$id}\";\n\n $curriculum_id_result = $connection->query($sql);\n $curriculum_id_array = $curriculum_id_result[0];\n\n // time_id, weekday_id, curriculum_id, classroom_id,\n $sql = 'SELECT time_id as start_time_id, time_class as time1 FROM time ORDER BY time_id ASC';\n $time1_result = $connection->query($sql);\n\n $sql = 'SELECT time_id as end_time_id, time_class as time2 FROM time ORDER BY time_id ASC';\n $time2_result = $connection->query($sql);\n\n $sql = 'SELECT weekday_id, weekday FROM weekdays ORDER BY weekday_id';\n $weekdays_result = $connection->query($sql);\n\n $sql = \"SELECT timetable_period_id, CONCAT(nom, ', from ', date_from, ' to ', date_to) as timetable_period FROM timetable_periods ORDER BY date_from\";\n $timetable_periods_result = $connection->query($sql);\n\n $sql = 'SELECT classroom_id, classroom FROM classrooms ORDER BY classroom ASC';\n $classrooms_result = $connection->query($sql);\n\n $drop_down = array(\n 'start_time_id' => array('start_time' => $time1_result),\n 'end_time_id' => array('end_time' => $time2_result),\n 'weekday_id' => array('weekday' => $weekdays_result),\n 'timetable_period_id'=>array('timetable_period'=> $timetable_periods_result),\n 'classroom_id' => array('classroom' => $classrooms_result)\n );\n\n /********************************************************************/\n /* CONFIGURES Form structure */\n\n $form = array(\n 'action' => '?controller=timetable&action=update&id='.$id,\n 'div' => \"class='solitary_input'\",\n 'div_button' => \"class='submit_button1'\",\n 'method' => 'post',\n 'action_links' => array(1 => array('delete', '?controller=timetable&action=delete&id=')),\n 'id' => 'top_form',\n 'elements' => array(\n 1 => array ('hidden' => $curriculum_id_array),\n 3 => array ('drop_down' => 'start_time_id'),\n 4 => array ('drop_down' => 'end_time_id'),\n 5 => array ('drop_down' => 'weekday_id'),\n 6 => array ('drop_down' => 'classroom_id'),\n 7 => array ('drop_down' => 'timetable_period_id'),\n 10 => array ('submit' => 'update')\n )\n );\n\n $table->set_top_form($form);\n\n $table->set_table_name('timetables');\n $table->set_id_column('timetable_id');\n\n $table->set_table_column_names($columns);\n $table->set_html_table_column_names($neat_columns);\n\n $table->set_values_form(); // set values found in database into form elements when building top_form\n $table->set_drop_down($drop_down);\n $table->set_form_array($form);\n\n\n $content .= \"</div>\";\n\n $content .= \" <div class='two_thirds_right'><table>\".$table->details().'</table></div>';\n $output['content'] = $content;\n return $output;\n\n }", "public function getEndDateTime();", "public function exporthours($id)\n {\n // $export = new HoursExport();\n // $export->setId($id);\n //\n // Excel::download($export, 'hours {{$id}}.xlsx');\n $hours = Hour::whereProjectId($id)->get();\n (new FastExcel($hours))->export('uren'.$id.'.xlsx', function ($hour) {\n return [\n 'Project' => $hour->project->projectname . ' '.$hour->project->customer->companyname,\n 'Naam' => $hour->user->name,\n 'Van' => date('d-m-Y', strtotime($hour->workedstartdate)),\n 'Begin' => $hour->workedstarttime,\n 'Tot' => date('d-m-Y', strtotime($hour->workedenddate)),\n 'Eind' => $hour->workedendtime,\n 'Totaal' => sprintf('%02d:%02d:%02d', ($hour->worked_hours/3600),($hour->worked_hours/60%60), $hour->worked_hours%60)\n ];\n});\nreturn FastExcel($hours)->download('uren'.$id.'.xlsx');\n$projects = Project::findOrFail($id);\n$tasks = Task::whereProjectId($id)->get()->all();\n$users = User::pluck('name','id')->all();\n // $hours = Hour::whereProjectId($id)->get()->all();\n $availables = Available::whereProjectId($id)->get()->all();\n $sumtaskhours = Task::whereProjectId($id)->sum('planned_hours');\n $sumhourhours = Hour::whereProjectId($id)->sum('worked_hours');\n\nreturn view('planner.projects');\n\n\n\n\n }", "public function renderTimetable()\n\t{\n\t\t$data = $this->database->query(\"SELECT * FROM course NATURAL JOIN course_has_student NATURAL JOIN task WHERE id_user=? AND student_status=1 AND (course_status=1 OR course_status=2 OR course_status=3);\", $this->user->identity->id)->fetchAll();\n\n\t\tif (!$data) {\n\t\t\treturn;\n\t\t}\n\n\n\t\t$conflictArray=array();\n\n\t\t$tasks = array();\n\t\t$dayTasksCount = array();\n\t\tfor ($i = 1; $i <= 7; $i++) {\n\t\t\t$dayTasksCount[$i] = 0;\n\t\t\t$conflictArray[$i]=array();\n\t\t\tfor ($j=0; $j < 24; $j++) { \n\t\t\t\t$conflictArray[$i][$j]=0;\n\t\t\t}\n\t\t}\n\t\tforeach ($data as $value) {\n\t\n\t\t\t$day = date('N', $value->task_date->getTimestamp());\n\n\t\t\t$from=$value->task_from==NULL?$value->task_to-1:$value->task_from;\n\t\t\t$to=$value->task_from==NULL?$value->task_to:$value->task_to;\n\t\t\t$date=$value->task_from==NULL?strftime(\"%Y-%m-%d\",$value->task_date->getTimestamp()):\"\";\n\t\t\tif($value->task_type==\"ZK\")\n\t\t\t{\n\t\t\t\t$date=strftime(\"%Y-%m-%d\",$value->task_date->getTimestamp());\n\t\t\t}\n\n\t\t\t//Check exist of time in conflict array\n\t\t\tfor ($i=$from; $i < $to; $i++) { \n\t\t\t\t$conflictArray[$day][$i]+=1;\n\t\t\t}\n\n\t\t\tarray_push($tasks,[\n\t\t\t\t\"task_name\"=>\"[$value->id_course] $value->task_name \".$date,\n\t\t\t\t\"day\"=>$day,\n\t\t\t\t\"task_from\"=>$from,\n\t\t\t\t\"task_to\"=>$to\n\t\t\t\t]);\n\t\t\t\n\t\t}\n\n\t\tforeach ($conflictArray as $key => $value) {\n\t\t\t$dayTasksCount[$key]=max($value);\n\t\t}\n\n\t\tforeach ($tasks as $key => $value) {\n\t\t\t$day_p=\"\";\n\t\t\tswitch ($value[\"day\"]) {\n\t\t\t\tcase 1:\n\t\t\t\t\t$day_p=\"Pondělí\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\t$day_p=\"Úterý\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\t$day_p=\"Středa\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\t$day_p=\"Čtvrtek\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\t$day_p=\"Pátek\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t\t$day_p=\"Sobota\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 7:\n\t\t\t\t\t$day_p=\"Neděle\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif($conflictArray[$value[\"day\"]][$value[\"task_from\"]]==0)\n\t\t\t{\n\t\t\t\t$tasks[$key][\"day\"]=$day_p;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$tasks[$key][\"day\"]=$day_p.$conflictArray[$value[\"day\"]][$value[\"task_from\"]];\n\t\t\t$conflictArray[$value[\"day\"]][$value[\"task_from\"]]-=1;\n\t\t}\n\n\t\t\n\t\t$weekDays = array();\n\t\tforeach ($dayTasksCount as $key => $value) {\n\t\t\tif ($value == 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfor ($i = 1; $i <= $value; $i++) {\n\t\t\t\tswitch ($key) {\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\tarray_push($weekDays, \"Pondělí$i\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tarray_push($weekDays, \"Úterý$i\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\tarray_push($weekDays, \"Středa$i\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 4:\n\t\t\t\t\t\tarray_push($weekDays, \"Čtvrtek$i\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 5:\n\t\t\t\t\t\tarray_push($weekDays, \"Pátek$i\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 6:\n\t\t\t\t\t\tarray_push($weekDays, \"Sobota$i\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 7:\n\t\t\t\t\t\tarray_push($weekDays, \"Neděle$i\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->template->weekDays=Json::encode($weekDays);\n\t\t$this->template->tasks=$tasks;\n\n\t}", "static function add_eb_finished(): void {\r\n\t\tself::add_acf_inner_field(self::ebs, self::eb_finished, [\r\n\t\t\t'label' => 'Finished',\r\n\t\t\t'type' => 'true_false',\r\n\t\t\t'instructions' => 'Is the election finished?',\r\n\t\t\t'required' => 0,\r\n\t\t\t'conditional_logic' => 0,\r\n\t\t\t'wrapper' => [\r\n\t\t\t\t'width' => '',\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'id' => '',\r\n\t\t\t],\r\n\t\t\t'message' => '',\r\n\t\t\t'default_value' => 0,\r\n\t\t\t'ui' => 1,\r\n\t\t]);\r\n\t}", "public function edit(tbl_project $tbl_project)\n {\n //\n }", "function timeconditions_timegroups_edit_times($timegroup,$times) {\n\tglobal $db;\n\n\t$sql = \"delete from timegroups_details where timegroupid = $timegroup\";\n\t$db->query($sql);\n\tforeach ($times as $key=>$val) {\n\t\textract($val);\n\t\t$time = timeconditions_timegroups_buildtime( $hour_start, $minute_start, $hour_finish, $minute_finish, $wday_start, $wday_finish, $mday_start, $mday_finish, $month_start, $month_finish);\n\t\tif (isset($time) && $time != '' && $time <> '*|*|*|*') {\n\t\t\t$sql = \"insert timegroups_details (timegroupid, time) values ($timegroup, '$time')\";\n\t\t\t$db->query($sql);\n\t\t}\n\t}\n\tneedreload();\n}", "public function getDateTimeObjectEnd();", "public function edit(tenth $tenth)\n {\n //\n }", "function udesign_single_portfolio_entry_bottom() {\r\n do_action('udesign_single_portfolio_entry_bottom');\r\n}", "public function update($timesheet){\n\t\t$sql = 'UPDATE timesheet SET EMP_ID = ?, TS_RPT_DATE = ?, WELL_ID = ?, WRK_DESC = ?, TIME_INT = ?, TIMESTAMP = ? WHERE SHEET_ID = ?';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t\n\t\t$sqlQuery->setNumber($timesheet->eMPID);\n\t\t$sqlQuery->set($timesheet->tSRPTDATE);\n\t\t$sqlQuery->setNumber($timesheet->wELLID);\n\t\t$sqlQuery->set($timesheet->wRKDESC);\n\t\t$sqlQuery->set($timesheet->tIMEINT);\n\t\t$sqlQuery->set($timesheet->tIMESTAMP);\n\n\t\t$sqlQuery->setNumber($timesheet->sHEETID);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}", "public function away_mode_end_date() {\n\n\t\t$current = current_time( 'timestamp' ); //The current time\n\n\t\t//if saved date is in the past update it to something in the future\n\t\tif ( isset( $this->settings['end'] ) && isset( $this->settings['enabled'] ) && $current < $this->settings['end'] ) {\n\t\t\t$end = $this->settings['end'];\n\t\t} else {\n\t\t\t$end = strtotime( date( 'n/j/y 12:00 \\a\\m', ( current_time( 'timestamp' ) + ( 86400 * 2 ) ) ) );\n\t\t}\n\n\t\t//Date Field\n\t\t$content = '<input class=\"end_date_field\" type=\"text\" id=\"itsec_away_mode_end_date\" name=\"itsec_away_mode[away_end][date]\" value=\"' . date( 'm/d/y', $end ) . '\"/><br>';\n\t\t$content .= '<label class=\"end_date_field\" for=\"itsec_away_mode_end_date\"> ' . __( 'Set the date at which the admin dashboard should become available', 'it-l10n-ithemes-security-pro' ) . '</label>';\n\n\t\techo $content;\n\n\t}", "function agenda_mini_footer($id_agenda=0, $critere='oui', $max_mois=6, $taille=5, $format='d-m H:i') {\n\n\tif ($id_agenda == 0)\n\t\treturn;\n\n\tif ($taille == 0)\n\t\treturn;\n\n\t// Init du contexte\n\t$nom_mois = agenda_mois(true, 'entier');\n\t$contexte_aff = agenda_definir_contexte(0);\n\t$mois_choisi = $contexte_aff['mois_base'];\n\t$annee_choisie = $contexte_aff['annee_base'];\n\t$url_base = $contexte_aff['url_base'];\n\t// Init de l'annee et du mois courant\n\t$mois_courant = affdate_base(date('Y-m-d'), 'mois');\n\t$annee_courante = affdate_base(date('Y-m-d'), 'annee');\n\t// Init des listes d'evenements\n\t$evenements = agenda_recenser_evenement(0);\n\t$count_evt = count($evenements);\n\n\t// Init de la date de base pour calculer le nombre d'evenements du resume a afficher\n\t// - si le mois choisi est le mois courant, la date de base est la date courante, on affichera donc les evenements posterieurs\n\t// - si le mois choisi est anterieur ou posterieur au mois courant, la date de base est le 1er jour du mois\n\tif (($annee_choisie==$annee_courante) && ($mois_choisi==$mois_courant)) \n\t\t$date_base = date('Y-m-d');\n\telse\n\t\t$date_base = date('Y-m-d', mktime(0,0,0,$mois_choisi,1,$annee_choisie));\n\n\t// Init de la chaine\n\t$footer = NULL;\n\n\t// Extraction des evenements du resume si demande\n\tif ($critere == 'oui') {\n\t\t$i = 1;\n\t\t$liste_complete = FALSE;\n\t\t$cellule = NULL;\n\t\t$count_liste = 0;\n\t\twhile ((!$liste_complete) && ($i <= $count_evt)) {\n\t\t\t$annee = $evenements[$i]['annee'];\n\t\t\t$mois = $evenements[$i]['mois'];\n\t\t\t$jour = $evenements[$i]['jour'];\n\t\t\t$date = mktime(0,0,0,intval($mois), intval($jour), intval($annee));\n\t\t\tif ((date('Y-m-d',$date) >= $date_base) && ($count_liste < $taille)) {\n\t\t\t\tif ($count_liste == 0) $cellule .= '<table id=\"footer_evenements\" summary=\"'._T('sarkaspip:resume_mini_agenda_footer').'\">';\n\t\t\t\t$cellule .= '<tr><td class=\"footer_colg\">'.affdate_base($evenements[$i]['date_redac'], $format).':&nbsp;</td>';\n\t\t\t\t$cellule .= '<td class=\"footer_cold\"><a rel=\"nofollow\" href=\"spip.php?page=evenement&amp;id_article='.$evenements[$i]['id'].'\">'.$evenements[$i]['titre'].'</a></td></tr>';\n\t\t\t\t$count_liste += 1;\n\t\t\t}\n\t\t\t$liste_complete = ($count_liste == $taille);\n\t\t\t$i = $i + 1;\n\t\t}\n\t\tif ($count_liste == 0) {\n\t\t\tif ($max_mois == 1)\n\t\t\t\t$msg_erreur = _T('sarkaspip:agenda_1_mois_vide');\n\t\t\telse {\n\t\t\t\t$msg_erreur = _T('sarkaspip:agenda_n_mois_vides', array('mois'=>$max_mois));\n\t\t\t}\n\t\t\t$cellule .= '<div class=\"texte\">'.$msg_erreur.'</div>';\n\t\t}\n\t\telse\n\t\t\t$cellule .= '</table>';\n\n\t\t$footer .= $cellule;\n\t}\n\treturn $footer;\n}", "public function edit(Doctor_timeslot $doctor_timeslot)\n {\n //\n }", "public function editAction()\n {\n\n $request = $this->getRequest();\n\n $routeMatch = $this->getEvent()->getRouteMatch();\n $id = $routeMatch->getParam('exercise_id', 0);\n\n if ($id <= 0) {\n return $this->redirect()->toRoute('hi-training/workout/list');\n }\n\n $exercise = $this->_exercise->getRow(array('exercise_id' => $id));\n\n if (!$exercise) {\n return $this->redirect()->toRoute('hi-training/workout/list');\n }\n\n $workoutId = $exercise->workout_id;\n\n $workout = $this->_workout->getRow(array('workout_id' => $workoutId));\n\n if (!$workout) {\n return $this->redirect()->toRoute('hi-training/workout/list');\n }\n\n $typeId = $exercise->type_id;\n\n $type = $this->_exerciseType->getRow(array('type_id' => $typeId));\n\n// if (!$type) {\n// return $this->redirect()->toRoute('hi-training/workout/list');\n// }\n\n /**\n * Grid FORM\n */\n $form = new WorkoutExerciseGrid(\n array(\n 'view' => $this->_view,\n )\n );\n\n /**\n * BUILDING Row\n */\n $row = new WorkoutExerciseRow(\n array(\n 'model' => $this->_exercise,\n 'view' => $this->_view,\n )\n );\n\n //\n $row->setRowId($id);\n\n\n\n $row->setFieldOptions('type_id', array(\n 'values' => $this->_exerciseType->getBehaviour('nestedSet')->getResultSetForSelect(),\n 'onchange' => 'exerciseType(this);',\n ));\n $row->setFieldOptions('workout_id', array(\n 'value' => $workoutId,\n ));\n\n $row->addAction(\n 'saveEdit',\n 'submit',\n array(\n 'label' => 'save and continue editing',\n 'class' => 'actionImage',\n// 'image' => $this->_skinUrl . '/img/icons/record/save.png',\n )\n );\n\n //\n $row->build();\n\n //\n $form->addSubForm($row, $row->getName());\n\n //\n $this->_view->headScript()->appendScript(\n $this->_view->render(\n 'workout-exercise/edit.js',\n array(\n 'currentFormType' => $type['form_type'],\n 'back' => $this->url()->fromRoute('hi-training/workout-exercise/list/wildcard', array('workout_id' => $workoutId)),\n 'ajaxFormType' => $this->url()->fromRoute(\n 'hi-training/exercise-type/ajax-form-type/wildcard',\n array('type_id' => '')\n ),\n 'ajaxLastOfType' => $this->url()->fromRoute(\n 'hi-training/workout-exercise/ajax-last-of-type/wildcard',\n array('type_id' => '')\n ),\n )\n )\n );\n\n\n /**\n * POST\n */\n if ($this->getRequest()->isPost()) {\n\n $formData = $this->getRequest()->post()->toArray();\n\n if ($form->isValid($formData)) {\n\n if ( isset($formData['header']['formId'])\n && $formData['header']['formId'] == 'WorkoutExerciseGridForm') {\n\n if (isset($formData['WorkoutExerciseRow']['actions']['save'])) {\n\n if (is_array($formData['WorkoutExerciseRow']['row'])){\n $row = $this->_exercise->getRow(array('exercise_id' => $id))\n ->populate($formData['WorkoutExerciseRow']['row']);\n $row->save();\n\n return $this->redirect()->toRoute(\n 'hi-training/workout-exercise/list/wildcard',\n array('workout_id' => $workoutId)\n );\n }\n\n }\n\n if (isset($formData['WorkoutExerciseRow']['actions']['saveAdd'])) {\n\n if (is_array($formData['WorkoutExerciseRow']['row'])){\n $row = $this->_exercise->getRow(array('exercise_id' => $id))\n ->populate($formData['WorkoutExerciseRow']['row']);\n $row->save();\n\n return $this->redirect()->toRoute(\n 'hi-training/workout-exercise/add/wildcard',\n array('workout_id' => $workoutId)\n );\n }\n\n }\n\n if (isset($formData['WorkoutExerciseRow']['actions']['saveEdit'])) {\n\n if (is_array($formData['WorkoutExerciseRow']['row'])){\n $row = $this->_exercise->getRow(array('exercise_id' => $id))\n ->populate($formData['WorkoutExerciseRow']['row']);\n $row->save();\n\n return $this->redirect()->toRoute(\n 'hi-training/workout-exercise/edit/wildcard',\n array('exercise_id' => $id)\n );\n }\n\n }\n }\n }\n }\n\n return array(\n 'form' => $form,\n 'workout' => $workout,\n 'exercise' => $exercise,\n );\n }", "public function finish()\n {\n parent::finish();\n \n $form_entry_list_method = sprintf( 'get_%s_entry_list', $this->get_subject() );\n $session = lib::create( 'business\\session' );\n $db_user = $session->get_user();\n $db_role = $session->get_role();\n\n foreach( $this->get_record_list() as $record )\n {\n // determine who has worked on the form\n $typist_1 = 'n/a';\n $typist_1_submitted = false;\n $typist_2 = 'n/a';\n $typist_2_submitted = false;\n\n $form_entry_list = $record->$form_entry_list_method();\n $db_form_entry = current( $form_entry_list );\n if( $db_form_entry )\n {\n $typist_1 = $db_form_entry->get_user()->name;\n $typist_1_submitted = !$db_form_entry->deferred;\n }\n $db_form_entry = next( $form_entry_list );\n if( $db_form_entry )\n {\n $typist_2 = $db_form_entry->get_user()->name;\n $typist_2_submitted = !$db_form_entry->deferred;\n }\n\n // if both typists have submitted and this form is still in the list then there is a conflict\n $conflict = $typist_1_submitted && $typist_2_submitted;\n\n $this->add_row( $record->id,\n array( 'id' => $record->id,\n 'date' => $record->date,\n 'typist_1' => $typist_1,\n 'typist_1_submitted' => $typist_1_submitted,\n 'typist_2' => $typist_2,\n 'typist_2_submitted' => $typist_2_submitted,\n 'conflict' => $conflict ) );\n }\n\n $this->finish_setting_rows();\n }", "public function endRun(): void\n {\n $file = $this->getLogDir() . 'timeReport.json';\n $data = is_file($file) ? json_decode(file_get_contents($file), true) : [];\n $data = array_replace($data, $this->timeList);\n file_put_contents($file, json_encode($data, JSON_PRETTY_PRINT));\n }", "public function get_endtime()\n {\n }", "function BeforeShowEdit(&$xt, &$templatefile, $values, &$pageObject)\n{\n\n\t\t$dbDate = db2time( $values[\"DateField\"] );\n$dbEndDate = db2time( $values[\"EndDate\"] );\n$recur = 0; \nif (comparedates( $dbEndDate, $dbDate) != 0) {\n\t\t\t$recur = 1;\n}\n$eid=$_REQUEST[\"editid1\"];\n$xt->assign(\"delete_button\",true);\n$xt->assign(\"hshow\",false);\n$xt->assign(\"deleteAttr\",\"recid=\".$eid.\" days=\".$_SESSION[\"days\"].\" mon=\".$_SESSION[\"mon\"].\" yr=\".$_SESSION[\"yr\"].\" recur=\".$recur);\n\n;\t\t\n}" ]
[ "0.5857467", "0.5823386", "0.5771635", "0.57287365", "0.57166153", "0.5543178", "0.5532987", "0.55003977", "0.54705083", "0.54627174", "0.54182446", "0.5406684", "0.53993934", "0.53990364", "0.5384052", "0.5374057", "0.5286709", "0.52829486", "0.5272925", "0.5267017", "0.5264354", "0.5242215", "0.5211516", "0.52111", "0.52013767", "0.51717216", "0.5165622", "0.5133041", "0.51107234", "0.51085293", "0.5101827", "0.50839436", "0.50672", "0.5048592", "0.5036019", "0.50169206", "0.5012492", "0.4991894", "0.49909896", "0.49850127", "0.49767238", "0.49748766", "0.49636272", "0.49624446", "0.49544236", "0.49458647", "0.49418426", "0.49369508", "0.49333546", "0.49297065", "0.49291408", "0.49282107", "0.49240464", "0.4922177", "0.4919048", "0.49157813", "0.49149364", "0.49113956", "0.48910666", "0.48713833", "0.48600098", "0.4855818", "0.48429564", "0.483826", "0.48308802", "0.48293406", "0.48227423", "0.48190606", "0.48149163", "0.48124352", "0.4811311", "0.48091337", "0.48070002", "0.48036143", "0.47878048", "0.47852224", "0.478392", "0.47800824", "0.47719657", "0.47716063", "0.47684327", "0.476686", "0.47608116", "0.4758236", "0.475815", "0.47508526", "0.47501886", "0.47423986", "0.4740115", "0.47398332", "0.4736386", "0.4735182", "0.47341335", "0.47328356", "0.47321016", "0.47277284", "0.47226858", "0.47171405", "0.47171107", "0.47161108", "0.4714501" ]
0.0
-1
END TIMESHEET WEEKLY VIEW / requestApproval /
function requestApproval() { $this->getMenu() ; $id = $this->input->post('id'); $this->timesheetModel->saveTimesheetRequest($id); redirect ('/timesheet/'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\r\n {\r\n \tini_set('memory_limit', '64M');\r\n $validFormats = array('weekly');\r\n $format = 'weekly'; // $this->_getParam('format', 'weekly');\r\n \r\n if (!in_array($format, $validFormats)) {\r\n $this->flash('Format not valid');\r\n $this->renderView('error.php');\r\n return;\r\n }\r\n\r\n $reportingOn = 'Dynamic';\r\n \r\n // -1 will mean that by default, just choose all timesheet records\r\n $timesheetid = -1;\r\n\r\n // Okay, so if we were passed in a timesheet, it means we want to view\r\n // the data for that timesheet. However, if that timesheet is locked, \r\n // we want to make sure that the tasks being viewed are ONLY those that\r\n // are found in that locked timesheet.\r\n $timesheet = $this->byId();\r\n\r\n $start = null;\r\n $end = null;\r\n $this->view->showLinks = true;\r\n $cats = array();\r\n\r\n if ($timesheet) {\r\n $this->_setParam('clientid', $timesheet->clientid);\r\n $this->_setParam('projectid', $timesheet->projectid);\r\n if ($timesheet->locked) {\r\n $timesheetid = $timesheet->id;\r\n $reportingOn = $timesheet->title;\r\n } else {\r\n $timesheetid = 0; \r\n $reportingOn = 'Preview: '.$timesheet->title;\r\n }\r\n if (is_array($timesheet->tasktype)) {\r\n \t$cats = $timesheet->tasktype;\r\n } \r\n\r\n $start = date('Y-m-d 00:00:01', strtotime($timesheet->from));\r\n $end = date('Y-m-d 23:59:59', strtotime($timesheet->to)); \r\n $this->view->showLinks = false;\r\n } else if ($this->_getParam('category')){\r\n \t$cats = array($this->_getParam('category'));\r\n }\r\n \r\n \r\n $project = $this->_getParam('projectid') ? $this->byId($this->_getParam('projectid'), 'Project') : null;\r\n\t\t\r\n\t\t$client = null;\r\n\t\tif (!$project) {\r\n \t$client = $this->_getParam('clientid') ? $this->byId($this->_getParam('clientid'), 'Client') : null;\r\n\t\t}\r\n\t\t\r\n $user = $this->_getParam('username') ? $this->userService->getUserByField('username', $this->_getParam('username')) : null;\r\n \r\n\t\t$this->view->user = $user;\r\n\t\t$this->view->project = $project;\r\n\t\t$this->view->client = $client ? $client : ( $project ? $this->byId($project->clientid, 'Client'):null);\r\n\t\t$this->view->category = $this->_getParam('category');\r\n \r\n if (!$start) {\r\n\t // The start date, if not set in the parameters, will be just\r\n\t // the previous monday\r\n\t $start = $this->_getParam('start', $this->calculateDefaultStartDate());\r\n\t // $end = $this->_getParam('end', date('Y-m-d', time()));\r\n\t $end = $this->_getParam('end', date('Y-m-d 23:59:59', strtotime($start) + (6 * 86400)));\r\n }\r\n \r\n // lets normalise the end date to make sure it's of 23:59:59\r\n\t\t$end = date('Y-m-d 23:59:59', strtotime($end));\r\n\r\n $this->view->title = $reportingOn;\r\n \r\n $order = 'endtime desc';\r\n if ($format == 'weekly') {\r\n $order = 'starttime asc';\r\n }\r\n\r\n $this->view->taskInfo = $this->projectService->getTimesheetReport($user, $project, $client, $timesheetid, $start, $end, $cats, $order);\r\n \r\n // get the hierachy for all the tasks in the task info. Make sure to record how 'deep' the hierarchy is too\r\n\t\t$hierarchies = array();\r\n\r\n\t\t$maxHierarchyLength = 0;\r\n\t\tforeach ($this->view->taskInfo as $taskinfo) {\r\n\t\t\tif (!isset($hierarchies[$taskinfo->taskid])) {\r\n\t\t\t\t$task = $this->projectService->getTask($taskinfo->taskid);\r\n\t\t\t\t$taskHierarchy = array();\r\n\t\t\t\tif ($task) {\r\n\t\t\t\t\t$taskHierarchy = $task->getHierarchy();\r\n\t\t\t\t\tif (count($taskHierarchy) > $maxHierarchyLength) {\r\n\t\t\t\t\t\t$maxHierarchyLength = count($taskHierarchy);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$hierarchies[$taskinfo->taskid] = $taskHierarchy;\r\n\t\t\t} \r\n\t\t}\r\n\t\r\n\t\t$this->view->hierarchies = $hierarchies;\r\n\t\t$this->view->maxHierarchyLength = $maxHierarchyLength;\r\n\r\n $this->view->startDate = $start;\r\n $this->view->endDate = $end;\r\n $this->view->params = $this->_getAllParams();\r\n $this->view->dayDivision = za()->getConfig('day_length', 8) / 4; // za()->getConfig('day_division', 2);\r\n $this->view->divisionTolerance = za()->getConfig('division_tolerance', 20);\r\n \r\n $outputformat = $this->_getParam('outputformat');\r\n if ($outputformat == 'csv') {\r\n \t$this->_response->setHeader(\"Content-type\", \"text/csv\");\r\n\t $this->_response->setHeader(\"Content-Disposition\", \"inline; filename=\\\"timesheet.csv\\\"\");\r\n\r\n\t echo $this->renderRawView('timesheet/csv-export.php');\r\n } else {\r\n\t\t\tif ($this->_getParam('_ajax')) {\r\n\t\t\t\t$this->renderRawView('timesheet/'.$format.'-report.php');\r\n\t\t\t} else {\r\n\t\t\t\t$this->renderView('timesheet/'.$format.'-report.php');\r\n\t\t\t}\r\n }\r\n }", "function weekviewFooter()\n\t {\n\t // Read the hours_lock id\n\t $periodid = $this->m_postvars[\"periodid\"];\n\t $viewdate = $this->m_postvars['viewdate'];\n $viewuser = $this->m_postvars['viewuser'];\n\n\t // If the periodid isnt numeric, then throw an error, no action can be\n // taken so no buttons are added to the footer.\n\t if (!is_numeric($periodid))\n\t {\n\t atkerror(\"Posted periodid isn't numeric\");\n\t return \"\";\n\t }\n\n\t // Retrieve the hours_lock record for the specified periodid\n\t $hourslocknode = &atkGetNode(\"timereg.hours_lock\");\n $hourlocks = $hourslocknode->selectDb(\"hours_lock.id='\".$periodid.\"'\n AND (hours_lock.userid='\".$viewuser.\"'\n OR hours_lock.userid IS NULL)\");\n atk_var_dump($hourlocks);\n\n // Don't display any buttons if there are no hourlocks found\n if (count($hourlocks)==0)\n {\n return \"\";\n }\n\n // Determine the approval status\n $hourlockapproved = ($hourlocks[0][\"approved\"]==1);\n\n $output = '<br />' . sprintf(atktext(\"hours_approve_thestatusofthisperiodis\"), $this->m_lockmode) . \": \";\n if ($hourlockapproved)\n {\n $output.= '<font color=\"#009900\">' . atktext(\"approved\") . '</font><br /><br />';\n }\n else\n {\n $output.= '<font color=\"#ff0000\">' . atktext(\"not_approved_yet\") . '</font><br /><br />';\n }\n\n // Add an approve or disapprove button to the weekview\n\t if (!$hourlockapproved)\n\t {\n\t $output.= atkButton(atktext(\"approve\"),\n dispatch_url(\"timereg.hours_approve\",\"approve\",\n array(\"periodid\"=>$periodid,\n \"viewuser\"=>$viewuser,\n \"viewdate\"=>$viewdate)),\n SESSION_NESTED) . \"&nbsp;&nbsp;\";\n\t }\n\t $output.= atkButton(atktext(\"disapprove\"),\n dispatch_url(\"timereg.hours_approve\",\"disapprove\",\n array(\"periodid\"=>$periodid,\n \"viewuser\"=>$viewuser,\n \"viewdate\"=>$viewdate)),\n SESSION_NESTED);\n\n\t // Return the weekview including button\n\t return $output;\n\t }", "public function view_req($month,$id,$status){\n\t\t// set the page title\t\t\n\t\t$this->set('title_for_layout', 'Waive Off Request- Approve/Reject - HRIS - BigOffice');\n\t\tif(!empty($id) && intval($id) && !empty($month) && !empty($status)){\n\t\t\tif($status == 'pass' || $status == 'view_only'){\t\n\t\t\t\t$options = array(\t\t\t\n\t\t\t\t\tarray('table' => 'hr_attendance',\n\t\t\t\t\t\t\t'alias' => 'Attendance',\t\t\t\t\t\n\t\t\t\t\t\t\t'type' => 'LEFT',\n\t\t\t\t\t\t\t'conditions' => array('`Attendance`.`app_users_id` = `HrAttWaive`.`app_users_id`',\n\t\t\t\t\t\t\t'HrAttWaive.date like date_format(`Attendance`.`in_time`, \"%Y-%m-%d\")')\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t// get the employee\n\t\t\t\t$emp_data = $this->HrAttWaive->HrEmployee->find('first', array('conditions' => array('HrEmployee.id' => $id)));\n\t\t\t\t$this->set('empData', $emp_data);\t\t\t\t\n\t\t\t\t$data = $this->HrAttWaive->find('all', array('conditions' => array(\"date_format(HrAttWaive.date, '%Y-%m')\" => $month,\n\t\t\t\t'HrAttWaive.app_users_id' => $id),\n\t\t\t\t'fields' => array('id','date','reason','Attendance.in_time','status',\n\t\t\t\t'HrEmployee.first_name','HrEmployee.last_name','remark'), 'order' => array('HrAttWaive.date' => 'asc'), 'joins' => $options));\t\n\t\t\t\t$this->set('att_data', $data);\n\t\t\t\t// for view mode\n\t\t\t\tif($status == 'view_only'){\t\t\t\t\t\n\t\t\t\t\t$this->set('VIEW_ONLY', 1);\n\t\t\t\t}\n\t\t\t}else if($ret_value == 'fail'){ \n\t\t\t\t$this->Session->setFlash('<button type=\"button\" class=\"close\" data-dismiss=\"alert-error\">&times;</button>Invalid Entry', 'default', array('class' => 'alert alert-error'));\t\n\t\t\t\t$this->redirect('/hrattwaive/');\t\n\t\t\t}else{\n\t\t\t\t$this->Session->setFlash('<button type=\"button\" class=\"close\" data-dismiss=\"alert-error\">&times;</button>Record Deleted: '.$ret_value , 'default', array('class' => 'alert alert-error'));\t\n\t\t\t\t$this->redirect('/hrattwaive/');\t\n\t\t\t}\n\t\t}else{\n\t\t\t$this->Session->setFlash('<button type=\"button\" class=\"close\" data-dismiss=\"alert-error\">&times;</button>Invalid Entry', 'default', array('class' => 'alert alert-error'));\t\t\n\t\t\t$this->redirect('/hrattwaive/');\t\n\t\t}\n\t\t\n\t\t\n\t}", "public function index()\n {\n $user = Auth::user();\n $data['user'] = $user;\n $settings = $user->settings;\n Carbon::setWeekStartsAt(0);\n Carbon::setWeekEndsAt(6);\n\n // TODO: get this from config\n $start_time = '06:30';\n $end_time = '19:30';\n\n $today = new Carbon($this->choose_start);\n $today2 = new Carbon($this->choose_start);\n $today3 = new Carbon($this->choose_start);\n // $today4 = new Carbon($this->choose_start);\n // $today5 = new Carbon($this->choose_start);\n $today6 = new Carbon($this->choose_start);\n\n $data['start'] = $today6->startOfWeek();\n\n $days = array();\n $days_to_add = 7 * ($settings->weeks - 2);\n $end = $today2->startOfWeek()->setDate(\n $today->year,\n $today->month,\n $today->format('d') > 15 ?\n $today3->endOfMonth()->format('d') :\n 15\n )->addDays($days_to_add);\n\n $data['end_of_period'] = $end->copy()->endOfWeek()->format('Y-m-d');\n $data['end'] = $end;\n\n $added_range = false;\n $next_range = array();\n if ((new Carbon)->day >= 13 && (new Carbon)->day <= 15) {\n $added_range = true;\n $next_range['start'] = (new Carbon)->setDate((new Carbon)->year, (new Carbon)->month, 16)->startOfWeek();\n $next_range['start_of_period'] = (new Carbon)->setDate((new Carbon)->year, (new Carbon)->month, 16);\n $next_range['end'] = (new Carbon)->startOfWeek()->setDate((new Carbon)->year, (new Carbon)->month, $today3->endOfMonth()->format('d'));\n $next_range['end_of_period'] = (new Carbon)->startOfWeek()->setDate((new Carbon)->year, (new Carbon)->month, $today3->endOfMonth()->format('d'))->endOfWeek()->format('Y-m-d');\n } elseif ((new Carbon)->day >= 28 && (new Carbon)->day <= 31) {\n $added_range = true;\n $year = (new Carbon)->year + ((new Carbon)->month == 12?1:0); // Set year as next year if this month is December (12)\n $next_range['start'] = (new Carbon)->setDate($year, (new Carbon)->addMonthNoOverflow(1)->format(\"m\"), 1)->startOfWeek();\n $next_range['start_of_period'] = (new Carbon)->setDate($year, (new Carbon)->addMonthNoOverflow(1)->format(\"m\"), 1);\n $next_range['end'] = (new Carbon)->startOfWeek()->setDate($year, (new Carbon)->addMonthNoOverflow(1)->format(\"m\"), 15);\n $next_range['end_of_period'] = (new Carbon)->startOfWeek()->setDate($year, (new Carbon)->addMonthNoOverflow(1)->format(\"m\"), 15)->endOfWeek()->format('Y-m-d');\n }\n\n $data['days_a'] = $this->get_days($data);\n $data['days_b'] = $this->get_days($next_range);\n\n $data['days'] = [__('Su'), __('Mo'), __('Tu'), __('We'), __('Th'), __('Fr'), __('Sa')];\n $time_line = [];\n $time = new Carbon($start_time);\n while ($time->format('H:i') <= $end_time) {\n $time_line[] = $time->format('H:i');\n $time->addMinutes(60);\n }\n $data['time_line'] = $time_line;\n\n $user = auth()->user();\n if (isset($user) && isset($user->settings))\n if ($user->settings->is_admin)\n return view('admin.home');\n else\n return view('home', $data);\n }", "public function timesheetAction()\r\n {\r\n $project = $this->projectService->getProject($this->_getParam('projectid'));\r\n $client = $this->clientService->getClient($this->_getParam('clientid'));\r\n \r\n if (!$project && !$client) {\r\n return;\r\n }\r\n \r\n if ($project) {\r\n $start = date('Y-m-d', strtotime($project->started) - 86400);\r\n $this->view->tasks = $this->projectService->getSummaryTimesheet(null, null, $project->id, null, null, $start, null);\r\n } else {\r\n $start = date('Y-m-d', strtotime($client->created));\r\n $this->view->tasks = $this->projectService->getSummaryTimesheet(null, null, null, $client->id, null, $start, null);\r\n }\r\n\r\n $this->renderRawView('timesheet/ajax-timesheet-summary.php');\r\n }", "public function mytimesheet($start = null, $end = null)\n\t{\n\n\t\t$me = (new CommonController)->get_current_user();\n\t\t// $auth = Auth::user();\n\t\t//\n\t\t// $me = DB::table('users')\n\t\t// ->leftJoin( DB::raw('(select Max(Id) as maxid,TargetId from files where Type=\"User\" Group By TargetId) as max'), 'max.TargetId', '=', 'users.Id')\n\t\t// ->leftJoin('files', 'files.Id', '=', DB::raw('max.`maxid` and files.`Type`=\"User\"'))\n\t\t// // ->leftJoin('accesscontrols', 'accesscontrols.UserId', '=', 'users.Id')\n\t\t// ->where('users.Id', '=',$auth -> Id)\n\t\t// ->first();\n\n\t\t// $showleave = DB::table('leaves')\n\t\t// ->leftJoin('leavestatuses', 'leaves.Id', '=', 'leavestatuses.LeaveId')\n\t\t// ->leftJoin('users as applicant', 'leaves.UserId', '=', 'applicant.Id')\n\t\t// ->leftJoin('accesscontrols', 'accesscontrols.UserId', '=', 'applicant.Id')\n\t\t// ->leftJoin('users as approver', 'leavestatuses.UserId', '=', 'approver.Id')\n\t\t// ->select('leaves.Id','applicant.Name','leaves.Leave_Type','leaves.Leave_Term','leaves.Start_Date','leaves.End_Date','leaves.Reason','leaves.created_at as Application_Date','approver.Name as Approver','leavestatuses.Leave_Status as Status','leavestatuses.updated_at as Review_Date','leavestatuses.Comment')\n\t\t// ->where('accesscontrols.Show_Leave_To_Public', '=', 1)\n\t\t// ->orderBy('leaves.Id','desc')\n\t\t// ->get();\n\t\t$d=date('d');\n\n\t\tif ($start==null)\n\t\t{\n\n\t\t\tif($d>=21)\n\t\t\t{\n\n\t\t\t\t$start=date('d-M-Y', strtotime('first day of this month'));\n\t\t\t\t$start = date('d-M-Y', strtotime($start . \" +20 days\"));\n\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\t$start=date('d-M-Y', strtotime('first day of last month'));\n\t\t\t\t$start = date('d-M-Y', strtotime($start . \" +20 days\"));\n\n\t\t\t}\n\t\t}\n\n\t\tif ($end==null)\n\t\t{\n\t\t\tif($d>=21)\n\t\t\t{\n\n\t\t\t\t$end=date('d-M-Y', strtotime('first day of next month'));\n\t\t\t\t$end = date('d-M-Y', strtotime($end . \" +19 days\"));\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\t$end=date('d-M-Y', strtotime('first day of this month'));\n\t\t\t\t$end = date('d-M-Y', strtotime($end . \" +19 days\"));\n\n\t\t\t}\n\n\t\t}\n\n\t\t$mytimesheet = DB::table('timesheets')\n\t\t->select('timesheets.Id','timesheets.UserId','timesheets.Latitude_In','timesheets.Longitude_In','timesheets.Latitude_Out','timesheets.Longitude_Out','timesheets.Date',DB::raw('\"\" as Day'),'holidays.Holiday','timesheets.Site_Name','timesheets.Check_In_Type','leaves.Leave_Type','leavestatuses.Leave_Status',\n\t\t'timesheets.Time_In','timesheets.Time_Out','timesheets.Leader_Member','timesheets.Next_Person','timesheets.State','timesheets.Work_Description','timesheets.Remarks','approver.Name as Approver','timesheetstatuses.Status','leaves.Leave_Type','timesheetstatuses.Comment','timesheetstatuses.updated_at as Updated_At','files.Web_Path')\n\t\t->leftJoin( DB::raw('(select Max(Id) as maxid,TargetId from files where Type=\"Timesheet\" Group By TargetId) as maxfile'), 'maxfile.TargetId', '=', 'timesheets.Id')\n\t\t->leftJoin('files', 'files.Id', '=', DB::raw('maxfile.`maxid` and files.`Type`=\"Timesheet\"'))\n\t\t->leftJoin( DB::raw('(select Max(Id) as maxid,TimesheetId from timesheetstatuses Group By TimesheetId) as max'), 'max.TimesheetId', '=', 'timesheets.Id')\n\t\t->leftJoin('timesheetstatuses', 'timesheetstatuses.Id', '=', DB::raw('max.`maxid`'))\n\t\t->leftJoin('users as approver', 'timesheetstatuses.UserId', '=', 'approver.Id')\n\t\t// ->leftJoin('leaves','leaves.UserId','=',DB::raw('timesheets.Id AND str_to_date(timesheets.Date,\"%d-%M-%Y\") Between str_to_date(leaves.Start_Date,\"%d-%M-%Y\") and str_to_date(leaves.End_Date,\"%d-%M-%Y\")'))\n\t\t->leftJoin('leaves','leaves.UserId','=',DB::raw($me->UserId.' AND str_to_date(timesheets.Date,\"%d-%M-%Y\") Between str_to_date(leaves.Start_Date,\"%d-%M-%Y\") and str_to_date(leaves.End_Date,\"%d-%M-%Y\")'))\n\t\t->leftJoin( DB::raw('(select Max(Id) as maxid,LeaveId from leavestatuses Group By LeaveId) as maxleave'), 'maxleave.LeaveId', '=', 'leaves.Id')\n\t\t->leftJoin('leavestatuses', 'leavestatuses.Id', '=', DB::raw('maxleave.`maxid`'))\n\t\t->leftJoin('holidays',DB::raw('1'),'=',DB::raw('1 AND str_to_date(timesheets.Date,\"%d-%M-%Y\") Between str_to_date(holidays.Start_Date,\"%d-%M-%Y\") and str_to_date(holidays.End_Date,\"%d-%M-%Y\")'))\n\t\t->where('timesheets.UserId', '=', $me->UserId)\n\t\t->where(DB::raw('str_to_date(timesheets.Date,\"%d-%M-%Y\")'), '>=', DB::raw('str_to_date(\"'.$start.'\",\"%d-%M-%Y\")'))\n\t\t->where(DB::raw('str_to_date(timesheets.Date,\"%d-%M-%Y\")'), '<=', DB::raw('str_to_date(\"'.$end.'\",\"%d-%M-%Y\")'))\n\t\t->orderBy('timesheets.Id','desc')\n\t\t->get();\n\n\t\t$user = DB::table('users')->select('users.Id','StaffId','Name','Password','User_Type','Company_Email','Personal_Email','Contact_No_1','Contact_No_2','Nationality','Permanent_Address','Current_Address','Home_Base','DOB','NRIC','Passport_No','Gender','Marital_Status','Position','Emergency_Contact_Person',\n\t\t'Emergency_Contact_No','Emergency_Contact_Relationship','Emergency_Contact_Address','files.Web_Path')\n\t\t// ->leftJoin('files', 'files.TargetId', '=', DB::raw('users.`Id` and files.`Type`=\"User\"'))\n\t\t->leftJoin( DB::raw('(select Max(Id) as maxid,TargetId from files where Type=\"User\" Group By Type,TargetId) as max'), 'max.TargetId', '=', 'users.Id')\n\t\t->leftJoin('files', 'files.Id', '=', DB::raw('max.`maxid` and files.`Type`=\"User\"'))\n\t\t->where('users.Id', '=', $me->UserId)\n\t\t->first();\n\n\t\t$arrDate = array();\n\t\t$arrDate2 = array();\n\t\t$arrInsert = array();\n\n\t\tforeach ($mytimesheet as $timesheet) {\n\t\t\t# code...\n\t\t\tarray_push($arrDate,$timesheet->Date);\n\t\t}\n\n\t\t$startTime = strtotime($start);\n\t\t$endTime = strtotime($end);\n\n\t\t// Loop between timestamps, 1 day at a time\n\t\tdo {\n\n\t\t\t if (!in_array(date('d-M-Y', $startTime),$arrDate))\n\t\t\t {\n\t\t\t\t array_push($arrDate2,date('d-M-Y', $startTime));\n\t\t\t }\n\n\t\t\t $startTime = strtotime('+1 day',$startTime);\n\n\t\t} while ($startTime <= $endTime);\n\n\t\tforeach ($arrDate2 as $date) {\n\t\t\t# code...\n\t\t\tarray_push($arrInsert,array('UserId'=>$me->UserId, 'Date'=> $date, 'updated_at'=>date('Y-m-d H:i:s')));\n\n\t\t}\n\n\t\tDB::table('timesheets')->insert($arrInsert);\n\n\t\t$options= DB::table('options')\n\t\t->whereIn('Table', [\"users\",\"timesheets\"])\n\t\t->orderBy('Table','asc')\n\t\t->orderBy('Option','asc')\n\t\t->get();\n\n // $mytimesheet = DB::table('timesheets')\n // ->leftJoin('users as submitter', 'timesheets.UserId', '=', 'submitter.Id')\n // ->select('timesheets.Id','submitter.Name','timesheets.Timesheet_Name','timesheets.Date','timesheets.Remarks')\n // ->where('timesheets.UserId', '=', $me->UserId)\n\t\t\t// ->orderBy('timesheets.Id','desc')\n // ->get();\n\n\t\t\t// $hierarchy = DB::table('users')\n\t\t\t// ->select('L2.Id as L2Id','L2.Name as L2Name','L2.Timesheet_1st_Approval as L21st','L2.Timesheet_2nd_Approval as L22nd',\n\t\t\t// 'L3.Id as L3Id','L3.Name as L3Name','L3.Timesheet_1st_Approval as L31st','L3.Timesheet_2nd_Approval as L32nd')\n\t\t\t// ->leftJoin(DB::raw(\"(select users.Id,users.Name,users.SuperiorId,accesscontrols.Timesheet_1st_Approval,accesscontrols.Timesheet_2nd_Approval,accesscontrols.Timesheet_Final_Approval from users left join accesscontrols on users.Id=accesscontrols.UserId) as L2\"),'L2.Id','=','users.SuperiorId')\n\t\t\t// ->leftJoin(DB::raw(\"(select users.Id,users.Name,users.SuperiorId,accesscontrols.Timesheet_1st_Approval,accesscontrols.Timesheet_2nd_Approval,accesscontrols.Timesheet_Final_Approval from users left join accesscontrols on users.Id=accesscontrols.UserId) as L3\"),'L3.Id','=','L2.SuperiorId')\n\t\t\t// ->where('users.Id', '=', $me->UserId)\n\t\t\t// ->get();\n\t\t\t//\n\t\t\t// $final = DB::table('users')\n\t\t\t// ->select('users.Id','users.Name')\n\t\t\t// ->leftJoin('accesscontrols', 'accesscontrols.UserId', '=', 'users.Id')\n\t\t\t// ->where('Timesheet_Final_Approval', '=', 1)\n\t\t\t// ->get();\n\n\t\t\treturn view('mytimesheet', ['me' => $me, 'user' =>$user, 'mytimesheet' => $mytimesheet,'start' =>$start,'end'=>$end,'options' =>$options]);\n\n\t\t\t//return view('mytimesheet', ['me' => $me,'showleave' =>$showleave, 'mytimesheet' => $mytimesheet, 'hierarchy' => $hierarchy, 'final' => $final]);\n\n\t}", "function approvedTimesheet($type=1, $pg=1, $limit=25) \t{\n\t\t$this->getMenu();\n\t\t$form = array();\n\t\tif($type==1) {\n\t\t\t$this->session->unset_userdata('client_no');\n\t\t\t$this->session->unset_userdata('client_name');\n\t\t\t$this->session->unset_userdata('project_no');\n\t\t}\n\t\telseif($type==2) {\n\t\t\t$this->session->unset_userdata('client_no');\n\t\t\t$this->session->unset_userdata('client_name');\n\t\t\t$this->session->unset_userdata('project_no');\n\t\t\t\n\t\t\tif($this->input->post('client_no')) \t\t$form['client_no'] = $this->input->post('client_no');\n\t\t\tif($this->input->post('client_name'))\t\t$form['client_name'] = $this->input->post('client_name');\n\t\t\tif($this->input->post('project_no'))\t\t$form['project_no'] = $this->input->post('project_no');\n\t\t\t$this->session->set_userdata($form);\n\t\t}\n\t\t\n\t\tif($this->session->userdata('client_no')) \t$form['client_no'] = $this->session->userdata('client_no');\n\t\tif($this->session->userdata('client_name')) $form['client_name'] = $this->session->userdata('client_name');\n\t\tif($this->session->userdata('project_no')) \t$form['project_no']\t = $this->session->userdata('project_no');\n\t\t\n\t\tif($limit) {\n\t\t\t$this->session->set_userdata('rpp', $limit);\n\t\t\t$this->rpp = $limit;\n\t\t}\n\t\t$limit\t\t= $limit ? $limit : $this->rpp;\n\t\t$this->data['done'] \t\t= $this->timesheetModel->getTimesheetDone();\n\t\n\t\t$this->load->view('timesheet_approvedTimesheet',$this->data); \n\t}", "public function editassigntimeAction()\n {\n $prevurl = getenv(\"HTTP_REFERER\");\n $user_params=$this->_request->getParams();\n $ftvrequest_obj = new Ep_Ftv_FtvRequests();\n $ftvpausetime_obj = new Ep_Ftv_FtvPauseTime();\n $requestId = $user_params['requestId'];\n $requestsdetail = $ftvrequest_obj->getRequestsDetails($requestId);\n\n ($user_params['editftvspentdays'] == '') ? $days=0 : $days=$user_params['editftvspentdays'];\n ($user_params['editftvspenthours'] == '') ? $hours=0 : $hours=$user_params['editftvspenthours'];\n ($user_params['editftvspentminutes'] == '') ? $minutes=0 : $minutes=$user_params['editftvspentminutes'];\n ($user_params['editftvspentseconds'] == '') ? $seconds=0 : $seconds=$user_params['editftvspentseconds'];\n\n /*if($user_params['addasigntime'] == 'addasigntime') ///when time changes in mail content in publish ao popup//\n {\n /*$editdate = date('Y-m-d', strtotime($user_params['editftvassigndate']));\n $edittime = date('H:i:s', strtotime($user_params['editftvassigntime']));\n $editdatetime =$editdate.\" \".$edittime;\n $data = array(\"assigned_at\"=>$editdatetime);////////updating\n $query = \"identifier= '\".$user_params['requestId'].\"'\";\n $ftvrequest_obj->updateFtvRequests($data,$query);\n $parameters['ftvType'] = \"chaine\";\n // $newseconds = $this->allToSeconds($user_params['editftvspentdays'],$user_params['editftvspenthours'],$user_params['editftvspentminutes'],$user_params['editftvspentseconds']);\n echo \"<br>\".$format = \"P\".$days.\"DT\".$hours.\"H\".$minutes.\"M\".$seconds.\"S\";\n echo \"<br>\".$requestsdetail[0]['assigned_at'];\n $time=new DateTime($requestsdetail[0]['assigned_at']);\n $time->sub(new DateInterval($format));\n echo \"<br>\".$assigntime = $time->format('Y-m-d H:i:s');\n $data = array(\"assigned_at\"=>$assigntime);////////updating\n echo $query = \"identifier= '\".$requestId.\"'\";\n $ftvrequest_obj->updateFtvRequests($data,$query);\n $this->_redirect($prevurl);\n }\n elseif($user_params['subasigntime'] == 'subasigntime')\n {\n $format = \"P\".$days.\"DT\".$hours.\"H\".$minutes.\"M\".$seconds.\"S\";\n $time=new DateTime($requestsdetail[0]['assigned_at']);\n $time->add(new DateInterval($format));\n $assigntime = $time->format('Y-m-d H:i:s');\n $data = array(\"assigned_at\"=>$assigntime);////////updating\n $query = \"identifier= '\".$requestId.\"'\";\n $ftvrequest_obj->updateFtvRequests($data,$query);\n $this->_redirect($prevurl);\n }*/\n $inpause = $ftvpausetime_obj->inPause($requestId);\n $requestsdetail[0]['inpause'] = $inpause;\n $ptimes = $ftvpausetime_obj->getPauseDuration($requestId);\n $assigntime = $requestsdetail[0]['assigned_at'];\n //echo $requestId; echo $requestsdetail[0]['assigned_at'];\n\n if(($requestsdetail[0]['status'] == 'done' || $inpause == 'yes') && $requestsdetail[0]['assigned_at'] != null)\n {\n if($requestsdetail[0]['status'] == \"closed\")\n $time1 = ($requestsdetail[0]['cancelled_at']); /// created time\n elseif ($requestsdetail[0]['status'] == \"done\")\n $time1 = ($requestsdetail[0]['closed_at']); /// created time\n else{\n if($inpause == 'yes') {\n $time1 = ($requestsdetail[0]['pause_at']);\n }else {\n $time1 = (date('Y-m-d H:i:s'));///curent time\n }\n }\n $pausedrequests = $ftvpausetime_obj->pausedRequest($requestId);\n if($pausedrequests == 'yes')\n {\n $time2 = $this->subDiffFromDate($requestId, $requestsdetail[0]['assigned_at']);\n }else{\n $time2 = $requestsdetail[0]['assigned_at'];\n }\n $difference = $this->timeDifference($time1, $time2);\n\n }elseif($requestsdetail[0]['assigned_at'] != null){\n $time1 = (date('Y-m-d H:i:s'));///curent time\n\n $pausedrequests = $ftvpausetime_obj->pausedRequest($requestId);\n if($pausedrequests == 'yes')\n {\n $updatedassigntime = $this->subDiffFromDate($requestId, $requestsdetail[0]['assigned_at']);\n }else{\n $updatedassigntime = $requestsdetail[0]['assigned_at'];\n }\n $time2 = $updatedassigntime;\n $difference = $this->timeDifference($time1, $time2);\n }\n ////when user trying to edit the time spent///\n if($user_params['editftvassignsubmit'] == 'editftvassignsubmit') ///when button submitted in popup//\n {\n $newseconds = $this->allToSeconds($days,$hours,$minutes,$seconds);\n $previousseconds = $this->allToSeconds($difference['days'],$difference['hours'],$difference['minutes'],$difference['seconds']);\n if($newseconds > $previousseconds){\n $diffseconds = $newseconds-$previousseconds;\n $difftime = $this->secondsTodayshours($diffseconds);\n $format = \"P\".$difftime['days'].\"DT\".$difftime['hours'].\"H\".$difftime['minutes'].\"M\".$difftime['seconds'].\"S\";\n $requestsdetail[0]['assigned_at'];\n $time=new DateTime($requestsdetail[0]['assigned_at']);\n $time->sub(new DateInterval($format));\n $assigntime = $time->format('Y-m-d H:i:s');\n $data = array(\"assigned_at\"=>$assigntime);////////updating\n $query = \"identifier= '\".$requestId.\"'\";\n $ftvrequest_obj->updateFtvRequests($data,$query);\n $this->_redirect($prevurl);\n }elseif($newseconds < $previousseconds){\n $diffseconds = $previousseconds-$newseconds;\n $difftime = $this->secondsTodayshours($diffseconds);\n $format = \"P\".$difftime['days'].\"DT\".$difftime['hours'].\"H\".$difftime['minutes'].\"M\".$difftime['seconds'].\"S\";\n $time=new DateTime($requestsdetail[0]['assigned_at']);\n $time->add(new DateInterval($format));\n $assigntime = $time->format('Y-m-d H:i:s');\n $data = array(\"assigned_at\"=>$assigntime);////////updating\n $query = \"identifier= '\".$requestId.\"'\";\n $ftvrequest_obj->updateFtvRequests($data,$query);\n $this->_redirect($prevurl);\n }else\n $this->_redirect($prevurl);\n }\n /*$this->_view->reqasgndate = date(\"d-m-Y\", strtotime($reqdetails[0]['assigned_at']));\n $this->_view->reqasgntime = date(\"g:i A\", strtotime($reqdetails[0]['assigned_at']));*/\n $this->_view->days = $difference['days'];\n $this->_view->hours = $difference['hours'];\n $this->_view->minutes = $difference['minutes'];\n $this->_view->seconds = $difference['seconds'];\n $this->_view->requestId = $user_params['requestId'];\n $this->_view->requestobject = $requestsdetail[0]['request_object'];\n $this->_view->current_duration= $difference['days'].\"j \".$difference['hours'].\"h \".$difference['minutes'].\"m \".$difference['seconds'].\"s \";\n\n $this->_view->extendparttime = 'no';\n $this->_view->extendcrtparttime = 'no';\n $this->_view->editftvassigntime = 'yes';\n $this->_view->nores = 'true';\n $this->_view->render(\"ongoing_extendtime_writer_popup\");\n\n }", "public function appointments()\n\t{\n\t\tif (!is_cli())\n\t\t{\n\t\t\techo \"This script can only be accessed via the command line\" . PHP_EOL;\n\t\t\treturn;\n\t\t}\n\n\t\t$participations = $this->participationModel->get_confirmed_participations();\n\t\tforeach ($participations as $participation)\n\t\t{\n\t\t\t$appointment = strtotime($participation->appointment); \n\t\t\tif ($appointment > strtotime('tomorrow') && $appointment <= strtotime('tomorrow + 1 day')) \n\t\t\t{\t\t\t\t\t\n\t\t\t\treset_language(L::DUTCH);\n\t\t\t\t\n\t\t\t\t$participant = $this->participationModel->get_participant_by_participation($participation->id);\n\t\t\t\t$experiment = $this->participationModel->get_experiment_by_participation($participation->id);\n\t\t\t\t$message = email_replace('mail/reminder', $participant, $participation, $experiment);\n\t\t\n\t\t\t\t$this->email->clear();\n\t\t\t\t$this->email->from(FROM_EMAIL, FROM_EMAIL_NAME);\n\t\t\t\t$this->email->to(in_development() ? TO_EMAIL_DEV_MODE : $participant->email);\n\t\t\t\t$this->email->subject('Babylab Utrecht: Herinnering deelname');\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t\t\t// DEBUG: $this->email->print_debugger();\n\t\t\t}\n\t\t}\n\t}", "protected function process_overview()\n {\n global $index_includes;\n\n $l_rules = [\n 'C__MAINTENANCE__OVERVIEW__FILTER__DATE_FROM' => [\n 'p_strPopupType' => 'calendar',\n 'p_strClass' => 'input-mini',\n 'p_bInfoIconSpacer' => 0,\n 'p_strValue' => date('Y-m-d'),\n ],\n 'C__MAINTENANCE__OVERVIEW__FILTER__DATE_TO' => [\n 'p_strPopupType' => 'calendar',\n 'p_strClass' => 'input-mini',\n 'p_bInfoIconSpacer' => 0,\n ]\n ];\n\n $l_day_of_week = date('N') - 1;\n $l_this_week_time = time() - ($l_day_of_week * isys_convert::DAY);\n\n $l_this_week = mktime(0, 0, 0, date('m', $l_this_week_time), date('d', $l_this_week_time), date('Y', $l_this_week_time));\n\n $this->m_tpl->activate_editmode()\n ->assign(\n 'ajax_url',\n isys_helper_link::create_url(\n [\n C__GET__AJAX => 1,\n C__GET__AJAX_CALL => 'maintenance'\n ]\n )\n )\n ->assign('this_week', $l_this_week)\n ->assign('this_month', mktime(0, 0, 0, date('m'), 1, date('Y')))\n ->assign('next_week', $l_this_week + isys_convert::WEEK)\n ->assign('next_month', mktime(0, 0, 0, (date('m') + 1), 1, date('Y')))\n ->assign('next_next_month', mktime(0, 0, 0, (date('m') + 2), 1, date('Y')))\n ->assign(\n 'planning_url',\n isys_helper_link::create_url(\n [\n C__GET__MODULE_ID => C__MODULE__MAINTENANCE,\n C__GET__SETTINGS_PAGE => C__MAINTENANCE__PLANNING\n ]\n )\n )\n ->smarty_tom_add_rules('tom.content.bottom.content', $l_rules);\n\n $index_includes['contentbottomcontent'] = __DIR__ . DS . 'templates' . DS . 'overview.tpl';\n }", "public function index(){\n\t \t@$this->loadModel(\"Dashboard\");\n global $session;\n $dashData = array();\n $dashData = $this->model->getDashboardStat();\n $this->view->oticketcount = $dashData['otcount'];\n $this->view->aticketcount = $dashData['atcount'];\n $this->view->oschedule = $dashData['oschedule'];\n $this->view->oworksheet = $dashData['oworksheet'];\n $this->view->clients = $dashData['clients'];\n $this->view->pendings = $dashData['openPend'];\n $this->view->cproducts = $dashData['cproducts'];\n $lastmonth = (int)date(\"n\")-1;\n $curmonth = date(\"n\");\n\n $this->view->monthreport = $this->model->getMonthlyReportFinance(\" Month(datecreated) ='\".$curmonth.\"' AND Year(datecreated)='\".date(\"Y\").\"'\");\n $this->view->lastmonthreport = $this->model->getLastMonthlyReportFinance(\" Month(datecreated) ='\".$lastmonth.\"' AND Year(datecreated)='\".date(\"Y\").\"'\");\n $this->view->thisquarter = $this->model->getThisQuaterReportFinance(\" Quarter(datecreated) ='\".self::date_quarter().\"' AND Year(datecreated)='\".date(\"Y\").\"'\");\n global $session;\n \n if($session->empright == \"Super Admin\"){\n\t\t $this->view->render(\"dashboard/index\");\n\t\t }elseif($session->empright == \"Customer Support Services\" || $session->empright == \"Customer Support Service\"){\n\t\t $this->view->render(\"support/index\");\n\t\t \n\t\t }elseif($session->empright == \"Customer Support Engineer\" || $session->empright == \"Customer Service Engineer\"){\n @$this->loadModel(\"Itdepartment\");\n global $session;\n $datan =\"\";\n $uri = new Url(\"\");\n //$empworkdata = $this->model->getWorkSheetEmployee($id,\"\");\n \n $ptasks = Worksheet::find_by_sql(\"SELECT * FROM work_sheet_form WHERE cse_emp_id =\".$_SESSION['emp_ident'] );\n // print_r($ptasks);\n //$empworkdata['worksheet'];\n $x=1;\n $datan .=\"<table width='100%'>\n <thead><tr>\n \t<th>S/N</th><th>Prod ID</th><th>Status</th><th>Emp ID</th><th>Issue</th><th>Date Generated </th><th></th><th></th>\n </tr>\n </thead>\n <tbody>\";\n if($ptasks){\n \n foreach($ptasks as $task){\n $datan .= \"<tr><td>$x</td><td>$task->prod_id</td><td>$task->status </td><td>$task->cse_emp_id</td><td>$task->problem</td><td>$task->sheet_date</td><td><a href='\".$uri->link(\"itdepartment/worksheetdetail/\".$task->id.\"\").\"'>View Detail</a></td><td></td></tr>\";\n $x++;\n }\n }else{\n $datan .=\"<tr><td colspan='8'></td></tr>\";\n } \n $datan .=\"</tbody></table>\";\n \n $mysched =\"<div id='transalert'>\"; $mysched .=(isset($_SESSION['message']) && !empty($_SESSION['message'])) ? $_SESSION['message'] : \"\"; $mysched .=\"</div>\";\n \n $psched = Schedule::find_by_sql(\"SELECT * FROM schedule WHERE status !='Closed' AND emp_id =\".$_SESSION['emp_ident'].\" ORDER BY id DESC\" );\n //print_r($psched);\n //$empworkdata['worksheet'];\n $x=1;\n $mysched .=\"<table width='100%'>\n <thead><tr>\n \t<th>S/N</th><th>Machine</th><th>Issue</th><th>Location</th><th>Task Type</th><th>Task Date </th><th></th><th></th><th></th>\n </tr>\n </thead>\n <tbody>\";\n if($psched){\n \n foreach($psched as $task){\n $mysched .= \"<tr><td>$x</td><td>$task->prod_name</td><td>$task->issue </td>\"; \n $machine = Cproduct::find_by_id($task->prod_id);\n \n $mysched .= \"<td>$machine->install_address $machine->install_city</td><td>$task->maint_type</td><td>$task->s_date</td><td>\";\n \n if($task->status == \"Open\"){\n $mysched .=\"<a scheddata='{$task->id}' class='acceptTask' href='#'>Accept Task</a>\";\n }\n if($task->status == \"In Progress\"){\n $mysched .=\"<a href='\".$uri->link(\"itdepartment/worksheetupdateEmp/\".$task->id.\"\").\"'>Get Work Sheet</a>\";\n }\n \n $mysched .=\"\n \n <div id='myModal{$task->id}' class='reveal-modal'>\n <h2>Accept Task </h2>\n <p class='lead'>Click on the button below to accept task! </p>\n <form action='?url=itdepartment/doAcceptTask' method='post'>\n <input type='hidden' value='{$task->id}' name='mtaskid' id='mtaskid' />\n <p><a href='#' data-reveal-id='secondModal' class='secondary button acceptTast' >Accept</a></p>\n </form>\n <a class='close-reveal-modal'>&#215;</a>\n</div>\n\n\n \n \n </td><td></td><td></td></tr>\";\n $x++;\n }\n }else{\n $mysched .=\"<tr><td colspan='8'>There is no task currently</td></tr>\";\n } \n $mysched .=\"</tbody></table>\";\n \n $this->view->oldtask = $datan;\n $this->view->schedule = $mysched;\n $this->view->mee = $this->model->getEmployee($_SESSION['emp_ident']);\n $this->view->render(\"itdepartment/staffaccount\");\n\t\t }else{\n\t\t $this->view->render(\"login/index\",true);\n\t\t }\n\t\t\n\t}", "function recurringdowntime_show_downtime()\n{\n global $request;\n\n do_page_start(array(\"page_title\" => _(\"Recurring Downtime\")), true);\n\n if (isset($request[\"host\"])) {\n $host_tbl_header = _(\"Recurring Downtime for Host: \") . $request[\"host\"];\n $service_tbl_header = _(\"Recurring Downtime for Host: \") . $request[\"host\"];\n if (is_authorized_for_host(0, $request[\"host\"])) {\n $host_data = recurringdowntime_get_host_cfg($request[\"host\"]);\n $service_data = recurringdowntime_get_service_cfg($request[\"host\"]);\n }\n } elseif (isset($request[\"hostgroup\"])) {\n $hostgroup_tbl_header = _(\"Recurring Downtime for Hostgroup: \") . $request[\"hostgroup\"];\n if (is_authorized_for_hostgroup(0, $request[\"hostgroup\"])) {\n $hostgroup_data = recurringdowntime_get_hostgroup_cfg($request[\"hostgroup\"]);\n }\n } elseif (isset($request[\"servicegroup\"])) {\n $servicegroup_tbl_header = _(\"Recurring Downtime for Servicegroup: \") . $request[\"servicegroup\"];\n if (is_authorized_for_servicegroup(0, $request[\"servicegroup\"])) {\n $servicegroup_data = recurringdowntime_get_servicegroup_cfg($request[\"servicegroup\"]);\n }\n }\n\n if (!isset($request[\"host\"]) && !isset($request[\"hostgroup\"]) && !isset($request[\"servicegroup\"])) {\n /*\n $host_tbl_header = \"Recurring Downtime for All Hosts\";\n $hostgroup_tbl_header = \"Recurring Downtime for All Hostgroups\";\n $servicegroup_tbl_header = \"Recurring Downtime for All Servicegroups\";\n */\n $host_tbl_header = _(\"Host Schedules\");\n $service_tbl_header = _(\"Service Schedules\");\n $hostgroup_tbl_header = _(\"Hostgroup Schedules\");\n $servicegroup_tbl_header = _(\"Servicegroup Schedules\");\n $host_data = recurringdowntime_get_host_cfg($host = false);\n $service_data = recurringdowntime_get_service_cfg($host = false);\n $hostgroup_data = recurringdowntime_get_hostgroup_cfg($hostgroup = false);\n $servicegroup_data = recurringdowntime_get_servicegroup_cfg($servicegroup = false);\n $showall = true;\n }\n\n ?>\n <h1><?php echo _(\"Recurring Downtime\"); ?></h1>\n\n <?php echo _(\"Scheduled downtime definitions that are designed to repeat (recur) at set intervals are shown below. The next schedule for each host/service are added to the monitoring engine when the cron runs at the top of the hour.\"); ?>\n\n <?php\n if (!isset($request[\"host\"]) && !isset($request[\"hostgroup\"]) && !isset($request[\"servicegroup\"])) {\n ?>\n <p>\n <?php } ?>\n\n <script type=\"text/javascript\">\n function do_delete_sid(sid) {\n input = confirm('<?php echo _(\"Are you sure you wish to delete this downtime schedule?\"); ?>');\n if (input == true) {\n window.location.href = 'recurringdowntime.php?mode=delete&sid=' + sid + '&nsp=<?php echo get_nagios_session_protector_id();?>';\n }\n }\n </script>\n\n <?php\n if ($showall) {\n ?>\n <script type=\"text/javascript\">\n $(document).ready(function () {\n $(\"#tabs\").tabs().show();\n });\n </script>\n\n <div id=\"tabs\" class=\"hide\">\n <ul>\n <li><a href=\"#host-tab\"><?php echo _(\"Hosts\"); ?></a></li>\n <li><a href=\"#service-tab\"><?php echo _(\"Services\"); ?></a></li>\n <li><a href=\"#hostgroup-tab\"><?php echo _(\"Hostgroups\"); ?></a></li>\n <li><a href=\"#servicegroup-tab\"><?php echo _(\"Servicegroups\"); ?></a></li>\n </ul>\n <?php\n }\n ?>\n\n <?php if (!empty($_GET[\"host\"]) || $showall) {\n\n $host = grab_request_var('host', '');\n\n // hosts tab\n if ($showall) {\n echo \"<div id='host-tab'>\";\n }\n ?>\n\n <h4 <?php if ($host) { echo 'style=\"margin-top: 20px;\"'; } ?>><?php echo $host_tbl_header; ?></h4>\n\n <?php\n if (!is_readonly_user(0)) {\n if ($host) {\n ?>\n <div style=\"margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=host&host_name=<?php echo $host; ?>&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23host-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add schedule for this host\"); ?></a>\n </div>\n <?php\n } else {\n ?>\n <div style=\"margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=host&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23host-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add Schedule\"); ?></a>\n </div>\n <?php\n }\n }\n ?>\n\n <table class=\"tablesorter table table-condensed table-striped table-bordered\" style=\"width:100%\">\n <thead>\n <tr>\n <th><?php echo _(\"Host\"); ?></th>\n <th><?php echo _(\"Services\"); ?></th>\n <th><?php echo _(\"Comment\"); ?></th>\n <th><?php echo _(\"Start Time\"); ?></th>\n <th><?php echo _(\"Duration\"); ?></th>\n <th><?php echo _(\"Months\"); ?></th>\n <th><?php echo _(\"Weekdays\"); ?></th>\n <th><?php echo _(\"Days in Month\"); ?></th>\n <th><?php echo _(\"Handle Child Hosts\"); ?></th>\n <th class=\"center\" style=\"width: 80px;\"><?php echo _(\"Actions\"); ?></th>\n </tr>\n </thead>\n <tbody>\n <?php\n if ($host_data) {\n $i = 0;\n\n $host_names = array();\n foreach ($host_data as $k => $data) {\n $host_names[$k] = $data['host_name'];\n }\n array_multisort($host_names, SORT_ASC, $host_data);\n\n foreach ($host_data as $sid => $schedule) {\n if (empty($schedule['childoptions'])) {\n $schedule['childoptions'] = 0;\n }\n ?>\n <tr>\n <td><?php echo $schedule[\"host_name\"]; ?></td>\n <td><?php echo (isset($schedule[\"svcalso\"]) && $schedule[\"svcalso\"] == 1) ? _(\"Yes\") : _(\"No\"); ?></td>\n <td><?php echo encode_form_val($schedule[\"comment\"]); ?></td>\n <td><?php echo $schedule[\"time\"]; ?></td>\n <td><?php echo $schedule[\"duration\"]; ?></td>\n <td><?php if ($schedule[\"months_of_year\"]) {\n echo $schedule[\"months_of_year\"];\n } else {\n echo _(\"All\");\n } ?></td>\n <td><?php if ($schedule[\"days_of_week\"]) {\n echo $schedule[\"days_of_week\"];\n } else {\n echo _(\"All\");\n } ?></td>\n <td><?php if ($schedule[\"days_of_month\"]) {\n echo $schedule[\"days_of_month\"];\n } else {\n echo _(\"All\");\n } ?></td>\n <td><?php if ($schedule[\"childoptions\"] == 0) {\n echo _(\"No\");\n } elseif ($schedule[\"childoptions\"] == 1) {\n echo _(\"Yes, triggered\");\n } elseif ($schedule[\"childoptions\"] == 2) {\n echo _(\"Yes, non-triggered\");\n } ?></td>\n <td class=\"center\">\n <?php if (!is_readonly_user(0)) { ?>\n <a href=\"<?php echo 'recurringdowntime.php' . \"?mode=edit&sid=\" . $sid . \"&return=\" . urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23host-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\"><img src=\"<?php echo theme_image('pencil.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Edit schedule'); ?>\" alt=\"<?php echo _('Edit'); ?>\"></a>&nbsp;\n <a onClick=\"javascript:return do_delete_sid('<?php echo $sid; ?>');\" href=\"javascript:void(0);\"><img src=\"<?php echo theme_image('cross.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Delete schedule'); ?>\" alt=\"<?php echo _('Delete'); ?>\"></a>\n <?php } ?>\n </td>\n </tr>\n <?php } // end foreach ?>\n\n <?php } else { ?>\n <tr>\n <td colspan=\"10\">\n <div style=\"padding:4px\">\n <em><?php echo _(\"There are currently no host recurring downtime events defined.\"); ?></em>\n </div>\n </td>\n </tr>\n <?php } // end if host_data ?>\n </table>\n\n <?php if ($showall) echo \"</div>\"; // end host tab?>\n\n<?php } // end if host or showall\n\nif (!empty($_GET[\"service\"]) || $showall) {\n\n $host = grab_request_var('host', '');\n $service = grab_request_var('service', '');\n\n if ($showall) {\n echo \"<div id='service-tab'>\";\n }\n ?>\n\n <h4><?php echo $service_tbl_header; ?></h4>\n\n <?php\n if (!is_readonly_user(0)) {\n if ($host) {\n ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=service&host_name=<?php echo $host; ?>&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23service-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add schedule for this host\"); ?></a>\n </div>\n <?php\n } else {\n ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=service&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23service-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add Schedule\"); ?></a>\n </div>\n <?php\n }\n } // end is_readonly_user\n ?>\n <table class=\"tablesorter table table-condensed table-striped table-bordered\" style=\"width:100%\">\n <thead>\n <tr>\n <th><?php echo _(\"Host\"); ?></th>\n <th><?php echo _(\"Service\"); ?></th>\n <th><?php echo _(\"Comment\"); ?></th>\n <th><?php echo _(\"Start Time\"); ?></th>\n <th><?php echo _(\"Duration\"); ?></th>\n <th><?php echo _(\"Weekdays\"); ?></th>\n <th><?php echo _(\"Days in Month\"); ?></th>\n <th><?php echo _(\"Actions\"); ?></th>\n </tr>\n </thead>\n <tbody>\n <?php\n if ($service_data) {\n $i = 0;\n\n $host_names = array();\n $service_names = array();\n foreach ($service_data as $k => $data) {\n $host_names[$k] = $data['host_name'];\n $service_names[$k] = $data['service_description'];\n }\n\n array_multisort($host_names, SORT_ASC, $service_names, SORT_ASC, $service_data);\n\n foreach ($service_data as $sid => $schedule) {\n ?>\n <tr>\n <td><?php echo $schedule[\"host_name\"]; ?></td>\n <td><?php echo $schedule[\"service_description\"]; ?></td>\n <td><?php echo encode_form_val($schedule[\"comment\"]); ?></td>\n <td><?php echo $schedule[\"time\"]; ?></td>\n <td><?php echo $schedule[\"duration\"]; ?></td>\n <td><?php if ($schedule[\"days_of_week\"]) {\n echo $schedule[\"days_of_week\"];\n } else {\n echo \"All\";\n } ?></td>\n <td><?php if ($schedule[\"days_of_month\"]) {\n echo $schedule[\"days_of_month\"];\n } else {\n echo \"All\";\n } ?></td>\n <td style=\"text-align:center;width:60px\">\n <?php if (!is_readonly_user(0)) { ?>\n <a href=\"<?php echo 'recurringdowntime.php'. \"?mode=edit&sid=\" . $sid . \"&return=\" . urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23service-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\"><img src=\"<?php echo theme_image('pencil.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Edit schedule'); ?>\" alt=\"<?php echo _('Edit'); ?>\"></a>\n <a onClick=\"javascript:return do_delete_sid('<?php echo $sid; ?>');\" href=\"javascript:void(0);\" title=\"<?php echo _('Delete Schedule'); ?>\"><img src=\"<?php echo theme_image('cross.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Delete schedule'); ?>\" alt=\"<?php echo _('Delete'); ?>\"></a>\n <?php }?>\n </td>\n </tr>\n <?php } // end foreach ?>\n\n <?php } else { ?>\n <tr>\n <td colspan=\"9\">\n <div style=\"padding:4px\">\n <em><?php echo _(\"There are currently no host/service recurring downtime events defined.\"); ?></em>\n </div>\n </td>\n </tr>\n <?php } // end if service_data ?>\n </table>\n\n <?php if ($showall) echo \"</div>\"; // end service tab?>\n\n<?php } // end if service or showall\n\nif (!empty($_GET[\"hostgroup\"]) || $showall) {\n\n $hostgroup = grab_request_var('hostgroup', '');\n\n if ($showall) {\n echo \"<div id='hostgroup-tab'>\";\n }\n ?>\n\n <h4><?php echo $hostgroup_tbl_header; ?></h4>\n\n <?php\n if (!is_readonly_user(0)) {\n if ($hostgroup) {\n ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=hostgroup&hostgroup_name=<?php echo $hostgroup; ?>&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23hostgroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add schedule for this hostgroup\"); ?></a>\n </div>\n <?php\n } else {\n ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=hostgroup&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23hostgroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add Schedule\"); ?></a>\n </div>\n <?php\n }\n } // end is_readonly_user\n ?>\n <table class=\"tablesorter table table-condensed table-striped table-bordered\" style=\"width:100%\">\n <thead>\n <tr>\n <th><?php echo _(\"Hostgroup\"); ?></th>\n <th><?php echo _(\"Services\"); ?></th>\n <th><?php echo _(\"Comment\"); ?></th>\n <th><?php echo _(\"Start Time\"); ?></th>\n <th><?php echo _(\"Duration\"); ?></th>\n <th><?php echo _(\"Weekdays\"); ?></th>\n <th><?php echo _(\"Days in Month\"); ?></th>\n <th><?php echo _(\"Actions\"); ?></th>\n </tr>\n </thead>\n <tbody>\n\n <?php\n\n if ($hostgroup_data) {\n $i = 0;\n\n $hostgroup_names = array();\n foreach ($hostgroup_data as $k => $data) {\n $hostgroup_names[$k] = $data['hostgroup_name'];\n }\n\n array_multisort($hostgroup_names, SORT_ASC, $hostgroup_data);\n\n foreach ($hostgroup_data as $sid => $schedule) {\n ?>\n <tr>\n <td><?php echo $schedule[\"hostgroup_name\"]; ?></td>\n <td><?php echo (isset($schedule[\"svcalso\"]) && $schedule[\"svcalso\"] == 1) ? \"Yes\" : \"No\"; ?></td>\n <td><?php echo encode_form_val($schedule[\"comment\"]); ?></td>\n <td><?php echo $schedule[\"time\"]; ?></td>\n <td><?php echo $schedule[\"duration\"]; ?></td>\n <td><?php if ($schedule[\"days_of_week\"]) {\n echo $schedule[\"days_of_week\"];\n } else {\n echo \"All\";\n } ?></td>\n <td><?php if ($schedule[\"days_of_month\"]) {\n echo $schedule[\"days_of_month\"];\n } else {\n echo \"All\";\n } ?></td>\n <td style=\"text-align:center;width:60px\">\n <?php if (!is_readonly_user(0)) { ?>\n <a href=\"<?php echo 'recurringdowntime.php' . \"?mode=edit&sid=\" . $sid . \"&return=\" . urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23hostgroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" title=\"Edit Schedule\"><img src=\"<?php echo theme_image('pencil.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Edit schedule'); ?>\" alt=\"<?php echo _('Edit'); ?>\"></a>\n <a onClick=\"javascript:return do_delete_sid('<?php echo $sid; ?>');\" href=\"javascript:void(0);\" title=\"<?php echo _('Delete Schedule'); ?>\"><img src=\"<?php echo theme_image('cross.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Delete schedule'); ?>\" alt=\"<?php echo _('Delete'); ?>\"></a>\n <?php } ?>\n </td>\n </tr>\n <?php } // end foreach ?>\n <?php } else { ?>\n <tr>\n <td colspan=\"8\">\n <div style=\"padding:4px\">\n <em><?php echo _(\"There are currently no hostgroup recurring downtime events defined.\"); ?></em>\n </div>\n </td>\n </tr>\n <?php } // end if hostrgroup_data ?>\n </tbody>\n </table>\n\n <?php if ($showall) echo \"</div>\"; // end hostgroup tab?>\n\n<?php } // end if hostgroup or showall\n\nif (!empty($_GET[\"servicegroup\"]) || $showall) {\n\n $servicegroup = grab_request_var('servicegroup', '');\n\n if ($showall) {\n echo \"<div id='servicegroup-tab'>\";\n }\n ?>\n <h4><?php echo $servicegroup_tbl_header; ?></h4>\n <?php\n if (!is_readonly_user(0)) {\n if ($servicegroup) {\n ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=servicegroup&servicegroup_name=<?php echo $servicegroup; ?>&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23servicegroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add schedule for this servicegroup\"); ?></a>\n </div>\n <?php } else { ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=servicegroup&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23servicegroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add Schedule\"); ?>\n </a>\n </div>\n <?php\n }\n } // end is_readonly_user\n ?>\n <table class=\"tablesorter table table-condensed table-striped table-bordered\" style=\"width:100%\">\n <thead>\n <tr>\n <th><?php echo _(\"Servicegroup\"); ?></th>\n <th><?php echo _(\"Comment\"); ?></th>\n <th><?php echo _(\"Start Time\"); ?></th>\n <th><?php echo _(\"Duration\"); ?></th>\n <th><?php echo _(\"Weekdays\"); ?></th>\n <th><?php echo _(\"Days in Month\"); ?></th>\n <th><?php echo _(\"Actions\"); ?></th>\n </tr>\n </thead>\n <tbody>\n <?php\n\n if ($servicegroup_data) {\n $i = 0;\n\n $servicegroup_names = array();\n foreach ($servicegroup_data as $k => $data) {\n $servicegroup_names[$k] = $data['servicegroup_name'];\n }\n\n array_multisort($servicegroup_names, SORT_ASC, $servicegroup_data);\n\n foreach ($servicegroup_data as $sid => $schedule) {\n ?>\n <tr>\n <td><?php echo $schedule[\"servicegroup_name\"]; ?></td>\n <td><?php echo $schedule[\"comment\"]; ?></td>\n <td><?php echo $schedule[\"time\"]; ?></td>\n <td><?php echo $schedule[\"duration\"]; ?></td>\n <td><?php if ($schedule[\"days_of_week\"]) {\n echo $schedule[\"days_of_week\"];\n } else {\n echo \"All\";\n } ?></td>\n <td><?php if ($schedule[\"days_of_month\"]) {\n echo $schedule[\"days_of_month\"];\n } else {\n echo \"All\";\n } ?></td>\n <td style=\"text-align:center;width:60px\">\n <?php if (!is_readonly_user(0)) { ?>\n <a href=\"recurringdowntime.php?mode=edit&sid=<?php echo $sid; ?>&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23servicegroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" title=\"Edit Schedule\"><img src=\"<?php echo theme_image('pencil.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Edit schedule'); ?>\" alt=\"<?php echo _('Edit'); ?>\"></a>\n <a onClick=\"javascript:return do_delete_sid('<?php echo $sid; ?>');\" href=\"javascript:void(0);\" title=\"<?php echo _('Delete Schedule'); ?>\"><img src=\"<?php echo theme_image('cross.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Delete schedule'); ?>\" alt=\"<?php echo _('Delete'); ?>\"></a>\n <?php } ?>\n </td>\n </tr>\n <?php } // end foreach ?>\n\n <?php } else { ?>\n <tr>\n <td colspan=\"7\">\n <div style=\"padding:4px\">\n <em><?php echo _(\"There are currently no servicegroup recurring downtime events defined.\"); ?></em>\n </div>\n </td>\n </tr>\n <?php } // end if servicegroup_data ?>\n\n\n </tbody>\n </table>\n\n <?php if ($showall) echo \"</div>\"; // end servicegroup tab?>\n\n <?php } // end if servicegroup or showall ?>\n\n <?php\n if ($showall) { // end of tabs container\n ?>\n </div>\n <?php\n }\n do_page_end(true);\n}", "public function index(){\t\n\t\t// set the page title\n\t\t$this->set('title_for_layout', 'Approve Waive Off Request- HRIS - BigOffice');\n\t\t\n\t\t// get employee list\t\t\n\t\t$emp_list = $this->HrAttWaive->get_team($this->Session->read('USER.Login.id'),'L');\n\t\t$format_list = $this->Functions->format_dropdown($emp_list, 'u','id','first_name', 'last_name');\t\t\n\t\t$this->set('empList', $format_list);\n\t\t\n\t\n\t\t// when the form is submitted for search\n\t\tif($this->request->is('post')){\n\t\t\t$url_vars = $this->Functions->create_url(array('keyword','emp_id','from','to'),'HrAttWaive'); \n\t\t\t$this->redirect('/hrattwaive/?'.$url_vars);\t\t\t\n\t\t}\t\t\t\t\t\n\t\t\n\t\tif($this->params->query['keyword'] != ''){\n\t\t\t$keyCond = array(\"MATCH (reason) AGAINST ('\".$this->params->query['keyword'].\"' IN BOOLEAN MODE)\"); \n\t\t}\n\t\tif($this->params->query['emp_id'] != ''){\n\t\t\t$empCond = array('HrAttWaive.app_users_id' => $this->params->query['emp_id']); \n\t\t}\n\t\t// for date search\n\t\tif($this->params->query['from'] != '' || $this->params->query['to'] != ''){\n\t\t\t$from = $this->Functions->format_date_save($this->params->query['from']);\n\t\t\t$to = $this->Functions->format_date_save($this->params->query['to']);\t\t\t\n\t\t\t$dateCond = array('HrAttWaive.created_date between ? and ?' => array($from, $to)); \n\t\t}\n\t\t\n\t\t\n\t\t// fetch the attendance data\t\t\n\t\t$this->paginate = array('fields' => array('id', 'created_date',\t\"date_format(HrAttWaive.date, '%Y-%m') as month\",\n\t\t\"date_format(HrAttWaive.date, '%M, %Y') as month_display\", 'HrEmployee.first_name', 'HrEmployee.last_name','status','approve_date', 'HrEmployee.id', 'count(*) no_req'),\n\t\t'limit' => 10,'conditions' => array($keyCond, \n\t\t$empCond, $dateCond, 'is_draft' => 'N'), 'group' => array('HrEmployee.id',\"date_format(HrAttWaive.date, '%Y-%m')\"),\n\t\t'order' => array('HrAttWaive.created_date' => 'desc'));\n\t\t$data = $this->paginate('HrAttWaive');\n\t\t\n\t\t$this->set('att_data', $data);\n\t\t\n\t\t\n\t\n\t\tif(empty($data)){\n\t\t\t$this->Session->setFlash('<button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>You have no waive-off request to approve', 'default', array('class' => 'alert alert'));\t\n\t\t}\n\t\t\n\t\t\n\t}", "public function index($view='week',$ref_datetime=false){\n\n $view = strtolower($view);\n\n if(!in_array($view,array('day','week','month','list'))){\n $this->_setFlash('Invalid view specified.');\n return $this->redirect($this->referer(array('action' => 'index')));\n }\n\n if($ref_datetime === false)\n $ref_datetime = time();\n\n $start_datetime = false;\n $end_datetime = false;\n $viewDescription = false;\n\n //Adjust start date/time based on the current reference time\n if($view == 'day'){\n $start_datetime = strtotime('today midnight', $ref_datetime);\n $end_datetime = strtotime('tomorrow midnight', $start_datetime);\n $previous_datetime = strtotime('yesterday midnight', $start_datetime);\n $next_datetime = $end_datetime;\n $viewDescription = date('M, D j',$start_datetime);\n }\n elseif($view == 'week') {\n $start_datetime = strtotime('Monday this week', $ref_datetime);\n $end_datetime = strtotime('Monday next week', $start_datetime);\n $previous_datetime = strtotime('Monday last week', $start_datetime);\n $next_datetime = $end_datetime;\n $viewDescription = date('M j', $start_datetime) . \" - \" . date('M j', $end_datetime-1);\n }\n elseif($view == 'month') {\n $start_datetime = strtotime('first day of this month', $ref_datetime);\n $end_datetime = strtotime('first day of next month', $start_datetime);\n $previous_datetime = strtotime('first day of last month', $start_datetime);\n $next_datetime = $end_datetime;\n $viewDescription = date('F \\'y', $start_datetime);\n }\n else { //list\n $start_datetime = strtotime('first day of January this year', $ref_datetime);\n $end_datetime = strtotime('first day of January next year', $start_datetime);\n $previous_datetime = strtotime('first day of January last year', $start_datetime);\n $next_datetime = $end_datetime;\n $viewDescription = date('Y', $start_datetime);\n }\n\n $start_datetime_db = date('Y-m-d H:i:s', $start_datetime);\n $end_datetime_db = date('Y-m-d H:i:s', $end_datetime);\n\n $entries = $this->CalendarEntry->find('all',array(\n 'contain' => array(),\n 'conditions' => array(\n 'OR' => array(\n array(\n 'start >=' => $start_datetime_db,\n 'start < ' => $end_datetime_db\n ),\n array(\n 'end >=' => $start_datetime_db,\n 'end <' => $end_datetime_db\n )\n )\n ),\n 'order' => array(\n 'start' => 'desc'\n )\n ));\n\n //Group entries appropriately\n $grouped_entries = array(); \n $group_offset = false;\n $group_index = 0;\n if($view == 'day'){\n //Group by hour\n $group_offset = self::HOUR_SECONDS;\n }\n elseif($view == 'week'){\n //Group by day\n $group_offset = self::DAY_SECONDS;\n }\n elseif($view == 'month'){\n //Group by week\n $group_offset = self::WEEK_SECONDS;\n }\n else {\n //Group by month\n $group_offset = self::DAY_SECONDS*31; //31 days in Jan\n }\n $group_starttime = $start_datetime;\n $group_endtime = $start_datetime + $group_offset - 1;\n while($group_starttime < $end_datetime){\n $grouped_entries[$group_index] = array(\n 'meta' => array(\n 'starttime' => $group_starttime,\n 'endtime' => $group_endtime\n ),\n 'items' => array()\n );\n foreach($entries as $entry){\n $entry_starttime = strtotime($entry['CalendarEntry']['start']);\n $entry_endtime = strtotime($entry['CalendarEntry']['end']);\n if($entry_starttime >= $group_starttime && $entry_starttime < $group_endtime){\n $grouped_entries[$group_index]['items'][] = $entry;\n continue;\n }\n if($entry_endtime > $group_starttime && $entry_endtime < $group_endtime){\n $grouped_entries[$group_index]['items'][] = $entry;\n }\n }\n $group_index++;\n\n if($view == 'list'){\n $group_starttime = $group_endtime + 1;\n $group_endtime = strtotime('first day of next month', $group_starttime) - 1;\n }\n else {\n $group_starttime += $group_offset;\n $group_endtime += $group_offset;\n if($group_endtime > $end_datetime)\n $group_endtime = $end_datetime-1;\n }\n }\n\n $this->set(array(\n 'view' => $view,\n 'viewDescription' => $viewDescription,\n 'calendarItems' => $grouped_entries,\n 'currentDatetime' => $start_datetime,\n 'previousDatetime' => $previous_datetime,\n 'nextDatetime' => $next_datetime\n ));\n }", "public function index() {\n $currentDate = (new Datetime())->format('Y-m-d');\n \t$timesheets = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->get();\n \t$schedule = Schedule::whereDate('start_date','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->get();\n \t//Get total time worked\n \t$hours = 0;\n \tforeach ($timesheets as $timesheet) {\n\t \t$date1 = new Datetime($timesheet->start_time);\n\t\t\t$date2 = new Datetime($timesheet->end_time);\n\t\t\t$diff = $date2->diff($date1);\n\n $hours = $hours + (($diff->h * 60) + $diff->i);\n \t}\n //Get total breaks\n $breaks = 0;\n $first_timesheet = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->first();\n $last_timesheet = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->latest()->first();\n if($first_timesheet){\n $date1 = new Datetime($first_timesheet->start_time);\n $date2 = new Datetime($last_timesheet->end_time);\n $diff = $date2->diff($date1);\n $breaks = (($diff->h * 60) + $diff->i) - $hours;\n }\n\n $worked = $this->hoursandmins($hours);\n $breaks = $this->hoursandmins($breaks);\n // First Punch In in current day\n $first_punch_in = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->first();\n return view('attendance/index', ['timesheets'=>$timesheets, 'schedule'=>$schedule, 'first_punch_in'=>$first_punch_in, 'worked'=>$worked, 'breaks'=>$breaks, 'first_timesheet'=>$first_timesheet, 'last_timesheet'=>$last_timesheet]);\n }", "public function detailedtimesheetAction()\r\n {\r\n $project = $this->projectService->getProject($this->_getParam('projectid'));\r\n $client = $this->clientService->getClient($this->_getParam('clientid'));\r\n $task = $this->projectService->getTask($this->_getParam('taskid'));\r\n $user = $this->userService->getUserByField('username', $this->_getParam('username'));\r\n\t\t\r\n if (!$project && !$client && !$task && !$user) {\r\n return;\r\n }\r\n\r\n\t\tif ($task) { \r\n $this->view->records = $this->projectService->getDetailedTimesheet(null, $task->id);\r\n } else if ($project) {\r\n \r\n $start = null;\r\n $this->view->records = $this->projectService->getDetailedTimesheet(null, null, $project->id);\r\n } else if ($client) {\r\n \r\n $start = null;\r\n $this->view->records = $this->projectService->getDetailedTimesheet(null, null, null, $client->id);\r\n } else if ($user) {\r\n\t\t\t$this->view->records = $this->projectService->getDetailedTimesheet($user);\r\n\t\t}\r\n\r\n\t\t$this->view->task = $task;\r\n $this->renderRawView('timesheet/ajax-timesheet-details.php');\r\n }", "function approvedperiodview()\n\t {\n\t // Get the current user\n\t $user = &getUser();\n\n\t // If the year is given in postvars, then view the approvedperiodview\n // for the specified year\n\t if (is_numeric($this->m_postvars[\"year\"]) && strlen($this->m_postvars[\"year\"])==4)\n\t $year = trim($this->m_postvars[\"year\"]);\n\n\t // Else use the current year\n\t else\n\t $year = date('Y');\n\n $selected_functionlevel_id = $this->m_postvars[\"functionlevelswitch\"];\n\n if (moduleExists('advancedsecurity'))\n $lowerlevels = atkArrayNvl($this->m_postvars, \"lowerlevels\", 'off');\n else\n $lowerlevels = \"off\";\n\n\t // Get the singleton instance of the ui renderer\n\t $ui = &atkui::getInstance();\n\n // Compose the tplvars containing content and legend\n $tplvars_contentwithlegend = array(\n \"content\" => $this->getEmployeesTable($user[\"id\"], $year, $selected_functionlevel_id, $lowerlevels),\n \"legenditems\" => $this->getLegendData()\n );\n\n $contentwithlegend = $ui->render(\"contentwithlegend.tpl\", $tplvars_contentwithlegend);\n\n\t // Use a numberattrib to get a display for the year inputbox\n\t $yearattrib = new atkNumberAttribute(\"year\",0,6);\n\n\t $func_code = $this->get_functionlevels($selected_functionlevel_id, $lowerlevels);\n\n // Display the year input form\n $header = \"\";\n if ($func_code != null) $header.= atktext('functionlevel','project').': '.$func_code.'<br />';\n $header.= atktext(\"year\").\" : \".$yearattrib->edit(array(\"year\"=>$year)).'&nbsp;&nbsp;';\n $header.= '<input type=\"submit\" name=\"atkbtn1\" value=\"'.atktext(\"view\").'\">';\n //$header.= atkbutton(atktext(\"view\"), dispatch_url(\"timereg.hours_approve\", \"admin\"), SESSION_REPLACE);\n\n // Add an explanation to the approvedperiodview\n\t $footer = atktext(\"remark\") . \": <br />\";\n $footer.= (!$this->allowed(\"any_user\")) ? atktext(\"hours_approve_remarkmanager\") . '<br />' : '';\n $footer.= (moduleExists('advancedsecurity')) ? atktext(\"hours_approve_advancedsecurity\") . '<br />' : '';\n $footer.= sprintf(atktext(\"hours_approve_remarkperiodblock\"), ucfirst($this->m_lockmode));\n\n if (atkconfig::get('timereg','hours_approve_only_show_not_approved') == true)\n $footer .= \"<br />\" . atktext('hours_approve_only_show_not_approved');\n\n if (atkconfig::get('timereg','hours_approve_projectteam_members_only') == true)\n $footer .= \"<br />\" . atktext('hours_approve_explain_teammembers_only');\n\n\t $footer.= $this->convertheck();\n\n\t // Start the output using a session form\n\t $formstart = '<form name=\"entryform\" enctype=\"multipart/form-data\" action=\"'.getDispatchFile().'\" method=\"post\" onsubmit=\"globalSubmit(this)\">';\n\t $formstart.= session_form();\n\t // Close the form\n\t $formend = '</form>';\n\n\t // Compose the tplvars containing the\n\t $tplvars_vertical = array(\n\t \"formstart\" => $formstart,\n\t \"formend\" => $formend,\n\t \"blocks\" => array(\n $header,\n $contentwithlegend,\n $footer\n ),\n \"align\" => \"left\"\n );\n\n $boxcontents = $ui->render(\"vertical.tpl\", $tplvars_vertical);\n\n\t // Add a conversion link to the approvedperiodview if datastructurs outdated\n\n\t // Put the result into a box\n\t $boxedresult = $ui->renderBox(array(\"title\"=>atktext(\"title_houradmin_approve\"),\"content\"=>$boxcontents));\n\n\t // Return the boxed result HTML\n\t return $boxedresult;\n\t }", "public function reportTodayAttendent()\n {\n $shift = DB::table('shift')->get();\n $dept = DB::table('department')->where('status',1)->get();\n return view('report.reportTodayAttendent')->with('shift',$shift)->with('dept',$dept);\n }", "public function mark_attendance($message = NULL) {\n $data['sideMenuData'] = fetch_non_main_page_content();\n $tenant_id = $this->tenant_id;\n $course_id = $this->input->post('course_id');\n $class_id = $this->input->post('class_id');\n $subsidy = $this->input->post('subsidy');\n $sort_by = $this->input->get('b');\n $sort_order = $this->input->get('o');\n $class_details = $this->class->get_class_by_id($tenant_id, $course_id, $class_id);\n \n $from_date = parse_date($class_details->class_start_datetime, SERVER_DATE_TIME_FORMAT);///added by shubhranshu\n $to_date = parse_date($class_details->class_end_datetime, SERVER_DATE_TIME_FORMAT);//added by shubhranshu\n $week_start_date = parse_date($this->input->post('week_start'), CLIENT_DATE_FORMAT);//added by shubhranshu\n //echo print_r($from_date);print_r($to_date);print_r($week_start_date);exit;\n \n $week = $this->input->post('week');\n $export = $this->input->post('export');\n $export1 = $this->input->post('export1');\n $this->load->helper('attendance_helper');\n if (!empty($export)) \n {\n $class_details = $this->class->get_class_details_for_report($tenant_id, $course_id, $class_id);\n $class_start = parse_date($class_details->class_start_datetime, SERVER_DATE_TIME_FORMAT);\n $class_end = parse_date($class_details->class_end_datetime, SERVER_DATE_TIME_FORMAT);\n if (empty($class_start))\n $class_start = new DateTime();\n if (empty($class_end))\n $class_end = new DateTime();\n $class_schedule = $this->class->get_all_class_schedule($tenant_id, $class_id);\n $class_schedule_data = array();\n foreach ($class_schedule as $row) {\n $session_arr = array('S1' => '1', 'BRK' => '3', 'S2' => '2');\n $class_schedule_data[date('d/m/y', strtotime($row['class_date']))][$session_arr[$row['session_type_id']]] = date('h:i A', strtotime($row['session_start_time']));\n }\n \n if ($export == 'xls') \n {\n $results = $this->classtraineemodel->get_class_trainee_list_for_attendance($tenant_id, $course_id, $class_id, $subsidy, $class_start, $class_end, $sort_by, $sort_order);\n $this->load->helper('export_helper');\n export_attendance($results, $class_details, $class_start, $class_end, $class_schedule_data);\n } \n else \n {\n $results = $this->classtraineemodel->get_class_trainee_list_for_attendance($tenant_id, $course_id, $class_id, $subsidy, $class_start, $class_end, $sort_by, $sort_order);\n $tenant_details = $this->classtraineemodel->get_tenant_masters($tenant_id);\n $tenant_details->tenant_state = rtrim($this->course->get_metadata_on_parameter_id($tenant_details->tenant_state), ', ');\n $tenant_details->tenant_country = rtrim($this->course->get_metadata_on_parameter_id($tenant_details->tenant_country), ', ');\n\t\t$mark_count = $this->classtraineemodel->get_rows_count($course_id,$class_id);\n \n if ($export == 'xls_week'){\n $this->load->helper('export_helper');\n return generate_class_attendance_sheet_xls($results, $class_details, $class_start, $class_end, $tenant_details, $class_schedule_data);\n }\n $this->load->helper('pdf_reports_helper');\n if ($export == 'pdf') {\n //return generate_class_attendance_pdf($results, $class_details, $tenant_details, $class_schedule_data, $mark_count);\n //print_r($results);exit;\n return generate_class_attendance_pdf($results, $class_details, $tenant_details, $class_schedule_data,$mark_count); // removed mark count by shubhranshu\n \n } else if ($export == 'pdf_week') {\n return generate_class_attendance_sheet_pdf($results, $class_details, $tenant_details, $class_schedule_data);\n }\n }\n \n } \n else \n {\n if($export1=='lock')\n { \n $lock_msg=$this->classtraineemodel->lock_class_attendance($tenant_id,$course_id,$class_id);\n if($lock_msg==TRUE){\n $this->session->set_flashdata(\"success\", \"Succesfully Locked.\");\n }else{\n $this->session ->set_flashdata(\"error\",\"Something went wrong while locking.\");\n }\n }else if($export1=='unlock'){\n $lock_msg=$this->classtraineemodel->unlock_class_attendance($tenant_id,$course_id,$class_id);\n if($lock_msg==TRUE){\n $this->session->set_flashdata(\"success\",\"Succesfully Unocked\");\n }else{\n $this->session->set_flashdata(\"error\",\"Somthing went wrong while Unlocking !\");\n \n }\n }\n \n \n $data = get_data_for_renderring_attendance($tenant_id, $course_id, $class_id, $subsidy, $from_date, $to_date, $week_start_date, $week, $sort_by, $sort_order,'');\n \n $data['class_schedule'] = $this->class->get_all_class_schedule($tenant_id, $class_id);\n $att = $this->classtraineemodel->get_attendance_lock_status($tenant_id,$course_id, $class_id);\n $data['lock_status']=$att->lock_status;\n $data['class_start_datetime']=$att->class_start_datetime;\n\t\t\t$data['user'] = $this->user;\n\t\t\t$data['controllerurl'] = 'class_trainee/mark_attendance';\n $data['page_title'] = 'Class Trainee Enrollment - Mark Attendance';\n $data['main_content'] = 'classtrainee/markattendance';\n //$data['week_start'] = $from_date;\n //$data['sideMenuData'] = $this->sideMenu;\n if (!empty($message))\n $data['message'] = $message;\n $this->load->view('layout', $data);\n }\n }", "public function approveTimesheet() {\n $id = request('timesheetId');\n Timesheet::find($id)->update(['status'=>'approved']);\n return back();\n }", "public function overAllSummaryReportView(Request $request)\n {\n $from_date = trim($request->from); \n $from = date (\"Y-m-d\", strtotime($from_date));\n $explode = explode('-',$from);\n $from_year = $explode[0];\n $get_current_day = date(\"l\",strtotime($from));\n $current_year = date('Y');\n if($get_current_day =='Saturday'){\n $current_day = 1 ;\n }\n if($get_current_day =='Sunday'){\n $current_day = 2 ;\n }\n if($get_current_day =='Monday'){\n $current_day = 3 ;\n }\n if($get_current_day =='Tuesday'){\n $current_day = 4 ;\n }\n if($get_current_day =='Wednesday'){\n $current_day = 5 ;\n }\n if($get_current_day =='Thursday'){\n $current_day = 6 ;\n }\n if($get_current_day =='Friday'){\n $current_day = 7 ;\n }\n if($from > $this->rcdate1){\n echo 'f1';\n exit();\n }\n // get door holiday\n $holiday_count = DB::table('holiday')->where('door_holiday',0)->where('holiday_date',$from)->count();\n if($holiday_count > 0){\n echo 'f2';\n exit();\n }\n if($from_year != $current_year){\n echo 'f3';\n exit();\n }\n // attendent holiday count\n $attendent_holiday_count = DB::table('holiday')->where('attendent_holiday',0)->where('holiday_date',$from)->count();\n // total staff\n $total_staff_count = DB::table('users')->where('trasfer_status',0)->whereNotIn('type',[10])->count();\n // total teacher count \n $total_teacher_count = DB::table('users')->where('trasfer_status',0)->where('type',3)->count();\n // total staff enter into the campus\n $total_staff_enter_into_campus = DB::table('tbl_door_log')->where('type',1)->whereNotIn('user_type',[10])->where('enter_date',$from)->distinct('user_id')->count('user_id');\n\n // total staff leave\n $total_staff_leave_count = DB::table('tbl_leave')->where('final_request_from',$from)->where('status',1)->count();\n $total_teacher_leave_count = DB::table('tbl_leave')\n ->join('users', 'users.id', '=', 'tbl_leave.user_id')\n ->select('tbl_leave.*')\n ->where('users.type', 3)\n ->where('final_request_from',$from)\n ->where('status',1)\n ->count();\n $total_teacher_attendent_in_class = DB::table('teacher_attendent')->where('created_at',$from)->where('status',1)->where('type',3)->distinct('teacherId')->count('teacherId');\n // total class of this day\n $total_class_count = DB::table('routine')\n ->join('semister', 'routine.semister_id', '=', 'semister.id')\n ->select('routine.*')\n ->where('routine.year', $from_year)\n ->where('routine.day', $current_day)\n ->where('semister.status',1)\n ->count();\n\n // total teacher attendent class\n $teacher_taken_total_class_class = DB::table('teacher_attendent')->where('created_at',$from)->where('status',1)->where('type',3)->count();\n #--------------------------------- student section------------------------------------#\n $total_student_count = DB::table('student')\n ->join('semister', 'student.semister_id', '=', 'semister.id')\n ->select('student.*')\n ->where('student.year', $from_year)\n ->where('student.status', 0)\n ->where('semister.status',1)\n ->count();\n $total_student_enter_into_campus = DB::table('tbl_door_log')->where('type',2)->where('enter_date',$from)->distinct('student_id')->count('student_id');\n $total_student_enter_into_class = DB::table('student_attendent')->where('created_at',$from)->distinct('studentId')->count('studentId');\n // total hours class of this day\n $total_class_hour_in_routine = DB::table('routine')\n ->join('semister', 'routine.semister_id', '=', 'semister.id')\n ->select('routine.*')\n ->where('routine.year', $from_year)\n ->where('routine.day', $current_day)\n ->where('semister.status',1)\n ->get();\n // total hours class held\n $total_hours_class_held_query = DB::table('teacher_attendent')->where('created_at',$from)->where('status',1)->where('type',3)->get(); \n\n return view('view_report.overAllSummaryReportView')\n ->with('total_staff_count',$total_staff_count)\n ->with('total_teacher_count',$total_teacher_count)\n ->with('total_staff_enter_into_campus',$total_staff_enter_into_campus)\n ->with('total_staff_leave_count',$total_staff_leave_count)\n ->with('total_teacher_leave_count',$total_teacher_leave_count)\n ->with('total_teacher_attendent_in_class',$total_teacher_attendent_in_class)\n ->with('total_class_count',$total_class_count)\n ->with('teacher_taken_total_class_class',$teacher_taken_total_class_class)\n ->with('from',$from)\n ->with('attendent_holiday_count',$attendent_holiday_count)\n ->with('total_student_count',$total_student_count)\n ->with('total_student_enter_into_campus',$total_student_enter_into_campus)\n ->with('total_student_enter_into_class',$total_student_enter_into_class)\n ->with('total_class_hour_in_routine',$total_class_hour_in_routine)\n ->with('total_hours_class_held_query',$total_hours_class_held_query)\n ;\n }", "function companydates(){\n $this->auth(COMP_ADM_LEVEL);\n $contest_id = $this->uri->segment(3);\n $data = $this->_getCompanyDataByContestId($contest_id);\n if($this->session->userdata('role_level') > SUPPORT_ADM_LEVEL){\n $data['editable'] = TRUE;\n } else {\n $data['editable'] = FALSE;\n }\n $this->load->view('admin/company_admin/v_dates', $data);\n }", "function teamGoals($viewPermissions, $mysqli) {\n$curDate = date (\"Y-m-d\");\n$curMonth = date('m');\n$curYear = date('Y');\n$beginWeek = date(\"Y-m-d\", strtotime('last sunday'));\n$endWeek = date(\"Y-m-d\", strtotime('this friday'));\n$monthBegin = $curYear . '-' . $curMonth . '-01';\n$monthEnd = $curYear . '-' . $curMonth . '-31';\n// Merging first and last name into one variable.\n// Declaring default value for the time counters.\n$teamMonth = 0;\n$teamWeek = 0;\n$teamDay = 0;\n// Switch case changing the role depending on permissions value.\nswitch ($viewPermissions) {\n\tcase 'Domain':\n\t\t$role = 'DateBought';\n\t\tbreak;\n\tcase 'Content':\n\t\t$role = 'ContentFinished';\n\t\tbreak;\n\tcase 'Writer':\n\t\t$role = 'ContentFinished';\n\t\tbreak;\n\tcase 'Designer':\n\t\t$role = 'DesignFinish';\n\t\tbreak;\n\tcase 'Support':\n\t\t$role = 'CloneFinished';\n\t\tbreak;\n\tcase 'Admin':\n\t\t$role = 'DevFinish';\n\t\tbreak;\n\tcase 'QA':\n\t\t$role = 'DateComplete';\n\t\tbreak;\n}\n$query = \"SELECT * FROM domainDetails WHERE `$role`= '$curDate'\";\n$results = mysqli_query($mysqli, $query);\n$rows = mysqli_num_rows($results);\nfor ($a = 0; $a < $rows; $a++){\n\tmysqli_data_seek($results, $a);\n\t$domain_data = mysqli_fetch_assoc($results);\n// Setting results as incrementers. If there is a day found then it adds to day, week, & month.\n\t\t$teamDay++;\n}\n$query = \"SELECT * FROM domainDetails WHERE $role BETWEEN '$beginWeek' AND '$endWeek'\";\n$results = mysqli_query($mysqli, $query);\n$rows = mysqli_num_rows($results);\nfor ($a = 0; $a < $rows; $a++){\n\tmysqli_data_seek($results, $a);\n\t$domain_data = mysqli_fetch_assoc($results);\n// Setting results as incrementers. If there is a day found then it adds to day, week, & month.\n// Adds to the week as well as month.\n\t\t$teamWeek++;\n}\n// Adds to only the month.\n$query = \"SELECT * FROM domainDetails WHERE $role BETWEEN '$monthBegin' AND '$monthEnd'\";\n$results = mysqli_query($mysqli, $query);\n$rows = mysqli_num_rows($results);\nfor ($a = 0; $a < $rows; $a++){\n\tmysqli_data_seek($results, $a);\n\t$domain_data = mysqli_fetch_assoc($results);\n\t\t$teamMonth++;\n}\n\nreturn array($teamDay, $teamWeek, $teamMonth);\n}", "function Approve( $id,$week,$year ) \t{\n\t\t$this->getMenu() ;\n\t\t$this->data['id']\t= $id ;\n\t\t$this->data['back']\t= $this->data['site'] .'timesheet/tobeApproved';\n\t\t$this->data['table'] = $this->timesheetModel->getTimesheetActiveStatusX($id,$week,$year);\n\t\t$this->load->view('timesheet_approve_detail',$this->data);\n\t}", "public static function weekly() {return new ScheduleViewMode(2);}", "public function action_list_approval_menu(){\n $param = \\Input::param();\n $export_date = isset($param['export_date'])?date('Y-m-d', strtotime($param['export_date'])):date('Y-m-d');\n\n $objPHPExcel = new \\PHPExcel();\n $objPHPExcel->getProperties()->setCreator('Vision')\n ->setLastModifiedBy('Vision')\n ->setTitle('Office 2007 Document')\n ->setSubject('Office 2007 Document')\n ->setDescription('Document has been generated by PHP')\n ->setKeywords('Office 2007 openxml php')\n ->setCategory('Route File');\n\n $header = ['様式', '適用開始日', '適用終了日',\n '第1 承認者','第1 承認者の権限',\n '第2 承認者','第2 承認者の権限','第3 承認者','第3 承認者の権限',\n '第4 承認者','第4 承認者の権限','第5 承認者','第5 承認者の権限',\n '第6 承認者','第6 承認者の権限','第7 承認者','第7 承認者の権限',\n '第8 承認者','第8 承認者の権限','第9 承認者','第9 承認者の権限',\n '第10 承認者','第10 承認者の権限','第11 承認者','第11 承認者の権限',\n '第12 承認者','第12 承認者の権限','第13 承認者','第13 承認者の権限',\n '第14 承認者','第14 承認者の権限','第15 承認者','第15 承認者の権限',\n ];\n $last_column = null;\n foreach($header as $i=>$v){\n $column = \\PHPExcel_Cell::stringFromColumnIndex($i);\n $objPHPExcel->setActiveSheetIndex(0)->setCellValue($column.'1',$v);\n $objPHPExcel->getActiveSheet()->getStyle($column.'1')\n ->applyFromArray([\n 'font' => [\n 'name' => 'Times New Roman',\n 'bold' => true,\n 'italic' => false,\n 'size' => 10,\n 'color' => ['rgb'=> \\PHPExcel_Style_Color::COLOR_WHITE]\n ],\n 'alignment' => [\n 'horizontal' => \\PHPExcel_Style_Alignment::HORIZONTAL_CENTER,\n 'vertical' => \\PHPExcel_Style_Alignment::VERTICAL_CENTER,\n 'wrap' => false\n ]\n ]);\n switch($i+1){\n case 1:\n $width = 50;\n break;\n case 5: case 7: case 9: case 11: case 13:\n case 15: case 17: case 19: case 21: case 23: case 25:\n case 27: case 29: case 31: case 33: case 35: case 37: case 39: \n $width = 20;\n break;\n default:\n $width = 30;\n break;\n }\n $objPHPExcel->getActiveSheet()->getColumnDimension($column)->setWidth($width);\n $last_column = $column;\n }\n \n /*====================================\n * Get list user has department enable_start_date >= export day <= enable_end_date\n * Or enable_start_date >= export day && enable_end_date IS NULL\n *====================================*/\n $query = \\DB::select('MAM.*',\n \\DB::expr('MM.name AS menu_name'), \\DB::expr('MM.id AS menu_id'), \n \\DB::expr('MRM.name AS request_menu_name'), \\DB::expr('MRM.id AS request_menu_id'))\n ->from(['m_approval_menu', 'MAM'])\n ->join(['m_menu', 'MM'], 'left')->on('MM.id', '=', 'MAM.m_menu_id')\n ->on('MAM.petition_type', '=', \\DB::expr(\"1\"))\n ->on('MM.item_status', '=', \\DB::expr(\"'active'\"))->on('MM.enable_flg', '=', \\DB::expr(\"1\"))\n ->join(['m_request_menu', 'MRM'], 'left')->on('MRM.id', '=', 'MAM.m_menu_id')\n ->on('MAM.petition_type', '=', \\DB::expr(\"2\"))\n ->on('MRM.item_status', '=', \\DB::expr(\"'active'\"))->on('MRM.enable_flg', '=', \\DB::expr(\"1\"))\n ->where('MAM.item_status', '=', 'active')\n ->group_by('MAM.m_menu_id', 'MAM.petition_type', 'MAM.enable_start_date')\n ;\n $items = $query->execute()->as_array();\n \n //set content\n $i = 0;\n foreach($items as $item){\n $row = $i+2;\n switch ($item['petition_type']) {\n case 1:\n $menu_name = $item['menu_name'];\n $menu_id = $item['menu_id'];\n break;\n case 2:\n $menu_name = $item['request_menu_name'];\n $menu_id = $item['request_menu_id'];\n break;\n }\n\n if(empty($menu_id)) continue;\n $objPHPExcel->setActiveSheetIndex()->setCellValue('A'.$row, $menu_name)\n ->setCellValue('B'.$row,$item['enable_start_date']?\\Vision_Common::system_format_date(strtotime($item['enable_start_date'])):null)\n ->setCellValue('C'.$row,$item['enable_end_date']?\\Vision_Common::system_format_date(strtotime($item['enable_end_date'])):null);\n\n //Get user of routes\n $query = \\DB::select('MU.fullname', \\DB::expr('MA.name AS authority_name'))\n ->from(['m_user', 'MU'])\n // ->join(['m_user_department', 'MUD'], 'left')->on('MUD.m_user_id', '=', 'MU.id')\n // ->join(['m_department', 'DEP'], 'left')->on('DEP.id', '=', 'MUD.m_department_id')\n ->join(['m_approval_menu', 'MAM'], 'left')->on('MAM.m_user_id', '=', 'MU.id')\n ->join(['m_authority', 'MA'], 'left')->on('MA.id', '=', 'MAM.m_authority_id')\n ->and_where('MAM.m_menu_id', '=', $item['m_menu_id'])\n ->and_where('MAM.petition_type', '=', $item['petition_type'])\n\n ->where('MU.item_status', '=', 'active')\n ->and_where_open()\n ->and_where('MU.retirement_date', '>', $export_date)\n ->or_where('MU.retirement_date', 'IS',\\DB::expr('NULL'))\n ->and_where_close()\n\n ->and_where('MAM.item_status', '=', 'active')\n ->and_where_open()\n ->and_where(\\DB::expr(\"'{$export_date}'\"), 'BETWEEN', [\\DB::expr('MAM.enable_start_date'), \\DB::expr('MAM.enable_end_date')])\n ->or_where_open()\n ->and_where(\\DB::expr('MAM.enable_start_date'), '<=', $export_date)\n ->and_where(\\DB::expr('MAM.enable_end_date'), 'IS', \\DB::expr('NULL'))\n ->or_where_close()\n ->and_where_close()\n\n ->order_by('MAM.order', 'ASC')\n ->group_by('MAM.m_user_id', 'MAM.m_authority_id')\n ;\n $users = $query->execute()->as_array(); \n\n if(!empty($users)){\n $col = 3;\n foreach ($users as $user) {\n $objPHPExcel->setActiveSheetIndex()->setCellValue(\\PHPExcel_Cell::stringFromColumnIndex($col).$row,$user['fullname']);\n $col++;\n $objPHPExcel->setActiveSheetIndex()->setCellValue(\\PHPExcel_Cell::stringFromColumnIndex($col).$row,$user['authority_name']);\n $col++;\n }\n }\n\n $i++;\n }\n\n\n $format = ['alignment'=>array('horizontal'=> \\PHPExcel_Style_Alignment::HORIZONTAL_CENTER,'wrap'=>true)];\n $objPHPExcel->getActiveSheet()->getStyle('A1:AC1')->getFill()->setFillType(\\PHPExcel_Style_Fill::FILL_SOLID);\n $objPHPExcel->getActiveSheet()->getStyle('A1:AC1')->getFill()->getStartColor()->setRGB('25a9cb');\n\n header(\"Last-Modified: \". gmdate(\"D, d M Y H:i:s\") .\" GMT\");\n header(\"Cache-Control: max-age=0\");\n header('Content-Type: application/vnd.ms-excel');\n header('Content-Disposition: attachment;filename=\"決裁経路(基準)-'.$export_date.'.xls\"');\n $objWriter = \\PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');\n $objWriter->save('php://output');\n exit; \n }", "public function getAppointments(){\n\t\tif (Auth::user()->type==4) {\n\t\t\t# code...\n\t\t\treturn redirect()->back(); \n\t\t}\n\t\t$todays = $this->getTodayAppointments(); \n\t\treturn view('appointments.nurseAppointments',compact('todays'));\n\t}", "public function date_range_report()\n\t{\n\t\t$this->data['crystal_report']=$this->reports_personnel_schedule_model->crystal_report_view();\n\t\t$this->data['company_list'] = $this->reports_personnel_schedule_model->company_list();\n\t\t$this->load->view('employee_portal/report_personnel/schedule/date_range_report',$this->data);\n\t}", "function wfCalendarRefresh()\n{\n global $wgRequest, $wgTitle, $wgScriptPath;\n // this is the \"refresh\" code that allows the calendar to switch time periods\n $v = $wgRequest->getValues();\n if (isset($v[\"calendar_info\"]))\n {\n $today = getdate(); // today\n $temp = explode(\"`\", $v[\"calendar_info\"]); // calling calendar info (name, title, etc..)\n\n // set the initial values\n $month = $temp[0];\n $day = $temp[1];\n $year = $temp[2];\n $title = $temp[3];\n $name = $temp[4];\n\n // the yearSelect and monthSelect must be on top... the onChange triggers\n // whenever the other buttons are clicked\n if (isset($v[\"yearSelect\"]))\n $year = $v[\"yearSelect\"];\n if (isset($v[\"monthSelect\"]))\n $month = $v[\"monthSelect\"];\n\n if (isset($v[\"yearBack\"]))\n --$year;\n if (isset($v[\"yearForward\"]))\n ++$year;\n\n if (isset($v[\"today\"]))\n {\n $day = $today['mday'];\n $month = $today['mon'];\n $year = $today['year'];\n }\n\n if (isset($v[\"monthBack\"]))\n {\n $year = ($month == 1 ? --$year : $year);\n $month = ($month == 1 ? 12 : --$month);\n }\n\n if (isset($v[\"monthForward\"]))\n {\n $year = ($month == 12 ? ++$year : $year);\n $month = ($month == 12 ? 1 : ++$month);\n }\n\n if (isset($v[\"weekBack\"]))\n {\n $arr = getdate(mktime(12, 0, 0, $month, $day-7, $year));\n $month = $arr['mon'];\n $day = $arr['mday'];\n $year = $arr['year'];\n }\n\n if (isset($v[\"weekForward\"]))\n {\n $arr = getdate(mktime(12, 0, 0, $month, $day+7, $year));\n $month = $arr['mon'];\n $day = $arr['mday'];\n $year = $arr['year'];\n }\n\n if (wfCalendarIsValidMode($v[\"viewSelect\"]))\n $mode = $v[\"viewSelect\"];\n\n $p = \"cal\".crc32(\"$title $name\");\n $v = sprintf(\"%04d-%02d-%02d-%s\", $year, $month, $day, $mode);\n\n // reload the page... clear any purge commands that may be in it from an ical load...\n $url = $wgTitle->getFullUrl(array($p => $v));\n header(\"Location: \" . $url);\n exit;\n }\n}", "function reminderForReimbursementSheet() {\n\n try {\n\n\n $conn = $this->connectToDB();\n\n $sql = \" SELECT date(h.ratingInputDate) as rating_date,q.first_mail_status,date(q.mail_sent_date) as mail_sent_date,q.sheet_status,q.assessment_id,q.user_id ,c.client_name,st.state_name,ct.city_name,u.name as user_name,\n d.school_aqs_pref_start_date as sdate,d.school_aqs_pref_end_date as edate\n FROM d_user u INNER JOIN h_user_review_reim_sheet_status q on u.user_id = q.user_id\n INNER JOIN d_assessment a ON q.assessment_id = a.assessment_id \n INNER JOIN d_client c ON a.client_id = c.client_id\n INNER JOIN d_cities ct ON c.city_id = ct.city_id\n INNER JOIN d_states st ON c.state_id = st.state_id\n INNER JOIN d_AQS_data d ON a.aqsdata_id = d.id\n INNER JOIN h_assessment_user h ON h.assessment_id = a.assessment_id AND h.role = :role\n WHERE q.sheet_status = :sheet_status AND h.isFilled = :isFilled \n \";\n $stmt = $conn->prepare($sql);\n $role = 4;\n $sheet_status = 0;\n $isFilled = 1;\n $stmt->bindParam(':sheet_status', $sheet_status, $conn::PARAM_INT);\n $stmt->bindParam(':role', $role, $conn::PARAM_INT);\n $stmt->bindParam(':isFilled', $isFilled, $conn::PARAM_INT);\n $stmt->execute();\n $sheetData = $stmt->fetchAll(PDO::FETCH_ASSOC);\n // echo \"<pre>\";print_r($sheetData);die;\n \n $templateSql = \"SELECT nm.sender,nm.sender_name,nm.cc,nm.subject,nt.template_text,nt.id FROM d_review_notification_template nt INNER JOIN h_review_notification_mail_users nm \"\n . \" ON nt.id = nm.notification_id WHERE nt.id=:type AND nm.status = :status\";\n $stmt = $conn->prepare($templateSql);\n $type = 8;\n $status = 1;\n $stmt->bindParam(':type', $type, $conn::PARAM_INT);\n $stmt->bindParam(':status', $status, $conn::PARAM_INT);\n $stmt->execute();\n $notificationsTemplates = $stmt->fetch(PDO::FETCH_ASSOC);\n // print_r($notificationsTemplates);die;\n //$sheetData = array_unique(array_column($sheetData,'assessment_id'));\n $assessmentSheetData = array();\n $rating_date = '';\n $first_mail_status = 0;\n $mail_sent_date = '';\n foreach($sheetData as $data) {\n // echo date(\"Y-m-d\");\n //echo date(\"Y-m-d\",strtotime(\"+5 day\", strtotime($data['rating_date'])));\n //$data['rating_date'] = date(\"Y-m-d\",$data['rating_date']);\n //$rating_date = \"2018-01-03\";\n //$data['rating_date'] = \"2018-01-03\";\n //$data['mail_sent_date'] = \"2018-01-01\";\n //echo date(\"Y-m-d\",strtotime(\"+5 day\", strtotime($data['rating_date'])));\n //$rating_date = isset($data['rating_date'])?$data['rating_date']:'';\n $first_mail_status = isset($data['first_mail_status'])?$data['first_mail_status']:0;\n $mail_sent_date = isset($data['mail_sent_date'])?$data['mail_sent_date']:'';\n if (!empty($data['edate']) && empty($first_mail_status) && strtotime(date(\"Y-m-d\")) == strtotime(\"+5 day\", strtotime($data['edate']))) {\n // print_r($data);die;\n $assessmentSheetData[$data['assessment_id']][] = $data;\n }else if (!empty($data['edate']) && !empty($first_mail_status) && strtotime(date(\"Y-m-d\")) == strtotime(\"+7 day\", strtotime($data['mail_sent_date']))) {\n // print_r($data);die;\n $assessmentSheetData[$data['assessment_id']][] = $data;\n }\n }\n //echo \"<pre>\";print_r($assessmentSheetData);die;\n if(!empty($assessmentSheetData)) {\n //$actionUrl = SITEURL . 'index.php?controller=assessment&action=reimSheetConfirmation';\n $actionUrl = SITEURL . 'cron/reviewApproveNotificationCron.php';\n $senderName = $notificationsTemplates['sender'];\n // $toEmail = '[email protected]';\n $toEmail = SHEET_TO_EMAIL;\n $toName = SHEET_TO_NAME;\n foreach($assessmentSheetData as $key=>$assessment ) {\n \n $mail_body = \"<form id='sheet_confirmation_from' method='post' action='$actionUrl'><table>\";\n $i = 1;\n foreach($assessment as $data) { \n\n $mail_body .= '<tr><td><span><b>'.$i.\". \".$data['user_name'].'</b></span></td>';\n $mail_body .= '<td><input autocomplete=\"off\" id=\"reim_sheet_yes_'.$data['user_id'].'\" type=\"radio\" value=\"1\" name=\"reim_sheet_'.$data['user_id'].'\" ><label><span>Yes</span></label>';\n $mail_body .= ' <input autocomplete=\"off\" id=\"reim_sheet_no_'.$data['user_id'].'\" type=\"radio\" value=\"0\" checked=\"checked\" name=\"reim_sheet_'.$data['user_id'].'\" ><label><span>No</span></label>';\n $mail_body .= '</td></tr>';\n $i++;\n } \n if($i>1){\n $mail_body .= \"<tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr><td><input type='submit' name='confirm_sheet' value='Confirm'></td></tr>\"; \n $mail_body .= \"<input type='hidden' name='assessment_id' value='$key'>\"; \n }\n $mail_body .= \"</form>\";\n \n $body = str_replace('_form_', $mail_body, $notificationsTemplates['template_text']);\n $school_name = $data['client_name'] . \", \" . $data['city_name'] . \", \" . $data['state_name'];\n $body = str_replace('_school_', $school_name, $body);\n $body = str_replace('_sdate_', $data['sdate'], $body);\n $body = str_replace('_edate_', $data['edate'], $body);\n $body = str_replace('_name_', $toName, $body);\n //$body = str_replace('_sdate_', date('d M Y', strtotime($data['sdate'])), $body);\n //$body = str_replace('_edate_', date('d M Y', strtotime($data['edate'])), $body);\n $mail_body = nl2br( $body);\n $subject = str_replace('_school_', $school_name, $notificationsTemplates['subject']);\n $sender = $notificationsTemplates['sender'];\n $senderName = $notificationsTemplates['sender_name'];\n $ccEmail = $notificationsTemplates['cc'];\n \n $ccName = '';\n //sendEmail($sender, $senderName, $toEmail, $toName, $ccEmail, $ccName, $subject, $mail_body, '')\n if (sendEmail($sender, $senderName, $toEmail, $toName, $ccEmail, $ccName, $subject, $mail_body, '')) {\n //echo \"yes\";\n foreach($assessment as $data){\n $sql = \"UPDATE h_user_review_reim_sheet_status SET first_mail_status = :mail_status,mail_sent_date = :mail_sent_date\n WHERE user_id = :user_id AND assessment_id = :assessment_id\";\n $stmt1 = $conn->prepare($sql);\n $status = 1;\n\n $date = date(\"Y-m-d h:i:s\");\n $stmt1->bindParam(':mail_status', $status, $conn::PARAM_INT);\n $stmt1->bindParam(':mail_sent_date', $date, $conn::PARAM_INT);\n $stmt1->bindParam(':user_id', $data['user_id'], $conn::PARAM_INT);\n $stmt1->bindParam(':assessment_id', $data['assessment_id'], $conn::PARAM_INT);\n $stmt1->execute();\n }\n // echo $stmt1->fullQuery; \n }\n //echo $mail_body;die;\n }\n \n \n }\n \n \n \n \n \n //$link = \"<a href=\" . SITEURL . 'index.php?controller=diagnostic&action=feedbackForm&assessment_id=' . $data['assessment_id'] . '&user_id=' . $data['user_id'] . '&des=received_feedback' . \">here</a>\";\n \n\n } catch (PDOException $e) {\n echo \"Error: \" . $e->getMessage();\n }\n $conn = null;\n }", "public function index()\n\t{\n\t\t//\n\t\tif (Auth::user()->type==4 || Auth::user()->type==3) {\n\t\t\t# code...\n\t\t\treturn redirect()->back(); \n\t\t}\n\t\t//dd($this->getTodayAppointments());\n\t\t$todays = $this->getTodayAppointments(); \n\t\t$upcomings = $this->getUpcomingAppointments(); \n\t\t$availables = $this->getAvailableBookings(); \n\t\t//dd($availables);\n\t\treturn view('appointments.addAppointment',compact('todays','upcomings','availables'));\n\t}", "public function getIndex()\n\t{\n\t\t\n\t\t//Get the user id of the currently logged in user\n $userId = Sentry::getUser()->id;\n //Current Date\n\t\t$day = date(\"Y-m-d\");\n //Get tasks list for the user\n\t\t$tasks = $this->timesheet->getIndex($userId);\n //Get the entries\n\t\t$entries = $this->timesheet->getEntries($day,$userId);\n //Current Week\n\t\t$week = $this->timesheet->getWeek($day);\n\t\treturn \\View::make('dashboard.timesheet.view')\n\t\t\t\t\t\t->with('week',$week)\n\t\t\t\t\t\t->with('selectedDate',$day)\n\t\t\t\t\t\t->with('entries', $entries)\n\t\t\t\t\t\t->with('tasks',$tasks);\n\t}", "function calender()\r\n\t{\r\n\t\t$this->erpm->auth();\r\n\t\t$user = $this->auth_pnh_employee();\r\n\t\t\r\n\t\t$role_id=$this->get_jobrolebyuid($user['userid']);\r\n\t\tif($role_id<=3)\r\n\t\t{\r\n\t\t$role_id = $this->get_emproleidbyuid($user['userid']);\r\n\t\t$emp_id = $this->get_empidbyuid($user['userid']);\r\n\t\t$sub_emp_ids=$this->get_subordinates($this,$role_id,$emp_id);\r\n\t\t$territory_list=$this->load_territoriesbyemp_id($emp_id,$role_id);\r\n\t\t$t_sub_emp_ids = $sub_emp_ids;\r\n\t\t$get_locationbyempid = $this->assigned_location($emp_id);\r\n\t\t\r\n\t\tarray_push($t_sub_emp_ids,$emp_id);\r\n\t \t$terry_id = $this->input->post('view_byterry');\r\n\t\t$emp_sub_list = array();\r\n\t\t$sql=\"SELECT a.employee_id,a.employee_id AS id,IFNULL(b.parent_emp_id ,0) AS parent,a.name as employee_name, a.name\r\n\t\t\t\tFROM m_employee_info a\r\n\t\t\t\tLEFT JOIN m_employee_rolelink b ON b.employee_id=a.employee_id and b.is_active = 1 \r\n\t\t\t\tWHERE a.is_suspended=0 and a.employee_id IN (\".implode(',',$t_sub_emp_ids).\")\r\n\t\t\t\";\r\n\t\t\t\t\r\n $res=$this->db->query($sql);\r\n\t\tif($res->num_rows())\r\n\t\t{\r\n\t\t\t$emp_sub_list=$res->result_array();\r\n\t\t}\r\n\t\t\r\n\t\t$task_list=$this->db->query('SELECT task,asgnd_town_id,assigned_to,b.town_name,c.name,a.on_date \r\n\t\t\t\t\t\t\t\t\t\t\tFROM pnh_m_task_info a\r\n\t\t\t\t\t\t\t\t\t\t\tJOIN pnh_towns b ON b.id=a.asgnd_town_id\r\n\t\t\t\t\t\t\t\t\t\t\tJOIN m_employee_info c ON c.employee_id=a.assigned_to\r\n\t\t\t\t\t\t\t\t\t\t\twhere a.assigned_to = ? and c.is_suspended=0',$emp_id)->result_array();\r\n\t\t$this->load->plugin('yentree_pi');//plugin to create employeeTree \r\n\t\t$emp_sub_list[0]['parent']=0;\r\n\t\t$data['emp_tree_config']=build_yentree($emp_sub_list);\r\n\t\t\r\n\t\tunset($emp_sub_list[0]);\r\n\t\t$emp_sub_list = array_values($emp_sub_list);\r\n\t\t\r\n\t\t$data['emp_sub_list']=$emp_sub_list;\r\n\t\t$data['get_locationbyempid']=$get_locationbyempid;\r\n\t\t$data['territory_list']=$territory_list;\r\n\t\t$data['task_list']=$task_list;\r\n\t\t$data['page']=\"calender\";\r\n\t\t$this->load->view(\"admin\",$data);\r\n\t\t\r\n\t\t}\r\n\t\telse \r\n\t\t\tshow_error(\"Access Denied\");\r\n\t}", "function waitingApproval($type=1, $pg=1, $limit=25) \t{\n\t\t$this->getMenu();\n\t\t$form = array();\n\t\tif($type==1) {\n\t\t\t$this->session->unset_userdata('client_no');\n\t\t\t$this->session->unset_userdata('client_name');\n\t\t\t$this->session->unset_userdata('project_no');\n\t\t}\n\t\telseif($type==2) {\n\t\t\t$this->session->unset_userdata('client_no');\n\t\t\t$this->session->unset_userdata('client_name');\n\t\t\t$this->session->unset_userdata('project_no');\n\t\t\t\n\t\t\tif($this->input->post('client_no')) \t\t$form['client_no'] = $this->input->post('client_no');\n\t\t\tif($this->input->post('client_name'))\t\t$form['client_name'] = $this->input->post('client_name');\n\t\t\tif($this->input->post('project_no'))\t\t$form['project_no'] = $this->input->post('project_no');\n\t\t\t$this->session->set_userdata($form);\n\t\t}\n\t\t\n\t\tif($this->session->userdata('client_no')) \t$form['client_no'] = $this->session->userdata('client_no');\n\t\tif($this->session->userdata('client_name')) $form['client_name'] = $this->session->userdata('client_name');\n\t\tif($this->session->userdata('project_no')) \t$form['project_no']\t = $this->session->userdata('project_no');\n\t\t\n\t\tif($limit) {\n\t\t\t$this->session->set_userdata('rpp', $limit);\n\t\t\t$this->rpp = $limit;\n\t\t}\n\t\t$limit\t\t= $limit ? $limit : $this->rpp;\n\t\t$this->data['request'] \t= $this->timesheetModel->getTimesheetRequest();\n\t\n\t\t$this->load->view('timesheet_waitingApproval',$this->data);\n\t\n\t}", "public function changeWeek(Request $request,$next_date){\n\n $start_date=Carbon::parse($next_date)->addDay(1);\n $date = Carbon::parse($next_date)->addDay(1);\n\n \n $end_date=Carbon::parse($start_date)->addDay(7);\n $this_week= $week_number = $end_date->weekOfYear;\n \n $period = CarbonPeriod::create($start_date, $end_date);\n \n\n $dates=[];\n foreach ($period as $date){\n $dates[] = $date->format('Y-m-d');\n \n }\n \n if (ApiBaseMethod::checkUrl($request->fullUrl())) {\n $user_id = $id;\n } else {\n $user = Auth::user();\n\n if ($user) {\n $user_id = $user->id;\n } else {\n $user_id = $request->user_id;\n }\n }\n\n $student_detail = SmStudent::where('user_id', $user_id)->first();\n //return $student_detail;\n $class_id = $student_detail->class_id;\n $section_id = $student_detail->section_id;\n\n $sm_weekends = SmWeekend::orderBy('order', 'ASC')->where('active_status', 1)->where('school_id',Auth::user()->school_id)->get();\n\n $class_times = SmClassTime::where('type', 'class')->where('academic_id', getAcademicId())->where('school_id',Auth::user()->school_id)->get();\n\n if (ApiBaseMethod::checkUrl($request->fullUrl())) {\n $data = [];\n $data['student_detail'] = $student_detail->toArray();\n $weekenD = SmWeekend::all();\n foreach ($weekenD as $row) {\n $data[$row->name] = DB::table('sm_class_routine_updates')\n ->select('sm_class_times.period', 'sm_class_times.start_time', 'sm_class_times.end_time', 'sm_subjects.subject_name', 'sm_class_rooms.room_no')\n ->join('sm_classes', 'sm_classes.id', '=', 'sm_class_routine_updates.class_id')\n ->join('sm_sections', 'sm_sections.id', '=', 'sm_class_routine_updates.section_id')\n ->join('sm_class_times', 'sm_class_times.id', '=', 'sm_class_routine_updates.class_period_id')\n ->join('sm_subjects', 'sm_subjects.id', '=', 'sm_class_routine_updates.subject_id')\n ->join('sm_class_rooms', 'sm_class_rooms.id', '=', 'sm_class_routine_updates.room_id')\n\n ->where([\n ['sm_class_routine_updates.class_id', $class_id], ['sm_class_routine_updates.section_id', $section_id], ['sm_class_routine_updates.day', $row->id],\n ])->where('sm_class_routine_updates.academic_id', getAcademicId())->where('sm_classesschool_id',Auth::user()->school_id)->get();\n }\n\n return ApiBaseMethod::sendResponse($data, null);\n }\n\n return view('lesson::student.student_lesson_plan', compact('dates','this_week','class_times', 'class_id', 'section_id', 'sm_weekends'));\n \n }", "function civicrm_api3_zoomevent_generatezoomattendance($params) {\n\t$allAttendees = [];\n\t$days = $params['days'];\n\t$pastDateTimeFull = new DateTime();\n\t$pastDateTimeFull = $pastDateTimeFull->modify(\"-\".$days.\" days\");\n\t$pastDate = $pastDateTimeFull->format('Y-m-d');\n\t$currentDate = date('Y-m-d');\n\n $apiResult = civicrm_api3('Event', 'get', [\n 'sequential' => 1,\n 'end_date' => ['BETWEEN' => [$pastDate, $currentDate]],\n ]);\n\t$allEvents = $apiResult['values'];\n\t$eventIds = [];\n\tforeach ($allEvents as $key => $value) {\n\t\t$eventIds[] = $value['id'];\n\t}\n\tforeach ($eventIds as $eventId) {\n\t\tCRM_Core_Error::debug_var('eventId', $eventId);\n\t\t$list = CRM_CivirulesActions_Participant_AddToZoom::getZoomAttendeeOrAbsenteesList($eventId);\n\t\tif(empty($list)){\n\t\t\tCRM_Core_Error::debug_var('No participants found in the zoom for the event Id: ', $eventId);\n\t\t\tcontinue;\n\t\t}\n\t\t$webinarId = getWebinarID($eventId);\n\t\t$meetingId = getMeetingID($eventId);\n\t\tif(!empty($webinarId)){\n\t\t\t$attendees = selectAttendees($list, $eventId, \"Webinar\");\n\t\t}elseif(!empty($meetingId)){\n\t\t\t$attendees = selectAttendees($list, $eventId, \"Meeting\");\n\t\t}\n\t\tupdateAttendeesStatus($attendees, $eventId);\n\t\t$allAttendees[$eventId] = $attendees;\n\t}\n\t$return['allAttendees'] = $allAttendees;\n\n\treturn civicrm_api3_create_success($return, $params, 'Event');\n}", "public function week()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$disable = array(\n\t\t\t'categories',\n\t\t\t'category_fields',\n\t\t\t'custom_fields',\n\t\t\t'member_data',\n\t\t\t'pagination',\n\t\t\t'trackbacks'\n\t\t);\n\n\t\t$params = array(\n\t\t\tarray(\n\t\t\t\t'name' => 'category',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'site_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'min_value' => 1,\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'default' => $this->data->get_site_id()\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'calendar_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'calendar_name',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'event_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'event_name',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'event_limit',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'status',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'default' => 'open'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'date_range_start',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'date'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'time_range_start',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'time',\n\t\t\t\t'default' => '0000'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'time_range_end',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'time',\n\t\t\t\t'default' => '2400'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'enable',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'default' => '',\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'allowed_values' => $disable\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'first_day_of_week',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'default' => $this->first_day_of_week\n\t\t\t)\n\t\t);\n\n\t\t//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t// -------------------------------------\n\t\t// Need to modify the starting date?\n\t\t// -------------------------------------\n\n\t\t$this->first_day_of_week = $this->P->value('first_day_of_week');\n\n\t\tif ($this->P->value('date_range_start') === FALSE)\n\t\t{\n\t\t\t$this->P->set('date_range_start', $this->CDT->datetime_array());\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->CDT->change_date(\n\t\t\t\t$this->P->value('date_range_start', 'year'),\n\t\t\t\t$this->P->value('date_range_start', 'month'),\n\t\t\t\t$this->P->value('date_range_start', 'day')\n\t\t\t);\n\t\t}\n\n\t\t$drs_dow = $this->P->value('date_range_start', 'day_of_week');\n\n\t\tif ($drs_dow != $this->first_day_of_week)\n\t\t{\n\t\t\tif ($drs_dow > $this->first_day_of_week)\n\t\t\t{\n\t\t\t\t$offset = ($drs_dow - $this->first_day_of_week);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$offset = (7 - ($this->first_day_of_week - $drs_dow));\n\t\t\t}\n\n\t\t\t$this->P->set('date_range_start', $this->CDT->add_day(-$offset));\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Define parameters specific to this calendar view\n\t\t// -------------------------------------\n\n\t\t$this->CDT->change_ymd($this->P->value('date_range_start', 'ymd'));\n\t\t$this->P->set('date_range_end', $this->CDT->add_day(6));\n\t\t$this->P->set('pad_short_weeks', FALSE);\n\n\t\t// -------------------------------------\n\t\t// Define our tagdata\n\t\t// -------------------------------------\n\n\t\t$find = array(\n\t\t\t'EVENTS_PLACEHOLDER',\n\t\t\t'{/',\n\t\t\t'{',\n\t\t\t'}'\n\t\t);\n\n\t\t$replace = array(\n\t\t\tee()->TMPL->tagdata,\n\t\t\tLD.T_SLASH,\n\t\t\tLD,\n\t\t\tRD\n\t\t);\n\n\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t$find,\n\t\t\t$replace,\n\t\t\t$this->view(\n\t\t\t\t'week.html',\n\t\t\t\tarray(),\n\t\t\t\tTRUE,\n\t\t\t\t$this->sc->addon_theme_path . 'templates/week.html'\n\t\t\t)\n\t\t);\n\n\t\t// -------------------------------------\n\t\t// Tell TMPL what we're up to\n\t\t// -------------------------------------\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'events'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['events'] = TRUE;\n\t\t}\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'display_each_hour'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['display_each_hour'] = TRUE;\n\t\t}\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'display_each_day'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['display_each_day'] = TRUE;\n\t\t}\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'display_each_week'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['display_each_week'] = TRUE;\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// If you build it, they will know what's going on.\n\t\t// -------------------------------------\n\n\t\t$this->parent_method = __FUNCTION__;\n\n\t\treturn $this->build_calendar();\n\t}", "public function index()\n {\n $attendanceSettings = AttendanceSetting::first();\n $openDays = json_decode($attendanceSettings->office_open_days);\n $this->startDate = Carbon::today()->timezone($this->global->timezone)->startOfMonth();\n $this->endDate = Carbon::today()->timezone($this->global->timezone);\n $this->employees = User::allEmployees();\n $this->userId = User::first()->id;\n\n $this->totalWorkingDays = $this->startDate->diffInDaysFiltered(function(Carbon $date) use ($openDays){\n foreach($openDays as $day){\n if($date->dayOfWeek == $day){\n return $date;\n }\n }\n }, $this->endDate);\n $this->daysPresent = Attendance::countDaysPresentByUser($this->startDate, $this->endDate, $this->userId);\n $this->daysLate = Attendance::countDaysLateByUser($this->startDate, $this->endDate, $this->userId);\n $this->halfDays = Attendance::countHalfDaysByUser($this->startDate, $this->endDate, $this->userId);\n return view('admin.attendance.index', $this->data);\n }", "public function show_report_service()\n { \n $this->load->model(\"swm/frontend/M_swm_attend\", \"msa\");\n $rs_service_data = $this->msa->get_time_us_attend(getNowDate(),getNowDate());//startDate, endDate, startAge, endAge, state\n $data['rs_service_data'] = $rs_service_data->result();\n $this->output(\"swm/frontend/v_report_service\", $data, true);\n }", "function approveTimesheet() \t{\n\t\t$this->getMenu() ;\n\t\t$id = $this->input->post('id');\n\t\t$this->timesheetModel->saveApproveTimesheet($id);\n\t\tredirect ('timesheet');\n\t}", "public function reportTotalClassHeldSummaryView(Request $request)\n {\n $from_date = trim($request->from); \n $from = date (\"Y-m-d\", strtotime($from_date));\n $explode = explode('-',$from);\n $from_year = $explode[0];\n $get_current_day = date(\"l\",strtotime($from));\n $current_year = date('Y');\n if($get_current_day =='Saturday'){\n $current_day = 1 ;\n }\n if($get_current_day =='Sunday'){\n $current_day = 2 ;\n }\n if($get_current_day =='Monday'){\n $current_day = 3 ;\n }\n if($get_current_day =='Tuesday'){\n $current_day = 4 ;\n }\n if($get_current_day =='Wednesday'){\n $current_day = 5 ;\n }\n if($get_current_day =='Thursday'){\n $current_day = 6 ;\n }\n if($get_current_day =='Friday'){\n $current_day = 7 ;\n }\n if($from > $this->rcdate1){\n echo 'f1';\n exit();\n }\n // get door holiday\n $holiday_count = DB::table('holiday')->where('holiday_date',$from)->count();\n if($holiday_count > 0){\n echo 'f2';\n exit();\n }\n if($from_year != $current_year){\n echo 'f3';\n exit();\n }\n // get all shift\n $result = DB::table('shift')->get();\n return view('view_report.reportTotalClassHeldSummaryView')->with('result',$result)->with('get_current_day',$get_current_day)->with('from',$from)->with('current_day',$current_day)->with('from_year',$from_year);\n }", "public function index() {\n //\n $currentDate = \\Helpers\\DateHelper::getLocalUserDate(date('Y-m-d H:i:s')); \n $day = \\Helpers\\DateHelper::getDay($currentDate);\n $weekDays = \\Helpers\\DateHelper::getWeekDays($currentDate, $day); \n $workouts = \\App\\Schedule::getScheduledWorkouts($weekDays);\n \n return view('user/schedule', ['number_of_day' => $day, 'current_date' => $currentDate, 'weekDays' => $weekDays])\n ->with('target_areas', json_decode($this->target_areas, true))\n ->with('movements', json_decode($this->movements, true))\n ->with('workouts', $workouts);\n }", "public function changeWeek($next_date)\n{\n try {\n $start_date=Carbon::parse($next_date)->addDay(1);\n $date = Carbon::parse($next_date)->addDay(1);\n\n\n $end_date=Carbon::parse($start_date)->addDay(7);\n $this_week= $week_number = $end_date->weekOfYear;\n\n $period = CarbonPeriod::create($start_date, $end_date);\n\n\n $dates=[];\n foreach ($period as $date){\n $dates[] = $date->format('Y-m-d');\n\n }\n\n $login_id = Auth::user()->id;\n $teachers = SmStaff::where('active_status', 1)->where('user_id',$login_id)->where('role_id', 4)->where('school_id', Auth::user()->school_id)->first();\n\n $user = Auth::user();\n $class_times = SmClassTime::where('academic_id', getAcademicId())->where('school_id', Auth::user()->school_id)->orderBy('period', 'ASC')->get();\n $teacher_id =$teachers->id;\n $sm_weekends = SmWeekend::where('school_id', Auth::user()->school_id)->orderBy('order', 'ASC')->where('active_status', 1)->get();\n\n $data = [];\n $data['message'] = 'operation Successful';\n return ApiBaseMethod::sendResponse($data, null);\n\n } catch (Exception $e) {\n return ApiBaseMethod::sendError('operation Failed');\n }\n\n}", "public function index()\n {\n if (Auth::user()) {\n if (!Usersubmissionstatus::checkQuarterSubmission()) {\n $employee = ['id' => Auth::user()->id];\n if (Usersubmissionstatus::checkDraftSubmission()) {\n $employee['quarter_id'] = Quarter::getRunningQuarter()->id;\n $employee['submission_status_id'] = config('constant.status.SUBMISSION_DRAFT');\n return view('evaluation-already-submitted', ['draft' => TRUE, 'employee' => $employee]);\n }\n\n return view('evaluation', ['data' => Department::getDetails(), 'employee_id' => $employee['id']]);\n }\n else {\n return view('evaluation-already-submitted', ['draft' => FALSE]);\n }\n } \n else {\n return redirect()->guest('login'); \n }\n }", "function admin_getCalculations($userId,$appointmentTime){\n pr($this->request->data); exit;\n }", "function ical() {\n \t$filter = ProjectUsers::getVisibleTypesFilter($this->logged_user, array(PROJECT_STATUS_ACTIVE), get_completable_project_object_types());\n if($filter) {\n $objects = ProjectObjects::find(array(\n \t\t 'conditions' => array($filter . ' AND completed_on IS NULL AND state >= ? AND visibility >= ?', STATE_VISIBLE, $this->logged_user->getVisibility()),\n \t\t 'order' => 'priority DESC',\n \t\t));\n\n \t\trender_icalendar(lang('Global Calendar'), $objects, true);\n \t\tdie();\n } elseif($this->request->get('subscribe')) {\n \tflash_error(lang('You are not able to download .ics file because you are not participating in any of the active projects at the moment'));\n \t$this->redirectTo('ical_subscribe');\n } else {\n \t$this->httpError(HTTP_ERR_NOT_FOUND);\n } // if\n }", "function alltimeAction() {\n\t\t$this->getModel()->setPage($this->getPageFromRequest());\n\n\t\t$oView = new userView($this);\n\t\t$oView->showAlltimeLeaderboard();\n\t}", "public function add(Request $req, $account)\n {\n $currentDate = (new Datetime())->format('Y-m-d');\n \n $schedule = Schedule::whereDate('start_date','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->get();\n //Add timesheet\n $timesheet = new Timesheet();\n $timesheet->start_time = date('Y-m-d H:i:s', strtotime($req->start_time));\n $timesheet->end_time = date(\"Y-m-d H:i:s\", strtotime($req->start_time) + $req->seconds);\n $timesheet->member_id = Auth::user()->id;\n $timesheet->activity = 'in';\n $timesheet->status = 'approved';\n\n $schedule_hours = 0;\n if(count($schedule)){\n $timesheet->schedule_id = $schedule[0]->id;\n //Update attendance on schedule-to investigate follow $schedule_hours\n $schedule_date1 = new Datetime($schedule[0]->start_date.' '.$schedule[0]->start_time.':00:00');\n $schedule_date2 = new Datetime($schedule[0]->end_date.' '.$schedule[0]->end_time.':00:00');\n $schedule_diff = $schedule_date1->diff($schedule_date2);\n $schedule_hours = $schedule_hours + (($schedule_diff->h * 60) + $schedule_diff->i);\n\n }\n $timesheet->save();\n $timesheets = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->get();\n //Get total time worked\n $hours = 0;\n foreach ($timesheets as $timesheet) {\n $date1 = new Datetime($timesheet->start_time);\n $date2 = new Datetime($timesheet->end_time);\n $diff = $date2->diff($date1);\n\n $hours = $hours + (($diff->h * 60) + $diff->i);\n }\n if(count($schedule)){\n $schedule_updated = Schedule::find($schedule[0]->id);\n\n //More than 30 min still to finish\n if($schedule_hours-$hours > 30 && $schedule_hours != 0){\n $schedule_updated->attendance = 'working';\n }elseif ($schedule_hours-$hours <= 30 || $schedule_hours-$hours <= 0) {\n $schedule_updated->attendance = 'attended';\n }//Less than 5 min to finish\n //late\n $first_timesheet = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->first();\n $date1 = new Datetime($schedule_updated->start_date.' '.$schedule_updated->start_time.':00:00');\n $date2 = new Datetime($first_timesheet->start_time);\n $diff = $date2->diff($date1);\n $late = (($diff->h * 60) + $diff->i);\n // dd($late);\n if($late > 10){\n $schedule_updated->attendance = 'late';\n }\n //\n $schedule_updated->save();\n }\n //Get total breaks\n $breaks = 0;\n $first_timesheet = Timesheet::whereDate('start_time','=',$currentDate)->first();\n $last_timesheet = Timesheet::whereDate('start_time','=',$currentDate)->latest()->first();\n if($first_timesheet){\n $date1 = new Datetime($first_timesheet->start_time);\n $date2 = new Datetime($last_timesheet->end_time);\n $diff = $date2->diff($date1);\n $breaks = (($diff->h * 60) + $diff->i) - $hours;\n }\n\n $worked = $this->hoursandmins($hours);\n $breaks = $this->hoursandmins($breaks);\n // First Punch In in current day\n $first_punch_in = Timesheet::whereDate('start_time','=',$currentDate)->first();\n\n // return view('attendance/index', ['timesheets'=>$timesheets, 'schedule'=>$schedule, 'first_punch_in'=>$first_punch_in, 'worked'=>$worked, 'breaks'=>$breaks, 'first_timesheet'=>$first_timesheet, 'last_timesheet'=>$last_timesheet]);\n\n \t$activities = view('attendance/ajax/activities', ['timesheets'=>$timesheets])->render();\n $statistics = view('attendance/ajax/statistics', ['schedule'=>$schedule, 'worked'=>$worked])->render();\n\n \treturn response()->json(['activities'=>$activities, 'statistics'=>$statistics]);\n\n }", "public function timesheetAction(Employee $admin)\n {\n\t\t$validateForm = $this->createValidateForm($admin->getEmployee());\n\t\t$this->setActivity($admin->getEmployee()->getName().\" \".$admin->getEmployee()->getFirstname().\" timesheets are consulted\");\n $em = $this->getDoctrine()->getManager();\n $aTimesheets = $em->getRepository('BoAdminBundle:Timesheet')->getTsByEmployee($admin->getEmployee(),2);\n return $this->render('BoAdminBundle:Admin:timesheet.html.twig', array(\n 'employee' => $admin->getEmployee(),\n\t\t\t'validate_form' => $validateForm->createView(),\n\t\t\t'timesheets'=>$aTimesheets,\n\t\t\t'pm'=>\"personnel\",\n\t\t\t'sm'=>\"admin\",\n ));\n }", "public function getIndex()\n {\n \t$dateRange = Carbon::now();\n \n\n //Get past Last Month = 4 Week Lag\n $endIniLag = $dateRange->copy()->subWeek(4);\n $dateNow = Carbon::now();\n\n //Get past Last Month = 5 Week Lag\n $endPastLag = $dateRange->copy()->subWeek(5);\n $iniPastLag = $dateRange->copy()->subWeek(1);\n\n \t //Get past Last week = Week 1\n $endIniWeek1 = $dateNow;\n $IniWeek1 = $dateRange->copy()->subWeek(4);\n\n //Get past 2 week = Week 2\n $endIniWeek2 = $dateRange->copy()->subWeek(1);\n $IniWeek2 = $dateRange->copy()->subWeek(5);\n\n //Get past 3 week = Week 3\n $endIniWeek3 = $dateRange->copy()->subWeek(2);\n $IniWeek3 = $dateRange->copy()->subWeek(6);\n\n //Get past 4 week = Week 4\n $endIniWeek4 = $dateRange->copy()->subWeek(3);\n $IniWeek4 = $dateRange->copy()->subWeek(7);\n\n $user_id=Auth::user()->id;\n\n \n //Count variables\n $countEmployee=0;\n $countPortfolio=0;\n $countEvaluation=0;\n\n $job_portfolio=array();\n $job_site=array();\n $manager_id=0;\n $manager_list=array();\n \n \n //Square Feet\n $sumSquareFeet=0; \n\n\n $job_list_str=\"\";\n $job_list_array=array();\n $comment_list=array();\n\n \t\t\t\t\t\t\n //Get user role\n $role_user=Auth::user()->getRole();\n\n $total_expense_lag=0;\n $total_bill_lag=0;\n $total_labor_tax_lag=0;\n $total_budget_monthly_lag=0;\n\n $total_expense_lag_past=0;\n $total_bill_lag_past=0;\n $total_labor_tax_lag_past=0;\n $total_budget_monthly_lag_past=0;\n\n $total_expense_week1=1;\n $total_labor_tax_week1=0;\n $total_budget_monthly_week1=0;\n\n $total_expense_week2=0;\n $total_labor_tax_week2=0;\n $total_budget_monthly_week2=0;\n\n $total_expense_week3=0;\n $total_labor_tax_week3=0;\n $total_budget_monthly_week3=0;\n\n $total_expense_week4=0;\n $total_labor_tax_week4=0;\n $total_budget_monthly_week4=0;\n\n $total_budget_monthly=0;\n\n $total_evaluation=0;\n $total_evaluation_no=0;\n $total_evaluation_user=0;\n\n $total_evaluation_past=0;\n $total_evaluation_no_past=0;\n\n $total_evaluation_param=array(\n 'param1' => 0,\n 'param2' => 0,\n 'param3' => 0,\n 'param4' => 0,\n 'param5' => 0,\n );\n\n $total_supplies=array(\n 'expense' => 0,\n 'budget_monthly' => 0,\n );\n\n $total_supplies_past=array(\n 'expense' => 0,\n 'budget_monthly' => 0,\n );\n\n $total_salies_wages_amount=array(\n 'expense' => 0,\n 'labor_tax' => 0,\n );\n\n $total_salies_wages_amount_past=array(\n 'expense' => 0,\n 'labor_tax' => 0,\n );\n\n $total_hours=array(\n 'used' => 0,\n 'budget' => 0,\n );\n\n $total_hours_past=array(\n 'used' => 0,\n 'budget' => 0,\n );\n\n \n if($role_user==Config::get('roles.AREA_MANAGER')){\n \n $manager_id=Auth::user()->getManagerId();\n\n //List of porfolio\n $job_portfolio = DB::table('job')\n ->where('manager', $manager_id)\n ->where('is_parent', 0)\n ->get();\n\n\n //List Site \n $job_site = DB::table('job')\n ->where('manager', $manager_id)\n ->where('is_parent', 1)\n ->get();\n\n //Count Employee \n $countEmployee = User::CountManagerEmployee($manager_id);\n\n //Count Portfolio\n $countPortfolio = Job::CountPortfolio($manager_id);\n\n\n //4 Week Lag - Ini\n $jobList = DB::table('expense')\n ->select(DB::raw('DISTINCT(expense.job_number) as \"job_number\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '>', $endIniLag->format('Y-m-d'))\n ->where('posting_date', '<=', $dateNow->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get(); \n\n foreach ($jobList as $value) {\n $job_list_array[]=$value->job_number; \n } \n\n $job_list_str=implode(\",\", $job_list_array); \n\n\n $sumSquareFeetQuery = DB::table('job')\n ->select(DB::raw('SUM(square_feet) as \"total_feet\"'))\n ->whereIn('job_number', $job_list_array)\n ->get();\n\n foreach ($sumSquareFeetQuery as $value) {\n $sumSquareFeet=$value->total_feet; \n }\n\n\n $query_expense_lag = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '>', $endIniLag->format('Y-m-d'))\n ->where('posting_date', '<=', $dateNow->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_expense_lag as $value) {\n $total_expense_lag=$value->total_amount; \n }\n\n $query_bill_lag = DB::table('billable_hours')\n ->select(DB::raw('SUM((regular_hours+overtime_hours)*pay_rate*1.19) as \"total_amount\"'))\n ->join('job', 'billable_hours.job_number', '=', 'job.job_number')\n ->where('work_date', '>', $endIniWeek3->format('Y-m-d'))\n ->where('work_date', '<=', $dateNow->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->get();\n\n foreach ($query_bill_lag as $value) {\n $total_bill_lag=$value->total_amount; \n }\n\n $query_labor_tax_lag = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('date', '>', $endIniLag->format('Y-m-d'))\n ->where('date', '<=', $dateNow->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_lag as $value) {\n $total_labor_tax_lag=$value->total_amount; \n }\n\n $query_budget_monthly_lag = DB::table('budget_monthly')\n ->select(DB::raw('SUM(((monthly_budget*12)/52)*4) as \"total_amount\"'))\n ->join('account', 'budget_monthly.account_number', '=', 'account.account_number')\n ->join('job', 'budget_monthly.job_number', '=', 'job.job_number')\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_budget_monthly_lag as $value) {\n $total_budget_monthly_lag=$value->total_amount; \n }\n\n //4 Week Lag - End\n\n //4 Week Lag Past - Ini\n\n $query_expense_lag_past= DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '>', $endPastLag->format('Y-m-d'))\n ->where('posting_date', '<=', $iniPastLag->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_expense_lag_past as $value) {\n $total_expense_lag_past=$value->total_amount; \n }\n\n $query_bill_lag_past = DB::table('billable_hours')\n ->select(DB::raw('SUM((regular_hours+overtime_hours)*pay_rate*1.19) as \"total_amount\"'))\n ->join('job', 'billable_hours.job_number', '=', 'job.job_number')\n ->where('work_date', '>', $endIniWeek3->format('Y-m-d'))\n ->where('work_date', '<=', $iniPastLag->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->get();\n\n foreach ($query_bill_lag_past as $value) {\n $total_bill_lag_past=$value->total_amount; \n }\n\n\n $query_labor_tax_lag_past = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('date', '>', $endPastLag->format('Y-m-d'))\n ->where('date', '<=', $iniPastLag->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_lag_past as $value) {\n $total_labor_tax_lag_past=$value->total_amount; \n if($total_labor_tax_lag_past==0 || $total_labor_tax_lag_past==null)\n $total_labor_tax_lag_past=0; \n }\n\n $query_budget_monthly_lag_past = DB::table('budget_monthly')\n ->select(DB::raw('SUM(((monthly_budget*12)/52)*4) as \"total_amount\"'))\n ->join('account', 'budget_monthly.account_number', '=', 'account.account_number')\n ->join('job', 'budget_monthly.job_number', '=', 'job.job_number')\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_budget_monthly_lag_past as $value) {\n $total_budget_monthly_lag_past=$value->total_amount; \n if($total_budget_monthly_lag_past==0 || $total_budget_monthly_lag_past==null)\n $total_budget_monthly_lag_past=0; \n }\n\n //4 Week Past Lag - End \n\n\n // Monthly budget calculation \n $query_budget_monthly = DB::table('budget_monthly')\n ->select(DB::raw('SUM(((monthly_budget*12)/52)*4) as \"total_amount\"'))\n ->join('account', 'budget_monthly.account_number', '=', 'account.account_number')\n ->join('job', 'budget_monthly.job_number', '=', 'job.job_number')\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_budget_monthly as $value) {\n $total_budget_monthly=$value->total_amount; \n }\n\n\n //Last Week = Week 1 - Ini\n $total_expense_week1=$total_expense_lag; \n if($total_expense_week1==0 || $total_expense_week1==null)\n $total_expense_week1=0;\n \n $total_labor_tax_week1=$total_labor_tax_lag; \n if($total_labor_tax_week1==0 || $total_labor_tax_week1==null)\n $total_labor_tax_week1=0;\n \n\n //Last Week = Week 1 - End\n\n //Week 2 - Ini\n\n $total_expense_week2=$total_expense_lag_past; \n if($total_expense_week2==0 || $total_expense_week2==null)\n $total_expense_week2=0; \n \n $total_labor_tax_week2=$total_labor_tax_lag_past; \n if($total_labor_tax_week2==0 || $total_labor_tax_week2==null)\n $total_labor_tax_week2=0; \n \n //Week 2 - End\n\n //Week 3 - Ini \n $query_expense_week3 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '>', $IniWeek3->format('Y-m-d'))\n ->where('posting_date', '<=', $endIniWeek3->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_expense_week3 as $value) {\n $total_expense_week3=$value->total_amount; \n if($total_expense_week3==0 || $total_expense_week3==null)\n $total_expense_week3=0; \n } \n\n $query_labor_tax_week3 = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('labor_tax.date', '>', $IniWeek3->format('Y-m-d'))\n ->where('labor_tax.date', '<=', $endIniWeek3->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_week3 as $value) {\n $total_labor_tax_week3=$value->total_amount; \n if($total_labor_tax_week3==0 || $total_labor_tax_week3==null)\n $total_labor_tax_week3=0; \n }\n\n //Week 3 - End\n\n //Week 4 - Ini \n $query_expense_week4 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '>', $IniWeek4->format('Y-m-d'))\n ->where('posting_date', '<=', $endIniWeek4->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_expense_week4 as $value) {\n $total_expense_week4=$value->total_amount; \n if($total_expense_week4==0 || $total_expense_week4==null)\n $total_expense_week4=0; \n } \n\n $query_labor_tax_week4 = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('labor_tax.date', '>', $IniWeek4->format('Y-m-d'))\n ->where('labor_tax.date', '<=', $endIniWeek4->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_week4 as $value) {\n $total_labor_tax_week4=$value->total_amount; \n if($total_labor_tax_week4==0 || $total_labor_tax_week4==null)\n $total_labor_tax_week4=0; \n }\n\n //Week 4 - End\n\n\n //Last Week = Supplies(Account Number=4090) Week 1 & 2 - Ini\n // Monthly budget calculation Supplies \n $query_budget_monthly = DB::table('budget_monthly')\n ->select(DB::raw('SUM(((monthly_budget*12)/52)*4) as \"total_amount\"'))\n ->join('account', 'budget_monthly.account_number', '=', 'account.account_number')\n ->join('job', 'budget_monthly.job_number', '=', 'job.job_number')\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->where('budget_monthly.account_number', 4090)\n ->get();\n\n foreach ($query_budget_monthly as $value) {\n $total_supplies['budget_monthly']=$value->total_amount; \n }\n\n $query_expense_week1 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '>', $IniWeek1->format('Y-m-d'))\n ->where('posting_date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->where('expense.account_number', 4090)\n ->get();\n\n foreach ($query_expense_week1 as $value) {\n $total_supplies['expense']=$value->total_amount; \n if($total_supplies['expense']==0 || $total_supplies['expense']==null)\n $total_supplies['expense']=0;\n }\n\n\n $query_expense_week2 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '>', $IniWeek2->format('Y-m-d'))\n ->where('posting_date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->where('expense.account_number', 4090)\n ->get();\n\n foreach ($query_expense_week2 as $value) {\n $total_supplies_past['expense']=$value->total_amount; \n if($total_supplies_past['expense']==0 || $total_supplies_past['expense']==null)\n $total_supplies_past['expense']=0;\n }\n\n\n //Last Week = Week 1 & 2 Supplies - End \n\n\n //Last Week = Labor & Tax(Account Number=4000, 4275, 4278, 4277, 4280, 4276 ) Week 1 & 2 - Ini\n // Monthly budget calculation Supplies \n $query_labor_tax_week1 = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('labor_tax.date', '>', $IniWeek1->format('Y-m-d'))\n ->where('labor_tax.date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_week1 as $value) {\n $total_salies_wages_amount['labor_tax']=$value->total_amount; \n if($total_salies_wages_amount['labor_tax']==0 || $total_salies_wages_amount['labor_tax']==null)\n $total_salies_wages_amount['labor_tax']=0;\n }\n\n $query_expense_week1 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek1->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->whereIn('expense.account_number', [4000, 4001, 4003, 4004, 4005, 4007, 4010, 4011, 4020, 4275, 4276, 4277, 4278, 4279, 4280])\n ->get();\n\n foreach ($query_expense_week1 as $value) {\n $total_salies_wages_amount['expense']=$value->total_amount; \n if($total_salies_wages_amount['expense']==0 || $total_salies_wages_amount['expense']==null)\n $total_salies_wages_amount['expense']=0;\n }\n\n $query_labor_tax_week2 = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('labor_tax.date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('labor_tax.date', '>', $IniWeek2->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_week2 as $value) {\n $total_salies_wages_amount_past['labor_tax']=$value->total_amount; \n if($total_salies_wages_amount_past['labor_tax']==0 || $total_salies_wages_amount_past['labor_tax']==null)\n $total_salies_wages_amount_past['labor_tax']=0;\n }\n\n\n $query_expense_week2 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek2->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->whereIn('expense.account_number', [4000, 4001, 4003, 4004, 4005, 4007, 4010, 4011, 4020, 4275, 4276, 4277, 4278, 4279, 4280])\n ->get();\n\n foreach ($query_expense_week2 as $value) {\n $total_salies_wages_amount_past['expense']=$value->total_amount; \n if($total_salies_wages_amount_past['expense']==0 || $total_salies_wages_amount_past['expense']==null)\n $total_salies_wages_amount_past['expense']=0;\n }\n\n\n //Last Week = Week 1 & 2 Supplies - End \n\n\n //Last Week = Budget - Billable Hours - Ini\n $query_hours = DB::table('billable_hours')\n ->select(DB::raw('SUM(regular_hours) as \"total_amount\"'))\n ->join('job', 'billable_hours.job_number', '=', 'job.job_number')\n ->where('work_date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('work_date', '>', $IniWeek1->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->get();\n\n foreach ($query_hours as $value) {\n $total_hours['used']=$value->total_amount; \n }\n\n $query_hours = DB::table('budget')\n ->select(DB::raw('SUM(hours) as \"total_amount\"'))\n ->join('job', 'budget.job_number', '=', 'job.job_number')\n ->where('date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('date', '>', $IniWeek1->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->get();\n\n foreach ($query_hours as $value) {\n $total_hours['budget']=$value->total_amount; \n }\n\n //Last Week = Budget - Billable Hours - End \n\n //Past Week = Budget - Billable Hours - Ini\n $query_hours = DB::table('billable_hours')\n ->select(DB::raw('SUM(regular_hours) as \"total_amount\"'))\n ->join('job', 'billable_hours.job_number', '=', 'job.job_number')\n ->where('work_date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('work_date', '>', $IniWeek2->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->get();\n\n foreach ($query_hours as $value) {\n $total_hours_past['used']=$value->total_amount; \n }\n\n $query_hours = DB::table('budget')\n ->select(DB::raw('SUM(hours) as \"total_amount\"'))\n ->join('job', 'budget.job_number', '=', 'job.job_number')\n ->where('date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('date', '>', $IniWeek2->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->get();\n\n foreach ($query_hours as $value) {\n $total_hours_past['budget']=$value->total_amount; \n }\n\n //Past Week = Budget - Billable Hours - End \n \n\n \n /*Evaluation functions - INI*/\n $query_evaluation = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1)+SUM(parameter2)+SUM(parameter3)+SUM(parameter4)+SUM(parameter5) as \"total_amount\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation as $value) {\n $total_evaluation=$value->total_amount; \n }\n\n $query_evaluation = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1) as \"param1\", SUM(parameter2) as \"param2\", SUM(parameter3) as \"param3\", SUM(parameter4) as \"param4\",SUM(parameter5) as \"param5\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation as $value) {\n $total_evaluation_param['param1']=$value->param1;\n $total_evaluation_param['param2']=$value->param2;\n $total_evaluation_param['param3']=$value->param3; \n $total_evaluation_param['param4']=$value->param4;\n $total_evaluation_param['param5']=$value->param5;\n\n }\n\n $query_evaluation_past = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1)+SUM(parameter2)+SUM(parameter3)+SUM(parameter4)+SUM(parameter5) as \"total_amount\"'))\n ->where('created_at', '>', $endPastLag)\n ->where('created_at', '<=', $iniPastLag)\n ->where('evaluate_user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation_past as $value) {\n $total_evaluation_past=$value->total_amount; \n }\n\n\n //Number of evaluations\n $total_evaluation_no = DB::table('evaluation')\n ->select(DB::raw('id'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', Auth::user()->id)\n ->count();\n\n //Number of evaluations Past\n $total_evaluation_no_past = DB::table('evaluation')\n ->select(DB::raw('id'))\n ->where('created_at', '>', $endPastLag)\n ->where('created_at', '<=', $iniPastLag)\n ->where('evaluate_user_id', Auth::user()->id)\n ->count();\n\n //Number of users evaluated \n $query_evaluation_user = DB::table('evaluation')\n ->select(DB::raw('COUNT(DISTINCT(evaluate_user_id)) as \"total\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation_user as $value) {\n $total_evaluation_user=$value->total; \n }\n\n\n /*Evaluation Functions - END*/\n\n }elseif($role_user==Config::get('roles.DIR_POS')){\n $manager_list = DB::table('users')\n -> where('manager_id', '!=', 0)\n -> where('active', 1)\n -> orderBy('manager_id', 'asc')\n -> get();\n\n $manager_list_array = array();\n\n foreach ($manager_list as $manager) {\n $manager_list_array[]=$manager->manager_id;\n }\n\n //Add Corporate and None Managers - 90 Corporate - 91 None\n $manager_list_array[]=90;\n $manager_list_array[]=91;\n\n\n //List of porfolio\n $job_portfolio = DB::table('job')\n ->whereIn('manager', $manager_list_array)\n ->where('is_parent', 0)\n ->get();\n\n\n //List Site \n $job_site = DB::table('job')\n ->whereIn('manager', $manager_list_array)\n ->where('is_parent', 1)\n ->get();\n\n //Count Managers Employee \n $countEmployee = User::CountManagerListEmployee($manager_list_array);\n\n //Count Same role\n $countEmployeeRole = User::CountRoleListEmployee(Config::get('roles.DIR_POS'), Auth::user()->id);\n\n //Count Managers\n $countManager = User::CountManagerList();\n\n $countEvaluation= $countEmployeeRole+ $countManager;\n\n\n //Count Portfolio\n $countPortfolio = Job::CountPortfolioList($manager_list_array);\n\n\n //4 Week Lag - Ini\n $jobList = DB::table('expense')\n ->select(DB::raw('DISTINCT(expense.job_number) as \"job_number\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '>', $endIniLag->format('Y-m-d'))\n ->where('posting_date', '<=', $dateNow->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get(); \n\n foreach ($jobList as $value) {\n $job_list_array[]=$value->job_number; \n } \n\n $job_list_str=implode(\",\", $job_list_array); \n\n\n $sumSquareFeetQuery = DB::table('job')\n ->select(DB::raw('SUM(square_feet) as \"total_feet\"'))\n ->whereIn('job_number', $job_list_array)\n ->get();\n\n foreach ($sumSquareFeetQuery as $value) {\n $sumSquareFeet=$value->total_feet; \n }\n\n\n $query_expense_lag = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '>', $endIniLag->format('Y-m-d'))\n ->where('posting_date', '<=', $dateNow->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_expense_lag as $value) {\n $total_expense_lag=$value->total_amount; \n }\n\n $query_bill_lag = DB::table('billable_hours')\n ->select(DB::raw('SUM((regular_hours+overtime_hours)*pay_rate*1.19) as \"total_amount\"'))\n ->join('job', 'billable_hours.job_number', '=', 'job.job_number')\n ->where('work_date', '>', $endIniWeek3->format('Y-m-d'))\n ->where('work_date', '<=', $dateNow->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->get();\n\n foreach ($query_bill_lag as $value) {\n $total_bill_lag=$value->total_amount; \n }\n\n\n $query_labor_tax_lag = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('date', '>', $endIniLag->format('Y-m-d'))\n ->where('date', '<=', $dateNow->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_lag as $value) {\n $total_labor_tax_lag=$value->total_amount; \n }\n\n $query_budget_monthly_lag = DB::table('budget_monthly')\n ->select(DB::raw('SUM(((monthly_budget*12)/52)*4) as \"total_amount\"'))\n ->join('account', 'budget_monthly.account_number', '=', 'account.account_number')\n ->join('job', 'budget_monthly.job_number', '=', 'job.job_number')\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_budget_monthly_lag as $value) {\n $total_budget_monthly_lag=$value->total_amount; \n }\n\n //4 Week Lag - End\n\n //4 Week Lag Past - Ini\n\n $query_expense_lag_past= DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '>', $endPastLag->format('Y-m-d'))\n ->where('posting_date', '<=', $iniPastLag->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_expense_lag_past as $value) {\n $total_expense_lag_past=$value->total_amount; \n }\n\n $query_bill_lag_past = DB::table('billable_hours')\n ->select(DB::raw('SUM((regular_hours+overtime_hours)*pay_rate*1.19) as \"total_amount\"'))\n ->join('job', 'billable_hours.job_number', '=', 'job.job_number')\n ->where('work_date', '>', $endIniWeek3->format('Y-m-d'))\n ->where('work_date', '<=', $iniPastLag->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->get();\n\n foreach ($query_bill_lag_past as $value) {\n $total_bill_lag_past=$value->total_amount; \n }\n\n\n $query_labor_tax_lag_past = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('date', '>', $endPastLag->format('Y-m-d'))\n ->where('date', '<=', $iniPastLag->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_lag_past as $value) {\n $total_labor_tax_lag_past=$value->total_amount; \n if($total_labor_tax_lag_past==0 || $total_labor_tax_lag_past==null)\n $total_labor_tax_lag_past=0; \n }\n\n $query_budget_monthly_lag_past = DB::table('budget_monthly')\n ->select(DB::raw('SUM(((monthly_budget*12)/52)*4) as \"total_amount\"'))\n ->join('account', 'budget_monthly.account_number', '=', 'account.account_number')\n ->join('job', 'budget_monthly.job_number', '=', 'job.job_number')\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_budget_monthly_lag_past as $value) {\n $total_budget_monthly_lag_past=$value->total_amount; \n if($total_budget_monthly_lag_past==0 || $total_budget_monthly_lag_past==null)\n $total_budget_monthly_lag_past=0; \n }\n\n //4 Week Past Lag - End \n\n\n // Monthly budget calculation \n $query_budget_monthly = DB::table('budget_monthly')\n ->select(DB::raw('SUM(((monthly_budget*12)/52)*4) as \"total_amount\"'))\n ->join('account', 'budget_monthly.account_number', '=', 'account.account_number')\n ->join('job', 'budget_monthly.job_number', '=', 'job.job_number')\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_budget_monthly as $value) {\n $total_budget_monthly=$value->total_amount; \n }\n\n \n //Last Week = Week 1 - Ini\n \n $total_expense_week1=$total_expense_lag; \n if($total_expense_week1==0 || $total_expense_week1==null)\n $total_expense_week1=0;\n \n $total_labor_tax_week1=$total_labor_tax_lag; \n if($total_labor_tax_week1==0 || $total_labor_tax_week1==null)\n $total_labor_tax_week1=0;\n \n //Last Week = Week 1 - End\n\n //Week 2 - Ini \n \n \n $total_expense_week2=$total_expense_lag_past; \n if($total_expense_week2==0 || $total_expense_week2==null)\n $total_expense_week2=0; \n \n $total_labor_tax_week2=$total_labor_tax_lag_past; \n if($total_labor_tax_week2==0 || $total_labor_tax_week2==null)\n $total_labor_tax_week2=0; \n \n\n //Week 2 - End\n\n //Week 3 - Ini \n $query_expense_week3 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek3->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek3->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_expense_week3 as $value) {\n $total_expense_week3=$value->total_amount; \n if($total_expense_week3==0 || $total_expense_week3==null)\n $total_expense_week3=0; \n } \n\n $query_labor_tax_week3 = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('labor_tax.date', '<=', $endIniWeek3->format('Y-m-d'))\n ->where('labor_tax.date', '>', $IniWeek3->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_week3 as $value) {\n $total_labor_tax_week3=$value->total_amount; \n if($total_labor_tax_week3==0 || $total_labor_tax_week3==null)\n $total_labor_tax_week3=0; \n }\n\n //Week 3 - End\n\n //Week 4 - Ini \n $query_expense_week4 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek4->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek4->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_expense_week4 as $value) {\n $total_expense_week4=$value->total_amount; \n if($total_expense_week4==0 || $total_expense_week4==null)\n $total_expense_week4=0; \n } \n\n $query_labor_tax_week4 = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('labor_tax.date', '<=', $endIniWeek4->format('Y-m-d'))\n ->where('labor_tax.date', '>', $IniWeek4->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_week4 as $value) {\n $total_labor_tax_week4=$value->total_amount; \n if($total_labor_tax_week4==0 || $total_labor_tax_week4==null)\n $total_labor_tax_week4=0; \n }\n\n //Week 4 - End\n\n\n //Last Week = Supplies(Account Number=4090) Week 1 & 2 - Ini\n // Monthly budget calculation Supplies \n $query_budget_monthly = DB::table('budget_monthly')\n ->select(DB::raw('SUM(((monthly_budget*12)/52)*4) as \"total_amount\"'))\n ->join('account', 'budget_monthly.account_number', '=', 'account.account_number')\n ->join('job', 'budget_monthly.job_number', '=', 'job.job_number')\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->where('budget_monthly.account_number', 4090)\n ->get();\n\n foreach ($query_budget_monthly as $value) {\n $total_supplies['budget_monthly']=$value->total_amount; \n }\n\n $query_expense_week1 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek1->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->where('expense.account_number', 4090)\n ->get();\n\n foreach ($query_expense_week1 as $value) {\n $total_supplies['expense']=$value->total_amount; \n if($total_supplies['expense']==0 || $total_supplies['expense']==null)\n $total_supplies['expense']=0;\n }\n\n\n $query_expense_week2 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek2->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->where('expense.account_number', 4090)\n ->get();\n\n foreach ($query_expense_week2 as $value) {\n $total_supplies_past['expense']=$value->total_amount; \n if($total_supplies_past['expense']==0 || $total_supplies_past['expense']==null)\n $total_supplies_past['expense']=0;\n }\n\n\n //Last Week = Week 1 & 2 Supplies - End \n\n\n //Last Week = Labor & Tax(Account Number=4000, 4275, 4278, 4277, 4280, 4276 ) Week 1 & 2 - Ini\n // Monthly budget calculation Supplies \n $query_labor_tax_week1 = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('labor_tax.date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('labor_tax.date', '>', $IniWeek1->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_week1 as $value) {\n $total_salies_wages_amount['labor_tax']=$value->total_amount; \n if($total_salies_wages_amount['labor_tax']==0 || $total_salies_wages_amount['labor_tax']==null)\n $total_salies_wages_amount['labor_tax']=0;\n }\n\n $query_expense_week1 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek1->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->whereIn('expense.account_number', [4000, 4001, 4003, 4004, 4005, 4007, 4010, 4011, 4020, 4275, 4276, 4277, 4278, 4279, 4280])\n ->get();\n\n foreach ($query_expense_week1 as $value) {\n $total_salies_wages_amount['expense']=$value->total_amount; \n if($total_salies_wages_amount['expense']==0 || $total_salies_wages_amount['expense']==null)\n $total_salies_wages_amount['expense']=0;\n }\n\n $query_labor_tax_week2 = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('labor_tax.date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('labor_tax.date', '>', $IniWeek2->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_week2 as $value) {\n $total_salies_wages_amount_past['labor_tax']=$value->total_amount; \n if($total_salies_wages_amount_past['labor_tax']==0 || $total_salies_wages_amount_past['labor_tax']==null)\n $total_salies_wages_amount_past['labor_tax']=0;\n }\n\n\n $query_expense_week2 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek2->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->whereIn('expense.account_number', [4000, 4001, 4003, 4004, 4005, 4007, 4010, 4011, 4020, 4275, 4276, 4277, 4278, 4279, 4280])\n ->get();\n\n foreach ($query_expense_week2 as $value) {\n $total_salies_wages_amount_past['expense']=$value->total_amount; \n if($total_salies_wages_amount_past['expense']==0 || $total_salies_wages_amount_past['expense']==null)\n $total_salies_wages_amount_past['expense']=0;\n }\n\n\n //Last Week = Week 1 & 2 Supplies - End \n\n\n //Last Week = Budget - Billable Hours - Ini\n $query_hours = DB::table('billable_hours')\n ->select(DB::raw('SUM(regular_hours) as \"total_amount\"'))\n ->join('job', 'billable_hours.job_number', '=', 'job.job_number')\n ->where('work_date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('work_date', '>', $IniWeek1->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->get();\n\n foreach ($query_hours as $value) {\n $total_hours['used']=$value->total_amount; \n }\n\n $query_hours = DB::table('budget')\n ->select(DB::raw('SUM(hours) as \"total_amount\"'))\n ->join('job', 'budget.job_number', '=', 'job.job_number')\n ->where('date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('date', '>', $IniWeek1->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->get();\n\n foreach ($query_hours as $value) {\n $total_hours['budget']=$value->total_amount; \n }\n\n //Last Week = Budget - Billable Hours - End \n\n //Past Week = Budget - Billable Hours - Ini\n $query_hours = DB::table('billable_hours')\n ->select(DB::raw('SUM(regular_hours) as \"total_amount\"'))\n ->join('job', 'billable_hours.job_number', '=', 'job.job_number')\n ->where('work_date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('work_date', '>', $IniWeek2->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->get();\n\n foreach ($query_hours as $value) {\n $total_hours_past['used']=$value->total_amount; \n }\n\n $query_hours = DB::table('budget')\n ->select(DB::raw('SUM(hours) as \"total_amount\"'))\n ->join('job', 'budget.job_number', '=', 'job.job_number')\n ->where('date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('date', '>', $IniWeek2->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->get();\n\n foreach ($query_hours as $value) {\n $total_hours_past['budget']=$value->total_amount; \n }\n\n //Past Week = Budget - Billable Hours - End \n\n /*Evaluation functions - INI*/\n $query_evaluation = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1)+SUM(parameter2)+SUM(parameter3)+SUM(parameter4)+SUM(parameter5) as \"total_amount\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation as $value) {\n $total_evaluation=$value->total_amount; \n }\n\n $query_evaluation = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1) as \"param1\", SUM(parameter2) as \"param2\", SUM(parameter3) as \"param3\", SUM(parameter4) as \"param4\",SUM(parameter5) as \"param5\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation as $value) {\n $total_evaluation_param['param1']=$value->param1;\n $total_evaluation_param['param2']=$value->param2;\n $total_evaluation_param['param3']=$value->param3; \n $total_evaluation_param['param4']=$value->param4;\n $total_evaluation_param['param5']=$value->param5;\n\n }\n\n $query_evaluation_past = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1)+SUM(parameter2)+SUM(parameter3)+SUM(parameter4)+SUM(parameter5) as \"total_amount\"'))\n ->where('created_at', '>', $endPastLag)\n ->where('created_at', '<=', $iniPastLag)\n ->where('evaluate_user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation_past as $value) {\n $total_evaluation_past=$value->total_amount; \n }\n\n\n //Number of evaluations\n $total_evaluation_no = DB::table('evaluation')\n ->select(DB::raw('id'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', Auth::user()->id)\n ->count();\n\n //Number of evaluations Past\n $total_evaluation_no_past = DB::table('evaluation')\n ->select(DB::raw('id'))\n ->where('created_at', '>', $endPastLag)\n ->where('created_at', '<=', $iniPastLag)\n ->where('evaluate_user_id', Auth::user()->id)\n ->count();\n\n //Number of users evaluated \n $query_evaluation_user = DB::table('evaluation')\n ->select(DB::raw('COUNT(DISTINCT(evaluate_user_id)) as \"total\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation_user as $value) {\n $total_evaluation_user=$value->total; \n }\n\n\n /*Evaluation Functions - END*/ \n\n\n }elseif($role_user==Config::get('roles.SUPERVISOR') || $role_user==Config::get('roles.AREA_SUPERVISOR')){\n\n $primary_job=Auth::user()->gePrimayJob();\n\n $job_query = DB::table('job')\n ->where('job_number', $primary_job)\n ->get();\n\n foreach ($job_query as $value) {\n $manager_id=$value->manager; \n } \n\n\n //Count Employee \n $countEmployee = User::CountManagerEmployee($manager_id);\n $countEmployee--;\n\n /*Evaluation functions - INI*/\n $query_evaluation = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1)+SUM(parameter2)+SUM(parameter3)+SUM(parameter4)+SUM(parameter5) as \"total_amount\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation as $value) {\n $total_evaluation=$value->total_amount; \n }\n\n $query_evaluation = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1) as \"param1\", SUM(parameter2) as \"param2\", SUM(parameter3) as \"param3\", SUM(parameter4) as \"param4\",SUM(parameter5) as \"param5\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation as $value) {\n $total_evaluation_param['param1']=$value->param1;\n $total_evaluation_param['param2']=$value->param2;\n $total_evaluation_param['param3']=$value->param3; \n $total_evaluation_param['param4']=$value->param4;\n $total_evaluation_param['param5']=$value->param5;\n\n }\n\n $query_evaluation_past = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1)+SUM(parameter2)+SUM(parameter3)+SUM(parameter4)+SUM(parameter5) as \"total_amount\"'))\n ->where('created_at', '>', $endPastLag)\n ->where('created_at', '<=', $iniPastLag)\n ->where('evaluate_user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation_past as $value) {\n $total_evaluation_past=$value->total_amount; \n }\n\n\n //Number of evaluations\n $total_evaluation_no = DB::table('evaluation')\n ->select(DB::raw('id'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', Auth::user()->id)\n ->count();\n\n //Number of evaluations Past\n $total_evaluation_no_past = DB::table('evaluation')\n ->select(DB::raw('id'))\n ->where('created_at', '>', $endPastLag)\n ->where('created_at', '<=', $iniPastLag)\n ->where('evaluate_user_id', Auth::user()->id)\n ->count();\n\n //Number of users evaluated \n $query_evaluation_user = DB::table('evaluation')\n ->select(DB::raw('COUNT(DISTINCT(evaluate_user_id)) as \"total\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation_user as $value) {\n $total_evaluation_user=$value->total; \n }\n\n\n /*Evaluation Functions - END*/\n }elseif($role_user==Config::get('roles.EMPLOYEE')){\n /*Evaluation functions - INI*/\n $query_evaluation = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1)+SUM(parameter2)+SUM(parameter3)+SUM(parameter4)+SUM(parameter5) as \"total_amount\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation as $value) {\n $total_evaluation=$value->total_amount; \n }\n\n $query_evaluation = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1) as \"param1\", SUM(parameter2) as \"param2\", SUM(parameter3) as \"param3\", SUM(parameter4) as \"param4\",SUM(parameter5) as \"param5\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation as $value) {\n $total_evaluation_param['param1']=$value->param1;\n $total_evaluation_param['param2']=$value->param2;\n $total_evaluation_param['param3']=$value->param3; \n $total_evaluation_param['param4']=$value->param4;\n $total_evaluation_param['param5']=$value->param5;\n\n }\n\n $query_evaluation_past = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1)+SUM(parameter2)+SUM(parameter3)+SUM(parameter4)+SUM(parameter5) as \"total_amount\"'))\n ->where('created_at', '>', $endPastLag)\n ->where('created_at', '<=', $iniPastLag)\n ->where('evaluate_user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation_past as $value) {\n $total_evaluation_past=$value->total_amount; \n }\n\n\n //Number of evaluations\n $total_evaluation_no = DB::table('evaluation')\n ->select(DB::raw('id'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', Auth::user()->id)\n ->count();\n\n //Number of evaluations Past\n $total_evaluation_no_past = DB::table('evaluation')\n ->select(DB::raw('id'))\n ->where('created_at', '>', $endPastLag)\n ->where('created_at', '<=', $iniPastLag)\n ->where('evaluate_user_id', Auth::user()->id)\n ->count();\n\n //Number of users evaluated \n $query_evaluation_user = DB::table('evaluation')\n ->select(DB::raw('COUNT(DISTINCT(evaluate_user_id)) as \"total\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation_user as $value) {\n $total_evaluation_user=$value->total; \n }\n\n\n /*Evaluation Functions - END*/ \n\n $comment_list = DB::table('evaluation')\n ->select(DB::raw('*')) \n ->where('description', '!=', '')\n ->where('evaluate_user_id', Auth::user()->id)\n ->orderBy('created_at', 'desc')\n ->paginate(100); \n }\n\n //Normalize data\n\n if($sumSquareFeet==0)\n $sumSquareFeet=1;\n \n\n //New Calculations\n $calc_val=$total_budget_monthly_lag+$total_labor_tax_lag;\n if($calc_val==0)\n $calc_val=1;\n $lag_differencial=(($total_expense_lag+$total_bill_lag)*100)/($calc_val);\n\n $budget_cant=$total_budget_monthly_lag_past+$total_labor_tax_lag_past;\n if($budget_cant==0)\n $budget_cant=1;\n $lag_differencial_past=(($total_expense_lag_past+$total_bill_lag_past)*100)/($budget_cant);\n\n\n\n $expense_calc_week1=$total_expense_week1+$total_bill_lag;\n $expense_calc_week2=$total_expense_week2+$total_bill_lag_past;\n if($expense_calc_week2==0 || $expense_calc_week2==null)\n $expense_calc_week2=1;\n \n $cost_past_week=$lag_differencial_past-$lag_differencial;\n\n $expense_week1=$total_expense_week1+$total_bill_lag;\n $expense_week2=$total_expense_week2+$total_bill_lag_past;\n $expense_week3=$total_expense_week3;\n $expense_week4=$total_expense_week4;\n\n $budget_week1=$total_budget_monthly+$total_labor_tax_week1;\n $budget_week2=$total_budget_monthly+$total_labor_tax_week2;\n $budget_week3=$total_budget_monthly+$total_labor_tax_week3;\n $budget_week4=$total_budget_monthly+$total_labor_tax_week4;\n\n\n $budget_cant=$budget_week1;\n if($budget_cant==0)\n $budget_cant=1;\n $lag_past_week=($expense_week1*100)/($budget_cant);\n\n //$cost_past_week=$total_expense_week1;\n\n\n /*Announcement list - INI*/\n switch ($role_user) {\n case '4':\n $permission_filter='1____';\n break;\n case '6':\n $permission_filter='_1___';\n break;\n case '5':\n $permission_filter='__1__';\n break;\n case '8':\n $permission_filter='___1_';\n break;\n case '9':\n $permission_filter='____1';\n break;\n default:\n $permission_filter='2____';\n break;\n }\n\n $result_announce = DB::table('announce')\n ->select(DB::raw('*'))\n ->where('status', 1)\n ->where('permission', 'like' , $permission_filter)\n ->orderBy('closing_date', 'desc')\n ->paginate(50);\n\n /*Announcement list - END*/\n\n return view('metrics.page', [\n 'user_id' => $user_id, \n 'count_employee' => $countEmployee,\n 'count_portfolio' => $countPortfolio, \n 'count_evaluation' => $countEvaluation, \n 'sum_square_feet' => $sumSquareFeet,\n 'role_user' => $role_user,\n 'manager_list' => $manager_list, \n 'job_portfolio' => $job_portfolio,\n 'job_site' => $job_site, \n 'job_list_str' => $job_list_str,\n 'job_portfolio_id' => 0,\n 'manager_id' => $manager_id,\n 'total_expense_lag' => $total_expense_lag,\n 'total_labor_tax_lag' => $total_labor_tax_lag,\n 'total_budget_monthly_lag' => $total_budget_monthly_lag,\n 'total_bill_lag' => $total_bill_lag,\n 'cost_past_week' => $cost_past_week,\n 'lag_differencial' => $lag_differencial,\n 'lag_differencial_past' => $lag_differencial_past,\n 'lag_past_week' => $lag_past_week,\n 'expense_week1' => $expense_week1,\n 'expense_week2' => $expense_week2,\n 'expense_week3' => $expense_week3,\n 'expense_week4' => $expense_week4,\n 'budget_week1' => $budget_week1,\n 'budget_week2' => $budget_week2,\n 'budget_week3' => $budget_week3,\n 'budget_week4' => $budget_week4,\n 'total_evaluation' => $total_evaluation,\n 'total_evaluation_no' => $total_evaluation_no,\n 'total_evaluation_past' => $total_evaluation_past,\n 'total_evaluation_no_past' => $total_evaluation_no_past,\n 'total_evaluation_user' => $total_evaluation_user,\n 'total_evaluation_param' => $total_evaluation_param,\n 'total_supplies' => $total_supplies,\n 'total_supplies_past' => $total_supplies_past,\n 'total_salies_wages_amount' => $total_salies_wages_amount,\n 'total_salies_wages_amount_past' => $total_salies_wages_amount_past,\n 'total_hours' => $total_hours,\n 'total_hours_past' => $total_hours_past,\n 'result_announce' => $result_announce,\n 'comment_list' => $comment_list \n ]);\n }", "public function meeting_schedule(){\n\t\tif($this->session->userdata('logged_in')==\"\")\n\t\t\theader(\"Location: \".$this->config->base_url().\"Login\");\n\t\t$this->cache_update();\n\t\t$this->load->model('Crud_model');\n\t\t$this->check_privilege(17);\n\t\t$this->load->driver('cache',array('adapter' => 'file'));\n\t\t$this->load->model('profile_model');\n\t\t$da = $this->profile_model->get_profile_info($this->session->userdata('uid'));\n\t\t//$this->load->view('dashboard/navbar');\n\t\t$u_type = array('var'=>$this->cache->get('Active_status'.$this->session->userdata('loginid'))['user_type_id_fk']);\n\t\t$noti = array('meeting'=>$this->profile_model->meeting_notification());\n\t\t$noti = array('meeting'=>$this->profile_model->meeting_notification());\n\t\t$u_type['notification'] = $noti;\n\t\t$u_type['noti1']=$this->profile_model->custom_notification();\n\t\t$this->load->view('dashboard/navbar',$u_type);\n\t\t$this->load->view('dashboard/sidebar',$da);\n $this->load->model('Admin_model');\n\t\t$row = $this->Admin_model->previous_meeting_schedule();\n\t\tif($row){\n \t$data=array(\n 'start_time'=> mdate('%Y-%M-%d %H:%i',strtotime('+2 hours', strtotime( $row->start_time ))),\n 'end_time'=> mdate('%Y-%M-%d %H:%i',strtotime('-2 hours', strtotime( $row->end_time ))),\n\t\t\t);\n\t\t}else{\n\t\t\t$data=array('start_time'=>'No Previous Meeting','end_time'=>'No Previous Meeting');\n\t\t}\n\t\t$this->load->view('schedule',$data);\n\t\t$this->db->trans_off();\n\t $this->db->trans_strict(FALSE);\n\t $this->db->trans_start();\n $this->Crud_model->audit_upload($this->session->userdata('loginid'),\n current_url(),\n 'Meeting Schedule Page visited',\n 'Custom Message here');\n $this->db->trans_complete();\n\t\t$this->load->view('dashboard/footer');\n\t}", "public function index()\n {\n $user = $this->getUser();\n $from = $this->request->getStringParam('from', date('Y-m-d'));\n $to = $this->request->getStringParam('to', date('Y-m-d', strtotime('next week')));\n $timetable = $this->timetable->calculate($user['id'], new DateTime($from), new DateTime($to));\n\n $this->response->html($this->helper->layout->user('timetable:timetable/index', array(\n 'user' => $user,\n 'timetable' => $timetable,\n 'values' => array(\n 'from' => $from,\n 'to' => $to,\n 'plugin' => 'timetable',\n 'controller' => 'timetable',\n 'action' => 'index',\n 'user_id' => $user['id'],\n ),\n )));\n }", "public function showNonStandardAction()\r\n {\r\n\t\t$startDate = $_POST['startDate'];\r\n\t\t$endDate = $_POST['endDate'];\r\n\t\t\r\n\t\t$period = 'od '.$startDate.' do '.$endDate.'';\r\n\t\t\r\n\t\tstatic::show($startDate, $endDate, $period);\r\n }", "public function showMainRequestForm() {\r\n $this->config->showPrinterFriendly = true;\r\n echo '<h2>Complete additional fields</h2>';\r\n echo 'Starting Date: ';\r\n displayDateSelect('useDate', 'date_1', $this->useDate, true, true);\r\n if(!$this->isEditing){\r\n echo ' Through date (optional): ';\r\n displayDateSelect('endDate', 'date_2', $this->endDate);\r\n } else{\r\n echo '<input type=\"hidden\" name=\"endDate\" value=\"\" />';\r\n }\r\n echo '<br/><br/>';\r\n echo 'Start time: ';\r\n showTimeSelector(\"begTime\", $this->begTime1, $this->begTime2);\r\n if ($this->subTypeInfo['LIMIT_8_12'] == '1' || $this->typeID == '2') {\r\n //Limit is enabled or Type is Personal\r\n if (!empty($this->shiftHours)) {\r\n if ($this->shiftHourRadio == \"8\" || $this->shiftHours == \"8\") {\r\n echo \" How long is your shift? <input type='radio' name='shiftHour' value='8' CHECKED>8 Hours\";\r\n echo \"<input type='radio' name='shiftHour' value='12'>12 Hours<br/>\";\r\n } elseif ($this->shiftHourRadio == \"12\" || $this->shiftHours == \"12\") {\r\n echo \" How long is your shift? <input type='radio' name='shiftHour' value='8'>8 Hours\";\r\n echo \"<input type='radio' name='shiftHour' value='12' CHECKED>12 Hours<br/>\";\r\n } else {\r\n echo \" How long is your shift? <input type='radio' name='shiftHour' value='8'>8 Hours\";\r\n echo \"<input type='radio' name='shiftHour' value='12'>12 Hours\";\r\n echo ' <font color=\"red\">Error in shift selection! </font><br/>';\r\n }\r\n } else {\r\n echo \" How long is your shift? <input type='radio' name='shiftHour' value='8'>8 Hours\";\r\n echo \"<input type='radio' name='shiftHour' value='12'>12 Hours<br/>\";\r\n }\r\n } else {\r\n echo ' End time: ';\r\n showTimeSelector(\"endTime\", $this->endTime1, $this->endTime2);\r\n }\r\n if (!empty($this->shiftHours))\r\n echo ' Total Hours: ' . $this->shiftHours;\r\n\r\n echo '<br/><br/>';\r\n echo 'Comment: <textarea rows=\"3\" cols=\"40\" name=\"empComment\" >' . $this->empComment . '</textarea>';\r\n echo '<br/><br/>';\r\n if(!empty($this->submitDate)){\r\n echo '<font color=\"darkred\">Submitted on '. $this->submitDate .' by '.$this->auditName.'</font>';\r\n echo '<br/><br/>';\r\n }\r\n\r\n if (!$this->isEditing) {\r\n echo '<input type=\"submit\" name=\"submitBtn\" value=\"Submit for Approval\">';\r\n } else { \r\n if($this->status != \"APPROVED\"){ \r\n echo '<input type=\"hidden\" name=\"reqID\" value=\"'.$this->reqID.'\" />';\r\n echo '<input type=\"submit\" name=\"updateReqBtn\" value=\"Update Request ' . $this->reqID . '\">';\r\n }\r\n echo '<input type=\"submit\" name=\"duplicateReqBtn\" value=\"Duplicate Request\" />';\r\n }\r\n }", "public function activity($start, $end, $customer) {\n//\t\tdebug(func_get_args());die;date('Y-m-d H:i:s', $end)\n\t\t\n\t\t$start = date('Y-m-d H:i:s', $start);\n\t\t$end = date('Y-m-d H:i:s', $end);\n\t\t//note here\n if(isset($this->request->params['ext']) && $this->request->params['ext'] == 'pdf'){\n\t\t\t$this->layout = 'default';\n\t\t}\n\t\t$this->report['customer'] = $customer;\n\t\t\n\t\t$this->discoverOldestLogTime(); // sets report['startLimit']\n\t\t$this->report['firstTime'] = strtotime($start);\n\t\tif ($this->report['firstTime'] < $this->report['startLimit']) {\n\t\t\t$this->report['firstTime'] = $this->report['startLimit'];\n\t\t}\n\t\t\n\t\t$this->report['firstSnapshot'] = strtotime(date('F j, Y', $this->report['firstTime']) . ' - 1 month');\n\t\t\n\t\t$this->discoverNewestLogTime(); // sets report['endLimit']\n\t\t$this->report['finalTime'] = strtotime($end);\n\t\tif ($this->report['finalTime'] >= $this->report['endLimit']) {\n\t\t\t$this->report['finalTime'] = $this->report['endLimit'];\n\t\t\t$this->logInventoryTotals();\n\t\t}\n\t\t\n\t\t$this->report['firstYear'] = date('Y', $this->report['firstTime']);\n\t\t$this->report['firstWeek'] = date('W', $this->report['firstTime']);\n\t\t$this->report['finalYear'] = date('Y', $this->report['finalTime']);\n\t\t$this->report['finalWeek'] = date('W', $this->report['finalTime']);\n\t\t\n\t\t$this->report['finalWeekTime'] = strtotime(\"+{$this->report['finalWeek']} week 1/1/{$this->report['finalYear']}\");\n\t\t$this->report['firstWeekTime'] = strtotime(\"+{$this->report['firstWeek']} week 1/1/{$this->report['firstYear']}\");\n\t\t\n\t\t$this->report['items'] = $this->Item->Catalog->allItemsForCustomer($this->report['customer']);\n\t\tif ($this->report['items']) {\n\t\t\t$this->logsInWeekRange();\n\t\t\t$this->logEntriesInDateRange();\n\t\t\t$this->snapshotEntriesInDateRange();\n\t\t} else {\n\t\t\t$this->Session->setFlash('There are no items for this customer.');\n\t\t}\n\t\t$this->set('customers', $this->User->getPermittedCustomers($this->Auth->user('id')));\n\t\t$this->set('customerName', $this->Item->Catalog->User->discoverName($customer));\n\t\t$this->set('report', $this->report);\n\t\t$this->set(compact('start', 'end', 'customer'));\n\t\tif ($this->request->params['action'] == 'activity') {\n\t\t\t$this->render('activity');\n\t\t} else {\n\t\t\treturn;\n\t\t}\n//\t\tdebug($this->report['activityEntries']);\n//\t\tdebug($this->report);\n\t}", "public function addWorklog($timesheetId, Request $request){\n\n }", "function getCalender(Request $request){\n\n $auth_id=Auth::user()->id;\n\n if((isset($request->start) && $request->start!='') && (isset($request->end) && $request->end!='')){\n \n /*\n * start_date is getting only date like 2017-11-11 in 2017-11-11T9:15:25\n * end_date is getting only date like 2017-11-17 in 2017-11-17T12:35:35 \n */\n $start_date= str_replace(strstr($request->start, 'T') , \"\", $request->start);\n\n $end_date= str_replace(strstr($request->end, 'T') , \"\", $request->end);\n\n $array=array();\n\n /*\n * get_time is getting the record according to user logged id \n */\n $get_time=CalendarAvailability::select('start_time','end_time','reocuuring')\n ->where('user_id',$auth_id)\n ->get();\n \n /*\n * $array[] is getting all dates between two dates 2017-11-11 to 2017-11-17\n * 2017-11-11,\n * 2017-11-12,\n * 2017-11-13,\n * 2017-11-14,\n * 2017-11-15,\n * 2017-11-16,\n * 2017-11-17\n */\n for ($x=strtotime($start_date);$x<strtotime($end_date);$x+=86400){\n \n $array[]=date('Y-m-d',$x);\n\n }\n\n /*\n * $get_time[0]->reocuuring==0 the sunday,saturday schedule is not display\n * $get_time[0]->reocuuring==1 the sunday schedule is not display\n * $get_time[0]->reocuuringis not equal to 0 or 1 then schedule is display for all days means daily\n */\n if(isset($get_time[0]->reocuuring) && $get_time[0]->reocuuring=='0'){\n unset($array[0]);\n unset($array[6]);\n }elseif (isset($get_time[0]->reocuuring) && $get_time[0]->reocuuring=='1') {\n unset($array[0]);\n }\n \n /*\n * get_holiday_days is getting the holiday dates user logged id and all dates \n */\n $get_holiday_days=CalendarHoliday::select('holiday_date')\n ->where('user_id',$auth_id)\n ->whereIn('holiday_date', $array)\n ->get();\n \n /*\n * $array is gettting that dates which is not in CalenderHoliday table\n */\n for ($i=0; $i <count($get_holiday_days) ; $i++) {\n if(array_search ($get_holiday_days[$i]->holiday_date, $array)){\n $array = array_diff($array, [$get_holiday_days[$i]->holiday_date]);\n }\n \n }\n\n /*\n * $arr is getting start date with start time and end date with end time \n */\n $arr = array();\n foreach ($array as $key => $value) {\n $start=$value.'T'.$get_time[0]->start_time;\n $end=$value.'T'.$get_time[0]->end_time;\n $arr[] = array('start' =>$start ,'end' =>$end);\n }\n\n echo json_encode($arr);die;\n \n }\n \n return view('calendar.get_calender');\n }", "function retrieve_trailing_weekly_guest_list_reservation_requests(){\n\t\t$this->CI->load->model('model_users_promoters', 'users_promoters', true);\n\t\treturn $this->CI->users_promoters->retrieve_trailing_weekly_guest_list_reservation_requests($this->promoter->up_id);\n\t}", "public function index()\n\t{\n\n $n = Input::has('n') ? Input::get('n'): 1 ;\n $day = date('w');\n $member = Confide::user()->youthMember ;\n\n $week_start = date('Y-m-d', strtotime('+'.($n*7-$day+1).' days'));\n\n\n $week_end = date('Y-m-d', strtotime('+'.(6-$day+$n*7).' days'));\n $shifts = $member->shifts()->whereRaw('date <= ? and date >= ?' , array($week_end ,$week_start))->get();\n\n $tds = array();\n if($shifts->count())\n {\n foreach($shifts as $shift)\n {\n array_push($tds ,\"td.\".($shift->time).($shift->gate).($shift->date->toDateString()));\n }\n }\n if(Request::ajax())\n {\n if ($n == 0)\n {\n return Response::json(['flag' => false ,'msg' => 'Không thể đăng ký cho tuần hiện tại']);\n }\n if($n > 3)\n {\n return Response::json(['flag' => false ,'msg' => 'Không thể đăng ký cho qúa 3 tuần ']);\n\n }\n $html = View::make('shift.partial.table', array('day' => $day , 'n' => $n ) )->render();\n return Response::json(['flag' => true ,'msg' => 'success' , 'html' => $html ,'tds' =>$tds]);\n\n }\n\n return View::make('shift.index',array('day' => $day , 'n' => $n ,'tds' => $tds));\n\n// var_dump($day);\n// var_dump($week_end);\n// var_dump($week_start_0);\n// var_dump($week_start_1);\n// var_dump($test);\n\t}", "public function index() {\n $tenement_id = Auth::user()->tenement_id;\n\n //Check period user\n if(Auth::user()->confirmed == 0 || $tenement_id == '') {\n return redirect(\"/home\");\n }\n\n return View('monthlyfee.exepaymonth');\n }", "public function activities_cal($checkavailableday){\n $calendar_selected['start_date'] = $this->input->post('txtFrom');\n $calendar_selected['end_date'] = $this->input->post('txtTo');\n $calendar_selected['start_time'] = $this->input->post('txtStartTime');\n $calendar_selected['end_time'] = $this->input->post('txtEndTime');\n $day = array(\"monday\",\"tuesday\",\"wednesday\",\"thursday\",\"friday\",\"saturday\",\"sunday\");\n if($checkavailableday[0] == \"1_everyday\"){\n $calendar_selected['monday'] = 1;\n $calendar_selected['tuesday'] = 1;\n $calendar_selected['wednesday'] = 1;\n $calendar_selected['thursday'] = 1;\n $calendar_selected['friday'] = 1;\n $calendar_selected['saturday'] = 1;\n $calendar_selected['sunday'] = 1;\n }else{\n if($checkavailableday[0] != \"\" and count($checkavailableday) > 0){\n for($i = 0; $i < count($day); $i++){\n for($j = 0; $j < count($checkavailableday); $j++){\n $explode = explode(\"_\", $checkavailableday[$j]);\n if($explode[1] == $day[$i]){\n $calendar_selected[$day[$i]] = $explode[0];\n }\n }\n if(array_key_exists($day[$i], $calendar_selected) === FALSE){\n $calendar_selected[$day[$i]] = 0;\n }\n }\n }\n }\n return $calendar_selected;\n }", "function meetingAttendanceReport($args, &$request){\r\n\t\timport ('classes.meeting.form.MeetingAttendanceReportForm');\r\n\t\tparent::validate();\r\n\t\t$this->setupTemplate();\r\n\t\t$meetingAttendanceReportForm= new MeetingAttendanceReportForm($args, $request);\r\n\t\t$isSubmit = Request::getUserVar('generateMeetingAttendance') != null ? true : false;\r\n\t\t\r\n\t\tif ($isSubmit) {\r\n\t\t\t$meetingAttendanceReportForm->readInputData();\r\n\t\t\tif($meetingAttendanceReportForm->validate()){\t\r\n\t\t\t\t\t$this->generateMeetingAttendanceReport($args);\r\n\t\t\t}else{\r\n\t\t\t\tif ($meetingAttendanceReportForm->isLocaleResubmit()) {\r\n\t\t\t\t\t$meetingAttendanceReportForm->readInputData();\r\n\t\t\t\t}\r\n\t\t\t\t$meetingAttendanceReportForm->display($args);\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\t$meetingAttendanceReportForm->display($args);\r\n\t\t}\r\n\t}", "public function summaryAction()\r\n {\r\n \t$timesheetid = -1;\r\n\r\n // Okay, so if we were passed in a timesheet, it means we want to view\r\n // the data for that timesheet. However, if that timesheet is locked, \r\n // we want to make sure that the tasks being viewed are ONLY those that\r\n // are found in that locked timesheet.\r\n $timesheet = $this->byId();\r\n\r\n $start = null;\r\n $end = null;\r\n $this->view->showLinks = true;\r\n $cats = array();\r\n\r\n $users = $this->userService->getUserList();\r\n\r\n if (!$start) {\r\n\t // The start date, if not set in the parameters, will be just\r\n\t // the previous monday\r\n\t $start = $this->_getParam('start', $this->calculateDefaultStartDate());\r\n\t // $end = $this->_getParam('end', date('Y-m-d', time()));\r\n\t $end = $this->_getParam('end', date('Y-m-d 23:59:59', strtotime($start) + (6 * 86400)));\r\n }\r\n\r\n // lets normalise the end date to make sure it's of 23:59:59\r\n\t\t$end = date('Y-m-d 23:59:59', strtotime($end));\r\n\r\n $order = 'endtime desc';\r\n\r\n $this->view->taskInfo = array();\r\n\r\n $project = null;\r\n if ($this->_getParam('projectid')) {\r\n \t$project = $this->projectService->getProject($this->_getParam('projectid'));\r\n }\r\n \r\n foreach ($users as $user) {\r\n \t$this->view->taskInfo[$user->username] = $this->projectService->getTimesheetReport($user, $project, null, -1, $start, $end, $cats, $order);\r\n }\r\n \r\n $task = new Task();\r\n \r\n $this->view->categories = $task->constraints['category']->getValues();\r\n $this->view->startDate = $start;\r\n $this->view->endDate = $end;\r\n $this->view->params = $this->_getAllParams();\r\n $this->view->dayDivision = za()->getConfig('day_length', 8) / 4; // za()->getConfig('day_division', 2);\r\n $this->view->divisionTolerance = za()->getConfig('division_tolerance', 20);\r\n \r\n $this->renderView('timesheet/user-report.php');\r\n }", "public function reportTodayAttendentView(Request $request)\n {\n $shift = trim($request->shift) ;\n $dept = trim($request->dept) ;\n // get semister of \n $result = DB::table('semister')->where('status',1)->get();\n // get section of this department\n $section_name = DB::table('section')->where('dept_id',$dept)->get();\n $shift_name = DB::table('shift')->where('id',$shift)->first();\n $dept_name = DB::table('department')->where('id',$dept)->first();\n return view('report.showsTodayAttendent')->with('result',$result)->with('shift_name',$shift_name)->with('dept_name',$dept_name)->with('section_name',$section_name)->with('shift_id',$shift)->with('dept_id',$dept);\n }", "public function schedule_view()\n {\n\n\n if (Input::get('submit') && Input::get('submit') == 'search') {\n\n\n $start_date = Input::get('start_date');\n $end_date = Input::get('end_date');\n $start_time = date(\"Y-m-d H:i:s\", strtotime($start_date));\n $end_time = date(\"Y-m-d H:i:s\", strtotime($end_date));\n $submit = Input::get('submit');\n\n $type1 = '0' . '&';\n if (Input::has('start_date')) {\n $type1 .= 'start_date' . '=' . $start_date . '&';\n } else {\n $type1 .= 'start_date' . '=' . '' . '&';\n }\n\n if (Input::has('end_date')) {\n $type1 .= 'end_date' . '=' . $end_date . '&';\n } else {\n $type1 .= 'end_date' . '=' . '' . '&';\n }\n if (Input::has('submit')) {\n $type1 .= 'submit' . '=' . $submit;\n } else {\n $type1 .= 'submit' . '=';\n\n }\n Session::put('type', $type1);\n\n\n\n if (Input::has('start_date') && Input::has('end_date')) {\n\n $request = DB::table('temp_assign')\n ->join('owner', 'temp_assign.userid', '=', 'owner.id')\n ->select(DB::raw(\"temp_assign.*,owner.*,DATE_FORMAT(temp_assign.schedule_datetime,'%h:%i %p') as newtime,temp_assign.assignId as assign_id \"))\n ->where('temp_assign.schedule_datetime', '>=', $start_time)\n ->where('temp_assign.schedule_datetime', '<=', $end_time)\n ->paginate(10);\n\n goto res;\n\n }\n\n\n }\n\n\n if (Input::get('submit') && Input::get('submit') == 'Download_Report') {\n\n\n $start_date = Input::get('start_date');\n $end_date = Input::get('end_date');\n $start_time = date(\"Y-m-d H:i:s\", strtotime($start_date));\n $end_time = date(\"Y-m-d H:i:s\", strtotime($end_date));\n $submit = Input::get('submit');\n\n\n if (Input::has('start_date') && Input::has('end_date')) {\n\n $request = DB::table('temp_assign')\n ->join('owner', 'temp_assign.userid', '=', 'owner.id')\n ->select(DB::raw(\"temp_assign.*,owner.*,DATE_FORMAT(temp_assign.schedule_datetime,'%h:%i %p') as newtime,temp_assign.assignId as assign_id \"))\n ->where('temp_assign.schedule_datetime', '>=', $start_time)\n ->where('temp_assign.schedule_datetime', '<=', $end_time)\n ->get();\n\n }else{\n $request = DB::table('temp_assign')\n ->join('owner', 'temp_assign.userid', '=', 'owner.id')\n ->select(DB::raw(\"temp_assign.*,owner.*,DATE_FORMAT(temp_assign.schedule_datetime,'%h:%i %p') as newtime,temp_assign.assignId as assign_id \"))\n ->orderBy('assign_id', ' DESC')\n ->get();\n }\n\n\n $cntrr=1;\n\n\n header('Content-Type: text/csv; charset=utf-8');\n header('Content-Disposition: attachment; filename=schedule.csv');\n $handle = fopen('php://output', 'w');\n fputcsv($handle, array('S.No', 'Customer Name', 'Date', 'Time', 'Pickup'));\n\n foreach($request as $req)\n {\n fputcsv($handle, array(\n $cntrr,\n $req->first_name.' '.$req->last_name,\n date('d-m-Y', strtotime($req->schedule_datetime)),\n $req->newtime,\n $req->pickupAddress,\n ));\n\n $cntrr++;\n }\n\n\n fclose($handle);\n\n $headers = array(\n 'Content-Type' => 'text/csv',\n );\n\n\n goto end;\n }\n else{\n\n $start_date=\"\";\n $end_date=\"\";\n $submit=\"\";\n $type1 = '0' . '&';\n if (Input::has('start_date')) {\n $type1 .= 'start_date' . '=' . $start_date . '&';\n } else {\n $type1 .= 'start_date' . '=' . '' . '&';\n }\n\n if (Input::has('end_date')) {\n $type1 .= 'end_date' . '=' . $end_date . '&';\n } else {\n $type1 .= 'end_date' . '=' . '' . '&';\n }\n if (Input::has('submit')) {\n $type1 .= 'submit' . '=' . $submit;\n } else {\n $type1 .= 'submit' . '=';\n\n }\n Session::put('type', $type1);\n $request = DB::table('temp_assign')\n ->join('owner', 'temp_assign.userid', '=', 'owner.id')\n ->select(DB::raw(\"temp_assign.*,owner.*,DATE_FORMAT(temp_assign.schedule_datetime,'%h:%i %p') as newtime,temp_assign.assignId as assign_id \"))\n ->orderBy('assign_id', ' DESC')\n ->paginate(10);\n goto res;\n\n\n\n }\n\n res:\n\n if(Config::get('app.locale') == 'arb'){\n $align_format=\"right\";\n }elseif(Config::get('app.locale') == 'en'){\n $align_format=\"left\";\n }\n return View::make('dispatch.schedule')\n ->with('page', 'schedule')\n ->with('align_format',$align_format)\n ->with('request', $request);\n\n\n end:\n }", "public function indexAction()\n {\n\t\t$this->verifySessionRights();\n\t\t$em = $this->getDoctrine()->getManager();\n\t\t$employee=$this->getConnectedEmployee();\n\t\t$this->setActivity($employee->getName().\" \".$employee->getFirstname().\"'s Agenda is consulted by this user\");\n\t\t$aTimes = $this->getAgendaTime();\n\t\t$aDates = $this->getDatesOfWeek();\t\n\t\t$aDkey = array_keys($aDates);\n\t\t$aAgenda = $this->generateAgenda($employee,$aTimes,$aDates);\n\t\t$aFormatdate = $this->formatDate($aDates);\n//print_r($aAgenda);\n/*\necho $aAgenda[4]['endpm'];\necho \"<br>\".$this->getCreatingTsHour();\nif(isset($aAgenda[4]['endpm']) and $this->getCreatingTsHour()>0 and $this->getCreatingTsHour()<$aAgenda[4]['endpm']) \n\techo \"yes\";\nelse \n\techo \"No\";\nexit(0);\n*/\n \treturn $this->render('BoHomeBundle:Agenda:index.html.twig', array(\n \t\t'employee' => $employee,\n\t\t\t'agenda'=>$aAgenda,\n\t\t\t'datekeys'=>$aDkey,\n\t\t\t'dates'=>$aDates,\n\t\t\t'cth'=>$this->getCreatingTsHour(),//cth is the time when the teacher can do the timesheet \n\t\t\t'higham'=>$this->getHighEndAm($aAgenda),\n\t\t\t'formatdates'=>$aFormatdate,\n\t\t\t'ttkeys'=>array_keys($aTimes),\n\t\t\t'today'=> new \\DateTime(date(\"d-m-Y\")),\n\t\t\t'times'=>$aTimes,\n\t\t\t'pm'=>\"tabeau-bord\",\n\t\t\t'sm'=>\"agenda\",\n \t));\n }", "function AfterEdit(&$values,$where,&$oldvalues,&$keys,$inline,&$pageObject)\n{\n\n\t\tglobal $conn;\n\n$attend_id=$values['attend_id'];\n\n//select shecdule ID from timetable\n$sql_at= \"SELECT scheduleID,courseID,date,(end_time-start_time) AS hour FROM schedule_timetable WHERE id='$attend_id'\";\n$query_at=db_query($sql_at,$conn);\n$row_at=db_fetch_array($query_at);\n\n$scheduleID=$row_at['scheduleID'];\n\n//select related schedule id from schedule\n$sql_at2= \"SELECT programID,batchID,groupID FROM schedule WHERE scheduleID='$scheduleID'\";\n$query_at2=db_query($sql_at2,$conn);\n$row_at2=db_fetch_array($query_at2);\n\n$program=$row_at2['programID'];\n$batch=$row_at2['batchID'];\n$class=$row_at2['groupID'];\n\n//update program , batch, class to student_attendance table\n$date=$row_at['date'];\n$hour=$row_at['hour'];\n$course=$row_at['courseID'];\n$id=$keys['id'];\n$sql_up= \"Update student_attendance set programID ='$program', batchID='$batch',class='$class',course='$course',date='$date',hour='$hour' where id='$id'\";\n$query_up=db_exec($sql_up,$conn);\n\n//query the total hour for this module\n$sql_th= \"SELECT total_hour FROM program_course WHERE programID='$program' && CourseID=$course\";\n$query_th=db_query($sql_th,$conn);\n$row_th=db_fetch_array($query_th);\n\n$totalhour=$row_th['total_hour'];\n//the percentage wight of absentee ( $hour/$totalhour)\n$weight_absent=($hour/$totalhour*100);\n\n//query current attendance status for this student, program , module\n$studentID=$values['StudentID'];\n$sql_at3=\"SELECT Attendance FROM student_course WHERE StudentID=$studentID AND programID=$program AND CourseID=$course\";\n$query_at3=db_query($sql_at3,$conn);\n$row_at3=db_fetch_array($query_at3);\n\n$current_attendance=$row_at3['Attendance'];\n//update student_course attendance\n\n$net_attendance=$current_attendance-$weight_absent;\n\n$sql_ups= \"Update student_course SET Attendance='$net_attendance' where StudentID='$studentID' && programID='$program' && CourseID=$course\";\n$query_ups=db_exec($sql_ups,$conn);\n;\t\t\n}", "function update_week(){\n\t\t$time = array('id'=>1, 'ending_date' => date('Y-m-d'));\n\t\treturn $this->save($time);\n\t}", "public function scopeGetReportOrganisationBreakDown($query, $request){\n $is_org_stat = true;\n $from = \"\";\n $to = \"\";\n $now = \"\";\n $inc_raw = \"\";\n $stat_array = [\n 'is_org_stat' => false\n ];\n\n $is_org_stat = ( isset( $request['type'] ) && $request['type'] == 'org_stat' ) ? true : false;\n\n /* if ( isset( $request['type'] ) && $request['type'] == 'org_stat' ) {\n $is_org_stat = true;\n\n if ( ! empty( $request['from'] ) && ! empty( $request['to'] ) ) {\n $from = Carbon::parse( $request['from'] )->toDateString();\n $to = Carbon::parse( $request['to'] )->toDateString();\n\n $inc_raw = \" AND lead_escalations.created_at BETWEEN '$from 00:00:01' AND '$to 23:59:59'\";\n\n $stat_array = [\n 'from' => $from,\n 'to' => $to,\n 'where_type' => 'between',\n 'is_org_stat' => true\n ];\n\n } else if ( isset( $request['days'] ) && $request['days'] !== NULL ) {\n $days = $request['days'];\n $now = Carbon::now()->subDays( intval( $days ) )->toDateString();\n\n $inc_raw = \" AND lead_escalations.created_at >= '$now 00:00:01'\";\n\n $stat_array = [\n 'now' => $now,\n 'where_type' => 'days',\n 'is_org_stat' => true\n ];\n }\n } */\n\n $months = [ Carbon::now(), Carbon::now()->subMonths( 1 ), Carbon::now()->subMonths( 2 ), Carbon::now()->subMonths( 6 ) ];\n $months_format = [\n 'month_' . strtolower( Carbon::now()->format( 'M' ) ),\n 'month_' . strtolower( Carbon::now()->subMonths( 1 )->format( 'M' ) ),\n 'month_' . strtolower( Carbon::now()->subMonths( 2 )->format( 'M' ) ),\n 'month_' . strtolower( Carbon::now()->subMonths( 6 )->format( 'M' ) ),\n ];\n $_months = [];\n\n foreach( $months as $_index => $month ) {\n if ( $_index + 1 == 4 ) {\n\n $from = $month->firstOfMonth()->toDateString() . ' 00:00:01';\n $to = $months[0]->endOfMonth()->toDateString() . ' 23:59:59';\n\n } else {\n\n $from = $month->firstOfMonth()->toDateString() . ' 00:00:01';\n $to = $month->endOfMonth()->toDateString() . ' 23:59:59';\n\n }\n\n $new_inc_raw = \" AND lead_escalations.created_at BETWEEN '$from' AND '$to'\";\n array_push( $_months, $new_inc_raw );\n }\n\n $query\n ->leftJoin('leads', function($join) use($request){\n $join->on('lead_escalations.lead_id', '=', 'leads.id');\n })\n ->leftJoin('organisations', function($join) use($stat_array){\n $join->on('lead_escalations.organisation_id', '=', 'organisations.id')\n ->whereNull('lead_escalations.deleted_at');\n // ->where('lead_escalations.is_active', 1);\n })\n ->leftJoin('addresses', function($join){\n $join->on('organisations.address_id', '=', 'addresses.id');\n })\n ->leftJoin('users', function($join){\n $join->on('organisations.user_id', '=', 'users.id');\n })\n ->select('lead_escalations.organisation_id', 'organisations.name', 'organisations.metadata', 'organisations.priority','addresses.state', 'organisations.org_code', 'organisations.contact_number', 'users.email',\n // \\DB::raw(\"\n // (SELECT COUNT(*) FROM lead_escalations\n // WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and deleted_at IS NULL\n // GROUP BY lead_escalations.organisation_id) as lead_count\n // \"),\n \\DB::raw(\"\n (SELECT COUNT(*) FROM lead_escalations inner join\n leads on leads.id = lead_escalations.lead_id\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and leads.deleted_at IS NULL and leads.customer_type = 'Supply & Install'\n GROUP BY lead_escalations.organisation_id) as lead_count\n \"),\n \\DB::raw(\"\n (SELECT COUNT(*) FROM lead_escalations\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1\n AND lead_escalations.deleted_at IS NULL\n $_months[0]\n GROUP BY lead_escalations.organisation_id) as {$months_format[0]}\n \"),\n \\DB::raw(\"\n (SELECT COUNT(*) FROM lead_escalations\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1\n AND lead_escalations.deleted_at IS NULL\n $_months[1]\n GROUP BY lead_escalations.organisation_id) as {$months_format[1]}\n \"),\n \\DB::raw(\"\n (SELECT COUNT(*) FROM lead_escalations\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1\n AND lead_escalations.deleted_at IS NULL\n $_months[2]\n GROUP BY lead_escalations.organisation_id) as {$months_format[2]}\n \"),\n \\DB::raw(\"\n (SELECT COUNT(*) FROM lead_escalations\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1\n AND lead_escalations.deleted_at IS NULL\n $_months[3]\n GROUP BY lead_escalations.organisation_id) as month_six\n \"),\n )\n // ->selectRaw(\"\n // (SELECT COUNT(*) FROM lead_escalations\n // WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and deleted_at IS NULL\n // AND lead_escalations.escalation_level = 'Won'\n // $inc_raw\n // GROUP BY lead_escalations.organisation_id) as won_count\n // \")\n ->selectRaw(\"\n (SELECT COUNT(*) FROM lead_escalations inner join\n leads on leads.id = lead_escalations.lead_id\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and leads.deleted_at IS NULL and leads.customer_type = 'Supply & Install'\n AND lead_escalations.escalation_level = 'Won'\n $inc_raw\n GROUP BY lead_escalations.organisation_id) as won_count\n \")\n ->selectRaw(\"\n (SELECT ( SUM(IFNULL(lead_escalations.gutter_edge_meters, 0)) + SUM(IFNULL(lead_escalations.valley_meters, 0)) ) FROM lead_escalations\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1\n AND lead_escalations.escalation_level = 'Won' AND deleted_at IS NULL\n GROUP BY lead_escalations.organisation_id) as installed_meters\n \")\n // ->selectRaw(\"\n // (SELECT COUNT(*) FROM lead_escalations\n // WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and deleted_at IS NULL\n // AND lead_escalations.escalation_level = 'Lost'\n // $inc_raw\n // GROUP BY lead_escalations.organisation_id) as lost_count\n // \")\n ->selectRaw(\"\n (SELECT COUNT(*) FROM lead_escalations inner join\n leads on leads.id = lead_escalations.lead_id\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and leads.deleted_at IS NULL and leads.customer_type = 'Supply & Install'\n AND lead_escalations.escalation_level = 'Lost' AND lead_escalations.escalation_status = 'Lost'\n $inc_raw\n GROUP BY lead_escalations.organisation_id) as lost_count\n \")\n // ->selectRaw(\"\n // (SELECT COUNT(*) FROM lead_escalations\n // WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and deleted_at IS NULL\n // AND lead_escalations.escalation_level NOT IN ('Lost', 'Won')\n // $inc_raw\n // GROUP BY lead_escalations.organisation_id) as unallocated_count\n // \")\n ->selectRaw(\"\n (SELECT COUNT(*) FROM lead_escalations inner join\n leads on leads.id = lead_escalations.lead_id\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and leads.deleted_at IS NULL and leads.customer_type = 'Supply & Install'\n AND lead_escalations.escalation_level NOT IN ('Lost', 'Won')\n $inc_raw\n GROUP BY lead_escalations.organisation_id) as unallocated_count\n \")\n ->selectRaw(\"\n CASE\n WHEN lead_escalations.escalation_level = 'Won' THEN 'Won'\n WHEN lead_escalations.escalation_level = 'Lost' THEN 'Lost'\n ELSE 'Unresolved'\n END AS status\n \")\n ->selectRaw(\"\n CONCAT(FORMAT(((count(organisations.id)\n /\n (SELECT COUNT(*) FROM lead_escalations\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and deleted_at IS NULL\n GROUP BY lead_escalations.organisation_id) * 100)),2),'%') as percent\n \")\n ->selectRaw(\"\n CONCAT(FORMAT(((SELECT COUNT(*) FROM lead_escalations\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and deleted_at IS NULL\n AND lead_escalations.escalation_level = 'Won'\n $inc_raw\n GROUP BY lead_escalations.organisation_id) /\n (SELECT COUNT(*) FROM lead_escalations\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and deleted_at IS NULL\n GROUP BY lead_escalations.organisation_id)*100),2),'%') as percent_won\n\n \")\n ->selectRaw(\"\n CONCAT(FORMAT(((SELECT COUNT(*) FROM lead_escalations\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and deleted_at IS NULL\n AND lead_escalations.escalation_level = 'Lost'\n $inc_raw\n GROUP BY lead_escalations.organisation_id) /\n (SELECT COUNT(*) FROM lead_escalations\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and deleted_at IS NULL\n GROUP BY lead_escalations.organisation_id)*100),2),'%') as percent_lost\n\n \")\n ->selectRaw(\"\n CONCAT(FORMAT(((SELECT COUNT(*) FROM lead_escalations\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and deleted_at IS NULL\n AND lead_escalations.escalation_level NOT IN ('Lost', 'Won')\n $inc_raw\n GROUP BY lead_escalations.organisation_id) /\n (SELECT COUNT(*) FROM lead_escalations\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and deleted_at IS NULL\n GROUP BY lead_escalations.organisation_id)*100),2),'%') as percent_unallocated\n\n \")\n ->selectRaw(\"\n (SELECT ( SUM(IFNULL(lead_escalations.gutter_edge_meters, 0)) + SUM(IFNULL(lead_escalations.valley_meters, 0)) ) FROM lead_escalations\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and deleted_at IS NULL\n AND lead_escalations.escalation_level = 'Won'\n GROUP BY lead_escalations.organisation_id) as installed_metersff\n \")\n ->whereIn('addresses.state', ['ACT', 'NSW', 'NT', 'QLD', 'SA', 'TAS', 'VIC', 'WA', ''])\n //->orWhereNull('addresses.state')\n ->where(function($q) use($request, $is_org_stat){\n\n if ( ! $is_org_stat ) {\n $q->where('is_active', 1);\n if (isset($request['state'])) {\n $state = $request['state'];\n //if all state dont query address state\n if ($request['state'] != 'All States') {\n $q->where('addresses.state', $state);\n }\n }\n\n if (isset($request['keyword'])) {\n $q->orWhere('name', 'like', '%' . $request['keyword'] . '%');\n $q->orWhere('addresses.state', 'like', '%' . $request['keyword'] . '%');\n }\n\n //query date between from and to\n if (isset($request['from']) && isset($request['to'])) {\n $from = date('Y-m-d', strtotime($request['from']));\n $to = date('Y-m-d', strtotime($request['to']));\n\n $q->whereBetween(\\DB::raw('DATE_FORMAT(lead_escalations.created_at, \"%Y-%m-%d\")'), [$from, $to]);\n }\n //query date by from to greater\n else if (isset($request['from'])) {\n $from = date('Y-m-d', strtotime($request['from']));\n $q->where(\\DB::raw('DATE_FORMAT(lead_escalations.created_at, \"%Y-%m-%d\")'), '>=', $from);\n }\n //query date by to less than\n else if (isset($request['to'])) {\n $to = date('Y-m-d', strtotime($request['to']));\n $q->where(\\DB::raw('DATE_FORMAT(lead_escalations.created_at, \"%Y-%m-%d\")'), '<=', $to);\n }\n\n } else {\n $q->whereIn( 'organisations.id', $request['ids'] );\n }\n })\n ->whereNotNull('name')\n // ->where('lead_escalations.is_active', 1)\n ->groupBy('status')\n ->groupBy('organisations.id')\n ->orderBy('organisations.name', 'asc');\n\n return $query;\n }", "function bookking_user_outline($course, $user, $mod, $bookking) {\n\n $bookking = bookking_instance::load_by_coursemodule_id($mod->id);\n $upcoming = count($bookking->get_upcoming_slots_for_student($user->id));\n $attended = count($bookking->get_attended_slots_for_student($user->id));\n\n $text = '';\n\n if ($attended + $upcoming > 0) {\n $a = array('attended' => $attended, 'upcoming' => $upcoming);\n $text .= get_string('outlineappointments', 'bookking', $a);\n }\n\n if ($bookking->uses_grades()) {\n $grade = $bookking->get_gradebook_info($user->id);\n if ($grade) {\n $text .= get_string('outlinegrade', 'bookking', $grade->str_long_grade);\n }\n }\n\n $return = new stdClass();\n $return->info = $text;\n return $return;\n}", "public function ga_provider_schedule_update()\n {\n $error = array('success' => false, 'message' => '<div class=\"ga_alert ga_alert_danger\">' . ga_get_translated_data('error') . '</div>');\n\n if (!is_user_logged_in_a_provider()) {\n wp_send_json_error($error);\n wp_die();\n }\n\n // Data\n $posted = isset($_POST) ? $_POST : array();\n\n // Provider Post ID\n $provider_id = get_logged_in_provider_id();\n\n // Policies options\n $policies = get_option('ga_appointments_policies');\n\n // Provider own calendar schedule\n $calendar = get_post_meta($provider_id, 'ga_provider_calendar', true);\n\n // Provider manages its schedule on the front-end\n $manage = isset($policies['provider_manages_schedule']) && in_array($policies['provider_manages_schedule'], array('yes', 'no')) ? $policies['provider_manages_schedule'] : 'yes';\n\n if (isset($posted['action']) && $posted['action'] == 'ga_provider_schedule_update' && $calendar == 'on' && $manage == 'yes') {\n if (!class_exists('ga_work_schedule')) {\n require_once(ga_base_path . '/admin/includes/ga_work_schedule.php');\n }\n $schedule = new ga_work_schedule($provider_id);\n $work_schedule = isset($_POST['ga_provider_work_schedule']) ? $_POST['ga_provider_work_schedule'] : array();\n $breaks = isset($_POST['ga_provider_breaks']) ? $_POST['ga_provider_breaks'] : array();\n $holidays = isset($_POST['ga_provider_holidays']) ? $_POST['ga_provider_holidays'] : array();\n\n update_post_meta($provider_id, 'ga_provider_work_schedule', $schedule->validate_work_schedule($work_schedule));\n update_post_meta($provider_id, 'ga_provider_breaks', $schedule->validate_breaks($breaks));\n update_post_meta($provider_id, 'ga_provider_holidays', $schedule->validate_holidays($holidays));\n\n $success = array('success' => true, 'html' => ga_provider_schedule_form($provider_id), 'message' => '<div class=\"ga_alert ga_alert_success\">' . ga_get_translated_data('schedule_updated') . '</div>');\n wp_send_json_success($success);\n wp_die();\n } else {\n wp_send_json_error($error);\n wp_die();\n }\n }", "function userGoals($fullname, $permissions, $mysqli) {\n$curDate = date (\"Y-m-d\");\n$curMonth = date('m');\n$curYear = date('Y');\n$beginWeek = date(\"Y-m-d\", strtotime('last sunday'));\n$endWeek = date(\"Y-m-d\", strtotime('this friday'));\n$monthBegin = $curYear . '-' . $curMonth . '-01';\n$monthEnd = $curYear . '-' . $curMonth . '-31';\n// Declaring default value for the time counters.\n$userMonth = 0;\n$userWeek = 0;\n$userDay = 0;\n// Switch case changing the role depending on permissions value.\nswitch ($permissions) {\n\tcase 'Domain':\n\t\t$role = 'DateBought';\n\t\t$user = 'BoughtBy';\n\t\tbreak;\n\tcase 'Content':\n\t\t$role = 'ContentFinished';\n\t\t$user = 'Writer';\n\t\tbreak;\n\tcase 'Writer':\n\t\t$role = 'ContentFinished';\n\t\t$user = 'Writer';\n\t\tbreak;\t\t\n\tcase 'Designer':\n\t\t$role = 'DesignFinish';\n\t\t$user = 'Designer';\n\t\tbreak;\n\tcase 'Support':\n\t\t$role = 'CloneFinished';\n\t\t$user = 'Cloner';\n\t\tbreak;\n\tcase 'Admin':\n\t\t$role = 'DevFinish';\n\t\t$user = 'Developer';\n\t\tbreak;\n\tcase 'QA':\n\t\t$role = 'DateComplete';\n\t\t$user = 'QAInspector';\n\t\tbreak;\n}\n\n$query = \"SELECT * FROM DomainDetails WHERE $role='$curDate' AND $user='$fullname'\";\n$results = mysqli_query($mysqli, $query);\n$rows = mysqli_num_rows($results);\n/////////////~~~~~~~~\nfor ($a = 0; $a < $rows; $a++){\n\tmysqli_data_seek($results, $a);\n\t$domain_data = mysqli_fetch_assoc($results);\n// Setting results as incrementers. If there is a day found then it adds to day, week, & month.\n\t\t$userDay++;\n\t}\n\n$query = \"SELECT * FROM DomainDetails WHERE $role BETWEEN '$beginWeek' AND '$endWeek' AND $user='$fullname'\";\n$results = mysqli_query($mysqli, $query);\n$rows = mysqli_num_rows($results);\n/////////////~~~~~~~~\nfor ($a = 0; $a < $rows; $a++){\n\tmysqli_data_seek($results, $a);\n\t$domain_data = mysqli_fetch_assoc($results);\n// Adds to the week as well as month.\n\t\t$userWeek++;\n\t}\n\n$query = \"SELECT * FROM DomainDetails WHERE $role BETWEEN '$monthBegin' AND '$monthEnd' AND $user='$fullname'\";\n$results = mysqli_query($mysqli, $query);\n$rows = mysqli_num_rows($results);\n/////////////~~~~~~~~\nfor ($a = 0; $a < $rows; $a++){\n\tmysqli_data_seek($results, $a);\n\t$domain_data = mysqli_fetch_assoc($results);\n// Adds to only the month.\n\t\t$userMonth++;\n\t}\n\nreturn array($userDay, $userWeek, $userMonth);\n}", "public function action_list_approval_department_menu(){\n $param = \\Input::param();\n $export_date = isset($param['export_date'])?date('Y-m-d', strtotime($param['export_date'])):date('Y-m-d');\n\n $objPHPExcel = new \\PHPExcel();\n $objPHPExcel->getProperties()->setCreator('Vision')\n ->setLastModifiedBy('Vision')\n ->setTitle('Office 2007 Document')\n ->setSubject('Office 2007 Document')\n ->setDescription('Document has been generated by PHP')\n ->setKeywords('Office 2007 openxml php')\n ->setCategory('Route File');\n\n $header = ['事業本部コード','事業本部','事業部コード','事業部','部門コード','部門','様式', '適用開始日', '適用終了日',\n '第1 承認者','第1 承認者の権限',\n '第2 承認者','第2 承認者の権限','第3 承認者','第3 承認者の権限',\n '第4 承認者','第4 承認者の権限','第5 承認者','第5 承認者の権限',\n '第6 承認者','第6 承認者の権限','第7 承認者','第7 承認者の権限',\n '第8 承認者','第8 承認者の権限','第9 承認者','第9 承認者の権限',\n '第10 承認者','第10 承認者の権限','第11 承認者','第11 承認者の権限',\n '第12 承認者','第12 承認者の権限','第13 承認者','第13 承認者の権限',\n '第14 承認者','第14 承認者の権限','第15 承認者','第15 承認者の権限',\n ];\n $last_column = null;\n foreach($header as $i=>$v){\n $column = \\PHPExcel_Cell::stringFromColumnIndex($i);\n $objPHPExcel->setActiveSheetIndex(0)->setCellValue($column.'1',$v);\n $objPHPExcel->getActiveSheet()->getStyle($column.'1')\n ->applyFromArray([\n 'font' => [\n 'name' => 'Times New Roman',\n 'bold' => true,\n 'italic' => false,\n 'size' => 10,\n 'color' => ['rgb'=> \\PHPExcel_Style_Color::COLOR_WHITE]\n ],\n 'alignment' => [\n 'horizontal' => \\PHPExcel_Style_Alignment::HORIZONTAL_CENTER,\n 'vertical' => \\PHPExcel_Style_Alignment::VERTICAL_CENTER,\n 'wrap' => false\n ]\n ]);\n switch($i+1){\n case 1:\n case 3:\n case 5:\n $width = 10;\n break;\n case 2:\n $width = 18;\n break;\n case 4:\n case 6:\n $width = 30;\n break;\n case 7:\n $width = 50;\n break; \n case 11: case 13:\n case 15: case 17: case 19: case 21: case 23: case 25:\n case 27: case 29: case 31: case 33: case 35: case 37: case 39:\n $width = 20;\n break;\n default:\n $width = 30;\n break;\n }\n $objPHPExcel->getActiveSheet()->getColumnDimension($column)->setWidth($width);\n $last_column = $column;\n }\n \n /*====================================\n * Get list user has department enable_start_date >= export day <= enable_end_date\n * Or enable_start_date >= export day && enable_end_date IS NULL\n *====================================*/\n $query = \\DB::select('MADM.*', \\DB::expr('MM.name AS menu_name'), \\DB::expr('MM.id AS menu_id'), \n \\DB::expr('MRM.name AS request_menu_name'), \\DB::expr('MRM.name AS request_menu_id'),\n 'MD.level')\n ->from(['m_approval_department_menu', 'MADM'])\n ->join(['m_department', 'MD'], 'left')->on('MD.id', '=', 'MADM.m_department_id')\n\n ->join(['m_menu', 'MM'], 'left')->on('MM.id', '=', 'MADM.m_menu_id')\n ->on('MADM.petition_type', '=', \\DB::expr(\"1\"))\n ->on('MM.item_status', '=', \\DB::expr(\"'active'\"))->on('MM.enable_flg', '=', \\DB::expr(\"1\"))\n ->join(['m_request_menu', 'MRM'], 'left')->on('MRM.id', '=', 'MADM.m_menu_id')\n ->on('MADM.petition_type', '=', \\DB::expr(\"2\"))\n ->on('MRM.item_status', '=', \\DB::expr(\"'active'\"))->on('MRM.enable_flg', '=', \\DB::expr(\"1\"))\n ->where('MD.item_status', '=', 'active')\n\n ->and_where('MADM.item_status', '=', 'active')\n ->and_where_open()\n ->and_where(\\DB::expr(\"'{$export_date}'\"), 'BETWEEN', [\\DB::expr('MADM.enable_start_date'), \\DB::expr('MADM.enable_end_date')])\n ->or_where_open()\n ->and_where(\\DB::expr('MADM.enable_start_date'), '<=', $export_date)\n ->and_where(\\DB::expr('MADM.enable_end_date'), 'IS', \\DB::expr('NULL'))\n ->or_where_close()\n ->and_where_close()\n\n ->group_by('MADM.m_department_id', 'MADM.m_menu_id', 'MADM.petition_type', 'MADM.enable_start_date')\n ;\n $items = $query->execute()->as_array();\n \n //set content\n $i = 0;\n foreach($items as $item){\n $row = $i+2;\n \n switch ($item['petition_type']) {\n case 1:\n $menu_name = $item['menu_name'];\n $menu_id = $item['menu_id'];\n break;\n case 2:\n $menu_name = $item['request_menu_name'];\n $menu_id = $item['request_menu_id'];\n break;\n }\n if(empty($menu_id)) continue;\n\n\n //Get Full Name\n switch ($item['level']) {\n case 1:\n //business\n $depInfo = \\Model_MDepartment::comboData(['m_department_id' => $item['m_department_id']], ['task' => 'business']);\n break;\n case 2:\n //division\n $depInfo = \\Model_MDepartment::comboData(['m_department_id' => $item['m_department_id']], ['task' => 'division']);\n break;\n case 3:\n //department\n $depInfo = \\Model_MDepartment::comboData(['m_department_id' => $item['m_department_id']], ['task' => 'department']);\n\n break;\n \n }\n if(empty($depInfo)) continue;\n\n //Get user of routes\n $query = \\DB::select('MU.fullname', \\DB::expr('MA.name AS authority_name'))\n ->from(['m_user', 'MU'])\n ->join(['m_approval_department_menu', 'MADM'], 'left')->on('MADM.m_user_id', '=', 'MU.id')\n ->join(['m_authority', 'MA'], 'left')->on('MA.id', '=', 'MADM.m_authority_id')\n ->where('MU.item_status', '=', 'active')\n ->and_where('MADM.item_status', '=', 'active')\n ->and_where('MADM.m_department_id', '=', $item['m_department_id'])\n ->and_where('MADM.m_menu_id', '=', $item['m_menu_id'])\n ->and_where('MADM.petition_type', '=', $item['petition_type'])\n\n ->where('MU.item_status', '=', 'active')\n ->and_where_open()\n ->and_where('MU.retirement_date', '>', $export_date)\n ->or_where('MU.retirement_date', 'IS',\\DB::expr('NULL'))\n ->and_where_close()\n\n ->and_where('MADM.item_status', '=', 'active')\n ->and_where_open()\n ->and_where(\\DB::expr(\"'{$export_date}'\"), 'BETWEEN', [\\DB::expr('MADM.enable_start_date'), \\DB::expr('MADM.enable_end_date')])\n ->or_where_open()\n ->and_where(\\DB::expr('MADM.enable_start_date'), '<=', $export_date)\n ->and_where(\\DB::expr('MADM.enable_end_date'), 'IS', \\DB::expr('NULL'))\n ->or_where_close()\n ->and_where_close()\n\n ->order_by('MADM.order', 'ASC')\n ->group_by('MADM.m_user_id', 'MADM.m_authority_id')\n ;\n\n //check valid date when level == 3\n if($item['level'] == 3){ \n $query->join(['m_department', 'DEP'], 'left')->on('DEP.id', '=', 'MADM.m_department_id')->on('DEP.level', '=', \\DB::expr(3))\n ->and_where('DEP.item_status', '=', 'active')\n ->and_where_open()\n ->and_where(\\DB::expr(\"'{$export_date}'\"), 'BETWEEN', [\\DB::expr('DEP.enable_start_date'), \\DB::expr('DEP.enable_end_date')])\n ->or_where_open()\n ->and_where(\\DB::expr('DEP.enable_start_date'), '<=', $export_date)\n ->and_where(\\DB::expr('DEP.enable_end_date'), 'IS', \\DB::expr('NULL'))\n ->or_where_close()\n ->and_where_close();\n }\n $users = $query->execute()->as_array(); \n \n if (empty($users)) continue;\n\n\n $business_code = isset($depInfo['business_code'])?$depInfo['business_code']:null;\n $business_name = isset($depInfo['business_name'])?$depInfo['business_name']:null;\n $division_code = isset($depInfo['division_code'])?$depInfo['division_code']:null;\n $division_name = isset($depInfo['division_name'])?$depInfo['division_name']:null;\n $department_code = isset($depInfo['department_code'])?$depInfo['department_code']:null;\n $department_name = isset($depInfo['deparment_name'])?$depInfo['deparment_name']:null;\n \n $objPHPExcel->setActiveSheetIndex()->setCellValue('A'.$row, $menu_name);\n // \\Vision_Common::system_format_date(strtotime($user['entry_date'])):null)\n $objPHPExcel->setActiveSheetIndex()->setCellValue('A'.$row,$business_code)\n ->setCellValue('B'.$row,$business_name)\n ->setCellValue('C'.$row,$division_code)\n ->setCellValue('D'.$row,$division_name)\n ->setCellValue('E'.$row,$department_code)\n ->setCellValue('F'.$row,$department_name)\n ->setCellValue('G'.$row,$menu_name)\n ->setCellValue('H'.$row,$item['enable_start_date']?\\Vision_Common::system_format_date(strtotime($item['enable_start_date'])):null)\n ->setCellValue('I'.$row,$item['enable_end_date']?\\Vision_Common::system_format_date(strtotime($item['enable_end_date'])):null)\n ;\n\n if(!empty($users)){\n $col = 9;\n foreach ($users as $user) {\n $objPHPExcel->setActiveSheetIndex()->setCellValue(\\PHPExcel_Cell::stringFromColumnIndex($col).$row,$user['fullname']);\n $col++;\n $objPHPExcel->setActiveSheetIndex()->setCellValue(\\PHPExcel_Cell::stringFromColumnIndex($col).$row,$user['authority_name']);\n $col++;\n }\n }\n\n $i++;\n }\n\n $format = ['alignment'=>array('horizontal'=> \\PHPExcel_Style_Alignment::HORIZONTAL_CENTER,'wrap'=>true)];\n $objPHPExcel->getActiveSheet()->getStyle('A1:AK1')->getFill()->setFillType(\\PHPExcel_Style_Fill::FILL_SOLID);\n $objPHPExcel->getActiveSheet()->getStyle('A1:AK1')->getFill()->getStartColor()->setRGB('25a9cb');\n\n header(\"Last-Modified: \". gmdate(\"D, d M Y H:i:s\") .\" GMT\");\n header(\"Cache-Control: max-age=0\");\n header('Content-Type: application/vnd.ms-excel');\n header('Content-Disposition: attachment;filename=\"決裁経路(カスタム)-'.$export_date.'.xls\"');\n $objWriter = \\PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');\n $objWriter->save('php://output');\n exit; \n }", "public function index()\n { \n if (Auth::user()->admin) {\n $dt = Carbon::now();\n $date_today = $dt->timezone('Europe/London');\n $date = $date_today->toDateString();\n $assignments = assignment::where('date',Carbon::now()->timezone('Europe/London')->addDays(-1)->toDateString())->where('status',0)->get();\n foreach ($assignments as $assignment) {\n $new_assignment = new assignment;\n $new_assignment->date = $date_today;\n $new_assignment->task = $assignment->task;\n $new_assignment->task_description = $assignment->task_description;\n $new_assignment->save();\n $assignment->status = 2;\n $assignment->save();\n }\n $expenses = expenses::where('auto',0)->get();\n $total_amount = 0;\n foreach ($expenses as $expense) {\n $total_amount = $total_amount + $expense->amount;\n }\n $wages = wage::where('date',$date)->get();\n $total_wage = 0;\n foreach ($wages as $wage) {\n $total_wage = $total_wage + $wage->today_wage;\n }\n\n $tasks = Task::all();\n $client_passport_emails = array();\n $mail_clients = client::where('mail_sent',0)->where('passport_expiry_date',Carbon::now()->addMonths(6)->toDateString())->get();\n foreach ($mail_clients as $client) {\n array_push($client_passport_emails,$client->email);\n $client->mail_sent = 1;\n $client->save();\n }\n if ($client_passport_emails != null) {\n Mail::to($client_passport_emails)->send(new \\App\\Mail\\passportMail);\n }\n $employee_passport_emails = array();\n $mail_employees = employee::where('mail_sent',0)->where('passport_expiry_date',Carbon::now()->addMonths(6)->toDateString())->get();\n foreach ($mail_employees as $employee) {\n array_push($employee_passport_emails,$employee->email);\n $employee->mail_sent = 1;\n $employee->save();\n }\n if ($employee_passport_emails != null) {\n Mail::to($employee_passport_emails)->send(new \\App\\Mail\\passportMail);\n }\n\n $invoice_emails = array();\n $mail_invoices = invoice::where('status',0)->where('mail_sent',Carbon::now()->addDays(-7)->toDateString())\n ->orwhere('mail_sent',Carbon::now()->addDays(-15)->toDateString())->get();\n foreach ($mail_invoices as $invoice) {\n array_push($invoice_emails,$invoice->client->email);\n if ($invoice->mail_sent == Carbon::now()->addDays(-15)->toDateString()) {\n $invoice->mail_sent = $date;\n $invoice->save();\n }\n }\n if ($invoice_emails != null) {\n Mail::to($invoice_emails)->send(new \\App\\Mail\\invoiceMail);\n }\n\n $paid_invoices = invoice::where('status',1)->where('refund',0)->get();\n $unpaid_invoices = invoice::where('status',0)->where('refund',0)->get();\n $canceled_invoices = invoice::onlyTrashed()->get();\n $refunded_invoices = invoice::where('refund',1)->get();\n\n $unread_messages = Chat::where('to_id',Auth::user()->id)->where('status',0)->orderBy('id','desc')->get();\n return view('home')->with('employees',employee::all())\n\n ->with('clients',client::all())\n ->with('expense',$total_amount)\n ->with('date',$date)\n ->with('invoices',invoice::withTrashed()->get())\n ->with('invoice_infos',invoiceInfo::where('service_name','Visa Services')->orderBy('id','desc')->take(7)->get())\n ->with('total_wage',$total_wage)\n ->with('expenses',expenses::all())\n ->with('tasks',$tasks)\n ->with('tax',settings::all())\n ->with('paid_invoices',$paid_invoices)\n ->with('unpaid_invoices',$unpaid_invoices)\n ->with('canceled_invoices',$canceled_invoices)\n ->with('refunded_invoices',$refunded_invoices)\n ->with('wages',$wages)\n ->with('unread_messages',$unread_messages)\n ->with('messages',null);\n }\n elseif(Auth::user()->employee->count()>0){\n $today_wage = wage::where('employee_id',Auth::user()->employee[0]->id)->where('date',Carbon::now()->toDateString())->get();\n if ($today_wage->count()>0) {\n $today_wageLogs = wageLog::where('wage_id',$today_wage[0]->id)->get();\n $latest_wageLog = wageLog::where('wage_id',$today_wage[0]->id)->orderBy('created_at','desc')->first();\n if($latest_wageLog != null and $latest_wageLog->logout_time == null){ \n $total_hours_this_session = (Carbon::now())->diffInMinutes($latest_wageLog->login_time);\n }\n else{\n $total_hours_this_session = null;\n }\n }\n else{\n $latest_wageLog = null;\n $total_hours_this_session = null;\n }\n $wages = wage::where('employee_id',Auth::user()->employee[0]->id)->get();\n $total_wage = 0;\n foreach ($wages as $wage) {\n $total_wage = $total_wage + $wage->today_wage;\n }\n $unread_messages = Chat::where('to_id',Auth::user()->id)->where('status',0)->orderBy('id','desc')->get();\n return view('employee.home')->with('assignments',assignment::where('date',Carbon::now()->timezone('Europe/London')->toDateString())\n ->where('employee_id',null)->get())\n ->with('employee',Auth::user()->employee[0])\n ->with('total_wage',$total_wage)\n ->with('total_hours_this_session',$total_hours_this_session)\n ->with('unread_messages',$unread_messages)\n ->with('latest_wageLog',$latest_wageLog);\n }\n else{\n $client = Auth::user()->client;\n return view('clients.home')->with('assignments',assignment::where('date',Carbon::now()->timezone('Europe/London')->toDateString()))->with('client',$client);\n }\n }", "public function action_index()\r\n {\r\n\t\t\\Package::load('email');\r\n\t\t$mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : null;\r\n\r\n // getting current date\r\n\t\tdate_default_timezone_set('Asia/Ho_Chi_Minh');\r\n $cDate = date('Y-m-d');\r\n\r\n\t\tif ($mode === 'now'){\r\n\t\t\t$dataSet = Model_Publishdate::find(\r\n\t\t\tarray(\r\n\t\t\t\t\t'select' => array('*'),\r\n\t\t\t\t\t'where' => DB::expr(\"DATEDIFF(publish_date, now()) = 0 AND status = \" . Model_Publishdate::STATUS_CREATED)\r\n\t\t\t\t)\r\n\t\t\t);\r\n\r\n\t\t\tif ($mode === 'now' && isset($dataSet))\r\n\t\t\t{\r\n\t\t\t\tforeach($dataSet as $publishData)\r\n\t\t\t\t{\r\n\t\t\t\t\t$luna = ($publishData->luna_date ? $publishData->luna_date : '');\r\n\r\n\t\t\t\t\t$dataMailing = array('email' => $publishData->email, 'luna' => $luna , 'message' => $publishData->message, 'token' => $publishData->token);\r\n\t\t\t\t\r\n\t\t\t\t\t$result = $this->cron_mail($dataMailing);\r\n\t\t\t\t\tif ($result == true){\r\n\t\t\t\t\t\t$publishData->set(array(\r\n\t\t\t\t\t\t\t'status' => Model_Publishdate::STATUS_PUPBLISHED,\r\n\t\t\t\t\t\t\t'run_date' => $cDate\r\n\t\t\t\t\t\t));\r\n\r\n\t\t\t\t\t\t$publishData->save();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n }", "public function excel_report_sectionmngr($grp)\n\t{\n\t\t$this->data['fields'] = $this->reports_personnel_schedule_model->crystal_report_working_schedule_attendance();\n\t\t$this->data['grp'] = $grp;\n\t\t$this->load->view('employee_portal/report_personnel/schedule/excel_report_sectionmngr',$this->data);\t\t\n\t}", "function wc_marketplace_date2() {\n global $wmp;\n $wmp->output_report_date2();\n }", "private function gASummary($date_from,$date_to) {\n $service_account_email = '[email protected]'; \n // Create and configure a new client object.\n $client = new \\Google_Client();\n $client->setApplicationName(\"Analytics Reporting\");\n $analytics = new \\Google_Service_Analytics($client);\n $cred = new \\Google_Auth_AssertionCredentials(\n $service_account_email,\n array(\\Google_Service_Analytics::ANALYTICS_READONLY),\n \"-----BEGIN PRIVATE KEY-----\\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDAUT0xOyseXwTo\\nMRchra9QmsRYGUZ8+rdGihcAXrt3AqDq4/sKRaIe5gvte+C3bwHV8fI42nz0axRN\\n8WJo7lT7TzZweuAFTv+yuH/yHvNQlPAHMDCars7QTTGf8XcUHO5cq9yYA0FD2/gg\\nWAwU9V34RjL0fvEFHPii9zOZoPMtrNsMwxQcKSw2cs9TZ+grwfp5r/pRbUbPlUYg\\n/3B87jk5FjG9NKO7eRW2Pu7zf7pPZw067EMdAcGpZO7Gnzc21T1f3qj0JR0V7ooh\\nQcxiGCUIUbkKMYOuj/Rb5uQhnfb8ERehxfGFAg9FSiYbPZqag2d/adbmt32hQEKW\\nvud0nU4HAgMBAAECggEAHmy7wY4axDNEE3ewsSNJGPdjGIznGd6QIBi4itZx0eIY\\nkxB+JqHdhAXg3TE728k0ASTFrTjji8dk7u/BIdiSmS9u7VyDFFPrH9sQYr2CwLzP\\nPFPjXJVLIqkTsLoCnKv3CbIms+XP7WxfVL6ZKrempiB07zkl6CktLJrvDt7nmdH4\\nevtrk7aKxpESJUQQVgs5CULH5gIQow/qx5rDHjAaLIsbIlmUXOBZQ4yO77/Lub8u\\nZe6GDBZGeqHqA1yzKgYQiFu/TqAmtsNbtDYfm8dUY/Tkxv/RhJDCJRlpE7Vhq5zD\\nBdrnjW/IWlMVZV0SFLgvkIZ8KMBhvJi6TARzhEXcAQKBgQDswarwvnXmbGCzi4Qh\\ntJ84VeSqzOib4Gp4wzC5WyWHdQdgVb4Ob/HpI69zswwB112W7GbRy/eiUZz7Cg8Q\\nak+3ZbIVeLTlNcJApa0sNEBft+ps7Ww9hajPpTOEhtuSQu9Hx5GXgj65a6a3l+gG\\n9DPGkZC0dLXMrSgWDFZMmtLtPQKBgQDP8uYyy3mhg9owkAhgr1gdSdLJxQ/13o+Y\\nozOWHvBjoF84k/0iLDOqGxuqwBaZBf1ov5W9TS4CeyEfECaCSYc87gThcsKngeZM\\n2fSICIkmOHh24WXamEENQqmKvMXQ8g9HGKzo0TL+r9/iDrrsfo0nCPVEC2A/QBU9\\nBB5YQ9SkkwKBgQDDXSAwXgmt5Vp6bbLPmVsVQpNZeZKsJafWFMMdAKBcQW6fyMD2\\n6tsE1cSOxX0v+8YnptVFY3jpQU03PdqmYgN7w3gLDbq/tPehHtViN4+zLHFOBzCd\\nJ7Df/2MehaWj8IXAhmaWTgxyNumwb7IwIsyimzV8Ix5tUalVYELKHavVxQKBgCkO\\nMMq4h4QO7yYFWdIU7FWj/Jzfbj5BuaIOHqI164oP4JzgAusbRPwBrB2zHQMLPrPO\\nl3avZTUSMEDcxG2WrL+n0ojcSngd2mUz5uZwoPtNzOLTr3NP+g/vKF/+0yNklwWX\\nZpP0sZe9C3urItaMSbv6NcpAYLk8IrVQOdl9Ut9HAoGACt0YP/MLOlnn/S/qyn5+\\npQhuIsnv3rNa7yZrhfn0u+jdLNk4ubmc/A6Z4Yc/hqQEV/UOwfSwAAlHAZgdUWYi\\nvL6VfVaDxX5goKnWxnuvErFH1Zg+3Lem+moBzXXpb0EPxMXsAgXWe6j8YuZReXXu\\nOLoW4l5DW4h2ZmxxWr/D/Jc=\\n-----END PRIVATE KEY-----\\n\"\n ); \n $client->setAssertionCredentials($cred);\n if($client->getAuth()->isAccessTokenExpired()) {\n $client->getAuth()->refreshTokenWithAssertion($cred);\n }\n $optParams = [\n 'dimensions' => 'ga:date',\n 'sort'=>'-ga:date'\n ] ; \n $results = $analytics->data_ga->get(\n 'ga:140884579',\n $date_from,\n $date_to,\n 'ga:sessions,ga:users,ga:pageviews,ga:bounceRate,ga:hits,ga:avgSessionDuration',\n $optParams\n );\n \n $rows = $results->getRows();\n $rows_re_align = [] ;\n foreach($rows as $key=>$row) {\n foreach($row as $k=>$d) {\n $rows_re_align[$k][$key] = $d ;\n }\n } \n $optParams = array(\n 'dimensions' => 'rt:medium'\n );\n try {\n $results1 = $analytics->data_realtime->get(\n 'ga:140884579',\n 'rt:activeUsers',\n $optParams);\n // Success. \n } catch (apiServiceException $e) {\n // Handle API service exceptions.\n $error = $e->getMessage();\n }\n $active_users = $results1->totalsForAllResults ;\n return [\n 'data'=> $rows_re_align ,\n 'summary'=>$results->getTotalsForAllResults(),\n 'active_users'=>$active_users['rt:activeUsers']\n ] ;\n }", "public function getDateEntries()\n\t{\n\t\t//Get Date\n\t\t$dateSubmit = \\Input::get('eventDate_submit');\n\t\t//Get Week\n\t\t$week = $this->timesheet->getWeek($dateSubmit);\n\t\t//Get the user id of the currently logged in user\n\t\t$userId = \\Sentry::getUser()->id;\n\t\t//Get Tasks List\n\t\t$tasks = $this->timesheet->getIndex($userId);\n\t\t//Get Entries\n\t\t$entries = $this->timesheet->getEntries($dateSubmit,$userId);\n\t\treturn \\View::make('dashboard.timesheet.view')\n\t\t\t\t\t->with('week',$week)\n\t\t\t\t\t->with('tasks',$tasks)\n\t\t\t\t\t->with('selectedDate',$dateSubmit)\n\t\t\t\t\t->with('entries', $entries);\n\t}", "function Create_Edited_Schedule($application_id, $request, $tr_info)\n{\n\t$holidays = Fetch_Holiday_List();\n\t$pd_calc = new Pay_Date_Calc_3($holidays);\n\t$log = get_log(\"scheduling\");\n\n\t$schedule = array();\n\t$status_date = (isset($request->status_date)) ?\n\t(date(\"Y-m-d\", strtotime($request->status_date))) : null;\n\t$date_fund_actual = $request->date_fund_actual;\n\t$log->Write(\"Creating Edited Schedule for {$application_id}\");\n\t$principal_balance = floatval($request->principal_balance);\n\t$fees_balance = floatval($request->fees_balance);\n\t$return_amount = floatval($request->return_amount);\n\t$num_service_charges = ($request->num_service_charges == \"max\") ?\n\t5 : intval($request->num_service_charges);\n\n\t$agent_id = isset($request->controlling_agent) ? $request->controlling_agent : 0;\n\n\t$today = date(\"Y-m-d\");\n\t$next_business_day = $pd_calc->Get_Next_Business_Day($today);\n\tRemove_Unregistered_Events_From_Schedule($application_id);\n\n\t// First generate the service charge placeholders\n\tfor ($i = 0; $i < $num_service_charges; $i++)\n\t{\n\t\t$schedule[] = Schedule_Event::MakeEvent($today, $today, array(),\n\t\t'converted_sc_event',\n\t\t'Placeholder for Cashline interest charge');\n\t}\n\n\t// Now generate the balance amounts.\n\tif ($principal_balance > 0.0)\n\t{\n\t\t// If they requested \"Funds Pending\", we want to set the transaction to pending, and set\n\t\t// the event and the transaction to the date they specified.\n\t\tif($request->account_status == '17') // Set Funds Pending\n\t\t{\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('principal' => $principal_balance));\n\t\t\t$event = Schedule_Event::MakeEvent($status_date, $status_date, $amounts,\n\t\t\t'converted_principal_bal',\n\t\t\t\"Converted principal amount for {$application_id}\");\n\n\t\t\t$evid = Record_Event($application_id, $event);\n\t\t\tRecord_Scheduled_Event_To_Register_Pending($status_date, $application_id, $evid);\n\t\t}\n\t\telse if ($request->account_status == '15') // Funding Failed\n\t\t{\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('principal' => -$principal_balance));\n\t\t\t$event = Schedule_Event::MakeEvent($today, $today, $amounts,\n\t\t\t'converted_principal_bal',\n\t\t\t\"Converted principal amount for {$application_id}\");\n\t\t\t$evid = Record_Event($application_id, $event);\n\t\t\t$trids = Record_Scheduled_Event_To_Register_Pending($today, $application_id, $evid);\n\t\t\tforeach ($trids as $trid)\n\t\t\t{\n\t\t\t\tRecord_Transaction_Failure($application_id, $trid);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('principal' => $principal_balance));\n\t\t\t$schedule[] = Schedule_Event::MakeEvent($today, $today, $amounts,\n\t\t\t'converted_principal_bal',\n\t\t\t\"Converted principal amount for {$application_id}\");\n\t\t}\n\t}\n\tif ($fees_balance > 0.0)\n\t{\n\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => $fees_balance));\n\t\t$schedule[] = Schedule_Event::MakeEvent($today, $today, $amounts,\n\t\t'converted_service_chg_bal',\n\t\t\"Converted interest charge amount for {$application_id}\");\n\t}\n\n\t// Scheduling section\n\t$rules = Prepare_Rules($tr_info->rules, $tr_info->info);\n\t$scs_left = max($rules['service_charge']['max_svc_charge_only_pmts'] - $num_service_charges, 0);\n\t$sc_amt = $principal_balance * $rules['interest'];\n\t$sc_comment = \"sched svc chg ({$rules['interest']})\";\n\t$payments = $principal_balance / $rules['principal_payment_amount'];\n\t$total_payments = $rules['service_charge']['max_svc_charge_only_pmts'] + $payments + 1; //add one for the loan date\n\n\tif(!in_array($request->account_status, array(\"19\")))\n\t{\n\t\t$dates = Get_Date_List($tr_info->info, $next_business_day, $rules, ($total_payments ) * 4, null, $next_business_day);\n\n\t\t$index = 0;\n\t\tif (isset($date_fund_actual) && ($date_fund_actual != ''))\n\t\t{\n\t\t\t$date_fund_actual = preg_replace(\"/-/\", \"/\", $date_fund_actual);\n\t\t\t$log->Write(\"Date fund actual is: {$date_fund_actual}\");\n\t\t\t$window = date(\"Y-m-d\", strtotime(\"+10 days\", strtotime($date_fund_actual)));\n\t\t\twhile (strtotime($window) > strtotime($dates['event'][$index])) $index++;\n\t\t}\n\t\telse\n\t\t{\n\t\t\twhile (strtotime($today) > strtotime($dates['event'][$index])) $index++;\n\t\t}\n\t}\n\n\tswitch($request->account_status)\n\t{\n\t\tcase \"1\":\n\t\tcase \"2\": $status_chain = array(\"active\", \"servicing\", \"customer\", \"*root\"); break;\n\t\tcase \"3\": $status_chain = array(\"sent\", \"external_collections\", \"*root\"); break;\n\t\tcase \"4\": $status_chain = array(\"new\", \"collections\", \"customer\", \"*root\"); break;\n\t\tcase \"5\": $status_chain = array(\"queued\", \"contact\", \"collections\", \"customer\", \"*root\"); break;\n\t\tcase \"6\": $status_chain = array(\"pending\", \"external_collections\", \"*root\"); break;\n\t\tcase \"7\": $status_chain = array(\"unverified\", \"bankruptcy\", \"collections\", \"customer\", \"*root\"); break;\n\t\tcase \"8\": $status_chain = array(\"recovered\", \"external_collections\", \"*root\"); break;\n\t\tcase \"9\": $status_chain = array(\"paid\", \"customer\", \"*root\"); break;\n\t\tcase \"10\":\n\t\tcase \"12\":\n\t\tcase \"13\": $status_chain = array(\"ready\", \"quickcheck\", \"collections\", \"customer\", \"*root\"); break;\n\t\tcase \"11\":\n\t\tcase \"14\": $status_chain = array(\"sent\", \"quickcheck\", \"collections\", \"customer\", \"*root\"); break;\n\t\tcase \"15\": $status_chain = array(\"funding_failed\", \"servicing\", \"customer\", \"*root\"); break;\n\t\tcase \"16\": $status_chain = array(\"queued\", \"contact\", \"collections\", \"customer\", \"*root\"); break;\n\t\tcase \"17\": $status_chain = array(\"active\", \"servicing\", \"customer\", \"*root\"); break;\n\t\tcase \"18\": $status_chain = array(\"past_due\", \"servicing\", \"customer\", \"*root\"); break;\n\t\tcase \"19\": $status_chain = array(\"sent\",\"external_collections\",\"*root\"); break;\n\t\tcase \"20\": $status_chain = array(\"queued\", \"contact\", \"collections\", \"customer\", \"*root\"); break;\n\t\tcase \"21\": $status_chain = array(\"sent\", \"quickcheck\", \"collections\", \"customer\", \"*root\"); break;\n\t}\n\n\tif (in_array($request->account_status, array(\"1\", \"2\", \"4\", \"17\",\"18\")))\n\t{\n\t\tif ($request->account_status == \"18\")\n\t\t{\n\t\t\t$old_sc_amt = $sc_amt;\n\t\t\t$today = date(\"Y-m-d\");\n\t\t\t$next_day = $pd_calc->Get_Business_Days_Forward($today, 1);\n\t\t\tif ($fees_balance != 0.00)\n\t\t\t{\n\t\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => -$fees_balance));\n\t\t\t\t$schedule[] = Schedule_Event::MakeEvent($today, $next_day,\n\t\t\t\t$amounts,\n\t\t\t\t'payment_service_chg', 'repull',\n\t\t\t\t'scheduled', 'generated',$application_id,\n\t\t\t\t-$application_id);\n\t\t\t\t$return_amount = bcsub($return_amount,$fees_balance,2);\n\t\t\t}\n\n\t\t\tif ($return_amount > 0)\n\t\t\t{\n\t\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('principal' => -$return_amount));\n\t\t\t\t$schedule[] = Schedule_Event::MakeEvent($today, $next_day,\n\t\t\t\t$amounts,\n\t\t\t\t'repayment_principal', 'repull',\n\t\t\t\t'scheduled','generated',$application_id,\n\t\t\t\t-$application_id);\n\t\t\t\t$principal_balance = bcsub($principal_balance,$return_amount,2);\n\t\t\t\t$sc_amt = $principal_balance * $rules['interest'];\n\t\t\t}\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => $sc_amt));\n\t\t\t$schedule[] = Schedule_Event::MakeEvent($today, $today, $amounts, 'assess_service_chg');\n\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('fee' => $rules['return_transaction_fee']));\n\t\t\t$schedule[] = Schedule_Event::MakeEvent($today, $today,\n\t\t\t$amounts,\n\t\t\t'assess_fee_ach_fail', 'ACH Fee Assessed');\n\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('fee' => -$rules['return_transaction_fee']));\n\t\t\t$schedule[] = Schedule_Event::MakeEvent($today, $next_day,\n\t\t\t$amounts,\n\t\t\t'payment_fee_ach_fail', 'ACH fee payment');\n\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => -$sc_amt));\n\t\t\t$schedule[] = Schedule_Event::MakeEvent($dates['event'][$index],\n\t\t\t$dates['effective'][$index],$amounts, 'payment_service_chg');\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($fees_balance != 0.00)\n\t\t\t{\n\t\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => -$fees_balance));\n\t\t\t\t$schedule[] = Schedule_Event::MakeEvent($dates['event'][$index], $dates['effective'][$index],\n\t\t\t\t$amounts, 'payment_service_chg', 'sched svc chg payment');\n\t\t\t}\n\t\t}\n\t\tfor ($i = 0; $i < $scs_left; $i++)\n\t\t{\n\t\t\tif ($sc_amt == 0.0) break;\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => $sc_amt));\n\t\t\t$schedule[] = Schedule_Event::MakeEvent($dates['event'][$index], $dates['event'][$index],\n\t\t\t$amounts, 'assess_service_chg', $sc_comment);\n\t\t\t$index++;\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => -$sc_amt));\n\t\t\t$schedule[] = Schedule_Event::MakeEvent($dates['event'][$index], $dates['effective'][$index],\n\t\t\t$amounts, 'payment_service_chg',\n\t\t\t'sched svc chg payment');\n\t\t}\n\n\t\twhile ($principal_balance > 0)\n\t\t{\n\t\t\t$charge_amount = min($principal_balance, $rules['principal_payment_amount']);\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('principal' => -$charge_amount));\n\t\t\t$schedule[] = Schedule_Event::MakeEvent($dates['event'][$index], $dates['effective'][$index],\n\t\t\t$amounts, 'repayment_principal', 'principal repayment');\n\t\t\t$principal_balance = bcsub($principal_balance,$charge_amount,2);\n\t\t\tif($principal_balance > 0)\n\t\t\t{\n\t\t\t\t$sc_amt = $principal_balance * $rules['interest'];\n\t\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => $sc_amt));\n\t\t\t\t$schedule[] = Schedule_Event::MakeEvent($dates['event'][$index],\n\t\t\t\t$dates['event'][$index],\n\t\t\t\t$amounts, 'assess_service_chg',\n\t\t\t\t$sc_comment);\n\t\t\t\t$index++;\n\t\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => -$sc_amt));\n\t\t\t\t$schedule[] = Schedule_Event::MakeEvent($dates['event'][$index],\n\t\t\t\t$dates['effective'][$index],\n\t\t\t\t$amounts, 'payment_service_chg',\n\t\t\t\t'sched svc chg payment');\n\t\t\t}\n\n\t\t}\n\t}\n\telse if ($request->account_status == \"15\") // for Funding Failed\n\t{\n\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array(\n\t\t'service_charge' => -$request->fees_balance\n\t\t));\n\t\t$event = Schedule_Event::MakeEvent($today, $today,\n\t\t$amounts, 'adjustment_internal',\n\t\t'Internal Adjustment');\n\t\tPost_Event($application_id, $event);\n\t}\n\telse if ($request->account_status == \"21\") // ACH Return After QC\n\t{\n\t\tif ($status_date != null) $date = $status_date;\n\t\telse $date = $today;\n\n\t\t// Quickcheck (Pending)\n\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array(\n\t\t'service_charge' => -$request->fees_balance,\n\t\t'principal' => -$request->principal_balance,\n\t\t));\n\t\t$schedule[] = Schedule_Event::MakeEvent($date, $date,\n\t\t$amounts, 'quickcheck',\n\t\t'Quickcheck');\n\n\t\t// Cashline Return (Completed)\n\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array(\n\t\t'principal' => $request->return_amount\n\t\t));\n\t\t$event = Schedule_Event::MakeEvent($today, $today,\n\t\t$amounts, 'cashline_return',\n\t\t'Cashline Return');\n\t\tPost_Event($application_id, $event);\n\t}\n\tif ($request->account_status == \"5\")\n\t{\n\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array(\n\t\t'service_charge' => -$request->fees_balance,\n\t\t'principal' => -$request->principal_balance,\n\t\t));\n\t\t$schedule[] = Schedule_Event::MakeEvent($dates['event'][$index], $dates['effective'][$index],\n\t\t$amounts, 'full_balance',\n\t\t'Full Pull Attempt');\n\t}\n\n\tif (in_array($request->account_status, array(\"12\", \"13\", \"14\")))\n\t{\n\t\tif ($status_date != null) $date = $status_date;\n\t\telse $date = $today;\n\n\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array(\n\t\t'service_charge' => -$request->fees_balance,\n\t\t'principal' => -$request->principal_balance,\n\t\t));\n\t\t$schedule[] = Schedule_Event::MakeEvent($date, $date,\n\t\t$amounts, 'quickcheck',\n\t\t'Quickcheck');\n\t}\n\n\tif (in_array($request->account_status, array(\"14\", \"11\")))\n\t{\n\t\tif ($status_date != null) $date = $status_date;\n\t\telse $date = $today;\n\n\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array(\n\t\t'service_charge' => -$request->fees_balance,\n\t\t'principal' => -$request->principal_balance,\n\t\t));\n\t\t$schedule[] = Schedule_Event::MakeEvent($date, $date,\n\t\t$amounts, 'quickcheck',\n\t\t'Quickcheck');\n\t}\n\n\tif (in_array($request->account_status, array('6', '3', '20')))\n\t{\n\t\tif ($status_date != null) $date = $status_date;\n\t\telse $date = $today;\n\n\t\t$amounts = array();\n\t\t$amounts[] = Event_Amount::MakeEventAmount('principal', -$request->principal_balance);\n\t\t$amounts[] = Event_Amount::MakeEventAmount('service_charge', -$request->fees_balance);\n\t\t$schedule[] = Schedule_Event::MakeEvent($date, $date,\n\t\t$amounts, 'quickcheck',\n\t\t'Quickcheck');\n\n\t\t$amounts = array();\n\t\t$amounts[] = Event_Amount::MakeEventAmount('principal', -$request->principal_balance);\n\t\t$amounts[] = Event_Amount::MakeEventAmount('service_charge', -$request->fees_balance);\n\t\t$schedule[] = Schedule_Event::MakeEvent($date, $date,\n\t\t$amounts, 'quickcheck',\n\t\t'Quickcheck');\n\t}\n\n\tif(in_array($request->account_status, array(\"19\")))\n\t{\n\t\tUpdate_Status(NULL,$application_id,$status_chain);\n\t}\n\n\tif (in_array($request->account_status, array(4,5,10,11,16)) && $agent_id)\n\t{\n\t\t$application = ECash::getApplicationById($application_id);\n\t\t$affiliations = $application->getAffiliations();\n\t\t$affiliations->add(ECash::getAgentById($agent_id), 'collections', 'owner', null);\n\t}\n\n\tif (count($schedule) > 0) Update_Schedule($application_id, $schedule);\n\treturn ($status_chain);\n}", "public function indexAction($from='', $to='', $timeSelected='')\n {\n\t\t\t\t\n\t\t/*if($from!='') \t$data['startDate']=$from;\n\t\t//else\t\t\t$data['allData']['startDate']=\"2014-11-23\";\n\t\t//else\t\t\t$data['allData']['startDate']=\"2015-03-11\";\n\t\telse\t\t\t$data['startDate']=\"2015-04-12\";\n\t\tif($to!='') \t$data['endDate']=$to;\n\t\t//else \t\t\t$data['allData']['endDate']=\"2014-11-29\";\n\t\t//else \t\t\t$data['allData']['endDate']=\"2015-03-17\";\n\t\telse \t\t\t$data['endDate']=\"2015-04-18\";*/\n\t\t\n\t\t\n\t\tif($from=='')\n\t\t{\n\t\t\t$dateActual=new \\DateTime();\t\t\t\n\t\t\t$startDate=\\DateTime::createFromFormat('Y-m-d H:i:s', $dateActual->format(\"Y-m-d H:i:s\"))->modify(\"last monday\");\t\t\t\t\n\t\t\t$startDateFunction=$startDate->format(\"Y-m-d H:i:s\");\n\t\t\t$data['startDate']=$startDate->format(\"Y-m-d\");\n\t\t\t$data['endDate']=\\DateTime::createFromFormat('Y-m-d', $startDate->format(\"Y-m-d\"))->modify(\"+6 day\")->format(\"Y-m-d\");\n\t\t}else{\n\t\t\t$startDateFunction=$from.\" 00:00:00\";\n\t\t\t$data['startDate']=$from;\n\t\t\t$data['endDate']=$to;\n\t\t}\t\n\t\t\n\n\t\t\n\t\t//$dataActionPlan = $this->get('gestor_data_capturing')->getDataFromDate(\"2015-04-15 00:00:00\", $data['allData']['startDate'].\" 00:00:00\", \"Energy production\");\n\t\t$idActionPlan=1;\n\t\t//$data['dataActionPlan'] = $this->get('gestor_data_capturing')->getDataPVActionPlan(\"2015-04-12 00:00:00\", $idActionPlan);\n\t\t$data['dataActionPlan'] = $this->get('gestor_data_capturing')->getDataPVActionPlan($startDateFunction, $idActionPlan);\n\t\t\n\t\t\n\t\treturn $this->render('OptimusOptimusBundle:Graph:actionPlan.html.twig', $data);\n\t\t//return $this->redirect($this->generateUrl('prediction'));\n }", "function get_activities($user_id, $show_tasks, $view_start_time, $view_end_time, $view, $show_calls = true){\n\t\tglobal $current_user;\n\t\t$act_list = array();\n\t\t$seen_ids = array();\n\n\n\t\t// get all upcoming meetings, tasks due, and calls for a user\n\t\tif(ACLController::checkAccess('Meetings', 'list', $current_user->id == $user_id)) {\n\t\t\t$meeting = new Meeting();\n\n\t\t\tif($current_user->id == $user_id) {\n\t\t\t\t$meeting->disable_row_level_security = true;\n\t\t\t}\n\n\t\t\t$where = CalendarActivity::get_occurs_within_where_clause($meeting->table_name, $meeting->rel_users_table, $view_start_time, $view_end_time, 'date_start', $view);\n\t\t\t$focus_meetings_list = build_related_list_by_user_id($meeting,$user_id,$where);\n\t\t\tforeach($focus_meetings_list as $meeting) {\n\t\t\t\tif(isset($seen_ids[$meeting->id])) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$seen_ids[$meeting->id] = 1;\n\t\t\t\t$act = new CalendarActivity($meeting);\n\n\t\t\t\tif(!empty($act)) {\n\t\t\t\t\t$act_list[] = $act;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif($show_calls){\n\t\t\tif(ACLController::checkAccess('Calls', 'list',$current_user->id == $user_id)) {\n\t\t\t\t$call = new Call();\n\n\t\t\t\tif($current_user->id == $user_id) {\n\t\t\t\t\t$call->disable_row_level_security = true;\n\t\t\t\t}\n\n\t\t\t\t$where = CalendarActivity::get_occurs_within_where_clause($call->table_name, $call->rel_users_table, $view_start_time, $view_end_time, 'date_start', $view);\n\t\t\t\t$focus_calls_list = build_related_list_by_user_id($call,$user_id,$where);\n\n\t\t\t\tforeach($focus_calls_list as $call) {\n\t\t\t\t\tif(isset($seen_ids[$call->id])) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$seen_ids[$call->id] = 1;\n\n\t\t\t\t\t$act = new CalendarActivity($call);\n\t\t\t\t\tif(!empty($act)) {\n\t\t\t\t\t\t$act_list[] = $act;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\tif($show_tasks){\n\t\t\tif(ACLController::checkAccess('Tasks', 'list',$current_user->id == $user_id)) {\n\t\t\t\t$task = new Task();\n\n\t\t\t\t$where = CalendarActivity::get_occurs_within_where_clause('tasks', '', $view_start_time, $view_end_time, 'date_due', $view);\n\t\t\t\t$where .= \" AND tasks.assigned_user_id='$user_id' \";\n\n\t\t\t\t$focus_tasks_list = $task->get_full_list(\"\", $where,true);\n\n\t\t\t\tif(!isset($focus_tasks_list)) {\n\t\t\t\t\t$focus_tasks_list = array();\n\t\t\t\t}\n\n\t\t\t\tforeach($focus_tasks_list as $task) {\n\t\t\t\t\t$act = new CalendarActivity($task);\n\t\t\t\t\tif(!empty($act)) {\n\t\t\t\t\t\t$act_list[] = $act;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $act_list;\n\t}", "function todaysactivities()\n {\n $variables = array();\n $userdetails = $this->userInfo();\n $paitent_id = $userdetails['user_id'];\n $day = $this->getPaitentCurrentDay($paitent_id);\n $day = ($day % 7) + 1;\n $variables['currday'] = $day;\n\n $video = $this->getPaitentVideoByDay($paitent_id, $day);\n $total_count = count($video);\n $variables['total_items'] = $total_count;\n //print_r($video);\n\n $this->output = $this->build_template($this->get_template('todaysactivities'), $variables);\n }", "public function actionAuth(){\n$client = $this->getClient();;\n$service = new Google_Service_Calendar($client);\n\n// Print the next 10 events on the user's calendar.\n$calendarId = 'primary';\n$optParams = array(\n 'maxResults' => 10,\n 'orderBy' => 'startTime',\n 'singleEvents' => true,\n 'timeMin' => date('c'),\n);\n$results = $service->events->listEvents($calendarId, $optParams);\n$events = $results->getItems();\n\nif (empty($events)) {\n print \"No upcoming events found.\\n\";\n} else {\n print \"Upcoming events:\\n\";\n foreach ($events as $event) {\n $start = $event->start->dateTime;\n if (empty($start)) {\n $start = $event->start->date;\n }\n printf(\"%s (%s)\\n\", $event->getSummary(), $start);\n }\n }\n}", "public function view_attendance() { \r\n date_default_timezone_set(\"Asia/Manila\");\r\n $date= date(\"Y-m-d\");\r\n $year = date('Y', strtotime($date));\r\n $month = date('m', strtotime($date));\r\n $datenow = $year .\"-\". $month;\r\n $set_data = $this->session->userdata('userlogin'); //session data\r\n $data = array('clientID' => $set_data['clientID']\r\n ); \r\n $firstDay = mktime(0,0,0,$month, 1, $year);\r\n $timestamp = $firstDay;\r\n $weekDays = array();\r\n for ($i = 0; $i < 31; $i++) {\r\n $weekDays[] = strftime('%a', $timestamp);\r\n $timestamp = strtotime('+1 day', $timestamp);\r\n } \r\n $records['clientprofile']=$this->Client_Model->clientprofile($data);\r\n $records['weekDays']=$weekDays;\r\n $records['useradmin']=$this->User_Model->usertype();\r\n $records['employeeatendance']=$this->Attendance_Model->viewattendanceemployee($set_data['clientID'], $datenow);\r\n $this->load->view('attendanceemployee', $records);\r\n }", "public function email_approver()\n {\n \n $this->db->select('EMAIL');\n $this->db->from('APPROVERS');\n $this->db->where('UNIT',$_SESSION['div']);\n $query = $this->db->get();\n $out = $query->result_array();\n\n if ($out) {\n\n \n foreach ($out as $recipient){\n \n //mail to approver\n $this->load->library('email');\n $htmlContent = '<h1>Title change requested in FREE System.</h1>';\n $htmlContent .= '<p>Please review the <a href=\"' . base_url() . '/admin\">Approval Control Panel</a> to review the request.</p>';\n \n $this->email->clear();\n\n $config['mailtype'] = 'html';\n $this->email->initialize($config);\n $this->email->to($recipient);\n $this->email->from('[email protected]', 'FREE System');\n $this->email->subject('Title Change Requested');\n $this->email->message($htmlContent);\n $this->email->send();\n }\n }\n }", "public function executeBookAppointment(sfWebRequest $request) {\n }", "public function getTimesheetRecent(){\n $emp_id = Auth::user()->id;\n $data['response'] = $this->timesheet->getInformRecent($emp_id);\n $data = $this->formatDate($data);\n return $data;\n }", "public function set_standard_schedule() {\n $this->load->model('hrd_model');\n $this->data['title'] = \"Kelola Jadwal\";\n $this->data['subtitle'] =\"Kelola Jadwal\";\n\n $this->data['message'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));\n $this->data['message_success'] = $this->session->flashdata('message_success');\n\n\n if (isset($_POST) && !empty($_POST)) {\n $office_hour_id=$this->input->post(\"office_hour\");\n $employees=$this->input->post(\"employees\");\n $start_date=$this->input->post(\"start_date\");\n $end_date=$this->input->post(\"end_date\");\n $repeat=$this->input->post(\"repeat\");\n $start_time=$this->input->post(\"start_time\");\n $end_time=$this->input->post(\"end_time\");\n\n $office_hour=$this->hrd_model->get_one(\"hr_office_hours\", $office_hour_id);\n $return=array();\n $return['status']=true;\n $return['message']=\"\";\n\n\n if ($office_hour_id == \"\" || $office_hour_id = 0) {\n if (($start_time == \"\") || ($end_time == \"\")) {\n $return['status']=false;\n $return['message']=\"Jam Mulai dan Jam Akhir harus diisi\";\n } else {\n $office_hour_id = 0;\n $checkin_time = $start_time;\n $checkout_time = $end_time;\n } \n } else {\n $office_hour_id = $this->input->post(\"office_hour\");\n $checkin_time = $office_hour->checkin_time;\n $checkout_time = $office_hour->checkout_time;\n }\n\n for($x=0;$x<sizeof($employees);$x++){\n $user_id = $employees[$x];\n $checking_schedule = $this->hrd_model->checking_schedule(array(\"start_date\"=>$start_date,\"end_date\"=>$end_date,\"repeat\"=>$repeat,\"user_id\"=>$user_id));\n if(sizeof($checking_schedule)>0){\n $return['status']=false;\n foreach($checking_schedule as $c){\n $return['message'].=$c->name.\" sudah mempunyai jadwal di tanggal \".date(\"d/m/Y\",strtotime($c->start_date)).($c->enum_repeat==1 ? \" dan berlaku seterusnya\" : \" s/d \".date(\"d/m/Y\",strtotime($c->end_date))).\"<br>\"; \n }\n }\n }\n\n if (!empty($employees)){\n\n if($return['status']==true){\n \n\n for($x=0;$x<sizeof($employees);$x++){\n $user_id=$employees[$x];\n\n if($repeat == 1){\n\n $save_data = array(\n 'user_id' => $user_id,\n 'start_date' => $start_date,\n 'end_date' => '0000-00-00',\n 'enum_repeat' => $repeat,\n 'free_day' => 0,\n 'is_special_schedule' => 0\n );\n\n } else {\n\n $save_data = array(\n 'user_id' => $user_id,\n 'start_date' => $start_date,\n 'end_date' => $end_date,\n 'enum_repeat' => $repeat,\n 'free_day' => 0,\n 'is_special_schedule' => 0\n );\n\n }\n\n $save_data = $this->hrd_model->save('hr_schedules', $save_data); \n\n if($save_data){\n $save_detail = array(\n 'schedule_id' => $save_data,\n 'office_hour_id' => $office_hour_id,\n 'start_time' => $checkin_time,\n 'end_time' => $checkout_time\n );\n $this->hrd_model->save('hr_schedule_detail', $save_detail);\n }\n\n } \n \n }\n }\n\n \n redirect(base_url(SITE_ADMIN.'/hrd_schedule/set_standard_schedule','refresh'));\n\n \n } else {\n $store = $this->data['setting']['store_id'];\n $this->data['office_hours']= $this->hrd_model->get(\"hr_office_hours\")->result();\n\n $usersch = array();\n $get_user_id = $this->hrd_model->get(\"hr_schedules\")->result();\n foreach ($get_user_id as $key) {\n array_push($usersch, $key->user_id);\n }\n\n $this->data['data_url'] = base_url(SITE_ADMIN . '/hrd_schedule/get_employee_schedule_data');\n $this->data['employees']=$this->hrd_model->get_employee_schedule(array(\"active\"=>1, \"store_id\" => $store),false);\n\n \n $this->data['content'] .= $this->load->view('admin/hrd/set_schedule_standard_view', $this->data, true);\n $this->render('hrd');\n }\n\n }", "function usp_ews_warning_popup($events, $attempts, $userid, $courseid){\n\n\tglobal $CFG, $OUTPUT, $SESSION;\n\t// popup content\n\t$content = '';\n\t\n\t$viewedpopup_cid_uid = 'usp_ewsviewedpopup'. $courseid .$userid;\n\n\t// popup now seen\n\t$SESSION->usp_ewsviewedpopup->$viewedpopup_cid_uid = true;\n\t\n\t//VS-v2 removed the pending activity\n\t$attemptcount = 0; // completed activities count\n\t$expectedcount = 0; // expected activities count \n\t$futurecount= 0; // upcoming activities count \n\t\n\t// hold information of the activities\n\t//$popupArray = array();\n\t$popupFuture = array();\n\n\t// formate the date\n\t$dateformat = get_string('date_format', 'block_usp_ews');\n\t$now = time();\n\n\t// each events checks if attmpted or not according to the configuration\n\tforeach ($events as $event) {\t\t\t\n\t\t$attempted = $attempts[$event['type'].$event['id']];\n\t\t// count attempted events\n\t\tif ($attempted) {\n\t\t\t$attemptcount++;\n\t\t}\n\t\t// check for upcoming activities\n\t\telse if($event['expected'] > $now){ \n\n\t\t\t//to find difference of current time and next week\n\t\t\t$aweek = mktime(0, 0, 0, date(\"m\"), date(\"d\")+7, date(\"Y\"));\n\n\t\t\t// if the event is due within 7 days from current time\n\t\t\t// then alert the user these events\n\t\t\tif($aweek > $event['expected']){\n\t\t\t\t$popupFuture[$futurecount] = array(format_string(addSlashes($event['name'])),\n\t\t\t\t\t\t\tuserdate($event['expected'], $dateformat, $CFG->timezone),\n\t\t\t\t\t\t\tget_string($event['action'], 'block_usp_ews'),\n\t\t\t\t\t\t\t$event['type'],\n\t\t\t\t\t\t\t$event['cmid']);\n\t\t\t\t$futurecount++;\n\t\t\t}\t\t\t\t\n\t\t}\n\t\t// check for expected events and puts in a array\n\t\telse {\n\t\t\t\t$expectedcount++; //count number of expected activities\n\t\t\t} \n\t}\n\n\t// display alert popup\n\t// if some pending activities or upcoming activities \n\tif($futurecount > 0)\n\t{\t\t\n\t\t$strdate = get_string('duedate', 'block_usp_ews');\n\t\t// popup content\n\t\t$content .= '<div class=\"usp_ews_popupContainer\" style=\"display:none;\"> \n\t\t\t\t\t<a class=\"usp_ews_popupclose\" title=\"' . get_string('close', 'block_usp_ews') . '\"><img src=\"' . $OUTPUT->pix_url('close', 'block_usp_ews') . '\" alt=\"\" /></a>';\n\t\t\t\t\t\n\t\t// if upcoming events\n\t\t$content .= '<p class=\"usp_ews_popupheader\">'\n\t\t\t\t. '<img src=\"' . $OUTPUT->pix_url('alertfuture', 'block_usp_ews') . '\" alt=\"\" />'\n\t\t\t\t. '<span class=\"blink_header\">&nbsp;&nbsp;&nbsp;' . get_string('upcomingactivity', 'block_usp_ews') \n\t\t\t\t. '</span></p>'\n\t\t\t\t. '<div class=\"usp_ews_popupcontactArea\">';\n\n\t\tfor($i=0; $i < $futurecount; $i++){\n\t\t\t// event's link\n\t\t\t$content .= '<p><a href=\"' . $CFG->wwwroot . '/mod/' . $popupFuture[$i][3] . '/view.php?id='\n\t\t\t. $popupFuture[$i][4] . '\">' . $popupFuture[$i][0] . '</a>' \n\t\t\t.$strdate . $popupFuture[$i][1] . '</p>';\n\t\t}\n\t\t\n\t\t$content .= '</div>';\n\t\t\n\t\t// placing cross to close popup box\n\t\t$content .= '<p class=\"usp_ews_click\">'. get_string('closepopup', 'block_usp_ews') \n\t\t\t.'</p></div>'\n\t\t\t. '<div class=\"usp_ews_overlayEffect\">'\n\t\t\t. '</div>'\n\t\t\t. '<!--end popup content-->';\t\t\t\n\t}\t\n\treturn $content;\n}", "public function setInterviewDates(){\n\t\t$data=[];\n\t\t$this->load->model('SAR/PanelDetails');\n\t\t$data['Members']=$this->PanelDetails->getAllEmailAddresses();\n\t\t//var_dump($data['Members']);\n\t\t$this->load->view('includes/header');\n $this->load->view('users/SAR/setDates', $data);\n $this->load->view('includes/footer');\n\t}", "public function getBookingsAsICAL($username, $password, $start_date, $end_date, $groups=false, $buildings=false, $statuses=false, $event_types=false, $group_types=false, $group_id=false) {\nglobal $_LW;\n$feed=$_LW->getNew('feed'); // get a feed object\n$ical=$feed->createFeed(['title'=>'EMS Events'], 'ical'); // create new feed\n$hostname=@parse_url((!empty($_LW->REGISTERED_APPS['ems']['custom']['wsdl']) ? $_LW->REGISTERED_APPS['ems']['custom']['wsdl'] : (!empty($_LW->REGISTERED_APPS['ems']['custom']['rest']) ? $_LW->REGISTERED_APPS['ems']['custom']['rest'] : '')), PHP_URL_HOST);\nif ($bookings=$this->getBookings($username, $password, $start_date, $end_date, $groups, $buildings, $statuses, $event_types, $group_types, $group_id)) { // if bookings obtained\n\tforeach($bookings as $booking) { // for each booking\n\t\t$arr=[ // format the event\n\t\t\t'summary'=>$booking['title'],\n\t\t\t'dtstart'=>$booking['date_ts'],\n\t\t\t'dtend'=>(!empty($booking['date2_ts']) ? $booking['date2_ts'] : ''),\n\t\t\t'description'=>'',\n\t\t\t'uid'=>$booking['booking_id'].'@'.$hostname,\n\t\t\t'categories'=>$booking['event_type'],\n\t\t\t'location'=>$booking['location'],\n\t\t\t'X-LIVEWHALE-TYPE'=>'event',\n\t\t\t'X-LIVEWHALE-TIMEZONE'=>@$booking['timezone'],\n\t\t\t'X-LIVEWHALE-CANCELED'=>@$booking['canceled'],\n\t\t\t'X-LIVEWHALE-CONTACT-INFO'=>@$booking['contact_info'],\n\t\t\t'X-EMS-STATUS-ID'=>@$booking['status_id'],\n\t\t\t'X-EMS-EVENT-TYPE-ID'=>@$booking['event_type_id']\n\t\t];\n\t\tif (@$booking['status_id']==5 || @$booking['status_id']==17) { // if this is a pending event, skip syncing (creation of events and updating if already existing)\n\t\t\t$arr['X-LIVEWHALE-SKIP-SYNC']=1;\n\t\t};\n\t\tif (!empty($_LW->REGISTERED_APPS['ems']['custom']['hidden_by_default'])) { // if importing hidden events, flag them\n\t\t\t$arr['X-LIVEWHALE-HIDDEN']=1;\n\t\t};\n\t\tif (!empty($booking['udfs']) && !empty($_LW->REGISTERED_APPS['ems']['custom']['udf_tags']) && !empty($booking['udfs'][$_LW->REGISTERED_APPS['ems']['custom']['udf_tags']])) { // if assigning UDF values as event tags\n\t\t\t$arr['X-LIVEWHALE-TAGS']=implode('|', $booking['udfs'][$_LW->REGISTERED_APPS['ems']['custom']['udf_tags']]); // add them to output\n\t\t};\n\t\tif (!empty($booking['udfs']) && !empty($_LW->REGISTERED_APPS['ems']['custom']['udf_categories']) && !empty($booking['udfs'][$_LW->REGISTERED_APPS['ems']['custom']['udf_categories']])) { // if assigning UDF values as event categories, implode array\n\t\t\t$arr['categories']=implode('|', $booking['udfs'][$_LW->REGISTERED_APPS['ems']['custom']['udf_categories']]); // add them to output\n\t\t};\n\t\tif (!empty($booking['udfs']) && !empty($_LW->REGISTERED_APPS['ems']['custom']['udf_description']) && !empty($booking['udfs'][$_LW->REGISTERED_APPS['ems']['custom']['udf_description']])) { // if assigning UDF value as event description\n\t\t\t$arr['description']=$booking['udfs'][$_LW->REGISTERED_APPS['ems']['custom']['udf_description']];\n\t\t};\n\t\tif (!empty($booking['contact_info'])) { // add contact info if available\n\t\t\t$arr['X-EMS-CONTACT-INFO']=$booking['contact_info'];\n\t\t};\n\t\tif (!empty($booking['contact_name'])) { // add contact name if available\n\t\t\t$arr['X-EMS-CONTACT-NAME']=$booking['contact_name'];\n\t\t};\n\t\t$arr=$_LW->callHandlersByType('application', 'onBeforeEMSFeed', ['buffer'=>$arr, 'booking'=>$booking]); // call handlers\n\t\tforeach($arr as $key=>$val) { // clear empty entries\n\t\t\tif (empty($val)) {\n\t\t\t\tunset($arr[$key]);\n\t\t\t};\n\t\t};\n\t\t$feed->addFeedItem($ical, $arr, 'ical'); // add event to feed\n\t};\n};\n$feed->disable_content_length=true;\nreturn $feed->showFeed($ical, 'ical'); // show the feed\n}", "public function getIndex()\n\t{\n\t\tif ( Auth::check() )\n\t\t{\n\t\t\tif (Auth::user()->role == 'admin')\n\t\t\t\treturn Redirect::to('admin');\n\n\t\t\tif (Auth::user()->role == 'ta')\n\t\t\t\treturn Redirect::to('ta');\n\t\t}\n\n $week = array(\n \"Sunday\" => array(),\n \"Monday\" => array(),\n \"Tuesday\" => array(),\n \"Wednesday\" => array(),\n \"Thursday\" => array(),\n \"Friday\" => array(),\n \"Saturday\" => array()\n );\n\n $days = array(\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\"\n );\n\n $start = Settings::get(\"availability_start_hour\")->value;\n $start = Time::ToNumber($start);\n $time['start'] = $start;\n\n $end = Settings::get(\"availability_end_hour\")->value;\n $end = Time::ToNumber($end);\n $time['end'] = $end;\n\n $week_start = time() - (date('w') * 24 * 60 * 60);\n $week_start = date('Y-m-d', $week_start);\n $week_end = strtotime($week_start) + (6 * 24 * 60 * 60);\n $week_end = date('Y-m-d', $week_end);\n\n $shifts = Shift::between($week_start,$week_end);\n\n $assigned = array();\n foreach ($shifts as $shift) {\n for ($i=$shift->start; $i < $shift->end; $i+=50){\n $ta = $shift->TA();\n if (isset($ta))\n {\n $day = date('l', strtotime($shift->date));\n $assigned[$day][$i][] = $ta->name;\n }\n }\n }\n\n $courses = Course::all();\n\n\t\treturn View::make('main')\n ->with('courses',$courses)\n ->with('days', $days)\n ->with('week', $week)\n ->with('assigned',$assigned)\n ->with('time', $time);\n\t}", "public function holiday() {\n $this->data['title'] = \"Kelola Cuti Pegawai\";\n $this->data['subtitle'] = \"Kelola Cuti Pegawai\";\n\n $this->data['users'] = $this->hrd_model->get_user_dropdown(array(\"active\"=>1));\n\n $this->data['data_url'] = base_url(SITE_ADMIN . '/hrd_schedule/get_leave_data/');\n $this->data['content'] .= $this->load->view('admin/hrd/schedule_holiday_view', $this->data, true);\n $this->render('hrd');\n }", "function action_report($low, $high) {\n\n $range_l = '';\n $range_h = '';\n\n if(strcmp($low, '1000-01-01 00:00:00') == 0) {\n $range_l = \"site's beginning\";\n } else {\n $range_l = $low;\n }\n\n if(strcmp($high, '9999-12-31 23:59:59') == 0) {\n $range_h = \"now\";\n } else {\n $range_h = $high;\n }\n\n $freq_patient = user_freq($low, $high, \"Patient\");\n $freq_nurse = user_freq($low, $high, \"Nurse\");\n $freq_doctor = user_freq($low, $high, \"Doctor\");\n $freq_admin = user_freq($low, $high, \"Admin\");\n\n $total_patient = total_action_user($low, $high, \"Patient\");\n $total_nurse = total_action_user($low, $high, \"Nurse\");\n $total_doctor = total_action_user($low, $high, \"Doctor\");\n $total_admin = total_action_user($low, $high, \"Admin\");\n\n $freq_login = action_freq($low, $high, \"Logged In\");\n $freq_logout = action_freq($low, $high, \"Logged Out\");\n $freq_newuser = action_freq($low, $high, \"Created New User\");\n $freq_modrec = action_freq($low, $high, \"Modified Record\");\n $freq_apmt = action_freq($low, $high, \"Scheduled Appointment\");\n $freq_prescript = action_freq($low, $high, \"Prescription Written\");\n\n $total_login = total_action_action($low, $high, \"Logged In\");\n $total_logout = total_action_action($low, $high, \"Logged Out\");\n $total_newuser = total_action_action($low, $high, \"Created New User\");\n $total_modrec = total_action_action($low, $high, \"Modified Record\");\n $total_apmt = total_action_action($low, $high, \"Scheduled Appointment\");\n $total_prescript = total_action_action($low, $high, \"Prescription Written\");\n\n echo \"<h2>Activity report for interval from \".$range_l.\" to \".$range_h.\"</h2><br>\";\n \n echo \"<h3>Average Daily Actions per User Type</h3>\";\n echo \"<table><tr><th>Patients</th><th>Nurses</th><th>Doctors</th><th>Admin</th></tr>\";\n echo \"<tr><td><center>\".$freq_patient.\"</center></td><td><center>\".$freq_nurse.\"</center></td><td><center>\".$freq_doctor.\"</center></td><td><center>\".$freq_admin.\"</center></td></tr></table>\";\n\n echo \"<h3>Total number of Actions per User Type</h3>\";\n echo \"<table><tr><th>Patients</th><th>Nurses</th><th>Doctors</th><th>Admin</th></tr>\";\n echo \"<tr><td><center>\".$total_patient.\"</center></td><td><center>\".$total_nurse.\"</center></td><td><center>\".$total_doctor.\"</center></td><td><center>\".$total_admin.\"</center></td></tr></table>\";\n\n echo \"<h3>Average Daily Actions per Action Type</h3>\";\n echo \"<table><tr><td>Logins: \".$freq_login.\" </td><td>Logouts: \".$freq_logout.\" </td></tr>\";\n echo \"<tr><td>New Users Created: \".$freq_newuser.\" </td><td>Records Modified: \".$freq_modrec.\" </td></tr>\";\n echo \"<tr><td>Appointments Scheduled: \".$freq_apmt.\"</td><td>Prescriptions Written: \".$freq_prescript.\"</td></tr></table>\";\n\n echo \"<h3>Total number of Actions per Action Type</h3>\";\n echo \"<table><tr><td>Logins: \".$total_login.\" </td><td>Logouts: \".$total_logout.\" </td></tr>\";\n echo \"<tr><td>New Users Created: \".$total_newuser.\" </td><td>Records Modified: \".$total_modrec.\" </td></tr>\";\n echo \"<tr><td>Appointments Scheduled: \".$total_apmt.\"</td><td>Prescriptions Written: \".$total_prescript.\"</td></tr></table>\";\n\n\n }", "function activetime() { # Simply return TRUE or FALSE based on the time/dow and whether we should activate\n $st1 = 2114; # start time for activation on weekdays (primary schedule)\n $st2 = 2114; # start time for activation on weekends (secondary schedule)\n $et1 = 420; # end time for activation on weekdays (primary schedule)\n $et2 = 629; # end time for activation on weekends (secondary schedule)\n date_default_timezone_set('America/New_York'); # Default is UTC. That's not super-useful here.\n $nowtime = (int)date('Gi', time()); \n $nowdow = (int)date('w',time()); # 0 - 6, 0=Sunday, 6=Saturday\n\n if($nowdow >= 1 && $nowdow <= 5) { # Weekday (primary) schedule\n if(($nowtime >= $st1 && $nowtime <= 2359) || ($nowtime >= 0000 && $nowtime <= $et1) ) {\n return TRUE;\n }\n return FALSE;\n }\n else { # Weekend (secondary) schedule. \n if(($nowtime >= $st2 && $nowtime <= 2359) || ($nowtime >= 0000 && $nowtime <= $et2) ) {\n return TRUE;\n }\n return FALSE;\n }\n}", "public function schedule_by_date(Request $request) {\n //\n $currentDate = $request->segment(2);\n $day = \\Helpers\\DateHelper::getDay($currentDate);\n $weekDays = \\Helpers\\DateHelper::getWeekDays($currentDate, $day); \n $workouts = \\App\\Schedule::getScheduledWorkouts($weekDays);\n \n return view('user/schedule', ['number_of_day' => $day, 'current_date' => $currentDate, 'weekDays' => $weekDays])\n ->with('target_areas', json_decode($this->target_areas, true))\n ->with('movements', json_decode($this->movements, true))\n ->with('workouts', $workouts); \n }", "public function vbd_report_other_datewise()\n\t\t{\n\t\t\t$this->load->view('admin/header');\n\t\t\t$this->load->view('admin/nav');\n\t\t\t$data['get_state']=$this->Mod_report->get_state();\n\t\t\t$data['get_institute']=$this->Mod_report->get_institute();\n\t\t\t$this->load->view('reports/vbd_report_other_datewise',$data);\t\t\n\t\t\t$this->load->view('admin/footer');\t\n\n\t\t}", "function dwsim_flowsheet_progress_all()\n{\n\t$page_content = \"\";\n\t$query = db_select('dwsim_flowsheet_proposal');\n\t$query->fields('dwsim_flowsheet_proposal');\n\t$query->condition('approval_status', 1);\n\t$query->condition('is_completed', 0);\n\t$result = $query->execute();\n\tif ($result->rowCount() == 0)\n\t{\n\t\t$page_content .= \"Work is in progress for the following flowsheets under Flowsheeting Project<hr>\";\n\t} //$result->rowCount() == 0\n\telse\n\t{\n\t\t$page_content .= \"Work is in progress for the following flowsheets under Flowsheeting Project<hr>\";;\n\t\t$preference_rows = array();\n\t\t$i = $result->rowCount();\n\t\twhile ($row = $result->fetchObject())\n\t\t{\n\t\t\t$approval_date = date(\"Y\", $row->approval_date);\n\t\t\t$preference_rows[] = array(\n\t\t\t\t$i,\n\t\t\t\t$row->project_title,\n\t\t\t\t$row->contributor_name,\n\t\t\t\t$row->university,\n\t\t\t\t$approval_date\n\t\t\t);\n\t\t\t$i--;\n\t\t} //$row = $result->fetchObject()\n\t\t$preference_header = array(\n\t\t\t'No',\n\t\t\t'Flowsheet Project',\n\t\t\t'Contributor Name',\n\t\t\t'University / Institute',\n\t\t\t'Year'\n\t\t);\n\t\t$page_content .= theme('table', array(\n\t\t\t'header' => $preference_header,\n\t\t\t'rows' => $preference_rows\n\t\t));\n\t}\n\treturn $page_content;\n}", "public function index($date = null)\n {\n $user = Auth::user();\n $workouts = $user->workouts;\n $currentWeek = $user->currentWeek;\n\n //will be checking against this to fix problem where refreshing takes users to previous or next weeks\n $pageWasRefreshed = isset($_SERVER['HTTP_CACHE_CONTROL']) && $_SERVER['HTTP_CACHE_CONTROL'] === 'max-age=0';\n\n if($date && !$pageWasRefreshed){ \n switch($date){\n case 'previous':\n $currentWeek--;\n $user->update(['currentWeek' => $currentWeek]);\n break;\n case 'next':\n $currentWeek++;\n $user->update(['currentWeek' => $currentWeek]);\n break;\n case 'current':\n $currentWeek = date('W');\n $user->update(['currentWeek' => $currentWeek]);\n break;\n }\n }\n\n //Use Currentweek to delegate weeks\n //Refactor this\n\n $dto = new DateTime();\n $ret['monday'] = $dto->setISODate(date('Y'), $currentWeek)->format('Y-m-d');\n $ret['sunday'] = $dto->modify('+6 days')->format('Y-m-d'); \n\n $monday = $ret['monday'];\n $sunday = $ret['sunday'];\n $weekof = $monday;\n \n $mondayWorkout = $this->findWorkout('Monday', $monday, $sunday, $workouts);\n $tuesdayWorkout = $this->findWorkout('Tuesday', $monday, $sunday, $workouts);\n $wednesdayWorkout = $this->findWorkout('Wednesday', $monday, $sunday, $workouts);\n $thursdayWorkout = $this->findWorkout('Thursday', $monday, $sunday, $workouts);\n $fridayWorkout = $this->findWorkout('Friday', $monday, $sunday, $workouts);\n // $saturdayWorkout = $this->findWorkout('Saturday', $monday, $sunday, $workouts);\n // $sundayWorkout = $this->findWorkout('Sunday', $monday, $sunday, $workouts);\n\n if($mondayWorkout){\n $mondayExercises = $mondayWorkout->exercises;\n }\n if($tuesdayWorkout){\n $tuesdayExercises = $tuesdayWorkout->exercises;\n }\n if($wednesdayWorkout){\n $wednesdayExercises = $wednesdayWorkout->exercises;\n }\n if($thursdayWorkout){\n $thursdayExercises = $thursdayWorkout->exercises;\n }\n if($fridayWorkout){\n $fridayExercises = $fridayWorkout->exercises;\n }\n // if($saturdayWorkout){\n // $saturdayExercises = $saturdayWorkout->exercises;\n // } \n // if($sundayWorkout){\n // $sundayExercises = $sundayWorkout->exercises;\n // }\n // \n \n //get the exercises of last week and current day for dashboard\n //for comparison week to week\n \n $lastweekDate = date('Y-m-d', strtotime('-1 week'));\n $lastweekWorkout = $workouts->where('week', $lastweekDate)->first();\n \n if($lastweekWorkout){\n $lastweekExercises = $lastweekWorkout->exercises;\n }\n\n return view('home', compact('weekof', \n 'lastweekWorkout', 'lastweekExercises',\n 'mondayExercises', 'mondayWorkout',\n 'tuesdayExercises', 'tuesdayWorkout',\n 'wednesdayExercises', 'wednesdayWorkout',\n 'thursdayExercises', 'thursdayWorkout',\n 'fridayExercises', 'fridayWorkout'//,\n // 'saturdayExercises', 'saturdayWorkout',\n // 'sundayExercises', 'sundayWorkout'\n ));\n }" ]
[ "0.6188917", "0.61371523", "0.5914209", "0.5878231", "0.58684427", "0.5850442", "0.5809613", "0.57332426", "0.5712904", "0.56981343", "0.56725204", "0.5626723", "0.5594761", "0.5590149", "0.55804193", "0.5577645", "0.55739397", "0.55374515", "0.55116487", "0.5501894", "0.5469365", "0.5463194", "0.5459715", "0.543053", "0.54192936", "0.5402215", "0.5391373", "0.53654265", "0.53366375", "0.532826", "0.5328194", "0.53208566", "0.5317873", "0.5317097", "0.5312749", "0.5302063", "0.53011024", "0.52907133", "0.52838594", "0.528342", "0.52802455", "0.5269643", "0.5267028", "0.526627", "0.52599436", "0.52435195", "0.5239207", "0.52377325", "0.52362746", "0.5227146", "0.5222961", "0.5217668", "0.52101684", "0.52024126", "0.52015114", "0.52013206", "0.5198396", "0.5195423", "0.5178767", "0.517663", "0.51723504", "0.51723224", "0.51662236", "0.5158751", "0.5154597", "0.5154454", "0.5137585", "0.51336694", "0.5129581", "0.5127755", "0.51270366", "0.5115246", "0.51148975", "0.5114245", "0.5109855", "0.5101838", "0.50937164", "0.5089672", "0.5089036", "0.5082643", "0.50810987", "0.50784343", "0.5070287", "0.50687826", "0.5064408", "0.50637126", "0.50567186", "0.5050754", "0.5050099", "0.5048506", "0.50480473", "0.5047626", "0.5046702", "0.5044833", "0.5043736", "0.504154", "0.50415", "0.50374013", "0.50366235", "0.50352395" ]
0.59724456
2
END REQUEST APPROVAL / timesheetWeeklyView /
function Approve( $id,$week,$year ) { $this->getMenu() ; $this->data['id'] = $id ; $this->data['back'] = $this->data['site'] .'timesheet/tobeApproved'; $this->data['table'] = $this->timesheetModel->getTimesheetActiveStatusX($id,$week,$year); $this->load->view('timesheet_approve_detail',$this->data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\r\n {\r\n \tini_set('memory_limit', '64M');\r\n $validFormats = array('weekly');\r\n $format = 'weekly'; // $this->_getParam('format', 'weekly');\r\n \r\n if (!in_array($format, $validFormats)) {\r\n $this->flash('Format not valid');\r\n $this->renderView('error.php');\r\n return;\r\n }\r\n\r\n $reportingOn = 'Dynamic';\r\n \r\n // -1 will mean that by default, just choose all timesheet records\r\n $timesheetid = -1;\r\n\r\n // Okay, so if we were passed in a timesheet, it means we want to view\r\n // the data for that timesheet. However, if that timesheet is locked, \r\n // we want to make sure that the tasks being viewed are ONLY those that\r\n // are found in that locked timesheet.\r\n $timesheet = $this->byId();\r\n\r\n $start = null;\r\n $end = null;\r\n $this->view->showLinks = true;\r\n $cats = array();\r\n\r\n if ($timesheet) {\r\n $this->_setParam('clientid', $timesheet->clientid);\r\n $this->_setParam('projectid', $timesheet->projectid);\r\n if ($timesheet->locked) {\r\n $timesheetid = $timesheet->id;\r\n $reportingOn = $timesheet->title;\r\n } else {\r\n $timesheetid = 0; \r\n $reportingOn = 'Preview: '.$timesheet->title;\r\n }\r\n if (is_array($timesheet->tasktype)) {\r\n \t$cats = $timesheet->tasktype;\r\n } \r\n\r\n $start = date('Y-m-d 00:00:01', strtotime($timesheet->from));\r\n $end = date('Y-m-d 23:59:59', strtotime($timesheet->to)); \r\n $this->view->showLinks = false;\r\n } else if ($this->_getParam('category')){\r\n \t$cats = array($this->_getParam('category'));\r\n }\r\n \r\n \r\n $project = $this->_getParam('projectid') ? $this->byId($this->_getParam('projectid'), 'Project') : null;\r\n\t\t\r\n\t\t$client = null;\r\n\t\tif (!$project) {\r\n \t$client = $this->_getParam('clientid') ? $this->byId($this->_getParam('clientid'), 'Client') : null;\r\n\t\t}\r\n\t\t\r\n $user = $this->_getParam('username') ? $this->userService->getUserByField('username', $this->_getParam('username')) : null;\r\n \r\n\t\t$this->view->user = $user;\r\n\t\t$this->view->project = $project;\r\n\t\t$this->view->client = $client ? $client : ( $project ? $this->byId($project->clientid, 'Client'):null);\r\n\t\t$this->view->category = $this->_getParam('category');\r\n \r\n if (!$start) {\r\n\t // The start date, if not set in the parameters, will be just\r\n\t // the previous monday\r\n\t $start = $this->_getParam('start', $this->calculateDefaultStartDate());\r\n\t // $end = $this->_getParam('end', date('Y-m-d', time()));\r\n\t $end = $this->_getParam('end', date('Y-m-d 23:59:59', strtotime($start) + (6 * 86400)));\r\n }\r\n \r\n // lets normalise the end date to make sure it's of 23:59:59\r\n\t\t$end = date('Y-m-d 23:59:59', strtotime($end));\r\n\r\n $this->view->title = $reportingOn;\r\n \r\n $order = 'endtime desc';\r\n if ($format == 'weekly') {\r\n $order = 'starttime asc';\r\n }\r\n\r\n $this->view->taskInfo = $this->projectService->getTimesheetReport($user, $project, $client, $timesheetid, $start, $end, $cats, $order);\r\n \r\n // get the hierachy for all the tasks in the task info. Make sure to record how 'deep' the hierarchy is too\r\n\t\t$hierarchies = array();\r\n\r\n\t\t$maxHierarchyLength = 0;\r\n\t\tforeach ($this->view->taskInfo as $taskinfo) {\r\n\t\t\tif (!isset($hierarchies[$taskinfo->taskid])) {\r\n\t\t\t\t$task = $this->projectService->getTask($taskinfo->taskid);\r\n\t\t\t\t$taskHierarchy = array();\r\n\t\t\t\tif ($task) {\r\n\t\t\t\t\t$taskHierarchy = $task->getHierarchy();\r\n\t\t\t\t\tif (count($taskHierarchy) > $maxHierarchyLength) {\r\n\t\t\t\t\t\t$maxHierarchyLength = count($taskHierarchy);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$hierarchies[$taskinfo->taskid] = $taskHierarchy;\r\n\t\t\t} \r\n\t\t}\r\n\t\r\n\t\t$this->view->hierarchies = $hierarchies;\r\n\t\t$this->view->maxHierarchyLength = $maxHierarchyLength;\r\n\r\n $this->view->startDate = $start;\r\n $this->view->endDate = $end;\r\n $this->view->params = $this->_getAllParams();\r\n $this->view->dayDivision = za()->getConfig('day_length', 8) / 4; // za()->getConfig('day_division', 2);\r\n $this->view->divisionTolerance = za()->getConfig('division_tolerance', 20);\r\n \r\n $outputformat = $this->_getParam('outputformat');\r\n if ($outputformat == 'csv') {\r\n \t$this->_response->setHeader(\"Content-type\", \"text/csv\");\r\n\t $this->_response->setHeader(\"Content-Disposition\", \"inline; filename=\\\"timesheet.csv\\\"\");\r\n\r\n\t echo $this->renderRawView('timesheet/csv-export.php');\r\n } else {\r\n\t\t\tif ($this->_getParam('_ajax')) {\r\n\t\t\t\t$this->renderRawView('timesheet/'.$format.'-report.php');\r\n\t\t\t} else {\r\n\t\t\t\t$this->renderView('timesheet/'.$format.'-report.php');\r\n\t\t\t}\r\n }\r\n }", "public function timesheetAction()\r\n {\r\n $project = $this->projectService->getProject($this->_getParam('projectid'));\r\n $client = $this->clientService->getClient($this->_getParam('clientid'));\r\n \r\n if (!$project && !$client) {\r\n return;\r\n }\r\n \r\n if ($project) {\r\n $start = date('Y-m-d', strtotime($project->started) - 86400);\r\n $this->view->tasks = $this->projectService->getSummaryTimesheet(null, null, $project->id, null, null, $start, null);\r\n } else {\r\n $start = date('Y-m-d', strtotime($client->created));\r\n $this->view->tasks = $this->projectService->getSummaryTimesheet(null, null, null, $client->id, null, $start, null);\r\n }\r\n\r\n $this->renderRawView('timesheet/ajax-timesheet-summary.php');\r\n }", "public function detailedtimesheetAction()\r\n {\r\n $project = $this->projectService->getProject($this->_getParam('projectid'));\r\n $client = $this->clientService->getClient($this->_getParam('clientid'));\r\n $task = $this->projectService->getTask($this->_getParam('taskid'));\r\n $user = $this->userService->getUserByField('username', $this->_getParam('username'));\r\n\t\t\r\n if (!$project && !$client && !$task && !$user) {\r\n return;\r\n }\r\n\r\n\t\tif ($task) { \r\n $this->view->records = $this->projectService->getDetailedTimesheet(null, $task->id);\r\n } else if ($project) {\r\n \r\n $start = null;\r\n $this->view->records = $this->projectService->getDetailedTimesheet(null, null, $project->id);\r\n } else if ($client) {\r\n \r\n $start = null;\r\n $this->view->records = $this->projectService->getDetailedTimesheet(null, null, null, $client->id);\r\n } else if ($user) {\r\n\t\t\t$this->view->records = $this->projectService->getDetailedTimesheet($user);\r\n\t\t}\r\n\r\n\t\t$this->view->task = $task;\r\n $this->renderRawView('timesheet/ajax-timesheet-details.php');\r\n }", "public function index()\n {\n $user = $this->getUser();\n $from = $this->request->getStringParam('from', date('Y-m-d'));\n $to = $this->request->getStringParam('to', date('Y-m-d', strtotime('next week')));\n $timetable = $this->timetable->calculate($user['id'], new DateTime($from), new DateTime($to));\n\n $this->response->html($this->helper->layout->user('timetable:timetable/index', array(\n 'user' => $user,\n 'timetable' => $timetable,\n 'values' => array(\n 'from' => $from,\n 'to' => $to,\n 'plugin' => 'timetable',\n 'controller' => 'timetable',\n 'action' => 'index',\n 'user_id' => $user['id'],\n ),\n )));\n }", "public function getIndex()\n\t{\n\t\t\n\t\t//Get the user id of the currently logged in user\n $userId = Sentry::getUser()->id;\n //Current Date\n\t\t$day = date(\"Y-m-d\");\n //Get tasks list for the user\n\t\t$tasks = $this->timesheet->getIndex($userId);\n //Get the entries\n\t\t$entries = $this->timesheet->getEntries($day,$userId);\n //Current Week\n\t\t$week = $this->timesheet->getWeek($day);\n\t\treturn \\View::make('dashboard.timesheet.view')\n\t\t\t\t\t\t->with('week',$week)\n\t\t\t\t\t\t->with('selectedDate',$day)\n\t\t\t\t\t\t->with('entries', $entries)\n\t\t\t\t\t\t->with('tasks',$tasks);\n\t}", "function recurringdowntime_show_downtime()\n{\n global $request;\n\n do_page_start(array(\"page_title\" => _(\"Recurring Downtime\")), true);\n\n if (isset($request[\"host\"])) {\n $host_tbl_header = _(\"Recurring Downtime for Host: \") . $request[\"host\"];\n $service_tbl_header = _(\"Recurring Downtime for Host: \") . $request[\"host\"];\n if (is_authorized_for_host(0, $request[\"host\"])) {\n $host_data = recurringdowntime_get_host_cfg($request[\"host\"]);\n $service_data = recurringdowntime_get_service_cfg($request[\"host\"]);\n }\n } elseif (isset($request[\"hostgroup\"])) {\n $hostgroup_tbl_header = _(\"Recurring Downtime for Hostgroup: \") . $request[\"hostgroup\"];\n if (is_authorized_for_hostgroup(0, $request[\"hostgroup\"])) {\n $hostgroup_data = recurringdowntime_get_hostgroup_cfg($request[\"hostgroup\"]);\n }\n } elseif (isset($request[\"servicegroup\"])) {\n $servicegroup_tbl_header = _(\"Recurring Downtime for Servicegroup: \") . $request[\"servicegroup\"];\n if (is_authorized_for_servicegroup(0, $request[\"servicegroup\"])) {\n $servicegroup_data = recurringdowntime_get_servicegroup_cfg($request[\"servicegroup\"]);\n }\n }\n\n if (!isset($request[\"host\"]) && !isset($request[\"hostgroup\"]) && !isset($request[\"servicegroup\"])) {\n /*\n $host_tbl_header = \"Recurring Downtime for All Hosts\";\n $hostgroup_tbl_header = \"Recurring Downtime for All Hostgroups\";\n $servicegroup_tbl_header = \"Recurring Downtime for All Servicegroups\";\n */\n $host_tbl_header = _(\"Host Schedules\");\n $service_tbl_header = _(\"Service Schedules\");\n $hostgroup_tbl_header = _(\"Hostgroup Schedules\");\n $servicegroup_tbl_header = _(\"Servicegroup Schedules\");\n $host_data = recurringdowntime_get_host_cfg($host = false);\n $service_data = recurringdowntime_get_service_cfg($host = false);\n $hostgroup_data = recurringdowntime_get_hostgroup_cfg($hostgroup = false);\n $servicegroup_data = recurringdowntime_get_servicegroup_cfg($servicegroup = false);\n $showall = true;\n }\n\n ?>\n <h1><?php echo _(\"Recurring Downtime\"); ?></h1>\n\n <?php echo _(\"Scheduled downtime definitions that are designed to repeat (recur) at set intervals are shown below. The next schedule for each host/service are added to the monitoring engine when the cron runs at the top of the hour.\"); ?>\n\n <?php\n if (!isset($request[\"host\"]) && !isset($request[\"hostgroup\"]) && !isset($request[\"servicegroup\"])) {\n ?>\n <p>\n <?php } ?>\n\n <script type=\"text/javascript\">\n function do_delete_sid(sid) {\n input = confirm('<?php echo _(\"Are you sure you wish to delete this downtime schedule?\"); ?>');\n if (input == true) {\n window.location.href = 'recurringdowntime.php?mode=delete&sid=' + sid + '&nsp=<?php echo get_nagios_session_protector_id();?>';\n }\n }\n </script>\n\n <?php\n if ($showall) {\n ?>\n <script type=\"text/javascript\">\n $(document).ready(function () {\n $(\"#tabs\").tabs().show();\n });\n </script>\n\n <div id=\"tabs\" class=\"hide\">\n <ul>\n <li><a href=\"#host-tab\"><?php echo _(\"Hosts\"); ?></a></li>\n <li><a href=\"#service-tab\"><?php echo _(\"Services\"); ?></a></li>\n <li><a href=\"#hostgroup-tab\"><?php echo _(\"Hostgroups\"); ?></a></li>\n <li><a href=\"#servicegroup-tab\"><?php echo _(\"Servicegroups\"); ?></a></li>\n </ul>\n <?php\n }\n ?>\n\n <?php if (!empty($_GET[\"host\"]) || $showall) {\n\n $host = grab_request_var('host', '');\n\n // hosts tab\n if ($showall) {\n echo \"<div id='host-tab'>\";\n }\n ?>\n\n <h4 <?php if ($host) { echo 'style=\"margin-top: 20px;\"'; } ?>><?php echo $host_tbl_header; ?></h4>\n\n <?php\n if (!is_readonly_user(0)) {\n if ($host) {\n ?>\n <div style=\"margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=host&host_name=<?php echo $host; ?>&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23host-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add schedule for this host\"); ?></a>\n </div>\n <?php\n } else {\n ?>\n <div style=\"margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=host&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23host-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add Schedule\"); ?></a>\n </div>\n <?php\n }\n }\n ?>\n\n <table class=\"tablesorter table table-condensed table-striped table-bordered\" style=\"width:100%\">\n <thead>\n <tr>\n <th><?php echo _(\"Host\"); ?></th>\n <th><?php echo _(\"Services\"); ?></th>\n <th><?php echo _(\"Comment\"); ?></th>\n <th><?php echo _(\"Start Time\"); ?></th>\n <th><?php echo _(\"Duration\"); ?></th>\n <th><?php echo _(\"Months\"); ?></th>\n <th><?php echo _(\"Weekdays\"); ?></th>\n <th><?php echo _(\"Days in Month\"); ?></th>\n <th><?php echo _(\"Handle Child Hosts\"); ?></th>\n <th class=\"center\" style=\"width: 80px;\"><?php echo _(\"Actions\"); ?></th>\n </tr>\n </thead>\n <tbody>\n <?php\n if ($host_data) {\n $i = 0;\n\n $host_names = array();\n foreach ($host_data as $k => $data) {\n $host_names[$k] = $data['host_name'];\n }\n array_multisort($host_names, SORT_ASC, $host_data);\n\n foreach ($host_data as $sid => $schedule) {\n if (empty($schedule['childoptions'])) {\n $schedule['childoptions'] = 0;\n }\n ?>\n <tr>\n <td><?php echo $schedule[\"host_name\"]; ?></td>\n <td><?php echo (isset($schedule[\"svcalso\"]) && $schedule[\"svcalso\"] == 1) ? _(\"Yes\") : _(\"No\"); ?></td>\n <td><?php echo encode_form_val($schedule[\"comment\"]); ?></td>\n <td><?php echo $schedule[\"time\"]; ?></td>\n <td><?php echo $schedule[\"duration\"]; ?></td>\n <td><?php if ($schedule[\"months_of_year\"]) {\n echo $schedule[\"months_of_year\"];\n } else {\n echo _(\"All\");\n } ?></td>\n <td><?php if ($schedule[\"days_of_week\"]) {\n echo $schedule[\"days_of_week\"];\n } else {\n echo _(\"All\");\n } ?></td>\n <td><?php if ($schedule[\"days_of_month\"]) {\n echo $schedule[\"days_of_month\"];\n } else {\n echo _(\"All\");\n } ?></td>\n <td><?php if ($schedule[\"childoptions\"] == 0) {\n echo _(\"No\");\n } elseif ($schedule[\"childoptions\"] == 1) {\n echo _(\"Yes, triggered\");\n } elseif ($schedule[\"childoptions\"] == 2) {\n echo _(\"Yes, non-triggered\");\n } ?></td>\n <td class=\"center\">\n <?php if (!is_readonly_user(0)) { ?>\n <a href=\"<?php echo 'recurringdowntime.php' . \"?mode=edit&sid=\" . $sid . \"&return=\" . urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23host-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\"><img src=\"<?php echo theme_image('pencil.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Edit schedule'); ?>\" alt=\"<?php echo _('Edit'); ?>\"></a>&nbsp;\n <a onClick=\"javascript:return do_delete_sid('<?php echo $sid; ?>');\" href=\"javascript:void(0);\"><img src=\"<?php echo theme_image('cross.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Delete schedule'); ?>\" alt=\"<?php echo _('Delete'); ?>\"></a>\n <?php } ?>\n </td>\n </tr>\n <?php } // end foreach ?>\n\n <?php } else { ?>\n <tr>\n <td colspan=\"10\">\n <div style=\"padding:4px\">\n <em><?php echo _(\"There are currently no host recurring downtime events defined.\"); ?></em>\n </div>\n </td>\n </tr>\n <?php } // end if host_data ?>\n </table>\n\n <?php if ($showall) echo \"</div>\"; // end host tab?>\n\n<?php } // end if host or showall\n\nif (!empty($_GET[\"service\"]) || $showall) {\n\n $host = grab_request_var('host', '');\n $service = grab_request_var('service', '');\n\n if ($showall) {\n echo \"<div id='service-tab'>\";\n }\n ?>\n\n <h4><?php echo $service_tbl_header; ?></h4>\n\n <?php\n if (!is_readonly_user(0)) {\n if ($host) {\n ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=service&host_name=<?php echo $host; ?>&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23service-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add schedule for this host\"); ?></a>\n </div>\n <?php\n } else {\n ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=service&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23service-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add Schedule\"); ?></a>\n </div>\n <?php\n }\n } // end is_readonly_user\n ?>\n <table class=\"tablesorter table table-condensed table-striped table-bordered\" style=\"width:100%\">\n <thead>\n <tr>\n <th><?php echo _(\"Host\"); ?></th>\n <th><?php echo _(\"Service\"); ?></th>\n <th><?php echo _(\"Comment\"); ?></th>\n <th><?php echo _(\"Start Time\"); ?></th>\n <th><?php echo _(\"Duration\"); ?></th>\n <th><?php echo _(\"Weekdays\"); ?></th>\n <th><?php echo _(\"Days in Month\"); ?></th>\n <th><?php echo _(\"Actions\"); ?></th>\n </tr>\n </thead>\n <tbody>\n <?php\n if ($service_data) {\n $i = 0;\n\n $host_names = array();\n $service_names = array();\n foreach ($service_data as $k => $data) {\n $host_names[$k] = $data['host_name'];\n $service_names[$k] = $data['service_description'];\n }\n\n array_multisort($host_names, SORT_ASC, $service_names, SORT_ASC, $service_data);\n\n foreach ($service_data as $sid => $schedule) {\n ?>\n <tr>\n <td><?php echo $schedule[\"host_name\"]; ?></td>\n <td><?php echo $schedule[\"service_description\"]; ?></td>\n <td><?php echo encode_form_val($schedule[\"comment\"]); ?></td>\n <td><?php echo $schedule[\"time\"]; ?></td>\n <td><?php echo $schedule[\"duration\"]; ?></td>\n <td><?php if ($schedule[\"days_of_week\"]) {\n echo $schedule[\"days_of_week\"];\n } else {\n echo \"All\";\n } ?></td>\n <td><?php if ($schedule[\"days_of_month\"]) {\n echo $schedule[\"days_of_month\"];\n } else {\n echo \"All\";\n } ?></td>\n <td style=\"text-align:center;width:60px\">\n <?php if (!is_readonly_user(0)) { ?>\n <a href=\"<?php echo 'recurringdowntime.php'. \"?mode=edit&sid=\" . $sid . \"&return=\" . urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23service-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\"><img src=\"<?php echo theme_image('pencil.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Edit schedule'); ?>\" alt=\"<?php echo _('Edit'); ?>\"></a>\n <a onClick=\"javascript:return do_delete_sid('<?php echo $sid; ?>');\" href=\"javascript:void(0);\" title=\"<?php echo _('Delete Schedule'); ?>\"><img src=\"<?php echo theme_image('cross.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Delete schedule'); ?>\" alt=\"<?php echo _('Delete'); ?>\"></a>\n <?php }?>\n </td>\n </tr>\n <?php } // end foreach ?>\n\n <?php } else { ?>\n <tr>\n <td colspan=\"9\">\n <div style=\"padding:4px\">\n <em><?php echo _(\"There are currently no host/service recurring downtime events defined.\"); ?></em>\n </div>\n </td>\n </tr>\n <?php } // end if service_data ?>\n </table>\n\n <?php if ($showall) echo \"</div>\"; // end service tab?>\n\n<?php } // end if service or showall\n\nif (!empty($_GET[\"hostgroup\"]) || $showall) {\n\n $hostgroup = grab_request_var('hostgroup', '');\n\n if ($showall) {\n echo \"<div id='hostgroup-tab'>\";\n }\n ?>\n\n <h4><?php echo $hostgroup_tbl_header; ?></h4>\n\n <?php\n if (!is_readonly_user(0)) {\n if ($hostgroup) {\n ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=hostgroup&hostgroup_name=<?php echo $hostgroup; ?>&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23hostgroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add schedule for this hostgroup\"); ?></a>\n </div>\n <?php\n } else {\n ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=hostgroup&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23hostgroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add Schedule\"); ?></a>\n </div>\n <?php\n }\n } // end is_readonly_user\n ?>\n <table class=\"tablesorter table table-condensed table-striped table-bordered\" style=\"width:100%\">\n <thead>\n <tr>\n <th><?php echo _(\"Hostgroup\"); ?></th>\n <th><?php echo _(\"Services\"); ?></th>\n <th><?php echo _(\"Comment\"); ?></th>\n <th><?php echo _(\"Start Time\"); ?></th>\n <th><?php echo _(\"Duration\"); ?></th>\n <th><?php echo _(\"Weekdays\"); ?></th>\n <th><?php echo _(\"Days in Month\"); ?></th>\n <th><?php echo _(\"Actions\"); ?></th>\n </tr>\n </thead>\n <tbody>\n\n <?php\n\n if ($hostgroup_data) {\n $i = 0;\n\n $hostgroup_names = array();\n foreach ($hostgroup_data as $k => $data) {\n $hostgroup_names[$k] = $data['hostgroup_name'];\n }\n\n array_multisort($hostgroup_names, SORT_ASC, $hostgroup_data);\n\n foreach ($hostgroup_data as $sid => $schedule) {\n ?>\n <tr>\n <td><?php echo $schedule[\"hostgroup_name\"]; ?></td>\n <td><?php echo (isset($schedule[\"svcalso\"]) && $schedule[\"svcalso\"] == 1) ? \"Yes\" : \"No\"; ?></td>\n <td><?php echo encode_form_val($schedule[\"comment\"]); ?></td>\n <td><?php echo $schedule[\"time\"]; ?></td>\n <td><?php echo $schedule[\"duration\"]; ?></td>\n <td><?php if ($schedule[\"days_of_week\"]) {\n echo $schedule[\"days_of_week\"];\n } else {\n echo \"All\";\n } ?></td>\n <td><?php if ($schedule[\"days_of_month\"]) {\n echo $schedule[\"days_of_month\"];\n } else {\n echo \"All\";\n } ?></td>\n <td style=\"text-align:center;width:60px\">\n <?php if (!is_readonly_user(0)) { ?>\n <a href=\"<?php echo 'recurringdowntime.php' . \"?mode=edit&sid=\" . $sid . \"&return=\" . urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23hostgroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" title=\"Edit Schedule\"><img src=\"<?php echo theme_image('pencil.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Edit schedule'); ?>\" alt=\"<?php echo _('Edit'); ?>\"></a>\n <a onClick=\"javascript:return do_delete_sid('<?php echo $sid; ?>');\" href=\"javascript:void(0);\" title=\"<?php echo _('Delete Schedule'); ?>\"><img src=\"<?php echo theme_image('cross.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Delete schedule'); ?>\" alt=\"<?php echo _('Delete'); ?>\"></a>\n <?php } ?>\n </td>\n </tr>\n <?php } // end foreach ?>\n <?php } else { ?>\n <tr>\n <td colspan=\"8\">\n <div style=\"padding:4px\">\n <em><?php echo _(\"There are currently no hostgroup recurring downtime events defined.\"); ?></em>\n </div>\n </td>\n </tr>\n <?php } // end if hostrgroup_data ?>\n </tbody>\n </table>\n\n <?php if ($showall) echo \"</div>\"; // end hostgroup tab?>\n\n<?php } // end if hostgroup or showall\n\nif (!empty($_GET[\"servicegroup\"]) || $showall) {\n\n $servicegroup = grab_request_var('servicegroup', '');\n\n if ($showall) {\n echo \"<div id='servicegroup-tab'>\";\n }\n ?>\n <h4><?php echo $servicegroup_tbl_header; ?></h4>\n <?php\n if (!is_readonly_user(0)) {\n if ($servicegroup) {\n ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=servicegroup&servicegroup_name=<?php echo $servicegroup; ?>&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23servicegroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add schedule for this servicegroup\"); ?></a>\n </div>\n <?php } else { ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=servicegroup&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23servicegroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add Schedule\"); ?>\n </a>\n </div>\n <?php\n }\n } // end is_readonly_user\n ?>\n <table class=\"tablesorter table table-condensed table-striped table-bordered\" style=\"width:100%\">\n <thead>\n <tr>\n <th><?php echo _(\"Servicegroup\"); ?></th>\n <th><?php echo _(\"Comment\"); ?></th>\n <th><?php echo _(\"Start Time\"); ?></th>\n <th><?php echo _(\"Duration\"); ?></th>\n <th><?php echo _(\"Weekdays\"); ?></th>\n <th><?php echo _(\"Days in Month\"); ?></th>\n <th><?php echo _(\"Actions\"); ?></th>\n </tr>\n </thead>\n <tbody>\n <?php\n\n if ($servicegroup_data) {\n $i = 0;\n\n $servicegroup_names = array();\n foreach ($servicegroup_data as $k => $data) {\n $servicegroup_names[$k] = $data['servicegroup_name'];\n }\n\n array_multisort($servicegroup_names, SORT_ASC, $servicegroup_data);\n\n foreach ($servicegroup_data as $sid => $schedule) {\n ?>\n <tr>\n <td><?php echo $schedule[\"servicegroup_name\"]; ?></td>\n <td><?php echo $schedule[\"comment\"]; ?></td>\n <td><?php echo $schedule[\"time\"]; ?></td>\n <td><?php echo $schedule[\"duration\"]; ?></td>\n <td><?php if ($schedule[\"days_of_week\"]) {\n echo $schedule[\"days_of_week\"];\n } else {\n echo \"All\";\n } ?></td>\n <td><?php if ($schedule[\"days_of_month\"]) {\n echo $schedule[\"days_of_month\"];\n } else {\n echo \"All\";\n } ?></td>\n <td style=\"text-align:center;width:60px\">\n <?php if (!is_readonly_user(0)) { ?>\n <a href=\"recurringdowntime.php?mode=edit&sid=<?php echo $sid; ?>&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23servicegroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" title=\"Edit Schedule\"><img src=\"<?php echo theme_image('pencil.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Edit schedule'); ?>\" alt=\"<?php echo _('Edit'); ?>\"></a>\n <a onClick=\"javascript:return do_delete_sid('<?php echo $sid; ?>');\" href=\"javascript:void(0);\" title=\"<?php echo _('Delete Schedule'); ?>\"><img src=\"<?php echo theme_image('cross.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Delete schedule'); ?>\" alt=\"<?php echo _('Delete'); ?>\"></a>\n <?php } ?>\n </td>\n </tr>\n <?php } // end foreach ?>\n\n <?php } else { ?>\n <tr>\n <td colspan=\"7\">\n <div style=\"padding:4px\">\n <em><?php echo _(\"There are currently no servicegroup recurring downtime events defined.\"); ?></em>\n </div>\n </td>\n </tr>\n <?php } // end if servicegroup_data ?>\n\n\n </tbody>\n </table>\n\n <?php if ($showall) echo \"</div>\"; // end servicegroup tab?>\n\n <?php } // end if servicegroup or showall ?>\n\n <?php\n if ($showall) { // end of tabs container\n ?>\n </div>\n <?php\n }\n do_page_end(true);\n}", "function weekviewFooter()\n\t {\n\t // Read the hours_lock id\n\t $periodid = $this->m_postvars[\"periodid\"];\n\t $viewdate = $this->m_postvars['viewdate'];\n $viewuser = $this->m_postvars['viewuser'];\n\n\t // If the periodid isnt numeric, then throw an error, no action can be\n // taken so no buttons are added to the footer.\n\t if (!is_numeric($periodid))\n\t {\n\t atkerror(\"Posted periodid isn't numeric\");\n\t return \"\";\n\t }\n\n\t // Retrieve the hours_lock record for the specified periodid\n\t $hourslocknode = &atkGetNode(\"timereg.hours_lock\");\n $hourlocks = $hourslocknode->selectDb(\"hours_lock.id='\".$periodid.\"'\n AND (hours_lock.userid='\".$viewuser.\"'\n OR hours_lock.userid IS NULL)\");\n atk_var_dump($hourlocks);\n\n // Don't display any buttons if there are no hourlocks found\n if (count($hourlocks)==0)\n {\n return \"\";\n }\n\n // Determine the approval status\n $hourlockapproved = ($hourlocks[0][\"approved\"]==1);\n\n $output = '<br />' . sprintf(atktext(\"hours_approve_thestatusofthisperiodis\"), $this->m_lockmode) . \": \";\n if ($hourlockapproved)\n {\n $output.= '<font color=\"#009900\">' . atktext(\"approved\") . '</font><br /><br />';\n }\n else\n {\n $output.= '<font color=\"#ff0000\">' . atktext(\"not_approved_yet\") . '</font><br /><br />';\n }\n\n // Add an approve or disapprove button to the weekview\n\t if (!$hourlockapproved)\n\t {\n\t $output.= atkButton(atktext(\"approve\"),\n dispatch_url(\"timereg.hours_approve\",\"approve\",\n array(\"periodid\"=>$periodid,\n \"viewuser\"=>$viewuser,\n \"viewdate\"=>$viewdate)),\n SESSION_NESTED) . \"&nbsp;&nbsp;\";\n\t }\n\t $output.= atkButton(atktext(\"disapprove\"),\n dispatch_url(\"timereg.hours_approve\",\"disapprove\",\n array(\"periodid\"=>$periodid,\n \"viewuser\"=>$viewuser,\n \"viewdate\"=>$viewdate)),\n SESSION_NESTED);\n\n\t // Return the weekview including button\n\t return $output;\n\t }", "public function index(){\n\t \t@$this->loadModel(\"Dashboard\");\n global $session;\n $dashData = array();\n $dashData = $this->model->getDashboardStat();\n $this->view->oticketcount = $dashData['otcount'];\n $this->view->aticketcount = $dashData['atcount'];\n $this->view->oschedule = $dashData['oschedule'];\n $this->view->oworksheet = $dashData['oworksheet'];\n $this->view->clients = $dashData['clients'];\n $this->view->pendings = $dashData['openPend'];\n $this->view->cproducts = $dashData['cproducts'];\n $lastmonth = (int)date(\"n\")-1;\n $curmonth = date(\"n\");\n\n $this->view->monthreport = $this->model->getMonthlyReportFinance(\" Month(datecreated) ='\".$curmonth.\"' AND Year(datecreated)='\".date(\"Y\").\"'\");\n $this->view->lastmonthreport = $this->model->getLastMonthlyReportFinance(\" Month(datecreated) ='\".$lastmonth.\"' AND Year(datecreated)='\".date(\"Y\").\"'\");\n $this->view->thisquarter = $this->model->getThisQuaterReportFinance(\" Quarter(datecreated) ='\".self::date_quarter().\"' AND Year(datecreated)='\".date(\"Y\").\"'\");\n global $session;\n \n if($session->empright == \"Super Admin\"){\n\t\t $this->view->render(\"dashboard/index\");\n\t\t }elseif($session->empright == \"Customer Support Services\" || $session->empright == \"Customer Support Service\"){\n\t\t $this->view->render(\"support/index\");\n\t\t \n\t\t }elseif($session->empright == \"Customer Support Engineer\" || $session->empright == \"Customer Service Engineer\"){\n @$this->loadModel(\"Itdepartment\");\n global $session;\n $datan =\"\";\n $uri = new Url(\"\");\n //$empworkdata = $this->model->getWorkSheetEmployee($id,\"\");\n \n $ptasks = Worksheet::find_by_sql(\"SELECT * FROM work_sheet_form WHERE cse_emp_id =\".$_SESSION['emp_ident'] );\n // print_r($ptasks);\n //$empworkdata['worksheet'];\n $x=1;\n $datan .=\"<table width='100%'>\n <thead><tr>\n \t<th>S/N</th><th>Prod ID</th><th>Status</th><th>Emp ID</th><th>Issue</th><th>Date Generated </th><th></th><th></th>\n </tr>\n </thead>\n <tbody>\";\n if($ptasks){\n \n foreach($ptasks as $task){\n $datan .= \"<tr><td>$x</td><td>$task->prod_id</td><td>$task->status </td><td>$task->cse_emp_id</td><td>$task->problem</td><td>$task->sheet_date</td><td><a href='\".$uri->link(\"itdepartment/worksheetdetail/\".$task->id.\"\").\"'>View Detail</a></td><td></td></tr>\";\n $x++;\n }\n }else{\n $datan .=\"<tr><td colspan='8'></td></tr>\";\n } \n $datan .=\"</tbody></table>\";\n \n $mysched =\"<div id='transalert'>\"; $mysched .=(isset($_SESSION['message']) && !empty($_SESSION['message'])) ? $_SESSION['message'] : \"\"; $mysched .=\"</div>\";\n \n $psched = Schedule::find_by_sql(\"SELECT * FROM schedule WHERE status !='Closed' AND emp_id =\".$_SESSION['emp_ident'].\" ORDER BY id DESC\" );\n //print_r($psched);\n //$empworkdata['worksheet'];\n $x=1;\n $mysched .=\"<table width='100%'>\n <thead><tr>\n \t<th>S/N</th><th>Machine</th><th>Issue</th><th>Location</th><th>Task Type</th><th>Task Date </th><th></th><th></th><th></th>\n </tr>\n </thead>\n <tbody>\";\n if($psched){\n \n foreach($psched as $task){\n $mysched .= \"<tr><td>$x</td><td>$task->prod_name</td><td>$task->issue </td>\"; \n $machine = Cproduct::find_by_id($task->prod_id);\n \n $mysched .= \"<td>$machine->install_address $machine->install_city</td><td>$task->maint_type</td><td>$task->s_date</td><td>\";\n \n if($task->status == \"Open\"){\n $mysched .=\"<a scheddata='{$task->id}' class='acceptTask' href='#'>Accept Task</a>\";\n }\n if($task->status == \"In Progress\"){\n $mysched .=\"<a href='\".$uri->link(\"itdepartment/worksheetupdateEmp/\".$task->id.\"\").\"'>Get Work Sheet</a>\";\n }\n \n $mysched .=\"\n \n <div id='myModal{$task->id}' class='reveal-modal'>\n <h2>Accept Task </h2>\n <p class='lead'>Click on the button below to accept task! </p>\n <form action='?url=itdepartment/doAcceptTask' method='post'>\n <input type='hidden' value='{$task->id}' name='mtaskid' id='mtaskid' />\n <p><a href='#' data-reveal-id='secondModal' class='secondary button acceptTast' >Accept</a></p>\n </form>\n <a class='close-reveal-modal'>&#215;</a>\n</div>\n\n\n \n \n </td><td></td><td></td></tr>\";\n $x++;\n }\n }else{\n $mysched .=\"<tr><td colspan='8'>There is no task currently</td></tr>\";\n } \n $mysched .=\"</tbody></table>\";\n \n $this->view->oldtask = $datan;\n $this->view->schedule = $mysched;\n $this->view->mee = $this->model->getEmployee($_SESSION['emp_ident']);\n $this->view->render(\"itdepartment/staffaccount\");\n\t\t }else{\n\t\t $this->view->render(\"login/index\",true);\n\t\t }\n\t\t\n\t}", "public function changeWeek(Request $request,$next_date){\n\n $start_date=Carbon::parse($next_date)->addDay(1);\n $date = Carbon::parse($next_date)->addDay(1);\n\n \n $end_date=Carbon::parse($start_date)->addDay(7);\n $this_week= $week_number = $end_date->weekOfYear;\n \n $period = CarbonPeriod::create($start_date, $end_date);\n \n\n $dates=[];\n foreach ($period as $date){\n $dates[] = $date->format('Y-m-d');\n \n }\n \n if (ApiBaseMethod::checkUrl($request->fullUrl())) {\n $user_id = $id;\n } else {\n $user = Auth::user();\n\n if ($user) {\n $user_id = $user->id;\n } else {\n $user_id = $request->user_id;\n }\n }\n\n $student_detail = SmStudent::where('user_id', $user_id)->first();\n //return $student_detail;\n $class_id = $student_detail->class_id;\n $section_id = $student_detail->section_id;\n\n $sm_weekends = SmWeekend::orderBy('order', 'ASC')->where('active_status', 1)->where('school_id',Auth::user()->school_id)->get();\n\n $class_times = SmClassTime::where('type', 'class')->where('academic_id', getAcademicId())->where('school_id',Auth::user()->school_id)->get();\n\n if (ApiBaseMethod::checkUrl($request->fullUrl())) {\n $data = [];\n $data['student_detail'] = $student_detail->toArray();\n $weekenD = SmWeekend::all();\n foreach ($weekenD as $row) {\n $data[$row->name] = DB::table('sm_class_routine_updates')\n ->select('sm_class_times.period', 'sm_class_times.start_time', 'sm_class_times.end_time', 'sm_subjects.subject_name', 'sm_class_rooms.room_no')\n ->join('sm_classes', 'sm_classes.id', '=', 'sm_class_routine_updates.class_id')\n ->join('sm_sections', 'sm_sections.id', '=', 'sm_class_routine_updates.section_id')\n ->join('sm_class_times', 'sm_class_times.id', '=', 'sm_class_routine_updates.class_period_id')\n ->join('sm_subjects', 'sm_subjects.id', '=', 'sm_class_routine_updates.subject_id')\n ->join('sm_class_rooms', 'sm_class_rooms.id', '=', 'sm_class_routine_updates.room_id')\n\n ->where([\n ['sm_class_routine_updates.class_id', $class_id], ['sm_class_routine_updates.section_id', $section_id], ['sm_class_routine_updates.day', $row->id],\n ])->where('sm_class_routine_updates.academic_id', getAcademicId())->where('sm_classesschool_id',Auth::user()->school_id)->get();\n }\n\n return ApiBaseMethod::sendResponse($data, null);\n }\n\n return view('lesson::student.student_lesson_plan', compact('dates','this_week','class_times', 'class_id', 'section_id', 'sm_weekends'));\n \n }", "public function index($view='week',$ref_datetime=false){\n\n $view = strtolower($view);\n\n if(!in_array($view,array('day','week','month','list'))){\n $this->_setFlash('Invalid view specified.');\n return $this->redirect($this->referer(array('action' => 'index')));\n }\n\n if($ref_datetime === false)\n $ref_datetime = time();\n\n $start_datetime = false;\n $end_datetime = false;\n $viewDescription = false;\n\n //Adjust start date/time based on the current reference time\n if($view == 'day'){\n $start_datetime = strtotime('today midnight', $ref_datetime);\n $end_datetime = strtotime('tomorrow midnight', $start_datetime);\n $previous_datetime = strtotime('yesterday midnight', $start_datetime);\n $next_datetime = $end_datetime;\n $viewDescription = date('M, D j',$start_datetime);\n }\n elseif($view == 'week') {\n $start_datetime = strtotime('Monday this week', $ref_datetime);\n $end_datetime = strtotime('Monday next week', $start_datetime);\n $previous_datetime = strtotime('Monday last week', $start_datetime);\n $next_datetime = $end_datetime;\n $viewDescription = date('M j', $start_datetime) . \" - \" . date('M j', $end_datetime-1);\n }\n elseif($view == 'month') {\n $start_datetime = strtotime('first day of this month', $ref_datetime);\n $end_datetime = strtotime('first day of next month', $start_datetime);\n $previous_datetime = strtotime('first day of last month', $start_datetime);\n $next_datetime = $end_datetime;\n $viewDescription = date('F \\'y', $start_datetime);\n }\n else { //list\n $start_datetime = strtotime('first day of January this year', $ref_datetime);\n $end_datetime = strtotime('first day of January next year', $start_datetime);\n $previous_datetime = strtotime('first day of January last year', $start_datetime);\n $next_datetime = $end_datetime;\n $viewDescription = date('Y', $start_datetime);\n }\n\n $start_datetime_db = date('Y-m-d H:i:s', $start_datetime);\n $end_datetime_db = date('Y-m-d H:i:s', $end_datetime);\n\n $entries = $this->CalendarEntry->find('all',array(\n 'contain' => array(),\n 'conditions' => array(\n 'OR' => array(\n array(\n 'start >=' => $start_datetime_db,\n 'start < ' => $end_datetime_db\n ),\n array(\n 'end >=' => $start_datetime_db,\n 'end <' => $end_datetime_db\n )\n )\n ),\n 'order' => array(\n 'start' => 'desc'\n )\n ));\n\n //Group entries appropriately\n $grouped_entries = array(); \n $group_offset = false;\n $group_index = 0;\n if($view == 'day'){\n //Group by hour\n $group_offset = self::HOUR_SECONDS;\n }\n elseif($view == 'week'){\n //Group by day\n $group_offset = self::DAY_SECONDS;\n }\n elseif($view == 'month'){\n //Group by week\n $group_offset = self::WEEK_SECONDS;\n }\n else {\n //Group by month\n $group_offset = self::DAY_SECONDS*31; //31 days in Jan\n }\n $group_starttime = $start_datetime;\n $group_endtime = $start_datetime + $group_offset - 1;\n while($group_starttime < $end_datetime){\n $grouped_entries[$group_index] = array(\n 'meta' => array(\n 'starttime' => $group_starttime,\n 'endtime' => $group_endtime\n ),\n 'items' => array()\n );\n foreach($entries as $entry){\n $entry_starttime = strtotime($entry['CalendarEntry']['start']);\n $entry_endtime = strtotime($entry['CalendarEntry']['end']);\n if($entry_starttime >= $group_starttime && $entry_starttime < $group_endtime){\n $grouped_entries[$group_index]['items'][] = $entry;\n continue;\n }\n if($entry_endtime > $group_starttime && $entry_endtime < $group_endtime){\n $grouped_entries[$group_index]['items'][] = $entry;\n }\n }\n $group_index++;\n\n if($view == 'list'){\n $group_starttime = $group_endtime + 1;\n $group_endtime = strtotime('first day of next month', $group_starttime) - 1;\n }\n else {\n $group_starttime += $group_offset;\n $group_endtime += $group_offset;\n if($group_endtime > $end_datetime)\n $group_endtime = $end_datetime-1;\n }\n }\n\n $this->set(array(\n 'view' => $view,\n 'viewDescription' => $viewDescription,\n 'calendarItems' => $grouped_entries,\n 'currentDatetime' => $start_datetime,\n 'previousDatetime' => $previous_datetime,\n 'nextDatetime' => $next_datetime\n ));\n }", "public function week()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$disable = array(\n\t\t\t'categories',\n\t\t\t'category_fields',\n\t\t\t'custom_fields',\n\t\t\t'member_data',\n\t\t\t'pagination',\n\t\t\t'trackbacks'\n\t\t);\n\n\t\t$params = array(\n\t\t\tarray(\n\t\t\t\t'name' => 'category',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'site_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'min_value' => 1,\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'default' => $this->data->get_site_id()\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'calendar_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'calendar_name',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'event_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'event_name',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'event_limit',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'status',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'default' => 'open'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'date_range_start',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'date'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'time_range_start',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'time',\n\t\t\t\t'default' => '0000'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'time_range_end',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'time',\n\t\t\t\t'default' => '2400'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'enable',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'default' => '',\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'allowed_values' => $disable\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'first_day_of_week',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'default' => $this->first_day_of_week\n\t\t\t)\n\t\t);\n\n\t\t//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t// -------------------------------------\n\t\t// Need to modify the starting date?\n\t\t// -------------------------------------\n\n\t\t$this->first_day_of_week = $this->P->value('first_day_of_week');\n\n\t\tif ($this->P->value('date_range_start') === FALSE)\n\t\t{\n\t\t\t$this->P->set('date_range_start', $this->CDT->datetime_array());\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->CDT->change_date(\n\t\t\t\t$this->P->value('date_range_start', 'year'),\n\t\t\t\t$this->P->value('date_range_start', 'month'),\n\t\t\t\t$this->P->value('date_range_start', 'day')\n\t\t\t);\n\t\t}\n\n\t\t$drs_dow = $this->P->value('date_range_start', 'day_of_week');\n\n\t\tif ($drs_dow != $this->first_day_of_week)\n\t\t{\n\t\t\tif ($drs_dow > $this->first_day_of_week)\n\t\t\t{\n\t\t\t\t$offset = ($drs_dow - $this->first_day_of_week);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$offset = (7 - ($this->first_day_of_week - $drs_dow));\n\t\t\t}\n\n\t\t\t$this->P->set('date_range_start', $this->CDT->add_day(-$offset));\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Define parameters specific to this calendar view\n\t\t// -------------------------------------\n\n\t\t$this->CDT->change_ymd($this->P->value('date_range_start', 'ymd'));\n\t\t$this->P->set('date_range_end', $this->CDT->add_day(6));\n\t\t$this->P->set('pad_short_weeks', FALSE);\n\n\t\t// -------------------------------------\n\t\t// Define our tagdata\n\t\t// -------------------------------------\n\n\t\t$find = array(\n\t\t\t'EVENTS_PLACEHOLDER',\n\t\t\t'{/',\n\t\t\t'{',\n\t\t\t'}'\n\t\t);\n\n\t\t$replace = array(\n\t\t\tee()->TMPL->tagdata,\n\t\t\tLD.T_SLASH,\n\t\t\tLD,\n\t\t\tRD\n\t\t);\n\n\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t$find,\n\t\t\t$replace,\n\t\t\t$this->view(\n\t\t\t\t'week.html',\n\t\t\t\tarray(),\n\t\t\t\tTRUE,\n\t\t\t\t$this->sc->addon_theme_path . 'templates/week.html'\n\t\t\t)\n\t\t);\n\n\t\t// -------------------------------------\n\t\t// Tell TMPL what we're up to\n\t\t// -------------------------------------\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'events'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['events'] = TRUE;\n\t\t}\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'display_each_hour'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['display_each_hour'] = TRUE;\n\t\t}\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'display_each_day'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['display_each_day'] = TRUE;\n\t\t}\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'display_each_week'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['display_each_week'] = TRUE;\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// If you build it, they will know what's going on.\n\t\t// -------------------------------------\n\n\t\t$this->parent_method = __FUNCTION__;\n\n\t\treturn $this->build_calendar();\n\t}", "public function index() {\n $currentDate = (new Datetime())->format('Y-m-d');\n \t$timesheets = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->get();\n \t$schedule = Schedule::whereDate('start_date','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->get();\n \t//Get total time worked\n \t$hours = 0;\n \tforeach ($timesheets as $timesheet) {\n\t \t$date1 = new Datetime($timesheet->start_time);\n\t\t\t$date2 = new Datetime($timesheet->end_time);\n\t\t\t$diff = $date2->diff($date1);\n\n $hours = $hours + (($diff->h * 60) + $diff->i);\n \t}\n //Get total breaks\n $breaks = 0;\n $first_timesheet = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->first();\n $last_timesheet = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->latest()->first();\n if($first_timesheet){\n $date1 = new Datetime($first_timesheet->start_time);\n $date2 = new Datetime($last_timesheet->end_time);\n $diff = $date2->diff($date1);\n $breaks = (($diff->h * 60) + $diff->i) - $hours;\n }\n\n $worked = $this->hoursandmins($hours);\n $breaks = $this->hoursandmins($breaks);\n // First Punch In in current day\n $first_punch_in = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->first();\n return view('attendance/index', ['timesheets'=>$timesheets, 'schedule'=>$schedule, 'first_punch_in'=>$first_punch_in, 'worked'=>$worked, 'breaks'=>$breaks, 'first_timesheet'=>$first_timesheet, 'last_timesheet'=>$last_timesheet]);\n }", "public function listAction()\r\n {\r\n $pid = $this->_getParam('projectid');\r\n $where = array();\r\n if ($pid) {\r\n $where['projectid='] = $pid;\r\n }\r\n $cid = $this->_getParam('clientid');\r\n if ($cid) {\r\n $where['clientid='] = $cid;\r\n }\r\n \r\n $this->view->timesheets = $this->projectService->getTimesheets($where);\r\n \r\n $this->renderView('timesheet/list.php');\r\n }", "public function index()\n\t{\n\n $n = Input::has('n') ? Input::get('n'): 1 ;\n $day = date('w');\n $member = Confide::user()->youthMember ;\n\n $week_start = date('Y-m-d', strtotime('+'.($n*7-$day+1).' days'));\n\n\n $week_end = date('Y-m-d', strtotime('+'.(6-$day+$n*7).' days'));\n $shifts = $member->shifts()->whereRaw('date <= ? and date >= ?' , array($week_end ,$week_start))->get();\n\n $tds = array();\n if($shifts->count())\n {\n foreach($shifts as $shift)\n {\n array_push($tds ,\"td.\".($shift->time).($shift->gate).($shift->date->toDateString()));\n }\n }\n if(Request::ajax())\n {\n if ($n == 0)\n {\n return Response::json(['flag' => false ,'msg' => 'Không thể đăng ký cho tuần hiện tại']);\n }\n if($n > 3)\n {\n return Response::json(['flag' => false ,'msg' => 'Không thể đăng ký cho qúa 3 tuần ']);\n\n }\n $html = View::make('shift.partial.table', array('day' => $day , 'n' => $n ) )->render();\n return Response::json(['flag' => true ,'msg' => 'success' , 'html' => $html ,'tds' =>$tds]);\n\n }\n\n return View::make('shift.index',array('day' => $day , 'n' => $n ,'tds' => $tds));\n\n// var_dump($day);\n// var_dump($week_end);\n// var_dump($week_start_0);\n// var_dump($week_start_1);\n// var_dump($test);\n\t}", "public function addWorklog($timesheetId, Request $request){\n\n }", "public function index(Request $request)\n {\n try {\n $modelData = $this->apiCrudHandler->index($request, Weekend::class);\n return $this->sendResponse($modelData);\n } catch (Exception $e) {\n return $this->sendError($e->getMessage());\n }\n }", "public function calculateWeeklyCosts(){\n $view = $this->view;\n $view->setNoRender();\n \n \n Service::loadModels('user', 'user');\n Service::loadModels('team', 'team');\n Service::loadModels('people', 'people');\n Service::loadModels('league', 'league');\n Service::loadModels('car', 'car');\n Service::loadModels('rally', 'rally');\n $teamService = parent::getService('team','team');\n \n /*\n * Wydatki : \n * 1. Pensje zawodnikow\n * 2. Koszty utrzymania samochodu\n * \n * Przychody : \n * 1. Od sponsora (5000)\n */\n \n $teams = $teamService->getAllTeams();\n foreach($teams as $team):\n $playersValue = $teamService->getAllTeamPlayersSalary($team);\n if($playersValue!=0)\n $teamService->removeTeamMoney($team['id'],$playersValue,4,'Player salaries '); \n \n \n $carUpkeep = $teamService->getAllTeamCarsUpkeep($team);\n if($carUpkeep!=0)\n $teamService->removeTeamMoney($team['id'],$carUpkeep,5,'Cars upkeep'); \n \n if(!empty($team['sponsor_id'])){\n $teamService->addTeamMoney($team['id'],5000,2,'Money from '.$team['Sponsor']['name'].' received on '.date('Y-m-d')); \n }\n \n if($team['cash']<0){\n $negativeFinances = (int)$team->get('negative_finances');\n $negativeFinances++;\n $team->set('negative_finances',$negativeFinances);\n $team->save();\n \n if($negativeFinances>=5){\n $team->delete();\n $user = $team->get('User');\n $user->set('active',0);\n $user->save();\n }\n }\n else{\n $team->set('negative_finances',0);\n }\n \n $team->save();\n \n endforeach;\n echo \"done\";exit;\n }", "function update_week(){\n\t\t$time = array('id'=>1, 'ending_date' => date('Y-m-d'));\n\t\treturn $this->save($time);\n\t}", "public function changeWeek($next_date)\n{\n try {\n $start_date=Carbon::parse($next_date)->addDay(1);\n $date = Carbon::parse($next_date)->addDay(1);\n\n\n $end_date=Carbon::parse($start_date)->addDay(7);\n $this_week= $week_number = $end_date->weekOfYear;\n\n $period = CarbonPeriod::create($start_date, $end_date);\n\n\n $dates=[];\n foreach ($period as $date){\n $dates[] = $date->format('Y-m-d');\n\n }\n\n $login_id = Auth::user()->id;\n $teachers = SmStaff::where('active_status', 1)->where('user_id',$login_id)->where('role_id', 4)->where('school_id', Auth::user()->school_id)->first();\n\n $user = Auth::user();\n $class_times = SmClassTime::where('academic_id', getAcademicId())->where('school_id', Auth::user()->school_id)->orderBy('period', 'ASC')->get();\n $teacher_id =$teachers->id;\n $sm_weekends = SmWeekend::where('school_id', Auth::user()->school_id)->orderBy('order', 'ASC')->where('active_status', 1)->get();\n\n $data = [];\n $data['message'] = 'operation Successful';\n return ApiBaseMethod::sendResponse($data, null);\n\n } catch (Exception $e) {\n return ApiBaseMethod::sendError('operation Failed');\n }\n\n}", "public function summaryAction()\r\n {\r\n \t$timesheetid = -1;\r\n\r\n // Okay, so if we were passed in a timesheet, it means we want to view\r\n // the data for that timesheet. However, if that timesheet is locked, \r\n // we want to make sure that the tasks being viewed are ONLY those that\r\n // are found in that locked timesheet.\r\n $timesheet = $this->byId();\r\n\r\n $start = null;\r\n $end = null;\r\n $this->view->showLinks = true;\r\n $cats = array();\r\n\r\n $users = $this->userService->getUserList();\r\n\r\n if (!$start) {\r\n\t // The start date, if not set in the parameters, will be just\r\n\t // the previous monday\r\n\t $start = $this->_getParam('start', $this->calculateDefaultStartDate());\r\n\t // $end = $this->_getParam('end', date('Y-m-d', time()));\r\n\t $end = $this->_getParam('end', date('Y-m-d 23:59:59', strtotime($start) + (6 * 86400)));\r\n }\r\n\r\n // lets normalise the end date to make sure it's of 23:59:59\r\n\t\t$end = date('Y-m-d 23:59:59', strtotime($end));\r\n\r\n $order = 'endtime desc';\r\n\r\n $this->view->taskInfo = array();\r\n\r\n $project = null;\r\n if ($this->_getParam('projectid')) {\r\n \t$project = $this->projectService->getProject($this->_getParam('projectid'));\r\n }\r\n \r\n foreach ($users as $user) {\r\n \t$this->view->taskInfo[$user->username] = $this->projectService->getTimesheetReport($user, $project, null, -1, $start, $end, $cats, $order);\r\n }\r\n \r\n $task = new Task();\r\n \r\n $this->view->categories = $task->constraints['category']->getValues();\r\n $this->view->startDate = $start;\r\n $this->view->endDate = $end;\r\n $this->view->params = $this->_getAllParams();\r\n $this->view->dayDivision = za()->getConfig('day_length', 8) / 4; // za()->getConfig('day_division', 2);\r\n $this->view->divisionTolerance = za()->getConfig('division_tolerance', 20);\r\n \r\n $this->renderView('timesheet/user-report.php');\r\n }", "private function renderWeekSchedule($request)\n {\n $services = app('ServicesRepository');\n\n // Get the service URI for which we need to compute the week schedule\n $serviceUri = $request->input('serviceUri');\n $channel = $request->input('channel');\n\n // Get the service\n $service = $services->where('uri', $serviceUri)->first();\n\n if (empty($service)) {\n return response()->json(['message' => 'The service was not found.'], 404);\n }\n\n return $this->formatWeek($service['id'], 'array', $channel);\n }", "public function getWaiverTransactionByWeek_post() {\n $this->form_validation->set_rules('ContestGUID', 'ContestGUID', 'trim|required|callback_validateEntityGUID[Contest,ContestID]');\n $this->form_validation->validation($this); /* Run validation */\n $TransactionHistory = $this->SnakeDrafts_model->getWaiverTransactionByWeek($this->ContestID);\n if ($TransactionHistory) {\n $this->Return['Data'] = $TransactionHistory;\n }\n }", "function weeklyQuotesAction(){\n\t\t\n\t\t\n\t\t$request=$this->_request->getParams();\n\t\t\n\t\t\n\t\t\t $quotecron_obj = new Ep_Quote_Cron();\n\t\t\t $quotes=$quotecron_obj->getweeklyquotes();\n\t\t\t $quoteDetails=array();\n\t\t\t $quoteslern=array();\n\t\t\t $quotesusertotal=array();\n\t\t\t $date7day = date('Y-m-d H:i:s',time()-(7*86400));\n\t\t\t\t\t\t$html=\"<table class='table-bordered table-hover'>\";\n\t\t\t\t\t\tif(count($quotes)>0){\n\t\t\t\t\t\t\t\t\t\t $quotetotal=0;\n\t\t\t\t\t\t\t\t\t\t $turnover=0;\n\t\t\t\t\t\t\t\t\t\t $signature=0;\n\t\t\t\t\t\t\t\t\t\t $i=0;\n\t\t\t\t\t\t\t\t\t\t $usertotal=1;\n\t\t\t\t\t\t\t\tforeach($quotes as $quotescheck){\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif(($quotescheck['created_at']>=$date7day && $quotescheck['created_at']<=date('Y-m-d') )&& ($quotescheck['sales_review']=='not_done' || $quotescheck['sales_review']=='challenged' || $quotescheck['sales_review']=='to_be_approve') ){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quotetotal++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$turnover+=$quotescheck['turnover'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$signature+=$quotescheck['estimate_sign_percentage'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['identifier']=$quotescheck['identifier'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$mrgin=explode('.',$quotescheck['sales_margin_percentage']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['company_name']=$quotescheck['company_name'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['bosalesuser']=$quotescheck['bosalesuser'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['title']=\"<a href='http://\".$_SERVER['HTTP_HOST'].\"/quote/quote-followup?quote_id=\".$quotescheck['identifier'].\"&submenuId=ML13-SL2' target='_blank'>\".$quotescheck['title'].\"</a>\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['estimate_sign_percentage']=$quotescheck['estimate_sign_percentage'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['turnover']=$quotescheck['turnover'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['saleinchange']=$quotescheck['bosalesuser'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['created_at']=date('Y-m-d',strtotime($quotescheck['created_at']));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['status']='Ongoing';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif($quotescheck['seo_timeline']<time() && $quotescheck['seo_timeline']!='')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$team= 'Seo ';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telseif($quotescheck['tech_timeline']<time() && $quotescheck['tech_timeline']!='')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$team= 'Tech ';\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telseif($quotescheck['prod_timeline']<time() && $quotescheck['prod_timeline']!=0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$team= 'Prod ';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['team']=$team;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif($quotescheck['response_time']>time()){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['notiontime']='Late No';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['notiontime']='Late Yes';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['quote_by']=$quotescheck['quote_by'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telseif($quotescheck['sales_review']=='closed' && $quotescheck['closed_reason']!='quote_permanently_lost' && $quotescheck['releaceraction']!=''){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quotetotal++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$turnover+=$quotescheck['turnover'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$signature+=$quotescheck['estimate_sign_percentage'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['identifier']=$quotescheck['identifier'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$mrgin=explode('.',$quotescheck['sales_margin_percentage']);\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['company_name']=utf8_decode($quotescheck['company_name']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['estimate_sign_percentage']=$quotescheck['estimate_sign_percentage'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['turnover']=$quotescheck['turnover'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['saleinchange']=$quotescheck['bosalesuser'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['title']=\"<a href='http://\".$_SERVER['HTTP_HOST'].\"/quote/quote-followup?quote_id=\".$quotescheck['identifier'].\"&submenuId=ML13-SL2' target='_blank'>\".$quotescheck['title'].\"</a>\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['created_at']=date('Y-m-d',strtotime($quotescheck['created_at']));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['status']='A relancer';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['team']='Relanc&#233;';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/*$validate_date= new DateTime($quotecron_obj->getquotesvalidatelog($quotescheck['identifier'])[0]['action_at']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $sent_days= $validate_date->diff(new DateTime(date(\"Y-m-d H:i:s\")));*/\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $sent_days=dateDiff($quotecron_obj->getquotesvalidatelog($quotescheck['identifier'])[0]['action_at'],date(\"Y-m-d H:i:s\"));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['notiontime']='Quote sent '.$sent_days.' on days ago';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$quoteslern[$i]['comments']='closed on '.$quotescheck['releaceraction'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['quote_by']=$quotescheck['quote_by'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telseif($quotescheck['sales_review'] == 'validated' && $quotescheck['validateaction']!=\"\" ){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quotetotal++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $turnover+=$quotescheck['turnover'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $signature+=$quotescheck['estimate_sign_percentage'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['identifier']=$quotescheck['identifier'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $mrgin=explode('.',$quotescheck['sales_margin_percentage']);\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['company_name']=utf8_decode($quotescheck['company_name']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['estimate_sign_percentage']=$quotescheck['estimate_sign_percentage'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['turnover']=$quotescheck['turnover'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['saleinchange']=$quotescheck['bosalesuser'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['title']=\"<a href='http://\".$_SERVER['HTTP_HOST'].\"/quote/quote-followup?quote_id=\".$quotescheck['identifier'].\"&submenuId=ML13-SL2' target='_blank'>\".$quotescheck['title'].\"</a>\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['created_at']=date('Y-m-d',strtotime($quotescheck['created_at']));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['quote_by']=$quotescheck['quote_by'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['status']='Sent';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t /*$sent_days= $validate_date->diff(new DateTime(date(\"Y-m-d H:i:s\")));*/\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $sent_days=dateDiff($quotescheck['validateaction'], date(\"Y-m-d H:i:s\"));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['notiontime']='Quote sent '.$sent_days.' on days ago';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['comments']='closed on '.$quotescheck['validateaction'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['team']='/';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telseif($quotescheck['sales_review'] == 'closed' && ($quotescheck['closed_reason']=='quote_permanently_lost' || $quotescheck['closeaction']!=\"\" || $quotescheck['close5dayaction']!=\"\" || $quotescheck['close20dayaction']!=\"\" || $quotescheck['close30dayaction']!=\"\") ){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $mrgin=explode('.',$quotescheck['sales_margin_percentage']);\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['identifier']=$quotescheck['identifier'];\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['company_name']=utf8_decode($quotescheck['company_name']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['estimate_sign_percentage']=$quotescheck['estimate_sign_percentage'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['turnover']=$quotescheck['turnover'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['saleinchange']=$quotescheck['bosalesuser'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['created_at']=date('Y-m-d',strtotime($quotescheck['created_at']));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['status']='Closed';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/* $validate_date= new DateTime($quotecron_obj->getquotesvalidatelog($quotescheck['identifier'])[0]['action_at']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $sent_days= $validate_date->diff(new DateTime(date(\"Y-m-d H:i:s\")));*/\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $sent_days=dateDiff($quotecron_obj->getquotesvalidatelog($quotescheck['identifier'])[0]['action_at'],date(\"Y-m-d H:i:s\"));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['notiontime']='Quote sent '.$sent_days.' on days ago';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['comments']= $quotescheck['closed_comments'].'<br> closed on '.$quotescheck['closeaction'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['team']=$this->closedreason[$quotescheck['closed_reason']];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $quoteslern[$i]['title']=\"<a href='http://\".$_SERVER['HTTP_HOST'].\"/quote/quote-followup?quote_id=\".$quotescheck['identifier'].\"&submenuId=ML13-SL2' target='_blank'>\".$quotescheck['title'].\"</a>\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t} // end foreach\n\t\t\t\t\t\t\t\t$quoteDetails['quotetotal']=$quotetotal;\n\t\t\t\t\t\t\t\t$quoteDetails['turnover']=$turnover;\n\t\t\t\t\t\t\t\t$quoteDetails['signature']=round($signature/$quotetotal);\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t $startdate = date('d',time()-(7*86400));\n\t\t\t\t\t\t\t\t\t $enddate= date('d-M-Y',strtotime(date('Y-m-d')));\n\t\t\t\t\t\t\t\t\t$statusdir =$_SERVER['DOCUMENT_ROOT'].\"/BO/quotes_weekly_report/\";\n\t\t\t\t\t\t\t\t\tif(!is_dir($statusdir))\n\t\t\t\t\t\t\t\t\tmkdir($statusdir,TRUE);\n\t\t\t\t\t\t\t\t\tchmod($statusdir,0777);\n\t\t\t\t\t\t\t\t\t$filename = $_SERVER['DOCUMENT_ROOT'].\"/BO/quotes_weekly_report/weekly-report-$startdate-to-$enddate.xlsx\";\n\t\t\t\t\t\t\t\t\t$htmltable = $this->QuotesTable($quoteDetails,$quoteslern);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//save excel file \n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tchmod($filename,0777);\t\n\t\t\t\t\t\t\t\t\t$quoteDetails['startdate']=$startdate;\n\t\t\t\t\t\t\t\t\t$quoteDetails['enddate']=$enddate;\n\t\t\t\t\t\t\t\t\t$this->_view->weely_table_details=$quoteDetails;\n\t\t\t\t\t\t\t\t\t$this->_view->weely_table_quote=$quotes;\n\t\t\t\t\t\t\t\t\t$this->_view->filepath=$filename;\n\t\t\t\t\t\t\t\t\t$this->render('weekly-quotes');\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($request['download']=='report'){\n\t\t\t\t\t\t\t\t\t$this->convertHtmltableToXlsx($htmltable,$filename,True);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->_redirect(\"/quote/download-document?type=weekly&filename=weekly-report-$startdate-to-$enddate.xlsx\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t } //end id\n\t\t\t\t\t\t\n\t\t\t \n\t\t\t}", "public function getCurrentWeek_post() {\n $this->form_validation->set_rules('SessionKey', 'SessionKey', 'trim|required|callback_validateSession');\n $this->form_validation->set_rules('SeriesGUID', 'SeriesGUID', 'trim|callback_validateEntityGUID[Series,SeriesID]');\n $this->form_validation->validation($this); /* Run validation */\n\n /* Get Contests Data */\n $ContestData = $this->SnakeDrafts_model->getCurrentWeek(@$this->SeriesID);\n if (!empty($ContestData)) {\n $this->Return['Data'] = $ContestData;\n }\n }", "public function actionWeekly()\n {\n $this->stdout(\"Executing weekly\n tasks:\\n\\n\", Console::FG_YELLOW);\n\n $this->trigger(self::EVENT_ON_DAILY_RUN);\n\n $this->saveGeneralStats();\n $this->saveUsersStats();\n $this->saveSpacesStats();\n $this->saveActivitiesStats();\n\n $this->stdout(\"\\n\\nYay, it worked. All cron tasks finished.\\n\\n\", Console::FG_GREEN);\n Setting::Set('cronLastDailyRun', time());\n\n return self::EXIT_CODE_NORMAL;\n }", "public function index($date = null)\n {\n $user = Auth::user();\n $workouts = $user->workouts;\n $currentWeek = $user->currentWeek;\n\n //will be checking against this to fix problem where refreshing takes users to previous or next weeks\n $pageWasRefreshed = isset($_SERVER['HTTP_CACHE_CONTROL']) && $_SERVER['HTTP_CACHE_CONTROL'] === 'max-age=0';\n\n if($date && !$pageWasRefreshed){ \n switch($date){\n case 'previous':\n $currentWeek--;\n $user->update(['currentWeek' => $currentWeek]);\n break;\n case 'next':\n $currentWeek++;\n $user->update(['currentWeek' => $currentWeek]);\n break;\n case 'current':\n $currentWeek = date('W');\n $user->update(['currentWeek' => $currentWeek]);\n break;\n }\n }\n\n //Use Currentweek to delegate weeks\n //Refactor this\n\n $dto = new DateTime();\n $ret['monday'] = $dto->setISODate(date('Y'), $currentWeek)->format('Y-m-d');\n $ret['sunday'] = $dto->modify('+6 days')->format('Y-m-d'); \n\n $monday = $ret['monday'];\n $sunday = $ret['sunday'];\n $weekof = $monday;\n \n $mondayWorkout = $this->findWorkout('Monday', $monday, $sunday, $workouts);\n $tuesdayWorkout = $this->findWorkout('Tuesday', $monday, $sunday, $workouts);\n $wednesdayWorkout = $this->findWorkout('Wednesday', $monday, $sunday, $workouts);\n $thursdayWorkout = $this->findWorkout('Thursday', $monday, $sunday, $workouts);\n $fridayWorkout = $this->findWorkout('Friday', $monday, $sunday, $workouts);\n // $saturdayWorkout = $this->findWorkout('Saturday', $monday, $sunday, $workouts);\n // $sundayWorkout = $this->findWorkout('Sunday', $monday, $sunday, $workouts);\n\n if($mondayWorkout){\n $mondayExercises = $mondayWorkout->exercises;\n }\n if($tuesdayWorkout){\n $tuesdayExercises = $tuesdayWorkout->exercises;\n }\n if($wednesdayWorkout){\n $wednesdayExercises = $wednesdayWorkout->exercises;\n }\n if($thursdayWorkout){\n $thursdayExercises = $thursdayWorkout->exercises;\n }\n if($fridayWorkout){\n $fridayExercises = $fridayWorkout->exercises;\n }\n // if($saturdayWorkout){\n // $saturdayExercises = $saturdayWorkout->exercises;\n // } \n // if($sundayWorkout){\n // $sundayExercises = $sundayWorkout->exercises;\n // }\n // \n \n //get the exercises of last week and current day for dashboard\n //for comparison week to week\n \n $lastweekDate = date('Y-m-d', strtotime('-1 week'));\n $lastweekWorkout = $workouts->where('week', $lastweekDate)->first();\n \n if($lastweekWorkout){\n $lastweekExercises = $lastweekWorkout->exercises;\n }\n\n return view('home', compact('weekof', \n 'lastweekWorkout', 'lastweekExercises',\n 'mondayExercises', 'mondayWorkout',\n 'tuesdayExercises', 'tuesdayWorkout',\n 'wednesdayExercises', 'wednesdayWorkout',\n 'thursdayExercises', 'thursdayWorkout',\n 'fridayExercises', 'fridayWorkout'//,\n // 'saturdayExercises', 'saturdayWorkout',\n // 'sundayExercises', 'sundayWorkout'\n ));\n }", "public function actionIndex($week = '', $id = null)\n {\n try {\n if ($id) {\n if (Yii::$app->user->id != $id) {\n if (!AuthHelper::isAdmin()) {\n throw new UnauthorizedHttpException();\n }\n }\n } else {\n $id = Yii::$app->user->id;\n }\n $date = new DateTime();\n $dateStr = $date->format(Constants::DATE_FORMAT);\n if (!empty($week)) {\n $dateStr = $week;\n $date = DateTime::createFromFormat(Constants::DATE_FORMAT, $dateStr); \n }\n $dayOfWeek = $date->format('N');//1 Monday, 7: Sunday \n $fromStr = date(Constants::DATE_DISPLAY_FORMAT, strtotime($dateStr.' -'.($dayOfWeek - 1).' day'));\n $fromDate = date(Constants::DATE_FORMAT, strtotime($dateStr.' -'.($dayOfWeek - 1).' day'));\n $previousDate = date(Constants::DATE_FORMAT, strtotime($dateStr.' -'.$dayOfWeek.' day'));\n $toStr = date(Constants::DATE_DISPLAY_FORMAT, strtotime($dateStr.' +'.(7 - $dayOfWeek).' day'));\n $nextDate = date(Constants::DATE_FORMAT, strtotime($dateStr.' +'.(8 - $dayOfWeek).' day'));\n Yii::trace(\"dayOfWeek $dayOfWeek - From $fromStr - To $toStr\");\n \n $searchModel = new TimetableSearch();\n $params = Yii::$app->request->queryParams;\n $params['TimetableSearch']['week'] = $fromDate;\n $params['TimetableSearch']['user_id'] = $id;\n $dataProvider = $searchModel->search($params);\n\n if ($dataProvider->getCount() == 0) {\n $dataProvider = new EmptyDataProvider(new Timetable());\n }\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'fromStr' => $fromStr,\n 'toStr' => $toStr,\n 'fromDate' => $fromDate,\n 'previousDate' => $previousDate,\n 'nextDate' => $nextDate,\n ]);\n } catch (Exception $ex) {\n throw new InvalidArgumentException();\n } \n }", "public function history($project = null, $year = null, $week = null) {\n\t\t$this->set('pageTitle', $this->request['project']);\n\t\t$this->set('subTitle', __(\"timesheets\"));\n\t\t$project = $this->_getProject($project);\n\n\t\t// Validate the Year\n\t\tif (($_year = $this->Time->validateYear($year)) != $year) {\n\t\t\treturn $this->redirect(array('project' => $project['Project']['name'], 'year' => $_year, 'week' => $week));\n\t\t}\n\t\t// Validate the week\n\t\tif (($_week = $this->Time->validateWeek($week, $year)) != $week) {\n\t\t\treturn $this->redirect(array('project' => $project['Project']['name'], 'year' => $_year, 'week' => $_week));\n\t\t}\n\n\t\t// Optionally filter by user\n\t\t$user = null;\n\t\t$userName = null;\n\t\tif (isset($this->request->query['user'])) {\n\t\t\t$user = $this->request->query['user'];\n\t\t\tif (!preg_replace('/^\\s*(\\d+)\\s*$/', '$1', $user)) {\n\t\t\t\t$user = null;\n\t\t\t} else {\n\t\t\t\t$userObject = $this->Time->User->find('first', array(\n\t\t\t\t\t'conditions' => array('id' => $user),\n\t\t\t\t\t'fields' => array('User.name')\n\t\t\t\t));\n\t\t\t\tif ($userObject) {\n\t\t\t\t\t$userName = $userObject['User']['name'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->set('user', $user);\n\t\t\t$this->set('userName', $userName);\n\t\t}\n\n\t\t// Start and end dates\n\t\t$startDate = new DateTime(null, new DateTimeZone('UTC'));\n\t\t$startDate->setISODate($year, $week, 1);\n\t\t$endDate = new DateTime(null, new DateTimeZone('UTC'));\n\t\t$endDate->setISODate($year, $week, 7);\n\n\t\t// Fetch summary details for the week\n\t\t$weekTimes = $this->Time->fetchWeeklySummary($project['Project']['id'], $year, $week, $user);\n\n\t\t$this->set('weekTimes', $weekTimes);\n\t\t$this->set('project', $project);\n\n\t\t$this->set('thisWeek', $week);\n\t\t$this->set('thisYear', $year);\n\t\t$this->set('startDate', $startDate);\n\t\t$this->set('endDate', $endDate);\n\n\t\tif ($week == $this->Time->lastWeekOfYear($year)) {\n\t\t\t$this->set('nextWeek', 1);\n\t\t\t$this->set('nextYear', $year + 1);\n\t\t} else {\n\t\t\t$this->set('nextWeek', $week + 1);\n\t\t\t$this->set('nextYear', $year);\n\t\t}\n\n\t\tif ($week == 1) {\n\t\t\t$this->set('prevWeek', $this->Time->lastWeekOfYear($year - 1));\n\t\t\t$this->set('prevYear', $year - 1);\n\t\t} else {\n\t\t\t$this->set('prevWeek', $week - 1);\n\t\t\t$this->set('prevYear', $year);\n\t\t}\n\n\t\t// List of tasks we can log time against, for modal add dialog\n\t\t$this->set('tasks', $this->Time->Project->Task->fetchLoggableTasks($this->Auth->user('id')));\n\n\t\t// Downloadable timesheets\n\t\tif (isset($this->request->query['format'])) {\n\t\t\tswitch (strtolower(trim($this->request->query['format']))) {\n\t\t\t\tcase 'csv':\n\t\t\t\t\t$this->layout = 'ajax';\n\t\t\t\t\t$this->RequestHandler->respondAs('text/csv');\n\t\t\t\t\t$this->response->header(array(\n\t\t\t\t\t\t'Content-Disposition' => 'attachment; filename=\"timesheet.csv\"'\n\t\t\t\t\t));\n\t\t\t\t\t$this->render('/Elements/Time/tempo.csv');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'json':\t\n\t\t\t\t\t$this->autoRender = false;\n\t\t\t\t\t$this->set('data', $weekTimes);\n\t\t\t\t\t$this->render('/Elements/json');\n\n\t\t\t\t\tbreak;\n\t\t\t\t// Explicitly specified HTML, or unknown format - just render the page as normal\n\t\t\t\tcase 'html':\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t}", "public function weekly_cron_data(){\n // $cro = $this->financial_model->saveDemoWeekly(array('runtime'=>$createdate,'type'=>'weekly'));\n // exit;\n \n $auto_cron = $this->financial_model->weekly_cron_fetch_data();\n $createdate = date('Y-m-d H:i:s');\n // exit;\n \n foreach ($auto_cron as $value) {\n \n $cron_recurring = $this->financial_model->saveCronData(\n\n array('transaction_id'=>$value['id'],\n\n 'p_amount'=>$value['due_amount'],\n\n 'p_date' => $createdate,\n\n 'p_memo'=>$value['memo'],\n\n 'p_payment_type'=>'recurring',\n\n 'del_status'=>'yes',\n\n 'recurring_type'=>$value['recurring_frequency'],\n\n 'day_date_type' => $value['monthly_and_weekly'],\n\n 'createdate'=>$createdate\n ));\n \n // redirect(base_url('financial/transaction'));\n }\n\n }", "public function view_req($month,$id,$status){\n\t\t// set the page title\t\t\n\t\t$this->set('title_for_layout', 'Waive Off Request- Approve/Reject - HRIS - BigOffice');\n\t\tif(!empty($id) && intval($id) && !empty($month) && !empty($status)){\n\t\t\tif($status == 'pass' || $status == 'view_only'){\t\n\t\t\t\t$options = array(\t\t\t\n\t\t\t\t\tarray('table' => 'hr_attendance',\n\t\t\t\t\t\t\t'alias' => 'Attendance',\t\t\t\t\t\n\t\t\t\t\t\t\t'type' => 'LEFT',\n\t\t\t\t\t\t\t'conditions' => array('`Attendance`.`app_users_id` = `HrAttWaive`.`app_users_id`',\n\t\t\t\t\t\t\t'HrAttWaive.date like date_format(`Attendance`.`in_time`, \"%Y-%m-%d\")')\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t// get the employee\n\t\t\t\t$emp_data = $this->HrAttWaive->HrEmployee->find('first', array('conditions' => array('HrEmployee.id' => $id)));\n\t\t\t\t$this->set('empData', $emp_data);\t\t\t\t\n\t\t\t\t$data = $this->HrAttWaive->find('all', array('conditions' => array(\"date_format(HrAttWaive.date, '%Y-%m')\" => $month,\n\t\t\t\t'HrAttWaive.app_users_id' => $id),\n\t\t\t\t'fields' => array('id','date','reason','Attendance.in_time','status',\n\t\t\t\t'HrEmployee.first_name','HrEmployee.last_name','remark'), 'order' => array('HrAttWaive.date' => 'asc'), 'joins' => $options));\t\n\t\t\t\t$this->set('att_data', $data);\n\t\t\t\t// for view mode\n\t\t\t\tif($status == 'view_only'){\t\t\t\t\t\n\t\t\t\t\t$this->set('VIEW_ONLY', 1);\n\t\t\t\t}\n\t\t\t}else if($ret_value == 'fail'){ \n\t\t\t\t$this->Session->setFlash('<button type=\"button\" class=\"close\" data-dismiss=\"alert-error\">&times;</button>Invalid Entry', 'default', array('class' => 'alert alert-error'));\t\n\t\t\t\t$this->redirect('/hrattwaive/');\t\n\t\t\t}else{\n\t\t\t\t$this->Session->setFlash('<button type=\"button\" class=\"close\" data-dismiss=\"alert-error\">&times;</button>Record Deleted: '.$ret_value , 'default', array('class' => 'alert alert-error'));\t\n\t\t\t\t$this->redirect('/hrattwaive/');\t\n\t\t\t}\n\t\t}else{\n\t\t\t$this->Session->setFlash('<button type=\"button\" class=\"close\" data-dismiss=\"alert-error\">&times;</button>Invalid Entry', 'default', array('class' => 'alert alert-error'));\t\t\n\t\t\t$this->redirect('/hrattwaive/');\t\n\t\t}\n\t\t\n\t\t\n\t}", "public function recordAction()\r\n {\r\n $task = $this->projectService->getTask($this->_getParam('id'));\r\n \r\n $user = za()->getUser();\r\n \r\n $time = time();\r\n $record = $this->projectService->addTimesheetRecord($task, $user, $time, $time);\r\n\r\n $this->view->task = $task;\r\n $this->view->record = $record;\r\n $this->view->relatedFaqs = $this->tagService->getRelatedItems($task);\r\n \r\n $this->renderRawView('timesheet/record.php');\r\n }", "public static function weekly() {return new ScheduleViewMode(2);}", "public function index(){\t\n\t\t// set the page title\n\t\t$this->set('title_for_layout', 'Approve Waive Off Request- HRIS - BigOffice');\n\t\t\n\t\t// get employee list\t\t\n\t\t$emp_list = $this->HrAttWaive->get_team($this->Session->read('USER.Login.id'),'L');\n\t\t$format_list = $this->Functions->format_dropdown($emp_list, 'u','id','first_name', 'last_name');\t\t\n\t\t$this->set('empList', $format_list);\n\t\t\n\t\n\t\t// when the form is submitted for search\n\t\tif($this->request->is('post')){\n\t\t\t$url_vars = $this->Functions->create_url(array('keyword','emp_id','from','to'),'HrAttWaive'); \n\t\t\t$this->redirect('/hrattwaive/?'.$url_vars);\t\t\t\n\t\t}\t\t\t\t\t\n\t\t\n\t\tif($this->params->query['keyword'] != ''){\n\t\t\t$keyCond = array(\"MATCH (reason) AGAINST ('\".$this->params->query['keyword'].\"' IN BOOLEAN MODE)\"); \n\t\t}\n\t\tif($this->params->query['emp_id'] != ''){\n\t\t\t$empCond = array('HrAttWaive.app_users_id' => $this->params->query['emp_id']); \n\t\t}\n\t\t// for date search\n\t\tif($this->params->query['from'] != '' || $this->params->query['to'] != ''){\n\t\t\t$from = $this->Functions->format_date_save($this->params->query['from']);\n\t\t\t$to = $this->Functions->format_date_save($this->params->query['to']);\t\t\t\n\t\t\t$dateCond = array('HrAttWaive.created_date between ? and ?' => array($from, $to)); \n\t\t}\n\t\t\n\t\t\n\t\t// fetch the attendance data\t\t\n\t\t$this->paginate = array('fields' => array('id', 'created_date',\t\"date_format(HrAttWaive.date, '%Y-%m') as month\",\n\t\t\"date_format(HrAttWaive.date, '%M, %Y') as month_display\", 'HrEmployee.first_name', 'HrEmployee.last_name','status','approve_date', 'HrEmployee.id', 'count(*) no_req'),\n\t\t'limit' => 10,'conditions' => array($keyCond, \n\t\t$empCond, $dateCond, 'is_draft' => 'N'), 'group' => array('HrEmployee.id',\"date_format(HrAttWaive.date, '%Y-%m')\"),\n\t\t'order' => array('HrAttWaive.created_date' => 'desc'));\n\t\t$data = $this->paginate('HrAttWaive');\n\t\t\n\t\t$this->set('att_data', $data);\n\t\t\n\t\t\n\t\n\t\tif(empty($data)){\n\t\t\t$this->Session->setFlash('<button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>You have no waive-off request to approve', 'default', array('class' => 'alert alert'));\t\n\t\t}\n\t\t\n\t\t\n\t}", "public function editassigntimeAction()\n {\n $prevurl = getenv(\"HTTP_REFERER\");\n $user_params=$this->_request->getParams();\n $ftvrequest_obj = new Ep_Ftv_FtvRequests();\n $ftvpausetime_obj = new Ep_Ftv_FtvPauseTime();\n $requestId = $user_params['requestId'];\n $requestsdetail = $ftvrequest_obj->getRequestsDetails($requestId);\n\n ($user_params['editftvspentdays'] == '') ? $days=0 : $days=$user_params['editftvspentdays'];\n ($user_params['editftvspenthours'] == '') ? $hours=0 : $hours=$user_params['editftvspenthours'];\n ($user_params['editftvspentminutes'] == '') ? $minutes=0 : $minutes=$user_params['editftvspentminutes'];\n ($user_params['editftvspentseconds'] == '') ? $seconds=0 : $seconds=$user_params['editftvspentseconds'];\n\n /*if($user_params['addasigntime'] == 'addasigntime') ///when time changes in mail content in publish ao popup//\n {\n /*$editdate = date('Y-m-d', strtotime($user_params['editftvassigndate']));\n $edittime = date('H:i:s', strtotime($user_params['editftvassigntime']));\n $editdatetime =$editdate.\" \".$edittime;\n $data = array(\"assigned_at\"=>$editdatetime);////////updating\n $query = \"identifier= '\".$user_params['requestId'].\"'\";\n $ftvrequest_obj->updateFtvRequests($data,$query);\n $parameters['ftvType'] = \"chaine\";\n // $newseconds = $this->allToSeconds($user_params['editftvspentdays'],$user_params['editftvspenthours'],$user_params['editftvspentminutes'],$user_params['editftvspentseconds']);\n echo \"<br>\".$format = \"P\".$days.\"DT\".$hours.\"H\".$minutes.\"M\".$seconds.\"S\";\n echo \"<br>\".$requestsdetail[0]['assigned_at'];\n $time=new DateTime($requestsdetail[0]['assigned_at']);\n $time->sub(new DateInterval($format));\n echo \"<br>\".$assigntime = $time->format('Y-m-d H:i:s');\n $data = array(\"assigned_at\"=>$assigntime);////////updating\n echo $query = \"identifier= '\".$requestId.\"'\";\n $ftvrequest_obj->updateFtvRequests($data,$query);\n $this->_redirect($prevurl);\n }\n elseif($user_params['subasigntime'] == 'subasigntime')\n {\n $format = \"P\".$days.\"DT\".$hours.\"H\".$minutes.\"M\".$seconds.\"S\";\n $time=new DateTime($requestsdetail[0]['assigned_at']);\n $time->add(new DateInterval($format));\n $assigntime = $time->format('Y-m-d H:i:s');\n $data = array(\"assigned_at\"=>$assigntime);////////updating\n $query = \"identifier= '\".$requestId.\"'\";\n $ftvrequest_obj->updateFtvRequests($data,$query);\n $this->_redirect($prevurl);\n }*/\n $inpause = $ftvpausetime_obj->inPause($requestId);\n $requestsdetail[0]['inpause'] = $inpause;\n $ptimes = $ftvpausetime_obj->getPauseDuration($requestId);\n $assigntime = $requestsdetail[0]['assigned_at'];\n //echo $requestId; echo $requestsdetail[0]['assigned_at'];\n\n if(($requestsdetail[0]['status'] == 'done' || $inpause == 'yes') && $requestsdetail[0]['assigned_at'] != null)\n {\n if($requestsdetail[0]['status'] == \"closed\")\n $time1 = ($requestsdetail[0]['cancelled_at']); /// created time\n elseif ($requestsdetail[0]['status'] == \"done\")\n $time1 = ($requestsdetail[0]['closed_at']); /// created time\n else{\n if($inpause == 'yes') {\n $time1 = ($requestsdetail[0]['pause_at']);\n }else {\n $time1 = (date('Y-m-d H:i:s'));///curent time\n }\n }\n $pausedrequests = $ftvpausetime_obj->pausedRequest($requestId);\n if($pausedrequests == 'yes')\n {\n $time2 = $this->subDiffFromDate($requestId, $requestsdetail[0]['assigned_at']);\n }else{\n $time2 = $requestsdetail[0]['assigned_at'];\n }\n $difference = $this->timeDifference($time1, $time2);\n\n }elseif($requestsdetail[0]['assigned_at'] != null){\n $time1 = (date('Y-m-d H:i:s'));///curent time\n\n $pausedrequests = $ftvpausetime_obj->pausedRequest($requestId);\n if($pausedrequests == 'yes')\n {\n $updatedassigntime = $this->subDiffFromDate($requestId, $requestsdetail[0]['assigned_at']);\n }else{\n $updatedassigntime = $requestsdetail[0]['assigned_at'];\n }\n $time2 = $updatedassigntime;\n $difference = $this->timeDifference($time1, $time2);\n }\n ////when user trying to edit the time spent///\n if($user_params['editftvassignsubmit'] == 'editftvassignsubmit') ///when button submitted in popup//\n {\n $newseconds = $this->allToSeconds($days,$hours,$minutes,$seconds);\n $previousseconds = $this->allToSeconds($difference['days'],$difference['hours'],$difference['minutes'],$difference['seconds']);\n if($newseconds > $previousseconds){\n $diffseconds = $newseconds-$previousseconds;\n $difftime = $this->secondsTodayshours($diffseconds);\n $format = \"P\".$difftime['days'].\"DT\".$difftime['hours'].\"H\".$difftime['minutes'].\"M\".$difftime['seconds'].\"S\";\n $requestsdetail[0]['assigned_at'];\n $time=new DateTime($requestsdetail[0]['assigned_at']);\n $time->sub(new DateInterval($format));\n $assigntime = $time->format('Y-m-d H:i:s');\n $data = array(\"assigned_at\"=>$assigntime);////////updating\n $query = \"identifier= '\".$requestId.\"'\";\n $ftvrequest_obj->updateFtvRequests($data,$query);\n $this->_redirect($prevurl);\n }elseif($newseconds < $previousseconds){\n $diffseconds = $previousseconds-$newseconds;\n $difftime = $this->secondsTodayshours($diffseconds);\n $format = \"P\".$difftime['days'].\"DT\".$difftime['hours'].\"H\".$difftime['minutes'].\"M\".$difftime['seconds'].\"S\";\n $time=new DateTime($requestsdetail[0]['assigned_at']);\n $time->add(new DateInterval($format));\n $assigntime = $time->format('Y-m-d H:i:s');\n $data = array(\"assigned_at\"=>$assigntime);////////updating\n $query = \"identifier= '\".$requestId.\"'\";\n $ftvrequest_obj->updateFtvRequests($data,$query);\n $this->_redirect($prevurl);\n }else\n $this->_redirect($prevurl);\n }\n /*$this->_view->reqasgndate = date(\"d-m-Y\", strtotime($reqdetails[0]['assigned_at']));\n $this->_view->reqasgntime = date(\"g:i A\", strtotime($reqdetails[0]['assigned_at']));*/\n $this->_view->days = $difference['days'];\n $this->_view->hours = $difference['hours'];\n $this->_view->minutes = $difference['minutes'];\n $this->_view->seconds = $difference['seconds'];\n $this->_view->requestId = $user_params['requestId'];\n $this->_view->requestobject = $requestsdetail[0]['request_object'];\n $this->_view->current_duration= $difference['days'].\"j \".$difference['hours'].\"h \".$difference['minutes'].\"m \".$difference['seconds'].\"s \";\n\n $this->_view->extendparttime = 'no';\n $this->_view->extendcrtparttime = 'no';\n $this->_view->editftvassigntime = 'yes';\n $this->_view->nores = 'true';\n $this->_view->render(\"ongoing_extendtime_writer_popup\");\n\n }", "public function addtimeAction()\r\n {\r\n\t\t$date = $this->_getParam('start', date('Y-m-d'));\r\n\t\t$time = $this->_getParam('start-time');\r\n\r\n\t\tif (!$time) {\r\n\t\t\t$hour = $this->_getParam('start-hour');\r\n\t\t\t$min = $this->_getParam('start-min');\r\n\t\t\t$time = $hour.':'.$min;\r\n\t\t}\r\n\r\n\t\t$start = strtotime($date . ' ' . $time . ':00');\r\n $end = $start + $this->_getParam('total') * 3600;\r\n $task = $this->projectService->getTask($this->_getParam('taskid'));\r\n $user = za()->getUser();\r\n\r\n $this->projectService->addTimesheetRecord($task, $user, $start, $end);\r\n\r\n\t\t$this->view->task = $task;\r\n\t\t\r\n\t\tif ($this->_getParam('_ajax')) {\r\n\t\t\t$this->renderRawView('timesheet/timesheet-submitted.php');\r\n\t\t}\r\n }", "public function timesheets(TimeEntry $timer)\n {\n $range = explode('-', $this->request->range);\n $start_date = date('Y-m-d', strtotime($range[0]));\n $end_date = date('Y-m-d', strtotime($range[1]));\n $this->request->request->add(['date_range' => [$start_date, $end_date]]);\n $entries = $timer->apply($this->request->except(['range']))->with(['user:id,username,name'])->get();\n $html = view('analytics::_ajax._timesheets', compact('entries'))->render();\n\n return response()->json(['status' => 'success', 'html' => $html, 'message' => 'Processed successfully'], 200);\n }", "public function get_time_sheet($type = \"\") {\r\n $paging = $this->session->userdata('search_time_sheet');\r\n\r\n if ($type == 'session' && !empty($paging)) {\r\n if ($this->input->post()) {\r\n $post_data = json_decode($this->input->post('data'), true);\r\n if (!empty($post_data['search_data'])) {\r\n $this->session->set_userdata(array('search_time_sheet' => $post_data));\r\n $paging = $post_data;\r\n }\r\n }\r\n } else {\r\n if ($this->input->post()) {\r\n $post_data = json_decode($this->input->post('data'), true);\r\n if (!empty($post_data['search_data'])) {\r\n $this->session->set_userdata(array('search_time_sheet' => $post_data));\r\n } else {\r\n $this->session->unset_userdata('search_time_sheet');\r\n }\r\n $paging = $post_data;\r\n }\r\n }\r\n\r\n if (!is_numeric($paging['offset'])) {\r\n redirect('/adminpanel/operation/time_sheet');\r\n }\r\n\r\n $this->session->set_flashdata($paging['search_data']);\r\n $content_data['table_data'] = array();\r\n $content_data['permission']['edit'] = $this->check_page_action(17, 'edit');\r\n $content_data['permission']['delete'] = $this->check_page_action(17, 'delete');\r\n $content_data['total_rows'] = '0';\r\n\r\n $content_data['time_sheet'] = $this->time_sheet_model->get_all_time_sheets($paging['order_by'], $paging['sort_order'], $paging['search_data'], $this->limit_per_page, $paging['offset'], $this->user_list);\r\n if (!empty($content_data['time_sheet'])) {\r\n foreach ($content_data['time_sheet']->result() as $value) {\r\n $value->content = '<strong>' . $value->title . '</strong> - ' . ((mb_strlen($value->remarks) > 6) ? mb_substr($value->remarks, 0, 6) . \"...\" : $value->remarks);\r\n if($value->time_end != 0){\r\n $value->duration = date_diff(date_create($value->time_start), date_create($value->time_end), true)->format('%dd %hh %im');\r\n } else {\r\n $value->duration = $this->lang->line('pending');\r\n }\r\n $value->created_time = $this->change_date_format($value->created_time);\r\n }\r\n $content_data['table_data'] = $content_data['time_sheet']->result();\r\n $content_data['total_rows'] = $content_data['time_sheet']->total_rows;\r\n }\r\n\r\n $content_data['offset'] = $paging['offset'];\r\n $content_data['per_page'] = $this->limit_per_page;\r\n\r\n echo json_encode($content_data, true);\r\n }", "public function index() {\n //\n $currentDate = \\Helpers\\DateHelper::getLocalUserDate(date('Y-m-d H:i:s')); \n $day = \\Helpers\\DateHelper::getDay($currentDate);\n $weekDays = \\Helpers\\DateHelper::getWeekDays($currentDate, $day); \n $workouts = \\App\\Schedule::getScheduledWorkouts($weekDays);\n \n return view('user/schedule', ['number_of_day' => $day, 'current_date' => $currentDate, 'weekDays' => $weekDays])\n ->with('target_areas', json_decode($this->target_areas, true))\n ->with('movements', json_decode($this->movements, true))\n ->with('workouts', $workouts);\n }", "public function index(Request $request,$id=null)\n {\n try {\n if (ApiBaseMethod::checkUrl($request->fullUrl())) {\n $user_id = $id;\n } else {\n $user = Auth::user();\n\n if ($user) {\n $user_id = $user->id;\n } else {\n $user_id = $request->user_id;\n }\n }\n $this_week= $weekNumber = date(\"W\");\n \n $period = CarbonPeriod::create(Carbon::now()->startOfWeek(Carbon::SATURDAY)->format('Y-m-d'), Carbon::now()->endOfWeek(Carbon::FRIDAY)->format('Y-m-d'));\n $dates=[];\n foreach ($period as $date){\n $dates[] = $date->format('Y-m-d');\n \n }\n $student_detail = SmStudent::where('user_id', $user_id)->first();\n //return $student_detail;\n $class_id = $student_detail->class_id;\n $section_id = $student_detail->section_id;\n\n $sm_weekends = SmWeekend::orderBy('order', 'ASC')->where('active_status', 1)->where('school_id',Auth::user()->school_id)->get();\n\n $class_times = SmClassTime::where('type', 'class')->where('academic_id', getAcademicId())->where('school_id',Auth::user()->school_id)->get();\n\n if (ApiBaseMethod::checkUrl($request->fullUrl())) {\n $data = [];\n $data['student_detail'] = $student_detail->toArray();\n $weekenD = SmWeekend::all();\n foreach ($weekenD as $row) {\n $data[$row->name] = DB::table('sm_class_routine_updates')\n ->select('sm_class_times.period', 'sm_class_times.start_time', 'sm_class_times.end_time', 'sm_subjects.subject_name', 'sm_class_rooms.room_no')\n ->join('sm_classes', 'sm_classes.id', '=', 'sm_class_routine_updates.class_id')\n ->join('sm_sections', 'sm_sections.id', '=', 'sm_class_routine_updates.section_id')\n ->join('sm_class_times', 'sm_class_times.id', '=', 'sm_class_routine_updates.class_period_id')\n ->join('sm_subjects', 'sm_subjects.id', '=', 'sm_class_routine_updates.subject_id')\n ->join('sm_class_rooms', 'sm_class_rooms.id', '=', 'sm_class_routine_updates.room_id')\n\n ->where([\n ['sm_class_routine_updates.class_id', $class_id], ['sm_class_routine_updates.section_id', $section_id], ['sm_class_routine_updates.day', $row->id],\n ])->where('sm_class_routine_updates.academic_id', getAcademicId())->where('sm_classesschool_id',Auth::user()->school_id)->get();\n }\n\n return ApiBaseMethod::sendResponse($data, null);\n }\n\n return view('lesson::student.student_lesson_plan', compact('dates','this_week','class_times', 'class_id', 'section_id', 'sm_weekends'));\n } catch (\\Exception $e) {\n Toastr::error('Operation Failed', 'Failed');\n return redirect()->back();\n }\n // return view('lesson::index');\n }", "public function exportExcelAction()\n {\n $fileName = 'appointments.xml';\n $grid = $this->getLayout()->createBlock('appointments/adminhtml_appointments_grid');\n $this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName));\n }", "function nth_weekly_schedule($action,$id,$start,$end,$day,$non_workdays,$nth_value=1)\n {\n $params = array($start,$end,$day);\n $results = array();\n $this->_where = $this->_where.' AND `cal_day_of_week` = ?';\n switch ($non_workdays){\n case 1:\n $sched_date = 'next_work_day';\n break;\n case 2:\n $sched_date = 'prev_work_day';\n break;\n case 0:\n $sched_date = 'cal_date';\n $this->_where = $this->_where.' AND `cal_is_weekday` = ?';\n array_push($params,1);\n break;\n }\n $sql = 'SELECT `cal_date` AS `report_date`, '.$sched_date.' AS `sched_date`,`cal_is_work_day` FROM `calendar__bank_holiday_offsets` ';\n $sql = $sql.$this->_where;\n \n $query = $this->_db->query($sql,$params);\n //echo $nth_value;\n \n if($query->count()){\n $results = $query->results();\n $results = ($nth_value > 1 || $non_workdays == 0 ? $this->nth_date($results,$nth_value):$results);\n if($action == 'preview') {\n return $results;\n } else if ($action == 'commit') {\n $this->commit_schedule($results,$id);\n }\n }\n }", "private function renderThisWeekSchedule($request)\n {\n $services = app('ServicesRepository');\n\n // Get the service URI for which we need to compute the week schedule\n $serviceUri = $request->input('serviceUri');\n $channel = $request->input('channel');\n\n // Get the service\n $service = $services->where('uri', $serviceUri)->first();\n\n if (empty($service)) {\n return response()->json(['message' => 'The service was not found.'], 404);\n }\n\n return $this->formatWeek($service['id'], 'array', $channel, Carbon::today()->startOfWeek());\n }", "public function add(Request $req, $account)\n {\n $currentDate = (new Datetime())->format('Y-m-d');\n \n $schedule = Schedule::whereDate('start_date','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->get();\n //Add timesheet\n $timesheet = new Timesheet();\n $timesheet->start_time = date('Y-m-d H:i:s', strtotime($req->start_time));\n $timesheet->end_time = date(\"Y-m-d H:i:s\", strtotime($req->start_time) + $req->seconds);\n $timesheet->member_id = Auth::user()->id;\n $timesheet->activity = 'in';\n $timesheet->status = 'approved';\n\n $schedule_hours = 0;\n if(count($schedule)){\n $timesheet->schedule_id = $schedule[0]->id;\n //Update attendance on schedule-to investigate follow $schedule_hours\n $schedule_date1 = new Datetime($schedule[0]->start_date.' '.$schedule[0]->start_time.':00:00');\n $schedule_date2 = new Datetime($schedule[0]->end_date.' '.$schedule[0]->end_time.':00:00');\n $schedule_diff = $schedule_date1->diff($schedule_date2);\n $schedule_hours = $schedule_hours + (($schedule_diff->h * 60) + $schedule_diff->i);\n\n }\n $timesheet->save();\n $timesheets = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->get();\n //Get total time worked\n $hours = 0;\n foreach ($timesheets as $timesheet) {\n $date1 = new Datetime($timesheet->start_time);\n $date2 = new Datetime($timesheet->end_time);\n $diff = $date2->diff($date1);\n\n $hours = $hours + (($diff->h * 60) + $diff->i);\n }\n if(count($schedule)){\n $schedule_updated = Schedule::find($schedule[0]->id);\n\n //More than 30 min still to finish\n if($schedule_hours-$hours > 30 && $schedule_hours != 0){\n $schedule_updated->attendance = 'working';\n }elseif ($schedule_hours-$hours <= 30 || $schedule_hours-$hours <= 0) {\n $schedule_updated->attendance = 'attended';\n }//Less than 5 min to finish\n //late\n $first_timesheet = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->first();\n $date1 = new Datetime($schedule_updated->start_date.' '.$schedule_updated->start_time.':00:00');\n $date2 = new Datetime($first_timesheet->start_time);\n $diff = $date2->diff($date1);\n $late = (($diff->h * 60) + $diff->i);\n // dd($late);\n if($late > 10){\n $schedule_updated->attendance = 'late';\n }\n //\n $schedule_updated->save();\n }\n //Get total breaks\n $breaks = 0;\n $first_timesheet = Timesheet::whereDate('start_time','=',$currentDate)->first();\n $last_timesheet = Timesheet::whereDate('start_time','=',$currentDate)->latest()->first();\n if($first_timesheet){\n $date1 = new Datetime($first_timesheet->start_time);\n $date2 = new Datetime($last_timesheet->end_time);\n $diff = $date2->diff($date1);\n $breaks = (($diff->h * 60) + $diff->i) - $hours;\n }\n\n $worked = $this->hoursandmins($hours);\n $breaks = $this->hoursandmins($breaks);\n // First Punch In in current day\n $first_punch_in = Timesheet::whereDate('start_time','=',$currentDate)->first();\n\n // return view('attendance/index', ['timesheets'=>$timesheets, 'schedule'=>$schedule, 'first_punch_in'=>$first_punch_in, 'worked'=>$worked, 'breaks'=>$breaks, 'first_timesheet'=>$first_timesheet, 'last_timesheet'=>$last_timesheet]);\n\n \t$activities = view('attendance/ajax/activities', ['timesheets'=>$timesheets])->render();\n $statistics = view('attendance/ajax/statistics', ['schedule'=>$schedule, 'worked'=>$worked])->render();\n\n \treturn response()->json(['activities'=>$activities, 'statistics'=>$statistics]);\n\n }", "public function leads_this_week_report()\n {\n echo json_encode($this->reports_model->leads_this_week_report());\n }", "function retrieve_specific_week(){\n\t\t\n\t\t$week_index = $this->CI->input->post('index');\n\t\tif($week_index === false)\n\t\t\treturn \tarray('success' => false, 'message' => 'Invalid request');\n\t\t\n\t\t$pgla_id = $this->CI->input->post('pgla_id');\n\t\tif($pgla_id === false)\n\t\t\treturn \tarray('success' => false, 'message' => 'Invalid request');\n\t\t\n\t\t\n\t\t$this->CI->load->model('model_guest_lists', 'guest_lists', true);\n\t\t\n\t\t//retrieve day of week for pgla_id that guest list is authorized on & make sure pgla_id belongs to this promoter\n\t\tif(!$result = $this->CI->guest_lists->retrieve_plga_day_promoter_check($pgla_id, $this->promoter->up_id))\n\t\t\treturn array('success' => false, 'message' => 'Unknown error');\n\t\t\n\t\t$data = $this->CI->guest_lists->retrieve_single_guest_list_and_guest_list_members($pgla_id, $result->pgla_day, $week_index, $result->pgla_create_time);\n\t\t\n\t\t$response = new stdClass;\n\t\t$response->data = $data;\n\t\t\n\t\treturn array('success' => true, 'message' => $response);\n\t\t\n\t}", "public function mark_attendance($message = NULL) {\n $data['sideMenuData'] = fetch_non_main_page_content();\n $tenant_id = $this->tenant_id;\n $course_id = $this->input->post('course_id');\n $class_id = $this->input->post('class_id');\n $subsidy = $this->input->post('subsidy');\n $sort_by = $this->input->get('b');\n $sort_order = $this->input->get('o');\n $class_details = $this->class->get_class_by_id($tenant_id, $course_id, $class_id);\n \n $from_date = parse_date($class_details->class_start_datetime, SERVER_DATE_TIME_FORMAT);///added by shubhranshu\n $to_date = parse_date($class_details->class_end_datetime, SERVER_DATE_TIME_FORMAT);//added by shubhranshu\n $week_start_date = parse_date($this->input->post('week_start'), CLIENT_DATE_FORMAT);//added by shubhranshu\n //echo print_r($from_date);print_r($to_date);print_r($week_start_date);exit;\n \n $week = $this->input->post('week');\n $export = $this->input->post('export');\n $export1 = $this->input->post('export1');\n $this->load->helper('attendance_helper');\n if (!empty($export)) \n {\n $class_details = $this->class->get_class_details_for_report($tenant_id, $course_id, $class_id);\n $class_start = parse_date($class_details->class_start_datetime, SERVER_DATE_TIME_FORMAT);\n $class_end = parse_date($class_details->class_end_datetime, SERVER_DATE_TIME_FORMAT);\n if (empty($class_start))\n $class_start = new DateTime();\n if (empty($class_end))\n $class_end = new DateTime();\n $class_schedule = $this->class->get_all_class_schedule($tenant_id, $class_id);\n $class_schedule_data = array();\n foreach ($class_schedule as $row) {\n $session_arr = array('S1' => '1', 'BRK' => '3', 'S2' => '2');\n $class_schedule_data[date('d/m/y', strtotime($row['class_date']))][$session_arr[$row['session_type_id']]] = date('h:i A', strtotime($row['session_start_time']));\n }\n \n if ($export == 'xls') \n {\n $results = $this->classtraineemodel->get_class_trainee_list_for_attendance($tenant_id, $course_id, $class_id, $subsidy, $class_start, $class_end, $sort_by, $sort_order);\n $this->load->helper('export_helper');\n export_attendance($results, $class_details, $class_start, $class_end, $class_schedule_data);\n } \n else \n {\n $results = $this->classtraineemodel->get_class_trainee_list_for_attendance($tenant_id, $course_id, $class_id, $subsidy, $class_start, $class_end, $sort_by, $sort_order);\n $tenant_details = $this->classtraineemodel->get_tenant_masters($tenant_id);\n $tenant_details->tenant_state = rtrim($this->course->get_metadata_on_parameter_id($tenant_details->tenant_state), ', ');\n $tenant_details->tenant_country = rtrim($this->course->get_metadata_on_parameter_id($tenant_details->tenant_country), ', ');\n\t\t$mark_count = $this->classtraineemodel->get_rows_count($course_id,$class_id);\n \n if ($export == 'xls_week'){\n $this->load->helper('export_helper');\n return generate_class_attendance_sheet_xls($results, $class_details, $class_start, $class_end, $tenant_details, $class_schedule_data);\n }\n $this->load->helper('pdf_reports_helper');\n if ($export == 'pdf') {\n //return generate_class_attendance_pdf($results, $class_details, $tenant_details, $class_schedule_data, $mark_count);\n //print_r($results);exit;\n return generate_class_attendance_pdf($results, $class_details, $tenant_details, $class_schedule_data,$mark_count); // removed mark count by shubhranshu\n \n } else if ($export == 'pdf_week') {\n return generate_class_attendance_sheet_pdf($results, $class_details, $tenant_details, $class_schedule_data);\n }\n }\n \n } \n else \n {\n if($export1=='lock')\n { \n $lock_msg=$this->classtraineemodel->lock_class_attendance($tenant_id,$course_id,$class_id);\n if($lock_msg==TRUE){\n $this->session->set_flashdata(\"success\", \"Succesfully Locked.\");\n }else{\n $this->session ->set_flashdata(\"error\",\"Something went wrong while locking.\");\n }\n }else if($export1=='unlock'){\n $lock_msg=$this->classtraineemodel->unlock_class_attendance($tenant_id,$course_id,$class_id);\n if($lock_msg==TRUE){\n $this->session->set_flashdata(\"success\",\"Succesfully Unocked\");\n }else{\n $this->session->set_flashdata(\"error\",\"Somthing went wrong while Unlocking !\");\n \n }\n }\n \n \n $data = get_data_for_renderring_attendance($tenant_id, $course_id, $class_id, $subsidy, $from_date, $to_date, $week_start_date, $week, $sort_by, $sort_order,'');\n \n $data['class_schedule'] = $this->class->get_all_class_schedule($tenant_id, $class_id);\n $att = $this->classtraineemodel->get_attendance_lock_status($tenant_id,$course_id, $class_id);\n $data['lock_status']=$att->lock_status;\n $data['class_start_datetime']=$att->class_start_datetime;\n\t\t\t$data['user'] = $this->user;\n\t\t\t$data['controllerurl'] = 'class_trainee/mark_attendance';\n $data['page_title'] = 'Class Trainee Enrollment - Mark Attendance';\n $data['main_content'] = 'classtrainee/markattendance';\n //$data['week_start'] = $from_date;\n //$data['sideMenuData'] = $this->sideMenu;\n if (!empty($message))\n $data['message'] = $message;\n $this->load->view('layout', $data);\n }\n }", "public function reportTodayAttendent()\n {\n $shift = DB::table('shift')->get();\n $dept = DB::table('department')->where('status',1)->get();\n return view('report.reportTodayAttendent')->with('shift',$shift)->with('dept',$dept);\n }", "public function timesheetAction(Employee $admin)\n {\n\t\t$validateForm = $this->createValidateForm($admin->getEmployee());\n\t\t$this->setActivity($admin->getEmployee()->getName().\" \".$admin->getEmployee()->getFirstname().\" timesheets are consulted\");\n $em = $this->getDoctrine()->getManager();\n $aTimesheets = $em->getRepository('BoAdminBundle:Timesheet')->getTsByEmployee($admin->getEmployee(),2);\n return $this->render('BoAdminBundle:Admin:timesheet.html.twig', array(\n 'employee' => $admin->getEmployee(),\n\t\t\t'validate_form' => $validateForm->createView(),\n\t\t\t'timesheets'=>$aTimesheets,\n\t\t\t'pm'=>\"personnel\",\n\t\t\t'sm'=>\"admin\",\n ));\n }", "public function add_week($arr_task_id = '')\n\t {\n\t \techo '<pre>';\n\t \tif($arr_task_id == '' || $arr_task_id == array()){\n\t \t\treturn false;\n\t \t}else{\n\t\t \t//task info\n\t\t\t$where['task_id'] = $arr_task_id;\n\t\t\t//$where['task_id'] = 1424;//test,frequency based on week, 3 times per week\n\t\t\t//$where['task_id'] = 1607;//test,frequency based on week, 3 times per week, Collin\n\t\t\t//$where['task_id'] = 1423;//test,frequency based on week, 2 times per week\n\t\t\t//$where['task_id'] = 1609;//test,frequency based on week, 1 time per 2 weeks\n\t\t\t//$where['task_id'] = 1610;//test,frequency based on month, 2 times per 3 months\n\t\t\t//$where['task_id'] = 1797;//test\n\n\t\t\t$task_res = $this->task_model->lists($this->task_lists_fields, $where, $like, $json = true, $orderby, $page, $pagesize);\n\n\t\t\t$total_cycle = 0;\n\t\t\t//assign year and week to schedule\n\t\t\tforeach($task_res['result'] as $res){\n\n\t\t\t\t//var_dump($res->cycle/(52*$res->year), $res->cycle/(54*$res->year), $res->year);\n\n\t\t\t\t//frequency based on month or week, if it's week then 99.999999% is debris, cycles per year inclues: 26, 52, 104, 156,,, 27, 54, 108, 162\n\t\t\t\tif(is_int($res->cycle/(52*$res->year)) || is_int($res->cycle/(54*$res->year)) || $res->cycle/(52*$res->year) == 0.5 || $res->cycle/(54*$res->year) == 0.5){//by week\n\t\t\t\t\t\n\t\t\t\t\t$ini_dayyyyyyy = date('w', strtotime($res->bdate));\n\t\t\t\t\t$ini_date = date('N',strtotime($res->bdate)) == 1 ? $res->bdate : date('Y-m-d',strtotime('+ '.(8-$ini_dayyyyyyy).' days', strtotime($res->bdate)));//set initial date to next Monday. Cities don't allow debirs work on Sunday\n\t\t\t\t\t\n\n\n\t\t\t\t\t$frequencyPerWeek = $res->cycle/(52*$res->year) ? $res->cycle/(52*$res->year) : $res->cycle/(54*$res->year) ; \n\t\t\t\t\t$addMaxDate = $frequencyPerWeek == 0.5 ? 13 : 6;//calculate maxdate, when one time per 2 weeks, the period will be 2 weeks; otherwise it's 1 week\n\n\n\t\t\t\t\tfor( $i=1; $i <= $res->cycle ; $i++){\n\t\t\t\t\t\t/*if($ini_month <= 12){\n\t\t\t\t\t\t\t$modi_year = $ini_year;\n\t\t\t\t\t\t\t$modi_week = $ini_week;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$modi_year = $ini_year = $ini_year + 1;\n\t\t\t\t\t\t\t$modi_week = $ini_week = $ini_week - 12;\n\t\t\t\t\t\t}*/\n\n\t\t\t\t\t\t$mindate = $ini_date;\n\t\t\t\t\t\t$maxdate = date('Y-m-d', strtotime(\"+ \".$addMaxDate.\" days\", strtotime($mindate)));\n\n\t\t\t\t\t\tswitch ($frequencyPerWeek) {//cycle per week\n\t\t\t\t\t\t\tcase 3 :\n\n\t\t\t\t\t\t\t\tif($i % 3 == 1){\n\t\t\t\t\t\t\t\t\t$work_weekday = $ini_date;\n\t\t\t\t\t\t\t\t}elseif($i % 3 == 2){\n\t\t\t\t\t\t\t\t\t$work_weekday = date('Y-m-d', strtotime('+ 2 days', strtotime($ini_date)));\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t$work_weekday = date('Y-m-d', strtotime('+ 4 days', strtotime($ini_date)));\n\n\t\t\t\t\t\t\t\t\t$ini_date = date('Y-m-d', strtotime('+ 7 days', strtotime($ini_date)));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\tif($i == 1 ) $ini_date = date('Y-m-d', strtotime('+ 1 days', strtotime($ini_date)));//starts on Tuesday\n\n\t\t\t\t\t\t\t\tif($i % 2 == 1){\n\t\t\t\t\t\t\t\t\t$work_weekday = $ini_date;\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t$work_weekday = date('Y-m-d', strtotime('+ 2 days', strtotime($ini_date)));\n\n\t\t\t\t\t\t\t\t\t$ini_date = date('Y-m-d', strtotime('+ 7 days', strtotime($ini_date)));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\t$work_weekday = $ini_date;\n\n\t\t\t\t\t\t\t\t$ini_date = date('Y-m-d', strtotime('+ 7 days', strtotime($ini_date)));\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 0.5:\n\t\t\t\t\t\t\t\t$work_weekday = $ini_date;\n\n\t\t\t\t\t\t\t\t$ini_date = date('Y-m-d', strtotime('+ 14 days', strtotime($ini_date)));\n\t\t\t\t\t\t\t\tbreak;\n\n\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t$this->redirect(BASE_URL().'task/add_csv','ask IT (week mod)'.$res->cycle);exit;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$insert_data['mindate'] = $mindate;\n\t\t\t\t\t\t$insert_data['maxdate'] = $maxdate;\n\t\t\t\t\t\t$insert_data['schedule_year'] = date('Y', strtotime($work_weekday));\n\t\t\t\t\t\t$insert_data['schedule_month'] = date('n', strtotime($work_weekday));\n\t\t\t\t\t\t$insert_data['schedule_week'] = date('N', strtotime($work_weekday)) != 7 ? ltrim(date('W', strtotime($work_weekday)), '0') : ltrim(date('W', strtotime($work_weekday)), '0') + 1;//week starts from Sunday\n\t\t\t\t\t\t$insert_data['schedule_date'] = $work_weekday;\n\t\t\t\t\t\t$insert_data['task_id'] = $res->task_id;\n\t\t\t\t\t\t$insert_data['addtime'] = date('Y-m-d H:i:s');\n\n\t\t\t\t\t\t//$insert_data['ini_month'] = $ini_month;//test\n\t\t\t\t\t\t//$insert_data['cycle'] = $res->cycle;//test\n\t\t\t\t\t\t//$insert_data['total_year'] = $res->year;//test\n\t\t\t\t\t\t//$insert_data['total_month'] = $res->month;//test\n\n\t\t\t\t\t\t$insert_week[] = $insert_data;\t\t\n\t\t\t\t\t}\n\n\t\t\t\t}else{//by month\n\n\t\t\t\t\t$ini_year = date('Y',strtotime($res->bdate));\n\t\t\t\t\t$ini_month = date('n',strtotime($res->bdate));\n\n\t\t\t\t\t//only for harris county\n\t\t\t\t\tif($res->contract_id == 11 && $res->cycle == 18){\n\t\t\t\t\t\t$ini_year = 2017;\n\t\t\t\t\t\t$ini_month = 3;\n\t\t\t\t\t}\n\n\t\t\t\t\t//settttttttingggggggggg\n\t\t\t\t\t$settle_to_next_week_1 = 4;//Thursday\n\t\t\t\t\t$settle_to_next_week_14 = $settle_to_next_week_1 - 1;//one day before $settle_to_next_week_1\n\n\t\t\t\t\t//var_dump($ini_year,$ini_month);//testing\n\t\t\t\t\tfor( $i=1; $i <= $res->cycle ; $i++){\n\t\t\t\t\t\tif($ini_month <= 12){\n\t\t\t\t\t\t\t$modi_year = $ini_year;\n\t\t\t\t\t\t\t$modi_month = $ini_month;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$modi_year = $ini_year = $ini_year + 1;\n\t\t\t\t\t\t\t$modi_month = $ini_month = $ini_month - 12;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\n\t\t\t\t\t\tswitch ($res->cycle/$res->month) {//cycle per month\n\n\t\t\t\t\t\t\t//case 12://cycle per year\n\t\t\t\t\t\t\tcase 1://cycle per month\n\n\t\t\t\t\t\t\t\t$work_weekday = $modi_year.'-'.$modi_month.'-01';\n\n\t\t\t\t\t\t\t\t$settle_to_next_week = $settle_to_next_week_1;\n\n\t\t\t\t\t\t\t\t//one month period\n\t\t\t\t\t\t\t\t$insert_data['mindate'] = date('Y-m-01', strtotime($work_weekday));\n\t\t\t\t\t\t\t\t$insert_data['maxdate'] = date('Y-m-t', strtotime($work_weekday));\n\n\t\t\t\t\t\t\t\t$ini_month ++;\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//case 18://cycle per year\n\t\t\t\t\t\t\tcase 1.5://cycle per month\n\t\t\t\t\t\t\t\tif($i % 3 == 1){\n\n\t\t\t\t\t\t\t\t\t$work_weekday = $modi_year.'-'.$modi_month.'-01';\n\n\t\t\t\t\t\t\t\t\t$settle_to_next_week = $settle_to_next_week_1;\n\n\t\t\t\t\t\t\t\t\t//two months period\n\t\t\t\t\t\t\t\t\t$insert_data['mindate'] = date('Y-m-01', strtotime($work_weekday));\n\t\t\t\t\t\t\t\t\t$insert_data['maxdate'] = date('Y-m-t', strtotime('+ 1 month', strtotime($work_weekday)));\n\n\t\t\t\t\t\t\t\t}elseif($i % 3 == 2){\n\n\t\t\t\t\t\t\t\t\t$work_weekday = $modi_year.'-'.$modi_month.'-14';\n\n\t\t\t\t\t\t\t\t\t$settle_to_next_week = $settle_to_next_week_14;\n\n\t\t\t\t\t\t\t\t\t//two months period\n\t\t\t\t\t\t\t\t\t$insert_data['mindate'] = date('Y-m-01', strtotime($work_weekday));\n\t\t\t\t\t\t\t\t\t$insert_data['maxdate'] = date('Y-m-t', strtotime('+ 1 month', strtotime($work_weekday)));\n\n\t\t\t\t\t\t\t\t\t$ini_month ++;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}else{\n\n\t\t\t\t\t\t\t\t\t$work_weekday = $modi_year.'-'.$modi_month.'-01';\n\n\t\t\t\t\t\t\t\t\t$settle_to_next_week = $settle_to_next_week_1;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//two months period\n\t\t\t\t\t\t\t\t\t$insert_data['mindate'] = date('Y-m-01', strtotime('- 1 month', strtotime($work_weekday)));\n\t\t\t\t\t\t\t\t\t$insert_data['maxdate'] = date('Y-m-t', strtotime($work_weekday));\n\n\t\t\t\t\t\t\t\t\t$ini_month ++;\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t//case 24://cycle per year\n\t\t\t\t\t\t\tcase 2://cycle per month\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif($i % 2 == 1){\n\n\t\t\t\t\t\t\t\t\t$work_weekday = $modi_year.'-'.$modi_month.'-01';\n\n\t\t\t\t\t\t\t\t\t$settle_to_next_week = $settle_to_next_week_1;\n\n\t\t\t\t\t\t\t\t\t//first 2 weeks of the month\n\t\t\t\t\t\t\t\t\t$insert_data['mindate'] = date('Y-m-01', strtotime($work_weekday));\n\t\t\t\t\t\t\t\t\t$insert_data['maxdate'] = date('Y-m-d', strtotime('+ 14 days', strtotime($work_weekday)));\n\n\t\t\t\t\t\t\t\t}else{\n\n\t\t\t\t\t\t\t\t\t$work_weekday = $modi_year.'-'.$modi_month.'-14';\n\n\t\t\t\t\t\t\t\t\t$settle_to_next_week = $settle_to_next_week_14;\n\n\t\t\t\t\t\t\t\t\t//last 2 weeks of the month\n\t\t\t\t\t\t\t\t\t$insert_data['mindate'] = date('Y-m-d', strtotime($work_weekday));\n\t\t\t\t\t\t\t\t\t$insert_data['maxdate'] = date('Y-m-t', strtotime($work_weekday));\n\n\t\t\t\t\t\t\t\t\t$ini_month ++;\n\n\t\t\t\t\t\t\t\t}\t\n\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault://months per cycle: 2,3,4,6,\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//$ini_month += 12 * $res->year / $res->cycle ;//per year\n\t\t\t\t\t\t\t\t$month_per_cycle = $res->month / $res->cycle ;//month per cycle\n\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif($res->contract_id == 85 && $res->cycle == 18){//only for harris county\n\t\t\t\t\t\t\t\t\t$work_weekday = $modi_year.'-'.$modi_month.'-01';//1st week\n\t\t\t\t\t\t\t\t\t//if(date(\"N\", strtotime($work_weekday)) >= $settle_to_next_week_1) $work_weekday = date('Y-m-d', strtotime('+1 week',strtotime($work_weekday)));\n\n\t\t\t\t\t\t\t\t\t$settle_to_next_week = $settle_to_next_week_1;\n\n\t\t\t\t\t\t\t\t\t$ini_month += 1 ;\n\n\t\t\t\t\t\t\t\t\t$insert_data['mindate'] = date('Y-m-01', strtotime($work_weekday));\n\t\t\t\t\t\t\t\t\t$insert_data['maxdate'] = date('Y-m-t', strtotime($work_weekday));\n\t\t\t\t\t\t\t\t\t//break;\n\t\t\t\t\t\t\t\t}elseif(is_int($month_per_cycle)){\n\n\t\t\t\t\t\t\t\t\t$work_weekday = $modi_year.'-'.$modi_month.'-14' ;\n\n\t\t\t\t\t\t\t\t\t$settle_to_next_week = $settle_to_next_week_14;\n\n\t\t\t\t\t\t\t\t\t$ini_month += $month_per_cycle ;\n\n\t\t\t\t\t\t\t\t\t//months period\n\t\t\t\t\t\t\t\t\t$insert_data['mindate'] = date('Y-m-01', strtotime($work_weekday));\n\t\t\t\t\t\t\t\t\t$insert_data['maxdate'] = date('Y-m-t', strtotime(\"+ \".($month_per_cycle - 1).\" months\", strtotime($work_weekday)));\n\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}elseif($month_per_cycle = 1.5){//twice per 3 months\n\n\t\t\t\t\t\t\t\t\t$work_weekday = $modi_year.'-'.$modi_month.'-01' ;\n\n\t\t\t\t\t\t\t\t\t$settle_to_next_week = $settle_to_next_week_1;\n\n\t\t\t\t\t\t\t\t\t$insert_data['mindate'] = date('Y-m-01', strtotime($work_weekday));\n\t\t\t\t\t\t\t\t\t$insert_data['maxdate'] = date('Y-m-t', strtotime(\"+ 1 months\", strtotime($work_weekday)));\n\n\t\t\t\t\t\t\t\t\tif($i % 2 == 1){\n\t\t\t\t\t\t\t\t\t\t$ini_month += 1 ;\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t$ini_month += 2 ;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t$this->redirect(BASE_URL().'task/add_csv','ask IT (month mod)'.$res->cycle);exit;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$dayyyy = date('w', strtotime($work_weekday));\n\t\t\t\t\t\tif($res->task_id == 446)var_dump($work_weekday);\n\t\t\t\t\t\t//when schedule is after $settle_to_next_week, set up to next Sunday\n\t\t\t\t\t\tif(date(\"w\", strtotime($work_weekday)) >= $settle_to_next_week) $work_weekday = date('Y-m-d', strtotime('+ '.(7 - $dayyyy).' days',strtotime($work_weekday)));\n\n\t\t\t\t\t\t//when date is 14, set up to previous Sunday\n\t\t\t\t\t\tif(date(\"d\", strtotime($work_weekday)) == 14) {\n\t\t\t\t\t\t\t$work_weekday = date('Y-m-d', strtotime('- '.$dayyyy.' days',strtotime($work_weekday)));\n\t\t\t\t\t\t\t$insert_data['mindate'] = date('Y-m-d', strtotime($work_weekday));\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\n\t\t\t\t\t\t$insert_data['schedule_year'] = $modi_year;\n\t\t\t\t\t\t$insert_data['schedule_month'] = $modi_month;\n\t\t\t\t\t\t$insert_data['schedule_week'] = date('N', strtotime($work_weekday)) != 7 ? ltrim(date('W', strtotime($work_weekday)), '0') : ltrim(date('W', strtotime($work_weekday)), '0') + 1;//week starts from Sunday\n\t\t\t\t\t\t$insert_data['schedule_date'] = $work_weekday;\n\t\t\t\t\t\t$insert_data['task_id'] = $res->task_id;\n\t\t\t\t\t\t$insert_data['unit_price'] = $res->unit_price;\n\t\t\t\t\t\t$insert_data['addtime'] = date('Y-m-d H:i:s');\n\n\t\t\t\t\t\t$insert_data['ini_month'] = $ini_month;//test\n\t\t\t\t\t\t$insert_data['cycle'] = $res->cycle;//test\n\t\t\t\t\t\t$insert_data['total_year'] = $res->year;//test\n\t\t\t\t\t\t$insert_data['total_month'] = $res->month;//test\n\n\t\t\t\t\t\t$insert_week[] = $insert_data;\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//echo $res->task_id; echo \"&nbsp;\"; echo $total_cycle += $res->cycle; echo '<br>'; \n\t\t\t\tunset($modi_year);\n\t\t\t\tunset($modi_month);\n\t\t\t\tunset($date_week3);\n\t\t\t\tunset($insert_data);\n\t\t\t}\n\t\t\t//echo \"<pre>\";\n\t\t\t//var_dump($insert_week);exit;\n\n\t\t\t//insert into schedule, and update task ifweek\n\t\t\t$insert_res = $this->schedule_model->add_batch($insert_week);\n\n\t\t\tif($insert_res){\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t \t}\n\t \t\n\t }", "public function index()\n {\n $user = Auth::user();\n $data['user'] = $user;\n $settings = $user->settings;\n Carbon::setWeekStartsAt(0);\n Carbon::setWeekEndsAt(6);\n\n // TODO: get this from config\n $start_time = '06:30';\n $end_time = '19:30';\n\n $today = new Carbon($this->choose_start);\n $today2 = new Carbon($this->choose_start);\n $today3 = new Carbon($this->choose_start);\n // $today4 = new Carbon($this->choose_start);\n // $today5 = new Carbon($this->choose_start);\n $today6 = new Carbon($this->choose_start);\n\n $data['start'] = $today6->startOfWeek();\n\n $days = array();\n $days_to_add = 7 * ($settings->weeks - 2);\n $end = $today2->startOfWeek()->setDate(\n $today->year,\n $today->month,\n $today->format('d') > 15 ?\n $today3->endOfMonth()->format('d') :\n 15\n )->addDays($days_to_add);\n\n $data['end_of_period'] = $end->copy()->endOfWeek()->format('Y-m-d');\n $data['end'] = $end;\n\n $added_range = false;\n $next_range = array();\n if ((new Carbon)->day >= 13 && (new Carbon)->day <= 15) {\n $added_range = true;\n $next_range['start'] = (new Carbon)->setDate((new Carbon)->year, (new Carbon)->month, 16)->startOfWeek();\n $next_range['start_of_period'] = (new Carbon)->setDate((new Carbon)->year, (new Carbon)->month, 16);\n $next_range['end'] = (new Carbon)->startOfWeek()->setDate((new Carbon)->year, (new Carbon)->month, $today3->endOfMonth()->format('d'));\n $next_range['end_of_period'] = (new Carbon)->startOfWeek()->setDate((new Carbon)->year, (new Carbon)->month, $today3->endOfMonth()->format('d'))->endOfWeek()->format('Y-m-d');\n } elseif ((new Carbon)->day >= 28 && (new Carbon)->day <= 31) {\n $added_range = true;\n $year = (new Carbon)->year + ((new Carbon)->month == 12?1:0); // Set year as next year if this month is December (12)\n $next_range['start'] = (new Carbon)->setDate($year, (new Carbon)->addMonthNoOverflow(1)->format(\"m\"), 1)->startOfWeek();\n $next_range['start_of_period'] = (new Carbon)->setDate($year, (new Carbon)->addMonthNoOverflow(1)->format(\"m\"), 1);\n $next_range['end'] = (new Carbon)->startOfWeek()->setDate($year, (new Carbon)->addMonthNoOverflow(1)->format(\"m\"), 15);\n $next_range['end_of_period'] = (new Carbon)->startOfWeek()->setDate($year, (new Carbon)->addMonthNoOverflow(1)->format(\"m\"), 15)->endOfWeek()->format('Y-m-d');\n }\n\n $data['days_a'] = $this->get_days($data);\n $data['days_b'] = $this->get_days($next_range);\n\n $data['days'] = [__('Su'), __('Mo'), __('Tu'), __('We'), __('Th'), __('Fr'), __('Sa')];\n $time_line = [];\n $time = new Carbon($start_time);\n while ($time->format('H:i') <= $end_time) {\n $time_line[] = $time->format('H:i');\n $time->addMinutes(60);\n }\n $data['time_line'] = $time_line;\n\n $user = auth()->user();\n if (isset($user) && isset($user->settings))\n if ($user->settings->is_admin)\n return view('admin.home');\n else\n return view('home', $data);\n }", "public function exportExcelAction()\n {\n $fileName = 'schedule.xls';\n $content = $this->getLayout()->createBlock('bs_schedule/adminhtml_schedule_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function getDateEntries()\n\t{\n\t\t//Get Date\n\t\t$dateSubmit = \\Input::get('eventDate_submit');\n\t\t//Get Week\n\t\t$week = $this->timesheet->getWeek($dateSubmit);\n\t\t//Get the user id of the currently logged in user\n\t\t$userId = \\Sentry::getUser()->id;\n\t\t//Get Tasks List\n\t\t$tasks = $this->timesheet->getIndex($userId);\n\t\t//Get Entries\n\t\t$entries = $this->timesheet->getEntries($dateSubmit,$userId);\n\t\treturn \\View::make('dashboard.timesheet.view')\n\t\t\t\t\t->with('week',$week)\n\t\t\t\t\t->with('tasks',$tasks)\n\t\t\t\t\t->with('selectedDate',$dateSubmit)\n\t\t\t\t\t->with('entries', $entries);\n\t}", "public function reportTotalClassHeldSummaryView(Request $request)\n {\n $from_date = trim($request->from); \n $from = date (\"Y-m-d\", strtotime($from_date));\n $explode = explode('-',$from);\n $from_year = $explode[0];\n $get_current_day = date(\"l\",strtotime($from));\n $current_year = date('Y');\n if($get_current_day =='Saturday'){\n $current_day = 1 ;\n }\n if($get_current_day =='Sunday'){\n $current_day = 2 ;\n }\n if($get_current_day =='Monday'){\n $current_day = 3 ;\n }\n if($get_current_day =='Tuesday'){\n $current_day = 4 ;\n }\n if($get_current_day =='Wednesday'){\n $current_day = 5 ;\n }\n if($get_current_day =='Thursday'){\n $current_day = 6 ;\n }\n if($get_current_day =='Friday'){\n $current_day = 7 ;\n }\n if($from > $this->rcdate1){\n echo 'f1';\n exit();\n }\n // get door holiday\n $holiday_count = DB::table('holiday')->where('holiday_date',$from)->count();\n if($holiday_count > 0){\n echo 'f2';\n exit();\n }\n if($from_year != $current_year){\n echo 'f3';\n exit();\n }\n // get all shift\n $result = DB::table('shift')->get();\n return view('view_report.reportTotalClassHeldSummaryView')->with('result',$result)->with('get_current_day',$get_current_day)->with('from',$from)->with('current_day',$current_day)->with('from_year',$from_year);\n }", "public function weeklyAction()\n {\n if (!$this->request->isPost()) {\n return false;\n }\n $email = $this->request->getPost('email');\n if (!$email) {\n $this->flashSession->error(t('Please input your Email'));\n return $this->indexRedirect();\n }\n $subscribe = new Subscribe();\n $subscribe->setStatus('Y');\n $subscribe->setEmail($email);\n\n if (!$subscribe->save()) {\n foreach ($subscribe->getMessages() as $message) {\n $this->flashSession->error($message);\n return $this->indexRedirect();\n }\n }\n $this->flashSession->success(t('Thank you for subscribing to our newsletter'));\n return $this->indexRedirect();\n }", "public function index()\n {\n $attendanceSettings = AttendanceSetting::first();\n $openDays = json_decode($attendanceSettings->office_open_days);\n $this->startDate = Carbon::today()->timezone($this->global->timezone)->startOfMonth();\n $this->endDate = Carbon::today()->timezone($this->global->timezone);\n $this->employees = User::allEmployees();\n $this->userId = User::first()->id;\n\n $this->totalWorkingDays = $this->startDate->diffInDaysFiltered(function(Carbon $date) use ($openDays){\n foreach($openDays as $day){\n if($date->dayOfWeek == $day){\n return $date;\n }\n }\n }, $this->endDate);\n $this->daysPresent = Attendance::countDaysPresentByUser($this->startDate, $this->endDate, $this->userId);\n $this->daysLate = Attendance::countDaysLateByUser($this->startDate, $this->endDate, $this->userId);\n $this->halfDays = Attendance::countHalfDaysByUser($this->startDate, $this->endDate, $this->userId);\n return view('admin.attendance.index', $this->data);\n }", "function weekviewHeader()\n {\n }", "public function show_report_service()\n { \n $this->load->model(\"swm/frontend/M_swm_attend\", \"msa\");\n $rs_service_data = $this->msa->get_time_us_attend(getNowDate(),getNowDate());//startDate, endDate, startAge, endAge, state\n $data['rs_service_data'] = $rs_service_data->result();\n $this->output(\"swm/frontend/v_report_service\", $data, true);\n }", "public function week_profit_8676fd8c296aaeC19bca4446e4575bdfcm_bitb64898d6da9d06dda03a0XAEQa82b00c02316d9cd4c8coin(){\r\n\t\t$this -> load -> model('account/auto');\r\n\t\t$this -> load -> model('account/customer');\r\n\t\t$this -> load -> model('account/activity');\r\n\t\t// die('Update');\r\n\t\t$date= date('Y-m-d H:i:s');\r\n\t\t$date1 = strtotime($date);\r\n\t\t$date2 = date(\"l\", $date1);\r\n\t\t$date3 = strtolower($date2);\r\n\t\tif (($date3 != \"sunday\")) {\r\n\t\t echo \"Die\";\r\n\t\t die();\r\n\t\t}\r\n\t\t$allPD = $this -> model_account_auto ->getPD20Before();\r\n\t\t$customer_id = '';\r\n\t\t$rate = $this -> model_account_activity -> get_rate_limit();\r\n\t\t// print_r($rate);die();\r\n\t\r\n\t\tintval(count($rate)) == 0 && die('2');\r\n\t\t$percent = floatval($rate['rate']);\r\n\t\t$this -> model_account_auto ->update_rate();\r\n\t\tforeach ($allPD as $key => $value) {\r\n\r\n\t\t\t$customer_id .= ', '.$value['customer_id'];\r\n\t\t\t\r\n\t\t\t$price = $percent/100;\r\n\t\t\t$amount = $price*$value['filled'];\r\n\t\t\t$amount = $amount*1000000;\r\n\t\t\t$this -> model_account_auto ->updateMaxProfitPD($value['id'],$amount);\r\n\t\t\t$this -> model_account_auto -> update_R_Wallet($amount,$value['customer_id']);\r\n\t\t\t$this -> model_account_auto -> update_R_Wallet_payment($amount,$value['id']);\r\n\t\t\t$this -> model_account_customer -> saveTranstionHistorys(\r\n \t$value['customer_id'],\r\n \t'Weekly rates', \r\n \t'+ '.($amount/1000000).' USD',\r\n \t'Earn '.$percent.'% from package '.$value['filled'].' USD',\r\n \t' ');\r\n\r\n\t\t\t$this -> matching_pnode($value['customer_id'], $amount);\r\n\t\t}\r\n\t\t\r\n\t\t// echo $customer_id;\r\n\t\tdie('Ok');\r\n\t\techo '1';\r\n\r\n\t}", "function my_add_weekly( $schedules ) {\n // add a 'weekly' schedule to the existing set\n $schedules['3_hours'] = array(\n 'interval' => 10800,\n 'display' => __('Every 3 Hours - (Flipkart API call)')\n );\n return $schedules;\n }", "public function schedule_view()\n {\n\n\n if (Input::get('submit') && Input::get('submit') == 'search') {\n\n\n $start_date = Input::get('start_date');\n $end_date = Input::get('end_date');\n $start_time = date(\"Y-m-d H:i:s\", strtotime($start_date));\n $end_time = date(\"Y-m-d H:i:s\", strtotime($end_date));\n $submit = Input::get('submit');\n\n $type1 = '0' . '&';\n if (Input::has('start_date')) {\n $type1 .= 'start_date' . '=' . $start_date . '&';\n } else {\n $type1 .= 'start_date' . '=' . '' . '&';\n }\n\n if (Input::has('end_date')) {\n $type1 .= 'end_date' . '=' . $end_date . '&';\n } else {\n $type1 .= 'end_date' . '=' . '' . '&';\n }\n if (Input::has('submit')) {\n $type1 .= 'submit' . '=' . $submit;\n } else {\n $type1 .= 'submit' . '=';\n\n }\n Session::put('type', $type1);\n\n\n\n if (Input::has('start_date') && Input::has('end_date')) {\n\n $request = DB::table('temp_assign')\n ->join('owner', 'temp_assign.userid', '=', 'owner.id')\n ->select(DB::raw(\"temp_assign.*,owner.*,DATE_FORMAT(temp_assign.schedule_datetime,'%h:%i %p') as newtime,temp_assign.assignId as assign_id \"))\n ->where('temp_assign.schedule_datetime', '>=', $start_time)\n ->where('temp_assign.schedule_datetime', '<=', $end_time)\n ->paginate(10);\n\n goto res;\n\n }\n\n\n }\n\n\n if (Input::get('submit') && Input::get('submit') == 'Download_Report') {\n\n\n $start_date = Input::get('start_date');\n $end_date = Input::get('end_date');\n $start_time = date(\"Y-m-d H:i:s\", strtotime($start_date));\n $end_time = date(\"Y-m-d H:i:s\", strtotime($end_date));\n $submit = Input::get('submit');\n\n\n if (Input::has('start_date') && Input::has('end_date')) {\n\n $request = DB::table('temp_assign')\n ->join('owner', 'temp_assign.userid', '=', 'owner.id')\n ->select(DB::raw(\"temp_assign.*,owner.*,DATE_FORMAT(temp_assign.schedule_datetime,'%h:%i %p') as newtime,temp_assign.assignId as assign_id \"))\n ->where('temp_assign.schedule_datetime', '>=', $start_time)\n ->where('temp_assign.schedule_datetime', '<=', $end_time)\n ->get();\n\n }else{\n $request = DB::table('temp_assign')\n ->join('owner', 'temp_assign.userid', '=', 'owner.id')\n ->select(DB::raw(\"temp_assign.*,owner.*,DATE_FORMAT(temp_assign.schedule_datetime,'%h:%i %p') as newtime,temp_assign.assignId as assign_id \"))\n ->orderBy('assign_id', ' DESC')\n ->get();\n }\n\n\n $cntrr=1;\n\n\n header('Content-Type: text/csv; charset=utf-8');\n header('Content-Disposition: attachment; filename=schedule.csv');\n $handle = fopen('php://output', 'w');\n fputcsv($handle, array('S.No', 'Customer Name', 'Date', 'Time', 'Pickup'));\n\n foreach($request as $req)\n {\n fputcsv($handle, array(\n $cntrr,\n $req->first_name.' '.$req->last_name,\n date('d-m-Y', strtotime($req->schedule_datetime)),\n $req->newtime,\n $req->pickupAddress,\n ));\n\n $cntrr++;\n }\n\n\n fclose($handle);\n\n $headers = array(\n 'Content-Type' => 'text/csv',\n );\n\n\n goto end;\n }\n else{\n\n $start_date=\"\";\n $end_date=\"\";\n $submit=\"\";\n $type1 = '0' . '&';\n if (Input::has('start_date')) {\n $type1 .= 'start_date' . '=' . $start_date . '&';\n } else {\n $type1 .= 'start_date' . '=' . '' . '&';\n }\n\n if (Input::has('end_date')) {\n $type1 .= 'end_date' . '=' . $end_date . '&';\n } else {\n $type1 .= 'end_date' . '=' . '' . '&';\n }\n if (Input::has('submit')) {\n $type1 .= 'submit' . '=' . $submit;\n } else {\n $type1 .= 'submit' . '=';\n\n }\n Session::put('type', $type1);\n $request = DB::table('temp_assign')\n ->join('owner', 'temp_assign.userid', '=', 'owner.id')\n ->select(DB::raw(\"temp_assign.*,owner.*,DATE_FORMAT(temp_assign.schedule_datetime,'%h:%i %p') as newtime,temp_assign.assignId as assign_id \"))\n ->orderBy('assign_id', ' DESC')\n ->paginate(10);\n goto res;\n\n\n\n }\n\n res:\n\n if(Config::get('app.locale') == 'arb'){\n $align_format=\"right\";\n }elseif(Config::get('app.locale') == 'en'){\n $align_format=\"left\";\n }\n return View::make('dispatch.schedule')\n ->with('page', 'schedule')\n ->with('align_format',$align_format)\n ->with('request', $request);\n\n\n end:\n }", "public function getWeekDate_post() {\n $this->form_validation->set_rules('SessionKey', 'SessionKey', 'trim|required|callback_validateSession');\n $this->form_validation->set_rules('SeriesGUID', 'SeriesGUID', 'trim|required|callback_validateEntityGUID[Series,SeriesID]');\n $this->form_validation->set_rules('WeekID', 'WeekID', 'trim|numeric');\n $this->form_validation->validation($this); /* Run validation */\n\n /* Get Contests Data */\n $ContestData = $this->SnakeDrafts_model->getWeekDate($this->SeriesID,$this->Post['WeekID']);\n if (!empty($ContestData)) {\n $this->Return['Data'] = $ContestData;\n }\n }", "public function exporthours($id)\n {\n // $export = new HoursExport();\n // $export->setId($id);\n //\n // Excel::download($export, 'hours {{$id}}.xlsx');\n $hours = Hour::whereProjectId($id)->get();\n (new FastExcel($hours))->export('uren'.$id.'.xlsx', function ($hour) {\n return [\n 'Project' => $hour->project->projectname . ' '.$hour->project->customer->companyname,\n 'Naam' => $hour->user->name,\n 'Van' => date('d-m-Y', strtotime($hour->workedstartdate)),\n 'Begin' => $hour->workedstarttime,\n 'Tot' => date('d-m-Y', strtotime($hour->workedenddate)),\n 'Eind' => $hour->workedendtime,\n 'Totaal' => sprintf('%02d:%02d:%02d', ($hour->worked_hours/3600),($hour->worked_hours/60%60), $hour->worked_hours%60)\n ];\n});\nreturn FastExcel($hours)->download('uren'.$id.'.xlsx');\n$projects = Project::findOrFail($id);\n$tasks = Task::whereProjectId($id)->get()->all();\n$users = User::pluck('name','id')->all();\n // $hours = Hour::whereProjectId($id)->get()->all();\n $availables = Available::whereProjectId($id)->get()->all();\n $sumtaskhours = Task::whereProjectId($id)->sum('planned_hours');\n $sumhourhours = Hour::whereProjectId($id)->sum('worked_hours');\n\nreturn view('planner.projects');\n\n\n\n\n }", "function index() {\n // Build a list of orders\n\n $this->data[\"daysofweek\"] = $this->TimeSchedule->getDays();\n// $temp=$this->TimeSchedule->getDays();\n// var_dump($temp);\n\n $this->data['timeslots'] = $this->TimeSchedule->getTimeslots();\n\n $this->data['courses'] = $this->TimeSchedule->getCourses();\n// $temp2=$this->TimeSchedule->getTimeslots();\n// var_dump($temp2);\n\n $this->data['pagebody'] = 'homepage';\n $this->render();\n }", "public function overAllSummaryReportView(Request $request)\n {\n $from_date = trim($request->from); \n $from = date (\"Y-m-d\", strtotime($from_date));\n $explode = explode('-',$from);\n $from_year = $explode[0];\n $get_current_day = date(\"l\",strtotime($from));\n $current_year = date('Y');\n if($get_current_day =='Saturday'){\n $current_day = 1 ;\n }\n if($get_current_day =='Sunday'){\n $current_day = 2 ;\n }\n if($get_current_day =='Monday'){\n $current_day = 3 ;\n }\n if($get_current_day =='Tuesday'){\n $current_day = 4 ;\n }\n if($get_current_day =='Wednesday'){\n $current_day = 5 ;\n }\n if($get_current_day =='Thursday'){\n $current_day = 6 ;\n }\n if($get_current_day =='Friday'){\n $current_day = 7 ;\n }\n if($from > $this->rcdate1){\n echo 'f1';\n exit();\n }\n // get door holiday\n $holiday_count = DB::table('holiday')->where('door_holiday',0)->where('holiday_date',$from)->count();\n if($holiday_count > 0){\n echo 'f2';\n exit();\n }\n if($from_year != $current_year){\n echo 'f3';\n exit();\n }\n // attendent holiday count\n $attendent_holiday_count = DB::table('holiday')->where('attendent_holiday',0)->where('holiday_date',$from)->count();\n // total staff\n $total_staff_count = DB::table('users')->where('trasfer_status',0)->whereNotIn('type',[10])->count();\n // total teacher count \n $total_teacher_count = DB::table('users')->where('trasfer_status',0)->where('type',3)->count();\n // total staff enter into the campus\n $total_staff_enter_into_campus = DB::table('tbl_door_log')->where('type',1)->whereNotIn('user_type',[10])->where('enter_date',$from)->distinct('user_id')->count('user_id');\n\n // total staff leave\n $total_staff_leave_count = DB::table('tbl_leave')->where('final_request_from',$from)->where('status',1)->count();\n $total_teacher_leave_count = DB::table('tbl_leave')\n ->join('users', 'users.id', '=', 'tbl_leave.user_id')\n ->select('tbl_leave.*')\n ->where('users.type', 3)\n ->where('final_request_from',$from)\n ->where('status',1)\n ->count();\n $total_teacher_attendent_in_class = DB::table('teacher_attendent')->where('created_at',$from)->where('status',1)->where('type',3)->distinct('teacherId')->count('teacherId');\n // total class of this day\n $total_class_count = DB::table('routine')\n ->join('semister', 'routine.semister_id', '=', 'semister.id')\n ->select('routine.*')\n ->where('routine.year', $from_year)\n ->where('routine.day', $current_day)\n ->where('semister.status',1)\n ->count();\n\n // total teacher attendent class\n $teacher_taken_total_class_class = DB::table('teacher_attendent')->where('created_at',$from)->where('status',1)->where('type',3)->count();\n #--------------------------------- student section------------------------------------#\n $total_student_count = DB::table('student')\n ->join('semister', 'student.semister_id', '=', 'semister.id')\n ->select('student.*')\n ->where('student.year', $from_year)\n ->where('student.status', 0)\n ->where('semister.status',1)\n ->count();\n $total_student_enter_into_campus = DB::table('tbl_door_log')->where('type',2)->where('enter_date',$from)->distinct('student_id')->count('student_id');\n $total_student_enter_into_class = DB::table('student_attendent')->where('created_at',$from)->distinct('studentId')->count('studentId');\n // total hours class of this day\n $total_class_hour_in_routine = DB::table('routine')\n ->join('semister', 'routine.semister_id', '=', 'semister.id')\n ->select('routine.*')\n ->where('routine.year', $from_year)\n ->where('routine.day', $current_day)\n ->where('semister.status',1)\n ->get();\n // total hours class held\n $total_hours_class_held_query = DB::table('teacher_attendent')->where('created_at',$from)->where('status',1)->where('type',3)->get(); \n\n return view('view_report.overAllSummaryReportView')\n ->with('total_staff_count',$total_staff_count)\n ->with('total_teacher_count',$total_teacher_count)\n ->with('total_staff_enter_into_campus',$total_staff_enter_into_campus)\n ->with('total_staff_leave_count',$total_staff_leave_count)\n ->with('total_teacher_leave_count',$total_teacher_leave_count)\n ->with('total_teacher_attendent_in_class',$total_teacher_attendent_in_class)\n ->with('total_class_count',$total_class_count)\n ->with('teacher_taken_total_class_class',$teacher_taken_total_class_class)\n ->with('from',$from)\n ->with('attendent_holiday_count',$attendent_holiday_count)\n ->with('total_student_count',$total_student_count)\n ->with('total_student_enter_into_campus',$total_student_enter_into_campus)\n ->with('total_student_enter_into_class',$total_student_enter_into_class)\n ->with('total_class_hour_in_routine',$total_class_hour_in_routine)\n ->with('total_hours_class_held_query',$total_hours_class_held_query)\n ;\n }", "public function approveTimesheet() {\n $id = request('timesheetId');\n Timesheet::find($id)->update(['status'=>'approved']);\n return back();\n }", "public function index()\n {\n $timesheets = Timesheet::all();\n\n return view('timesheets.index')->with('timesheets', $timesheets);\n }", "public function index()\n {\n return PatientWeek::all();\n }", "public function index(Request $request)\n\t{\n\t\t$datas = \\App\\Work::orderBy(\\DB::raw('updated_at, is_top'), 'desc');\n\t\tif(!is_null($request['title'])){\n\t\t\t$datas = $datas->where(\"title\", 'LIKE', '%'.$request['title'].'%');\n\t\t}\n\t\tif(!is_null($request['user_id'])){\n\t\t\t$datas = $datas->where(\"user_id\", '=', $request['user_id']);\n\t\t}\n\t\tif(!is_null($request['mobile'])){\n\t\t\t$datas = $datas->where(\"mobile\", 'LIKE', '%'.$request['mobile'].'%');\n\t\t}\n\t\t\n\t\tif(!is_null($request['excel']))\n\t\t{\t\t\t\n\t\t\t$index = 0;\n\t\t\t\\Excel::create('Excel', function($excel) use($datas, $index){\n\t\t $excel->sheet('sheet', function($sheet) use($datas, $index) {\n\t\t\t\t\t$index += 1;\n\t\t\t\t\t$sheet->row($index, array('发布人','标题','行业','工种','区域','报酬','服务时间','所需人数','发布时间','置顶'));\n\t\t\t\t\tforeach($datas->get() as $data){\n\t\t\t\t\t\t$index += 1;\n\t\t\t\t\t\t$user_name = is_null($data->user) ? '' : $data->user->name;\n\t\t\t\t\t\t$title = $data->title;\n\t\t\t\t\t\t$industry_name = $data->industry_name;\n\t\t\t\t\t\t$category_name = $data->work_category_name;\n\t\t\t\t\t\t$area_name = $data->area_name;\n\t\t\t\t\t\t$price = $data->price;\n\t\t\t\t\t\t$date = null;\n\t\t\t\t\t\tif(isset($data->start_at) || isset($data->end_at))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$date = date('Y-m-d', strtotime($data->start_at));\n\t\t\t\t\t\t\t$date .= \" - \";\n\t\t\t\t\t\t\t$date .= date('Y-m-d', strtotime($data->end_at));\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$date = \"长期\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$people_number = $data->people_number;\n\t\t\t\t\t\t$created_at = $data->created_at;\n\t\t\t\t\t\t$is_top = $data->is_top == true ? '是' : '否';\n\t\t\t\t\t\t\n \t$sheet->row($index, array($user_name, $title, $industry_name, $category_name, $area_name, $price, $date, $people_number, $created_at, $is_top));\n }\n\t\t });\n\t\t\t})->export('xls');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$datas = $datas->paginate(11);\n\t\t\treturn view('admin.works.index')->with('datas', $datas);\t\n\t\t}\n\t}", "public function date_range_report()\n\t{\n\t\t$this->data['crystal_report']=$this->reports_personnel_schedule_model->crystal_report_view();\n\t\t$this->data['company_list'] = $this->reports_personnel_schedule_model->company_list();\n\t\t$this->load->view('employee_portal/report_personnel/schedule/date_range_report',$this->data);\n\t}", "function approvedTimesheet($type=1, $pg=1, $limit=25) \t{\n\t\t$this->getMenu();\n\t\t$form = array();\n\t\tif($type==1) {\n\t\t\t$this->session->unset_userdata('client_no');\n\t\t\t$this->session->unset_userdata('client_name');\n\t\t\t$this->session->unset_userdata('project_no');\n\t\t}\n\t\telseif($type==2) {\n\t\t\t$this->session->unset_userdata('client_no');\n\t\t\t$this->session->unset_userdata('client_name');\n\t\t\t$this->session->unset_userdata('project_no');\n\t\t\t\n\t\t\tif($this->input->post('client_no')) \t\t$form['client_no'] = $this->input->post('client_no');\n\t\t\tif($this->input->post('client_name'))\t\t$form['client_name'] = $this->input->post('client_name');\n\t\t\tif($this->input->post('project_no'))\t\t$form['project_no'] = $this->input->post('project_no');\n\t\t\t$this->session->set_userdata($form);\n\t\t}\n\t\t\n\t\tif($this->session->userdata('client_no')) \t$form['client_no'] = $this->session->userdata('client_no');\n\t\tif($this->session->userdata('client_name')) $form['client_name'] = $this->session->userdata('client_name');\n\t\tif($this->session->userdata('project_no')) \t$form['project_no']\t = $this->session->userdata('project_no');\n\t\t\n\t\tif($limit) {\n\t\t\t$this->session->set_userdata('rpp', $limit);\n\t\t\t$this->rpp = $limit;\n\t\t}\n\t\t$limit\t\t= $limit ? $limit : $this->rpp;\n\t\t$this->data['done'] \t\t= $this->timesheetModel->getTimesheetDone();\n\t\n\t\t$this->load->view('timesheet_approvedTimesheet',$this->data); \n\t}", "public function timeWorkshop() {\n\t\t$pageTitle = 'Time Management Strategies Workshop';\n\t\t// $stylesheet = '';\n\n\t\tinclude_once SYSTEM_PATH.'/view/header.php';\n\t\tinclude_once SYSTEM_PATH.'/view/academic-help/owsub-time.php';\n\t\tinclude_once SYSTEM_PATH.'/view/footer.php';\n\t}", "public function viewAction()\n {\n \t$idEmployee = EmployeeCatalog::getInstance()->getIdEmployeeByIdUser($this->getUser()->getBean()->getIdUser());\n \t$projects = ProjectCatalog::getInstance()->getIdProjectByIdEmployee($idEmployee); \t\n \tforeach ($projects as $project)\n \t{\n \t\t$tmp[]=$project['id_project'];\n\t\t}\n\t\t$stringProjects = implode(\",\",$tmp);\n\t\t$strProjects='\"';\t\n\t\t$strProjects.= implode(\",\",$tmp);\n\t\t$strProjects.='\"';\t\n\t\t$dates = TimetableHourCatalog::getInstance()->getDisctinctDateByIdProjects($stringProjects);\n \tforeach ($dates as $date)\n \t{\n \t\t$date = $date['date'];\n \t\t$statusTask= TimetableHourCatalog::getInstance()->getStatusByDate($date);\n \t\tif ($statusTask == 2)\n \t\t\t$dateArray2[] = $date;\n \t\tif ($statusTask == 3)\n \t\t\t$dateArray3[] = $date;\n \t\tif ($statusTask == 4)\n \t\t\t$dateArray4[] = $date;\n \t\tif ($statusTask == 1)\n \t\t\t$dateArray1[] = $date;\n\t\t}\t\t\n\t\t$datesStatus2=CalendarDayManager::getInstance()->getCalendarDays($dateArray2);\n\t\t$datesStatus3=CalendarDayManager::getInstance()->getCalendarDays($dateArray3);\n\t\t$datesStatus4=CalendarDayManager::getInstance()->getCalendarDays($dateArray4);\n\t\t$datesStatus1=CalendarDayManager::getInstance()->getCalendarDays($dateArray1);\n\t\t$this->view->daysStaus2= json_encode($datesStatus2);\n\t\t$this->view->daysStaus3= json_encode($datesStatus3);\n\t\t$this->view->daysStaus4= json_encode($datesStatus4);\n\t\t$this->view->daysStaus1= json_encode($datesStatus1); \n\t\t$this->view->projects = $strProjects; \t\t\n $this->setTitle('Calendario de Tareas');\n }", "public function helpdeskstatusAction(){\n\n $this->view->helpdeskstatus = $this->ModelObj->allheldeskstatus(); \n\n }", "function time() {\n if($this->active_invoice->isLoaded()) {\n if($this->active_invoice->canViewRelatedItems($this->logged_user)) {\n $this->wireframe->print->enable();\n \n $this->response->assign(array(\n 'time_records' => $this->active_invoice->getTimeRecords(),\n 'expenses' => $this->active_invoice->getExpenses(),\n 'items_can_be_released' => $this->active_invoice->isDraft() || $this->active_invoice->isCanceled()\n ));\n } else {\n $this->response->forbidden();\n } // if\n } else {\n $this->response->notFound();\n } // if\n }", "public function getTimesheetRecent(){\n $emp_id = Auth::user()->id;\n $data['response'] = $this->timesheet->getInformRecent($emp_id);\n $data = $this->formatDate($data);\n return $data;\n }", "public function actionList()\n {\n $searchModel = new WeekStatsRepository();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render([\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "function alltimeAction() {\n\t\t$this->getModel()->setPage($this->getPageFromRequest());\n\n\t\t$oView = new userView($this);\n\t\t$oView->showAlltimeLeaderboard();\n\t}", "public function actionFixHourScheduler() {\n $fixedUserIds = [];\n $fixedRecords = 0;\n $hourIdsToDelete = [];\n\n $dataProvider = new CActiveDataProvider(\"UserWorkdayPeriodWeeklyHourDivision\");\n $iterator = new CDataProviderIterator($dataProvider);\n foreach($iterator as $hour) {\n if(count($hour->scheduled) == 0){\n $hourIdsToDelete[] = $hour->id;\n }\n }\n\n echo \"first loop done \\n\";\n\n foreach($hourIdsToDelete as $hourIdToDelete){\n $hour = UserWorkdayPeriodWeeklyHourDivision::model()->findByPk($hourIdToDelete);\n if(is_null($hour)){\n echo \"HOUR ID: \".$hourIdToDelete.\" not found \\n\";\n continue;\n }\n\n $fixedRecords++;\n\n if(!is_null($hour->weekly) && !is_null($hour->weekly->period)){\n $weekly = $hour->weekly;\n $userId = $weekly->period->user_id;\n $fixedUserIds[$userId] = $userId;\n }\n\n $hour->delete();\n $weekly->updateHours(true);\n }\n\n\n\n echo \"Total fixed records: \".$fixedRecords.\"\\n\";\n echo \"Total fixed users: \".count($fixedUserIds).\"\\n\";\n\n if(count($fixedUserIds) > 0)\n echo \"Fixed user Id(s): \".implode(\", \", $fixedUserIds).\"\\n\";\n }", "public function storeTimes(Request $request){\n $times = Excel::load('public/times.csv', function ($reader) {\n // Load times\n })->get();\n foreach ($times as $time) {\n $period = new SelectionPeriod;\n $period->week = $time->week;\n $period->closed = $time->close;\n $period->reopen = $time->reopen;\n $period->send_email = $time->send_email;\n $period->save();\n }\n $full = false;\n if(SelectionPeriod::first() !=null){\n $full = true;\n }\n return view('upload-tools.close-lineups',compact('full'));\n }", "function admin_getCalculations($userId,$appointmentTime){\n pr($this->request->data); exit;\n }", "function retrieve_trailing_weekly_guest_list_reservation_requests(){\n\t\t$this->CI->load->model('model_users_promoters', 'users_promoters', true);\n\t\treturn $this->CI->users_promoters->retrieve_trailing_weekly_guest_list_reservation_requests($this->promoter->up_id);\n\t}", "public function actionWorkinghours(): array\n {\n $request = Yii::$app->request;\n\n if ($request->isPost) {\n return Appointments::WORKING_HOURS;\n }\n \n return [];\n }", "public function view_attendance() { \r\n date_default_timezone_set(\"Asia/Manila\");\r\n $date= date(\"Y-m-d\");\r\n $year = date('Y', strtotime($date));\r\n $month = date('m', strtotime($date));\r\n $datenow = $year .\"-\". $month;\r\n $set_data = $this->session->userdata('userlogin'); //session data\r\n $data = array('clientID' => $set_data['clientID']\r\n ); \r\n $firstDay = mktime(0,0,0,$month, 1, $year);\r\n $timestamp = $firstDay;\r\n $weekDays = array();\r\n for ($i = 0; $i < 31; $i++) {\r\n $weekDays[] = strftime('%a', $timestamp);\r\n $timestamp = strtotime('+1 day', $timestamp);\r\n } \r\n $records['clientprofile']=$this->Client_Model->clientprofile($data);\r\n $records['weekDays']=$weekDays;\r\n $records['useradmin']=$this->User_Model->usertype();\r\n $records['employeeatendance']=$this->Attendance_Model->viewattendanceemployee($set_data['clientID'], $datenow);\r\n $this->load->view('attendanceemployee', $records);\r\n }", "protected function process_overview()\n {\n global $index_includes;\n\n $l_rules = [\n 'C__MAINTENANCE__OVERVIEW__FILTER__DATE_FROM' => [\n 'p_strPopupType' => 'calendar',\n 'p_strClass' => 'input-mini',\n 'p_bInfoIconSpacer' => 0,\n 'p_strValue' => date('Y-m-d'),\n ],\n 'C__MAINTENANCE__OVERVIEW__FILTER__DATE_TO' => [\n 'p_strPopupType' => 'calendar',\n 'p_strClass' => 'input-mini',\n 'p_bInfoIconSpacer' => 0,\n ]\n ];\n\n $l_day_of_week = date('N') - 1;\n $l_this_week_time = time() - ($l_day_of_week * isys_convert::DAY);\n\n $l_this_week = mktime(0, 0, 0, date('m', $l_this_week_time), date('d', $l_this_week_time), date('Y', $l_this_week_time));\n\n $this->m_tpl->activate_editmode()\n ->assign(\n 'ajax_url',\n isys_helper_link::create_url(\n [\n C__GET__AJAX => 1,\n C__GET__AJAX_CALL => 'maintenance'\n ]\n )\n )\n ->assign('this_week', $l_this_week)\n ->assign('this_month', mktime(0, 0, 0, date('m'), 1, date('Y')))\n ->assign('next_week', $l_this_week + isys_convert::WEEK)\n ->assign('next_month', mktime(0, 0, 0, (date('m') + 1), 1, date('Y')))\n ->assign('next_next_month', mktime(0, 0, 0, (date('m') + 2), 1, date('Y')))\n ->assign(\n 'planning_url',\n isys_helper_link::create_url(\n [\n C__GET__MODULE_ID => C__MODULE__MAINTENANCE,\n C__GET__SETTINGS_PAGE => C__MAINTENANCE__PLANNING\n ]\n )\n )\n ->smarty_tom_add_rules('tom.content.bottom.content', $l_rules);\n\n $index_includes['contentbottomcontent'] = __DIR__ . DS . 'templates' . DS . 'overview.tpl';\n }", "public function index(Request $request)\n {\n $sheets = $this->TimeSheetService->getList($request->except('_token'));\n $request->flashExcept('_token');\n return view('sheet.index', compact('sheets'));\n }", "public function tablePost ()\n {\n // and make it a model to register\n \n \n $user = $_SESSION['connectedUser'];\n \n if ($user) {\n $authenticator = new Authentication($this->router);\n \n if ($authenticator->checkAuthentication($user)) {\n\n \n $weekStart = filter_input(INPUT_POST , 'week__start', FILTER_SANITIZE_STRING);\n $weekEnd = filter_input(INPUT_POST , 'week__end', FILTER_SANITIZE_STRING);\n $mondayMorningStart = filter_input(INPUT_POST , 'monday__morning__start', FILTER_SANITIZE_STRING);\n $mondayMorningEnd = filter_input(INPUT_POST , 'monday__morning__end', FILTER_SANITIZE_STRING);\n $mondayAfternoonStart = filter_input(INPUT_POST , 'monday__afternoon__start', FILTER_SANITIZE_STRING);\n $mondayAfternoonEnd = filter_input(INPUT_POST , 'monday__afternoon__end', FILTER_SANITIZE_STRING);\n $mondayStart = filter_input(INPUT_POST , 'monday__start', FILTER_SANITIZE_STRING);\n $mondayEnd = filter_input(INPUT_POST , 'monday__end', FILTER_SANITIZE_STRING);\n $mondayResultStandard = filter_input(INPUT_POST , 'monday__result__standard', FILTER_SANITIZE_STRING);\n $mondayResultHundredths = filter_input(INPUT_POST , 'monday__result__hundredths', FILTER_SANITIZE_STRING);\n $tuesdayMorningStart = filter_input(INPUT_POST , 'tuesday__morning__start', FILTER_SANITIZE_STRING);\n $tuesdayMorningEnd = filter_input(INPUT_POST , 'tuesday__morning__end', FILTER_SANITIZE_STRING);\n $tuesdayAfternoonStart = filter_input(INPUT_POST , 'tuesday__afternoon__start', FILTER_SANITIZE_STRING);\n $tuesdayAfternoonEnd = filter_input(INPUT_POST , 'tuesday__afternoon__end', FILTER_SANITIZE_STRING);\n $tuesdayStart = filter_input(INPUT_POST , 'tueday__start', FILTER_SANITIZE_STRING);\n $tuesdayEnd = filter_input(INPUT_POST , 'tueday__end', FILTER_SANITIZE_STRING);\n $tuesdayResultStandard = filter_input(INPUT_POST , 'tuesday__result__standard', FILTER_SANITIZE_STRING);\n $tuesdayResultHundredths = filter_input(INPUT_POST , 'tuesday__result__hundredths', FILTER_SANITIZE_STRING);\n $wednesdayMorningStart = filter_input(INPUT_POST , 'wednesday__morning__start', FILTER_SANITIZE_STRING);\n $wednesdayMorningEnd = filter_input(INPUT_POST , 'wednesday__morning__end', FILTER_SANITIZE_STRING);\n $wednesdayAfternoonStart = filter_input(INPUT_POST , 'wednesday__afternoon__start', FILTER_SANITIZE_STRING);\n $wednesdayAfternoonEnd = filter_input(INPUT_POST , 'wednesday__afternoon__end', FILTER_SANITIZE_STRING);\n $wednesdayStart = filter_input(INPUT_POST , 'wednesday__start', FILTER_SANITIZE_STRING);\n $wednesdayEnd = filter_input(INPUT_POST , 'wednesday__end', FILTER_SANITIZE_STRING);\n $wednesdayResultStandard = filter_input(INPUT_POST , 'wednesday__result__standard', FILTER_SANITIZE_STRING);\n $wednesdayResultHundredths = filter_input(INPUT_POST , 'wednesday__result__hundredths', FILTER_SANITIZE_STRING);\n $thursdayMorningStart = filter_input(INPUT_POST , 'thursday__morning__start', FILTER_SANITIZE_STRING);\n $thursdayMorningEnd = filter_input(INPUT_POST , 'thursday__morning__end', FILTER_SANITIZE_STRING);\n $thursdayAfternoonStart = filter_input(INPUT_POST , 'thursday__afternoon__start', FILTER_SANITIZE_STRING);\n $thursdayAfternoonEnd = filter_input(INPUT_POST , 'thursday__afternoon__end', FILTER_SANITIZE_STRING);\n $thursdayStart = filter_input(INPUT_POST , 'thursday__start', FILTER_SANITIZE_STRING);\n $thursdayEnd = filter_input(INPUT_POST , 'thursday__end', FILTER_SANITIZE_STRING);\n $thursdayResultStandard = filter_input(INPUT_POST , 'thursday__result__standard', FILTER_SANITIZE_STRING);\n $thursdayResultHundredths = filter_input(INPUT_POST , 'thursday__result__hundredths', FILTER_SANITIZE_STRING);\n $fridayMorningStart = filter_input(INPUT_POST , 'friday__morning__start', FILTER_SANITIZE_STRING);\n $fridayMorningEnd = filter_input(INPUT_POST , 'friday__morning__end', FILTER_SANITIZE_STRING);\n $fridayAfternoonStart = filter_input(INPUT_POST , 'friday__afternoon__start', FILTER_SANITIZE_STRING);\n $fridayAfternoonEnd = filter_input(INPUT_POST , 'friday__afternoon__end', FILTER_SANITIZE_STRING);\n $fridayStart = filter_input(INPUT_POST , 'friday__start', FILTER_SANITIZE_STRING);\n $fridayEnd = filter_input(INPUT_POST , 'friday__end', FILTER_SANITIZE_STRING);\n $fridayResultStandard = filter_input(INPUT_POST , 'friday__result__standard', FILTER_SANITIZE_STRING);\n $fridayResultHundredths = filter_input(INPUT_POST , 'friday__result__hundredths', FILTER_SANITIZE_STRING);\n $saturdayMorningStart = filter_input(INPUT_POST , 'saturday__morning__start', FILTER_SANITIZE_STRING);\n $saturdayMorningEnd = filter_input(INPUT_POST , 'saturday__morning__end', FILTER_SANITIZE_STRING);\n $saturdayAfternoonStart = filter_input(INPUT_POST , 'saturday__afternoon__start', FILTER_SANITIZE_STRING);\n $saturdayAfternoonEnd = filter_input(INPUT_POST , 'saturday__afternoon__end', FILTER_SANITIZE_STRING);\n $saturdayStart = filter_input(INPUT_POST , 'saturday__start', FILTER_SANITIZE_STRING);\n $saturdayEnd = filter_input(INPUT_POST , 'saturday__end', FILTER_SANITIZE_STRING);\n $saturdayResultStandard = filter_input(INPUT_POST , 'saturday__result__standard', FILTER_SANITIZE_STRING);\n $saturdayResultHundredths = filter_input(INPUT_POST , 'saturday__result__hundredths', FILTER_SANITIZE_STRING);\n $finalStandardResult = filter_input(INPUT_POST , 'finalStandardResult', FILTER_SANITIZE_STRING);\n $finalHundredthsResult = filter_input(INPUT_POST , 'finalhundredthsResult', FILTER_SANITIZE_STRING);\n $token = filter_input(INPUT_POST, 'token', FILTER_SANITIZE_STRING);\n\n $errorsList = [];\n\n if(empty($token) || $token != $_SESSION['csrfToken']){\n $errorsList[] = \"Erreur CSRF !\";\n }\n\n if(empty($errorsList)) {\n $table = new Table;\n\n $table->setWeekStart($weekStart)\n ->setWeekEnd($weekEnd)\n ->setMondayMorningStart($mondayMorningStart)\n ->setMondayMorningEnd($mondayMorningEnd)\n ->setMondayAfternoonStart($mondayAfternoonStart)\n ->setMondayAfternoonEnd($mondayAfternoonEnd)\n ->setMondayStart($mondayStart)\n ->setMondayEnd($mondayEnd)\n ->setMondayResultStandard($mondayResultStandard)\n ->setMondayResultHundredths($mondayResultHundredths)\n ->setTuesdayMorningStart($tuesdayMorningStart)\n ->setTuesdayMorningEnd($tuesdayMorningEnd)\n ->setTuesdayAfternoonStart($tuesdayAfternoonStart)\n ->setTuesdayAfternoonEnd($tuesdayAfternoonEnd)\n ->setTuesdayStart($tuesdayStart)\n ->setTuesdayEnd($tuesdayEnd)\n ->setTuesdayResultStandard($tuesdayResultStandard)\n ->setTuesdayResultHundredths($tuesdayResultHundredths)\n ->setWednesdayMorningStart($wednesdayMorningStart)\n ->setWednesdayMorningEnd($wednesdayMorningEnd)\n ->setWednesdayAfternoonStart($wednesdayAfternoonStart)\n ->setWednesdayAfternoonEnd($wednesdayAfternoonEnd)\n ->setWednesdayStart($wednesdayStart)\n ->setWednesdayEnd($wednesdayEnd)\n ->setWednesdayResultStandard($wednesdayResultStandard)\n ->setWednesdayResultHundredths($wednesdayResultHundredths)\n ->setThursdayMorningStart($thursdayMorningStart)\n ->setThursdayMorningEnd($thursdayMorningEnd)\n ->setThursdayAfternoonStart($thursdayAfternoonStart)\n ->setThursdayAfternoonEnd($thursdayAfternoonEnd)\n ->setThursdayStart($thursdayStart)\n ->setThursdayEnd($thursdayEnd)\n ->setThursdayResultStandard($thursdayResultStandard)\n ->setThursdayResultHundredths($thursdayResultHundredths)\n ->setFridayMorningStart($fridayMorningStart)\n ->setFridayMorningEnd($fridayMorningEnd)\n ->setFridayAfternoonStart($fridayAfternoonStart)\n ->setFridayAfternoonEnd($fridayAfternoonEnd)\n ->setFridayStart($fridayStart)\n ->setFridayEnd($fridayEnd)\n ->setFridayResultStandard($fridayResultStandard)\n ->setFridayResultHundredths($fridayResultHundredths)\n ->setSaturdayMorningStart($saturdayMorningStart)\n ->setSaturdayMorningEnd($saturdayMorningEnd)\n ->setSaturdayAfternoonStart($saturdayAfternoonStart)\n ->setSaturdayAfternoonEnd($saturdayAfternoonEnd)\n ->setSaturdayStart($saturdayStart)\n ->setSaturdayEnd($saturdayEnd)\n ->setSaturdayResultStandard($saturdayResultStandard)\n ->setSaturdayResultHundredths($saturdayResultHundredths)\n ->setFinalStandardResult($finalStandardResult)\n ->setFinalHundredthsResult($finalHundredthsResult)\n ->setUserId($user->getId())\n ;\n\n $result = $table->insertNew();\n \n if ($result) {\n $errorsList = [];\n unset($_SESSION['token']);\n $_SESSION['tableSuccess'] = \"Votre tableau d'heures a bien été enregister, vous pouvez le consulter depuis votre espace personnel\";\n\n return $this->redirectTo('profil', $user->getNickname());\n }\n\n $errorsList[] = 'Une erreur s\\'est produite, veuillez réessayer plus tard ou contacter un administarteur';\n\n }\n\n $viewDatas = [\n 'errorsList' => $errorsList,\n ];\n\n return $this->render('main/table.tpl.php', $viewDatas);\n\n }\n }\n\n return $this->redirectTo('login');\n }", "public function pausetimeAction()\n {\n $user_params=$this->_request->getParams();\n $ftvrequest_obj = new Ep_Ftv_FtvRequests();\n $ftvcontacts_obj = new Ep_Ftv_FtvContacts();\n $ftvtime_obj = new Ep_Ftv_FtvPauseTime();\n if($user_params['type'] == 'pause')\n {\n ////for goroup Id in users table////\n $ftvtime_obj->ftvrequest_id=$user_params['requestId'];\n $ftvtime_obj->pause_at=date('Y-m-d H:i:s') ;\n $ftvtime_obj->resume_at=null;\n $ftvtime_obj->insert();\n }\n else\n {\n $data = array(\"resume_at\"=>date('Y-m-d H:i:s'));////////updating\n $query = \"ftvrequest_id= '\".$user_params['requestId'].\"' AND resume_at is null\";\n $ftvtime_obj->updateFtvPauseTime($data,$query);\n }\n }", "function get_delivery_date_withing_week_page($cDate,$lWeek){\n $query = \"\n SELECT\n view_delivery_dates.mgo_file_ref,\n view_delivery_dates.dos_file_ref,\n view_delivery_dates.vote_id,\n view_delivery_dates.vote_head,\n view_delivery_dates.vote_name,\n view_delivery_dates.item_id,\n view_delivery_dates.item_code,\n view_delivery_dates.item_name,\n view_delivery_dates.quantity,\n view_delivery_dates.unit_type_id,\n view_delivery_dates.unit_name,\n view_delivery_dates.tndr_open_date,\n view_delivery_dates.ho_date,\n view_delivery_dates.date_of_doc_ho,\n view_delivery_dates.tec_due_date,\n view_delivery_dates.received_tec_date,\n view_delivery_dates.forward_tec_date,\n view_delivery_dates.recomma_due_date,\n view_delivery_dates.rece_rec_date,\n view_delivery_dates.fwd_tb_date,\n view_delivery_dates.tb_approval_date,\n view_delivery_dates.appd_sup_id,\n view_delivery_dates.supplier_ref,\n view_delivery_dates.supplier_name,\n view_delivery_dates.appd_sup_remarks,\n view_delivery_dates.delivery_date\n FROM\n view_delivery_dates\n WHERE view_delivery_dates.delivery_date BETWEEN '$cDate' AND '$lWeek'\n \";\n $query_result = $this->mDbm->setData($query);\n return $query_result;\n }", "function weekly_summary() {\r\n\t global $wpdb;\r\n\r\n $img_base = $this->plugin_url. 'images/';\r\n\r\n\t //count total\r\n $current_total = $wpdb->get_var(\"SELECT COUNT(*) FROM {$wpdb->base_prefix}pro_sites WHERE expire > '\" . time() . \"'\");\r\n\r\n\t $date = date(\"Y-m-d\", strtotime( \"-1 week\" ) );\r\n\t $last_total = $wpdb->get_var(\"SELECT supporter_count FROM {$wpdb->base_prefix}pro_sites_daily_stats WHERE date >= '$date' ORDER BY date ASC LIMIT 1\");\r\n\r\n\t if ($current_total > $last_total) {\r\n\t $active_diff = \"<img src='{$img_base}green-up.gif'><span style='font-size: 18px; font-family: arial;'>\" . number_format_i18n($current_total-$last_total) . \"</span>\";\r\n\t } else if ($current_total < $last_total) {\r\n\t $active_diff = \"<img src='{$img_base}red-down.gif'><span style='font-size: 18px; font-family: arial;'>\" . number_format_i18n(-($current_total-$last_total)) . \"</span>\";\r\n\t } else {\r\n\t $active_diff = \"<span style='font-size: 18px; font-family: arial;'>\" . __('no change', 'psts') . \"</span>\";\r\n\t }\r\n\r\n\t $text = sprintf(__('%s active Pro Sites %s since last week', 'psts'), \"<p><span style='font-size: 24px; font-family: arial;'>\" . number_format_i18n($current_total) . \"</span><span style='color: rgb(85, 85, 85);'>\", \"</span>$active_diff<span style='color: rgb(85, 85, 85);'>\") . \"</span></p>\";\r\n\r\n\t //activity stats\r\n\t $week_start = strtotime( \"-1 week\" );\r\n $week_start_date = date('Y-m-d', $week_start);\r\n\t $this_week['total_signups'] = $wpdb->get_var(\"SELECT COUNT(*) FROM {$wpdb->base_prefix}pro_sites_signup_stats WHERE action = 'signup' AND time_stamp >= '$week_start_date'\");\r\n\t $this_week['upgrades'] = $wpdb->get_var(\"SELECT COUNT(*) FROM {$wpdb->base_prefix}pro_sites_signup_stats WHERE action = 'upgrade' AND time_stamp >= '$week_start_date'\");\r\n\t $this_week['cancels'] = $wpdb->get_var(\"SELECT COUNT(*) FROM {$wpdb->base_prefix}pro_sites_signup_stats WHERE action = 'cancel' AND time_stamp >= '$week_start_date'\");\r\n\r\n\t $week_end = $week_start;\r\n\t $week_start = strtotime( \"-1 week\", $week_start );\r\n $week_start_date = date('Y-m-d', $week_start);\r\n $week_end_date = date('Y-m-d', $week_end);\r\n\t $last_week['total_signups'] = $wpdb->get_var(\"SELECT COUNT(*) FROM {$wpdb->base_prefix}pro_sites_signup_stats WHERE action = 'signup' AND time_stamp >= '$week_start_date' AND time_stamp < '$week_end_date'\");\r\n\t $last_week['upgrades'] = $wpdb->get_var(\"SELECT COUNT(*) FROM {$wpdb->base_prefix}pro_sites_signup_stats WHERE action = 'upgrade' AND time_stamp >= '$week_start_date' AND time_stamp < '$week_end_date'\");\r\n\t $last_week['cancels'] = $wpdb->get_var(\"SELECT COUNT(*) FROM {$wpdb->base_prefix}pro_sites_signup_stats WHERE action = 'cancel' AND time_stamp >= '$week_start_date' AND time_stamp < '$week_end_date'\");\r\n\r\n\t if ($this_week['total_signups'] > $last_week['total_signups']) {\r\n\t $diff = \"<img src='{$img_base}green-up.gif'><span style='font-size: 18px; font-family: arial;'>\" . number_format_i18n($this_week['total_signups']-$last_week['total_signups']) . \"</span>\";\r\n\t } else if ($this_week['total_signups'] < $last_week['total_signups']) {\r\n\t $diff = \"<img src='{$img_base}red-down.gif'><span style='font-size: 18px; font-family: arial;'>\" . number_format_i18n(-($this_week['total_signups']-$last_week['total_signups'])) . \"</span>\";\r\n\t } else {\r\n\t $diff = \"<span style='font-size: 18px; font-family: arial;'>\" . __('no change', 'psts') . \"</span>\";\r\n\t }\r\n\r\n $text .= sprintf(__('%s new signups this week %s compared to last week', 'psts'), \"\\n<p><span style='font-size: 24px; font-family: arial;'>\" . number_format_i18n($this_week['total_signups']) . \"</span><span style='color: rgb(85, 85, 85);'>\", \"</span>$diff<span style='color: rgb(85, 85, 85);'>\") . \"</span></p>\";\r\n\r\n\t if ($this_week['upgrades'] > $last_week['upgrades']) {\r\n\t $diff = \"<img src='{$img_base}green-up.gif'><span style='font-size: 18px; font-family: arial;'>\" . number_format_i18n($this_week['upgrades']-$last_week['upgrades']) . \"</span>\";\r\n\t } else if ($this_week['upgrades'] < $last_week['upgrades']) {\r\n\t $diff = \"<img src='{$img_base}red-down.gif'><span style='font-size: 18px; font-family: arial;'>\" . number_format_i18n(-($this_week['upgrades']-$last_week['upgrades'])) . \"</span>\";\r\n\t } else {\r\n\t $diff = \"<span style='font-size: 18px; font-family: arial;'>\" . __('no change', 'psts') . \"</span>\";\r\n\t }\r\n\r\n\t\t$text .= sprintf(__('%s upgrades this week %s compared to last week', 'psts'), \"\\n<p><span style='font-size: 24px; font-family: arial;'>\" . number_format_i18n($this_week['upgrades']) . \"</span><span style='color: rgb(85, 85, 85);'>\", \"</span>$diff<span style='color: rgb(85, 85, 85);'>\") . \"</span></p>\";\r\n\r\n\t if ($this_week['cancels'] > $last_week['cancels']) {\r\n\t $diff = \"<img src='{$img_base}red-up.gif'><span style='font-size: 18px; font-family: arial;'>\" . number_format_i18n($this_week['cancels']-$last_week['cancels']) . \"</span>\";\r\n\t } else if ($this_week['cancels'] < $last_week['cancels']) {\r\n\t $diff = \"<img src='{$img_base}green-down.gif'><span style='font-size: 18px; font-family: arial;'>\" . number_format_i18n(-($this_week['cancels']-$last_week['cancels'])) . \"</span>\";\r\n\t } else {\r\n\t $diff = \"<span style='font-size: 18px; font-family: arial;'>\" . __('no change', 'psts') . \"</span>\";\r\n\t }\r\n\r\n\t $text .= sprintf(__('%s cancelations this week %s compared to last week', 'psts'), \"\\n<p><span style='font-size: 24px; font-family: arial;'>\" . number_format_i18n($this_week['cancels']) . \"</span><span style='color: rgb(85, 85, 85);'>\", \"</span>$diff<span style='color: rgb(85, 85, 85);'>\") . \"</span></p>\";\r\n\r\n\t return $text;\r\n\t}", "public function schedule_by_date(Request $request) {\n //\n $currentDate = $request->segment(2);\n $day = \\Helpers\\DateHelper::getDay($currentDate);\n $weekDays = \\Helpers\\DateHelper::getWeekDays($currentDate, $day); \n $workouts = \\App\\Schedule::getScheduledWorkouts($weekDays);\n \n return view('user/schedule', ['number_of_day' => $day, 'current_date' => $currentDate, 'weekDays' => $weekDays])\n ->with('target_areas', json_decode($this->target_areas, true))\n ->with('movements', json_decode($this->movements, true))\n ->with('workouts', $workouts); \n }", "public function viewArchivedTimesheets() {\n $type = request('type');\n $value = request('value');\n\n $date = date('W', time());\n\n if ($type == null) { \n $type = 'Date'; \n }\n if ($type == 'Date') {\n if ($value !== null) {\n $date = date('W', strtotime($value));\n }\n if($date%2 != 1){\n $date = $date -1;\n }\n $value = date('Y-m-d', strtotime(date('Y').\"W\".sprintf(\"%02d\", $date).\"1\"));\n }\n\n $timesheets = null;\n\n switch ($type) {\n case 'Date':\n $timesheets = Timesheet::where('organizationId', '=', Auth::user()->organizationId)\n ->where('startDate', 'like', $value)\n ->join('users', 'timesheets.userId', '=', 'users.id')\n ->orderby('name', 'ASC')\n ->get();\n break;\n case 'Name':\n $timesheets = Timesheet::where('organizationId', '=', Auth::user()->organizationId)\n ->where('name', '=', $value)\n ->join('users', 'timesheets.userId', '=', 'users.id')\n ->orderby('startDate', 'DESC')\n ->get();\n break;\n }\n \n $users = User::where('organizationId', '=', Auth::user()->organizationId)->get();\n\n return view('admin.archived-timesheets', compact('type', 'value', 'timesheets', 'users'));\n }", "function get_time_table_data()\n\t\t{\n\t\t$this->load->view('backend/parents/get_time_table_data', $_POST['student_name'],$_POST['month'],$_POST['week']);\t\t\t\t\t\t\t }", "public function fullUkAction(){\n \t$logger = new Frogg_Log('/home2/bleachse/public_html/seriando/log/calendar_UK.log');\n \t$xml = new XMLReader();\n \tif(!$xml->open('http://services.tvrage.com/feeds/fullschedule.php?country=UK')){\n \t\t$logger->err('Failed to open input file');\n \t\t$logger->close();\n \t\tdie;\n \t}\n \t$logger->info('Starting to index full schedule');\n \t$series = new Application_Model_Series();\n \twhile ($xml->read()){\n \t\twhile($xml->read() && $xml->name != 'DAY');//Goes to next <DAY>\n \t\t$timestamp = new Frogg_Time_Time($xml->getAttribute('attr'));\n \t\t$timestamp = $timestamp->getUnixTstamp();\n \t\twhile($xml->read()){ //Daily shows reading\n \t\t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'show'){ //Found new show\n \t\t\t\t$episode_name = $xml->getAttribute('name');\n \t\t\t\t$show_id = '';\n \t\t\t\twhile($xml->read() && $xml->name != 'sid'); //Found show id\n \t\t\t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'sid'){\n \t\t\t\t\t$show_id = $xml->readString();\n \t\t\t\t}\n \t\t\t\twhile($xml->read() && $xml->name != 'ep'); //Found episode air order\n \t\t\t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'ep'){\n \t\t\t\t\t$episode_num = $xml->readString();\n \t\t\t\t\t$scheduled = new Application_Model_Scheduled($show_id,'http://services.tvrage.com/tools/quickinfo.php?show='.urlencode($episode_name).'&ep='.$episode_num,Application_Model_Scheduled::UNREAD,$timestamp);\n \t\t\t\t\t$scheduled->save();\n \t\t\t\t\t$logger->ok('Saved : '.$scheduled->link);\n \t\t\t\t}\n \t\t\t$xml->next('show');\n \t\t\t} else if($xml->nodeType == XMLReader::END_ELEMENT && $xml->name == 'DAY'){ //Found </DAY>\n \t\t\t\tbreak;\n \t\t\t}\n \t\t}//END - Daily shows reading\n \t}\n \t$logger->close();\n \tdie;\n }", "function get_weekday_stats(){\n if(!DashboardCommon::is_su()) return null;\n \n $sat = strtotime(\"last saturday\");\n $sat = date('w', $sat) == date('w') ? $sat + 7 * 86400 : $sat;\n $fri = strtotime(date(\"Y-m-d\", $sat) . \" +6 days\");\n $from = date(\"Y-m-d\", $sat);//for current week only\n $to = date(\"Y-m-d\", $fri);//for current week only\n $sql = \"SELECT DAYNAME(atr.call_start) as dayname,count(*) as total \n FROM week_days wd \n LEFT JOIN ( SELECT * FROM calls WHERE call_start >= '\" . $this->from . \"' AND call_start <= '\" . $this->to . \"') atr\n ON wd.week_day_num = DAYOFWEEK(atr.call_start)\n GROUP BY\n DAYOFWEEK(atr.call_start)\";\n\n $this_week_rec = DashboardCommon::db()->Execute($sql);\n $saturday = $sunday = $monday = $tuesday = $wednesday = 0;\n $thursday = $friday = 0;\n// $data = array();\n// while (!$this_week_rec->EOF) {\n// $k = $this_week_rec->fields['dayname'];\n// $data[$k]= $this_week_rec->fields['total'];\n// $this_week_rec->MoveNext();\n// }\n// \n// return array_keys($data, max($data));\n\n while (!$this_week_rec->EOF) {\n $daynames = $this_week_rec->fields['dayname'];\n $totalcalls = $this_week_rec->fields['total'];\n if ($daynames == 'Saturday') {\n $saturday = $this_week_rec->fields['total'];\n }\n if ($daynames == 'Sunday') {\n $sunday = $this_week_rec->fields['total'];\n }\n if ($daynames == 'Monday') {\n $monday = $this_week_rec->fields['total'];\n }\n if ($daynames == 'Tuesday') {\n $tuesday = $this_week_rec->fields['total'];\n }\n if ($daynames == 'Wednesday') {\n $wednesday = $this_week_rec->fields['total'];\n }\n if ($daynames == 'Thursday') {\n $thursday = $this_week_rec->fields['total'];\n }\n if ($daynames == 'Friday') {\n $friday = $this_week_rec->fields['total'];\n }\n\n $this_week_rec->MoveNext();\n }\n\n $arr = array('Saturday' => $saturday,\n 'Sunday' => $sunday,\n 'Monday' => $monday,\n 'Tuesday' => $tuesday,\n 'Wednesday' => $wednesday,\n 'Thursday' => $thursday,\n 'Friday' => $friday\n );\n $max_day = array_keys($arr, max($arr));\n \n $avg_calltime_sql = \"SELECT sum(duration) as total_call_time, count(*) as total_records, \n sum(duration) / count(*) as avg_time\n FROM \n (\n SELECT call_end-call_start as duration\n FROM calls\n WHERE call_start >= '\".$this->from.\"' AND call_start <= '\".$this->to.\"'\n ) as dt\";\n $avg_calltime_res = DashboardCommon::db()->Execute($avg_calltime_sql);\n \n \n return array('weekday'=>$max_day[0],'avg_call_time'=>$avg_calltime_res->fields['avg_time']);\n \n }", "public function action_index()\n\t{\n\t\t$type = 'week';\n\n\t\t$settings = array\n\t\t(\n\t\t\t'_label' => 'Week 1',\n\t\t\t'_namespace' => 'mmi',\n\t\t\t'class' => 'week',\n\t\t\t'id' => 'week1',\n\t\t\t'required' => 'required',\n\t\t\t'step' => 3,\n\t\t\t'value' => '1970-W01'\n\t\t);\n\t\t$field = MMI_Form_Field::factory($type, $settings);\n\t\t$this->_form->add_field($field);\n\t\tif ($this->debug)\n\t\t{\n\t\t\tMMI_Debug::dump($field->render(), $type.' (step 3)');\n\t\t}\n\n\t\t$settings = array_merge($settings, array\n\t\t(\n\t\t\t'_after' => '2010-W10',\n\t\t\t'_before' => '2010-W01',\n\t\t\t'_label' => 'Week 2',\n\t\t\t'id' => 'week2',\n\t\t\t'max' => '2010-W10',\n\t\t\t'min' => '2010-W01',\n\t\t\t'required' => FALSE,\n\t\t\t'step' => 1,\n\t\t\t'value' => '',\n\t\t));\n\t\t$field = MMI_Form_Field::factory($type, $settings);\n\t\t$this->_form->add_field($field);\n\t\tif ($this->debug)\n\t\t{\n\t\t\tMMI_Debug::dump($field->render(), $type.' (min 2010-W01; max 2010-W10; step 1)');\n\t\t}\n\n\t\t$settings = array_merge($settings, array\n\t\t(\n\t\t\t'_before' => '2010-W10',\n\t\t\t'_label' => 'Week 3',\n\t\t\t'id' => 'week3',\n\t\t\t'min' => '2010-W10',\n\t\t\t'step' => 2,\n\t\t));\n\t\tunset($settings['_after'], $settings['max']);\n\t\t$field = MMI_Form_Field::factory($type, $settings);\n\t\t$this->_form->add_field($field);\n\t\tif ($this->debug)\n\t\t{\n\t\t\tMMI_Debug::dump($field->render(), $type.' (min 2010-W10; step 2)');\n\t\t}\n\n\t\t$settings = array_merge($settings, array\n\t\t(\n\t\t\t'_after' => '2010-W30',\n\t\t\t'_label' => 'Week 4',\n\t\t\t'id' => 'week4',\n\t\t\t'max' => '2010-W30',\n\t\t\t'step' => 4,\n\t\t));\n\t\tunset($settings['_before'], $settings['min']);\n\t\t$field = MMI_Form_Field::factory($type, $settings);\n\t\t$this->_form->add_field($field);\n\t\tif ($this->debug)\n\t\t{\n\t\t\tMMI_Debug::dump($field->render(), $type.' (max 2010-W30; step 4)');\n\t\t}\n\t}", "public function overviewAction(){\n \t$analytics = new Pas_Analytics_Gateway($this->_ID, $this->_pword);\n \t$analytics->setProfile(25726058);\n \t$timeframe = new Pas_Analytics_Timespan(); \n $timeframe->setTimespan($this->_getParam('timespan'));\n \t$dates = $timeframe->getDates();\n \t$analytics->setStart($dates['start']);\n \t$analytics->setEnd($dates['end']);\n \t$analytics->setMetrics(\n array(\n Zend_Gdata_Analytics_DataQuery::METRIC_VISITORS,\n Zend_Gdata_Analytics_DataQuery::METRIC_PAGEVIEWS,\n Zend_Gdata_Analytics_DataQuery::METRIC_UNIQUE_PAGEVIEWS,\n Zend_Gdata_Analytics_DataQuery::METRIC_AVG_TIME_ON_PAGE,\n Zend_Gdata_Analytics_DataQuery::METRIC_ENTRANCES,\n Zend_Gdata_Analytics_DataQuery::METRIC_EXITS,\n Zend_Gdata_Analytics_DataQuery::METRIC_BOUNCES\n \t\t));\n \t$analytics->setDimensions(\n array(\n Zend_Gdata_Analytics_DataQuery::DIMENSION_PAGE_TITLE,\n Zend_Gdata_Analytics_DataQuery::DIMENSION_PAGE_PATH,\t\t\n \t\t));\n \tif(is_null($this->_getParam('filter'))){\n \t$analytics->setFilters(\n array(\n Zend_Gdata_Analytics_DataQuery::DIMENSION_PAGE_PATH \n . Zend_Gdata_Analytics_DataQuery::REGULAR_NOT . 'forum'\n\t ));\n\t } else {\n \t$analytics->setFilters(\n array(\n Zend_Gdata_Analytics_DataQuery::DIMENSION_PAGE_PATH \n . Zend_Gdata_Analytics_DataQuery::REGULAR . '/'\n . $this->_getParam('filter')\n\t ));\n\t }\n \t$analytics->setMax(20);\n \t$analytics->setSort(Zend_Gdata_Analytics_DataQuery::METRIC_VISITORS);\n \t$analytics->setSortDirection(true);\n \t$analytics->setStartIndex($this->getStart());\n \t$this->view->results = $analytics->getData();\n $paginator = Zend_Paginator::factory((int)$analytics->getTotal());\n $paginator->setCurrentPageNumber((int)$this->getPage())\n\t\t\t->setItemCountPerPage((int)self::MAX_RESULTS);\n $this->view->paginator = $paginator;\n }", "private static function printWeeks($startDate, $endDate, $formNum, $id)\r\n {\r\n $newDate = self::splitDates($startDate,$endDate);//retrive array of monday dates\r\n $divs =\"\";\r\n $numDates = count($newDate);\r\n if($numDates===0){//no future mondays meaning end date and start date only range of values\r\n $futuredate= new DateTime($startDate);\r\n $startDate= $futuredate->format(\"Y-m-d\");\r\n $displayStart = $futuredate->format(\"M d,Y\");//format date for route get hive\r\n $futuredate= new DateTime($endDate);\r\n $displayEnd= $futuredate->format(\"M d,Y\");\r\n $divs = \"<li class='list-group-item'><a href='viewform?form=\".$formNum. \"&weekStart=\".$startDate.\"&weekEnd=\".\r\n $futuredate->format(\"Y-m-d\").\"&id=\".$id.\"'>\". $displayStart.\r\n \" - \". $displayEnd.\"</a></li>\" . $divs;\r\n } else{//multiple weeks\r\n\r\n //display start day to saturday\r\n $futuredate= new DateTime($startDate);\r\n $startDate = new DateTime($startDate);\r\n $startDate= $startDate->format(\"Y-m-d\");\r\n if($futuredate->format('N')!=1)// if start date does not fall on a monday create first div\r\n {\r\n $displayStart = $futuredate->format(\"M d,Y\");//format date for route get hive\r\n $futuredate= $futuredate->modify('next sunday');\r\n $displayEnd= $futuredate->format(\"M d,Y\");\r\n $divs = \"<li class='list-group-item'><a href='viewform?form=\".$formNum. \"&weekStart=\".$startDate.\"&weekEnd=\".\r\n $futuredate->format(\"Y-m-d\").\"&id=\".$id.\"'>\". $displayStart.\r\n \" - \". $displayEnd.\"</a></li>\" . $divs;\r\n }\r\n //display all but last week\r\n for($i=0; $i<count($newDate)-1; $i++)\r\n {\r\n $futuredate = new DateTime($newDate[$i]);//convert date time object to be converted to next saturday\r\n $displayStart = $futuredate->format(\"M d,Y\");//format date for route get hive\r\n $futuredate->modify('next sunday');//grab saturday of the weeks monday date provided\r\n $futuredate->format(\"Y-m-d\");//format for route get hive\r\n\r\n $displayEnd =$futuredate->format(\"M d,Y\");//format for html example (October 31, 2018)\r\n //put together href utilizing all the information provided\r\n $divs = \"<li class='list-group-item'><a href='viewform?form=\".$formNum. \"&weekStart=\".$newDate[$i].\"&weekEnd=\".\r\n $futuredate->format(\"Y-m-d\").\"&id=\".$id.\"'>\". $displayStart.\r\n \" - \". $displayEnd.\"</a></li>\" . $divs;\r\n }\r\n\r\n //print last week making end date forms end date\r\n $futuredate = new DateTime($newDate[count($newDate)-1]);//convert date time object to be converted to next saturday\r\n $displayStart = $futuredate->format(\"M d,Y\");//format date for route get hive\r\n $futuredate= new DateTime($endDate);//grab saturday of the weeks monday date provided\r\n\r\n $futuredate->format(\"Y-m-d\");//format for route get hive\r\n\r\n $displayEnd =$futuredate->format(\"M d,Y\");//format for html example (October 31, 2018)\r\n //put together href utilizing all the information provided\r\n $divs = \"<li class='list-group-item'><a href='viewform?form=\".$formNum. \"&weekStart=\".$newDate[count($newDate)-1].\"&weekEnd=\".\r\n $futuredate->format(\"Y-m-d\").\"&id=\".$id.\"'>\". $displayStart.\r\n \" - \". $displayEnd.\"</a></li>\" . $divs;\r\n\r\n }\r\n return $divs;\r\n }", "public function get_attendance() {\n\t\t$view_type = ($this->uri->segment(3) === NULL)? 'daily': $this->uri->segment(3);\n\n\t\t$data['view_header'] = $this->get_sched_header($view_type);\n\t\t$data['view_type'] = $view_type;\n\t\t$data['type'] = ($this->type === NULL)? 'active': $this->type;\n\n\t\t$result = $this->Member_Model->get_attendance($view_type);\n\t\t$data['members'] = $result;\n\n\t\t$this->breadcrumbs->set(['Members Attendance' => 'members/attendance']);\n\n\t\t$this->render('attendance', $data);\n\t}", "function index( $data = array()) {\n\n/* ... data declarations */\n $data['announcements'] = array();\n $todaysDate = date( \"Y-m-d\" );\n\n/* ... define values for template variables to display on page */\n if (!array_key_exists( 'title', $data )) {\n $data['title'] = $this->config->item( 'siteName' );\n }\n $data['firstMonday'] = $this->config->item( 'firstMonday' );\n $data['endOfSeason'] = date( \"Y\", strtotime( $data['firstMonday'] ) ).\"-10-01\";\n\n/* ... set the name of the page to be displayed (and any header attributes) */\n if (!array_key_exists( 'main', $data )) {\n $data['main'] = \"home\";\n $data['noCache'] = TRUE;\n }\n\n/* ... if we're displaying the main Home page, see what announcements are to appear on it */\n if ($data['main'] == \"home\") {\n $data['announcements'] = $this->Model_Announcement->getCurrentSet();\n $data['announcements'] = $this->Model_Announcement->reviewSet( $data['announcements'] );\n }\n\n/* ... if displaying main page and we are in midst of season, display 2 week's of schedule */\n if ($data['main'] == 'home' && strtotime( $todaysDate ) < strtotime( $data['endOfSeason'] )) {\n\n/* ... determine last Sunday to current date, unless today is Sunday; then from there, a week prior and ahead */\n if (date( \"D\" ) != \"Sun\") {\n $curSunday = date( \"Y-m-d\", strtotime( \"last Sunday\" ) );\n }\n else {\n $curSunday = date( \"Y-m-d\" );\n }\n $prevSunday = date( \"Y-m-d\", strtotime( $curSunday.\" - 1 week\" ) );\n $nextSunday = date( \"Y-m-d\", strtotime( $curSunday.\" + 1 week\" ) );\n\n/* ... get the slate of games from last week */\n $lastWeekGames = $this->Model_Schedule->getSetOfGames( $prevSunday, $curSunday, FALSE );\n if (count( $lastWeekGames ) > 0) {\n $data['lastWeekSched'] = $this->_displayWeeksGames( $lastWeekGames );\n }\n\n/* ... get the slate of games from this week */\n $thisWeekGames = $this->Model_Schedule->getSetOfGames( $curSunday, $nextSunday, FALSE );\n if (count( $thisWeekGames ) > 0) {\n $data['thisWeekSched'] = $this->_displayWeeksGames( $thisWeekGames );\n }\n }\n\n/* ... determine which view for the small left hand contextual navigation menu */\n if (array_key_exists( 'UserId', $_SESSION )) {\n $data['contextNav'] = \"loggedIn\";\n }\n else {\n $data['contextNav'] = \"loggedOut\";\n }\n\n/* ... enable our template variables and then display the template, as we want it shown */\n $this->load->vars( $data );\n $this->load->view( \"template\" );\n\n/* ... time to go */\n return;\n }", "function generate_report($req, $res, $isMonthly = true, $timeUnit = null, $uid = 1) {\r\n\tif ($isMonthly) {\r\n\t\tif (is_null ( $timeUnit ) || ! is_numeric ( $timeUnit ) || $timeUnit > 12 || $timeUnit < 1) {\r\n\t\t\t$timeUnit = date ( 'M' );\r\n\t\t}\r\n\t} else {\r\n\t\tif (is_null ( $timeUnit )) {\r\n\t\t\t$timeUnit = date ( 'Y' );\r\n\t\t}\r\n\t}\r\n\t\r\n\trequire_once 'PHPExcel/PHPExcel.php';\r\n\t$objPHPExcel = new PHPExcel ();\r\n\t\r\n\theader ( 'Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' );\r\n\theader ( 'Content-Disposition: attachment;filename=\"report_' . ($isMonthly ? 'monthly' : 'yearly') . date ( 'YMDhm' ) . '.xlsx\"' );\r\n\theader ( 'Cache-Control: max-age=0' );\r\n\t\r\n\t// Set properties\r\n\t$objPHPExcel->getProperties ()->setCreator ( \"Roy Ganor\" )->setTitle ( \"Doctors Report\" )->setSubject ( \"Doctors Report\" )->setDescription ( \"Doctors Report\" );\r\n\t\r\n\twriteSurgeries ( $req, $res, $uid, $objPHPExcel );\r\n\twriteShifts ( $req, $res, $uid, $objPHPExcel );\r\n\twriteSessions ( $req, $res, $uid, $objPHPExcel );\r\n\twriteSurgeons ( $req, $res, $uid, $objPHPExcel );\r\n\twriteOperations ( $req, $res, $uid, $objPHPExcel );\r\n\t\r\n\t$objPHPExcel->setActiveSheetIndex ( 0 );\r\n\t\r\n\t$objWriter = PHPExcel_IOFactory::createWriter ( $objPHPExcel, 'Excel2007' );\r\n\t$objWriter->save ( 'php://output' );\r\n}" ]
[ "0.70099133", "0.6660617", "0.62575525", "0.6014046", "0.5897853", "0.5877225", "0.5844203", "0.58154064", "0.57941884", "0.5788714", "0.5715038", "0.57061714", "0.5693799", "0.5678491", "0.56666887", "0.56245714", "0.56092733", "0.5597994", "0.55711925", "0.5562966", "0.5554124", "0.5546116", "0.55430377", "0.5536841", "0.55305123", "0.55014366", "0.5495464", "0.5479579", "0.5476146", "0.547578", "0.5473809", "0.5469451", "0.54671603", "0.5460732", "0.54591584", "0.5456086", "0.54530895", "0.5450739", "0.54497147", "0.544719", "0.5436833", "0.5425948", "0.5420302", "0.5406495", "0.53867525", "0.5383852", "0.5369636", "0.5352363", "0.5348554", "0.5347073", "0.5324926", "0.53158385", "0.53014284", "0.5301328", "0.5293243", "0.52858096", "0.5273746", "0.5264995", "0.52580875", "0.52430767", "0.5217018", "0.5215093", "0.5209812", "0.51990896", "0.5190068", "0.5188882", "0.51840526", "0.518144", "0.5179022", "0.5175898", "0.5175834", "0.5170115", "0.5169111", "0.51687825", "0.5158082", "0.5142298", "0.51407367", "0.51391923", "0.51376325", "0.5137441", "0.5134129", "0.51329875", "0.5125153", "0.51224667", "0.5118909", "0.5102815", "0.51023644", "0.5099921", "0.50818634", "0.50785077", "0.50770444", "0.50758433", "0.5074726", "0.50696373", "0.5060469", "0.5060072", "0.50570744", "0.50555575", "0.504486", "0.5042899" ]
0.5197563
64
END TIMESHEET WEEKLY VIEW / requestApproval /
function approveTimesheet() { $this->getMenu() ; $id = $this->input->post('id'); $this->timesheetModel->saveApproveTimesheet($id); redirect ('timesheet'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\r\n {\r\n \tini_set('memory_limit', '64M');\r\n $validFormats = array('weekly');\r\n $format = 'weekly'; // $this->_getParam('format', 'weekly');\r\n \r\n if (!in_array($format, $validFormats)) {\r\n $this->flash('Format not valid');\r\n $this->renderView('error.php');\r\n return;\r\n }\r\n\r\n $reportingOn = 'Dynamic';\r\n \r\n // -1 will mean that by default, just choose all timesheet records\r\n $timesheetid = -1;\r\n\r\n // Okay, so if we were passed in a timesheet, it means we want to view\r\n // the data for that timesheet. However, if that timesheet is locked, \r\n // we want to make sure that the tasks being viewed are ONLY those that\r\n // are found in that locked timesheet.\r\n $timesheet = $this->byId();\r\n\r\n $start = null;\r\n $end = null;\r\n $this->view->showLinks = true;\r\n $cats = array();\r\n\r\n if ($timesheet) {\r\n $this->_setParam('clientid', $timesheet->clientid);\r\n $this->_setParam('projectid', $timesheet->projectid);\r\n if ($timesheet->locked) {\r\n $timesheetid = $timesheet->id;\r\n $reportingOn = $timesheet->title;\r\n } else {\r\n $timesheetid = 0; \r\n $reportingOn = 'Preview: '.$timesheet->title;\r\n }\r\n if (is_array($timesheet->tasktype)) {\r\n \t$cats = $timesheet->tasktype;\r\n } \r\n\r\n $start = date('Y-m-d 00:00:01', strtotime($timesheet->from));\r\n $end = date('Y-m-d 23:59:59', strtotime($timesheet->to)); \r\n $this->view->showLinks = false;\r\n } else if ($this->_getParam('category')){\r\n \t$cats = array($this->_getParam('category'));\r\n }\r\n \r\n \r\n $project = $this->_getParam('projectid') ? $this->byId($this->_getParam('projectid'), 'Project') : null;\r\n\t\t\r\n\t\t$client = null;\r\n\t\tif (!$project) {\r\n \t$client = $this->_getParam('clientid') ? $this->byId($this->_getParam('clientid'), 'Client') : null;\r\n\t\t}\r\n\t\t\r\n $user = $this->_getParam('username') ? $this->userService->getUserByField('username', $this->_getParam('username')) : null;\r\n \r\n\t\t$this->view->user = $user;\r\n\t\t$this->view->project = $project;\r\n\t\t$this->view->client = $client ? $client : ( $project ? $this->byId($project->clientid, 'Client'):null);\r\n\t\t$this->view->category = $this->_getParam('category');\r\n \r\n if (!$start) {\r\n\t // The start date, if not set in the parameters, will be just\r\n\t // the previous monday\r\n\t $start = $this->_getParam('start', $this->calculateDefaultStartDate());\r\n\t // $end = $this->_getParam('end', date('Y-m-d', time()));\r\n\t $end = $this->_getParam('end', date('Y-m-d 23:59:59', strtotime($start) + (6 * 86400)));\r\n }\r\n \r\n // lets normalise the end date to make sure it's of 23:59:59\r\n\t\t$end = date('Y-m-d 23:59:59', strtotime($end));\r\n\r\n $this->view->title = $reportingOn;\r\n \r\n $order = 'endtime desc';\r\n if ($format == 'weekly') {\r\n $order = 'starttime asc';\r\n }\r\n\r\n $this->view->taskInfo = $this->projectService->getTimesheetReport($user, $project, $client, $timesheetid, $start, $end, $cats, $order);\r\n \r\n // get the hierachy for all the tasks in the task info. Make sure to record how 'deep' the hierarchy is too\r\n\t\t$hierarchies = array();\r\n\r\n\t\t$maxHierarchyLength = 0;\r\n\t\tforeach ($this->view->taskInfo as $taskinfo) {\r\n\t\t\tif (!isset($hierarchies[$taskinfo->taskid])) {\r\n\t\t\t\t$task = $this->projectService->getTask($taskinfo->taskid);\r\n\t\t\t\t$taskHierarchy = array();\r\n\t\t\t\tif ($task) {\r\n\t\t\t\t\t$taskHierarchy = $task->getHierarchy();\r\n\t\t\t\t\tif (count($taskHierarchy) > $maxHierarchyLength) {\r\n\t\t\t\t\t\t$maxHierarchyLength = count($taskHierarchy);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$hierarchies[$taskinfo->taskid] = $taskHierarchy;\r\n\t\t\t} \r\n\t\t}\r\n\t\r\n\t\t$this->view->hierarchies = $hierarchies;\r\n\t\t$this->view->maxHierarchyLength = $maxHierarchyLength;\r\n\r\n $this->view->startDate = $start;\r\n $this->view->endDate = $end;\r\n $this->view->params = $this->_getAllParams();\r\n $this->view->dayDivision = za()->getConfig('day_length', 8) / 4; // za()->getConfig('day_division', 2);\r\n $this->view->divisionTolerance = za()->getConfig('division_tolerance', 20);\r\n \r\n $outputformat = $this->_getParam('outputformat');\r\n if ($outputformat == 'csv') {\r\n \t$this->_response->setHeader(\"Content-type\", \"text/csv\");\r\n\t $this->_response->setHeader(\"Content-Disposition\", \"inline; filename=\\\"timesheet.csv\\\"\");\r\n\r\n\t echo $this->renderRawView('timesheet/csv-export.php');\r\n } else {\r\n\t\t\tif ($this->_getParam('_ajax')) {\r\n\t\t\t\t$this->renderRawView('timesheet/'.$format.'-report.php');\r\n\t\t\t} else {\r\n\t\t\t\t$this->renderView('timesheet/'.$format.'-report.php');\r\n\t\t\t}\r\n }\r\n }", "function weekviewFooter()\n\t {\n\t // Read the hours_lock id\n\t $periodid = $this->m_postvars[\"periodid\"];\n\t $viewdate = $this->m_postvars['viewdate'];\n $viewuser = $this->m_postvars['viewuser'];\n\n\t // If the periodid isnt numeric, then throw an error, no action can be\n // taken so no buttons are added to the footer.\n\t if (!is_numeric($periodid))\n\t {\n\t atkerror(\"Posted periodid isn't numeric\");\n\t return \"\";\n\t }\n\n\t // Retrieve the hours_lock record for the specified periodid\n\t $hourslocknode = &atkGetNode(\"timereg.hours_lock\");\n $hourlocks = $hourslocknode->selectDb(\"hours_lock.id='\".$periodid.\"'\n AND (hours_lock.userid='\".$viewuser.\"'\n OR hours_lock.userid IS NULL)\");\n atk_var_dump($hourlocks);\n\n // Don't display any buttons if there are no hourlocks found\n if (count($hourlocks)==0)\n {\n return \"\";\n }\n\n // Determine the approval status\n $hourlockapproved = ($hourlocks[0][\"approved\"]==1);\n\n $output = '<br />' . sprintf(atktext(\"hours_approve_thestatusofthisperiodis\"), $this->m_lockmode) . \": \";\n if ($hourlockapproved)\n {\n $output.= '<font color=\"#009900\">' . atktext(\"approved\") . '</font><br /><br />';\n }\n else\n {\n $output.= '<font color=\"#ff0000\">' . atktext(\"not_approved_yet\") . '</font><br /><br />';\n }\n\n // Add an approve or disapprove button to the weekview\n\t if (!$hourlockapproved)\n\t {\n\t $output.= atkButton(atktext(\"approve\"),\n dispatch_url(\"timereg.hours_approve\",\"approve\",\n array(\"periodid\"=>$periodid,\n \"viewuser\"=>$viewuser,\n \"viewdate\"=>$viewdate)),\n SESSION_NESTED) . \"&nbsp;&nbsp;\";\n\t }\n\t $output.= atkButton(atktext(\"disapprove\"),\n dispatch_url(\"timereg.hours_approve\",\"disapprove\",\n array(\"periodid\"=>$periodid,\n \"viewuser\"=>$viewuser,\n \"viewdate\"=>$viewdate)),\n SESSION_NESTED);\n\n\t // Return the weekview including button\n\t return $output;\n\t }", "function requestApproval() \t{\n\t\t$this->getMenu() ;\n\t\t$id = $this->input->post('id');\n\t\t$this->timesheetModel->saveTimesheetRequest($id);\n\t\tredirect ('/timesheet/');\n\t}", "public function view_req($month,$id,$status){\n\t\t// set the page title\t\t\n\t\t$this->set('title_for_layout', 'Waive Off Request- Approve/Reject - HRIS - BigOffice');\n\t\tif(!empty($id) && intval($id) && !empty($month) && !empty($status)){\n\t\t\tif($status == 'pass' || $status == 'view_only'){\t\n\t\t\t\t$options = array(\t\t\t\n\t\t\t\t\tarray('table' => 'hr_attendance',\n\t\t\t\t\t\t\t'alias' => 'Attendance',\t\t\t\t\t\n\t\t\t\t\t\t\t'type' => 'LEFT',\n\t\t\t\t\t\t\t'conditions' => array('`Attendance`.`app_users_id` = `HrAttWaive`.`app_users_id`',\n\t\t\t\t\t\t\t'HrAttWaive.date like date_format(`Attendance`.`in_time`, \"%Y-%m-%d\")')\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t// get the employee\n\t\t\t\t$emp_data = $this->HrAttWaive->HrEmployee->find('first', array('conditions' => array('HrEmployee.id' => $id)));\n\t\t\t\t$this->set('empData', $emp_data);\t\t\t\t\n\t\t\t\t$data = $this->HrAttWaive->find('all', array('conditions' => array(\"date_format(HrAttWaive.date, '%Y-%m')\" => $month,\n\t\t\t\t'HrAttWaive.app_users_id' => $id),\n\t\t\t\t'fields' => array('id','date','reason','Attendance.in_time','status',\n\t\t\t\t'HrEmployee.first_name','HrEmployee.last_name','remark'), 'order' => array('HrAttWaive.date' => 'asc'), 'joins' => $options));\t\n\t\t\t\t$this->set('att_data', $data);\n\t\t\t\t// for view mode\n\t\t\t\tif($status == 'view_only'){\t\t\t\t\t\n\t\t\t\t\t$this->set('VIEW_ONLY', 1);\n\t\t\t\t}\n\t\t\t}else if($ret_value == 'fail'){ \n\t\t\t\t$this->Session->setFlash('<button type=\"button\" class=\"close\" data-dismiss=\"alert-error\">&times;</button>Invalid Entry', 'default', array('class' => 'alert alert-error'));\t\n\t\t\t\t$this->redirect('/hrattwaive/');\t\n\t\t\t}else{\n\t\t\t\t$this->Session->setFlash('<button type=\"button\" class=\"close\" data-dismiss=\"alert-error\">&times;</button>Record Deleted: '.$ret_value , 'default', array('class' => 'alert alert-error'));\t\n\t\t\t\t$this->redirect('/hrattwaive/');\t\n\t\t\t}\n\t\t}else{\n\t\t\t$this->Session->setFlash('<button type=\"button\" class=\"close\" data-dismiss=\"alert-error\">&times;</button>Invalid Entry', 'default', array('class' => 'alert alert-error'));\t\t\n\t\t\t$this->redirect('/hrattwaive/');\t\n\t\t}\n\t\t\n\t\t\n\t}", "public function index()\n {\n $user = Auth::user();\n $data['user'] = $user;\n $settings = $user->settings;\n Carbon::setWeekStartsAt(0);\n Carbon::setWeekEndsAt(6);\n\n // TODO: get this from config\n $start_time = '06:30';\n $end_time = '19:30';\n\n $today = new Carbon($this->choose_start);\n $today2 = new Carbon($this->choose_start);\n $today3 = new Carbon($this->choose_start);\n // $today4 = new Carbon($this->choose_start);\n // $today5 = new Carbon($this->choose_start);\n $today6 = new Carbon($this->choose_start);\n\n $data['start'] = $today6->startOfWeek();\n\n $days = array();\n $days_to_add = 7 * ($settings->weeks - 2);\n $end = $today2->startOfWeek()->setDate(\n $today->year,\n $today->month,\n $today->format('d') > 15 ?\n $today3->endOfMonth()->format('d') :\n 15\n )->addDays($days_to_add);\n\n $data['end_of_period'] = $end->copy()->endOfWeek()->format('Y-m-d');\n $data['end'] = $end;\n\n $added_range = false;\n $next_range = array();\n if ((new Carbon)->day >= 13 && (new Carbon)->day <= 15) {\n $added_range = true;\n $next_range['start'] = (new Carbon)->setDate((new Carbon)->year, (new Carbon)->month, 16)->startOfWeek();\n $next_range['start_of_period'] = (new Carbon)->setDate((new Carbon)->year, (new Carbon)->month, 16);\n $next_range['end'] = (new Carbon)->startOfWeek()->setDate((new Carbon)->year, (new Carbon)->month, $today3->endOfMonth()->format('d'));\n $next_range['end_of_period'] = (new Carbon)->startOfWeek()->setDate((new Carbon)->year, (new Carbon)->month, $today3->endOfMonth()->format('d'))->endOfWeek()->format('Y-m-d');\n } elseif ((new Carbon)->day >= 28 && (new Carbon)->day <= 31) {\n $added_range = true;\n $year = (new Carbon)->year + ((new Carbon)->month == 12?1:0); // Set year as next year if this month is December (12)\n $next_range['start'] = (new Carbon)->setDate($year, (new Carbon)->addMonthNoOverflow(1)->format(\"m\"), 1)->startOfWeek();\n $next_range['start_of_period'] = (new Carbon)->setDate($year, (new Carbon)->addMonthNoOverflow(1)->format(\"m\"), 1);\n $next_range['end'] = (new Carbon)->startOfWeek()->setDate($year, (new Carbon)->addMonthNoOverflow(1)->format(\"m\"), 15);\n $next_range['end_of_period'] = (new Carbon)->startOfWeek()->setDate($year, (new Carbon)->addMonthNoOverflow(1)->format(\"m\"), 15)->endOfWeek()->format('Y-m-d');\n }\n\n $data['days_a'] = $this->get_days($data);\n $data['days_b'] = $this->get_days($next_range);\n\n $data['days'] = [__('Su'), __('Mo'), __('Tu'), __('We'), __('Th'), __('Fr'), __('Sa')];\n $time_line = [];\n $time = new Carbon($start_time);\n while ($time->format('H:i') <= $end_time) {\n $time_line[] = $time->format('H:i');\n $time->addMinutes(60);\n }\n $data['time_line'] = $time_line;\n\n $user = auth()->user();\n if (isset($user) && isset($user->settings))\n if ($user->settings->is_admin)\n return view('admin.home');\n else\n return view('home', $data);\n }", "public function timesheetAction()\r\n {\r\n $project = $this->projectService->getProject($this->_getParam('projectid'));\r\n $client = $this->clientService->getClient($this->_getParam('clientid'));\r\n \r\n if (!$project && !$client) {\r\n return;\r\n }\r\n \r\n if ($project) {\r\n $start = date('Y-m-d', strtotime($project->started) - 86400);\r\n $this->view->tasks = $this->projectService->getSummaryTimesheet(null, null, $project->id, null, null, $start, null);\r\n } else {\r\n $start = date('Y-m-d', strtotime($client->created));\r\n $this->view->tasks = $this->projectService->getSummaryTimesheet(null, null, null, $client->id, null, $start, null);\r\n }\r\n\r\n $this->renderRawView('timesheet/ajax-timesheet-summary.php');\r\n }", "public function mytimesheet($start = null, $end = null)\n\t{\n\n\t\t$me = (new CommonController)->get_current_user();\n\t\t// $auth = Auth::user();\n\t\t//\n\t\t// $me = DB::table('users')\n\t\t// ->leftJoin( DB::raw('(select Max(Id) as maxid,TargetId from files where Type=\"User\" Group By TargetId) as max'), 'max.TargetId', '=', 'users.Id')\n\t\t// ->leftJoin('files', 'files.Id', '=', DB::raw('max.`maxid` and files.`Type`=\"User\"'))\n\t\t// // ->leftJoin('accesscontrols', 'accesscontrols.UserId', '=', 'users.Id')\n\t\t// ->where('users.Id', '=',$auth -> Id)\n\t\t// ->first();\n\n\t\t// $showleave = DB::table('leaves')\n\t\t// ->leftJoin('leavestatuses', 'leaves.Id', '=', 'leavestatuses.LeaveId')\n\t\t// ->leftJoin('users as applicant', 'leaves.UserId', '=', 'applicant.Id')\n\t\t// ->leftJoin('accesscontrols', 'accesscontrols.UserId', '=', 'applicant.Id')\n\t\t// ->leftJoin('users as approver', 'leavestatuses.UserId', '=', 'approver.Id')\n\t\t// ->select('leaves.Id','applicant.Name','leaves.Leave_Type','leaves.Leave_Term','leaves.Start_Date','leaves.End_Date','leaves.Reason','leaves.created_at as Application_Date','approver.Name as Approver','leavestatuses.Leave_Status as Status','leavestatuses.updated_at as Review_Date','leavestatuses.Comment')\n\t\t// ->where('accesscontrols.Show_Leave_To_Public', '=', 1)\n\t\t// ->orderBy('leaves.Id','desc')\n\t\t// ->get();\n\t\t$d=date('d');\n\n\t\tif ($start==null)\n\t\t{\n\n\t\t\tif($d>=21)\n\t\t\t{\n\n\t\t\t\t$start=date('d-M-Y', strtotime('first day of this month'));\n\t\t\t\t$start = date('d-M-Y', strtotime($start . \" +20 days\"));\n\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\t$start=date('d-M-Y', strtotime('first day of last month'));\n\t\t\t\t$start = date('d-M-Y', strtotime($start . \" +20 days\"));\n\n\t\t\t}\n\t\t}\n\n\t\tif ($end==null)\n\t\t{\n\t\t\tif($d>=21)\n\t\t\t{\n\n\t\t\t\t$end=date('d-M-Y', strtotime('first day of next month'));\n\t\t\t\t$end = date('d-M-Y', strtotime($end . \" +19 days\"));\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\t$end=date('d-M-Y', strtotime('first day of this month'));\n\t\t\t\t$end = date('d-M-Y', strtotime($end . \" +19 days\"));\n\n\t\t\t}\n\n\t\t}\n\n\t\t$mytimesheet = DB::table('timesheets')\n\t\t->select('timesheets.Id','timesheets.UserId','timesheets.Latitude_In','timesheets.Longitude_In','timesheets.Latitude_Out','timesheets.Longitude_Out','timesheets.Date',DB::raw('\"\" as Day'),'holidays.Holiday','timesheets.Site_Name','timesheets.Check_In_Type','leaves.Leave_Type','leavestatuses.Leave_Status',\n\t\t'timesheets.Time_In','timesheets.Time_Out','timesheets.Leader_Member','timesheets.Next_Person','timesheets.State','timesheets.Work_Description','timesheets.Remarks','approver.Name as Approver','timesheetstatuses.Status','leaves.Leave_Type','timesheetstatuses.Comment','timesheetstatuses.updated_at as Updated_At','files.Web_Path')\n\t\t->leftJoin( DB::raw('(select Max(Id) as maxid,TargetId from files where Type=\"Timesheet\" Group By TargetId) as maxfile'), 'maxfile.TargetId', '=', 'timesheets.Id')\n\t\t->leftJoin('files', 'files.Id', '=', DB::raw('maxfile.`maxid` and files.`Type`=\"Timesheet\"'))\n\t\t->leftJoin( DB::raw('(select Max(Id) as maxid,TimesheetId from timesheetstatuses Group By TimesheetId) as max'), 'max.TimesheetId', '=', 'timesheets.Id')\n\t\t->leftJoin('timesheetstatuses', 'timesheetstatuses.Id', '=', DB::raw('max.`maxid`'))\n\t\t->leftJoin('users as approver', 'timesheetstatuses.UserId', '=', 'approver.Id')\n\t\t// ->leftJoin('leaves','leaves.UserId','=',DB::raw('timesheets.Id AND str_to_date(timesheets.Date,\"%d-%M-%Y\") Between str_to_date(leaves.Start_Date,\"%d-%M-%Y\") and str_to_date(leaves.End_Date,\"%d-%M-%Y\")'))\n\t\t->leftJoin('leaves','leaves.UserId','=',DB::raw($me->UserId.' AND str_to_date(timesheets.Date,\"%d-%M-%Y\") Between str_to_date(leaves.Start_Date,\"%d-%M-%Y\") and str_to_date(leaves.End_Date,\"%d-%M-%Y\")'))\n\t\t->leftJoin( DB::raw('(select Max(Id) as maxid,LeaveId from leavestatuses Group By LeaveId) as maxleave'), 'maxleave.LeaveId', '=', 'leaves.Id')\n\t\t->leftJoin('leavestatuses', 'leavestatuses.Id', '=', DB::raw('maxleave.`maxid`'))\n\t\t->leftJoin('holidays',DB::raw('1'),'=',DB::raw('1 AND str_to_date(timesheets.Date,\"%d-%M-%Y\") Between str_to_date(holidays.Start_Date,\"%d-%M-%Y\") and str_to_date(holidays.End_Date,\"%d-%M-%Y\")'))\n\t\t->where('timesheets.UserId', '=', $me->UserId)\n\t\t->where(DB::raw('str_to_date(timesheets.Date,\"%d-%M-%Y\")'), '>=', DB::raw('str_to_date(\"'.$start.'\",\"%d-%M-%Y\")'))\n\t\t->where(DB::raw('str_to_date(timesheets.Date,\"%d-%M-%Y\")'), '<=', DB::raw('str_to_date(\"'.$end.'\",\"%d-%M-%Y\")'))\n\t\t->orderBy('timesheets.Id','desc')\n\t\t->get();\n\n\t\t$user = DB::table('users')->select('users.Id','StaffId','Name','Password','User_Type','Company_Email','Personal_Email','Contact_No_1','Contact_No_2','Nationality','Permanent_Address','Current_Address','Home_Base','DOB','NRIC','Passport_No','Gender','Marital_Status','Position','Emergency_Contact_Person',\n\t\t'Emergency_Contact_No','Emergency_Contact_Relationship','Emergency_Contact_Address','files.Web_Path')\n\t\t// ->leftJoin('files', 'files.TargetId', '=', DB::raw('users.`Id` and files.`Type`=\"User\"'))\n\t\t->leftJoin( DB::raw('(select Max(Id) as maxid,TargetId from files where Type=\"User\" Group By Type,TargetId) as max'), 'max.TargetId', '=', 'users.Id')\n\t\t->leftJoin('files', 'files.Id', '=', DB::raw('max.`maxid` and files.`Type`=\"User\"'))\n\t\t->where('users.Id', '=', $me->UserId)\n\t\t->first();\n\n\t\t$arrDate = array();\n\t\t$arrDate2 = array();\n\t\t$arrInsert = array();\n\n\t\tforeach ($mytimesheet as $timesheet) {\n\t\t\t# code...\n\t\t\tarray_push($arrDate,$timesheet->Date);\n\t\t}\n\n\t\t$startTime = strtotime($start);\n\t\t$endTime = strtotime($end);\n\n\t\t// Loop between timestamps, 1 day at a time\n\t\tdo {\n\n\t\t\t if (!in_array(date('d-M-Y', $startTime),$arrDate))\n\t\t\t {\n\t\t\t\t array_push($arrDate2,date('d-M-Y', $startTime));\n\t\t\t }\n\n\t\t\t $startTime = strtotime('+1 day',$startTime);\n\n\t\t} while ($startTime <= $endTime);\n\n\t\tforeach ($arrDate2 as $date) {\n\t\t\t# code...\n\t\t\tarray_push($arrInsert,array('UserId'=>$me->UserId, 'Date'=> $date, 'updated_at'=>date('Y-m-d H:i:s')));\n\n\t\t}\n\n\t\tDB::table('timesheets')->insert($arrInsert);\n\n\t\t$options= DB::table('options')\n\t\t->whereIn('Table', [\"users\",\"timesheets\"])\n\t\t->orderBy('Table','asc')\n\t\t->orderBy('Option','asc')\n\t\t->get();\n\n // $mytimesheet = DB::table('timesheets')\n // ->leftJoin('users as submitter', 'timesheets.UserId', '=', 'submitter.Id')\n // ->select('timesheets.Id','submitter.Name','timesheets.Timesheet_Name','timesheets.Date','timesheets.Remarks')\n // ->where('timesheets.UserId', '=', $me->UserId)\n\t\t\t// ->orderBy('timesheets.Id','desc')\n // ->get();\n\n\t\t\t// $hierarchy = DB::table('users')\n\t\t\t// ->select('L2.Id as L2Id','L2.Name as L2Name','L2.Timesheet_1st_Approval as L21st','L2.Timesheet_2nd_Approval as L22nd',\n\t\t\t// 'L3.Id as L3Id','L3.Name as L3Name','L3.Timesheet_1st_Approval as L31st','L3.Timesheet_2nd_Approval as L32nd')\n\t\t\t// ->leftJoin(DB::raw(\"(select users.Id,users.Name,users.SuperiorId,accesscontrols.Timesheet_1st_Approval,accesscontrols.Timesheet_2nd_Approval,accesscontrols.Timesheet_Final_Approval from users left join accesscontrols on users.Id=accesscontrols.UserId) as L2\"),'L2.Id','=','users.SuperiorId')\n\t\t\t// ->leftJoin(DB::raw(\"(select users.Id,users.Name,users.SuperiorId,accesscontrols.Timesheet_1st_Approval,accesscontrols.Timesheet_2nd_Approval,accesscontrols.Timesheet_Final_Approval from users left join accesscontrols on users.Id=accesscontrols.UserId) as L3\"),'L3.Id','=','L2.SuperiorId')\n\t\t\t// ->where('users.Id', '=', $me->UserId)\n\t\t\t// ->get();\n\t\t\t//\n\t\t\t// $final = DB::table('users')\n\t\t\t// ->select('users.Id','users.Name')\n\t\t\t// ->leftJoin('accesscontrols', 'accesscontrols.UserId', '=', 'users.Id')\n\t\t\t// ->where('Timesheet_Final_Approval', '=', 1)\n\t\t\t// ->get();\n\n\t\t\treturn view('mytimesheet', ['me' => $me, 'user' =>$user, 'mytimesheet' => $mytimesheet,'start' =>$start,'end'=>$end,'options' =>$options]);\n\n\t\t\t//return view('mytimesheet', ['me' => $me,'showleave' =>$showleave, 'mytimesheet' => $mytimesheet, 'hierarchy' => $hierarchy, 'final' => $final]);\n\n\t}", "function approvedTimesheet($type=1, $pg=1, $limit=25) \t{\n\t\t$this->getMenu();\n\t\t$form = array();\n\t\tif($type==1) {\n\t\t\t$this->session->unset_userdata('client_no');\n\t\t\t$this->session->unset_userdata('client_name');\n\t\t\t$this->session->unset_userdata('project_no');\n\t\t}\n\t\telseif($type==2) {\n\t\t\t$this->session->unset_userdata('client_no');\n\t\t\t$this->session->unset_userdata('client_name');\n\t\t\t$this->session->unset_userdata('project_no');\n\t\t\t\n\t\t\tif($this->input->post('client_no')) \t\t$form['client_no'] = $this->input->post('client_no');\n\t\t\tif($this->input->post('client_name'))\t\t$form['client_name'] = $this->input->post('client_name');\n\t\t\tif($this->input->post('project_no'))\t\t$form['project_no'] = $this->input->post('project_no');\n\t\t\t$this->session->set_userdata($form);\n\t\t}\n\t\t\n\t\tif($this->session->userdata('client_no')) \t$form['client_no'] = $this->session->userdata('client_no');\n\t\tif($this->session->userdata('client_name')) $form['client_name'] = $this->session->userdata('client_name');\n\t\tif($this->session->userdata('project_no')) \t$form['project_no']\t = $this->session->userdata('project_no');\n\t\t\n\t\tif($limit) {\n\t\t\t$this->session->set_userdata('rpp', $limit);\n\t\t\t$this->rpp = $limit;\n\t\t}\n\t\t$limit\t\t= $limit ? $limit : $this->rpp;\n\t\t$this->data['done'] \t\t= $this->timesheetModel->getTimesheetDone();\n\t\n\t\t$this->load->view('timesheet_approvedTimesheet',$this->data); \n\t}", "public function editassigntimeAction()\n {\n $prevurl = getenv(\"HTTP_REFERER\");\n $user_params=$this->_request->getParams();\n $ftvrequest_obj = new Ep_Ftv_FtvRequests();\n $ftvpausetime_obj = new Ep_Ftv_FtvPauseTime();\n $requestId = $user_params['requestId'];\n $requestsdetail = $ftvrequest_obj->getRequestsDetails($requestId);\n\n ($user_params['editftvspentdays'] == '') ? $days=0 : $days=$user_params['editftvspentdays'];\n ($user_params['editftvspenthours'] == '') ? $hours=0 : $hours=$user_params['editftvspenthours'];\n ($user_params['editftvspentminutes'] == '') ? $minutes=0 : $minutes=$user_params['editftvspentminutes'];\n ($user_params['editftvspentseconds'] == '') ? $seconds=0 : $seconds=$user_params['editftvspentseconds'];\n\n /*if($user_params['addasigntime'] == 'addasigntime') ///when time changes in mail content in publish ao popup//\n {\n /*$editdate = date('Y-m-d', strtotime($user_params['editftvassigndate']));\n $edittime = date('H:i:s', strtotime($user_params['editftvassigntime']));\n $editdatetime =$editdate.\" \".$edittime;\n $data = array(\"assigned_at\"=>$editdatetime);////////updating\n $query = \"identifier= '\".$user_params['requestId'].\"'\";\n $ftvrequest_obj->updateFtvRequests($data,$query);\n $parameters['ftvType'] = \"chaine\";\n // $newseconds = $this->allToSeconds($user_params['editftvspentdays'],$user_params['editftvspenthours'],$user_params['editftvspentminutes'],$user_params['editftvspentseconds']);\n echo \"<br>\".$format = \"P\".$days.\"DT\".$hours.\"H\".$minutes.\"M\".$seconds.\"S\";\n echo \"<br>\".$requestsdetail[0]['assigned_at'];\n $time=new DateTime($requestsdetail[0]['assigned_at']);\n $time->sub(new DateInterval($format));\n echo \"<br>\".$assigntime = $time->format('Y-m-d H:i:s');\n $data = array(\"assigned_at\"=>$assigntime);////////updating\n echo $query = \"identifier= '\".$requestId.\"'\";\n $ftvrequest_obj->updateFtvRequests($data,$query);\n $this->_redirect($prevurl);\n }\n elseif($user_params['subasigntime'] == 'subasigntime')\n {\n $format = \"P\".$days.\"DT\".$hours.\"H\".$minutes.\"M\".$seconds.\"S\";\n $time=new DateTime($requestsdetail[0]['assigned_at']);\n $time->add(new DateInterval($format));\n $assigntime = $time->format('Y-m-d H:i:s');\n $data = array(\"assigned_at\"=>$assigntime);////////updating\n $query = \"identifier= '\".$requestId.\"'\";\n $ftvrequest_obj->updateFtvRequests($data,$query);\n $this->_redirect($prevurl);\n }*/\n $inpause = $ftvpausetime_obj->inPause($requestId);\n $requestsdetail[0]['inpause'] = $inpause;\n $ptimes = $ftvpausetime_obj->getPauseDuration($requestId);\n $assigntime = $requestsdetail[0]['assigned_at'];\n //echo $requestId; echo $requestsdetail[0]['assigned_at'];\n\n if(($requestsdetail[0]['status'] == 'done' || $inpause == 'yes') && $requestsdetail[0]['assigned_at'] != null)\n {\n if($requestsdetail[0]['status'] == \"closed\")\n $time1 = ($requestsdetail[0]['cancelled_at']); /// created time\n elseif ($requestsdetail[0]['status'] == \"done\")\n $time1 = ($requestsdetail[0]['closed_at']); /// created time\n else{\n if($inpause == 'yes') {\n $time1 = ($requestsdetail[0]['pause_at']);\n }else {\n $time1 = (date('Y-m-d H:i:s'));///curent time\n }\n }\n $pausedrequests = $ftvpausetime_obj->pausedRequest($requestId);\n if($pausedrequests == 'yes')\n {\n $time2 = $this->subDiffFromDate($requestId, $requestsdetail[0]['assigned_at']);\n }else{\n $time2 = $requestsdetail[0]['assigned_at'];\n }\n $difference = $this->timeDifference($time1, $time2);\n\n }elseif($requestsdetail[0]['assigned_at'] != null){\n $time1 = (date('Y-m-d H:i:s'));///curent time\n\n $pausedrequests = $ftvpausetime_obj->pausedRequest($requestId);\n if($pausedrequests == 'yes')\n {\n $updatedassigntime = $this->subDiffFromDate($requestId, $requestsdetail[0]['assigned_at']);\n }else{\n $updatedassigntime = $requestsdetail[0]['assigned_at'];\n }\n $time2 = $updatedassigntime;\n $difference = $this->timeDifference($time1, $time2);\n }\n ////when user trying to edit the time spent///\n if($user_params['editftvassignsubmit'] == 'editftvassignsubmit') ///when button submitted in popup//\n {\n $newseconds = $this->allToSeconds($days,$hours,$minutes,$seconds);\n $previousseconds = $this->allToSeconds($difference['days'],$difference['hours'],$difference['minutes'],$difference['seconds']);\n if($newseconds > $previousseconds){\n $diffseconds = $newseconds-$previousseconds;\n $difftime = $this->secondsTodayshours($diffseconds);\n $format = \"P\".$difftime['days'].\"DT\".$difftime['hours'].\"H\".$difftime['minutes'].\"M\".$difftime['seconds'].\"S\";\n $requestsdetail[0]['assigned_at'];\n $time=new DateTime($requestsdetail[0]['assigned_at']);\n $time->sub(new DateInterval($format));\n $assigntime = $time->format('Y-m-d H:i:s');\n $data = array(\"assigned_at\"=>$assigntime);////////updating\n $query = \"identifier= '\".$requestId.\"'\";\n $ftvrequest_obj->updateFtvRequests($data,$query);\n $this->_redirect($prevurl);\n }elseif($newseconds < $previousseconds){\n $diffseconds = $previousseconds-$newseconds;\n $difftime = $this->secondsTodayshours($diffseconds);\n $format = \"P\".$difftime['days'].\"DT\".$difftime['hours'].\"H\".$difftime['minutes'].\"M\".$difftime['seconds'].\"S\";\n $time=new DateTime($requestsdetail[0]['assigned_at']);\n $time->add(new DateInterval($format));\n $assigntime = $time->format('Y-m-d H:i:s');\n $data = array(\"assigned_at\"=>$assigntime);////////updating\n $query = \"identifier= '\".$requestId.\"'\";\n $ftvrequest_obj->updateFtvRequests($data,$query);\n $this->_redirect($prevurl);\n }else\n $this->_redirect($prevurl);\n }\n /*$this->_view->reqasgndate = date(\"d-m-Y\", strtotime($reqdetails[0]['assigned_at']));\n $this->_view->reqasgntime = date(\"g:i A\", strtotime($reqdetails[0]['assigned_at']));*/\n $this->_view->days = $difference['days'];\n $this->_view->hours = $difference['hours'];\n $this->_view->minutes = $difference['minutes'];\n $this->_view->seconds = $difference['seconds'];\n $this->_view->requestId = $user_params['requestId'];\n $this->_view->requestobject = $requestsdetail[0]['request_object'];\n $this->_view->current_duration= $difference['days'].\"j \".$difference['hours'].\"h \".$difference['minutes'].\"m \".$difference['seconds'].\"s \";\n\n $this->_view->extendparttime = 'no';\n $this->_view->extendcrtparttime = 'no';\n $this->_view->editftvassigntime = 'yes';\n $this->_view->nores = 'true';\n $this->_view->render(\"ongoing_extendtime_writer_popup\");\n\n }", "public function appointments()\n\t{\n\t\tif (!is_cli())\n\t\t{\n\t\t\techo \"This script can only be accessed via the command line\" . PHP_EOL;\n\t\t\treturn;\n\t\t}\n\n\t\t$participations = $this->participationModel->get_confirmed_participations();\n\t\tforeach ($participations as $participation)\n\t\t{\n\t\t\t$appointment = strtotime($participation->appointment); \n\t\t\tif ($appointment > strtotime('tomorrow') && $appointment <= strtotime('tomorrow + 1 day')) \n\t\t\t{\t\t\t\t\t\n\t\t\t\treset_language(L::DUTCH);\n\t\t\t\t\n\t\t\t\t$participant = $this->participationModel->get_participant_by_participation($participation->id);\n\t\t\t\t$experiment = $this->participationModel->get_experiment_by_participation($participation->id);\n\t\t\t\t$message = email_replace('mail/reminder', $participant, $participation, $experiment);\n\t\t\n\t\t\t\t$this->email->clear();\n\t\t\t\t$this->email->from(FROM_EMAIL, FROM_EMAIL_NAME);\n\t\t\t\t$this->email->to(in_development() ? TO_EMAIL_DEV_MODE : $participant->email);\n\t\t\t\t$this->email->subject('Babylab Utrecht: Herinnering deelname');\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t\t\t// DEBUG: $this->email->print_debugger();\n\t\t\t}\n\t\t}\n\t}", "protected function process_overview()\n {\n global $index_includes;\n\n $l_rules = [\n 'C__MAINTENANCE__OVERVIEW__FILTER__DATE_FROM' => [\n 'p_strPopupType' => 'calendar',\n 'p_strClass' => 'input-mini',\n 'p_bInfoIconSpacer' => 0,\n 'p_strValue' => date('Y-m-d'),\n ],\n 'C__MAINTENANCE__OVERVIEW__FILTER__DATE_TO' => [\n 'p_strPopupType' => 'calendar',\n 'p_strClass' => 'input-mini',\n 'p_bInfoIconSpacer' => 0,\n ]\n ];\n\n $l_day_of_week = date('N') - 1;\n $l_this_week_time = time() - ($l_day_of_week * isys_convert::DAY);\n\n $l_this_week = mktime(0, 0, 0, date('m', $l_this_week_time), date('d', $l_this_week_time), date('Y', $l_this_week_time));\n\n $this->m_tpl->activate_editmode()\n ->assign(\n 'ajax_url',\n isys_helper_link::create_url(\n [\n C__GET__AJAX => 1,\n C__GET__AJAX_CALL => 'maintenance'\n ]\n )\n )\n ->assign('this_week', $l_this_week)\n ->assign('this_month', mktime(0, 0, 0, date('m'), 1, date('Y')))\n ->assign('next_week', $l_this_week + isys_convert::WEEK)\n ->assign('next_month', mktime(0, 0, 0, (date('m') + 1), 1, date('Y')))\n ->assign('next_next_month', mktime(0, 0, 0, (date('m') + 2), 1, date('Y')))\n ->assign(\n 'planning_url',\n isys_helper_link::create_url(\n [\n C__GET__MODULE_ID => C__MODULE__MAINTENANCE,\n C__GET__SETTINGS_PAGE => C__MAINTENANCE__PLANNING\n ]\n )\n )\n ->smarty_tom_add_rules('tom.content.bottom.content', $l_rules);\n\n $index_includes['contentbottomcontent'] = __DIR__ . DS . 'templates' . DS . 'overview.tpl';\n }", "public function index(){\n\t \t@$this->loadModel(\"Dashboard\");\n global $session;\n $dashData = array();\n $dashData = $this->model->getDashboardStat();\n $this->view->oticketcount = $dashData['otcount'];\n $this->view->aticketcount = $dashData['atcount'];\n $this->view->oschedule = $dashData['oschedule'];\n $this->view->oworksheet = $dashData['oworksheet'];\n $this->view->clients = $dashData['clients'];\n $this->view->pendings = $dashData['openPend'];\n $this->view->cproducts = $dashData['cproducts'];\n $lastmonth = (int)date(\"n\")-1;\n $curmonth = date(\"n\");\n\n $this->view->monthreport = $this->model->getMonthlyReportFinance(\" Month(datecreated) ='\".$curmonth.\"' AND Year(datecreated)='\".date(\"Y\").\"'\");\n $this->view->lastmonthreport = $this->model->getLastMonthlyReportFinance(\" Month(datecreated) ='\".$lastmonth.\"' AND Year(datecreated)='\".date(\"Y\").\"'\");\n $this->view->thisquarter = $this->model->getThisQuaterReportFinance(\" Quarter(datecreated) ='\".self::date_quarter().\"' AND Year(datecreated)='\".date(\"Y\").\"'\");\n global $session;\n \n if($session->empright == \"Super Admin\"){\n\t\t $this->view->render(\"dashboard/index\");\n\t\t }elseif($session->empright == \"Customer Support Services\" || $session->empright == \"Customer Support Service\"){\n\t\t $this->view->render(\"support/index\");\n\t\t \n\t\t }elseif($session->empright == \"Customer Support Engineer\" || $session->empright == \"Customer Service Engineer\"){\n @$this->loadModel(\"Itdepartment\");\n global $session;\n $datan =\"\";\n $uri = new Url(\"\");\n //$empworkdata = $this->model->getWorkSheetEmployee($id,\"\");\n \n $ptasks = Worksheet::find_by_sql(\"SELECT * FROM work_sheet_form WHERE cse_emp_id =\".$_SESSION['emp_ident'] );\n // print_r($ptasks);\n //$empworkdata['worksheet'];\n $x=1;\n $datan .=\"<table width='100%'>\n <thead><tr>\n \t<th>S/N</th><th>Prod ID</th><th>Status</th><th>Emp ID</th><th>Issue</th><th>Date Generated </th><th></th><th></th>\n </tr>\n </thead>\n <tbody>\";\n if($ptasks){\n \n foreach($ptasks as $task){\n $datan .= \"<tr><td>$x</td><td>$task->prod_id</td><td>$task->status </td><td>$task->cse_emp_id</td><td>$task->problem</td><td>$task->sheet_date</td><td><a href='\".$uri->link(\"itdepartment/worksheetdetail/\".$task->id.\"\").\"'>View Detail</a></td><td></td></tr>\";\n $x++;\n }\n }else{\n $datan .=\"<tr><td colspan='8'></td></tr>\";\n } \n $datan .=\"</tbody></table>\";\n \n $mysched =\"<div id='transalert'>\"; $mysched .=(isset($_SESSION['message']) && !empty($_SESSION['message'])) ? $_SESSION['message'] : \"\"; $mysched .=\"</div>\";\n \n $psched = Schedule::find_by_sql(\"SELECT * FROM schedule WHERE status !='Closed' AND emp_id =\".$_SESSION['emp_ident'].\" ORDER BY id DESC\" );\n //print_r($psched);\n //$empworkdata['worksheet'];\n $x=1;\n $mysched .=\"<table width='100%'>\n <thead><tr>\n \t<th>S/N</th><th>Machine</th><th>Issue</th><th>Location</th><th>Task Type</th><th>Task Date </th><th></th><th></th><th></th>\n </tr>\n </thead>\n <tbody>\";\n if($psched){\n \n foreach($psched as $task){\n $mysched .= \"<tr><td>$x</td><td>$task->prod_name</td><td>$task->issue </td>\"; \n $machine = Cproduct::find_by_id($task->prod_id);\n \n $mysched .= \"<td>$machine->install_address $machine->install_city</td><td>$task->maint_type</td><td>$task->s_date</td><td>\";\n \n if($task->status == \"Open\"){\n $mysched .=\"<a scheddata='{$task->id}' class='acceptTask' href='#'>Accept Task</a>\";\n }\n if($task->status == \"In Progress\"){\n $mysched .=\"<a href='\".$uri->link(\"itdepartment/worksheetupdateEmp/\".$task->id.\"\").\"'>Get Work Sheet</a>\";\n }\n \n $mysched .=\"\n \n <div id='myModal{$task->id}' class='reveal-modal'>\n <h2>Accept Task </h2>\n <p class='lead'>Click on the button below to accept task! </p>\n <form action='?url=itdepartment/doAcceptTask' method='post'>\n <input type='hidden' value='{$task->id}' name='mtaskid' id='mtaskid' />\n <p><a href='#' data-reveal-id='secondModal' class='secondary button acceptTast' >Accept</a></p>\n </form>\n <a class='close-reveal-modal'>&#215;</a>\n</div>\n\n\n \n \n </td><td></td><td></td></tr>\";\n $x++;\n }\n }else{\n $mysched .=\"<tr><td colspan='8'>There is no task currently</td></tr>\";\n } \n $mysched .=\"</tbody></table>\";\n \n $this->view->oldtask = $datan;\n $this->view->schedule = $mysched;\n $this->view->mee = $this->model->getEmployee($_SESSION['emp_ident']);\n $this->view->render(\"itdepartment/staffaccount\");\n\t\t }else{\n\t\t $this->view->render(\"login/index\",true);\n\t\t }\n\t\t\n\t}", "function recurringdowntime_show_downtime()\n{\n global $request;\n\n do_page_start(array(\"page_title\" => _(\"Recurring Downtime\")), true);\n\n if (isset($request[\"host\"])) {\n $host_tbl_header = _(\"Recurring Downtime for Host: \") . $request[\"host\"];\n $service_tbl_header = _(\"Recurring Downtime for Host: \") . $request[\"host\"];\n if (is_authorized_for_host(0, $request[\"host\"])) {\n $host_data = recurringdowntime_get_host_cfg($request[\"host\"]);\n $service_data = recurringdowntime_get_service_cfg($request[\"host\"]);\n }\n } elseif (isset($request[\"hostgroup\"])) {\n $hostgroup_tbl_header = _(\"Recurring Downtime for Hostgroup: \") . $request[\"hostgroup\"];\n if (is_authorized_for_hostgroup(0, $request[\"hostgroup\"])) {\n $hostgroup_data = recurringdowntime_get_hostgroup_cfg($request[\"hostgroup\"]);\n }\n } elseif (isset($request[\"servicegroup\"])) {\n $servicegroup_tbl_header = _(\"Recurring Downtime for Servicegroup: \") . $request[\"servicegroup\"];\n if (is_authorized_for_servicegroup(0, $request[\"servicegroup\"])) {\n $servicegroup_data = recurringdowntime_get_servicegroup_cfg($request[\"servicegroup\"]);\n }\n }\n\n if (!isset($request[\"host\"]) && !isset($request[\"hostgroup\"]) && !isset($request[\"servicegroup\"])) {\n /*\n $host_tbl_header = \"Recurring Downtime for All Hosts\";\n $hostgroup_tbl_header = \"Recurring Downtime for All Hostgroups\";\n $servicegroup_tbl_header = \"Recurring Downtime for All Servicegroups\";\n */\n $host_tbl_header = _(\"Host Schedules\");\n $service_tbl_header = _(\"Service Schedules\");\n $hostgroup_tbl_header = _(\"Hostgroup Schedules\");\n $servicegroup_tbl_header = _(\"Servicegroup Schedules\");\n $host_data = recurringdowntime_get_host_cfg($host = false);\n $service_data = recurringdowntime_get_service_cfg($host = false);\n $hostgroup_data = recurringdowntime_get_hostgroup_cfg($hostgroup = false);\n $servicegroup_data = recurringdowntime_get_servicegroup_cfg($servicegroup = false);\n $showall = true;\n }\n\n ?>\n <h1><?php echo _(\"Recurring Downtime\"); ?></h1>\n\n <?php echo _(\"Scheduled downtime definitions that are designed to repeat (recur) at set intervals are shown below. The next schedule for each host/service are added to the monitoring engine when the cron runs at the top of the hour.\"); ?>\n\n <?php\n if (!isset($request[\"host\"]) && !isset($request[\"hostgroup\"]) && !isset($request[\"servicegroup\"])) {\n ?>\n <p>\n <?php } ?>\n\n <script type=\"text/javascript\">\n function do_delete_sid(sid) {\n input = confirm('<?php echo _(\"Are you sure you wish to delete this downtime schedule?\"); ?>');\n if (input == true) {\n window.location.href = 'recurringdowntime.php?mode=delete&sid=' + sid + '&nsp=<?php echo get_nagios_session_protector_id();?>';\n }\n }\n </script>\n\n <?php\n if ($showall) {\n ?>\n <script type=\"text/javascript\">\n $(document).ready(function () {\n $(\"#tabs\").tabs().show();\n });\n </script>\n\n <div id=\"tabs\" class=\"hide\">\n <ul>\n <li><a href=\"#host-tab\"><?php echo _(\"Hosts\"); ?></a></li>\n <li><a href=\"#service-tab\"><?php echo _(\"Services\"); ?></a></li>\n <li><a href=\"#hostgroup-tab\"><?php echo _(\"Hostgroups\"); ?></a></li>\n <li><a href=\"#servicegroup-tab\"><?php echo _(\"Servicegroups\"); ?></a></li>\n </ul>\n <?php\n }\n ?>\n\n <?php if (!empty($_GET[\"host\"]) || $showall) {\n\n $host = grab_request_var('host', '');\n\n // hosts tab\n if ($showall) {\n echo \"<div id='host-tab'>\";\n }\n ?>\n\n <h4 <?php if ($host) { echo 'style=\"margin-top: 20px;\"'; } ?>><?php echo $host_tbl_header; ?></h4>\n\n <?php\n if (!is_readonly_user(0)) {\n if ($host) {\n ?>\n <div style=\"margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=host&host_name=<?php echo $host; ?>&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23host-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add schedule for this host\"); ?></a>\n </div>\n <?php\n } else {\n ?>\n <div style=\"margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=host&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23host-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add Schedule\"); ?></a>\n </div>\n <?php\n }\n }\n ?>\n\n <table class=\"tablesorter table table-condensed table-striped table-bordered\" style=\"width:100%\">\n <thead>\n <tr>\n <th><?php echo _(\"Host\"); ?></th>\n <th><?php echo _(\"Services\"); ?></th>\n <th><?php echo _(\"Comment\"); ?></th>\n <th><?php echo _(\"Start Time\"); ?></th>\n <th><?php echo _(\"Duration\"); ?></th>\n <th><?php echo _(\"Months\"); ?></th>\n <th><?php echo _(\"Weekdays\"); ?></th>\n <th><?php echo _(\"Days in Month\"); ?></th>\n <th><?php echo _(\"Handle Child Hosts\"); ?></th>\n <th class=\"center\" style=\"width: 80px;\"><?php echo _(\"Actions\"); ?></th>\n </tr>\n </thead>\n <tbody>\n <?php\n if ($host_data) {\n $i = 0;\n\n $host_names = array();\n foreach ($host_data as $k => $data) {\n $host_names[$k] = $data['host_name'];\n }\n array_multisort($host_names, SORT_ASC, $host_data);\n\n foreach ($host_data as $sid => $schedule) {\n if (empty($schedule['childoptions'])) {\n $schedule['childoptions'] = 0;\n }\n ?>\n <tr>\n <td><?php echo $schedule[\"host_name\"]; ?></td>\n <td><?php echo (isset($schedule[\"svcalso\"]) && $schedule[\"svcalso\"] == 1) ? _(\"Yes\") : _(\"No\"); ?></td>\n <td><?php echo encode_form_val($schedule[\"comment\"]); ?></td>\n <td><?php echo $schedule[\"time\"]; ?></td>\n <td><?php echo $schedule[\"duration\"]; ?></td>\n <td><?php if ($schedule[\"months_of_year\"]) {\n echo $schedule[\"months_of_year\"];\n } else {\n echo _(\"All\");\n } ?></td>\n <td><?php if ($schedule[\"days_of_week\"]) {\n echo $schedule[\"days_of_week\"];\n } else {\n echo _(\"All\");\n } ?></td>\n <td><?php if ($schedule[\"days_of_month\"]) {\n echo $schedule[\"days_of_month\"];\n } else {\n echo _(\"All\");\n } ?></td>\n <td><?php if ($schedule[\"childoptions\"] == 0) {\n echo _(\"No\");\n } elseif ($schedule[\"childoptions\"] == 1) {\n echo _(\"Yes, triggered\");\n } elseif ($schedule[\"childoptions\"] == 2) {\n echo _(\"Yes, non-triggered\");\n } ?></td>\n <td class=\"center\">\n <?php if (!is_readonly_user(0)) { ?>\n <a href=\"<?php echo 'recurringdowntime.php' . \"?mode=edit&sid=\" . $sid . \"&return=\" . urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23host-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\"><img src=\"<?php echo theme_image('pencil.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Edit schedule'); ?>\" alt=\"<?php echo _('Edit'); ?>\"></a>&nbsp;\n <a onClick=\"javascript:return do_delete_sid('<?php echo $sid; ?>');\" href=\"javascript:void(0);\"><img src=\"<?php echo theme_image('cross.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Delete schedule'); ?>\" alt=\"<?php echo _('Delete'); ?>\"></a>\n <?php } ?>\n </td>\n </tr>\n <?php } // end foreach ?>\n\n <?php } else { ?>\n <tr>\n <td colspan=\"10\">\n <div style=\"padding:4px\">\n <em><?php echo _(\"There are currently no host recurring downtime events defined.\"); ?></em>\n </div>\n </td>\n </tr>\n <?php } // end if host_data ?>\n </table>\n\n <?php if ($showall) echo \"</div>\"; // end host tab?>\n\n<?php } // end if host or showall\n\nif (!empty($_GET[\"service\"]) || $showall) {\n\n $host = grab_request_var('host', '');\n $service = grab_request_var('service', '');\n\n if ($showall) {\n echo \"<div id='service-tab'>\";\n }\n ?>\n\n <h4><?php echo $service_tbl_header; ?></h4>\n\n <?php\n if (!is_readonly_user(0)) {\n if ($host) {\n ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=service&host_name=<?php echo $host; ?>&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23service-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add schedule for this host\"); ?></a>\n </div>\n <?php\n } else {\n ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=service&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23service-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add Schedule\"); ?></a>\n </div>\n <?php\n }\n } // end is_readonly_user\n ?>\n <table class=\"tablesorter table table-condensed table-striped table-bordered\" style=\"width:100%\">\n <thead>\n <tr>\n <th><?php echo _(\"Host\"); ?></th>\n <th><?php echo _(\"Service\"); ?></th>\n <th><?php echo _(\"Comment\"); ?></th>\n <th><?php echo _(\"Start Time\"); ?></th>\n <th><?php echo _(\"Duration\"); ?></th>\n <th><?php echo _(\"Weekdays\"); ?></th>\n <th><?php echo _(\"Days in Month\"); ?></th>\n <th><?php echo _(\"Actions\"); ?></th>\n </tr>\n </thead>\n <tbody>\n <?php\n if ($service_data) {\n $i = 0;\n\n $host_names = array();\n $service_names = array();\n foreach ($service_data as $k => $data) {\n $host_names[$k] = $data['host_name'];\n $service_names[$k] = $data['service_description'];\n }\n\n array_multisort($host_names, SORT_ASC, $service_names, SORT_ASC, $service_data);\n\n foreach ($service_data as $sid => $schedule) {\n ?>\n <tr>\n <td><?php echo $schedule[\"host_name\"]; ?></td>\n <td><?php echo $schedule[\"service_description\"]; ?></td>\n <td><?php echo encode_form_val($schedule[\"comment\"]); ?></td>\n <td><?php echo $schedule[\"time\"]; ?></td>\n <td><?php echo $schedule[\"duration\"]; ?></td>\n <td><?php if ($schedule[\"days_of_week\"]) {\n echo $schedule[\"days_of_week\"];\n } else {\n echo \"All\";\n } ?></td>\n <td><?php if ($schedule[\"days_of_month\"]) {\n echo $schedule[\"days_of_month\"];\n } else {\n echo \"All\";\n } ?></td>\n <td style=\"text-align:center;width:60px\">\n <?php if (!is_readonly_user(0)) { ?>\n <a href=\"<?php echo 'recurringdowntime.php'. \"?mode=edit&sid=\" . $sid . \"&return=\" . urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23service-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\"><img src=\"<?php echo theme_image('pencil.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Edit schedule'); ?>\" alt=\"<?php echo _('Edit'); ?>\"></a>\n <a onClick=\"javascript:return do_delete_sid('<?php echo $sid; ?>');\" href=\"javascript:void(0);\" title=\"<?php echo _('Delete Schedule'); ?>\"><img src=\"<?php echo theme_image('cross.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Delete schedule'); ?>\" alt=\"<?php echo _('Delete'); ?>\"></a>\n <?php }?>\n </td>\n </tr>\n <?php } // end foreach ?>\n\n <?php } else { ?>\n <tr>\n <td colspan=\"9\">\n <div style=\"padding:4px\">\n <em><?php echo _(\"There are currently no host/service recurring downtime events defined.\"); ?></em>\n </div>\n </td>\n </tr>\n <?php } // end if service_data ?>\n </table>\n\n <?php if ($showall) echo \"</div>\"; // end service tab?>\n\n<?php } // end if service or showall\n\nif (!empty($_GET[\"hostgroup\"]) || $showall) {\n\n $hostgroup = grab_request_var('hostgroup', '');\n\n if ($showall) {\n echo \"<div id='hostgroup-tab'>\";\n }\n ?>\n\n <h4><?php echo $hostgroup_tbl_header; ?></h4>\n\n <?php\n if (!is_readonly_user(0)) {\n if ($hostgroup) {\n ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=hostgroup&hostgroup_name=<?php echo $hostgroup; ?>&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23hostgroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add schedule for this hostgroup\"); ?></a>\n </div>\n <?php\n } else {\n ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=hostgroup&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23hostgroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add Schedule\"); ?></a>\n </div>\n <?php\n }\n } // end is_readonly_user\n ?>\n <table class=\"tablesorter table table-condensed table-striped table-bordered\" style=\"width:100%\">\n <thead>\n <tr>\n <th><?php echo _(\"Hostgroup\"); ?></th>\n <th><?php echo _(\"Services\"); ?></th>\n <th><?php echo _(\"Comment\"); ?></th>\n <th><?php echo _(\"Start Time\"); ?></th>\n <th><?php echo _(\"Duration\"); ?></th>\n <th><?php echo _(\"Weekdays\"); ?></th>\n <th><?php echo _(\"Days in Month\"); ?></th>\n <th><?php echo _(\"Actions\"); ?></th>\n </tr>\n </thead>\n <tbody>\n\n <?php\n\n if ($hostgroup_data) {\n $i = 0;\n\n $hostgroup_names = array();\n foreach ($hostgroup_data as $k => $data) {\n $hostgroup_names[$k] = $data['hostgroup_name'];\n }\n\n array_multisort($hostgroup_names, SORT_ASC, $hostgroup_data);\n\n foreach ($hostgroup_data as $sid => $schedule) {\n ?>\n <tr>\n <td><?php echo $schedule[\"hostgroup_name\"]; ?></td>\n <td><?php echo (isset($schedule[\"svcalso\"]) && $schedule[\"svcalso\"] == 1) ? \"Yes\" : \"No\"; ?></td>\n <td><?php echo encode_form_val($schedule[\"comment\"]); ?></td>\n <td><?php echo $schedule[\"time\"]; ?></td>\n <td><?php echo $schedule[\"duration\"]; ?></td>\n <td><?php if ($schedule[\"days_of_week\"]) {\n echo $schedule[\"days_of_week\"];\n } else {\n echo \"All\";\n } ?></td>\n <td><?php if ($schedule[\"days_of_month\"]) {\n echo $schedule[\"days_of_month\"];\n } else {\n echo \"All\";\n } ?></td>\n <td style=\"text-align:center;width:60px\">\n <?php if (!is_readonly_user(0)) { ?>\n <a href=\"<?php echo 'recurringdowntime.php' . \"?mode=edit&sid=\" . $sid . \"&return=\" . urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23hostgroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" title=\"Edit Schedule\"><img src=\"<?php echo theme_image('pencil.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Edit schedule'); ?>\" alt=\"<?php echo _('Edit'); ?>\"></a>\n <a onClick=\"javascript:return do_delete_sid('<?php echo $sid; ?>');\" href=\"javascript:void(0);\" title=\"<?php echo _('Delete Schedule'); ?>\"><img src=\"<?php echo theme_image('cross.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Delete schedule'); ?>\" alt=\"<?php echo _('Delete'); ?>\"></a>\n <?php } ?>\n </td>\n </tr>\n <?php } // end foreach ?>\n <?php } else { ?>\n <tr>\n <td colspan=\"8\">\n <div style=\"padding:4px\">\n <em><?php echo _(\"There are currently no hostgroup recurring downtime events defined.\"); ?></em>\n </div>\n </td>\n </tr>\n <?php } // end if hostrgroup_data ?>\n </tbody>\n </table>\n\n <?php if ($showall) echo \"</div>\"; // end hostgroup tab?>\n\n<?php } // end if hostgroup or showall\n\nif (!empty($_GET[\"servicegroup\"]) || $showall) {\n\n $servicegroup = grab_request_var('servicegroup', '');\n\n if ($showall) {\n echo \"<div id='servicegroup-tab'>\";\n }\n ?>\n <h4><?php echo $servicegroup_tbl_header; ?></h4>\n <?php\n if (!is_readonly_user(0)) {\n if ($servicegroup) {\n ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=servicegroup&servicegroup_name=<?php echo $servicegroup; ?>&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23servicegroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add schedule for this servicegroup\"); ?></a>\n </div>\n <?php } else { ?>\n <div style=\"clear: left; margin: 0 0 10px 0;\">\n <a href=\"recurringdowntime.php?mode=add&type=servicegroup&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23servicegroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" class=\"btn btn-sm btn-primary\"><i class=\"fa fa-plus l\"></i> <?php echo _(\"Add Schedule\"); ?>\n </a>\n </div>\n <?php\n }\n } // end is_readonly_user\n ?>\n <table class=\"tablesorter table table-condensed table-striped table-bordered\" style=\"width:100%\">\n <thead>\n <tr>\n <th><?php echo _(\"Servicegroup\"); ?></th>\n <th><?php echo _(\"Comment\"); ?></th>\n <th><?php echo _(\"Start Time\"); ?></th>\n <th><?php echo _(\"Duration\"); ?></th>\n <th><?php echo _(\"Weekdays\"); ?></th>\n <th><?php echo _(\"Days in Month\"); ?></th>\n <th><?php echo _(\"Actions\"); ?></th>\n </tr>\n </thead>\n <tbody>\n <?php\n\n if ($servicegroup_data) {\n $i = 0;\n\n $servicegroup_names = array();\n foreach ($servicegroup_data as $k => $data) {\n $servicegroup_names[$k] = $data['servicegroup_name'];\n }\n\n array_multisort($servicegroup_names, SORT_ASC, $servicegroup_data);\n\n foreach ($servicegroup_data as $sid => $schedule) {\n ?>\n <tr>\n <td><?php echo $schedule[\"servicegroup_name\"]; ?></td>\n <td><?php echo $schedule[\"comment\"]; ?></td>\n <td><?php echo $schedule[\"time\"]; ?></td>\n <td><?php echo $schedule[\"duration\"]; ?></td>\n <td><?php if ($schedule[\"days_of_week\"]) {\n echo $schedule[\"days_of_week\"];\n } else {\n echo \"All\";\n } ?></td>\n <td><?php if ($schedule[\"days_of_month\"]) {\n echo $schedule[\"days_of_month\"];\n } else {\n echo \"All\";\n } ?></td>\n <td style=\"text-align:center;width:60px\">\n <?php if (!is_readonly_user(0)) { ?>\n <a href=\"recurringdowntime.php?mode=edit&sid=<?php echo $sid; ?>&return=<?php echo urlencode($_SERVER[\"REQUEST_URI\"]); ?>%23servicegroup-tab&nsp=<?php echo get_nagios_session_protector_id(); ?>\" title=\"Edit Schedule\"><img src=\"<?php echo theme_image('pencil.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Edit schedule'); ?>\" alt=\"<?php echo _('Edit'); ?>\"></a>\n <a onClick=\"javascript:return do_delete_sid('<?php echo $sid; ?>');\" href=\"javascript:void(0);\" title=\"<?php echo _('Delete Schedule'); ?>\"><img src=\"<?php echo theme_image('cross.png'); ?>\" class=\"tt-bind\" title=\"<?php echo _('Delete schedule'); ?>\" alt=\"<?php echo _('Delete'); ?>\"></a>\n <?php } ?>\n </td>\n </tr>\n <?php } // end foreach ?>\n\n <?php } else { ?>\n <tr>\n <td colspan=\"7\">\n <div style=\"padding:4px\">\n <em><?php echo _(\"There are currently no servicegroup recurring downtime events defined.\"); ?></em>\n </div>\n </td>\n </tr>\n <?php } // end if servicegroup_data ?>\n\n\n </tbody>\n </table>\n\n <?php if ($showall) echo \"</div>\"; // end servicegroup tab?>\n\n <?php } // end if servicegroup or showall ?>\n\n <?php\n if ($showall) { // end of tabs container\n ?>\n </div>\n <?php\n }\n do_page_end(true);\n}", "public function index(){\t\n\t\t// set the page title\n\t\t$this->set('title_for_layout', 'Approve Waive Off Request- HRIS - BigOffice');\n\t\t\n\t\t// get employee list\t\t\n\t\t$emp_list = $this->HrAttWaive->get_team($this->Session->read('USER.Login.id'),'L');\n\t\t$format_list = $this->Functions->format_dropdown($emp_list, 'u','id','first_name', 'last_name');\t\t\n\t\t$this->set('empList', $format_list);\n\t\t\n\t\n\t\t// when the form is submitted for search\n\t\tif($this->request->is('post')){\n\t\t\t$url_vars = $this->Functions->create_url(array('keyword','emp_id','from','to'),'HrAttWaive'); \n\t\t\t$this->redirect('/hrattwaive/?'.$url_vars);\t\t\t\n\t\t}\t\t\t\t\t\n\t\t\n\t\tif($this->params->query['keyword'] != ''){\n\t\t\t$keyCond = array(\"MATCH (reason) AGAINST ('\".$this->params->query['keyword'].\"' IN BOOLEAN MODE)\"); \n\t\t}\n\t\tif($this->params->query['emp_id'] != ''){\n\t\t\t$empCond = array('HrAttWaive.app_users_id' => $this->params->query['emp_id']); \n\t\t}\n\t\t// for date search\n\t\tif($this->params->query['from'] != '' || $this->params->query['to'] != ''){\n\t\t\t$from = $this->Functions->format_date_save($this->params->query['from']);\n\t\t\t$to = $this->Functions->format_date_save($this->params->query['to']);\t\t\t\n\t\t\t$dateCond = array('HrAttWaive.created_date between ? and ?' => array($from, $to)); \n\t\t}\n\t\t\n\t\t\n\t\t// fetch the attendance data\t\t\n\t\t$this->paginate = array('fields' => array('id', 'created_date',\t\"date_format(HrAttWaive.date, '%Y-%m') as month\",\n\t\t\"date_format(HrAttWaive.date, '%M, %Y') as month_display\", 'HrEmployee.first_name', 'HrEmployee.last_name','status','approve_date', 'HrEmployee.id', 'count(*) no_req'),\n\t\t'limit' => 10,'conditions' => array($keyCond, \n\t\t$empCond, $dateCond, 'is_draft' => 'N'), 'group' => array('HrEmployee.id',\"date_format(HrAttWaive.date, '%Y-%m')\"),\n\t\t'order' => array('HrAttWaive.created_date' => 'desc'));\n\t\t$data = $this->paginate('HrAttWaive');\n\t\t\n\t\t$this->set('att_data', $data);\n\t\t\n\t\t\n\t\n\t\tif(empty($data)){\n\t\t\t$this->Session->setFlash('<button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>You have no waive-off request to approve', 'default', array('class' => 'alert alert'));\t\n\t\t}\n\t\t\n\t\t\n\t}", "public function index($view='week',$ref_datetime=false){\n\n $view = strtolower($view);\n\n if(!in_array($view,array('day','week','month','list'))){\n $this->_setFlash('Invalid view specified.');\n return $this->redirect($this->referer(array('action' => 'index')));\n }\n\n if($ref_datetime === false)\n $ref_datetime = time();\n\n $start_datetime = false;\n $end_datetime = false;\n $viewDescription = false;\n\n //Adjust start date/time based on the current reference time\n if($view == 'day'){\n $start_datetime = strtotime('today midnight', $ref_datetime);\n $end_datetime = strtotime('tomorrow midnight', $start_datetime);\n $previous_datetime = strtotime('yesterday midnight', $start_datetime);\n $next_datetime = $end_datetime;\n $viewDescription = date('M, D j',$start_datetime);\n }\n elseif($view == 'week') {\n $start_datetime = strtotime('Monday this week', $ref_datetime);\n $end_datetime = strtotime('Monday next week', $start_datetime);\n $previous_datetime = strtotime('Monday last week', $start_datetime);\n $next_datetime = $end_datetime;\n $viewDescription = date('M j', $start_datetime) . \" - \" . date('M j', $end_datetime-1);\n }\n elseif($view == 'month') {\n $start_datetime = strtotime('first day of this month', $ref_datetime);\n $end_datetime = strtotime('first day of next month', $start_datetime);\n $previous_datetime = strtotime('first day of last month', $start_datetime);\n $next_datetime = $end_datetime;\n $viewDescription = date('F \\'y', $start_datetime);\n }\n else { //list\n $start_datetime = strtotime('first day of January this year', $ref_datetime);\n $end_datetime = strtotime('first day of January next year', $start_datetime);\n $previous_datetime = strtotime('first day of January last year', $start_datetime);\n $next_datetime = $end_datetime;\n $viewDescription = date('Y', $start_datetime);\n }\n\n $start_datetime_db = date('Y-m-d H:i:s', $start_datetime);\n $end_datetime_db = date('Y-m-d H:i:s', $end_datetime);\n\n $entries = $this->CalendarEntry->find('all',array(\n 'contain' => array(),\n 'conditions' => array(\n 'OR' => array(\n array(\n 'start >=' => $start_datetime_db,\n 'start < ' => $end_datetime_db\n ),\n array(\n 'end >=' => $start_datetime_db,\n 'end <' => $end_datetime_db\n )\n )\n ),\n 'order' => array(\n 'start' => 'desc'\n )\n ));\n\n //Group entries appropriately\n $grouped_entries = array(); \n $group_offset = false;\n $group_index = 0;\n if($view == 'day'){\n //Group by hour\n $group_offset = self::HOUR_SECONDS;\n }\n elseif($view == 'week'){\n //Group by day\n $group_offset = self::DAY_SECONDS;\n }\n elseif($view == 'month'){\n //Group by week\n $group_offset = self::WEEK_SECONDS;\n }\n else {\n //Group by month\n $group_offset = self::DAY_SECONDS*31; //31 days in Jan\n }\n $group_starttime = $start_datetime;\n $group_endtime = $start_datetime + $group_offset - 1;\n while($group_starttime < $end_datetime){\n $grouped_entries[$group_index] = array(\n 'meta' => array(\n 'starttime' => $group_starttime,\n 'endtime' => $group_endtime\n ),\n 'items' => array()\n );\n foreach($entries as $entry){\n $entry_starttime = strtotime($entry['CalendarEntry']['start']);\n $entry_endtime = strtotime($entry['CalendarEntry']['end']);\n if($entry_starttime >= $group_starttime && $entry_starttime < $group_endtime){\n $grouped_entries[$group_index]['items'][] = $entry;\n continue;\n }\n if($entry_endtime > $group_starttime && $entry_endtime < $group_endtime){\n $grouped_entries[$group_index]['items'][] = $entry;\n }\n }\n $group_index++;\n\n if($view == 'list'){\n $group_starttime = $group_endtime + 1;\n $group_endtime = strtotime('first day of next month', $group_starttime) - 1;\n }\n else {\n $group_starttime += $group_offset;\n $group_endtime += $group_offset;\n if($group_endtime > $end_datetime)\n $group_endtime = $end_datetime-1;\n }\n }\n\n $this->set(array(\n 'view' => $view,\n 'viewDescription' => $viewDescription,\n 'calendarItems' => $grouped_entries,\n 'currentDatetime' => $start_datetime,\n 'previousDatetime' => $previous_datetime,\n 'nextDatetime' => $next_datetime\n ));\n }", "public function index() {\n $currentDate = (new Datetime())->format('Y-m-d');\n \t$timesheets = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->get();\n \t$schedule = Schedule::whereDate('start_date','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->get();\n \t//Get total time worked\n \t$hours = 0;\n \tforeach ($timesheets as $timesheet) {\n\t \t$date1 = new Datetime($timesheet->start_time);\n\t\t\t$date2 = new Datetime($timesheet->end_time);\n\t\t\t$diff = $date2->diff($date1);\n\n $hours = $hours + (($diff->h * 60) + $diff->i);\n \t}\n //Get total breaks\n $breaks = 0;\n $first_timesheet = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->first();\n $last_timesheet = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->latest()->first();\n if($first_timesheet){\n $date1 = new Datetime($first_timesheet->start_time);\n $date2 = new Datetime($last_timesheet->end_time);\n $diff = $date2->diff($date1);\n $breaks = (($diff->h * 60) + $diff->i) - $hours;\n }\n\n $worked = $this->hoursandmins($hours);\n $breaks = $this->hoursandmins($breaks);\n // First Punch In in current day\n $first_punch_in = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->first();\n return view('attendance/index', ['timesheets'=>$timesheets, 'schedule'=>$schedule, 'first_punch_in'=>$first_punch_in, 'worked'=>$worked, 'breaks'=>$breaks, 'first_timesheet'=>$first_timesheet, 'last_timesheet'=>$last_timesheet]);\n }", "public function detailedtimesheetAction()\r\n {\r\n $project = $this->projectService->getProject($this->_getParam('projectid'));\r\n $client = $this->clientService->getClient($this->_getParam('clientid'));\r\n $task = $this->projectService->getTask($this->_getParam('taskid'));\r\n $user = $this->userService->getUserByField('username', $this->_getParam('username'));\r\n\t\t\r\n if (!$project && !$client && !$task && !$user) {\r\n return;\r\n }\r\n\r\n\t\tif ($task) { \r\n $this->view->records = $this->projectService->getDetailedTimesheet(null, $task->id);\r\n } else if ($project) {\r\n \r\n $start = null;\r\n $this->view->records = $this->projectService->getDetailedTimesheet(null, null, $project->id);\r\n } else if ($client) {\r\n \r\n $start = null;\r\n $this->view->records = $this->projectService->getDetailedTimesheet(null, null, null, $client->id);\r\n } else if ($user) {\r\n\t\t\t$this->view->records = $this->projectService->getDetailedTimesheet($user);\r\n\t\t}\r\n\r\n\t\t$this->view->task = $task;\r\n $this->renderRawView('timesheet/ajax-timesheet-details.php');\r\n }", "function approvedperiodview()\n\t {\n\t // Get the current user\n\t $user = &getUser();\n\n\t // If the year is given in postvars, then view the approvedperiodview\n // for the specified year\n\t if (is_numeric($this->m_postvars[\"year\"]) && strlen($this->m_postvars[\"year\"])==4)\n\t $year = trim($this->m_postvars[\"year\"]);\n\n\t // Else use the current year\n\t else\n\t $year = date('Y');\n\n $selected_functionlevel_id = $this->m_postvars[\"functionlevelswitch\"];\n\n if (moduleExists('advancedsecurity'))\n $lowerlevels = atkArrayNvl($this->m_postvars, \"lowerlevels\", 'off');\n else\n $lowerlevels = \"off\";\n\n\t // Get the singleton instance of the ui renderer\n\t $ui = &atkui::getInstance();\n\n // Compose the tplvars containing content and legend\n $tplvars_contentwithlegend = array(\n \"content\" => $this->getEmployeesTable($user[\"id\"], $year, $selected_functionlevel_id, $lowerlevels),\n \"legenditems\" => $this->getLegendData()\n );\n\n $contentwithlegend = $ui->render(\"contentwithlegend.tpl\", $tplvars_contentwithlegend);\n\n\t // Use a numberattrib to get a display for the year inputbox\n\t $yearattrib = new atkNumberAttribute(\"year\",0,6);\n\n\t $func_code = $this->get_functionlevels($selected_functionlevel_id, $lowerlevels);\n\n // Display the year input form\n $header = \"\";\n if ($func_code != null) $header.= atktext('functionlevel','project').': '.$func_code.'<br />';\n $header.= atktext(\"year\").\" : \".$yearattrib->edit(array(\"year\"=>$year)).'&nbsp;&nbsp;';\n $header.= '<input type=\"submit\" name=\"atkbtn1\" value=\"'.atktext(\"view\").'\">';\n //$header.= atkbutton(atktext(\"view\"), dispatch_url(\"timereg.hours_approve\", \"admin\"), SESSION_REPLACE);\n\n // Add an explanation to the approvedperiodview\n\t $footer = atktext(\"remark\") . \": <br />\";\n $footer.= (!$this->allowed(\"any_user\")) ? atktext(\"hours_approve_remarkmanager\") . '<br />' : '';\n $footer.= (moduleExists('advancedsecurity')) ? atktext(\"hours_approve_advancedsecurity\") . '<br />' : '';\n $footer.= sprintf(atktext(\"hours_approve_remarkperiodblock\"), ucfirst($this->m_lockmode));\n\n if (atkconfig::get('timereg','hours_approve_only_show_not_approved') == true)\n $footer .= \"<br />\" . atktext('hours_approve_only_show_not_approved');\n\n if (atkconfig::get('timereg','hours_approve_projectteam_members_only') == true)\n $footer .= \"<br />\" . atktext('hours_approve_explain_teammembers_only');\n\n\t $footer.= $this->convertheck();\n\n\t // Start the output using a session form\n\t $formstart = '<form name=\"entryform\" enctype=\"multipart/form-data\" action=\"'.getDispatchFile().'\" method=\"post\" onsubmit=\"globalSubmit(this)\">';\n\t $formstart.= session_form();\n\t // Close the form\n\t $formend = '</form>';\n\n\t // Compose the tplvars containing the\n\t $tplvars_vertical = array(\n\t \"formstart\" => $formstart,\n\t \"formend\" => $formend,\n\t \"blocks\" => array(\n $header,\n $contentwithlegend,\n $footer\n ),\n \"align\" => \"left\"\n );\n\n $boxcontents = $ui->render(\"vertical.tpl\", $tplvars_vertical);\n\n\t // Add a conversion link to the approvedperiodview if datastructurs outdated\n\n\t // Put the result into a box\n\t $boxedresult = $ui->renderBox(array(\"title\"=>atktext(\"title_houradmin_approve\"),\"content\"=>$boxcontents));\n\n\t // Return the boxed result HTML\n\t return $boxedresult;\n\t }", "public function reportTodayAttendent()\n {\n $shift = DB::table('shift')->get();\n $dept = DB::table('department')->where('status',1)->get();\n return view('report.reportTodayAttendent')->with('shift',$shift)->with('dept',$dept);\n }", "public function mark_attendance($message = NULL) {\n $data['sideMenuData'] = fetch_non_main_page_content();\n $tenant_id = $this->tenant_id;\n $course_id = $this->input->post('course_id');\n $class_id = $this->input->post('class_id');\n $subsidy = $this->input->post('subsidy');\n $sort_by = $this->input->get('b');\n $sort_order = $this->input->get('o');\n $class_details = $this->class->get_class_by_id($tenant_id, $course_id, $class_id);\n \n $from_date = parse_date($class_details->class_start_datetime, SERVER_DATE_TIME_FORMAT);///added by shubhranshu\n $to_date = parse_date($class_details->class_end_datetime, SERVER_DATE_TIME_FORMAT);//added by shubhranshu\n $week_start_date = parse_date($this->input->post('week_start'), CLIENT_DATE_FORMAT);//added by shubhranshu\n //echo print_r($from_date);print_r($to_date);print_r($week_start_date);exit;\n \n $week = $this->input->post('week');\n $export = $this->input->post('export');\n $export1 = $this->input->post('export1');\n $this->load->helper('attendance_helper');\n if (!empty($export)) \n {\n $class_details = $this->class->get_class_details_for_report($tenant_id, $course_id, $class_id);\n $class_start = parse_date($class_details->class_start_datetime, SERVER_DATE_TIME_FORMAT);\n $class_end = parse_date($class_details->class_end_datetime, SERVER_DATE_TIME_FORMAT);\n if (empty($class_start))\n $class_start = new DateTime();\n if (empty($class_end))\n $class_end = new DateTime();\n $class_schedule = $this->class->get_all_class_schedule($tenant_id, $class_id);\n $class_schedule_data = array();\n foreach ($class_schedule as $row) {\n $session_arr = array('S1' => '1', 'BRK' => '3', 'S2' => '2');\n $class_schedule_data[date('d/m/y', strtotime($row['class_date']))][$session_arr[$row['session_type_id']]] = date('h:i A', strtotime($row['session_start_time']));\n }\n \n if ($export == 'xls') \n {\n $results = $this->classtraineemodel->get_class_trainee_list_for_attendance($tenant_id, $course_id, $class_id, $subsidy, $class_start, $class_end, $sort_by, $sort_order);\n $this->load->helper('export_helper');\n export_attendance($results, $class_details, $class_start, $class_end, $class_schedule_data);\n } \n else \n {\n $results = $this->classtraineemodel->get_class_trainee_list_for_attendance($tenant_id, $course_id, $class_id, $subsidy, $class_start, $class_end, $sort_by, $sort_order);\n $tenant_details = $this->classtraineemodel->get_tenant_masters($tenant_id);\n $tenant_details->tenant_state = rtrim($this->course->get_metadata_on_parameter_id($tenant_details->tenant_state), ', ');\n $tenant_details->tenant_country = rtrim($this->course->get_metadata_on_parameter_id($tenant_details->tenant_country), ', ');\n\t\t$mark_count = $this->classtraineemodel->get_rows_count($course_id,$class_id);\n \n if ($export == 'xls_week'){\n $this->load->helper('export_helper');\n return generate_class_attendance_sheet_xls($results, $class_details, $class_start, $class_end, $tenant_details, $class_schedule_data);\n }\n $this->load->helper('pdf_reports_helper');\n if ($export == 'pdf') {\n //return generate_class_attendance_pdf($results, $class_details, $tenant_details, $class_schedule_data, $mark_count);\n //print_r($results);exit;\n return generate_class_attendance_pdf($results, $class_details, $tenant_details, $class_schedule_data,$mark_count); // removed mark count by shubhranshu\n \n } else if ($export == 'pdf_week') {\n return generate_class_attendance_sheet_pdf($results, $class_details, $tenant_details, $class_schedule_data);\n }\n }\n \n } \n else \n {\n if($export1=='lock')\n { \n $lock_msg=$this->classtraineemodel->lock_class_attendance($tenant_id,$course_id,$class_id);\n if($lock_msg==TRUE){\n $this->session->set_flashdata(\"success\", \"Succesfully Locked.\");\n }else{\n $this->session ->set_flashdata(\"error\",\"Something went wrong while locking.\");\n }\n }else if($export1=='unlock'){\n $lock_msg=$this->classtraineemodel->unlock_class_attendance($tenant_id,$course_id,$class_id);\n if($lock_msg==TRUE){\n $this->session->set_flashdata(\"success\",\"Succesfully Unocked\");\n }else{\n $this->session->set_flashdata(\"error\",\"Somthing went wrong while Unlocking !\");\n \n }\n }\n \n \n $data = get_data_for_renderring_attendance($tenant_id, $course_id, $class_id, $subsidy, $from_date, $to_date, $week_start_date, $week, $sort_by, $sort_order,'');\n \n $data['class_schedule'] = $this->class->get_all_class_schedule($tenant_id, $class_id);\n $att = $this->classtraineemodel->get_attendance_lock_status($tenant_id,$course_id, $class_id);\n $data['lock_status']=$att->lock_status;\n $data['class_start_datetime']=$att->class_start_datetime;\n\t\t\t$data['user'] = $this->user;\n\t\t\t$data['controllerurl'] = 'class_trainee/mark_attendance';\n $data['page_title'] = 'Class Trainee Enrollment - Mark Attendance';\n $data['main_content'] = 'classtrainee/markattendance';\n //$data['week_start'] = $from_date;\n //$data['sideMenuData'] = $this->sideMenu;\n if (!empty($message))\n $data['message'] = $message;\n $this->load->view('layout', $data);\n }\n }", "public function approveTimesheet() {\n $id = request('timesheetId');\n Timesheet::find($id)->update(['status'=>'approved']);\n return back();\n }", "public function overAllSummaryReportView(Request $request)\n {\n $from_date = trim($request->from); \n $from = date (\"Y-m-d\", strtotime($from_date));\n $explode = explode('-',$from);\n $from_year = $explode[0];\n $get_current_day = date(\"l\",strtotime($from));\n $current_year = date('Y');\n if($get_current_day =='Saturday'){\n $current_day = 1 ;\n }\n if($get_current_day =='Sunday'){\n $current_day = 2 ;\n }\n if($get_current_day =='Monday'){\n $current_day = 3 ;\n }\n if($get_current_day =='Tuesday'){\n $current_day = 4 ;\n }\n if($get_current_day =='Wednesday'){\n $current_day = 5 ;\n }\n if($get_current_day =='Thursday'){\n $current_day = 6 ;\n }\n if($get_current_day =='Friday'){\n $current_day = 7 ;\n }\n if($from > $this->rcdate1){\n echo 'f1';\n exit();\n }\n // get door holiday\n $holiday_count = DB::table('holiday')->where('door_holiday',0)->where('holiday_date',$from)->count();\n if($holiday_count > 0){\n echo 'f2';\n exit();\n }\n if($from_year != $current_year){\n echo 'f3';\n exit();\n }\n // attendent holiday count\n $attendent_holiday_count = DB::table('holiday')->where('attendent_holiday',0)->where('holiday_date',$from)->count();\n // total staff\n $total_staff_count = DB::table('users')->where('trasfer_status',0)->whereNotIn('type',[10])->count();\n // total teacher count \n $total_teacher_count = DB::table('users')->where('trasfer_status',0)->where('type',3)->count();\n // total staff enter into the campus\n $total_staff_enter_into_campus = DB::table('tbl_door_log')->where('type',1)->whereNotIn('user_type',[10])->where('enter_date',$from)->distinct('user_id')->count('user_id');\n\n // total staff leave\n $total_staff_leave_count = DB::table('tbl_leave')->where('final_request_from',$from)->where('status',1)->count();\n $total_teacher_leave_count = DB::table('tbl_leave')\n ->join('users', 'users.id', '=', 'tbl_leave.user_id')\n ->select('tbl_leave.*')\n ->where('users.type', 3)\n ->where('final_request_from',$from)\n ->where('status',1)\n ->count();\n $total_teacher_attendent_in_class = DB::table('teacher_attendent')->where('created_at',$from)->where('status',1)->where('type',3)->distinct('teacherId')->count('teacherId');\n // total class of this day\n $total_class_count = DB::table('routine')\n ->join('semister', 'routine.semister_id', '=', 'semister.id')\n ->select('routine.*')\n ->where('routine.year', $from_year)\n ->where('routine.day', $current_day)\n ->where('semister.status',1)\n ->count();\n\n // total teacher attendent class\n $teacher_taken_total_class_class = DB::table('teacher_attendent')->where('created_at',$from)->where('status',1)->where('type',3)->count();\n #--------------------------------- student section------------------------------------#\n $total_student_count = DB::table('student')\n ->join('semister', 'student.semister_id', '=', 'semister.id')\n ->select('student.*')\n ->where('student.year', $from_year)\n ->where('student.status', 0)\n ->where('semister.status',1)\n ->count();\n $total_student_enter_into_campus = DB::table('tbl_door_log')->where('type',2)->where('enter_date',$from)->distinct('student_id')->count('student_id');\n $total_student_enter_into_class = DB::table('student_attendent')->where('created_at',$from)->distinct('studentId')->count('studentId');\n // total hours class of this day\n $total_class_hour_in_routine = DB::table('routine')\n ->join('semister', 'routine.semister_id', '=', 'semister.id')\n ->select('routine.*')\n ->where('routine.year', $from_year)\n ->where('routine.day', $current_day)\n ->where('semister.status',1)\n ->get();\n // total hours class held\n $total_hours_class_held_query = DB::table('teacher_attendent')->where('created_at',$from)->where('status',1)->where('type',3)->get(); \n\n return view('view_report.overAllSummaryReportView')\n ->with('total_staff_count',$total_staff_count)\n ->with('total_teacher_count',$total_teacher_count)\n ->with('total_staff_enter_into_campus',$total_staff_enter_into_campus)\n ->with('total_staff_leave_count',$total_staff_leave_count)\n ->with('total_teacher_leave_count',$total_teacher_leave_count)\n ->with('total_teacher_attendent_in_class',$total_teacher_attendent_in_class)\n ->with('total_class_count',$total_class_count)\n ->with('teacher_taken_total_class_class',$teacher_taken_total_class_class)\n ->with('from',$from)\n ->with('attendent_holiday_count',$attendent_holiday_count)\n ->with('total_student_count',$total_student_count)\n ->with('total_student_enter_into_campus',$total_student_enter_into_campus)\n ->with('total_student_enter_into_class',$total_student_enter_into_class)\n ->with('total_class_hour_in_routine',$total_class_hour_in_routine)\n ->with('total_hours_class_held_query',$total_hours_class_held_query)\n ;\n }", "function companydates(){\n $this->auth(COMP_ADM_LEVEL);\n $contest_id = $this->uri->segment(3);\n $data = $this->_getCompanyDataByContestId($contest_id);\n if($this->session->userdata('role_level') > SUPPORT_ADM_LEVEL){\n $data['editable'] = TRUE;\n } else {\n $data['editable'] = FALSE;\n }\n $this->load->view('admin/company_admin/v_dates', $data);\n }", "function teamGoals($viewPermissions, $mysqli) {\n$curDate = date (\"Y-m-d\");\n$curMonth = date('m');\n$curYear = date('Y');\n$beginWeek = date(\"Y-m-d\", strtotime('last sunday'));\n$endWeek = date(\"Y-m-d\", strtotime('this friday'));\n$monthBegin = $curYear . '-' . $curMonth . '-01';\n$monthEnd = $curYear . '-' . $curMonth . '-31';\n// Merging first and last name into one variable.\n// Declaring default value for the time counters.\n$teamMonth = 0;\n$teamWeek = 0;\n$teamDay = 0;\n// Switch case changing the role depending on permissions value.\nswitch ($viewPermissions) {\n\tcase 'Domain':\n\t\t$role = 'DateBought';\n\t\tbreak;\n\tcase 'Content':\n\t\t$role = 'ContentFinished';\n\t\tbreak;\n\tcase 'Writer':\n\t\t$role = 'ContentFinished';\n\t\tbreak;\n\tcase 'Designer':\n\t\t$role = 'DesignFinish';\n\t\tbreak;\n\tcase 'Support':\n\t\t$role = 'CloneFinished';\n\t\tbreak;\n\tcase 'Admin':\n\t\t$role = 'DevFinish';\n\t\tbreak;\n\tcase 'QA':\n\t\t$role = 'DateComplete';\n\t\tbreak;\n}\n$query = \"SELECT * FROM domainDetails WHERE `$role`= '$curDate'\";\n$results = mysqli_query($mysqli, $query);\n$rows = mysqli_num_rows($results);\nfor ($a = 0; $a < $rows; $a++){\n\tmysqli_data_seek($results, $a);\n\t$domain_data = mysqli_fetch_assoc($results);\n// Setting results as incrementers. If there is a day found then it adds to day, week, & month.\n\t\t$teamDay++;\n}\n$query = \"SELECT * FROM domainDetails WHERE $role BETWEEN '$beginWeek' AND '$endWeek'\";\n$results = mysqli_query($mysqli, $query);\n$rows = mysqli_num_rows($results);\nfor ($a = 0; $a < $rows; $a++){\n\tmysqli_data_seek($results, $a);\n\t$domain_data = mysqli_fetch_assoc($results);\n// Setting results as incrementers. If there is a day found then it adds to day, week, & month.\n// Adds to the week as well as month.\n\t\t$teamWeek++;\n}\n// Adds to only the month.\n$query = \"SELECT * FROM domainDetails WHERE $role BETWEEN '$monthBegin' AND '$monthEnd'\";\n$results = mysqli_query($mysqli, $query);\n$rows = mysqli_num_rows($results);\nfor ($a = 0; $a < $rows; $a++){\n\tmysqli_data_seek($results, $a);\n\t$domain_data = mysqli_fetch_assoc($results);\n\t\t$teamMonth++;\n}\n\nreturn array($teamDay, $teamWeek, $teamMonth);\n}", "function Approve( $id,$week,$year ) \t{\n\t\t$this->getMenu() ;\n\t\t$this->data['id']\t= $id ;\n\t\t$this->data['back']\t= $this->data['site'] .'timesheet/tobeApproved';\n\t\t$this->data['table'] = $this->timesheetModel->getTimesheetActiveStatusX($id,$week,$year);\n\t\t$this->load->view('timesheet_approve_detail',$this->data);\n\t}", "public static function weekly() {return new ScheduleViewMode(2);}", "public function action_list_approval_menu(){\n $param = \\Input::param();\n $export_date = isset($param['export_date'])?date('Y-m-d', strtotime($param['export_date'])):date('Y-m-d');\n\n $objPHPExcel = new \\PHPExcel();\n $objPHPExcel->getProperties()->setCreator('Vision')\n ->setLastModifiedBy('Vision')\n ->setTitle('Office 2007 Document')\n ->setSubject('Office 2007 Document')\n ->setDescription('Document has been generated by PHP')\n ->setKeywords('Office 2007 openxml php')\n ->setCategory('Route File');\n\n $header = ['様式', '適用開始日', '適用終了日',\n '第1 承認者','第1 承認者の権限',\n '第2 承認者','第2 承認者の権限','第3 承認者','第3 承認者の権限',\n '第4 承認者','第4 承認者の権限','第5 承認者','第5 承認者の権限',\n '第6 承認者','第6 承認者の権限','第7 承認者','第7 承認者の権限',\n '第8 承認者','第8 承認者の権限','第9 承認者','第9 承認者の権限',\n '第10 承認者','第10 承認者の権限','第11 承認者','第11 承認者の権限',\n '第12 承認者','第12 承認者の権限','第13 承認者','第13 承認者の権限',\n '第14 承認者','第14 承認者の権限','第15 承認者','第15 承認者の権限',\n ];\n $last_column = null;\n foreach($header as $i=>$v){\n $column = \\PHPExcel_Cell::stringFromColumnIndex($i);\n $objPHPExcel->setActiveSheetIndex(0)->setCellValue($column.'1',$v);\n $objPHPExcel->getActiveSheet()->getStyle($column.'1')\n ->applyFromArray([\n 'font' => [\n 'name' => 'Times New Roman',\n 'bold' => true,\n 'italic' => false,\n 'size' => 10,\n 'color' => ['rgb'=> \\PHPExcel_Style_Color::COLOR_WHITE]\n ],\n 'alignment' => [\n 'horizontal' => \\PHPExcel_Style_Alignment::HORIZONTAL_CENTER,\n 'vertical' => \\PHPExcel_Style_Alignment::VERTICAL_CENTER,\n 'wrap' => false\n ]\n ]);\n switch($i+1){\n case 1:\n $width = 50;\n break;\n case 5: case 7: case 9: case 11: case 13:\n case 15: case 17: case 19: case 21: case 23: case 25:\n case 27: case 29: case 31: case 33: case 35: case 37: case 39: \n $width = 20;\n break;\n default:\n $width = 30;\n break;\n }\n $objPHPExcel->getActiveSheet()->getColumnDimension($column)->setWidth($width);\n $last_column = $column;\n }\n \n /*====================================\n * Get list user has department enable_start_date >= export day <= enable_end_date\n * Or enable_start_date >= export day && enable_end_date IS NULL\n *====================================*/\n $query = \\DB::select('MAM.*',\n \\DB::expr('MM.name AS menu_name'), \\DB::expr('MM.id AS menu_id'), \n \\DB::expr('MRM.name AS request_menu_name'), \\DB::expr('MRM.id AS request_menu_id'))\n ->from(['m_approval_menu', 'MAM'])\n ->join(['m_menu', 'MM'], 'left')->on('MM.id', '=', 'MAM.m_menu_id')\n ->on('MAM.petition_type', '=', \\DB::expr(\"1\"))\n ->on('MM.item_status', '=', \\DB::expr(\"'active'\"))->on('MM.enable_flg', '=', \\DB::expr(\"1\"))\n ->join(['m_request_menu', 'MRM'], 'left')->on('MRM.id', '=', 'MAM.m_menu_id')\n ->on('MAM.petition_type', '=', \\DB::expr(\"2\"))\n ->on('MRM.item_status', '=', \\DB::expr(\"'active'\"))->on('MRM.enable_flg', '=', \\DB::expr(\"1\"))\n ->where('MAM.item_status', '=', 'active')\n ->group_by('MAM.m_menu_id', 'MAM.petition_type', 'MAM.enable_start_date')\n ;\n $items = $query->execute()->as_array();\n \n //set content\n $i = 0;\n foreach($items as $item){\n $row = $i+2;\n switch ($item['petition_type']) {\n case 1:\n $menu_name = $item['menu_name'];\n $menu_id = $item['menu_id'];\n break;\n case 2:\n $menu_name = $item['request_menu_name'];\n $menu_id = $item['request_menu_id'];\n break;\n }\n\n if(empty($menu_id)) continue;\n $objPHPExcel->setActiveSheetIndex()->setCellValue('A'.$row, $menu_name)\n ->setCellValue('B'.$row,$item['enable_start_date']?\\Vision_Common::system_format_date(strtotime($item['enable_start_date'])):null)\n ->setCellValue('C'.$row,$item['enable_end_date']?\\Vision_Common::system_format_date(strtotime($item['enable_end_date'])):null);\n\n //Get user of routes\n $query = \\DB::select('MU.fullname', \\DB::expr('MA.name AS authority_name'))\n ->from(['m_user', 'MU'])\n // ->join(['m_user_department', 'MUD'], 'left')->on('MUD.m_user_id', '=', 'MU.id')\n // ->join(['m_department', 'DEP'], 'left')->on('DEP.id', '=', 'MUD.m_department_id')\n ->join(['m_approval_menu', 'MAM'], 'left')->on('MAM.m_user_id', '=', 'MU.id')\n ->join(['m_authority', 'MA'], 'left')->on('MA.id', '=', 'MAM.m_authority_id')\n ->and_where('MAM.m_menu_id', '=', $item['m_menu_id'])\n ->and_where('MAM.petition_type', '=', $item['petition_type'])\n\n ->where('MU.item_status', '=', 'active')\n ->and_where_open()\n ->and_where('MU.retirement_date', '>', $export_date)\n ->or_where('MU.retirement_date', 'IS',\\DB::expr('NULL'))\n ->and_where_close()\n\n ->and_where('MAM.item_status', '=', 'active')\n ->and_where_open()\n ->and_where(\\DB::expr(\"'{$export_date}'\"), 'BETWEEN', [\\DB::expr('MAM.enable_start_date'), \\DB::expr('MAM.enable_end_date')])\n ->or_where_open()\n ->and_where(\\DB::expr('MAM.enable_start_date'), '<=', $export_date)\n ->and_where(\\DB::expr('MAM.enable_end_date'), 'IS', \\DB::expr('NULL'))\n ->or_where_close()\n ->and_where_close()\n\n ->order_by('MAM.order', 'ASC')\n ->group_by('MAM.m_user_id', 'MAM.m_authority_id')\n ;\n $users = $query->execute()->as_array(); \n\n if(!empty($users)){\n $col = 3;\n foreach ($users as $user) {\n $objPHPExcel->setActiveSheetIndex()->setCellValue(\\PHPExcel_Cell::stringFromColumnIndex($col).$row,$user['fullname']);\n $col++;\n $objPHPExcel->setActiveSheetIndex()->setCellValue(\\PHPExcel_Cell::stringFromColumnIndex($col).$row,$user['authority_name']);\n $col++;\n }\n }\n\n $i++;\n }\n\n\n $format = ['alignment'=>array('horizontal'=> \\PHPExcel_Style_Alignment::HORIZONTAL_CENTER,'wrap'=>true)];\n $objPHPExcel->getActiveSheet()->getStyle('A1:AC1')->getFill()->setFillType(\\PHPExcel_Style_Fill::FILL_SOLID);\n $objPHPExcel->getActiveSheet()->getStyle('A1:AC1')->getFill()->getStartColor()->setRGB('25a9cb');\n\n header(\"Last-Modified: \". gmdate(\"D, d M Y H:i:s\") .\" GMT\");\n header(\"Cache-Control: max-age=0\");\n header('Content-Type: application/vnd.ms-excel');\n header('Content-Disposition: attachment;filename=\"決裁経路(基準)-'.$export_date.'.xls\"');\n $objWriter = \\PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');\n $objWriter->save('php://output');\n exit; \n }", "public function getAppointments(){\n\t\tif (Auth::user()->type==4) {\n\t\t\t# code...\n\t\t\treturn redirect()->back(); \n\t\t}\n\t\t$todays = $this->getTodayAppointments(); \n\t\treturn view('appointments.nurseAppointments',compact('todays'));\n\t}", "public function date_range_report()\n\t{\n\t\t$this->data['crystal_report']=$this->reports_personnel_schedule_model->crystal_report_view();\n\t\t$this->data['company_list'] = $this->reports_personnel_schedule_model->company_list();\n\t\t$this->load->view('employee_portal/report_personnel/schedule/date_range_report',$this->data);\n\t}", "function wfCalendarRefresh()\n{\n global $wgRequest, $wgTitle, $wgScriptPath;\n // this is the \"refresh\" code that allows the calendar to switch time periods\n $v = $wgRequest->getValues();\n if (isset($v[\"calendar_info\"]))\n {\n $today = getdate(); // today\n $temp = explode(\"`\", $v[\"calendar_info\"]); // calling calendar info (name, title, etc..)\n\n // set the initial values\n $month = $temp[0];\n $day = $temp[1];\n $year = $temp[2];\n $title = $temp[3];\n $name = $temp[4];\n\n // the yearSelect and monthSelect must be on top... the onChange triggers\n // whenever the other buttons are clicked\n if (isset($v[\"yearSelect\"]))\n $year = $v[\"yearSelect\"];\n if (isset($v[\"monthSelect\"]))\n $month = $v[\"monthSelect\"];\n\n if (isset($v[\"yearBack\"]))\n --$year;\n if (isset($v[\"yearForward\"]))\n ++$year;\n\n if (isset($v[\"today\"]))\n {\n $day = $today['mday'];\n $month = $today['mon'];\n $year = $today['year'];\n }\n\n if (isset($v[\"monthBack\"]))\n {\n $year = ($month == 1 ? --$year : $year);\n $month = ($month == 1 ? 12 : --$month);\n }\n\n if (isset($v[\"monthForward\"]))\n {\n $year = ($month == 12 ? ++$year : $year);\n $month = ($month == 12 ? 1 : ++$month);\n }\n\n if (isset($v[\"weekBack\"]))\n {\n $arr = getdate(mktime(12, 0, 0, $month, $day-7, $year));\n $month = $arr['mon'];\n $day = $arr['mday'];\n $year = $arr['year'];\n }\n\n if (isset($v[\"weekForward\"]))\n {\n $arr = getdate(mktime(12, 0, 0, $month, $day+7, $year));\n $month = $arr['mon'];\n $day = $arr['mday'];\n $year = $arr['year'];\n }\n\n if (wfCalendarIsValidMode($v[\"viewSelect\"]))\n $mode = $v[\"viewSelect\"];\n\n $p = \"cal\".crc32(\"$title $name\");\n $v = sprintf(\"%04d-%02d-%02d-%s\", $year, $month, $day, $mode);\n\n // reload the page... clear any purge commands that may be in it from an ical load...\n $url = $wgTitle->getFullUrl(array($p => $v));\n header(\"Location: \" . $url);\n exit;\n }\n}", "function reminderForReimbursementSheet() {\n\n try {\n\n\n $conn = $this->connectToDB();\n\n $sql = \" SELECT date(h.ratingInputDate) as rating_date,q.first_mail_status,date(q.mail_sent_date) as mail_sent_date,q.sheet_status,q.assessment_id,q.user_id ,c.client_name,st.state_name,ct.city_name,u.name as user_name,\n d.school_aqs_pref_start_date as sdate,d.school_aqs_pref_end_date as edate\n FROM d_user u INNER JOIN h_user_review_reim_sheet_status q on u.user_id = q.user_id\n INNER JOIN d_assessment a ON q.assessment_id = a.assessment_id \n INNER JOIN d_client c ON a.client_id = c.client_id\n INNER JOIN d_cities ct ON c.city_id = ct.city_id\n INNER JOIN d_states st ON c.state_id = st.state_id\n INNER JOIN d_AQS_data d ON a.aqsdata_id = d.id\n INNER JOIN h_assessment_user h ON h.assessment_id = a.assessment_id AND h.role = :role\n WHERE q.sheet_status = :sheet_status AND h.isFilled = :isFilled \n \";\n $stmt = $conn->prepare($sql);\n $role = 4;\n $sheet_status = 0;\n $isFilled = 1;\n $stmt->bindParam(':sheet_status', $sheet_status, $conn::PARAM_INT);\n $stmt->bindParam(':role', $role, $conn::PARAM_INT);\n $stmt->bindParam(':isFilled', $isFilled, $conn::PARAM_INT);\n $stmt->execute();\n $sheetData = $stmt->fetchAll(PDO::FETCH_ASSOC);\n // echo \"<pre>\";print_r($sheetData);die;\n \n $templateSql = \"SELECT nm.sender,nm.sender_name,nm.cc,nm.subject,nt.template_text,nt.id FROM d_review_notification_template nt INNER JOIN h_review_notification_mail_users nm \"\n . \" ON nt.id = nm.notification_id WHERE nt.id=:type AND nm.status = :status\";\n $stmt = $conn->prepare($templateSql);\n $type = 8;\n $status = 1;\n $stmt->bindParam(':type', $type, $conn::PARAM_INT);\n $stmt->bindParam(':status', $status, $conn::PARAM_INT);\n $stmt->execute();\n $notificationsTemplates = $stmt->fetch(PDO::FETCH_ASSOC);\n // print_r($notificationsTemplates);die;\n //$sheetData = array_unique(array_column($sheetData,'assessment_id'));\n $assessmentSheetData = array();\n $rating_date = '';\n $first_mail_status = 0;\n $mail_sent_date = '';\n foreach($sheetData as $data) {\n // echo date(\"Y-m-d\");\n //echo date(\"Y-m-d\",strtotime(\"+5 day\", strtotime($data['rating_date'])));\n //$data['rating_date'] = date(\"Y-m-d\",$data['rating_date']);\n //$rating_date = \"2018-01-03\";\n //$data['rating_date'] = \"2018-01-03\";\n //$data['mail_sent_date'] = \"2018-01-01\";\n //echo date(\"Y-m-d\",strtotime(\"+5 day\", strtotime($data['rating_date'])));\n //$rating_date = isset($data['rating_date'])?$data['rating_date']:'';\n $first_mail_status = isset($data['first_mail_status'])?$data['first_mail_status']:0;\n $mail_sent_date = isset($data['mail_sent_date'])?$data['mail_sent_date']:'';\n if (!empty($data['edate']) && empty($first_mail_status) && strtotime(date(\"Y-m-d\")) == strtotime(\"+5 day\", strtotime($data['edate']))) {\n // print_r($data);die;\n $assessmentSheetData[$data['assessment_id']][] = $data;\n }else if (!empty($data['edate']) && !empty($first_mail_status) && strtotime(date(\"Y-m-d\")) == strtotime(\"+7 day\", strtotime($data['mail_sent_date']))) {\n // print_r($data);die;\n $assessmentSheetData[$data['assessment_id']][] = $data;\n }\n }\n //echo \"<pre>\";print_r($assessmentSheetData);die;\n if(!empty($assessmentSheetData)) {\n //$actionUrl = SITEURL . 'index.php?controller=assessment&action=reimSheetConfirmation';\n $actionUrl = SITEURL . 'cron/reviewApproveNotificationCron.php';\n $senderName = $notificationsTemplates['sender'];\n // $toEmail = '[email protected]';\n $toEmail = SHEET_TO_EMAIL;\n $toName = SHEET_TO_NAME;\n foreach($assessmentSheetData as $key=>$assessment ) {\n \n $mail_body = \"<form id='sheet_confirmation_from' method='post' action='$actionUrl'><table>\";\n $i = 1;\n foreach($assessment as $data) { \n\n $mail_body .= '<tr><td><span><b>'.$i.\". \".$data['user_name'].'</b></span></td>';\n $mail_body .= '<td><input autocomplete=\"off\" id=\"reim_sheet_yes_'.$data['user_id'].'\" type=\"radio\" value=\"1\" name=\"reim_sheet_'.$data['user_id'].'\" ><label><span>Yes</span></label>';\n $mail_body .= ' <input autocomplete=\"off\" id=\"reim_sheet_no_'.$data['user_id'].'\" type=\"radio\" value=\"0\" checked=\"checked\" name=\"reim_sheet_'.$data['user_id'].'\" ><label><span>No</span></label>';\n $mail_body .= '</td></tr>';\n $i++;\n } \n if($i>1){\n $mail_body .= \"<tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr><td><input type='submit' name='confirm_sheet' value='Confirm'></td></tr>\"; \n $mail_body .= \"<input type='hidden' name='assessment_id' value='$key'>\"; \n }\n $mail_body .= \"</form>\";\n \n $body = str_replace('_form_', $mail_body, $notificationsTemplates['template_text']);\n $school_name = $data['client_name'] . \", \" . $data['city_name'] . \", \" . $data['state_name'];\n $body = str_replace('_school_', $school_name, $body);\n $body = str_replace('_sdate_', $data['sdate'], $body);\n $body = str_replace('_edate_', $data['edate'], $body);\n $body = str_replace('_name_', $toName, $body);\n //$body = str_replace('_sdate_', date('d M Y', strtotime($data['sdate'])), $body);\n //$body = str_replace('_edate_', date('d M Y', strtotime($data['edate'])), $body);\n $mail_body = nl2br( $body);\n $subject = str_replace('_school_', $school_name, $notificationsTemplates['subject']);\n $sender = $notificationsTemplates['sender'];\n $senderName = $notificationsTemplates['sender_name'];\n $ccEmail = $notificationsTemplates['cc'];\n \n $ccName = '';\n //sendEmail($sender, $senderName, $toEmail, $toName, $ccEmail, $ccName, $subject, $mail_body, '')\n if (sendEmail($sender, $senderName, $toEmail, $toName, $ccEmail, $ccName, $subject, $mail_body, '')) {\n //echo \"yes\";\n foreach($assessment as $data){\n $sql = \"UPDATE h_user_review_reim_sheet_status SET first_mail_status = :mail_status,mail_sent_date = :mail_sent_date\n WHERE user_id = :user_id AND assessment_id = :assessment_id\";\n $stmt1 = $conn->prepare($sql);\n $status = 1;\n\n $date = date(\"Y-m-d h:i:s\");\n $stmt1->bindParam(':mail_status', $status, $conn::PARAM_INT);\n $stmt1->bindParam(':mail_sent_date', $date, $conn::PARAM_INT);\n $stmt1->bindParam(':user_id', $data['user_id'], $conn::PARAM_INT);\n $stmt1->bindParam(':assessment_id', $data['assessment_id'], $conn::PARAM_INT);\n $stmt1->execute();\n }\n // echo $stmt1->fullQuery; \n }\n //echo $mail_body;die;\n }\n \n \n }\n \n \n \n \n \n //$link = \"<a href=\" . SITEURL . 'index.php?controller=diagnostic&action=feedbackForm&assessment_id=' . $data['assessment_id'] . '&user_id=' . $data['user_id'] . '&des=received_feedback' . \">here</a>\";\n \n\n } catch (PDOException $e) {\n echo \"Error: \" . $e->getMessage();\n }\n $conn = null;\n }", "public function index()\n\t{\n\t\t//\n\t\tif (Auth::user()->type==4 || Auth::user()->type==3) {\n\t\t\t# code...\n\t\t\treturn redirect()->back(); \n\t\t}\n\t\t//dd($this->getTodayAppointments());\n\t\t$todays = $this->getTodayAppointments(); \n\t\t$upcomings = $this->getUpcomingAppointments(); \n\t\t$availables = $this->getAvailableBookings(); \n\t\t//dd($availables);\n\t\treturn view('appointments.addAppointment',compact('todays','upcomings','availables'));\n\t}", "public function getIndex()\n\t{\n\t\t\n\t\t//Get the user id of the currently logged in user\n $userId = Sentry::getUser()->id;\n //Current Date\n\t\t$day = date(\"Y-m-d\");\n //Get tasks list for the user\n\t\t$tasks = $this->timesheet->getIndex($userId);\n //Get the entries\n\t\t$entries = $this->timesheet->getEntries($day,$userId);\n //Current Week\n\t\t$week = $this->timesheet->getWeek($day);\n\t\treturn \\View::make('dashboard.timesheet.view')\n\t\t\t\t\t\t->with('week',$week)\n\t\t\t\t\t\t->with('selectedDate',$day)\n\t\t\t\t\t\t->with('entries', $entries)\n\t\t\t\t\t\t->with('tasks',$tasks);\n\t}", "function calender()\r\n\t{\r\n\t\t$this->erpm->auth();\r\n\t\t$user = $this->auth_pnh_employee();\r\n\t\t\r\n\t\t$role_id=$this->get_jobrolebyuid($user['userid']);\r\n\t\tif($role_id<=3)\r\n\t\t{\r\n\t\t$role_id = $this->get_emproleidbyuid($user['userid']);\r\n\t\t$emp_id = $this->get_empidbyuid($user['userid']);\r\n\t\t$sub_emp_ids=$this->get_subordinates($this,$role_id,$emp_id);\r\n\t\t$territory_list=$this->load_territoriesbyemp_id($emp_id,$role_id);\r\n\t\t$t_sub_emp_ids = $sub_emp_ids;\r\n\t\t$get_locationbyempid = $this->assigned_location($emp_id);\r\n\t\t\r\n\t\tarray_push($t_sub_emp_ids,$emp_id);\r\n\t \t$terry_id = $this->input->post('view_byterry');\r\n\t\t$emp_sub_list = array();\r\n\t\t$sql=\"SELECT a.employee_id,a.employee_id AS id,IFNULL(b.parent_emp_id ,0) AS parent,a.name as employee_name, a.name\r\n\t\t\t\tFROM m_employee_info a\r\n\t\t\t\tLEFT JOIN m_employee_rolelink b ON b.employee_id=a.employee_id and b.is_active = 1 \r\n\t\t\t\tWHERE a.is_suspended=0 and a.employee_id IN (\".implode(',',$t_sub_emp_ids).\")\r\n\t\t\t\";\r\n\t\t\t\t\r\n $res=$this->db->query($sql);\r\n\t\tif($res->num_rows())\r\n\t\t{\r\n\t\t\t$emp_sub_list=$res->result_array();\r\n\t\t}\r\n\t\t\r\n\t\t$task_list=$this->db->query('SELECT task,asgnd_town_id,assigned_to,b.town_name,c.name,a.on_date \r\n\t\t\t\t\t\t\t\t\t\t\tFROM pnh_m_task_info a\r\n\t\t\t\t\t\t\t\t\t\t\tJOIN pnh_towns b ON b.id=a.asgnd_town_id\r\n\t\t\t\t\t\t\t\t\t\t\tJOIN m_employee_info c ON c.employee_id=a.assigned_to\r\n\t\t\t\t\t\t\t\t\t\t\twhere a.assigned_to = ? and c.is_suspended=0',$emp_id)->result_array();\r\n\t\t$this->load->plugin('yentree_pi');//plugin to create employeeTree \r\n\t\t$emp_sub_list[0]['parent']=0;\r\n\t\t$data['emp_tree_config']=build_yentree($emp_sub_list);\r\n\t\t\r\n\t\tunset($emp_sub_list[0]);\r\n\t\t$emp_sub_list = array_values($emp_sub_list);\r\n\t\t\r\n\t\t$data['emp_sub_list']=$emp_sub_list;\r\n\t\t$data['get_locationbyempid']=$get_locationbyempid;\r\n\t\t$data['territory_list']=$territory_list;\r\n\t\t$data['task_list']=$task_list;\r\n\t\t$data['page']=\"calender\";\r\n\t\t$this->load->view(\"admin\",$data);\r\n\t\t\r\n\t\t}\r\n\t\telse \r\n\t\t\tshow_error(\"Access Denied\");\r\n\t}", "function waitingApproval($type=1, $pg=1, $limit=25) \t{\n\t\t$this->getMenu();\n\t\t$form = array();\n\t\tif($type==1) {\n\t\t\t$this->session->unset_userdata('client_no');\n\t\t\t$this->session->unset_userdata('client_name');\n\t\t\t$this->session->unset_userdata('project_no');\n\t\t}\n\t\telseif($type==2) {\n\t\t\t$this->session->unset_userdata('client_no');\n\t\t\t$this->session->unset_userdata('client_name');\n\t\t\t$this->session->unset_userdata('project_no');\n\t\t\t\n\t\t\tif($this->input->post('client_no')) \t\t$form['client_no'] = $this->input->post('client_no');\n\t\t\tif($this->input->post('client_name'))\t\t$form['client_name'] = $this->input->post('client_name');\n\t\t\tif($this->input->post('project_no'))\t\t$form['project_no'] = $this->input->post('project_no');\n\t\t\t$this->session->set_userdata($form);\n\t\t}\n\t\t\n\t\tif($this->session->userdata('client_no')) \t$form['client_no'] = $this->session->userdata('client_no');\n\t\tif($this->session->userdata('client_name')) $form['client_name'] = $this->session->userdata('client_name');\n\t\tif($this->session->userdata('project_no')) \t$form['project_no']\t = $this->session->userdata('project_no');\n\t\t\n\t\tif($limit) {\n\t\t\t$this->session->set_userdata('rpp', $limit);\n\t\t\t$this->rpp = $limit;\n\t\t}\n\t\t$limit\t\t= $limit ? $limit : $this->rpp;\n\t\t$this->data['request'] \t= $this->timesheetModel->getTimesheetRequest();\n\t\n\t\t$this->load->view('timesheet_waitingApproval',$this->data);\n\t\n\t}", "public function changeWeek(Request $request,$next_date){\n\n $start_date=Carbon::parse($next_date)->addDay(1);\n $date = Carbon::parse($next_date)->addDay(1);\n\n \n $end_date=Carbon::parse($start_date)->addDay(7);\n $this_week= $week_number = $end_date->weekOfYear;\n \n $period = CarbonPeriod::create($start_date, $end_date);\n \n\n $dates=[];\n foreach ($period as $date){\n $dates[] = $date->format('Y-m-d');\n \n }\n \n if (ApiBaseMethod::checkUrl($request->fullUrl())) {\n $user_id = $id;\n } else {\n $user = Auth::user();\n\n if ($user) {\n $user_id = $user->id;\n } else {\n $user_id = $request->user_id;\n }\n }\n\n $student_detail = SmStudent::where('user_id', $user_id)->first();\n //return $student_detail;\n $class_id = $student_detail->class_id;\n $section_id = $student_detail->section_id;\n\n $sm_weekends = SmWeekend::orderBy('order', 'ASC')->where('active_status', 1)->where('school_id',Auth::user()->school_id)->get();\n\n $class_times = SmClassTime::where('type', 'class')->where('academic_id', getAcademicId())->where('school_id',Auth::user()->school_id)->get();\n\n if (ApiBaseMethod::checkUrl($request->fullUrl())) {\n $data = [];\n $data['student_detail'] = $student_detail->toArray();\n $weekenD = SmWeekend::all();\n foreach ($weekenD as $row) {\n $data[$row->name] = DB::table('sm_class_routine_updates')\n ->select('sm_class_times.period', 'sm_class_times.start_time', 'sm_class_times.end_time', 'sm_subjects.subject_name', 'sm_class_rooms.room_no')\n ->join('sm_classes', 'sm_classes.id', '=', 'sm_class_routine_updates.class_id')\n ->join('sm_sections', 'sm_sections.id', '=', 'sm_class_routine_updates.section_id')\n ->join('sm_class_times', 'sm_class_times.id', '=', 'sm_class_routine_updates.class_period_id')\n ->join('sm_subjects', 'sm_subjects.id', '=', 'sm_class_routine_updates.subject_id')\n ->join('sm_class_rooms', 'sm_class_rooms.id', '=', 'sm_class_routine_updates.room_id')\n\n ->where([\n ['sm_class_routine_updates.class_id', $class_id], ['sm_class_routine_updates.section_id', $section_id], ['sm_class_routine_updates.day', $row->id],\n ])->where('sm_class_routine_updates.academic_id', getAcademicId())->where('sm_classesschool_id',Auth::user()->school_id)->get();\n }\n\n return ApiBaseMethod::sendResponse($data, null);\n }\n\n return view('lesson::student.student_lesson_plan', compact('dates','this_week','class_times', 'class_id', 'section_id', 'sm_weekends'));\n \n }", "function civicrm_api3_zoomevent_generatezoomattendance($params) {\n\t$allAttendees = [];\n\t$days = $params['days'];\n\t$pastDateTimeFull = new DateTime();\n\t$pastDateTimeFull = $pastDateTimeFull->modify(\"-\".$days.\" days\");\n\t$pastDate = $pastDateTimeFull->format('Y-m-d');\n\t$currentDate = date('Y-m-d');\n\n $apiResult = civicrm_api3('Event', 'get', [\n 'sequential' => 1,\n 'end_date' => ['BETWEEN' => [$pastDate, $currentDate]],\n ]);\n\t$allEvents = $apiResult['values'];\n\t$eventIds = [];\n\tforeach ($allEvents as $key => $value) {\n\t\t$eventIds[] = $value['id'];\n\t}\n\tforeach ($eventIds as $eventId) {\n\t\tCRM_Core_Error::debug_var('eventId', $eventId);\n\t\t$list = CRM_CivirulesActions_Participant_AddToZoom::getZoomAttendeeOrAbsenteesList($eventId);\n\t\tif(empty($list)){\n\t\t\tCRM_Core_Error::debug_var('No participants found in the zoom for the event Id: ', $eventId);\n\t\t\tcontinue;\n\t\t}\n\t\t$webinarId = getWebinarID($eventId);\n\t\t$meetingId = getMeetingID($eventId);\n\t\tif(!empty($webinarId)){\n\t\t\t$attendees = selectAttendees($list, $eventId, \"Webinar\");\n\t\t}elseif(!empty($meetingId)){\n\t\t\t$attendees = selectAttendees($list, $eventId, \"Meeting\");\n\t\t}\n\t\tupdateAttendeesStatus($attendees, $eventId);\n\t\t$allAttendees[$eventId] = $attendees;\n\t}\n\t$return['allAttendees'] = $allAttendees;\n\n\treturn civicrm_api3_create_success($return, $params, 'Event');\n}", "public function week()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$disable = array(\n\t\t\t'categories',\n\t\t\t'category_fields',\n\t\t\t'custom_fields',\n\t\t\t'member_data',\n\t\t\t'pagination',\n\t\t\t'trackbacks'\n\t\t);\n\n\t\t$params = array(\n\t\t\tarray(\n\t\t\t\t'name' => 'category',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'site_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'min_value' => 1,\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'default' => $this->data->get_site_id()\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'calendar_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'calendar_name',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'event_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'event_name',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'event_limit',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'status',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'default' => 'open'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'date_range_start',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'date'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'time_range_start',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'time',\n\t\t\t\t'default' => '0000'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'time_range_end',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'time',\n\t\t\t\t'default' => '2400'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'enable',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'default' => '',\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'allowed_values' => $disable\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'first_day_of_week',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'default' => $this->first_day_of_week\n\t\t\t)\n\t\t);\n\n\t\t//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t// -------------------------------------\n\t\t// Need to modify the starting date?\n\t\t// -------------------------------------\n\n\t\t$this->first_day_of_week = $this->P->value('first_day_of_week');\n\n\t\tif ($this->P->value('date_range_start') === FALSE)\n\t\t{\n\t\t\t$this->P->set('date_range_start', $this->CDT->datetime_array());\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->CDT->change_date(\n\t\t\t\t$this->P->value('date_range_start', 'year'),\n\t\t\t\t$this->P->value('date_range_start', 'month'),\n\t\t\t\t$this->P->value('date_range_start', 'day')\n\t\t\t);\n\t\t}\n\n\t\t$drs_dow = $this->P->value('date_range_start', 'day_of_week');\n\n\t\tif ($drs_dow != $this->first_day_of_week)\n\t\t{\n\t\t\tif ($drs_dow > $this->first_day_of_week)\n\t\t\t{\n\t\t\t\t$offset = ($drs_dow - $this->first_day_of_week);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$offset = (7 - ($this->first_day_of_week - $drs_dow));\n\t\t\t}\n\n\t\t\t$this->P->set('date_range_start', $this->CDT->add_day(-$offset));\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Define parameters specific to this calendar view\n\t\t// -------------------------------------\n\n\t\t$this->CDT->change_ymd($this->P->value('date_range_start', 'ymd'));\n\t\t$this->P->set('date_range_end', $this->CDT->add_day(6));\n\t\t$this->P->set('pad_short_weeks', FALSE);\n\n\t\t// -------------------------------------\n\t\t// Define our tagdata\n\t\t// -------------------------------------\n\n\t\t$find = array(\n\t\t\t'EVENTS_PLACEHOLDER',\n\t\t\t'{/',\n\t\t\t'{',\n\t\t\t'}'\n\t\t);\n\n\t\t$replace = array(\n\t\t\tee()->TMPL->tagdata,\n\t\t\tLD.T_SLASH,\n\t\t\tLD,\n\t\t\tRD\n\t\t);\n\n\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t$find,\n\t\t\t$replace,\n\t\t\t$this->view(\n\t\t\t\t'week.html',\n\t\t\t\tarray(),\n\t\t\t\tTRUE,\n\t\t\t\t$this->sc->addon_theme_path . 'templates/week.html'\n\t\t\t)\n\t\t);\n\n\t\t// -------------------------------------\n\t\t// Tell TMPL what we're up to\n\t\t// -------------------------------------\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'events'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['events'] = TRUE;\n\t\t}\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'display_each_hour'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['display_each_hour'] = TRUE;\n\t\t}\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'display_each_day'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['display_each_day'] = TRUE;\n\t\t}\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'display_each_week'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['display_each_week'] = TRUE;\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// If you build it, they will know what's going on.\n\t\t// -------------------------------------\n\n\t\t$this->parent_method = __FUNCTION__;\n\n\t\treturn $this->build_calendar();\n\t}", "public function index()\n {\n $attendanceSettings = AttendanceSetting::first();\n $openDays = json_decode($attendanceSettings->office_open_days);\n $this->startDate = Carbon::today()->timezone($this->global->timezone)->startOfMonth();\n $this->endDate = Carbon::today()->timezone($this->global->timezone);\n $this->employees = User::allEmployees();\n $this->userId = User::first()->id;\n\n $this->totalWorkingDays = $this->startDate->diffInDaysFiltered(function(Carbon $date) use ($openDays){\n foreach($openDays as $day){\n if($date->dayOfWeek == $day){\n return $date;\n }\n }\n }, $this->endDate);\n $this->daysPresent = Attendance::countDaysPresentByUser($this->startDate, $this->endDate, $this->userId);\n $this->daysLate = Attendance::countDaysLateByUser($this->startDate, $this->endDate, $this->userId);\n $this->halfDays = Attendance::countHalfDaysByUser($this->startDate, $this->endDate, $this->userId);\n return view('admin.attendance.index', $this->data);\n }", "public function show_report_service()\n { \n $this->load->model(\"swm/frontend/M_swm_attend\", \"msa\");\n $rs_service_data = $this->msa->get_time_us_attend(getNowDate(),getNowDate());//startDate, endDate, startAge, endAge, state\n $data['rs_service_data'] = $rs_service_data->result();\n $this->output(\"swm/frontend/v_report_service\", $data, true);\n }", "public function reportTotalClassHeldSummaryView(Request $request)\n {\n $from_date = trim($request->from); \n $from = date (\"Y-m-d\", strtotime($from_date));\n $explode = explode('-',$from);\n $from_year = $explode[0];\n $get_current_day = date(\"l\",strtotime($from));\n $current_year = date('Y');\n if($get_current_day =='Saturday'){\n $current_day = 1 ;\n }\n if($get_current_day =='Sunday'){\n $current_day = 2 ;\n }\n if($get_current_day =='Monday'){\n $current_day = 3 ;\n }\n if($get_current_day =='Tuesday'){\n $current_day = 4 ;\n }\n if($get_current_day =='Wednesday'){\n $current_day = 5 ;\n }\n if($get_current_day =='Thursday'){\n $current_day = 6 ;\n }\n if($get_current_day =='Friday'){\n $current_day = 7 ;\n }\n if($from > $this->rcdate1){\n echo 'f1';\n exit();\n }\n // get door holiday\n $holiday_count = DB::table('holiday')->where('holiday_date',$from)->count();\n if($holiday_count > 0){\n echo 'f2';\n exit();\n }\n if($from_year != $current_year){\n echo 'f3';\n exit();\n }\n // get all shift\n $result = DB::table('shift')->get();\n return view('view_report.reportTotalClassHeldSummaryView')->with('result',$result)->with('get_current_day',$get_current_day)->with('from',$from)->with('current_day',$current_day)->with('from_year',$from_year);\n }", "public function index() {\n //\n $currentDate = \\Helpers\\DateHelper::getLocalUserDate(date('Y-m-d H:i:s')); \n $day = \\Helpers\\DateHelper::getDay($currentDate);\n $weekDays = \\Helpers\\DateHelper::getWeekDays($currentDate, $day); \n $workouts = \\App\\Schedule::getScheduledWorkouts($weekDays);\n \n return view('user/schedule', ['number_of_day' => $day, 'current_date' => $currentDate, 'weekDays' => $weekDays])\n ->with('target_areas', json_decode($this->target_areas, true))\n ->with('movements', json_decode($this->movements, true))\n ->with('workouts', $workouts);\n }", "public function changeWeek($next_date)\n{\n try {\n $start_date=Carbon::parse($next_date)->addDay(1);\n $date = Carbon::parse($next_date)->addDay(1);\n\n\n $end_date=Carbon::parse($start_date)->addDay(7);\n $this_week= $week_number = $end_date->weekOfYear;\n\n $period = CarbonPeriod::create($start_date, $end_date);\n\n\n $dates=[];\n foreach ($period as $date){\n $dates[] = $date->format('Y-m-d');\n\n }\n\n $login_id = Auth::user()->id;\n $teachers = SmStaff::where('active_status', 1)->where('user_id',$login_id)->where('role_id', 4)->where('school_id', Auth::user()->school_id)->first();\n\n $user = Auth::user();\n $class_times = SmClassTime::where('academic_id', getAcademicId())->where('school_id', Auth::user()->school_id)->orderBy('period', 'ASC')->get();\n $teacher_id =$teachers->id;\n $sm_weekends = SmWeekend::where('school_id', Auth::user()->school_id)->orderBy('order', 'ASC')->where('active_status', 1)->get();\n\n $data = [];\n $data['message'] = 'operation Successful';\n return ApiBaseMethod::sendResponse($data, null);\n\n } catch (Exception $e) {\n return ApiBaseMethod::sendError('operation Failed');\n }\n\n}", "public function index()\n {\n if (Auth::user()) {\n if (!Usersubmissionstatus::checkQuarterSubmission()) {\n $employee = ['id' => Auth::user()->id];\n if (Usersubmissionstatus::checkDraftSubmission()) {\n $employee['quarter_id'] = Quarter::getRunningQuarter()->id;\n $employee['submission_status_id'] = config('constant.status.SUBMISSION_DRAFT');\n return view('evaluation-already-submitted', ['draft' => TRUE, 'employee' => $employee]);\n }\n\n return view('evaluation', ['data' => Department::getDetails(), 'employee_id' => $employee['id']]);\n }\n else {\n return view('evaluation-already-submitted', ['draft' => FALSE]);\n }\n } \n else {\n return redirect()->guest('login'); \n }\n }", "function admin_getCalculations($userId,$appointmentTime){\n pr($this->request->data); exit;\n }", "function ical() {\n \t$filter = ProjectUsers::getVisibleTypesFilter($this->logged_user, array(PROJECT_STATUS_ACTIVE), get_completable_project_object_types());\n if($filter) {\n $objects = ProjectObjects::find(array(\n \t\t 'conditions' => array($filter . ' AND completed_on IS NULL AND state >= ? AND visibility >= ?', STATE_VISIBLE, $this->logged_user->getVisibility()),\n \t\t 'order' => 'priority DESC',\n \t\t));\n\n \t\trender_icalendar(lang('Global Calendar'), $objects, true);\n \t\tdie();\n } elseif($this->request->get('subscribe')) {\n \tflash_error(lang('You are not able to download .ics file because you are not participating in any of the active projects at the moment'));\n \t$this->redirectTo('ical_subscribe');\n } else {\n \t$this->httpError(HTTP_ERR_NOT_FOUND);\n } // if\n }", "function alltimeAction() {\n\t\t$this->getModel()->setPage($this->getPageFromRequest());\n\n\t\t$oView = new userView($this);\n\t\t$oView->showAlltimeLeaderboard();\n\t}", "public function add(Request $req, $account)\n {\n $currentDate = (new Datetime())->format('Y-m-d');\n \n $schedule = Schedule::whereDate('start_date','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->get();\n //Add timesheet\n $timesheet = new Timesheet();\n $timesheet->start_time = date('Y-m-d H:i:s', strtotime($req->start_time));\n $timesheet->end_time = date(\"Y-m-d H:i:s\", strtotime($req->start_time) + $req->seconds);\n $timesheet->member_id = Auth::user()->id;\n $timesheet->activity = 'in';\n $timesheet->status = 'approved';\n\n $schedule_hours = 0;\n if(count($schedule)){\n $timesheet->schedule_id = $schedule[0]->id;\n //Update attendance on schedule-to investigate follow $schedule_hours\n $schedule_date1 = new Datetime($schedule[0]->start_date.' '.$schedule[0]->start_time.':00:00');\n $schedule_date2 = new Datetime($schedule[0]->end_date.' '.$schedule[0]->end_time.':00:00');\n $schedule_diff = $schedule_date1->diff($schedule_date2);\n $schedule_hours = $schedule_hours + (($schedule_diff->h * 60) + $schedule_diff->i);\n\n }\n $timesheet->save();\n $timesheets = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->get();\n //Get total time worked\n $hours = 0;\n foreach ($timesheets as $timesheet) {\n $date1 = new Datetime($timesheet->start_time);\n $date2 = new Datetime($timesheet->end_time);\n $diff = $date2->diff($date1);\n\n $hours = $hours + (($diff->h * 60) + $diff->i);\n }\n if(count($schedule)){\n $schedule_updated = Schedule::find($schedule[0]->id);\n\n //More than 30 min still to finish\n if($schedule_hours-$hours > 30 && $schedule_hours != 0){\n $schedule_updated->attendance = 'working';\n }elseif ($schedule_hours-$hours <= 30 || $schedule_hours-$hours <= 0) {\n $schedule_updated->attendance = 'attended';\n }//Less than 5 min to finish\n //late\n $first_timesheet = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->first();\n $date1 = new Datetime($schedule_updated->start_date.' '.$schedule_updated->start_time.':00:00');\n $date2 = new Datetime($first_timesheet->start_time);\n $diff = $date2->diff($date1);\n $late = (($diff->h * 60) + $diff->i);\n // dd($late);\n if($late > 10){\n $schedule_updated->attendance = 'late';\n }\n //\n $schedule_updated->save();\n }\n //Get total breaks\n $breaks = 0;\n $first_timesheet = Timesheet::whereDate('start_time','=',$currentDate)->first();\n $last_timesheet = Timesheet::whereDate('start_time','=',$currentDate)->latest()->first();\n if($first_timesheet){\n $date1 = new Datetime($first_timesheet->start_time);\n $date2 = new Datetime($last_timesheet->end_time);\n $diff = $date2->diff($date1);\n $breaks = (($diff->h * 60) + $diff->i) - $hours;\n }\n\n $worked = $this->hoursandmins($hours);\n $breaks = $this->hoursandmins($breaks);\n // First Punch In in current day\n $first_punch_in = Timesheet::whereDate('start_time','=',$currentDate)->first();\n\n // return view('attendance/index', ['timesheets'=>$timesheets, 'schedule'=>$schedule, 'first_punch_in'=>$first_punch_in, 'worked'=>$worked, 'breaks'=>$breaks, 'first_timesheet'=>$first_timesheet, 'last_timesheet'=>$last_timesheet]);\n\n \t$activities = view('attendance/ajax/activities', ['timesheets'=>$timesheets])->render();\n $statistics = view('attendance/ajax/statistics', ['schedule'=>$schedule, 'worked'=>$worked])->render();\n\n \treturn response()->json(['activities'=>$activities, 'statistics'=>$statistics]);\n\n }", "public function timesheetAction(Employee $admin)\n {\n\t\t$validateForm = $this->createValidateForm($admin->getEmployee());\n\t\t$this->setActivity($admin->getEmployee()->getName().\" \".$admin->getEmployee()->getFirstname().\" timesheets are consulted\");\n $em = $this->getDoctrine()->getManager();\n $aTimesheets = $em->getRepository('BoAdminBundle:Timesheet')->getTsByEmployee($admin->getEmployee(),2);\n return $this->render('BoAdminBundle:Admin:timesheet.html.twig', array(\n 'employee' => $admin->getEmployee(),\n\t\t\t'validate_form' => $validateForm->createView(),\n\t\t\t'timesheets'=>$aTimesheets,\n\t\t\t'pm'=>\"personnel\",\n\t\t\t'sm'=>\"admin\",\n ));\n }", "public function getIndex()\n {\n \t$dateRange = Carbon::now();\n \n\n //Get past Last Month = 4 Week Lag\n $endIniLag = $dateRange->copy()->subWeek(4);\n $dateNow = Carbon::now();\n\n //Get past Last Month = 5 Week Lag\n $endPastLag = $dateRange->copy()->subWeek(5);\n $iniPastLag = $dateRange->copy()->subWeek(1);\n\n \t //Get past Last week = Week 1\n $endIniWeek1 = $dateNow;\n $IniWeek1 = $dateRange->copy()->subWeek(4);\n\n //Get past 2 week = Week 2\n $endIniWeek2 = $dateRange->copy()->subWeek(1);\n $IniWeek2 = $dateRange->copy()->subWeek(5);\n\n //Get past 3 week = Week 3\n $endIniWeek3 = $dateRange->copy()->subWeek(2);\n $IniWeek3 = $dateRange->copy()->subWeek(6);\n\n //Get past 4 week = Week 4\n $endIniWeek4 = $dateRange->copy()->subWeek(3);\n $IniWeek4 = $dateRange->copy()->subWeek(7);\n\n $user_id=Auth::user()->id;\n\n \n //Count variables\n $countEmployee=0;\n $countPortfolio=0;\n $countEvaluation=0;\n\n $job_portfolio=array();\n $job_site=array();\n $manager_id=0;\n $manager_list=array();\n \n \n //Square Feet\n $sumSquareFeet=0; \n\n\n $job_list_str=\"\";\n $job_list_array=array();\n $comment_list=array();\n\n \t\t\t\t\t\t\n //Get user role\n $role_user=Auth::user()->getRole();\n\n $total_expense_lag=0;\n $total_bill_lag=0;\n $total_labor_tax_lag=0;\n $total_budget_monthly_lag=0;\n\n $total_expense_lag_past=0;\n $total_bill_lag_past=0;\n $total_labor_tax_lag_past=0;\n $total_budget_monthly_lag_past=0;\n\n $total_expense_week1=1;\n $total_labor_tax_week1=0;\n $total_budget_monthly_week1=0;\n\n $total_expense_week2=0;\n $total_labor_tax_week2=0;\n $total_budget_monthly_week2=0;\n\n $total_expense_week3=0;\n $total_labor_tax_week3=0;\n $total_budget_monthly_week3=0;\n\n $total_expense_week4=0;\n $total_labor_tax_week4=0;\n $total_budget_monthly_week4=0;\n\n $total_budget_monthly=0;\n\n $total_evaluation=0;\n $total_evaluation_no=0;\n $total_evaluation_user=0;\n\n $total_evaluation_past=0;\n $total_evaluation_no_past=0;\n\n $total_evaluation_param=array(\n 'param1' => 0,\n 'param2' => 0,\n 'param3' => 0,\n 'param4' => 0,\n 'param5' => 0,\n );\n\n $total_supplies=array(\n 'expense' => 0,\n 'budget_monthly' => 0,\n );\n\n $total_supplies_past=array(\n 'expense' => 0,\n 'budget_monthly' => 0,\n );\n\n $total_salies_wages_amount=array(\n 'expense' => 0,\n 'labor_tax' => 0,\n );\n\n $total_salies_wages_amount_past=array(\n 'expense' => 0,\n 'labor_tax' => 0,\n );\n\n $total_hours=array(\n 'used' => 0,\n 'budget' => 0,\n );\n\n $total_hours_past=array(\n 'used' => 0,\n 'budget' => 0,\n );\n\n \n if($role_user==Config::get('roles.AREA_MANAGER')){\n \n $manager_id=Auth::user()->getManagerId();\n\n //List of porfolio\n $job_portfolio = DB::table('job')\n ->where('manager', $manager_id)\n ->where('is_parent', 0)\n ->get();\n\n\n //List Site \n $job_site = DB::table('job')\n ->where('manager', $manager_id)\n ->where('is_parent', 1)\n ->get();\n\n //Count Employee \n $countEmployee = User::CountManagerEmployee($manager_id);\n\n //Count Portfolio\n $countPortfolio = Job::CountPortfolio($manager_id);\n\n\n //4 Week Lag - Ini\n $jobList = DB::table('expense')\n ->select(DB::raw('DISTINCT(expense.job_number) as \"job_number\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '>', $endIniLag->format('Y-m-d'))\n ->where('posting_date', '<=', $dateNow->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get(); \n\n foreach ($jobList as $value) {\n $job_list_array[]=$value->job_number; \n } \n\n $job_list_str=implode(\",\", $job_list_array); \n\n\n $sumSquareFeetQuery = DB::table('job')\n ->select(DB::raw('SUM(square_feet) as \"total_feet\"'))\n ->whereIn('job_number', $job_list_array)\n ->get();\n\n foreach ($sumSquareFeetQuery as $value) {\n $sumSquareFeet=$value->total_feet; \n }\n\n\n $query_expense_lag = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '>', $endIniLag->format('Y-m-d'))\n ->where('posting_date', '<=', $dateNow->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_expense_lag as $value) {\n $total_expense_lag=$value->total_amount; \n }\n\n $query_bill_lag = DB::table('billable_hours')\n ->select(DB::raw('SUM((regular_hours+overtime_hours)*pay_rate*1.19) as \"total_amount\"'))\n ->join('job', 'billable_hours.job_number', '=', 'job.job_number')\n ->where('work_date', '>', $endIniWeek3->format('Y-m-d'))\n ->where('work_date', '<=', $dateNow->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->get();\n\n foreach ($query_bill_lag as $value) {\n $total_bill_lag=$value->total_amount; \n }\n\n $query_labor_tax_lag = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('date', '>', $endIniLag->format('Y-m-d'))\n ->where('date', '<=', $dateNow->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_lag as $value) {\n $total_labor_tax_lag=$value->total_amount; \n }\n\n $query_budget_monthly_lag = DB::table('budget_monthly')\n ->select(DB::raw('SUM(((monthly_budget*12)/52)*4) as \"total_amount\"'))\n ->join('account', 'budget_monthly.account_number', '=', 'account.account_number')\n ->join('job', 'budget_monthly.job_number', '=', 'job.job_number')\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_budget_monthly_lag as $value) {\n $total_budget_monthly_lag=$value->total_amount; \n }\n\n //4 Week Lag - End\n\n //4 Week Lag Past - Ini\n\n $query_expense_lag_past= DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '>', $endPastLag->format('Y-m-d'))\n ->where('posting_date', '<=', $iniPastLag->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_expense_lag_past as $value) {\n $total_expense_lag_past=$value->total_amount; \n }\n\n $query_bill_lag_past = DB::table('billable_hours')\n ->select(DB::raw('SUM((regular_hours+overtime_hours)*pay_rate*1.19) as \"total_amount\"'))\n ->join('job', 'billable_hours.job_number', '=', 'job.job_number')\n ->where('work_date', '>', $endIniWeek3->format('Y-m-d'))\n ->where('work_date', '<=', $iniPastLag->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->get();\n\n foreach ($query_bill_lag_past as $value) {\n $total_bill_lag_past=$value->total_amount; \n }\n\n\n $query_labor_tax_lag_past = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('date', '>', $endPastLag->format('Y-m-d'))\n ->where('date', '<=', $iniPastLag->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_lag_past as $value) {\n $total_labor_tax_lag_past=$value->total_amount; \n if($total_labor_tax_lag_past==0 || $total_labor_tax_lag_past==null)\n $total_labor_tax_lag_past=0; \n }\n\n $query_budget_monthly_lag_past = DB::table('budget_monthly')\n ->select(DB::raw('SUM(((monthly_budget*12)/52)*4) as \"total_amount\"'))\n ->join('account', 'budget_monthly.account_number', '=', 'account.account_number')\n ->join('job', 'budget_monthly.job_number', '=', 'job.job_number')\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_budget_monthly_lag_past as $value) {\n $total_budget_monthly_lag_past=$value->total_amount; \n if($total_budget_monthly_lag_past==0 || $total_budget_monthly_lag_past==null)\n $total_budget_monthly_lag_past=0; \n }\n\n //4 Week Past Lag - End \n\n\n // Monthly budget calculation \n $query_budget_monthly = DB::table('budget_monthly')\n ->select(DB::raw('SUM(((monthly_budget*12)/52)*4) as \"total_amount\"'))\n ->join('account', 'budget_monthly.account_number', '=', 'account.account_number')\n ->join('job', 'budget_monthly.job_number', '=', 'job.job_number')\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_budget_monthly as $value) {\n $total_budget_monthly=$value->total_amount; \n }\n\n\n //Last Week = Week 1 - Ini\n $total_expense_week1=$total_expense_lag; \n if($total_expense_week1==0 || $total_expense_week1==null)\n $total_expense_week1=0;\n \n $total_labor_tax_week1=$total_labor_tax_lag; \n if($total_labor_tax_week1==0 || $total_labor_tax_week1==null)\n $total_labor_tax_week1=0;\n \n\n //Last Week = Week 1 - End\n\n //Week 2 - Ini\n\n $total_expense_week2=$total_expense_lag_past; \n if($total_expense_week2==0 || $total_expense_week2==null)\n $total_expense_week2=0; \n \n $total_labor_tax_week2=$total_labor_tax_lag_past; \n if($total_labor_tax_week2==0 || $total_labor_tax_week2==null)\n $total_labor_tax_week2=0; \n \n //Week 2 - End\n\n //Week 3 - Ini \n $query_expense_week3 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '>', $IniWeek3->format('Y-m-d'))\n ->where('posting_date', '<=', $endIniWeek3->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_expense_week3 as $value) {\n $total_expense_week3=$value->total_amount; \n if($total_expense_week3==0 || $total_expense_week3==null)\n $total_expense_week3=0; \n } \n\n $query_labor_tax_week3 = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('labor_tax.date', '>', $IniWeek3->format('Y-m-d'))\n ->where('labor_tax.date', '<=', $endIniWeek3->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_week3 as $value) {\n $total_labor_tax_week3=$value->total_amount; \n if($total_labor_tax_week3==0 || $total_labor_tax_week3==null)\n $total_labor_tax_week3=0; \n }\n\n //Week 3 - End\n\n //Week 4 - Ini \n $query_expense_week4 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '>', $IniWeek4->format('Y-m-d'))\n ->where('posting_date', '<=', $endIniWeek4->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_expense_week4 as $value) {\n $total_expense_week4=$value->total_amount; \n if($total_expense_week4==0 || $total_expense_week4==null)\n $total_expense_week4=0; \n } \n\n $query_labor_tax_week4 = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('labor_tax.date', '>', $IniWeek4->format('Y-m-d'))\n ->where('labor_tax.date', '<=', $endIniWeek4->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_week4 as $value) {\n $total_labor_tax_week4=$value->total_amount; \n if($total_labor_tax_week4==0 || $total_labor_tax_week4==null)\n $total_labor_tax_week4=0; \n }\n\n //Week 4 - End\n\n\n //Last Week = Supplies(Account Number=4090) Week 1 & 2 - Ini\n // Monthly budget calculation Supplies \n $query_budget_monthly = DB::table('budget_monthly')\n ->select(DB::raw('SUM(((monthly_budget*12)/52)*4) as \"total_amount\"'))\n ->join('account', 'budget_monthly.account_number', '=', 'account.account_number')\n ->join('job', 'budget_monthly.job_number', '=', 'job.job_number')\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->where('budget_monthly.account_number', 4090)\n ->get();\n\n foreach ($query_budget_monthly as $value) {\n $total_supplies['budget_monthly']=$value->total_amount; \n }\n\n $query_expense_week1 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '>', $IniWeek1->format('Y-m-d'))\n ->where('posting_date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->where('expense.account_number', 4090)\n ->get();\n\n foreach ($query_expense_week1 as $value) {\n $total_supplies['expense']=$value->total_amount; \n if($total_supplies['expense']==0 || $total_supplies['expense']==null)\n $total_supplies['expense']=0;\n }\n\n\n $query_expense_week2 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '>', $IniWeek2->format('Y-m-d'))\n ->where('posting_date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->where('expense.account_number', 4090)\n ->get();\n\n foreach ($query_expense_week2 as $value) {\n $total_supplies_past['expense']=$value->total_amount; \n if($total_supplies_past['expense']==0 || $total_supplies_past['expense']==null)\n $total_supplies_past['expense']=0;\n }\n\n\n //Last Week = Week 1 & 2 Supplies - End \n\n\n //Last Week = Labor & Tax(Account Number=4000, 4275, 4278, 4277, 4280, 4276 ) Week 1 & 2 - Ini\n // Monthly budget calculation Supplies \n $query_labor_tax_week1 = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('labor_tax.date', '>', $IniWeek1->format('Y-m-d'))\n ->where('labor_tax.date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_week1 as $value) {\n $total_salies_wages_amount['labor_tax']=$value->total_amount; \n if($total_salies_wages_amount['labor_tax']==0 || $total_salies_wages_amount['labor_tax']==null)\n $total_salies_wages_amount['labor_tax']=0;\n }\n\n $query_expense_week1 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek1->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->whereIn('expense.account_number', [4000, 4001, 4003, 4004, 4005, 4007, 4010, 4011, 4020, 4275, 4276, 4277, 4278, 4279, 4280])\n ->get();\n\n foreach ($query_expense_week1 as $value) {\n $total_salies_wages_amount['expense']=$value->total_amount; \n if($total_salies_wages_amount['expense']==0 || $total_salies_wages_amount['expense']==null)\n $total_salies_wages_amount['expense']=0;\n }\n\n $query_labor_tax_week2 = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('labor_tax.date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('labor_tax.date', '>', $IniWeek2->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_week2 as $value) {\n $total_salies_wages_amount_past['labor_tax']=$value->total_amount; \n if($total_salies_wages_amount_past['labor_tax']==0 || $total_salies_wages_amount_past['labor_tax']==null)\n $total_salies_wages_amount_past['labor_tax']=0;\n }\n\n\n $query_expense_week2 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek2->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->whereIn('expense.account_number', [4000, 4001, 4003, 4004, 4005, 4007, 4010, 4011, 4020, 4275, 4276, 4277, 4278, 4279, 4280])\n ->get();\n\n foreach ($query_expense_week2 as $value) {\n $total_salies_wages_amount_past['expense']=$value->total_amount; \n if($total_salies_wages_amount_past['expense']==0 || $total_salies_wages_amount_past['expense']==null)\n $total_salies_wages_amount_past['expense']=0;\n }\n\n\n //Last Week = Week 1 & 2 Supplies - End \n\n\n //Last Week = Budget - Billable Hours - Ini\n $query_hours = DB::table('billable_hours')\n ->select(DB::raw('SUM(regular_hours) as \"total_amount\"'))\n ->join('job', 'billable_hours.job_number', '=', 'job.job_number')\n ->where('work_date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('work_date', '>', $IniWeek1->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->get();\n\n foreach ($query_hours as $value) {\n $total_hours['used']=$value->total_amount; \n }\n\n $query_hours = DB::table('budget')\n ->select(DB::raw('SUM(hours) as \"total_amount\"'))\n ->join('job', 'budget.job_number', '=', 'job.job_number')\n ->where('date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('date', '>', $IniWeek1->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->get();\n\n foreach ($query_hours as $value) {\n $total_hours['budget']=$value->total_amount; \n }\n\n //Last Week = Budget - Billable Hours - End \n\n //Past Week = Budget - Billable Hours - Ini\n $query_hours = DB::table('billable_hours')\n ->select(DB::raw('SUM(regular_hours) as \"total_amount\"'))\n ->join('job', 'billable_hours.job_number', '=', 'job.job_number')\n ->where('work_date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('work_date', '>', $IniWeek2->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->get();\n\n foreach ($query_hours as $value) {\n $total_hours_past['used']=$value->total_amount; \n }\n\n $query_hours = DB::table('budget')\n ->select(DB::raw('SUM(hours) as \"total_amount\"'))\n ->join('job', 'budget.job_number', '=', 'job.job_number')\n ->where('date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('date', '>', $IniWeek2->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->get();\n\n foreach ($query_hours as $value) {\n $total_hours_past['budget']=$value->total_amount; \n }\n\n //Past Week = Budget - Billable Hours - End \n \n\n \n /*Evaluation functions - INI*/\n $query_evaluation = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1)+SUM(parameter2)+SUM(parameter3)+SUM(parameter4)+SUM(parameter5) as \"total_amount\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation as $value) {\n $total_evaluation=$value->total_amount; \n }\n\n $query_evaluation = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1) as \"param1\", SUM(parameter2) as \"param2\", SUM(parameter3) as \"param3\", SUM(parameter4) as \"param4\",SUM(parameter5) as \"param5\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation as $value) {\n $total_evaluation_param['param1']=$value->param1;\n $total_evaluation_param['param2']=$value->param2;\n $total_evaluation_param['param3']=$value->param3; \n $total_evaluation_param['param4']=$value->param4;\n $total_evaluation_param['param5']=$value->param5;\n\n }\n\n $query_evaluation_past = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1)+SUM(parameter2)+SUM(parameter3)+SUM(parameter4)+SUM(parameter5) as \"total_amount\"'))\n ->where('created_at', '>', $endPastLag)\n ->where('created_at', '<=', $iniPastLag)\n ->where('evaluate_user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation_past as $value) {\n $total_evaluation_past=$value->total_amount; \n }\n\n\n //Number of evaluations\n $total_evaluation_no = DB::table('evaluation')\n ->select(DB::raw('id'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', Auth::user()->id)\n ->count();\n\n //Number of evaluations Past\n $total_evaluation_no_past = DB::table('evaluation')\n ->select(DB::raw('id'))\n ->where('created_at', '>', $endPastLag)\n ->where('created_at', '<=', $iniPastLag)\n ->where('evaluate_user_id', Auth::user()->id)\n ->count();\n\n //Number of users evaluated \n $query_evaluation_user = DB::table('evaluation')\n ->select(DB::raw('COUNT(DISTINCT(evaluate_user_id)) as \"total\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation_user as $value) {\n $total_evaluation_user=$value->total; \n }\n\n\n /*Evaluation Functions - END*/\n\n }elseif($role_user==Config::get('roles.DIR_POS')){\n $manager_list = DB::table('users')\n -> where('manager_id', '!=', 0)\n -> where('active', 1)\n -> orderBy('manager_id', 'asc')\n -> get();\n\n $manager_list_array = array();\n\n foreach ($manager_list as $manager) {\n $manager_list_array[]=$manager->manager_id;\n }\n\n //Add Corporate and None Managers - 90 Corporate - 91 None\n $manager_list_array[]=90;\n $manager_list_array[]=91;\n\n\n //List of porfolio\n $job_portfolio = DB::table('job')\n ->whereIn('manager', $manager_list_array)\n ->where('is_parent', 0)\n ->get();\n\n\n //List Site \n $job_site = DB::table('job')\n ->whereIn('manager', $manager_list_array)\n ->where('is_parent', 1)\n ->get();\n\n //Count Managers Employee \n $countEmployee = User::CountManagerListEmployee($manager_list_array);\n\n //Count Same role\n $countEmployeeRole = User::CountRoleListEmployee(Config::get('roles.DIR_POS'), Auth::user()->id);\n\n //Count Managers\n $countManager = User::CountManagerList();\n\n $countEvaluation= $countEmployeeRole+ $countManager;\n\n\n //Count Portfolio\n $countPortfolio = Job::CountPortfolioList($manager_list_array);\n\n\n //4 Week Lag - Ini\n $jobList = DB::table('expense')\n ->select(DB::raw('DISTINCT(expense.job_number) as \"job_number\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '>', $endIniLag->format('Y-m-d'))\n ->where('posting_date', '<=', $dateNow->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get(); \n\n foreach ($jobList as $value) {\n $job_list_array[]=$value->job_number; \n } \n\n $job_list_str=implode(\",\", $job_list_array); \n\n\n $sumSquareFeetQuery = DB::table('job')\n ->select(DB::raw('SUM(square_feet) as \"total_feet\"'))\n ->whereIn('job_number', $job_list_array)\n ->get();\n\n foreach ($sumSquareFeetQuery as $value) {\n $sumSquareFeet=$value->total_feet; \n }\n\n\n $query_expense_lag = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '>', $endIniLag->format('Y-m-d'))\n ->where('posting_date', '<=', $dateNow->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_expense_lag as $value) {\n $total_expense_lag=$value->total_amount; \n }\n\n $query_bill_lag = DB::table('billable_hours')\n ->select(DB::raw('SUM((regular_hours+overtime_hours)*pay_rate*1.19) as \"total_amount\"'))\n ->join('job', 'billable_hours.job_number', '=', 'job.job_number')\n ->where('work_date', '>', $endIniWeek3->format('Y-m-d'))\n ->where('work_date', '<=', $dateNow->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->get();\n\n foreach ($query_bill_lag as $value) {\n $total_bill_lag=$value->total_amount; \n }\n\n\n $query_labor_tax_lag = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('date', '>', $endIniLag->format('Y-m-d'))\n ->where('date', '<=', $dateNow->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_lag as $value) {\n $total_labor_tax_lag=$value->total_amount; \n }\n\n $query_budget_monthly_lag = DB::table('budget_monthly')\n ->select(DB::raw('SUM(((monthly_budget*12)/52)*4) as \"total_amount\"'))\n ->join('account', 'budget_monthly.account_number', '=', 'account.account_number')\n ->join('job', 'budget_monthly.job_number', '=', 'job.job_number')\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_budget_monthly_lag as $value) {\n $total_budget_monthly_lag=$value->total_amount; \n }\n\n //4 Week Lag - End\n\n //4 Week Lag Past - Ini\n\n $query_expense_lag_past= DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '>', $endPastLag->format('Y-m-d'))\n ->where('posting_date', '<=', $iniPastLag->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_expense_lag_past as $value) {\n $total_expense_lag_past=$value->total_amount; \n }\n\n $query_bill_lag_past = DB::table('billable_hours')\n ->select(DB::raw('SUM((regular_hours+overtime_hours)*pay_rate*1.19) as \"total_amount\"'))\n ->join('job', 'billable_hours.job_number', '=', 'job.job_number')\n ->where('work_date', '>', $endIniWeek3->format('Y-m-d'))\n ->where('work_date', '<=', $iniPastLag->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->get();\n\n foreach ($query_bill_lag_past as $value) {\n $total_bill_lag_past=$value->total_amount; \n }\n\n\n $query_labor_tax_lag_past = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('date', '>', $endPastLag->format('Y-m-d'))\n ->where('date', '<=', $iniPastLag->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_lag_past as $value) {\n $total_labor_tax_lag_past=$value->total_amount; \n if($total_labor_tax_lag_past==0 || $total_labor_tax_lag_past==null)\n $total_labor_tax_lag_past=0; \n }\n\n $query_budget_monthly_lag_past = DB::table('budget_monthly')\n ->select(DB::raw('SUM(((monthly_budget*12)/52)*4) as \"total_amount\"'))\n ->join('account', 'budget_monthly.account_number', '=', 'account.account_number')\n ->join('job', 'budget_monthly.job_number', '=', 'job.job_number')\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_budget_monthly_lag_past as $value) {\n $total_budget_monthly_lag_past=$value->total_amount; \n if($total_budget_monthly_lag_past==0 || $total_budget_monthly_lag_past==null)\n $total_budget_monthly_lag_past=0; \n }\n\n //4 Week Past Lag - End \n\n\n // Monthly budget calculation \n $query_budget_monthly = DB::table('budget_monthly')\n ->select(DB::raw('SUM(((monthly_budget*12)/52)*4) as \"total_amount\"'))\n ->join('account', 'budget_monthly.account_number', '=', 'account.account_number')\n ->join('job', 'budget_monthly.job_number', '=', 'job.job_number')\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_budget_monthly as $value) {\n $total_budget_monthly=$value->total_amount; \n }\n\n \n //Last Week = Week 1 - Ini\n \n $total_expense_week1=$total_expense_lag; \n if($total_expense_week1==0 || $total_expense_week1==null)\n $total_expense_week1=0;\n \n $total_labor_tax_week1=$total_labor_tax_lag; \n if($total_labor_tax_week1==0 || $total_labor_tax_week1==null)\n $total_labor_tax_week1=0;\n \n //Last Week = Week 1 - End\n\n //Week 2 - Ini \n \n \n $total_expense_week2=$total_expense_lag_past; \n if($total_expense_week2==0 || $total_expense_week2==null)\n $total_expense_week2=0; \n \n $total_labor_tax_week2=$total_labor_tax_lag_past; \n if($total_labor_tax_week2==0 || $total_labor_tax_week2==null)\n $total_labor_tax_week2=0; \n \n\n //Week 2 - End\n\n //Week 3 - Ini \n $query_expense_week3 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek3->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek3->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_expense_week3 as $value) {\n $total_expense_week3=$value->total_amount; \n if($total_expense_week3==0 || $total_expense_week3==null)\n $total_expense_week3=0; \n } \n\n $query_labor_tax_week3 = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('labor_tax.date', '<=', $endIniWeek3->format('Y-m-d'))\n ->where('labor_tax.date', '>', $IniWeek3->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_week3 as $value) {\n $total_labor_tax_week3=$value->total_amount; \n if($total_labor_tax_week3==0 || $total_labor_tax_week3==null)\n $total_labor_tax_week3=0; \n }\n\n //Week 3 - End\n\n //Week 4 - Ini \n $query_expense_week4 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek4->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek4->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_expense_week4 as $value) {\n $total_expense_week4=$value->total_amount; \n if($total_expense_week4==0 || $total_expense_week4==null)\n $total_expense_week4=0; \n } \n\n $query_labor_tax_week4 = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('labor_tax.date', '<=', $endIniWeek4->format('Y-m-d'))\n ->where('labor_tax.date', '>', $IniWeek4->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_week4 as $value) {\n $total_labor_tax_week4=$value->total_amount; \n if($total_labor_tax_week4==0 || $total_labor_tax_week4==null)\n $total_labor_tax_week4=0; \n }\n\n //Week 4 - End\n\n\n //Last Week = Supplies(Account Number=4090) Week 1 & 2 - Ini\n // Monthly budget calculation Supplies \n $query_budget_monthly = DB::table('budget_monthly')\n ->select(DB::raw('SUM(((monthly_budget*12)/52)*4) as \"total_amount\"'))\n ->join('account', 'budget_monthly.account_number', '=', 'account.account_number')\n ->join('job', 'budget_monthly.job_number', '=', 'job.job_number')\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->where('budget_monthly.account_number', 4090)\n ->get();\n\n foreach ($query_budget_monthly as $value) {\n $total_supplies['budget_monthly']=$value->total_amount; \n }\n\n $query_expense_week1 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek1->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->where('expense.account_number', 4090)\n ->get();\n\n foreach ($query_expense_week1 as $value) {\n $total_supplies['expense']=$value->total_amount; \n if($total_supplies['expense']==0 || $total_supplies['expense']==null)\n $total_supplies['expense']=0;\n }\n\n\n $query_expense_week2 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek2->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->where('expense.account_number', 4090)\n ->get();\n\n foreach ($query_expense_week2 as $value) {\n $total_supplies_past['expense']=$value->total_amount; \n if($total_supplies_past['expense']==0 || $total_supplies_past['expense']==null)\n $total_supplies_past['expense']=0;\n }\n\n\n //Last Week = Week 1 & 2 Supplies - End \n\n\n //Last Week = Labor & Tax(Account Number=4000, 4275, 4278, 4277, 4280, 4276 ) Week 1 & 2 - Ini\n // Monthly budget calculation Supplies \n $query_labor_tax_week1 = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('labor_tax.date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('labor_tax.date', '>', $IniWeek1->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_week1 as $value) {\n $total_salies_wages_amount['labor_tax']=$value->total_amount; \n if($total_salies_wages_amount['labor_tax']==0 || $total_salies_wages_amount['labor_tax']==null)\n $total_salies_wages_amount['labor_tax']=0;\n }\n\n $query_expense_week1 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek1->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->whereIn('expense.account_number', [4000, 4001, 4003, 4004, 4005, 4007, 4010, 4011, 4020, 4275, 4276, 4277, 4278, 4279, 4280])\n ->get();\n\n foreach ($query_expense_week1 as $value) {\n $total_salies_wages_amount['expense']=$value->total_amount; \n if($total_salies_wages_amount['expense']==0 || $total_salies_wages_amount['expense']==null)\n $total_salies_wages_amount['expense']=0;\n }\n\n $query_labor_tax_week2 = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('labor_tax.date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('labor_tax.date', '>', $IniWeek2->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_week2 as $value) {\n $total_salies_wages_amount_past['labor_tax']=$value->total_amount; \n if($total_salies_wages_amount_past['labor_tax']==0 || $total_salies_wages_amount_past['labor_tax']==null)\n $total_salies_wages_amount_past['labor_tax']=0;\n }\n\n\n $query_expense_week2 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek2->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->whereIn('expense.account_number', [4000, 4001, 4003, 4004, 4005, 4007, 4010, 4011, 4020, 4275, 4276, 4277, 4278, 4279, 4280])\n ->get();\n\n foreach ($query_expense_week2 as $value) {\n $total_salies_wages_amount_past['expense']=$value->total_amount; \n if($total_salies_wages_amount_past['expense']==0 || $total_salies_wages_amount_past['expense']==null)\n $total_salies_wages_amount_past['expense']=0;\n }\n\n\n //Last Week = Week 1 & 2 Supplies - End \n\n\n //Last Week = Budget - Billable Hours - Ini\n $query_hours = DB::table('billable_hours')\n ->select(DB::raw('SUM(regular_hours) as \"total_amount\"'))\n ->join('job', 'billable_hours.job_number', '=', 'job.job_number')\n ->where('work_date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('work_date', '>', $IniWeek1->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->get();\n\n foreach ($query_hours as $value) {\n $total_hours['used']=$value->total_amount; \n }\n\n $query_hours = DB::table('budget')\n ->select(DB::raw('SUM(hours) as \"total_amount\"'))\n ->join('job', 'budget.job_number', '=', 'job.job_number')\n ->where('date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('date', '>', $IniWeek1->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->get();\n\n foreach ($query_hours as $value) {\n $total_hours['budget']=$value->total_amount; \n }\n\n //Last Week = Budget - Billable Hours - End \n\n //Past Week = Budget - Billable Hours - Ini\n $query_hours = DB::table('billable_hours')\n ->select(DB::raw('SUM(regular_hours) as \"total_amount\"'))\n ->join('job', 'billable_hours.job_number', '=', 'job.job_number')\n ->where('work_date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('work_date', '>', $IniWeek2->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->get();\n\n foreach ($query_hours as $value) {\n $total_hours_past['used']=$value->total_amount; \n }\n\n $query_hours = DB::table('budget')\n ->select(DB::raw('SUM(hours) as \"total_amount\"'))\n ->join('job', 'budget.job_number', '=', 'job.job_number')\n ->where('date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('date', '>', $IniWeek2->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->get();\n\n foreach ($query_hours as $value) {\n $total_hours_past['budget']=$value->total_amount; \n }\n\n //Past Week = Budget - Billable Hours - End \n\n /*Evaluation functions - INI*/\n $query_evaluation = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1)+SUM(parameter2)+SUM(parameter3)+SUM(parameter4)+SUM(parameter5) as \"total_amount\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation as $value) {\n $total_evaluation=$value->total_amount; \n }\n\n $query_evaluation = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1) as \"param1\", SUM(parameter2) as \"param2\", SUM(parameter3) as \"param3\", SUM(parameter4) as \"param4\",SUM(parameter5) as \"param5\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation as $value) {\n $total_evaluation_param['param1']=$value->param1;\n $total_evaluation_param['param2']=$value->param2;\n $total_evaluation_param['param3']=$value->param3; \n $total_evaluation_param['param4']=$value->param4;\n $total_evaluation_param['param5']=$value->param5;\n\n }\n\n $query_evaluation_past = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1)+SUM(parameter2)+SUM(parameter3)+SUM(parameter4)+SUM(parameter5) as \"total_amount\"'))\n ->where('created_at', '>', $endPastLag)\n ->where('created_at', '<=', $iniPastLag)\n ->where('evaluate_user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation_past as $value) {\n $total_evaluation_past=$value->total_amount; \n }\n\n\n //Number of evaluations\n $total_evaluation_no = DB::table('evaluation')\n ->select(DB::raw('id'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', Auth::user()->id)\n ->count();\n\n //Number of evaluations Past\n $total_evaluation_no_past = DB::table('evaluation')\n ->select(DB::raw('id'))\n ->where('created_at', '>', $endPastLag)\n ->where('created_at', '<=', $iniPastLag)\n ->where('evaluate_user_id', Auth::user()->id)\n ->count();\n\n //Number of users evaluated \n $query_evaluation_user = DB::table('evaluation')\n ->select(DB::raw('COUNT(DISTINCT(evaluate_user_id)) as \"total\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation_user as $value) {\n $total_evaluation_user=$value->total; \n }\n\n\n /*Evaluation Functions - END*/ \n\n\n }elseif($role_user==Config::get('roles.SUPERVISOR') || $role_user==Config::get('roles.AREA_SUPERVISOR')){\n\n $primary_job=Auth::user()->gePrimayJob();\n\n $job_query = DB::table('job')\n ->where('job_number', $primary_job)\n ->get();\n\n foreach ($job_query as $value) {\n $manager_id=$value->manager; \n } \n\n\n //Count Employee \n $countEmployee = User::CountManagerEmployee($manager_id);\n $countEmployee--;\n\n /*Evaluation functions - INI*/\n $query_evaluation = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1)+SUM(parameter2)+SUM(parameter3)+SUM(parameter4)+SUM(parameter5) as \"total_amount\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation as $value) {\n $total_evaluation=$value->total_amount; \n }\n\n $query_evaluation = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1) as \"param1\", SUM(parameter2) as \"param2\", SUM(parameter3) as \"param3\", SUM(parameter4) as \"param4\",SUM(parameter5) as \"param5\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation as $value) {\n $total_evaluation_param['param1']=$value->param1;\n $total_evaluation_param['param2']=$value->param2;\n $total_evaluation_param['param3']=$value->param3; \n $total_evaluation_param['param4']=$value->param4;\n $total_evaluation_param['param5']=$value->param5;\n\n }\n\n $query_evaluation_past = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1)+SUM(parameter2)+SUM(parameter3)+SUM(parameter4)+SUM(parameter5) as \"total_amount\"'))\n ->where('created_at', '>', $endPastLag)\n ->where('created_at', '<=', $iniPastLag)\n ->where('evaluate_user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation_past as $value) {\n $total_evaluation_past=$value->total_amount; \n }\n\n\n //Number of evaluations\n $total_evaluation_no = DB::table('evaluation')\n ->select(DB::raw('id'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', Auth::user()->id)\n ->count();\n\n //Number of evaluations Past\n $total_evaluation_no_past = DB::table('evaluation')\n ->select(DB::raw('id'))\n ->where('created_at', '>', $endPastLag)\n ->where('created_at', '<=', $iniPastLag)\n ->where('evaluate_user_id', Auth::user()->id)\n ->count();\n\n //Number of users evaluated \n $query_evaluation_user = DB::table('evaluation')\n ->select(DB::raw('COUNT(DISTINCT(evaluate_user_id)) as \"total\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation_user as $value) {\n $total_evaluation_user=$value->total; \n }\n\n\n /*Evaluation Functions - END*/\n }elseif($role_user==Config::get('roles.EMPLOYEE')){\n /*Evaluation functions - INI*/\n $query_evaluation = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1)+SUM(parameter2)+SUM(parameter3)+SUM(parameter4)+SUM(parameter5) as \"total_amount\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation as $value) {\n $total_evaluation=$value->total_amount; \n }\n\n $query_evaluation = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1) as \"param1\", SUM(parameter2) as \"param2\", SUM(parameter3) as \"param3\", SUM(parameter4) as \"param4\",SUM(parameter5) as \"param5\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation as $value) {\n $total_evaluation_param['param1']=$value->param1;\n $total_evaluation_param['param2']=$value->param2;\n $total_evaluation_param['param3']=$value->param3; \n $total_evaluation_param['param4']=$value->param4;\n $total_evaluation_param['param5']=$value->param5;\n\n }\n\n $query_evaluation_past = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1)+SUM(parameter2)+SUM(parameter3)+SUM(parameter4)+SUM(parameter5) as \"total_amount\"'))\n ->where('created_at', '>', $endPastLag)\n ->where('created_at', '<=', $iniPastLag)\n ->where('evaluate_user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation_past as $value) {\n $total_evaluation_past=$value->total_amount; \n }\n\n\n //Number of evaluations\n $total_evaluation_no = DB::table('evaluation')\n ->select(DB::raw('id'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', Auth::user()->id)\n ->count();\n\n //Number of evaluations Past\n $total_evaluation_no_past = DB::table('evaluation')\n ->select(DB::raw('id'))\n ->where('created_at', '>', $endPastLag)\n ->where('created_at', '<=', $iniPastLag)\n ->where('evaluate_user_id', Auth::user()->id)\n ->count();\n\n //Number of users evaluated \n $query_evaluation_user = DB::table('evaluation')\n ->select(DB::raw('COUNT(DISTINCT(evaluate_user_id)) as \"total\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation_user as $value) {\n $total_evaluation_user=$value->total; \n }\n\n\n /*Evaluation Functions - END*/ \n\n $comment_list = DB::table('evaluation')\n ->select(DB::raw('*')) \n ->where('description', '!=', '')\n ->where('evaluate_user_id', Auth::user()->id)\n ->orderBy('created_at', 'desc')\n ->paginate(100); \n }\n\n //Normalize data\n\n if($sumSquareFeet==0)\n $sumSquareFeet=1;\n \n\n //New Calculations\n $calc_val=$total_budget_monthly_lag+$total_labor_tax_lag;\n if($calc_val==0)\n $calc_val=1;\n $lag_differencial=(($total_expense_lag+$total_bill_lag)*100)/($calc_val);\n\n $budget_cant=$total_budget_monthly_lag_past+$total_labor_tax_lag_past;\n if($budget_cant==0)\n $budget_cant=1;\n $lag_differencial_past=(($total_expense_lag_past+$total_bill_lag_past)*100)/($budget_cant);\n\n\n\n $expense_calc_week1=$total_expense_week1+$total_bill_lag;\n $expense_calc_week2=$total_expense_week2+$total_bill_lag_past;\n if($expense_calc_week2==0 || $expense_calc_week2==null)\n $expense_calc_week2=1;\n \n $cost_past_week=$lag_differencial_past-$lag_differencial;\n\n $expense_week1=$total_expense_week1+$total_bill_lag;\n $expense_week2=$total_expense_week2+$total_bill_lag_past;\n $expense_week3=$total_expense_week3;\n $expense_week4=$total_expense_week4;\n\n $budget_week1=$total_budget_monthly+$total_labor_tax_week1;\n $budget_week2=$total_budget_monthly+$total_labor_tax_week2;\n $budget_week3=$total_budget_monthly+$total_labor_tax_week3;\n $budget_week4=$total_budget_monthly+$total_labor_tax_week4;\n\n\n $budget_cant=$budget_week1;\n if($budget_cant==0)\n $budget_cant=1;\n $lag_past_week=($expense_week1*100)/($budget_cant);\n\n //$cost_past_week=$total_expense_week1;\n\n\n /*Announcement list - INI*/\n switch ($role_user) {\n case '4':\n $permission_filter='1____';\n break;\n case '6':\n $permission_filter='_1___';\n break;\n case '5':\n $permission_filter='__1__';\n break;\n case '8':\n $permission_filter='___1_';\n break;\n case '9':\n $permission_filter='____1';\n break;\n default:\n $permission_filter='2____';\n break;\n }\n\n $result_announce = DB::table('announce')\n ->select(DB::raw('*'))\n ->where('status', 1)\n ->where('permission', 'like' , $permission_filter)\n ->orderBy('closing_date', 'desc')\n ->paginate(50);\n\n /*Announcement list - END*/\n\n return view('metrics.page', [\n 'user_id' => $user_id, \n 'count_employee' => $countEmployee,\n 'count_portfolio' => $countPortfolio, \n 'count_evaluation' => $countEvaluation, \n 'sum_square_feet' => $sumSquareFeet,\n 'role_user' => $role_user,\n 'manager_list' => $manager_list, \n 'job_portfolio' => $job_portfolio,\n 'job_site' => $job_site, \n 'job_list_str' => $job_list_str,\n 'job_portfolio_id' => 0,\n 'manager_id' => $manager_id,\n 'total_expense_lag' => $total_expense_lag,\n 'total_labor_tax_lag' => $total_labor_tax_lag,\n 'total_budget_monthly_lag' => $total_budget_monthly_lag,\n 'total_bill_lag' => $total_bill_lag,\n 'cost_past_week' => $cost_past_week,\n 'lag_differencial' => $lag_differencial,\n 'lag_differencial_past' => $lag_differencial_past,\n 'lag_past_week' => $lag_past_week,\n 'expense_week1' => $expense_week1,\n 'expense_week2' => $expense_week2,\n 'expense_week3' => $expense_week3,\n 'expense_week4' => $expense_week4,\n 'budget_week1' => $budget_week1,\n 'budget_week2' => $budget_week2,\n 'budget_week3' => $budget_week3,\n 'budget_week4' => $budget_week4,\n 'total_evaluation' => $total_evaluation,\n 'total_evaluation_no' => $total_evaluation_no,\n 'total_evaluation_past' => $total_evaluation_past,\n 'total_evaluation_no_past' => $total_evaluation_no_past,\n 'total_evaluation_user' => $total_evaluation_user,\n 'total_evaluation_param' => $total_evaluation_param,\n 'total_supplies' => $total_supplies,\n 'total_supplies_past' => $total_supplies_past,\n 'total_salies_wages_amount' => $total_salies_wages_amount,\n 'total_salies_wages_amount_past' => $total_salies_wages_amount_past,\n 'total_hours' => $total_hours,\n 'total_hours_past' => $total_hours_past,\n 'result_announce' => $result_announce,\n 'comment_list' => $comment_list \n ]);\n }", "public function meeting_schedule(){\n\t\tif($this->session->userdata('logged_in')==\"\")\n\t\t\theader(\"Location: \".$this->config->base_url().\"Login\");\n\t\t$this->cache_update();\n\t\t$this->load->model('Crud_model');\n\t\t$this->check_privilege(17);\n\t\t$this->load->driver('cache',array('adapter' => 'file'));\n\t\t$this->load->model('profile_model');\n\t\t$da = $this->profile_model->get_profile_info($this->session->userdata('uid'));\n\t\t//$this->load->view('dashboard/navbar');\n\t\t$u_type = array('var'=>$this->cache->get('Active_status'.$this->session->userdata('loginid'))['user_type_id_fk']);\n\t\t$noti = array('meeting'=>$this->profile_model->meeting_notification());\n\t\t$noti = array('meeting'=>$this->profile_model->meeting_notification());\n\t\t$u_type['notification'] = $noti;\n\t\t$u_type['noti1']=$this->profile_model->custom_notification();\n\t\t$this->load->view('dashboard/navbar',$u_type);\n\t\t$this->load->view('dashboard/sidebar',$da);\n $this->load->model('Admin_model');\n\t\t$row = $this->Admin_model->previous_meeting_schedule();\n\t\tif($row){\n \t$data=array(\n 'start_time'=> mdate('%Y-%M-%d %H:%i',strtotime('+2 hours', strtotime( $row->start_time ))),\n 'end_time'=> mdate('%Y-%M-%d %H:%i',strtotime('-2 hours', strtotime( $row->end_time ))),\n\t\t\t);\n\t\t}else{\n\t\t\t$data=array('start_time'=>'No Previous Meeting','end_time'=>'No Previous Meeting');\n\t\t}\n\t\t$this->load->view('schedule',$data);\n\t\t$this->db->trans_off();\n\t $this->db->trans_strict(FALSE);\n\t $this->db->trans_start();\n $this->Crud_model->audit_upload($this->session->userdata('loginid'),\n current_url(),\n 'Meeting Schedule Page visited',\n 'Custom Message here');\n $this->db->trans_complete();\n\t\t$this->load->view('dashboard/footer');\n\t}", "public function index()\n {\n $user = $this->getUser();\n $from = $this->request->getStringParam('from', date('Y-m-d'));\n $to = $this->request->getStringParam('to', date('Y-m-d', strtotime('next week')));\n $timetable = $this->timetable->calculate($user['id'], new DateTime($from), new DateTime($to));\n\n $this->response->html($this->helper->layout->user('timetable:timetable/index', array(\n 'user' => $user,\n 'timetable' => $timetable,\n 'values' => array(\n 'from' => $from,\n 'to' => $to,\n 'plugin' => 'timetable',\n 'controller' => 'timetable',\n 'action' => 'index',\n 'user_id' => $user['id'],\n ),\n )));\n }", "public function showNonStandardAction()\r\n {\r\n\t\t$startDate = $_POST['startDate'];\r\n\t\t$endDate = $_POST['endDate'];\r\n\t\t\r\n\t\t$period = 'od '.$startDate.' do '.$endDate.'';\r\n\t\t\r\n\t\tstatic::show($startDate, $endDate, $period);\r\n }", "public function showMainRequestForm() {\r\n $this->config->showPrinterFriendly = true;\r\n echo '<h2>Complete additional fields</h2>';\r\n echo 'Starting Date: ';\r\n displayDateSelect('useDate', 'date_1', $this->useDate, true, true);\r\n if(!$this->isEditing){\r\n echo ' Through date (optional): ';\r\n displayDateSelect('endDate', 'date_2', $this->endDate);\r\n } else{\r\n echo '<input type=\"hidden\" name=\"endDate\" value=\"\" />';\r\n }\r\n echo '<br/><br/>';\r\n echo 'Start time: ';\r\n showTimeSelector(\"begTime\", $this->begTime1, $this->begTime2);\r\n if ($this->subTypeInfo['LIMIT_8_12'] == '1' || $this->typeID == '2') {\r\n //Limit is enabled or Type is Personal\r\n if (!empty($this->shiftHours)) {\r\n if ($this->shiftHourRadio == \"8\" || $this->shiftHours == \"8\") {\r\n echo \" How long is your shift? <input type='radio' name='shiftHour' value='8' CHECKED>8 Hours\";\r\n echo \"<input type='radio' name='shiftHour' value='12'>12 Hours<br/>\";\r\n } elseif ($this->shiftHourRadio == \"12\" || $this->shiftHours == \"12\") {\r\n echo \" How long is your shift? <input type='radio' name='shiftHour' value='8'>8 Hours\";\r\n echo \"<input type='radio' name='shiftHour' value='12' CHECKED>12 Hours<br/>\";\r\n } else {\r\n echo \" How long is your shift? <input type='radio' name='shiftHour' value='8'>8 Hours\";\r\n echo \"<input type='radio' name='shiftHour' value='12'>12 Hours\";\r\n echo ' <font color=\"red\">Error in shift selection! </font><br/>';\r\n }\r\n } else {\r\n echo \" How long is your shift? <input type='radio' name='shiftHour' value='8'>8 Hours\";\r\n echo \"<input type='radio' name='shiftHour' value='12'>12 Hours<br/>\";\r\n }\r\n } else {\r\n echo ' End time: ';\r\n showTimeSelector(\"endTime\", $this->endTime1, $this->endTime2);\r\n }\r\n if (!empty($this->shiftHours))\r\n echo ' Total Hours: ' . $this->shiftHours;\r\n\r\n echo '<br/><br/>';\r\n echo 'Comment: <textarea rows=\"3\" cols=\"40\" name=\"empComment\" >' . $this->empComment . '</textarea>';\r\n echo '<br/><br/>';\r\n if(!empty($this->submitDate)){\r\n echo '<font color=\"darkred\">Submitted on '. $this->submitDate .' by '.$this->auditName.'</font>';\r\n echo '<br/><br/>';\r\n }\r\n\r\n if (!$this->isEditing) {\r\n echo '<input type=\"submit\" name=\"submitBtn\" value=\"Submit for Approval\">';\r\n } else { \r\n if($this->status != \"APPROVED\"){ \r\n echo '<input type=\"hidden\" name=\"reqID\" value=\"'.$this->reqID.'\" />';\r\n echo '<input type=\"submit\" name=\"updateReqBtn\" value=\"Update Request ' . $this->reqID . '\">';\r\n }\r\n echo '<input type=\"submit\" name=\"duplicateReqBtn\" value=\"Duplicate Request\" />';\r\n }\r\n }", "public function activity($start, $end, $customer) {\n//\t\tdebug(func_get_args());die;date('Y-m-d H:i:s', $end)\n\t\t\n\t\t$start = date('Y-m-d H:i:s', $start);\n\t\t$end = date('Y-m-d H:i:s', $end);\n\t\t//note here\n if(isset($this->request->params['ext']) && $this->request->params['ext'] == 'pdf'){\n\t\t\t$this->layout = 'default';\n\t\t}\n\t\t$this->report['customer'] = $customer;\n\t\t\n\t\t$this->discoverOldestLogTime(); // sets report['startLimit']\n\t\t$this->report['firstTime'] = strtotime($start);\n\t\tif ($this->report['firstTime'] < $this->report['startLimit']) {\n\t\t\t$this->report['firstTime'] = $this->report['startLimit'];\n\t\t}\n\t\t\n\t\t$this->report['firstSnapshot'] = strtotime(date('F j, Y', $this->report['firstTime']) . ' - 1 month');\n\t\t\n\t\t$this->discoverNewestLogTime(); // sets report['endLimit']\n\t\t$this->report['finalTime'] = strtotime($end);\n\t\tif ($this->report['finalTime'] >= $this->report['endLimit']) {\n\t\t\t$this->report['finalTime'] = $this->report['endLimit'];\n\t\t\t$this->logInventoryTotals();\n\t\t}\n\t\t\n\t\t$this->report['firstYear'] = date('Y', $this->report['firstTime']);\n\t\t$this->report['firstWeek'] = date('W', $this->report['firstTime']);\n\t\t$this->report['finalYear'] = date('Y', $this->report['finalTime']);\n\t\t$this->report['finalWeek'] = date('W', $this->report['finalTime']);\n\t\t\n\t\t$this->report['finalWeekTime'] = strtotime(\"+{$this->report['finalWeek']} week 1/1/{$this->report['finalYear']}\");\n\t\t$this->report['firstWeekTime'] = strtotime(\"+{$this->report['firstWeek']} week 1/1/{$this->report['firstYear']}\");\n\t\t\n\t\t$this->report['items'] = $this->Item->Catalog->allItemsForCustomer($this->report['customer']);\n\t\tif ($this->report['items']) {\n\t\t\t$this->logsInWeekRange();\n\t\t\t$this->logEntriesInDateRange();\n\t\t\t$this->snapshotEntriesInDateRange();\n\t\t} else {\n\t\t\t$this->Session->setFlash('There are no items for this customer.');\n\t\t}\n\t\t$this->set('customers', $this->User->getPermittedCustomers($this->Auth->user('id')));\n\t\t$this->set('customerName', $this->Item->Catalog->User->discoverName($customer));\n\t\t$this->set('report', $this->report);\n\t\t$this->set(compact('start', 'end', 'customer'));\n\t\tif ($this->request->params['action'] == 'activity') {\n\t\t\t$this->render('activity');\n\t\t} else {\n\t\t\treturn;\n\t\t}\n//\t\tdebug($this->report['activityEntries']);\n//\t\tdebug($this->report);\n\t}", "public function addWorklog($timesheetId, Request $request){\n\n }", "function getCalender(Request $request){\n\n $auth_id=Auth::user()->id;\n\n if((isset($request->start) && $request->start!='') && (isset($request->end) && $request->end!='')){\n \n /*\n * start_date is getting only date like 2017-11-11 in 2017-11-11T9:15:25\n * end_date is getting only date like 2017-11-17 in 2017-11-17T12:35:35 \n */\n $start_date= str_replace(strstr($request->start, 'T') , \"\", $request->start);\n\n $end_date= str_replace(strstr($request->end, 'T') , \"\", $request->end);\n\n $array=array();\n\n /*\n * get_time is getting the record according to user logged id \n */\n $get_time=CalendarAvailability::select('start_time','end_time','reocuuring')\n ->where('user_id',$auth_id)\n ->get();\n \n /*\n * $array[] is getting all dates between two dates 2017-11-11 to 2017-11-17\n * 2017-11-11,\n * 2017-11-12,\n * 2017-11-13,\n * 2017-11-14,\n * 2017-11-15,\n * 2017-11-16,\n * 2017-11-17\n */\n for ($x=strtotime($start_date);$x<strtotime($end_date);$x+=86400){\n \n $array[]=date('Y-m-d',$x);\n\n }\n\n /*\n * $get_time[0]->reocuuring==0 the sunday,saturday schedule is not display\n * $get_time[0]->reocuuring==1 the sunday schedule is not display\n * $get_time[0]->reocuuringis not equal to 0 or 1 then schedule is display for all days means daily\n */\n if(isset($get_time[0]->reocuuring) && $get_time[0]->reocuuring=='0'){\n unset($array[0]);\n unset($array[6]);\n }elseif (isset($get_time[0]->reocuuring) && $get_time[0]->reocuuring=='1') {\n unset($array[0]);\n }\n \n /*\n * get_holiday_days is getting the holiday dates user logged id and all dates \n */\n $get_holiday_days=CalendarHoliday::select('holiday_date')\n ->where('user_id',$auth_id)\n ->whereIn('holiday_date', $array)\n ->get();\n \n /*\n * $array is gettting that dates which is not in CalenderHoliday table\n */\n for ($i=0; $i <count($get_holiday_days) ; $i++) {\n if(array_search ($get_holiday_days[$i]->holiday_date, $array)){\n $array = array_diff($array, [$get_holiday_days[$i]->holiday_date]);\n }\n \n }\n\n /*\n * $arr is getting start date with start time and end date with end time \n */\n $arr = array();\n foreach ($array as $key => $value) {\n $start=$value.'T'.$get_time[0]->start_time;\n $end=$value.'T'.$get_time[0]->end_time;\n $arr[] = array('start' =>$start ,'end' =>$end);\n }\n\n echo json_encode($arr);die;\n \n }\n \n return view('calendar.get_calender');\n }", "function retrieve_trailing_weekly_guest_list_reservation_requests(){\n\t\t$this->CI->load->model('model_users_promoters', 'users_promoters', true);\n\t\treturn $this->CI->users_promoters->retrieve_trailing_weekly_guest_list_reservation_requests($this->promoter->up_id);\n\t}", "public function index()\n\t{\n\n $n = Input::has('n') ? Input::get('n'): 1 ;\n $day = date('w');\n $member = Confide::user()->youthMember ;\n\n $week_start = date('Y-m-d', strtotime('+'.($n*7-$day+1).' days'));\n\n\n $week_end = date('Y-m-d', strtotime('+'.(6-$day+$n*7).' days'));\n $shifts = $member->shifts()->whereRaw('date <= ? and date >= ?' , array($week_end ,$week_start))->get();\n\n $tds = array();\n if($shifts->count())\n {\n foreach($shifts as $shift)\n {\n array_push($tds ,\"td.\".($shift->time).($shift->gate).($shift->date->toDateString()));\n }\n }\n if(Request::ajax())\n {\n if ($n == 0)\n {\n return Response::json(['flag' => false ,'msg' => 'Không thể đăng ký cho tuần hiện tại']);\n }\n if($n > 3)\n {\n return Response::json(['flag' => false ,'msg' => 'Không thể đăng ký cho qúa 3 tuần ']);\n\n }\n $html = View::make('shift.partial.table', array('day' => $day , 'n' => $n ) )->render();\n return Response::json(['flag' => true ,'msg' => 'success' , 'html' => $html ,'tds' =>$tds]);\n\n }\n\n return View::make('shift.index',array('day' => $day , 'n' => $n ,'tds' => $tds));\n\n// var_dump($day);\n// var_dump($week_end);\n// var_dump($week_start_0);\n// var_dump($week_start_1);\n// var_dump($test);\n\t}", "public function index() {\n $tenement_id = Auth::user()->tenement_id;\n\n //Check period user\n if(Auth::user()->confirmed == 0 || $tenement_id == '') {\n return redirect(\"/home\");\n }\n\n return View('monthlyfee.exepaymonth');\n }", "public function activities_cal($checkavailableday){\n $calendar_selected['start_date'] = $this->input->post('txtFrom');\n $calendar_selected['end_date'] = $this->input->post('txtTo');\n $calendar_selected['start_time'] = $this->input->post('txtStartTime');\n $calendar_selected['end_time'] = $this->input->post('txtEndTime');\n $day = array(\"monday\",\"tuesday\",\"wednesday\",\"thursday\",\"friday\",\"saturday\",\"sunday\");\n if($checkavailableday[0] == \"1_everyday\"){\n $calendar_selected['monday'] = 1;\n $calendar_selected['tuesday'] = 1;\n $calendar_selected['wednesday'] = 1;\n $calendar_selected['thursday'] = 1;\n $calendar_selected['friday'] = 1;\n $calendar_selected['saturday'] = 1;\n $calendar_selected['sunday'] = 1;\n }else{\n if($checkavailableday[0] != \"\" and count($checkavailableday) > 0){\n for($i = 0; $i < count($day); $i++){\n for($j = 0; $j < count($checkavailableday); $j++){\n $explode = explode(\"_\", $checkavailableday[$j]);\n if($explode[1] == $day[$i]){\n $calendar_selected[$day[$i]] = $explode[0];\n }\n }\n if(array_key_exists($day[$i], $calendar_selected) === FALSE){\n $calendar_selected[$day[$i]] = 0;\n }\n }\n }\n }\n return $calendar_selected;\n }", "function meetingAttendanceReport($args, &$request){\r\n\t\timport ('classes.meeting.form.MeetingAttendanceReportForm');\r\n\t\tparent::validate();\r\n\t\t$this->setupTemplate();\r\n\t\t$meetingAttendanceReportForm= new MeetingAttendanceReportForm($args, $request);\r\n\t\t$isSubmit = Request::getUserVar('generateMeetingAttendance') != null ? true : false;\r\n\t\t\r\n\t\tif ($isSubmit) {\r\n\t\t\t$meetingAttendanceReportForm->readInputData();\r\n\t\t\tif($meetingAttendanceReportForm->validate()){\t\r\n\t\t\t\t\t$this->generateMeetingAttendanceReport($args);\r\n\t\t\t}else{\r\n\t\t\t\tif ($meetingAttendanceReportForm->isLocaleResubmit()) {\r\n\t\t\t\t\t$meetingAttendanceReportForm->readInputData();\r\n\t\t\t\t}\r\n\t\t\t\t$meetingAttendanceReportForm->display($args);\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\t$meetingAttendanceReportForm->display($args);\r\n\t\t}\r\n\t}", "public function summaryAction()\r\n {\r\n \t$timesheetid = -1;\r\n\r\n // Okay, so if we were passed in a timesheet, it means we want to view\r\n // the data for that timesheet. However, if that timesheet is locked, \r\n // we want to make sure that the tasks being viewed are ONLY those that\r\n // are found in that locked timesheet.\r\n $timesheet = $this->byId();\r\n\r\n $start = null;\r\n $end = null;\r\n $this->view->showLinks = true;\r\n $cats = array();\r\n\r\n $users = $this->userService->getUserList();\r\n\r\n if (!$start) {\r\n\t // The start date, if not set in the parameters, will be just\r\n\t // the previous monday\r\n\t $start = $this->_getParam('start', $this->calculateDefaultStartDate());\r\n\t // $end = $this->_getParam('end', date('Y-m-d', time()));\r\n\t $end = $this->_getParam('end', date('Y-m-d 23:59:59', strtotime($start) + (6 * 86400)));\r\n }\r\n\r\n // lets normalise the end date to make sure it's of 23:59:59\r\n\t\t$end = date('Y-m-d 23:59:59', strtotime($end));\r\n\r\n $order = 'endtime desc';\r\n\r\n $this->view->taskInfo = array();\r\n\r\n $project = null;\r\n if ($this->_getParam('projectid')) {\r\n \t$project = $this->projectService->getProject($this->_getParam('projectid'));\r\n }\r\n \r\n foreach ($users as $user) {\r\n \t$this->view->taskInfo[$user->username] = $this->projectService->getTimesheetReport($user, $project, null, -1, $start, $end, $cats, $order);\r\n }\r\n \r\n $task = new Task();\r\n \r\n $this->view->categories = $task->constraints['category']->getValues();\r\n $this->view->startDate = $start;\r\n $this->view->endDate = $end;\r\n $this->view->params = $this->_getAllParams();\r\n $this->view->dayDivision = za()->getConfig('day_length', 8) / 4; // za()->getConfig('day_division', 2);\r\n $this->view->divisionTolerance = za()->getConfig('division_tolerance', 20);\r\n \r\n $this->renderView('timesheet/user-report.php');\r\n }", "public function reportTodayAttendentView(Request $request)\n {\n $shift = trim($request->shift) ;\n $dept = trim($request->dept) ;\n // get semister of \n $result = DB::table('semister')->where('status',1)->get();\n // get section of this department\n $section_name = DB::table('section')->where('dept_id',$dept)->get();\n $shift_name = DB::table('shift')->where('id',$shift)->first();\n $dept_name = DB::table('department')->where('id',$dept)->first();\n return view('report.showsTodayAttendent')->with('result',$result)->with('shift_name',$shift_name)->with('dept_name',$dept_name)->with('section_name',$section_name)->with('shift_id',$shift)->with('dept_id',$dept);\n }", "public function schedule_view()\n {\n\n\n if (Input::get('submit') && Input::get('submit') == 'search') {\n\n\n $start_date = Input::get('start_date');\n $end_date = Input::get('end_date');\n $start_time = date(\"Y-m-d H:i:s\", strtotime($start_date));\n $end_time = date(\"Y-m-d H:i:s\", strtotime($end_date));\n $submit = Input::get('submit');\n\n $type1 = '0' . '&';\n if (Input::has('start_date')) {\n $type1 .= 'start_date' . '=' . $start_date . '&';\n } else {\n $type1 .= 'start_date' . '=' . '' . '&';\n }\n\n if (Input::has('end_date')) {\n $type1 .= 'end_date' . '=' . $end_date . '&';\n } else {\n $type1 .= 'end_date' . '=' . '' . '&';\n }\n if (Input::has('submit')) {\n $type1 .= 'submit' . '=' . $submit;\n } else {\n $type1 .= 'submit' . '=';\n\n }\n Session::put('type', $type1);\n\n\n\n if (Input::has('start_date') && Input::has('end_date')) {\n\n $request = DB::table('temp_assign')\n ->join('owner', 'temp_assign.userid', '=', 'owner.id')\n ->select(DB::raw(\"temp_assign.*,owner.*,DATE_FORMAT(temp_assign.schedule_datetime,'%h:%i %p') as newtime,temp_assign.assignId as assign_id \"))\n ->where('temp_assign.schedule_datetime', '>=', $start_time)\n ->where('temp_assign.schedule_datetime', '<=', $end_time)\n ->paginate(10);\n\n goto res;\n\n }\n\n\n }\n\n\n if (Input::get('submit') && Input::get('submit') == 'Download_Report') {\n\n\n $start_date = Input::get('start_date');\n $end_date = Input::get('end_date');\n $start_time = date(\"Y-m-d H:i:s\", strtotime($start_date));\n $end_time = date(\"Y-m-d H:i:s\", strtotime($end_date));\n $submit = Input::get('submit');\n\n\n if (Input::has('start_date') && Input::has('end_date')) {\n\n $request = DB::table('temp_assign')\n ->join('owner', 'temp_assign.userid', '=', 'owner.id')\n ->select(DB::raw(\"temp_assign.*,owner.*,DATE_FORMAT(temp_assign.schedule_datetime,'%h:%i %p') as newtime,temp_assign.assignId as assign_id \"))\n ->where('temp_assign.schedule_datetime', '>=', $start_time)\n ->where('temp_assign.schedule_datetime', '<=', $end_time)\n ->get();\n\n }else{\n $request = DB::table('temp_assign')\n ->join('owner', 'temp_assign.userid', '=', 'owner.id')\n ->select(DB::raw(\"temp_assign.*,owner.*,DATE_FORMAT(temp_assign.schedule_datetime,'%h:%i %p') as newtime,temp_assign.assignId as assign_id \"))\n ->orderBy('assign_id', ' DESC')\n ->get();\n }\n\n\n $cntrr=1;\n\n\n header('Content-Type: text/csv; charset=utf-8');\n header('Content-Disposition: attachment; filename=schedule.csv');\n $handle = fopen('php://output', 'w');\n fputcsv($handle, array('S.No', 'Customer Name', 'Date', 'Time', 'Pickup'));\n\n foreach($request as $req)\n {\n fputcsv($handle, array(\n $cntrr,\n $req->first_name.' '.$req->last_name,\n date('d-m-Y', strtotime($req->schedule_datetime)),\n $req->newtime,\n $req->pickupAddress,\n ));\n\n $cntrr++;\n }\n\n\n fclose($handle);\n\n $headers = array(\n 'Content-Type' => 'text/csv',\n );\n\n\n goto end;\n }\n else{\n\n $start_date=\"\";\n $end_date=\"\";\n $submit=\"\";\n $type1 = '0' . '&';\n if (Input::has('start_date')) {\n $type1 .= 'start_date' . '=' . $start_date . '&';\n } else {\n $type1 .= 'start_date' . '=' . '' . '&';\n }\n\n if (Input::has('end_date')) {\n $type1 .= 'end_date' . '=' . $end_date . '&';\n } else {\n $type1 .= 'end_date' . '=' . '' . '&';\n }\n if (Input::has('submit')) {\n $type1 .= 'submit' . '=' . $submit;\n } else {\n $type1 .= 'submit' . '=';\n\n }\n Session::put('type', $type1);\n $request = DB::table('temp_assign')\n ->join('owner', 'temp_assign.userid', '=', 'owner.id')\n ->select(DB::raw(\"temp_assign.*,owner.*,DATE_FORMAT(temp_assign.schedule_datetime,'%h:%i %p') as newtime,temp_assign.assignId as assign_id \"))\n ->orderBy('assign_id', ' DESC')\n ->paginate(10);\n goto res;\n\n\n\n }\n\n res:\n\n if(Config::get('app.locale') == 'arb'){\n $align_format=\"right\";\n }elseif(Config::get('app.locale') == 'en'){\n $align_format=\"left\";\n }\n return View::make('dispatch.schedule')\n ->with('page', 'schedule')\n ->with('align_format',$align_format)\n ->with('request', $request);\n\n\n end:\n }", "public function indexAction()\n {\n\t\t$this->verifySessionRights();\n\t\t$em = $this->getDoctrine()->getManager();\n\t\t$employee=$this->getConnectedEmployee();\n\t\t$this->setActivity($employee->getName().\" \".$employee->getFirstname().\"'s Agenda is consulted by this user\");\n\t\t$aTimes = $this->getAgendaTime();\n\t\t$aDates = $this->getDatesOfWeek();\t\n\t\t$aDkey = array_keys($aDates);\n\t\t$aAgenda = $this->generateAgenda($employee,$aTimes,$aDates);\n\t\t$aFormatdate = $this->formatDate($aDates);\n//print_r($aAgenda);\n/*\necho $aAgenda[4]['endpm'];\necho \"<br>\".$this->getCreatingTsHour();\nif(isset($aAgenda[4]['endpm']) and $this->getCreatingTsHour()>0 and $this->getCreatingTsHour()<$aAgenda[4]['endpm']) \n\techo \"yes\";\nelse \n\techo \"No\";\nexit(0);\n*/\n \treturn $this->render('BoHomeBundle:Agenda:index.html.twig', array(\n \t\t'employee' => $employee,\n\t\t\t'agenda'=>$aAgenda,\n\t\t\t'datekeys'=>$aDkey,\n\t\t\t'dates'=>$aDates,\n\t\t\t'cth'=>$this->getCreatingTsHour(),//cth is the time when the teacher can do the timesheet \n\t\t\t'higham'=>$this->getHighEndAm($aAgenda),\n\t\t\t'formatdates'=>$aFormatdate,\n\t\t\t'ttkeys'=>array_keys($aTimes),\n\t\t\t'today'=> new \\DateTime(date(\"d-m-Y\")),\n\t\t\t'times'=>$aTimes,\n\t\t\t'pm'=>\"tabeau-bord\",\n\t\t\t'sm'=>\"agenda\",\n \t));\n }", "function AfterEdit(&$values,$where,&$oldvalues,&$keys,$inline,&$pageObject)\n{\n\n\t\tglobal $conn;\n\n$attend_id=$values['attend_id'];\n\n//select shecdule ID from timetable\n$sql_at= \"SELECT scheduleID,courseID,date,(end_time-start_time) AS hour FROM schedule_timetable WHERE id='$attend_id'\";\n$query_at=db_query($sql_at,$conn);\n$row_at=db_fetch_array($query_at);\n\n$scheduleID=$row_at['scheduleID'];\n\n//select related schedule id from schedule\n$sql_at2= \"SELECT programID,batchID,groupID FROM schedule WHERE scheduleID='$scheduleID'\";\n$query_at2=db_query($sql_at2,$conn);\n$row_at2=db_fetch_array($query_at2);\n\n$program=$row_at2['programID'];\n$batch=$row_at2['batchID'];\n$class=$row_at2['groupID'];\n\n//update program , batch, class to student_attendance table\n$date=$row_at['date'];\n$hour=$row_at['hour'];\n$course=$row_at['courseID'];\n$id=$keys['id'];\n$sql_up= \"Update student_attendance set programID ='$program', batchID='$batch',class='$class',course='$course',date='$date',hour='$hour' where id='$id'\";\n$query_up=db_exec($sql_up,$conn);\n\n//query the total hour for this module\n$sql_th= \"SELECT total_hour FROM program_course WHERE programID='$program' && CourseID=$course\";\n$query_th=db_query($sql_th,$conn);\n$row_th=db_fetch_array($query_th);\n\n$totalhour=$row_th['total_hour'];\n//the percentage wight of absentee ( $hour/$totalhour)\n$weight_absent=($hour/$totalhour*100);\n\n//query current attendance status for this student, program , module\n$studentID=$values['StudentID'];\n$sql_at3=\"SELECT Attendance FROM student_course WHERE StudentID=$studentID AND programID=$program AND CourseID=$course\";\n$query_at3=db_query($sql_at3,$conn);\n$row_at3=db_fetch_array($query_at3);\n\n$current_attendance=$row_at3['Attendance'];\n//update student_course attendance\n\n$net_attendance=$current_attendance-$weight_absent;\n\n$sql_ups= \"Update student_course SET Attendance='$net_attendance' where StudentID='$studentID' && programID='$program' && CourseID=$course\";\n$query_ups=db_exec($sql_ups,$conn);\n;\t\t\n}", "function update_week(){\n\t\t$time = array('id'=>1, 'ending_date' => date('Y-m-d'));\n\t\treturn $this->save($time);\n\t}", "public function scopeGetReportOrganisationBreakDown($query, $request){\n $is_org_stat = true;\n $from = \"\";\n $to = \"\";\n $now = \"\";\n $inc_raw = \"\";\n $stat_array = [\n 'is_org_stat' => false\n ];\n\n $is_org_stat = ( isset( $request['type'] ) && $request['type'] == 'org_stat' ) ? true : false;\n\n /* if ( isset( $request['type'] ) && $request['type'] == 'org_stat' ) {\n $is_org_stat = true;\n\n if ( ! empty( $request['from'] ) && ! empty( $request['to'] ) ) {\n $from = Carbon::parse( $request['from'] )->toDateString();\n $to = Carbon::parse( $request['to'] )->toDateString();\n\n $inc_raw = \" AND lead_escalations.created_at BETWEEN '$from 00:00:01' AND '$to 23:59:59'\";\n\n $stat_array = [\n 'from' => $from,\n 'to' => $to,\n 'where_type' => 'between',\n 'is_org_stat' => true\n ];\n\n } else if ( isset( $request['days'] ) && $request['days'] !== NULL ) {\n $days = $request['days'];\n $now = Carbon::now()->subDays( intval( $days ) )->toDateString();\n\n $inc_raw = \" AND lead_escalations.created_at >= '$now 00:00:01'\";\n\n $stat_array = [\n 'now' => $now,\n 'where_type' => 'days',\n 'is_org_stat' => true\n ];\n }\n } */\n\n $months = [ Carbon::now(), Carbon::now()->subMonths( 1 ), Carbon::now()->subMonths( 2 ), Carbon::now()->subMonths( 6 ) ];\n $months_format = [\n 'month_' . strtolower( Carbon::now()->format( 'M' ) ),\n 'month_' . strtolower( Carbon::now()->subMonths( 1 )->format( 'M' ) ),\n 'month_' . strtolower( Carbon::now()->subMonths( 2 )->format( 'M' ) ),\n 'month_' . strtolower( Carbon::now()->subMonths( 6 )->format( 'M' ) ),\n ];\n $_months = [];\n\n foreach( $months as $_index => $month ) {\n if ( $_index + 1 == 4 ) {\n\n $from = $month->firstOfMonth()->toDateString() . ' 00:00:01';\n $to = $months[0]->endOfMonth()->toDateString() . ' 23:59:59';\n\n } else {\n\n $from = $month->firstOfMonth()->toDateString() . ' 00:00:01';\n $to = $month->endOfMonth()->toDateString() . ' 23:59:59';\n\n }\n\n $new_inc_raw = \" AND lead_escalations.created_at BETWEEN '$from' AND '$to'\";\n array_push( $_months, $new_inc_raw );\n }\n\n $query\n ->leftJoin('leads', function($join) use($request){\n $join->on('lead_escalations.lead_id', '=', 'leads.id');\n })\n ->leftJoin('organisations', function($join) use($stat_array){\n $join->on('lead_escalations.organisation_id', '=', 'organisations.id')\n ->whereNull('lead_escalations.deleted_at');\n // ->where('lead_escalations.is_active', 1);\n })\n ->leftJoin('addresses', function($join){\n $join->on('organisations.address_id', '=', 'addresses.id');\n })\n ->leftJoin('users', function($join){\n $join->on('organisations.user_id', '=', 'users.id');\n })\n ->select('lead_escalations.organisation_id', 'organisations.name', 'organisations.metadata', 'organisations.priority','addresses.state', 'organisations.org_code', 'organisations.contact_number', 'users.email',\n // \\DB::raw(\"\n // (SELECT COUNT(*) FROM lead_escalations\n // WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and deleted_at IS NULL\n // GROUP BY lead_escalations.organisation_id) as lead_count\n // \"),\n \\DB::raw(\"\n (SELECT COUNT(*) FROM lead_escalations inner join\n leads on leads.id = lead_escalations.lead_id\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and leads.deleted_at IS NULL and leads.customer_type = 'Supply & Install'\n GROUP BY lead_escalations.organisation_id) as lead_count\n \"),\n \\DB::raw(\"\n (SELECT COUNT(*) FROM lead_escalations\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1\n AND lead_escalations.deleted_at IS NULL\n $_months[0]\n GROUP BY lead_escalations.organisation_id) as {$months_format[0]}\n \"),\n \\DB::raw(\"\n (SELECT COUNT(*) FROM lead_escalations\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1\n AND lead_escalations.deleted_at IS NULL\n $_months[1]\n GROUP BY lead_escalations.organisation_id) as {$months_format[1]}\n \"),\n \\DB::raw(\"\n (SELECT COUNT(*) FROM lead_escalations\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1\n AND lead_escalations.deleted_at IS NULL\n $_months[2]\n GROUP BY lead_escalations.organisation_id) as {$months_format[2]}\n \"),\n \\DB::raw(\"\n (SELECT COUNT(*) FROM lead_escalations\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1\n AND lead_escalations.deleted_at IS NULL\n $_months[3]\n GROUP BY lead_escalations.organisation_id) as month_six\n \"),\n )\n // ->selectRaw(\"\n // (SELECT COUNT(*) FROM lead_escalations\n // WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and deleted_at IS NULL\n // AND lead_escalations.escalation_level = 'Won'\n // $inc_raw\n // GROUP BY lead_escalations.organisation_id) as won_count\n // \")\n ->selectRaw(\"\n (SELECT COUNT(*) FROM lead_escalations inner join\n leads on leads.id = lead_escalations.lead_id\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and leads.deleted_at IS NULL and leads.customer_type = 'Supply & Install'\n AND lead_escalations.escalation_level = 'Won'\n $inc_raw\n GROUP BY lead_escalations.organisation_id) as won_count\n \")\n ->selectRaw(\"\n (SELECT ( SUM(IFNULL(lead_escalations.gutter_edge_meters, 0)) + SUM(IFNULL(lead_escalations.valley_meters, 0)) ) FROM lead_escalations\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1\n AND lead_escalations.escalation_level = 'Won' AND deleted_at IS NULL\n GROUP BY lead_escalations.organisation_id) as installed_meters\n \")\n // ->selectRaw(\"\n // (SELECT COUNT(*) FROM lead_escalations\n // WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and deleted_at IS NULL\n // AND lead_escalations.escalation_level = 'Lost'\n // $inc_raw\n // GROUP BY lead_escalations.organisation_id) as lost_count\n // \")\n ->selectRaw(\"\n (SELECT COUNT(*) FROM lead_escalations inner join\n leads on leads.id = lead_escalations.lead_id\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and leads.deleted_at IS NULL and leads.customer_type = 'Supply & Install'\n AND lead_escalations.escalation_level = 'Lost' AND lead_escalations.escalation_status = 'Lost'\n $inc_raw\n GROUP BY lead_escalations.organisation_id) as lost_count\n \")\n // ->selectRaw(\"\n // (SELECT COUNT(*) FROM lead_escalations\n // WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and deleted_at IS NULL\n // AND lead_escalations.escalation_level NOT IN ('Lost', 'Won')\n // $inc_raw\n // GROUP BY lead_escalations.organisation_id) as unallocated_count\n // \")\n ->selectRaw(\"\n (SELECT COUNT(*) FROM lead_escalations inner join\n leads on leads.id = lead_escalations.lead_id\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and leads.deleted_at IS NULL and leads.customer_type = 'Supply & Install'\n AND lead_escalations.escalation_level NOT IN ('Lost', 'Won')\n $inc_raw\n GROUP BY lead_escalations.organisation_id) as unallocated_count\n \")\n ->selectRaw(\"\n CASE\n WHEN lead_escalations.escalation_level = 'Won' THEN 'Won'\n WHEN lead_escalations.escalation_level = 'Lost' THEN 'Lost'\n ELSE 'Unresolved'\n END AS status\n \")\n ->selectRaw(\"\n CONCAT(FORMAT(((count(organisations.id)\n /\n (SELECT COUNT(*) FROM lead_escalations\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and deleted_at IS NULL\n GROUP BY lead_escalations.organisation_id) * 100)),2),'%') as percent\n \")\n ->selectRaw(\"\n CONCAT(FORMAT(((SELECT COUNT(*) FROM lead_escalations\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and deleted_at IS NULL\n AND lead_escalations.escalation_level = 'Won'\n $inc_raw\n GROUP BY lead_escalations.organisation_id) /\n (SELECT COUNT(*) FROM lead_escalations\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and deleted_at IS NULL\n GROUP BY lead_escalations.organisation_id)*100),2),'%') as percent_won\n\n \")\n ->selectRaw(\"\n CONCAT(FORMAT(((SELECT COUNT(*) FROM lead_escalations\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and deleted_at IS NULL\n AND lead_escalations.escalation_level = 'Lost'\n $inc_raw\n GROUP BY lead_escalations.organisation_id) /\n (SELECT COUNT(*) FROM lead_escalations\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and deleted_at IS NULL\n GROUP BY lead_escalations.organisation_id)*100),2),'%') as percent_lost\n\n \")\n ->selectRaw(\"\n CONCAT(FORMAT(((SELECT COUNT(*) FROM lead_escalations\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and deleted_at IS NULL\n AND lead_escalations.escalation_level NOT IN ('Lost', 'Won')\n $inc_raw\n GROUP BY lead_escalations.organisation_id) /\n (SELECT COUNT(*) FROM lead_escalations\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and deleted_at IS NULL\n GROUP BY lead_escalations.organisation_id)*100),2),'%') as percent_unallocated\n\n \")\n ->selectRaw(\"\n (SELECT ( SUM(IFNULL(lead_escalations.gutter_edge_meters, 0)) + SUM(IFNULL(lead_escalations.valley_meters, 0)) ) FROM lead_escalations\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and deleted_at IS NULL\n AND lead_escalations.escalation_level = 'Won'\n GROUP BY lead_escalations.organisation_id) as installed_metersff\n \")\n ->whereIn('addresses.state', ['ACT', 'NSW', 'NT', 'QLD', 'SA', 'TAS', 'VIC', 'WA', ''])\n //->orWhereNull('addresses.state')\n ->where(function($q) use($request, $is_org_stat){\n\n if ( ! $is_org_stat ) {\n $q->where('is_active', 1);\n if (isset($request['state'])) {\n $state = $request['state'];\n //if all state dont query address state\n if ($request['state'] != 'All States') {\n $q->where('addresses.state', $state);\n }\n }\n\n if (isset($request['keyword'])) {\n $q->orWhere('name', 'like', '%' . $request['keyword'] . '%');\n $q->orWhere('addresses.state', 'like', '%' . $request['keyword'] . '%');\n }\n\n //query date between from and to\n if (isset($request['from']) && isset($request['to'])) {\n $from = date('Y-m-d', strtotime($request['from']));\n $to = date('Y-m-d', strtotime($request['to']));\n\n $q->whereBetween(\\DB::raw('DATE_FORMAT(lead_escalations.created_at, \"%Y-%m-%d\")'), [$from, $to]);\n }\n //query date by from to greater\n else if (isset($request['from'])) {\n $from = date('Y-m-d', strtotime($request['from']));\n $q->where(\\DB::raw('DATE_FORMAT(lead_escalations.created_at, \"%Y-%m-%d\")'), '>=', $from);\n }\n //query date by to less than\n else if (isset($request['to'])) {\n $to = date('Y-m-d', strtotime($request['to']));\n $q->where(\\DB::raw('DATE_FORMAT(lead_escalations.created_at, \"%Y-%m-%d\")'), '<=', $to);\n }\n\n } else {\n $q->whereIn( 'organisations.id', $request['ids'] );\n }\n })\n ->whereNotNull('name')\n // ->where('lead_escalations.is_active', 1)\n ->groupBy('status')\n ->groupBy('organisations.id')\n ->orderBy('organisations.name', 'asc');\n\n return $query;\n }", "function bookking_user_outline($course, $user, $mod, $bookking) {\n\n $bookking = bookking_instance::load_by_coursemodule_id($mod->id);\n $upcoming = count($bookking->get_upcoming_slots_for_student($user->id));\n $attended = count($bookking->get_attended_slots_for_student($user->id));\n\n $text = '';\n\n if ($attended + $upcoming > 0) {\n $a = array('attended' => $attended, 'upcoming' => $upcoming);\n $text .= get_string('outlineappointments', 'bookking', $a);\n }\n\n if ($bookking->uses_grades()) {\n $grade = $bookking->get_gradebook_info($user->id);\n if ($grade) {\n $text .= get_string('outlinegrade', 'bookking', $grade->str_long_grade);\n }\n }\n\n $return = new stdClass();\n $return->info = $text;\n return $return;\n}", "public function ga_provider_schedule_update()\n {\n $error = array('success' => false, 'message' => '<div class=\"ga_alert ga_alert_danger\">' . ga_get_translated_data('error') . '</div>');\n\n if (!is_user_logged_in_a_provider()) {\n wp_send_json_error($error);\n wp_die();\n }\n\n // Data\n $posted = isset($_POST) ? $_POST : array();\n\n // Provider Post ID\n $provider_id = get_logged_in_provider_id();\n\n // Policies options\n $policies = get_option('ga_appointments_policies');\n\n // Provider own calendar schedule\n $calendar = get_post_meta($provider_id, 'ga_provider_calendar', true);\n\n // Provider manages its schedule on the front-end\n $manage = isset($policies['provider_manages_schedule']) && in_array($policies['provider_manages_schedule'], array('yes', 'no')) ? $policies['provider_manages_schedule'] : 'yes';\n\n if (isset($posted['action']) && $posted['action'] == 'ga_provider_schedule_update' && $calendar == 'on' && $manage == 'yes') {\n if (!class_exists('ga_work_schedule')) {\n require_once(ga_base_path . '/admin/includes/ga_work_schedule.php');\n }\n $schedule = new ga_work_schedule($provider_id);\n $work_schedule = isset($_POST['ga_provider_work_schedule']) ? $_POST['ga_provider_work_schedule'] : array();\n $breaks = isset($_POST['ga_provider_breaks']) ? $_POST['ga_provider_breaks'] : array();\n $holidays = isset($_POST['ga_provider_holidays']) ? $_POST['ga_provider_holidays'] : array();\n\n update_post_meta($provider_id, 'ga_provider_work_schedule', $schedule->validate_work_schedule($work_schedule));\n update_post_meta($provider_id, 'ga_provider_breaks', $schedule->validate_breaks($breaks));\n update_post_meta($provider_id, 'ga_provider_holidays', $schedule->validate_holidays($holidays));\n\n $success = array('success' => true, 'html' => ga_provider_schedule_form($provider_id), 'message' => '<div class=\"ga_alert ga_alert_success\">' . ga_get_translated_data('schedule_updated') . '</div>');\n wp_send_json_success($success);\n wp_die();\n } else {\n wp_send_json_error($error);\n wp_die();\n }\n }", "function userGoals($fullname, $permissions, $mysqli) {\n$curDate = date (\"Y-m-d\");\n$curMonth = date('m');\n$curYear = date('Y');\n$beginWeek = date(\"Y-m-d\", strtotime('last sunday'));\n$endWeek = date(\"Y-m-d\", strtotime('this friday'));\n$monthBegin = $curYear . '-' . $curMonth . '-01';\n$monthEnd = $curYear . '-' . $curMonth . '-31';\n// Declaring default value for the time counters.\n$userMonth = 0;\n$userWeek = 0;\n$userDay = 0;\n// Switch case changing the role depending on permissions value.\nswitch ($permissions) {\n\tcase 'Domain':\n\t\t$role = 'DateBought';\n\t\t$user = 'BoughtBy';\n\t\tbreak;\n\tcase 'Content':\n\t\t$role = 'ContentFinished';\n\t\t$user = 'Writer';\n\t\tbreak;\n\tcase 'Writer':\n\t\t$role = 'ContentFinished';\n\t\t$user = 'Writer';\n\t\tbreak;\t\t\n\tcase 'Designer':\n\t\t$role = 'DesignFinish';\n\t\t$user = 'Designer';\n\t\tbreak;\n\tcase 'Support':\n\t\t$role = 'CloneFinished';\n\t\t$user = 'Cloner';\n\t\tbreak;\n\tcase 'Admin':\n\t\t$role = 'DevFinish';\n\t\t$user = 'Developer';\n\t\tbreak;\n\tcase 'QA':\n\t\t$role = 'DateComplete';\n\t\t$user = 'QAInspector';\n\t\tbreak;\n}\n\n$query = \"SELECT * FROM DomainDetails WHERE $role='$curDate' AND $user='$fullname'\";\n$results = mysqli_query($mysqli, $query);\n$rows = mysqli_num_rows($results);\n/////////////~~~~~~~~\nfor ($a = 0; $a < $rows; $a++){\n\tmysqli_data_seek($results, $a);\n\t$domain_data = mysqli_fetch_assoc($results);\n// Setting results as incrementers. If there is a day found then it adds to day, week, & month.\n\t\t$userDay++;\n\t}\n\n$query = \"SELECT * FROM DomainDetails WHERE $role BETWEEN '$beginWeek' AND '$endWeek' AND $user='$fullname'\";\n$results = mysqli_query($mysqli, $query);\n$rows = mysqli_num_rows($results);\n/////////////~~~~~~~~\nfor ($a = 0; $a < $rows; $a++){\n\tmysqli_data_seek($results, $a);\n\t$domain_data = mysqli_fetch_assoc($results);\n// Adds to the week as well as month.\n\t\t$userWeek++;\n\t}\n\n$query = \"SELECT * FROM DomainDetails WHERE $role BETWEEN '$monthBegin' AND '$monthEnd' AND $user='$fullname'\";\n$results = mysqli_query($mysqli, $query);\n$rows = mysqli_num_rows($results);\n/////////////~~~~~~~~\nfor ($a = 0; $a < $rows; $a++){\n\tmysqli_data_seek($results, $a);\n\t$domain_data = mysqli_fetch_assoc($results);\n// Adds to only the month.\n\t\t$userMonth++;\n\t}\n\nreturn array($userDay, $userWeek, $userMonth);\n}", "public function action_list_approval_department_menu(){\n $param = \\Input::param();\n $export_date = isset($param['export_date'])?date('Y-m-d', strtotime($param['export_date'])):date('Y-m-d');\n\n $objPHPExcel = new \\PHPExcel();\n $objPHPExcel->getProperties()->setCreator('Vision')\n ->setLastModifiedBy('Vision')\n ->setTitle('Office 2007 Document')\n ->setSubject('Office 2007 Document')\n ->setDescription('Document has been generated by PHP')\n ->setKeywords('Office 2007 openxml php')\n ->setCategory('Route File');\n\n $header = ['事業本部コード','事業本部','事業部コード','事業部','部門コード','部門','様式', '適用開始日', '適用終了日',\n '第1 承認者','第1 承認者の権限',\n '第2 承認者','第2 承認者の権限','第3 承認者','第3 承認者の権限',\n '第4 承認者','第4 承認者の権限','第5 承認者','第5 承認者の権限',\n '第6 承認者','第6 承認者の権限','第7 承認者','第7 承認者の権限',\n '第8 承認者','第8 承認者の権限','第9 承認者','第9 承認者の権限',\n '第10 承認者','第10 承認者の権限','第11 承認者','第11 承認者の権限',\n '第12 承認者','第12 承認者の権限','第13 承認者','第13 承認者の権限',\n '第14 承認者','第14 承認者の権限','第15 承認者','第15 承認者の権限',\n ];\n $last_column = null;\n foreach($header as $i=>$v){\n $column = \\PHPExcel_Cell::stringFromColumnIndex($i);\n $objPHPExcel->setActiveSheetIndex(0)->setCellValue($column.'1',$v);\n $objPHPExcel->getActiveSheet()->getStyle($column.'1')\n ->applyFromArray([\n 'font' => [\n 'name' => 'Times New Roman',\n 'bold' => true,\n 'italic' => false,\n 'size' => 10,\n 'color' => ['rgb'=> \\PHPExcel_Style_Color::COLOR_WHITE]\n ],\n 'alignment' => [\n 'horizontal' => \\PHPExcel_Style_Alignment::HORIZONTAL_CENTER,\n 'vertical' => \\PHPExcel_Style_Alignment::VERTICAL_CENTER,\n 'wrap' => false\n ]\n ]);\n switch($i+1){\n case 1:\n case 3:\n case 5:\n $width = 10;\n break;\n case 2:\n $width = 18;\n break;\n case 4:\n case 6:\n $width = 30;\n break;\n case 7:\n $width = 50;\n break; \n case 11: case 13:\n case 15: case 17: case 19: case 21: case 23: case 25:\n case 27: case 29: case 31: case 33: case 35: case 37: case 39:\n $width = 20;\n break;\n default:\n $width = 30;\n break;\n }\n $objPHPExcel->getActiveSheet()->getColumnDimension($column)->setWidth($width);\n $last_column = $column;\n }\n \n /*====================================\n * Get list user has department enable_start_date >= export day <= enable_end_date\n * Or enable_start_date >= export day && enable_end_date IS NULL\n *====================================*/\n $query = \\DB::select('MADM.*', \\DB::expr('MM.name AS menu_name'), \\DB::expr('MM.id AS menu_id'), \n \\DB::expr('MRM.name AS request_menu_name'), \\DB::expr('MRM.name AS request_menu_id'),\n 'MD.level')\n ->from(['m_approval_department_menu', 'MADM'])\n ->join(['m_department', 'MD'], 'left')->on('MD.id', '=', 'MADM.m_department_id')\n\n ->join(['m_menu', 'MM'], 'left')->on('MM.id', '=', 'MADM.m_menu_id')\n ->on('MADM.petition_type', '=', \\DB::expr(\"1\"))\n ->on('MM.item_status', '=', \\DB::expr(\"'active'\"))->on('MM.enable_flg', '=', \\DB::expr(\"1\"))\n ->join(['m_request_menu', 'MRM'], 'left')->on('MRM.id', '=', 'MADM.m_menu_id')\n ->on('MADM.petition_type', '=', \\DB::expr(\"2\"))\n ->on('MRM.item_status', '=', \\DB::expr(\"'active'\"))->on('MRM.enable_flg', '=', \\DB::expr(\"1\"))\n ->where('MD.item_status', '=', 'active')\n\n ->and_where('MADM.item_status', '=', 'active')\n ->and_where_open()\n ->and_where(\\DB::expr(\"'{$export_date}'\"), 'BETWEEN', [\\DB::expr('MADM.enable_start_date'), \\DB::expr('MADM.enable_end_date')])\n ->or_where_open()\n ->and_where(\\DB::expr('MADM.enable_start_date'), '<=', $export_date)\n ->and_where(\\DB::expr('MADM.enable_end_date'), 'IS', \\DB::expr('NULL'))\n ->or_where_close()\n ->and_where_close()\n\n ->group_by('MADM.m_department_id', 'MADM.m_menu_id', 'MADM.petition_type', 'MADM.enable_start_date')\n ;\n $items = $query->execute()->as_array();\n \n //set content\n $i = 0;\n foreach($items as $item){\n $row = $i+2;\n \n switch ($item['petition_type']) {\n case 1:\n $menu_name = $item['menu_name'];\n $menu_id = $item['menu_id'];\n break;\n case 2:\n $menu_name = $item['request_menu_name'];\n $menu_id = $item['request_menu_id'];\n break;\n }\n if(empty($menu_id)) continue;\n\n\n //Get Full Name\n switch ($item['level']) {\n case 1:\n //business\n $depInfo = \\Model_MDepartment::comboData(['m_department_id' => $item['m_department_id']], ['task' => 'business']);\n break;\n case 2:\n //division\n $depInfo = \\Model_MDepartment::comboData(['m_department_id' => $item['m_department_id']], ['task' => 'division']);\n break;\n case 3:\n //department\n $depInfo = \\Model_MDepartment::comboData(['m_department_id' => $item['m_department_id']], ['task' => 'department']);\n\n break;\n \n }\n if(empty($depInfo)) continue;\n\n //Get user of routes\n $query = \\DB::select('MU.fullname', \\DB::expr('MA.name AS authority_name'))\n ->from(['m_user', 'MU'])\n ->join(['m_approval_department_menu', 'MADM'], 'left')->on('MADM.m_user_id', '=', 'MU.id')\n ->join(['m_authority', 'MA'], 'left')->on('MA.id', '=', 'MADM.m_authority_id')\n ->where('MU.item_status', '=', 'active')\n ->and_where('MADM.item_status', '=', 'active')\n ->and_where('MADM.m_department_id', '=', $item['m_department_id'])\n ->and_where('MADM.m_menu_id', '=', $item['m_menu_id'])\n ->and_where('MADM.petition_type', '=', $item['petition_type'])\n\n ->where('MU.item_status', '=', 'active')\n ->and_where_open()\n ->and_where('MU.retirement_date', '>', $export_date)\n ->or_where('MU.retirement_date', 'IS',\\DB::expr('NULL'))\n ->and_where_close()\n\n ->and_where('MADM.item_status', '=', 'active')\n ->and_where_open()\n ->and_where(\\DB::expr(\"'{$export_date}'\"), 'BETWEEN', [\\DB::expr('MADM.enable_start_date'), \\DB::expr('MADM.enable_end_date')])\n ->or_where_open()\n ->and_where(\\DB::expr('MADM.enable_start_date'), '<=', $export_date)\n ->and_where(\\DB::expr('MADM.enable_end_date'), 'IS', \\DB::expr('NULL'))\n ->or_where_close()\n ->and_where_close()\n\n ->order_by('MADM.order', 'ASC')\n ->group_by('MADM.m_user_id', 'MADM.m_authority_id')\n ;\n\n //check valid date when level == 3\n if($item['level'] == 3){ \n $query->join(['m_department', 'DEP'], 'left')->on('DEP.id', '=', 'MADM.m_department_id')->on('DEP.level', '=', \\DB::expr(3))\n ->and_where('DEP.item_status', '=', 'active')\n ->and_where_open()\n ->and_where(\\DB::expr(\"'{$export_date}'\"), 'BETWEEN', [\\DB::expr('DEP.enable_start_date'), \\DB::expr('DEP.enable_end_date')])\n ->or_where_open()\n ->and_where(\\DB::expr('DEP.enable_start_date'), '<=', $export_date)\n ->and_where(\\DB::expr('DEP.enable_end_date'), 'IS', \\DB::expr('NULL'))\n ->or_where_close()\n ->and_where_close();\n }\n $users = $query->execute()->as_array(); \n \n if (empty($users)) continue;\n\n\n $business_code = isset($depInfo['business_code'])?$depInfo['business_code']:null;\n $business_name = isset($depInfo['business_name'])?$depInfo['business_name']:null;\n $division_code = isset($depInfo['division_code'])?$depInfo['division_code']:null;\n $division_name = isset($depInfo['division_name'])?$depInfo['division_name']:null;\n $department_code = isset($depInfo['department_code'])?$depInfo['department_code']:null;\n $department_name = isset($depInfo['deparment_name'])?$depInfo['deparment_name']:null;\n \n $objPHPExcel->setActiveSheetIndex()->setCellValue('A'.$row, $menu_name);\n // \\Vision_Common::system_format_date(strtotime($user['entry_date'])):null)\n $objPHPExcel->setActiveSheetIndex()->setCellValue('A'.$row,$business_code)\n ->setCellValue('B'.$row,$business_name)\n ->setCellValue('C'.$row,$division_code)\n ->setCellValue('D'.$row,$division_name)\n ->setCellValue('E'.$row,$department_code)\n ->setCellValue('F'.$row,$department_name)\n ->setCellValue('G'.$row,$menu_name)\n ->setCellValue('H'.$row,$item['enable_start_date']?\\Vision_Common::system_format_date(strtotime($item['enable_start_date'])):null)\n ->setCellValue('I'.$row,$item['enable_end_date']?\\Vision_Common::system_format_date(strtotime($item['enable_end_date'])):null)\n ;\n\n if(!empty($users)){\n $col = 9;\n foreach ($users as $user) {\n $objPHPExcel->setActiveSheetIndex()->setCellValue(\\PHPExcel_Cell::stringFromColumnIndex($col).$row,$user['fullname']);\n $col++;\n $objPHPExcel->setActiveSheetIndex()->setCellValue(\\PHPExcel_Cell::stringFromColumnIndex($col).$row,$user['authority_name']);\n $col++;\n }\n }\n\n $i++;\n }\n\n $format = ['alignment'=>array('horizontal'=> \\PHPExcel_Style_Alignment::HORIZONTAL_CENTER,'wrap'=>true)];\n $objPHPExcel->getActiveSheet()->getStyle('A1:AK1')->getFill()->setFillType(\\PHPExcel_Style_Fill::FILL_SOLID);\n $objPHPExcel->getActiveSheet()->getStyle('A1:AK1')->getFill()->getStartColor()->setRGB('25a9cb');\n\n header(\"Last-Modified: \". gmdate(\"D, d M Y H:i:s\") .\" GMT\");\n header(\"Cache-Control: max-age=0\");\n header('Content-Type: application/vnd.ms-excel');\n header('Content-Disposition: attachment;filename=\"決裁経路(カスタム)-'.$export_date.'.xls\"');\n $objWriter = \\PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');\n $objWriter->save('php://output');\n exit; \n }", "public function index()\n { \n if (Auth::user()->admin) {\n $dt = Carbon::now();\n $date_today = $dt->timezone('Europe/London');\n $date = $date_today->toDateString();\n $assignments = assignment::where('date',Carbon::now()->timezone('Europe/London')->addDays(-1)->toDateString())->where('status',0)->get();\n foreach ($assignments as $assignment) {\n $new_assignment = new assignment;\n $new_assignment->date = $date_today;\n $new_assignment->task = $assignment->task;\n $new_assignment->task_description = $assignment->task_description;\n $new_assignment->save();\n $assignment->status = 2;\n $assignment->save();\n }\n $expenses = expenses::where('auto',0)->get();\n $total_amount = 0;\n foreach ($expenses as $expense) {\n $total_amount = $total_amount + $expense->amount;\n }\n $wages = wage::where('date',$date)->get();\n $total_wage = 0;\n foreach ($wages as $wage) {\n $total_wage = $total_wage + $wage->today_wage;\n }\n\n $tasks = Task::all();\n $client_passport_emails = array();\n $mail_clients = client::where('mail_sent',0)->where('passport_expiry_date',Carbon::now()->addMonths(6)->toDateString())->get();\n foreach ($mail_clients as $client) {\n array_push($client_passport_emails,$client->email);\n $client->mail_sent = 1;\n $client->save();\n }\n if ($client_passport_emails != null) {\n Mail::to($client_passport_emails)->send(new \\App\\Mail\\passportMail);\n }\n $employee_passport_emails = array();\n $mail_employees = employee::where('mail_sent',0)->where('passport_expiry_date',Carbon::now()->addMonths(6)->toDateString())->get();\n foreach ($mail_employees as $employee) {\n array_push($employee_passport_emails,$employee->email);\n $employee->mail_sent = 1;\n $employee->save();\n }\n if ($employee_passport_emails != null) {\n Mail::to($employee_passport_emails)->send(new \\App\\Mail\\passportMail);\n }\n\n $invoice_emails = array();\n $mail_invoices = invoice::where('status',0)->where('mail_sent',Carbon::now()->addDays(-7)->toDateString())\n ->orwhere('mail_sent',Carbon::now()->addDays(-15)->toDateString())->get();\n foreach ($mail_invoices as $invoice) {\n array_push($invoice_emails,$invoice->client->email);\n if ($invoice->mail_sent == Carbon::now()->addDays(-15)->toDateString()) {\n $invoice->mail_sent = $date;\n $invoice->save();\n }\n }\n if ($invoice_emails != null) {\n Mail::to($invoice_emails)->send(new \\App\\Mail\\invoiceMail);\n }\n\n $paid_invoices = invoice::where('status',1)->where('refund',0)->get();\n $unpaid_invoices = invoice::where('status',0)->where('refund',0)->get();\n $canceled_invoices = invoice::onlyTrashed()->get();\n $refunded_invoices = invoice::where('refund',1)->get();\n\n $unread_messages = Chat::where('to_id',Auth::user()->id)->where('status',0)->orderBy('id','desc')->get();\n return view('home')->with('employees',employee::all())\n\n ->with('clients',client::all())\n ->with('expense',$total_amount)\n ->with('date',$date)\n ->with('invoices',invoice::withTrashed()->get())\n ->with('invoice_infos',invoiceInfo::where('service_name','Visa Services')->orderBy('id','desc')->take(7)->get())\n ->with('total_wage',$total_wage)\n ->with('expenses',expenses::all())\n ->with('tasks',$tasks)\n ->with('tax',settings::all())\n ->with('paid_invoices',$paid_invoices)\n ->with('unpaid_invoices',$unpaid_invoices)\n ->with('canceled_invoices',$canceled_invoices)\n ->with('refunded_invoices',$refunded_invoices)\n ->with('wages',$wages)\n ->with('unread_messages',$unread_messages)\n ->with('messages',null);\n }\n elseif(Auth::user()->employee->count()>0){\n $today_wage = wage::where('employee_id',Auth::user()->employee[0]->id)->where('date',Carbon::now()->toDateString())->get();\n if ($today_wage->count()>0) {\n $today_wageLogs = wageLog::where('wage_id',$today_wage[0]->id)->get();\n $latest_wageLog = wageLog::where('wage_id',$today_wage[0]->id)->orderBy('created_at','desc')->first();\n if($latest_wageLog != null and $latest_wageLog->logout_time == null){ \n $total_hours_this_session = (Carbon::now())->diffInMinutes($latest_wageLog->login_time);\n }\n else{\n $total_hours_this_session = null;\n }\n }\n else{\n $latest_wageLog = null;\n $total_hours_this_session = null;\n }\n $wages = wage::where('employee_id',Auth::user()->employee[0]->id)->get();\n $total_wage = 0;\n foreach ($wages as $wage) {\n $total_wage = $total_wage + $wage->today_wage;\n }\n $unread_messages = Chat::where('to_id',Auth::user()->id)->where('status',0)->orderBy('id','desc')->get();\n return view('employee.home')->with('assignments',assignment::where('date',Carbon::now()->timezone('Europe/London')->toDateString())\n ->where('employee_id',null)->get())\n ->with('employee',Auth::user()->employee[0])\n ->with('total_wage',$total_wage)\n ->with('total_hours_this_session',$total_hours_this_session)\n ->with('unread_messages',$unread_messages)\n ->with('latest_wageLog',$latest_wageLog);\n }\n else{\n $client = Auth::user()->client;\n return view('clients.home')->with('assignments',assignment::where('date',Carbon::now()->timezone('Europe/London')->toDateString()))->with('client',$client);\n }\n }", "public function action_index()\r\n {\r\n\t\t\\Package::load('email');\r\n\t\t$mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : null;\r\n\r\n // getting current date\r\n\t\tdate_default_timezone_set('Asia/Ho_Chi_Minh');\r\n $cDate = date('Y-m-d');\r\n\r\n\t\tif ($mode === 'now'){\r\n\t\t\t$dataSet = Model_Publishdate::find(\r\n\t\t\tarray(\r\n\t\t\t\t\t'select' => array('*'),\r\n\t\t\t\t\t'where' => DB::expr(\"DATEDIFF(publish_date, now()) = 0 AND status = \" . Model_Publishdate::STATUS_CREATED)\r\n\t\t\t\t)\r\n\t\t\t);\r\n\r\n\t\t\tif ($mode === 'now' && isset($dataSet))\r\n\t\t\t{\r\n\t\t\t\tforeach($dataSet as $publishData)\r\n\t\t\t\t{\r\n\t\t\t\t\t$luna = ($publishData->luna_date ? $publishData->luna_date : '');\r\n\r\n\t\t\t\t\t$dataMailing = array('email' => $publishData->email, 'luna' => $luna , 'message' => $publishData->message, 'token' => $publishData->token);\r\n\t\t\t\t\r\n\t\t\t\t\t$result = $this->cron_mail($dataMailing);\r\n\t\t\t\t\tif ($result == true){\r\n\t\t\t\t\t\t$publishData->set(array(\r\n\t\t\t\t\t\t\t'status' => Model_Publishdate::STATUS_PUPBLISHED,\r\n\t\t\t\t\t\t\t'run_date' => $cDate\r\n\t\t\t\t\t\t));\r\n\r\n\t\t\t\t\t\t$publishData->save();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n }", "public function excel_report_sectionmngr($grp)\n\t{\n\t\t$this->data['fields'] = $this->reports_personnel_schedule_model->crystal_report_working_schedule_attendance();\n\t\t$this->data['grp'] = $grp;\n\t\t$this->load->view('employee_portal/report_personnel/schedule/excel_report_sectionmngr',$this->data);\t\t\n\t}", "function wc_marketplace_date2() {\n global $wmp;\n $wmp->output_report_date2();\n }", "private function gASummary($date_from,$date_to) {\n $service_account_email = '[email protected]'; \n // Create and configure a new client object.\n $client = new \\Google_Client();\n $client->setApplicationName(\"Analytics Reporting\");\n $analytics = new \\Google_Service_Analytics($client);\n $cred = new \\Google_Auth_AssertionCredentials(\n $service_account_email,\n array(\\Google_Service_Analytics::ANALYTICS_READONLY),\n \"-----BEGIN PRIVATE KEY-----\\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDAUT0xOyseXwTo\\nMRchra9QmsRYGUZ8+rdGihcAXrt3AqDq4/sKRaIe5gvte+C3bwHV8fI42nz0axRN\\n8WJo7lT7TzZweuAFTv+yuH/yHvNQlPAHMDCars7QTTGf8XcUHO5cq9yYA0FD2/gg\\nWAwU9V34RjL0fvEFHPii9zOZoPMtrNsMwxQcKSw2cs9TZ+grwfp5r/pRbUbPlUYg\\n/3B87jk5FjG9NKO7eRW2Pu7zf7pPZw067EMdAcGpZO7Gnzc21T1f3qj0JR0V7ooh\\nQcxiGCUIUbkKMYOuj/Rb5uQhnfb8ERehxfGFAg9FSiYbPZqag2d/adbmt32hQEKW\\nvud0nU4HAgMBAAECggEAHmy7wY4axDNEE3ewsSNJGPdjGIznGd6QIBi4itZx0eIY\\nkxB+JqHdhAXg3TE728k0ASTFrTjji8dk7u/BIdiSmS9u7VyDFFPrH9sQYr2CwLzP\\nPFPjXJVLIqkTsLoCnKv3CbIms+XP7WxfVL6ZKrempiB07zkl6CktLJrvDt7nmdH4\\nevtrk7aKxpESJUQQVgs5CULH5gIQow/qx5rDHjAaLIsbIlmUXOBZQ4yO77/Lub8u\\nZe6GDBZGeqHqA1yzKgYQiFu/TqAmtsNbtDYfm8dUY/Tkxv/RhJDCJRlpE7Vhq5zD\\nBdrnjW/IWlMVZV0SFLgvkIZ8KMBhvJi6TARzhEXcAQKBgQDswarwvnXmbGCzi4Qh\\ntJ84VeSqzOib4Gp4wzC5WyWHdQdgVb4Ob/HpI69zswwB112W7GbRy/eiUZz7Cg8Q\\nak+3ZbIVeLTlNcJApa0sNEBft+ps7Ww9hajPpTOEhtuSQu9Hx5GXgj65a6a3l+gG\\n9DPGkZC0dLXMrSgWDFZMmtLtPQKBgQDP8uYyy3mhg9owkAhgr1gdSdLJxQ/13o+Y\\nozOWHvBjoF84k/0iLDOqGxuqwBaZBf1ov5W9TS4CeyEfECaCSYc87gThcsKngeZM\\n2fSICIkmOHh24WXamEENQqmKvMXQ8g9HGKzo0TL+r9/iDrrsfo0nCPVEC2A/QBU9\\nBB5YQ9SkkwKBgQDDXSAwXgmt5Vp6bbLPmVsVQpNZeZKsJafWFMMdAKBcQW6fyMD2\\n6tsE1cSOxX0v+8YnptVFY3jpQU03PdqmYgN7w3gLDbq/tPehHtViN4+zLHFOBzCd\\nJ7Df/2MehaWj8IXAhmaWTgxyNumwb7IwIsyimzV8Ix5tUalVYELKHavVxQKBgCkO\\nMMq4h4QO7yYFWdIU7FWj/Jzfbj5BuaIOHqI164oP4JzgAusbRPwBrB2zHQMLPrPO\\nl3avZTUSMEDcxG2WrL+n0ojcSngd2mUz5uZwoPtNzOLTr3NP+g/vKF/+0yNklwWX\\nZpP0sZe9C3urItaMSbv6NcpAYLk8IrVQOdl9Ut9HAoGACt0YP/MLOlnn/S/qyn5+\\npQhuIsnv3rNa7yZrhfn0u+jdLNk4ubmc/A6Z4Yc/hqQEV/UOwfSwAAlHAZgdUWYi\\nvL6VfVaDxX5goKnWxnuvErFH1Zg+3Lem+moBzXXpb0EPxMXsAgXWe6j8YuZReXXu\\nOLoW4l5DW4h2ZmxxWr/D/Jc=\\n-----END PRIVATE KEY-----\\n\"\n ); \n $client->setAssertionCredentials($cred);\n if($client->getAuth()->isAccessTokenExpired()) {\n $client->getAuth()->refreshTokenWithAssertion($cred);\n }\n $optParams = [\n 'dimensions' => 'ga:date',\n 'sort'=>'-ga:date'\n ] ; \n $results = $analytics->data_ga->get(\n 'ga:140884579',\n $date_from,\n $date_to,\n 'ga:sessions,ga:users,ga:pageviews,ga:bounceRate,ga:hits,ga:avgSessionDuration',\n $optParams\n );\n \n $rows = $results->getRows();\n $rows_re_align = [] ;\n foreach($rows as $key=>$row) {\n foreach($row as $k=>$d) {\n $rows_re_align[$k][$key] = $d ;\n }\n } \n $optParams = array(\n 'dimensions' => 'rt:medium'\n );\n try {\n $results1 = $analytics->data_realtime->get(\n 'ga:140884579',\n 'rt:activeUsers',\n $optParams);\n // Success. \n } catch (apiServiceException $e) {\n // Handle API service exceptions.\n $error = $e->getMessage();\n }\n $active_users = $results1->totalsForAllResults ;\n return [\n 'data'=> $rows_re_align ,\n 'summary'=>$results->getTotalsForAllResults(),\n 'active_users'=>$active_users['rt:activeUsers']\n ] ;\n }", "public function getDateEntries()\n\t{\n\t\t//Get Date\n\t\t$dateSubmit = \\Input::get('eventDate_submit');\n\t\t//Get Week\n\t\t$week = $this->timesheet->getWeek($dateSubmit);\n\t\t//Get the user id of the currently logged in user\n\t\t$userId = \\Sentry::getUser()->id;\n\t\t//Get Tasks List\n\t\t$tasks = $this->timesheet->getIndex($userId);\n\t\t//Get Entries\n\t\t$entries = $this->timesheet->getEntries($dateSubmit,$userId);\n\t\treturn \\View::make('dashboard.timesheet.view')\n\t\t\t\t\t->with('week',$week)\n\t\t\t\t\t->with('tasks',$tasks)\n\t\t\t\t\t->with('selectedDate',$dateSubmit)\n\t\t\t\t\t->with('entries', $entries);\n\t}", "function Create_Edited_Schedule($application_id, $request, $tr_info)\n{\n\t$holidays = Fetch_Holiday_List();\n\t$pd_calc = new Pay_Date_Calc_3($holidays);\n\t$log = get_log(\"scheduling\");\n\n\t$schedule = array();\n\t$status_date = (isset($request->status_date)) ?\n\t(date(\"Y-m-d\", strtotime($request->status_date))) : null;\n\t$date_fund_actual = $request->date_fund_actual;\n\t$log->Write(\"Creating Edited Schedule for {$application_id}\");\n\t$principal_balance = floatval($request->principal_balance);\n\t$fees_balance = floatval($request->fees_balance);\n\t$return_amount = floatval($request->return_amount);\n\t$num_service_charges = ($request->num_service_charges == \"max\") ?\n\t5 : intval($request->num_service_charges);\n\n\t$agent_id = isset($request->controlling_agent) ? $request->controlling_agent : 0;\n\n\t$today = date(\"Y-m-d\");\n\t$next_business_day = $pd_calc->Get_Next_Business_Day($today);\n\tRemove_Unregistered_Events_From_Schedule($application_id);\n\n\t// First generate the service charge placeholders\n\tfor ($i = 0; $i < $num_service_charges; $i++)\n\t{\n\t\t$schedule[] = Schedule_Event::MakeEvent($today, $today, array(),\n\t\t'converted_sc_event',\n\t\t'Placeholder for Cashline interest charge');\n\t}\n\n\t// Now generate the balance amounts.\n\tif ($principal_balance > 0.0)\n\t{\n\t\t// If they requested \"Funds Pending\", we want to set the transaction to pending, and set\n\t\t// the event and the transaction to the date they specified.\n\t\tif($request->account_status == '17') // Set Funds Pending\n\t\t{\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('principal' => $principal_balance));\n\t\t\t$event = Schedule_Event::MakeEvent($status_date, $status_date, $amounts,\n\t\t\t'converted_principal_bal',\n\t\t\t\"Converted principal amount for {$application_id}\");\n\n\t\t\t$evid = Record_Event($application_id, $event);\n\t\t\tRecord_Scheduled_Event_To_Register_Pending($status_date, $application_id, $evid);\n\t\t}\n\t\telse if ($request->account_status == '15') // Funding Failed\n\t\t{\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('principal' => -$principal_balance));\n\t\t\t$event = Schedule_Event::MakeEvent($today, $today, $amounts,\n\t\t\t'converted_principal_bal',\n\t\t\t\"Converted principal amount for {$application_id}\");\n\t\t\t$evid = Record_Event($application_id, $event);\n\t\t\t$trids = Record_Scheduled_Event_To_Register_Pending($today, $application_id, $evid);\n\t\t\tforeach ($trids as $trid)\n\t\t\t{\n\t\t\t\tRecord_Transaction_Failure($application_id, $trid);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('principal' => $principal_balance));\n\t\t\t$schedule[] = Schedule_Event::MakeEvent($today, $today, $amounts,\n\t\t\t'converted_principal_bal',\n\t\t\t\"Converted principal amount for {$application_id}\");\n\t\t}\n\t}\n\tif ($fees_balance > 0.0)\n\t{\n\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => $fees_balance));\n\t\t$schedule[] = Schedule_Event::MakeEvent($today, $today, $amounts,\n\t\t'converted_service_chg_bal',\n\t\t\"Converted interest charge amount for {$application_id}\");\n\t}\n\n\t// Scheduling section\n\t$rules = Prepare_Rules($tr_info->rules, $tr_info->info);\n\t$scs_left = max($rules['service_charge']['max_svc_charge_only_pmts'] - $num_service_charges, 0);\n\t$sc_amt = $principal_balance * $rules['interest'];\n\t$sc_comment = \"sched svc chg ({$rules['interest']})\";\n\t$payments = $principal_balance / $rules['principal_payment_amount'];\n\t$total_payments = $rules['service_charge']['max_svc_charge_only_pmts'] + $payments + 1; //add one for the loan date\n\n\tif(!in_array($request->account_status, array(\"19\")))\n\t{\n\t\t$dates = Get_Date_List($tr_info->info, $next_business_day, $rules, ($total_payments ) * 4, null, $next_business_day);\n\n\t\t$index = 0;\n\t\tif (isset($date_fund_actual) && ($date_fund_actual != ''))\n\t\t{\n\t\t\t$date_fund_actual = preg_replace(\"/-/\", \"/\", $date_fund_actual);\n\t\t\t$log->Write(\"Date fund actual is: {$date_fund_actual}\");\n\t\t\t$window = date(\"Y-m-d\", strtotime(\"+10 days\", strtotime($date_fund_actual)));\n\t\t\twhile (strtotime($window) > strtotime($dates['event'][$index])) $index++;\n\t\t}\n\t\telse\n\t\t{\n\t\t\twhile (strtotime($today) > strtotime($dates['event'][$index])) $index++;\n\t\t}\n\t}\n\n\tswitch($request->account_status)\n\t{\n\t\tcase \"1\":\n\t\tcase \"2\": $status_chain = array(\"active\", \"servicing\", \"customer\", \"*root\"); break;\n\t\tcase \"3\": $status_chain = array(\"sent\", \"external_collections\", \"*root\"); break;\n\t\tcase \"4\": $status_chain = array(\"new\", \"collections\", \"customer\", \"*root\"); break;\n\t\tcase \"5\": $status_chain = array(\"queued\", \"contact\", \"collections\", \"customer\", \"*root\"); break;\n\t\tcase \"6\": $status_chain = array(\"pending\", \"external_collections\", \"*root\"); break;\n\t\tcase \"7\": $status_chain = array(\"unverified\", \"bankruptcy\", \"collections\", \"customer\", \"*root\"); break;\n\t\tcase \"8\": $status_chain = array(\"recovered\", \"external_collections\", \"*root\"); break;\n\t\tcase \"9\": $status_chain = array(\"paid\", \"customer\", \"*root\"); break;\n\t\tcase \"10\":\n\t\tcase \"12\":\n\t\tcase \"13\": $status_chain = array(\"ready\", \"quickcheck\", \"collections\", \"customer\", \"*root\"); break;\n\t\tcase \"11\":\n\t\tcase \"14\": $status_chain = array(\"sent\", \"quickcheck\", \"collections\", \"customer\", \"*root\"); break;\n\t\tcase \"15\": $status_chain = array(\"funding_failed\", \"servicing\", \"customer\", \"*root\"); break;\n\t\tcase \"16\": $status_chain = array(\"queued\", \"contact\", \"collections\", \"customer\", \"*root\"); break;\n\t\tcase \"17\": $status_chain = array(\"active\", \"servicing\", \"customer\", \"*root\"); break;\n\t\tcase \"18\": $status_chain = array(\"past_due\", \"servicing\", \"customer\", \"*root\"); break;\n\t\tcase \"19\": $status_chain = array(\"sent\",\"external_collections\",\"*root\"); break;\n\t\tcase \"20\": $status_chain = array(\"queued\", \"contact\", \"collections\", \"customer\", \"*root\"); break;\n\t\tcase \"21\": $status_chain = array(\"sent\", \"quickcheck\", \"collections\", \"customer\", \"*root\"); break;\n\t}\n\n\tif (in_array($request->account_status, array(\"1\", \"2\", \"4\", \"17\",\"18\")))\n\t{\n\t\tif ($request->account_status == \"18\")\n\t\t{\n\t\t\t$old_sc_amt = $sc_amt;\n\t\t\t$today = date(\"Y-m-d\");\n\t\t\t$next_day = $pd_calc->Get_Business_Days_Forward($today, 1);\n\t\t\tif ($fees_balance != 0.00)\n\t\t\t{\n\t\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => -$fees_balance));\n\t\t\t\t$schedule[] = Schedule_Event::MakeEvent($today, $next_day,\n\t\t\t\t$amounts,\n\t\t\t\t'payment_service_chg', 'repull',\n\t\t\t\t'scheduled', 'generated',$application_id,\n\t\t\t\t-$application_id);\n\t\t\t\t$return_amount = bcsub($return_amount,$fees_balance,2);\n\t\t\t}\n\n\t\t\tif ($return_amount > 0)\n\t\t\t{\n\t\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('principal' => -$return_amount));\n\t\t\t\t$schedule[] = Schedule_Event::MakeEvent($today, $next_day,\n\t\t\t\t$amounts,\n\t\t\t\t'repayment_principal', 'repull',\n\t\t\t\t'scheduled','generated',$application_id,\n\t\t\t\t-$application_id);\n\t\t\t\t$principal_balance = bcsub($principal_balance,$return_amount,2);\n\t\t\t\t$sc_amt = $principal_balance * $rules['interest'];\n\t\t\t}\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => $sc_amt));\n\t\t\t$schedule[] = Schedule_Event::MakeEvent($today, $today, $amounts, 'assess_service_chg');\n\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('fee' => $rules['return_transaction_fee']));\n\t\t\t$schedule[] = Schedule_Event::MakeEvent($today, $today,\n\t\t\t$amounts,\n\t\t\t'assess_fee_ach_fail', 'ACH Fee Assessed');\n\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('fee' => -$rules['return_transaction_fee']));\n\t\t\t$schedule[] = Schedule_Event::MakeEvent($today, $next_day,\n\t\t\t$amounts,\n\t\t\t'payment_fee_ach_fail', 'ACH fee payment');\n\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => -$sc_amt));\n\t\t\t$schedule[] = Schedule_Event::MakeEvent($dates['event'][$index],\n\t\t\t$dates['effective'][$index],$amounts, 'payment_service_chg');\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($fees_balance != 0.00)\n\t\t\t{\n\t\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => -$fees_balance));\n\t\t\t\t$schedule[] = Schedule_Event::MakeEvent($dates['event'][$index], $dates['effective'][$index],\n\t\t\t\t$amounts, 'payment_service_chg', 'sched svc chg payment');\n\t\t\t}\n\t\t}\n\t\tfor ($i = 0; $i < $scs_left; $i++)\n\t\t{\n\t\t\tif ($sc_amt == 0.0) break;\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => $sc_amt));\n\t\t\t$schedule[] = Schedule_Event::MakeEvent($dates['event'][$index], $dates['event'][$index],\n\t\t\t$amounts, 'assess_service_chg', $sc_comment);\n\t\t\t$index++;\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => -$sc_amt));\n\t\t\t$schedule[] = Schedule_Event::MakeEvent($dates['event'][$index], $dates['effective'][$index],\n\t\t\t$amounts, 'payment_service_chg',\n\t\t\t'sched svc chg payment');\n\t\t}\n\n\t\twhile ($principal_balance > 0)\n\t\t{\n\t\t\t$charge_amount = min($principal_balance, $rules['principal_payment_amount']);\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('principal' => -$charge_amount));\n\t\t\t$schedule[] = Schedule_Event::MakeEvent($dates['event'][$index], $dates['effective'][$index],\n\t\t\t$amounts, 'repayment_principal', 'principal repayment');\n\t\t\t$principal_balance = bcsub($principal_balance,$charge_amount,2);\n\t\t\tif($principal_balance > 0)\n\t\t\t{\n\t\t\t\t$sc_amt = $principal_balance * $rules['interest'];\n\t\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => $sc_amt));\n\t\t\t\t$schedule[] = Schedule_Event::MakeEvent($dates['event'][$index],\n\t\t\t\t$dates['event'][$index],\n\t\t\t\t$amounts, 'assess_service_chg',\n\t\t\t\t$sc_comment);\n\t\t\t\t$index++;\n\t\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => -$sc_amt));\n\t\t\t\t$schedule[] = Schedule_Event::MakeEvent($dates['event'][$index],\n\t\t\t\t$dates['effective'][$index],\n\t\t\t\t$amounts, 'payment_service_chg',\n\t\t\t\t'sched svc chg payment');\n\t\t\t}\n\n\t\t}\n\t}\n\telse if ($request->account_status == \"15\") // for Funding Failed\n\t{\n\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array(\n\t\t'service_charge' => -$request->fees_balance\n\t\t));\n\t\t$event = Schedule_Event::MakeEvent($today, $today,\n\t\t$amounts, 'adjustment_internal',\n\t\t'Internal Adjustment');\n\t\tPost_Event($application_id, $event);\n\t}\n\telse if ($request->account_status == \"21\") // ACH Return After QC\n\t{\n\t\tif ($status_date != null) $date = $status_date;\n\t\telse $date = $today;\n\n\t\t// Quickcheck (Pending)\n\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array(\n\t\t'service_charge' => -$request->fees_balance,\n\t\t'principal' => -$request->principal_balance,\n\t\t));\n\t\t$schedule[] = Schedule_Event::MakeEvent($date, $date,\n\t\t$amounts, 'quickcheck',\n\t\t'Quickcheck');\n\n\t\t// Cashline Return (Completed)\n\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array(\n\t\t'principal' => $request->return_amount\n\t\t));\n\t\t$event = Schedule_Event::MakeEvent($today, $today,\n\t\t$amounts, 'cashline_return',\n\t\t'Cashline Return');\n\t\tPost_Event($application_id, $event);\n\t}\n\tif ($request->account_status == \"5\")\n\t{\n\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array(\n\t\t'service_charge' => -$request->fees_balance,\n\t\t'principal' => -$request->principal_balance,\n\t\t));\n\t\t$schedule[] = Schedule_Event::MakeEvent($dates['event'][$index], $dates['effective'][$index],\n\t\t$amounts, 'full_balance',\n\t\t'Full Pull Attempt');\n\t}\n\n\tif (in_array($request->account_status, array(\"12\", \"13\", \"14\")))\n\t{\n\t\tif ($status_date != null) $date = $status_date;\n\t\telse $date = $today;\n\n\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array(\n\t\t'service_charge' => -$request->fees_balance,\n\t\t'principal' => -$request->principal_balance,\n\t\t));\n\t\t$schedule[] = Schedule_Event::MakeEvent($date, $date,\n\t\t$amounts, 'quickcheck',\n\t\t'Quickcheck');\n\t}\n\n\tif (in_array($request->account_status, array(\"14\", \"11\")))\n\t{\n\t\tif ($status_date != null) $date = $status_date;\n\t\telse $date = $today;\n\n\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array(\n\t\t'service_charge' => -$request->fees_balance,\n\t\t'principal' => -$request->principal_balance,\n\t\t));\n\t\t$schedule[] = Schedule_Event::MakeEvent($date, $date,\n\t\t$amounts, 'quickcheck',\n\t\t'Quickcheck');\n\t}\n\n\tif (in_array($request->account_status, array('6', '3', '20')))\n\t{\n\t\tif ($status_date != null) $date = $status_date;\n\t\telse $date = $today;\n\n\t\t$amounts = array();\n\t\t$amounts[] = Event_Amount::MakeEventAmount('principal', -$request->principal_balance);\n\t\t$amounts[] = Event_Amount::MakeEventAmount('service_charge', -$request->fees_balance);\n\t\t$schedule[] = Schedule_Event::MakeEvent($date, $date,\n\t\t$amounts, 'quickcheck',\n\t\t'Quickcheck');\n\n\t\t$amounts = array();\n\t\t$amounts[] = Event_Amount::MakeEventAmount('principal', -$request->principal_balance);\n\t\t$amounts[] = Event_Amount::MakeEventAmount('service_charge', -$request->fees_balance);\n\t\t$schedule[] = Schedule_Event::MakeEvent($date, $date,\n\t\t$amounts, 'quickcheck',\n\t\t'Quickcheck');\n\t}\n\n\tif(in_array($request->account_status, array(\"19\")))\n\t{\n\t\tUpdate_Status(NULL,$application_id,$status_chain);\n\t}\n\n\tif (in_array($request->account_status, array(4,5,10,11,16)) && $agent_id)\n\t{\n\t\t$application = ECash::getApplicationById($application_id);\n\t\t$affiliations = $application->getAffiliations();\n\t\t$affiliations->add(ECash::getAgentById($agent_id), 'collections', 'owner', null);\n\t}\n\n\tif (count($schedule) > 0) Update_Schedule($application_id, $schedule);\n\treturn ($status_chain);\n}", "public function indexAction($from='', $to='', $timeSelected='')\n {\n\t\t\t\t\n\t\t/*if($from!='') \t$data['startDate']=$from;\n\t\t//else\t\t\t$data['allData']['startDate']=\"2014-11-23\";\n\t\t//else\t\t\t$data['allData']['startDate']=\"2015-03-11\";\n\t\telse\t\t\t$data['startDate']=\"2015-04-12\";\n\t\tif($to!='') \t$data['endDate']=$to;\n\t\t//else \t\t\t$data['allData']['endDate']=\"2014-11-29\";\n\t\t//else \t\t\t$data['allData']['endDate']=\"2015-03-17\";\n\t\telse \t\t\t$data['endDate']=\"2015-04-18\";*/\n\t\t\n\t\t\n\t\tif($from=='')\n\t\t{\n\t\t\t$dateActual=new \\DateTime();\t\t\t\n\t\t\t$startDate=\\DateTime::createFromFormat('Y-m-d H:i:s', $dateActual->format(\"Y-m-d H:i:s\"))->modify(\"last monday\");\t\t\t\t\n\t\t\t$startDateFunction=$startDate->format(\"Y-m-d H:i:s\");\n\t\t\t$data['startDate']=$startDate->format(\"Y-m-d\");\n\t\t\t$data['endDate']=\\DateTime::createFromFormat('Y-m-d', $startDate->format(\"Y-m-d\"))->modify(\"+6 day\")->format(\"Y-m-d\");\n\t\t}else{\n\t\t\t$startDateFunction=$from.\" 00:00:00\";\n\t\t\t$data['startDate']=$from;\n\t\t\t$data['endDate']=$to;\n\t\t}\t\n\t\t\n\n\t\t\n\t\t//$dataActionPlan = $this->get('gestor_data_capturing')->getDataFromDate(\"2015-04-15 00:00:00\", $data['allData']['startDate'].\" 00:00:00\", \"Energy production\");\n\t\t$idActionPlan=1;\n\t\t//$data['dataActionPlan'] = $this->get('gestor_data_capturing')->getDataPVActionPlan(\"2015-04-12 00:00:00\", $idActionPlan);\n\t\t$data['dataActionPlan'] = $this->get('gestor_data_capturing')->getDataPVActionPlan($startDateFunction, $idActionPlan);\n\t\t\n\t\t\n\t\treturn $this->render('OptimusOptimusBundle:Graph:actionPlan.html.twig', $data);\n\t\t//return $this->redirect($this->generateUrl('prediction'));\n }", "function get_activities($user_id, $show_tasks, $view_start_time, $view_end_time, $view, $show_calls = true){\n\t\tglobal $current_user;\n\t\t$act_list = array();\n\t\t$seen_ids = array();\n\n\n\t\t// get all upcoming meetings, tasks due, and calls for a user\n\t\tif(ACLController::checkAccess('Meetings', 'list', $current_user->id == $user_id)) {\n\t\t\t$meeting = new Meeting();\n\n\t\t\tif($current_user->id == $user_id) {\n\t\t\t\t$meeting->disable_row_level_security = true;\n\t\t\t}\n\n\t\t\t$where = CalendarActivity::get_occurs_within_where_clause($meeting->table_name, $meeting->rel_users_table, $view_start_time, $view_end_time, 'date_start', $view);\n\t\t\t$focus_meetings_list = build_related_list_by_user_id($meeting,$user_id,$where);\n\t\t\tforeach($focus_meetings_list as $meeting) {\n\t\t\t\tif(isset($seen_ids[$meeting->id])) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$seen_ids[$meeting->id] = 1;\n\t\t\t\t$act = new CalendarActivity($meeting);\n\n\t\t\t\tif(!empty($act)) {\n\t\t\t\t\t$act_list[] = $act;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif($show_calls){\n\t\t\tif(ACLController::checkAccess('Calls', 'list',$current_user->id == $user_id)) {\n\t\t\t\t$call = new Call();\n\n\t\t\t\tif($current_user->id == $user_id) {\n\t\t\t\t\t$call->disable_row_level_security = true;\n\t\t\t\t}\n\n\t\t\t\t$where = CalendarActivity::get_occurs_within_where_clause($call->table_name, $call->rel_users_table, $view_start_time, $view_end_time, 'date_start', $view);\n\t\t\t\t$focus_calls_list = build_related_list_by_user_id($call,$user_id,$where);\n\n\t\t\t\tforeach($focus_calls_list as $call) {\n\t\t\t\t\tif(isset($seen_ids[$call->id])) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$seen_ids[$call->id] = 1;\n\n\t\t\t\t\t$act = new CalendarActivity($call);\n\t\t\t\t\tif(!empty($act)) {\n\t\t\t\t\t\t$act_list[] = $act;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\tif($show_tasks){\n\t\t\tif(ACLController::checkAccess('Tasks', 'list',$current_user->id == $user_id)) {\n\t\t\t\t$task = new Task();\n\n\t\t\t\t$where = CalendarActivity::get_occurs_within_where_clause('tasks', '', $view_start_time, $view_end_time, 'date_due', $view);\n\t\t\t\t$where .= \" AND tasks.assigned_user_id='$user_id' \";\n\n\t\t\t\t$focus_tasks_list = $task->get_full_list(\"\", $where,true);\n\n\t\t\t\tif(!isset($focus_tasks_list)) {\n\t\t\t\t\t$focus_tasks_list = array();\n\t\t\t\t}\n\n\t\t\t\tforeach($focus_tasks_list as $task) {\n\t\t\t\t\t$act = new CalendarActivity($task);\n\t\t\t\t\tif(!empty($act)) {\n\t\t\t\t\t\t$act_list[] = $act;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $act_list;\n\t}", "function todaysactivities()\n {\n $variables = array();\n $userdetails = $this->userInfo();\n $paitent_id = $userdetails['user_id'];\n $day = $this->getPaitentCurrentDay($paitent_id);\n $day = ($day % 7) + 1;\n $variables['currday'] = $day;\n\n $video = $this->getPaitentVideoByDay($paitent_id, $day);\n $total_count = count($video);\n $variables['total_items'] = $total_count;\n //print_r($video);\n\n $this->output = $this->build_template($this->get_template('todaysactivities'), $variables);\n }", "public function actionAuth(){\n$client = $this->getClient();;\n$service = new Google_Service_Calendar($client);\n\n// Print the next 10 events on the user's calendar.\n$calendarId = 'primary';\n$optParams = array(\n 'maxResults' => 10,\n 'orderBy' => 'startTime',\n 'singleEvents' => true,\n 'timeMin' => date('c'),\n);\n$results = $service->events->listEvents($calendarId, $optParams);\n$events = $results->getItems();\n\nif (empty($events)) {\n print \"No upcoming events found.\\n\";\n} else {\n print \"Upcoming events:\\n\";\n foreach ($events as $event) {\n $start = $event->start->dateTime;\n if (empty($start)) {\n $start = $event->start->date;\n }\n printf(\"%s (%s)\\n\", $event->getSummary(), $start);\n }\n }\n}", "public function view_attendance() { \r\n date_default_timezone_set(\"Asia/Manila\");\r\n $date= date(\"Y-m-d\");\r\n $year = date('Y', strtotime($date));\r\n $month = date('m', strtotime($date));\r\n $datenow = $year .\"-\". $month;\r\n $set_data = $this->session->userdata('userlogin'); //session data\r\n $data = array('clientID' => $set_data['clientID']\r\n ); \r\n $firstDay = mktime(0,0,0,$month, 1, $year);\r\n $timestamp = $firstDay;\r\n $weekDays = array();\r\n for ($i = 0; $i < 31; $i++) {\r\n $weekDays[] = strftime('%a', $timestamp);\r\n $timestamp = strtotime('+1 day', $timestamp);\r\n } \r\n $records['clientprofile']=$this->Client_Model->clientprofile($data);\r\n $records['weekDays']=$weekDays;\r\n $records['useradmin']=$this->User_Model->usertype();\r\n $records['employeeatendance']=$this->Attendance_Model->viewattendanceemployee($set_data['clientID'], $datenow);\r\n $this->load->view('attendanceemployee', $records);\r\n }", "public function email_approver()\n {\n \n $this->db->select('EMAIL');\n $this->db->from('APPROVERS');\n $this->db->where('UNIT',$_SESSION['div']);\n $query = $this->db->get();\n $out = $query->result_array();\n\n if ($out) {\n\n \n foreach ($out as $recipient){\n \n //mail to approver\n $this->load->library('email');\n $htmlContent = '<h1>Title change requested in FREE System.</h1>';\n $htmlContent .= '<p>Please review the <a href=\"' . base_url() . '/admin\">Approval Control Panel</a> to review the request.</p>';\n \n $this->email->clear();\n\n $config['mailtype'] = 'html';\n $this->email->initialize($config);\n $this->email->to($recipient);\n $this->email->from('[email protected]', 'FREE System');\n $this->email->subject('Title Change Requested');\n $this->email->message($htmlContent);\n $this->email->send();\n }\n }\n }", "public function executeBookAppointment(sfWebRequest $request) {\n }", "public function getTimesheetRecent(){\n $emp_id = Auth::user()->id;\n $data['response'] = $this->timesheet->getInformRecent($emp_id);\n $data = $this->formatDate($data);\n return $data;\n }", "public function set_standard_schedule() {\n $this->load->model('hrd_model');\n $this->data['title'] = \"Kelola Jadwal\";\n $this->data['subtitle'] =\"Kelola Jadwal\";\n\n $this->data['message'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));\n $this->data['message_success'] = $this->session->flashdata('message_success');\n\n\n if (isset($_POST) && !empty($_POST)) {\n $office_hour_id=$this->input->post(\"office_hour\");\n $employees=$this->input->post(\"employees\");\n $start_date=$this->input->post(\"start_date\");\n $end_date=$this->input->post(\"end_date\");\n $repeat=$this->input->post(\"repeat\");\n $start_time=$this->input->post(\"start_time\");\n $end_time=$this->input->post(\"end_time\");\n\n $office_hour=$this->hrd_model->get_one(\"hr_office_hours\", $office_hour_id);\n $return=array();\n $return['status']=true;\n $return['message']=\"\";\n\n\n if ($office_hour_id == \"\" || $office_hour_id = 0) {\n if (($start_time == \"\") || ($end_time == \"\")) {\n $return['status']=false;\n $return['message']=\"Jam Mulai dan Jam Akhir harus diisi\";\n } else {\n $office_hour_id = 0;\n $checkin_time = $start_time;\n $checkout_time = $end_time;\n } \n } else {\n $office_hour_id = $this->input->post(\"office_hour\");\n $checkin_time = $office_hour->checkin_time;\n $checkout_time = $office_hour->checkout_time;\n }\n\n for($x=0;$x<sizeof($employees);$x++){\n $user_id = $employees[$x];\n $checking_schedule = $this->hrd_model->checking_schedule(array(\"start_date\"=>$start_date,\"end_date\"=>$end_date,\"repeat\"=>$repeat,\"user_id\"=>$user_id));\n if(sizeof($checking_schedule)>0){\n $return['status']=false;\n foreach($checking_schedule as $c){\n $return['message'].=$c->name.\" sudah mempunyai jadwal di tanggal \".date(\"d/m/Y\",strtotime($c->start_date)).($c->enum_repeat==1 ? \" dan berlaku seterusnya\" : \" s/d \".date(\"d/m/Y\",strtotime($c->end_date))).\"<br>\"; \n }\n }\n }\n\n if (!empty($employees)){\n\n if($return['status']==true){\n \n\n for($x=0;$x<sizeof($employees);$x++){\n $user_id=$employees[$x];\n\n if($repeat == 1){\n\n $save_data = array(\n 'user_id' => $user_id,\n 'start_date' => $start_date,\n 'end_date' => '0000-00-00',\n 'enum_repeat' => $repeat,\n 'free_day' => 0,\n 'is_special_schedule' => 0\n );\n\n } else {\n\n $save_data = array(\n 'user_id' => $user_id,\n 'start_date' => $start_date,\n 'end_date' => $end_date,\n 'enum_repeat' => $repeat,\n 'free_day' => 0,\n 'is_special_schedule' => 0\n );\n\n }\n\n $save_data = $this->hrd_model->save('hr_schedules', $save_data); \n\n if($save_data){\n $save_detail = array(\n 'schedule_id' => $save_data,\n 'office_hour_id' => $office_hour_id,\n 'start_time' => $checkin_time,\n 'end_time' => $checkout_time\n );\n $this->hrd_model->save('hr_schedule_detail', $save_detail);\n }\n\n } \n \n }\n }\n\n \n redirect(base_url(SITE_ADMIN.'/hrd_schedule/set_standard_schedule','refresh'));\n\n \n } else {\n $store = $this->data['setting']['store_id'];\n $this->data['office_hours']= $this->hrd_model->get(\"hr_office_hours\")->result();\n\n $usersch = array();\n $get_user_id = $this->hrd_model->get(\"hr_schedules\")->result();\n foreach ($get_user_id as $key) {\n array_push($usersch, $key->user_id);\n }\n\n $this->data['data_url'] = base_url(SITE_ADMIN . '/hrd_schedule/get_employee_schedule_data');\n $this->data['employees']=$this->hrd_model->get_employee_schedule(array(\"active\"=>1, \"store_id\" => $store),false);\n\n \n $this->data['content'] .= $this->load->view('admin/hrd/set_schedule_standard_view', $this->data, true);\n $this->render('hrd');\n }\n\n }", "function usp_ews_warning_popup($events, $attempts, $userid, $courseid){\n\n\tglobal $CFG, $OUTPUT, $SESSION;\n\t// popup content\n\t$content = '';\n\t\n\t$viewedpopup_cid_uid = 'usp_ewsviewedpopup'. $courseid .$userid;\n\n\t// popup now seen\n\t$SESSION->usp_ewsviewedpopup->$viewedpopup_cid_uid = true;\n\t\n\t//VS-v2 removed the pending activity\n\t$attemptcount = 0; // completed activities count\n\t$expectedcount = 0; // expected activities count \n\t$futurecount= 0; // upcoming activities count \n\t\n\t// hold information of the activities\n\t//$popupArray = array();\n\t$popupFuture = array();\n\n\t// formate the date\n\t$dateformat = get_string('date_format', 'block_usp_ews');\n\t$now = time();\n\n\t// each events checks if attmpted or not according to the configuration\n\tforeach ($events as $event) {\t\t\t\n\t\t$attempted = $attempts[$event['type'].$event['id']];\n\t\t// count attempted events\n\t\tif ($attempted) {\n\t\t\t$attemptcount++;\n\t\t}\n\t\t// check for upcoming activities\n\t\telse if($event['expected'] > $now){ \n\n\t\t\t//to find difference of current time and next week\n\t\t\t$aweek = mktime(0, 0, 0, date(\"m\"), date(\"d\")+7, date(\"Y\"));\n\n\t\t\t// if the event is due within 7 days from current time\n\t\t\t// then alert the user these events\n\t\t\tif($aweek > $event['expected']){\n\t\t\t\t$popupFuture[$futurecount] = array(format_string(addSlashes($event['name'])),\n\t\t\t\t\t\t\tuserdate($event['expected'], $dateformat, $CFG->timezone),\n\t\t\t\t\t\t\tget_string($event['action'], 'block_usp_ews'),\n\t\t\t\t\t\t\t$event['type'],\n\t\t\t\t\t\t\t$event['cmid']);\n\t\t\t\t$futurecount++;\n\t\t\t}\t\t\t\t\n\t\t}\n\t\t// check for expected events and puts in a array\n\t\telse {\n\t\t\t\t$expectedcount++; //count number of expected activities\n\t\t\t} \n\t}\n\n\t// display alert popup\n\t// if some pending activities or upcoming activities \n\tif($futurecount > 0)\n\t{\t\t\n\t\t$strdate = get_string('duedate', 'block_usp_ews');\n\t\t// popup content\n\t\t$content .= '<div class=\"usp_ews_popupContainer\" style=\"display:none;\"> \n\t\t\t\t\t<a class=\"usp_ews_popupclose\" title=\"' . get_string('close', 'block_usp_ews') . '\"><img src=\"' . $OUTPUT->pix_url('close', 'block_usp_ews') . '\" alt=\"\" /></a>';\n\t\t\t\t\t\n\t\t// if upcoming events\n\t\t$content .= '<p class=\"usp_ews_popupheader\">'\n\t\t\t\t. '<img src=\"' . $OUTPUT->pix_url('alertfuture', 'block_usp_ews') . '\" alt=\"\" />'\n\t\t\t\t. '<span class=\"blink_header\">&nbsp;&nbsp;&nbsp;' . get_string('upcomingactivity', 'block_usp_ews') \n\t\t\t\t. '</span></p>'\n\t\t\t\t. '<div class=\"usp_ews_popupcontactArea\">';\n\n\t\tfor($i=0; $i < $futurecount; $i++){\n\t\t\t// event's link\n\t\t\t$content .= '<p><a href=\"' . $CFG->wwwroot . '/mod/' . $popupFuture[$i][3] . '/view.php?id='\n\t\t\t. $popupFuture[$i][4] . '\">' . $popupFuture[$i][0] . '</a>' \n\t\t\t.$strdate . $popupFuture[$i][1] . '</p>';\n\t\t}\n\t\t\n\t\t$content .= '</div>';\n\t\t\n\t\t// placing cross to close popup box\n\t\t$content .= '<p class=\"usp_ews_click\">'. get_string('closepopup', 'block_usp_ews') \n\t\t\t.'</p></div>'\n\t\t\t. '<div class=\"usp_ews_overlayEffect\">'\n\t\t\t. '</div>'\n\t\t\t. '<!--end popup content-->';\t\t\t\n\t}\t\n\treturn $content;\n}", "public function setInterviewDates(){\n\t\t$data=[];\n\t\t$this->load->model('SAR/PanelDetails');\n\t\t$data['Members']=$this->PanelDetails->getAllEmailAddresses();\n\t\t//var_dump($data['Members']);\n\t\t$this->load->view('includes/header');\n $this->load->view('users/SAR/setDates', $data);\n $this->load->view('includes/footer');\n\t}", "public function getBookingsAsICAL($username, $password, $start_date, $end_date, $groups=false, $buildings=false, $statuses=false, $event_types=false, $group_types=false, $group_id=false) {\nglobal $_LW;\n$feed=$_LW->getNew('feed'); // get a feed object\n$ical=$feed->createFeed(['title'=>'EMS Events'], 'ical'); // create new feed\n$hostname=@parse_url((!empty($_LW->REGISTERED_APPS['ems']['custom']['wsdl']) ? $_LW->REGISTERED_APPS['ems']['custom']['wsdl'] : (!empty($_LW->REGISTERED_APPS['ems']['custom']['rest']) ? $_LW->REGISTERED_APPS['ems']['custom']['rest'] : '')), PHP_URL_HOST);\nif ($bookings=$this->getBookings($username, $password, $start_date, $end_date, $groups, $buildings, $statuses, $event_types, $group_types, $group_id)) { // if bookings obtained\n\tforeach($bookings as $booking) { // for each booking\n\t\t$arr=[ // format the event\n\t\t\t'summary'=>$booking['title'],\n\t\t\t'dtstart'=>$booking['date_ts'],\n\t\t\t'dtend'=>(!empty($booking['date2_ts']) ? $booking['date2_ts'] : ''),\n\t\t\t'description'=>'',\n\t\t\t'uid'=>$booking['booking_id'].'@'.$hostname,\n\t\t\t'categories'=>$booking['event_type'],\n\t\t\t'location'=>$booking['location'],\n\t\t\t'X-LIVEWHALE-TYPE'=>'event',\n\t\t\t'X-LIVEWHALE-TIMEZONE'=>@$booking['timezone'],\n\t\t\t'X-LIVEWHALE-CANCELED'=>@$booking['canceled'],\n\t\t\t'X-LIVEWHALE-CONTACT-INFO'=>@$booking['contact_info'],\n\t\t\t'X-EMS-STATUS-ID'=>@$booking['status_id'],\n\t\t\t'X-EMS-EVENT-TYPE-ID'=>@$booking['event_type_id']\n\t\t];\n\t\tif (@$booking['status_id']==5 || @$booking['status_id']==17) { // if this is a pending event, skip syncing (creation of events and updating if already existing)\n\t\t\t$arr['X-LIVEWHALE-SKIP-SYNC']=1;\n\t\t};\n\t\tif (!empty($_LW->REGISTERED_APPS['ems']['custom']['hidden_by_default'])) { // if importing hidden events, flag them\n\t\t\t$arr['X-LIVEWHALE-HIDDEN']=1;\n\t\t};\n\t\tif (!empty($booking['udfs']) && !empty($_LW->REGISTERED_APPS['ems']['custom']['udf_tags']) && !empty($booking['udfs'][$_LW->REGISTERED_APPS['ems']['custom']['udf_tags']])) { // if assigning UDF values as event tags\n\t\t\t$arr['X-LIVEWHALE-TAGS']=implode('|', $booking['udfs'][$_LW->REGISTERED_APPS['ems']['custom']['udf_tags']]); // add them to output\n\t\t};\n\t\tif (!empty($booking['udfs']) && !empty($_LW->REGISTERED_APPS['ems']['custom']['udf_categories']) && !empty($booking['udfs'][$_LW->REGISTERED_APPS['ems']['custom']['udf_categories']])) { // if assigning UDF values as event categories, implode array\n\t\t\t$arr['categories']=implode('|', $booking['udfs'][$_LW->REGISTERED_APPS['ems']['custom']['udf_categories']]); // add them to output\n\t\t};\n\t\tif (!empty($booking['udfs']) && !empty($_LW->REGISTERED_APPS['ems']['custom']['udf_description']) && !empty($booking['udfs'][$_LW->REGISTERED_APPS['ems']['custom']['udf_description']])) { // if assigning UDF value as event description\n\t\t\t$arr['description']=$booking['udfs'][$_LW->REGISTERED_APPS['ems']['custom']['udf_description']];\n\t\t};\n\t\tif (!empty($booking['contact_info'])) { // add contact info if available\n\t\t\t$arr['X-EMS-CONTACT-INFO']=$booking['contact_info'];\n\t\t};\n\t\tif (!empty($booking['contact_name'])) { // add contact name if available\n\t\t\t$arr['X-EMS-CONTACT-NAME']=$booking['contact_name'];\n\t\t};\n\t\t$arr=$_LW->callHandlersByType('application', 'onBeforeEMSFeed', ['buffer'=>$arr, 'booking'=>$booking]); // call handlers\n\t\tforeach($arr as $key=>$val) { // clear empty entries\n\t\t\tif (empty($val)) {\n\t\t\t\tunset($arr[$key]);\n\t\t\t};\n\t\t};\n\t\t$feed->addFeedItem($ical, $arr, 'ical'); // add event to feed\n\t};\n};\n$feed->disable_content_length=true;\nreturn $feed->showFeed($ical, 'ical'); // show the feed\n}", "public function getIndex()\n\t{\n\t\tif ( Auth::check() )\n\t\t{\n\t\t\tif (Auth::user()->role == 'admin')\n\t\t\t\treturn Redirect::to('admin');\n\n\t\t\tif (Auth::user()->role == 'ta')\n\t\t\t\treturn Redirect::to('ta');\n\t\t}\n\n $week = array(\n \"Sunday\" => array(),\n \"Monday\" => array(),\n \"Tuesday\" => array(),\n \"Wednesday\" => array(),\n \"Thursday\" => array(),\n \"Friday\" => array(),\n \"Saturday\" => array()\n );\n\n $days = array(\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\"\n );\n\n $start = Settings::get(\"availability_start_hour\")->value;\n $start = Time::ToNumber($start);\n $time['start'] = $start;\n\n $end = Settings::get(\"availability_end_hour\")->value;\n $end = Time::ToNumber($end);\n $time['end'] = $end;\n\n $week_start = time() - (date('w') * 24 * 60 * 60);\n $week_start = date('Y-m-d', $week_start);\n $week_end = strtotime($week_start) + (6 * 24 * 60 * 60);\n $week_end = date('Y-m-d', $week_end);\n\n $shifts = Shift::between($week_start,$week_end);\n\n $assigned = array();\n foreach ($shifts as $shift) {\n for ($i=$shift->start; $i < $shift->end; $i+=50){\n $ta = $shift->TA();\n if (isset($ta))\n {\n $day = date('l', strtotime($shift->date));\n $assigned[$day][$i][] = $ta->name;\n }\n }\n }\n\n $courses = Course::all();\n\n\t\treturn View::make('main')\n ->with('courses',$courses)\n ->with('days', $days)\n ->with('week', $week)\n ->with('assigned',$assigned)\n ->with('time', $time);\n\t}", "public function holiday() {\n $this->data['title'] = \"Kelola Cuti Pegawai\";\n $this->data['subtitle'] = \"Kelola Cuti Pegawai\";\n\n $this->data['users'] = $this->hrd_model->get_user_dropdown(array(\"active\"=>1));\n\n $this->data['data_url'] = base_url(SITE_ADMIN . '/hrd_schedule/get_leave_data/');\n $this->data['content'] .= $this->load->view('admin/hrd/schedule_holiday_view', $this->data, true);\n $this->render('hrd');\n }", "function action_report($low, $high) {\n\n $range_l = '';\n $range_h = '';\n\n if(strcmp($low, '1000-01-01 00:00:00') == 0) {\n $range_l = \"site's beginning\";\n } else {\n $range_l = $low;\n }\n\n if(strcmp($high, '9999-12-31 23:59:59') == 0) {\n $range_h = \"now\";\n } else {\n $range_h = $high;\n }\n\n $freq_patient = user_freq($low, $high, \"Patient\");\n $freq_nurse = user_freq($low, $high, \"Nurse\");\n $freq_doctor = user_freq($low, $high, \"Doctor\");\n $freq_admin = user_freq($low, $high, \"Admin\");\n\n $total_patient = total_action_user($low, $high, \"Patient\");\n $total_nurse = total_action_user($low, $high, \"Nurse\");\n $total_doctor = total_action_user($low, $high, \"Doctor\");\n $total_admin = total_action_user($low, $high, \"Admin\");\n\n $freq_login = action_freq($low, $high, \"Logged In\");\n $freq_logout = action_freq($low, $high, \"Logged Out\");\n $freq_newuser = action_freq($low, $high, \"Created New User\");\n $freq_modrec = action_freq($low, $high, \"Modified Record\");\n $freq_apmt = action_freq($low, $high, \"Scheduled Appointment\");\n $freq_prescript = action_freq($low, $high, \"Prescription Written\");\n\n $total_login = total_action_action($low, $high, \"Logged In\");\n $total_logout = total_action_action($low, $high, \"Logged Out\");\n $total_newuser = total_action_action($low, $high, \"Created New User\");\n $total_modrec = total_action_action($low, $high, \"Modified Record\");\n $total_apmt = total_action_action($low, $high, \"Scheduled Appointment\");\n $total_prescript = total_action_action($low, $high, \"Prescription Written\");\n\n echo \"<h2>Activity report for interval from \".$range_l.\" to \".$range_h.\"</h2><br>\";\n \n echo \"<h3>Average Daily Actions per User Type</h3>\";\n echo \"<table><tr><th>Patients</th><th>Nurses</th><th>Doctors</th><th>Admin</th></tr>\";\n echo \"<tr><td><center>\".$freq_patient.\"</center></td><td><center>\".$freq_nurse.\"</center></td><td><center>\".$freq_doctor.\"</center></td><td><center>\".$freq_admin.\"</center></td></tr></table>\";\n\n echo \"<h3>Total number of Actions per User Type</h3>\";\n echo \"<table><tr><th>Patients</th><th>Nurses</th><th>Doctors</th><th>Admin</th></tr>\";\n echo \"<tr><td><center>\".$total_patient.\"</center></td><td><center>\".$total_nurse.\"</center></td><td><center>\".$total_doctor.\"</center></td><td><center>\".$total_admin.\"</center></td></tr></table>\";\n\n echo \"<h3>Average Daily Actions per Action Type</h3>\";\n echo \"<table><tr><td>Logins: \".$freq_login.\" </td><td>Logouts: \".$freq_logout.\" </td></tr>\";\n echo \"<tr><td>New Users Created: \".$freq_newuser.\" </td><td>Records Modified: \".$freq_modrec.\" </td></tr>\";\n echo \"<tr><td>Appointments Scheduled: \".$freq_apmt.\"</td><td>Prescriptions Written: \".$freq_prescript.\"</td></tr></table>\";\n\n echo \"<h3>Total number of Actions per Action Type</h3>\";\n echo \"<table><tr><td>Logins: \".$total_login.\" </td><td>Logouts: \".$total_logout.\" </td></tr>\";\n echo \"<tr><td>New Users Created: \".$total_newuser.\" </td><td>Records Modified: \".$total_modrec.\" </td></tr>\";\n echo \"<tr><td>Appointments Scheduled: \".$total_apmt.\"</td><td>Prescriptions Written: \".$total_prescript.\"</td></tr></table>\";\n\n\n }", "function activetime() { # Simply return TRUE or FALSE based on the time/dow and whether we should activate\n $st1 = 2114; # start time for activation on weekdays (primary schedule)\n $st2 = 2114; # start time for activation on weekends (secondary schedule)\n $et1 = 420; # end time for activation on weekdays (primary schedule)\n $et2 = 629; # end time for activation on weekends (secondary schedule)\n date_default_timezone_set('America/New_York'); # Default is UTC. That's not super-useful here.\n $nowtime = (int)date('Gi', time()); \n $nowdow = (int)date('w',time()); # 0 - 6, 0=Sunday, 6=Saturday\n\n if($nowdow >= 1 && $nowdow <= 5) { # Weekday (primary) schedule\n if(($nowtime >= $st1 && $nowtime <= 2359) || ($nowtime >= 0000 && $nowtime <= $et1) ) {\n return TRUE;\n }\n return FALSE;\n }\n else { # Weekend (secondary) schedule. \n if(($nowtime >= $st2 && $nowtime <= 2359) || ($nowtime >= 0000 && $nowtime <= $et2) ) {\n return TRUE;\n }\n return FALSE;\n }\n}", "public function schedule_by_date(Request $request) {\n //\n $currentDate = $request->segment(2);\n $day = \\Helpers\\DateHelper::getDay($currentDate);\n $weekDays = \\Helpers\\DateHelper::getWeekDays($currentDate, $day); \n $workouts = \\App\\Schedule::getScheduledWorkouts($weekDays);\n \n return view('user/schedule', ['number_of_day' => $day, 'current_date' => $currentDate, 'weekDays' => $weekDays])\n ->with('target_areas', json_decode($this->target_areas, true))\n ->with('movements', json_decode($this->movements, true))\n ->with('workouts', $workouts); \n }", "public function vbd_report_other_datewise()\n\t\t{\n\t\t\t$this->load->view('admin/header');\n\t\t\t$this->load->view('admin/nav');\n\t\t\t$data['get_state']=$this->Mod_report->get_state();\n\t\t\t$data['get_institute']=$this->Mod_report->get_institute();\n\t\t\t$this->load->view('reports/vbd_report_other_datewise',$data);\t\t\n\t\t\t$this->load->view('admin/footer');\t\n\n\t\t}", "function dwsim_flowsheet_progress_all()\n{\n\t$page_content = \"\";\n\t$query = db_select('dwsim_flowsheet_proposal');\n\t$query->fields('dwsim_flowsheet_proposal');\n\t$query->condition('approval_status', 1);\n\t$query->condition('is_completed', 0);\n\t$result = $query->execute();\n\tif ($result->rowCount() == 0)\n\t{\n\t\t$page_content .= \"Work is in progress for the following flowsheets under Flowsheeting Project<hr>\";\n\t} //$result->rowCount() == 0\n\telse\n\t{\n\t\t$page_content .= \"Work is in progress for the following flowsheets under Flowsheeting Project<hr>\";;\n\t\t$preference_rows = array();\n\t\t$i = $result->rowCount();\n\t\twhile ($row = $result->fetchObject())\n\t\t{\n\t\t\t$approval_date = date(\"Y\", $row->approval_date);\n\t\t\t$preference_rows[] = array(\n\t\t\t\t$i,\n\t\t\t\t$row->project_title,\n\t\t\t\t$row->contributor_name,\n\t\t\t\t$row->university,\n\t\t\t\t$approval_date\n\t\t\t);\n\t\t\t$i--;\n\t\t} //$row = $result->fetchObject()\n\t\t$preference_header = array(\n\t\t\t'No',\n\t\t\t'Flowsheet Project',\n\t\t\t'Contributor Name',\n\t\t\t'University / Institute',\n\t\t\t'Year'\n\t\t);\n\t\t$page_content .= theme('table', array(\n\t\t\t'header' => $preference_header,\n\t\t\t'rows' => $preference_rows\n\t\t));\n\t}\n\treturn $page_content;\n}", "public function index($date = null)\n {\n $user = Auth::user();\n $workouts = $user->workouts;\n $currentWeek = $user->currentWeek;\n\n //will be checking against this to fix problem where refreshing takes users to previous or next weeks\n $pageWasRefreshed = isset($_SERVER['HTTP_CACHE_CONTROL']) && $_SERVER['HTTP_CACHE_CONTROL'] === 'max-age=0';\n\n if($date && !$pageWasRefreshed){ \n switch($date){\n case 'previous':\n $currentWeek--;\n $user->update(['currentWeek' => $currentWeek]);\n break;\n case 'next':\n $currentWeek++;\n $user->update(['currentWeek' => $currentWeek]);\n break;\n case 'current':\n $currentWeek = date('W');\n $user->update(['currentWeek' => $currentWeek]);\n break;\n }\n }\n\n //Use Currentweek to delegate weeks\n //Refactor this\n\n $dto = new DateTime();\n $ret['monday'] = $dto->setISODate(date('Y'), $currentWeek)->format('Y-m-d');\n $ret['sunday'] = $dto->modify('+6 days')->format('Y-m-d'); \n\n $monday = $ret['monday'];\n $sunday = $ret['sunday'];\n $weekof = $monday;\n \n $mondayWorkout = $this->findWorkout('Monday', $monday, $sunday, $workouts);\n $tuesdayWorkout = $this->findWorkout('Tuesday', $monday, $sunday, $workouts);\n $wednesdayWorkout = $this->findWorkout('Wednesday', $monday, $sunday, $workouts);\n $thursdayWorkout = $this->findWorkout('Thursday', $monday, $sunday, $workouts);\n $fridayWorkout = $this->findWorkout('Friday', $monday, $sunday, $workouts);\n // $saturdayWorkout = $this->findWorkout('Saturday', $monday, $sunday, $workouts);\n // $sundayWorkout = $this->findWorkout('Sunday', $monday, $sunday, $workouts);\n\n if($mondayWorkout){\n $mondayExercises = $mondayWorkout->exercises;\n }\n if($tuesdayWorkout){\n $tuesdayExercises = $tuesdayWorkout->exercises;\n }\n if($wednesdayWorkout){\n $wednesdayExercises = $wednesdayWorkout->exercises;\n }\n if($thursdayWorkout){\n $thursdayExercises = $thursdayWorkout->exercises;\n }\n if($fridayWorkout){\n $fridayExercises = $fridayWorkout->exercises;\n }\n // if($saturdayWorkout){\n // $saturdayExercises = $saturdayWorkout->exercises;\n // } \n // if($sundayWorkout){\n // $sundayExercises = $sundayWorkout->exercises;\n // }\n // \n \n //get the exercises of last week and current day for dashboard\n //for comparison week to week\n \n $lastweekDate = date('Y-m-d', strtotime('-1 week'));\n $lastweekWorkout = $workouts->where('week', $lastweekDate)->first();\n \n if($lastweekWorkout){\n $lastweekExercises = $lastweekWorkout->exercises;\n }\n\n return view('home', compact('weekof', \n 'lastweekWorkout', 'lastweekExercises',\n 'mondayExercises', 'mondayWorkout',\n 'tuesdayExercises', 'tuesdayWorkout',\n 'wednesdayExercises', 'wednesdayWorkout',\n 'thursdayExercises', 'thursdayWorkout',\n 'fridayExercises', 'fridayWorkout'//,\n // 'saturdayExercises', 'saturdayWorkout',\n // 'sundayExercises', 'sundayWorkout'\n ));\n }" ]
[ "0.6188917", "0.61371523", "0.59724456", "0.5914209", "0.5878231", "0.58684427", "0.5850442", "0.5809613", "0.57332426", "0.5712904", "0.56981343", "0.56725204", "0.5626723", "0.5594761", "0.5590149", "0.55804193", "0.5577645", "0.55739397", "0.55374515", "0.55116487", "0.5501894", "0.5469365", "0.5463194", "0.5459715", "0.543053", "0.54192936", "0.5402215", "0.5391373", "0.53654265", "0.53366375", "0.532826", "0.5328194", "0.53208566", "0.5317873", "0.5317097", "0.5312749", "0.5302063", "0.53011024", "0.52907133", "0.52838594", "0.52802455", "0.5269643", "0.5267028", "0.526627", "0.52599436", "0.52435195", "0.5239207", "0.52377325", "0.52362746", "0.5227146", "0.5222961", "0.5217668", "0.52101684", "0.52024126", "0.52015114", "0.52013206", "0.5198396", "0.5195423", "0.5178767", "0.517663", "0.51723504", "0.51723224", "0.51662236", "0.5158751", "0.5154597", "0.5154454", "0.5137585", "0.51336694", "0.5129581", "0.5127755", "0.51270366", "0.5115246", "0.51148975", "0.5114245", "0.5109855", "0.5101838", "0.50937164", "0.5089672", "0.5089036", "0.5082643", "0.50810987", "0.50784343", "0.5070287", "0.50687826", "0.5064408", "0.50637126", "0.50567186", "0.5050754", "0.5050099", "0.5048506", "0.50480473", "0.5047626", "0.5046702", "0.5044833", "0.5043736", "0.504154", "0.50415", "0.50374013", "0.50366235", "0.50352395" ]
0.528342
40
END TIMESHEET / timesheet /
function waitingApproval($type=1, $pg=1, $limit=25) { $this->getMenu(); $form = array(); if($type==1) { $this->session->unset_userdata('client_no'); $this->session->unset_userdata('client_name'); $this->session->unset_userdata('project_no'); } elseif($type==2) { $this->session->unset_userdata('client_no'); $this->session->unset_userdata('client_name'); $this->session->unset_userdata('project_no'); if($this->input->post('client_no')) $form['client_no'] = $this->input->post('client_no'); if($this->input->post('client_name')) $form['client_name'] = $this->input->post('client_name'); if($this->input->post('project_no')) $form['project_no'] = $this->input->post('project_no'); $this->session->set_userdata($form); } if($this->session->userdata('client_no')) $form['client_no'] = $this->session->userdata('client_no'); if($this->session->userdata('client_name')) $form['client_name'] = $this->session->userdata('client_name'); if($this->session->userdata('project_no')) $form['project_no'] = $this->session->userdata('project_no'); if($limit) { $this->session->set_userdata('rpp', $limit); $this->rpp = $limit; } $limit = $limit ? $limit : $this->rpp; $this->data['request'] = $this->timesheetModel->getTimesheetRequest(); $this->load->view('timesheet_waitingApproval',$this->data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function close_timesheet($timesheet)\n\t{\n\t\t$date = Carbon::now();\n\n\t\t$this->CI->timecard_model->timecard_update(\n\t\t\t$timesheet->id,\n\t\t\t$date->format('h'),\n\t\t\t$date->format('i'),\n\t\t\t$date->format('A'),\n\t\t\t$timesheet->user_id\n\t\t);\n\t}", "public function testCreateTimesheet()\n {\n }", "function testTimeSheet()\n{\n\tcreateClient('The Business', '1993-06-20', 'LeRoy', 'Jenkins', '1234567890', '[email protected]', 'The streets', 'Las Vegas', 'NV');\n\n\t//Create Project to assign task\n\tcreateProject('The Business', 'Build Website', 'Build a website for the Business.');\n\tcreateProject('The Business', 'Fix CSS', 'Restyle the website');\n\n\t//Create Tasks\n\tcreateTask('The Business', 'Build Website', 'Start the Project', 'This is the first task for Build Website.');\n\tcreateTask('The Business', 'Build Website', 'Register domain name', 'Reserach webservices and make a good url');\n\tcreateTask('The Business', 'Fix CSS', 'Start the Project', 'Dont be lazy');\n\n\t//Create Developer to record time\n\tcreateEmployee('SE', 'b.zucker', 'Developer', 'bz', 'Brent', 'Zucker', '4045801384', '[email protected]', 'Columbia St', 'Milledgeville', 'GA');\n\n\t//Create TimeSheet Entry\n\tcreateTimeSheet('b.zucker', 'The Business', 'Build Website', 'Start the Project', '2015-03-02 10-30-00', '2015-03-02 15-30-00');\n\t\n\t//prints out timesheet\n\techo \"<h3>TimeSheet</h3>\";\n\ttest(\"SELECT * FROM TimeSheet\");\n\n\t//deletes the timesheet\n\tdeleteTimeSheet('b.zucker', 'The Business', 'Build Website', 'Start the Project', '2015-03-02 10-30-00', '2015-03-02 15-30-00');\n\n\t//deletes the tasks\n\tdeleteTask('The Business', 'Build Website', 'Start the Project');\n\tdeleteTask('The Business', 'Build Website', 'Register domain name');\n\tdeleteTask('The Business', 'Fix CSS', 'Start the Project');\n\n\t//deletes the projects\n\tdeleteProject('The Business', 'Fix CSS');\n\tdeleteProject('The Business', 'Build Website');\n\t\n\t//deletes the client\n\tdeleteClient('The Business');\n\n\t//deletes employee\n\tdeleteEmployee('b.zucker');\n}", "private function endMonthSpacers()\n\t{\n\t\tif((8 - $this->weekDayNum) >= '1') {\n\t\t\t$this->calWeekDays .= \"\\t\\t<td colspan=\\\"\".(8 - $this->weekDayNum).\"\\\" class=\\\"spacerDays\\\">&nbsp;</td>\\n\";\n\t\t\t$this->outArray['lastday'] = (8 - $this->weekDayNum);\t\t\t\n\t\t}\n\t}", "function\tendTable() {\n\n\t\t/**\n\t\t *\n\t\t */\n\t\t$frm\t=\t$this->myDoc->currMasterPage->getFrameByFlowName( \"Auto\") ;\n\t\tfor ( $actRow=$this->myTable->getFirstRow( BRow::RTFooterTE) ; $actRow !== FALSE ; $actRow=$this->myTable->getNextRow()) {\n\t\t\t$this->punchTableRow( $actRow) ;\n\t\t}\n\t\t$frm->currVerPos\t+=\t$this->myTable->currVerPos ;\n\t\t$frm->currVerPos\t+=\t1.5 ;\t\t// now add the height of everythign we have output'\n\n\t\t/**\n\t\t * if there's less than 20 mm on this page\n\t\t *\tgoto next page\n\t\t */\n//\t\t$remHeight\t=\t$frm->skipLine(\t$this->myTablePar) ;\n//\t\tif ( $remHeight < mmToPt( $this->saveZone)) {\n//\t\t\t$this->tableFoot() ;\n//\t\t\t$this->myDoc->newPage() ;\n//\t\t\t$this->tableHead() ;\n//\t\t}\n\t}", "function end_table() {\n if ($this->_cellopen) {\n $this->end_cell();\n }\n // Close any open table rows\n if ($this->_rowopen) {\n $this->end_row();\n }\n ?></table><?php\n echo \"\\n\";\n\n $this->reset_table();\n }", "public function register_end()\n {\n echo \"Ended the Action \";\n date_default_timezone_set('Europe/Berlin');\n //Array that keeps the localtime \n $arrayt = localtime();\n //calculates seconds rn for further use\n $timeRN = $arrayt[0] + ($arrayt[1] * 60) + ($arrayt[2] * 60 * 60); //in seconds\n\n $jsondecode = file_get_contents($this->save);\n $decoded = json_decode($jsondecode, true);\n for ($i = 0; $i < count($decoded); $i++) {\n if ($decoded[$i][0]['Endtime'] == NULL) {\n $decoded[$i][0]['Endtime'] = $timeRN;\n $encoded = json_encode($decoded);\n file_put_contents($this->save, $encoded);\n }\n }\n }", "public function timesheetAction()\r\n {\r\n $project = $this->projectService->getProject($this->_getParam('projectid'));\r\n $client = $this->clientService->getClient($this->_getParam('clientid'));\r\n \r\n if (!$project && !$client) {\r\n return;\r\n }\r\n \r\n if ($project) {\r\n $start = date('Y-m-d', strtotime($project->started) - 86400);\r\n $this->view->tasks = $this->projectService->getSummaryTimesheet(null, null, $project->id, null, null, $start, null);\r\n } else {\r\n $start = date('Y-m-d', strtotime($client->created));\r\n $this->view->tasks = $this->projectService->getSummaryTimesheet(null, null, null, $client->id, null, $start, null);\r\n }\r\n\r\n $this->renderRawView('timesheet/ajax-timesheet-summary.php');\r\n }", "public function timeManagement() {\n\t\t$pageTitle = 'Time Management';\n\t\t// $stylesheet = '';\n\n\t\tinclude_once SYSTEM_PATH.'/view/header.php';\n\t\tinclude_once SYSTEM_PATH.'/view/academic-help/time-management.php';\n\t\tinclude_once SYSTEM_PATH.'/view/footer.php';\n\t}", "public function endRun(): void\n {\n $file = $this->getLogDir() . 'timeReport.json';\n $data = is_file($file) ? json_decode(file_get_contents($file), true) : [];\n $data = array_replace($data, $this->timeList);\n file_put_contents($file, json_encode($data, JSON_PRETTY_PRINT));\n }", "public function timeWorkshop() {\n\t\t$pageTitle = 'Time Management Strategies Workshop';\n\t\t// $stylesheet = '';\n\n\t\tinclude_once SYSTEM_PATH.'/view/header.php';\n\t\tinclude_once SYSTEM_PATH.'/view/academic-help/owsub-time.php';\n\t\tinclude_once SYSTEM_PATH.'/view/footer.php';\n\t}", "public function testUpdateTimesheet()\n {\n }", "public function close_sheet($columns) {\n echo \"</table>\";\n }", "public function whereTime() {\n\t\t$pageTitle = 'Where Does Time Go';\n\t\t// $stylesheet = '';\n\n\t\tinclude_once SYSTEM_PATH.'/view/header.php';\n\t\tinclude_once SYSTEM_PATH.'/view/academic-help/tmsub-where-time.php';\n\t\tinclude_once SYSTEM_PATH.'/view/footer.php';\n\t}", "function update_end()\n {\n }", "function createWorkbook($recordset, $StartDay, $EndDay)\n{\n\n global $objPHPExcel;\n $objPHPExcel->createSheet(1);\n $objPHPExcel->createSheet(2);\n\n $objPHPExcel->getDefaultStyle()->getFont()->setSize(7);\n\n // Set document properties\n $objPHPExcel->getProperties()->setCreator(\"HTC\")\n ->setLastModifiedBy(\"HTC\")\n ->setTitle(\"HTC - State Fair Schedule \" . date(\"Y\"))\n ->setSubject(\"State Fair Schedule \" . date(\"Y\"))\n ->setDescription(\"State Fair Schedule \" . date(\"Y\"));\n\n addHeaders($StartDay, $EndDay);\n addTimes($StartDay,$EndDay);\n // Add some data\n addWorksheetData($recordset);\n\n\n // adding data required for spreadsheet to work properly\n addStaticData();\n\n // Rename worksheet\n $objPHPExcel->setActiveSheetIndex(2)->setTitle('Overnight');\n $objPHPExcel->setActiveSheetIndex(1)->setTitle('Night');\n $objPHPExcel->setActiveSheetIndex(0)->setTitle('Morning');\n\n\n\n $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');\n\n $objWriter->save('../Export/excel/Schedule' . date(\"Y\") . '.xls');\n\n return 'Schedule' . date(\"Y\") . '.xls';\n\n}", "public function sectionEnd() {}", "public function sectionEnd() {}", "public function getDateTimeObjectEnd();", "function end();", "abstract public function bootEndTabSet();", "function createHourLogSheet($name, $data, &$workBook, $ambs){\n\t$file = 0;\n\t$excel = 1;\n\n\t$cols = array('Log ID', 'Date', 'Date Logged', 'Ambassador', 'Event Name', 'Hours', 'People', 'Schools', 'Experience', 'Questions', 'Would make your job better', 'Improvements you could make');\n\t$entries = array('id', 'eventDate', 'logTime', 'ambassador', 'eventName', 'hours', 'peopleInteracted', 'otherSchools', 'experience', 'questions', 'madeJobBetter', 'improvements');\n\n\t$numSemesterTours = count($data);\n\tif($excel)\n\t\t$tourSheet = & $workBook->add_worksheet($name. ' Hours');\n\tif($file)\n\t\tfwrite($f, \"\\nWorksheet: $name Tours\\n\");\n\t$numCols = count($cols);\n\n\t//Set the column widths\n\tfor($col = 0; $col < $numCols; $col++){\n\t\t$colName = $cols[$col];\n\t\t$colRef = $entries[$col];\t\n\t\t$maxWidth = getTextWidth($colName);\n\t\tif($excel)\n\t\t\t$tourSheet->write_string(0, $col, $colName);\n\t\tif($file)\n\t\t\tfwrite($f, \"Row: 0, Col: $col, $colRef: $colName, width:$maxWidth\\t\");\n\n\t\tfor($logNum = 0; $logNum < $numSemesterTours; $logNum++){\n\t\t\t$text = $data[$logNum][$colRef];\n\t\t\tif($colRef == 'ambassador')\n\t\t\t{\n\t\t\t\t$text = $ambs[\"$text\"]['name'];\n\t\t\t}\n\t\t\t$width = getTextWidth($text);\n\t\t\tif($width > $maxWidth){\n\t\t\t\t$maxWidth = $width;\n\t\t\t}\n\t\t\t/*\n\t\t\t //formats do not work at the moment\n\t\t\t if($col == 0){\n\t\t\t\t$tourSheet->set_row($logNum + 1, NULL, $formatOffset + ($tour % 2));\n\t\t\t}\n\t\t\t*/\n\t\t}\n\t\tif($file)\n\t\t\tfwrite($f, \"\\n\");\n\t\tif($excel)\n\t\t\t$tourSheet->set_column($col, $col, $maxWidth * (2.0/3.0));\n\t}\n\n\t//Now we just add all the logs to the right page\n\tfor($col = 0; $col < $numCols; $col++){\n\t\t$colRef = $entries[$col];\n\t\tfor($logNum = 0; $logNum < $numSemesterTours; $logNum++){\n\t\t\t$text = $data[$logNum][$colRef];\n\t\t\tif($colRef == 'ambassador')\n\t\t\t{\n\t\t\t\t$text = $ambs[\"$text\"]['name'];\n\t\t\t}\n if(is_numeric($text)){\n \tif ($colRef == 'hours') {\n $tourSheet->write_number($logNum + 1, $col, floatval($text));\n }\n else {\n\t\t\t\t $tourSheet->write_number($logNum + 1, $col, intval($text));\n }\n\t\t\t} else {\n\t\t\t\t$tourSheet->write_string($logNum + 1, $col, $text);\n\t\t\t}\n\t\t}\n\t}\n}", "function\ttableFoot() {\n\n\t\t/**\n\t\t *\n\t\t */\n\t\t$frm\t=\t$this->myDoc->currMasterPage->getFrameByFlowName( \"Auto\") ;\n\t\tif ( $this->myDoc->pageNr >= 1) {\n\t\t\tfor ( $actRow=$this->myTable->getFirstRow( BRow::RTFooterCT) ; $actRow !== FALSE ; $actRow=$this->myTable->getNextRow()) {\n\t\t\t\tif ( $actRow->isEnabled()) {\n\t\t\t\t\t$this->punchTableRow( $actRow) ;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$frm->currVerPos\t+=\t1.5 ;\t\t// now add the height of everything we have output'\n\t\t}\n\t\tfor ( $actRow=$this->myTable->getFirstRow( BRow::RTFooterPE) ; $actRow !== FALSE ; $actRow=$this->myTable->getNextRow()) {\n\t\t\t$this->punchTableRow( $actRow) ;\n\t\t}\n\t\t$frm->currVerPos\t+=\t1.5 ;\t\t// now add the height of everythign we have output'\n\t}", "function endTable()\n {\n if (! $this->tableIsOpen)\n die('ERROR: TABLE IS NOT STARTED');\n \n $this->documentBuffer .= \"</table>\\n\";\n \n $this->tableIsOpen = false;\n $this->tableLastRow = 0;\n }", "function Footer(){\n $this->SetY(-12);\n\n $this->Cell(0,5,'Page '.$this->PageNo(),0,0,'L');\n $this->Cell(0,5,iconv( 'UTF-8','cp874','วันที่พิมพ์ :'.date('d').'/'.date('m').'/'.(date('Y')+543)),0,0,\"R\");\n}", "public function _end_block()\n\t{\n\t\t//echo '</table>';\n\t}", "public function endMaintenancePeriod() : void\n {\n $this->getHesAdminDb()->update('\n UPDATE maintenance_periods SET end_time = now() WHERE end_time IS NULL\n ');\n }", "public function end(): void\n {\n }", "Public function end()\n\t{\n\t\t$this->endTimer = microtime(TRUE);\n\t}", "public function hasEndtime(){\n return $this->_has(8);\n }", "public function close_sheet($columns) {\n echo \"]\";\n }", "private function add_events()\r\n {\r\n $events = $this->events;\r\n foreach ($events as $time => $items)\r\n {\r\n $column = date('H', $time) / $this->hour_step + 1;\r\n foreach ($items as $item)\r\n {\r\n $content = $item['content'];\r\n $row = $item['index'] + 1;\r\n \r\n $cell_content = $this->getCellContents($row, $column);\r\n $cell_content .= $content;\r\n $this->setCellContents($row, $column, $cell_content);\r\n }\r\n }\r\n \r\n }", "abstract public function bootEndTab();", "public function finish()\n {\n parent::finish();\n \n // this widget must have a parent, and it's subject must be a participant\n if( is_null( $this->parent ) || 'participant' != $this->parent->get_subject() )\n throw new exc\\runtime(\n 'Appointment widget must have a parent with participant as the subject.', __METHOD__ );\n\n $db_participant = new db\\participant( $this->parent->get_record()->id );\n \n // determine the time difference\n $db_address = $db_participant->get_first_address();\n $time_diff = is_null( $db_address ) ? NULL : $db_address->get_time_diff();\n\n // need to add the participant's timezone information as information to the date item\n $site_name = bus\\session::self()->get_site()->name;\n if( is_null( $time_diff ) )\n $note = 'The participant\\'s time zone is not known.';\n else if( 0 == $time_diff )\n $note = sprintf( 'The participant is in the same time zone as the %s site.',\n $site_name );\n else if( 0 < $time_diff )\n $note = sprintf( 'The participant\\'s time zone is %s hours ahead of %s\\'s time.',\n $time_diff,\n $site_name );\n else if( 0 > $time_diff )\n $note = sprintf( 'The participant\\'s time zone is %s hours behind %s\\'s time.',\n abs( $time_diff ),\n $site_name );\n\n $this->add_item( 'datetime', 'datetime', 'Date', $note );\n\n // create enum arrays\n $modifier = new db\\modifier();\n $modifier->where( 'active', '=', true );\n $modifier->order( 'rank' );\n $phones = array();\n foreach( $db_participant->get_phone_list( $modifier ) as $db_phone )\n $phones[$db_phone->id] = $db_phone->rank.\". \".$db_phone->number;\n \n // create the min datetime array\n $start_qnaire_date = $this->parent->get_record()->start_qnaire_date;\n $datetime_limits = !is_null( $start_qnaire_date )\n ? array( 'min_date' => substr( $start_qnaire_date, 0, -9 ) )\n : NULL;\n\n // set the view's items\n $this->set_item( 'participant_id', $this->parent->get_record()->id );\n $this->set_item( 'phone_id', '', false, $phones );\n $this->set_item( 'datetime', '', true, $datetime_limits );\n\n $this->set_variable( \n 'is_supervisor', \n 'supervisor' == bus\\session::self()->get_role()->name );\n\n $this->finish_setting_items();\n }", "public function endCurrentRound(){\n global $tpl, $lng, $ilCtrl, $ilTabs;\n\n $ilTabs->activateTab(\"showCurrentRound\");\n\n $this->object->endCurrentRound();\n $ilCtrl->redirect($this, \"showCurrentRound\");\n }", "function actionbar_end(){\n\techo '</td></tr>';\n\techo '</thead>';\n\techo '</table>';\n\techo '</div>';\n}", "public function createAppointmentEndTime()\n {\n $dateTime = strtotime(\"+\" . $this->getEndTimeslot()->getWeight() * 900 . \" seconds\", $this->getAppointmentDate()->format('U'));\n $currentDateTime = new \\DateTime();\n $currentDateTime->setTimestamp($dateTime);\n $this->setHiddenAppointmentEndTime($currentDateTime);\n return;\n }", "public function index() {\n $currentDate = (new Datetime())->format('Y-m-d');\n \t$timesheets = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->get();\n \t$schedule = Schedule::whereDate('start_date','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->get();\n \t//Get total time worked\n \t$hours = 0;\n \tforeach ($timesheets as $timesheet) {\n\t \t$date1 = new Datetime($timesheet->start_time);\n\t\t\t$date2 = new Datetime($timesheet->end_time);\n\t\t\t$diff = $date2->diff($date1);\n\n $hours = $hours + (($diff->h * 60) + $diff->i);\n \t}\n //Get total breaks\n $breaks = 0;\n $first_timesheet = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->first();\n $last_timesheet = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->latest()->first();\n if($first_timesheet){\n $date1 = new Datetime($first_timesheet->start_time);\n $date2 = new Datetime($last_timesheet->end_time);\n $diff = $date2->diff($date1);\n $breaks = (($diff->h * 60) + $diff->i) - $hours;\n }\n\n $worked = $this->hoursandmins($hours);\n $breaks = $this->hoursandmins($breaks);\n // First Punch In in current day\n $first_punch_in = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->first();\n return view('attendance/index', ['timesheets'=>$timesheets, 'schedule'=>$schedule, 'first_punch_in'=>$first_punch_in, 'worked'=>$worked, 'breaks'=>$breaks, 'first_timesheet'=>$first_timesheet, 'last_timesheet'=>$last_timesheet]);\n }", "function mkMonthFoot(){\nreturn \"</table>\\n\";\n}", "public function getEnd() {}", "public function testGetTimesheets()\n {\n }", "public function get_endtime()\n {\n }", "protected function end() {\n // must have space after it\n return 'END ';\n }", "function doc_end () {\r\n\t}", "public function eighth_hour_clockout($timesheet)\n\t{\n\t\t$sent_already = $this->CI->clockout_notifications_model->exists(\n\t\t\t$timesheet->user_id,\n\t\t\t'CLOCKOUT_FIRST_8HOUR_WARNING'\n\t\t);\n\n\t\tif ($sent_already) return false;\n\n\t\t// Send notification to managers\n\t\t$this->CI->cfpslack_library->notify(\n\t\t\tsprintf(\n\t\t\t\t$this->CI->config->item('eighth_hour_5min_clockout'),\n\t\t\t\t$this->CI->user_model->get_name($timesheet->user_id),\n\t\t\t\t$timesheet->workorder_id,\n\t\t\t\t$timesheet->id\n\t\t\t)\n\t\t);\n\n\t\t// SMS the user\n\t\t$this->CI->sms_library->send(\n\t\t\t$timesheet->user_id,\n\t\t\t$this->CI->config->item('eighth_hour_sms'),\n\t\t\t$timesheet->workorder_id\n\t\t);\n\n\t\t// Mark sending\n\t\t$this->CI->clockout_notifications_model->create(\n\t\t\t$timesheet->user_id,\n\t\t\t'CLOCKOUT_FIRST_8HOUR_WARNING',\n\t\t\t$timesheet->id\n\t\t);\n\n\t\treturn true;\n\t}", "function table_end(){\n\techo '</table>';\n}", "public function ga_calendar_time_slots()\n {\n // Timezone\n $timezone = ga_time_zone();\n\n // Service & Provider ID\n $current_date = isset($_POST['current_month']) ? esc_html($_POST['current_month']) : '';\n $service_id = isset($_POST['service_id']) ? (int) $_POST['service_id'] : 0;\n $provider_id = isset($_POST['provider_id']) && 'ga_providers' == get_post_type($_POST['provider_id']) ? (int) $_POST['provider_id'] : 0;\n $form_id = isset($_POST['form_id']) ? (int) $_POST['form_id'] : 0;\n\n if ('ga_services' == get_post_type($service_id) && ga_valid_date_format($current_date)) {\n # ok\n } else {\n wp_die('Something went wrong.');\n }\n\n // Date Caption\n $date = new DateTime($current_date, new DateTimeZone($timezone));\n\n // Generate Slots\n $ga_calendar = new GA_Calendar($form_id, $date->format('n'), $date->format('Y'), $service_id, $provider_id);\n echo $ga_calendar->calendar_time_slots($date);\n wp_die();\n }", "public function end()\n {\n }", "function tablecell_close() {\n $this->doc .= '</td>';\n }", "function Footer()\n {\n $this->SetY(-12);\n $this->SetFont('Arial','B',5); \n $this->Cell(505,10,utf8_decode(\"TI. Fecha de creación: \").date(\"d-m-Y H:i\").\" \".\"Pag \".$this->PageNo(),0,0,'C'); \n }", "function Footer()\n {\n $this->SetY(-12);\n $this->SetFont('Arial','B',5); \n $this->Cell(505,10,utf8_decode(\"TI. Fecha de creación: \").date(\"d-m-Y H:i\").\" \".\"Pag \".$this->PageNo(),0,0,'C'); \n }", "public function Footer()\n {\n $this->SetFont('Arial', 'I', 8);\n $this->SetY(-15);\n $this->Write(4, 'Dokumen ini dicetak secara otomatis menggunakan sistem terkomputerisasi');\n\n $time = \"Dicetak pada tanggal \" . date('d-m-Y H:i:s') . \" WIB\";\n\n $this->SetX(-150);\n $this->Cell(0, 4, $time, 0, 0, 'R');\n }", "public function end();", "public function end();", "public function end();", "public function end();", "function FooterRR()\n {\n //Posición: a 2 cm del final\n $this->Ln();\n $this->SetY(-12);\n $this->SetFont('Arial','B',6);\n //Número de página\n $this->Cell(190,4,'Sistema de Control de Ventas y Facturacion \"BOUTIQUE DE ZAPATERIA\"','T',0,'L');\n $this->AliasNbPages();\n $this->Cell(0,4,'Pagina '.$this->PageNo(),'T',1,'R');\n }", "public function testGetTimesheet()\n {\n }", "public function getEnd();", "public function checkTimeEnd(): bool;", "function eo_the_end($format='d-m-Y',$id=''){\n\techo eo_get_the_end($format,$id);\n}", "private function endLap() {\n $lapCount = count( $this->laps ) - 1;\n if ( count( $this->laps ) > 0 ) {\n $this->laps[$lapCount]['end'] = $this->getCurrentTime();\n $this->laps[$lapCount]['total'] = $this->laps[$lapCount]['end'] - $this->laps[$lapCount]['start'];\n }\n }", "public function addtimeAction()\r\n {\r\n\t\t$date = $this->_getParam('start', date('Y-m-d'));\r\n\t\t$time = $this->_getParam('start-time');\r\n\r\n\t\tif (!$time) {\r\n\t\t\t$hour = $this->_getParam('start-hour');\r\n\t\t\t$min = $this->_getParam('start-min');\r\n\t\t\t$time = $hour.':'.$min;\r\n\t\t}\r\n\r\n\t\t$start = strtotime($date . ' ' . $time . ':00');\r\n $end = $start + $this->_getParam('total') * 3600;\r\n $task = $this->projectService->getTask($this->_getParam('taskid'));\r\n $user = za()->getUser();\r\n\r\n $this->projectService->addTimesheetRecord($task, $user, $start, $end);\r\n\r\n\t\t$this->view->task = $task;\r\n\t\t\r\n\t\tif ($this->_getParam('_ajax')) {\r\n\t\t\t$this->renderRawView('timesheet/timesheet-submitted.php');\r\n\t\t}\r\n }", "public function end() {}", "public function end() {}", "public function end() {}", "abstract protected function doEnd();", "public function Footer(){\n // Posición: a 1,5 cm del final\n $this->SetY(-20);\n // Arial italic 8\n $this->AddFont('Futura-Medium');\n $this->SetFont('Futura-Medium','',10);\n $this->SetTextColor(50,50,50);\n // Número de págin\n $this->Cell(3);\n $this->Cell(0,3,utf8_decode('Generado por GetYourGames'),0,0,\"R\");\n $this->Ln(4);\n $this->Cell(3);\n $this->Cell(0,3,utf8_decode(date(\"d-m-Y g:i a\").' - Página ').$this->PageNo(),0,0,\"R\");\n\n }", "public function mytimesheet($start = null, $end = null)\n\t{\n\n\t\t$me = (new CommonController)->get_current_user();\n\t\t// $auth = Auth::user();\n\t\t//\n\t\t// $me = DB::table('users')\n\t\t// ->leftJoin( DB::raw('(select Max(Id) as maxid,TargetId from files where Type=\"User\" Group By TargetId) as max'), 'max.TargetId', '=', 'users.Id')\n\t\t// ->leftJoin('files', 'files.Id', '=', DB::raw('max.`maxid` and files.`Type`=\"User\"'))\n\t\t// // ->leftJoin('accesscontrols', 'accesscontrols.UserId', '=', 'users.Id')\n\t\t// ->where('users.Id', '=',$auth -> Id)\n\t\t// ->first();\n\n\t\t// $showleave = DB::table('leaves')\n\t\t// ->leftJoin('leavestatuses', 'leaves.Id', '=', 'leavestatuses.LeaveId')\n\t\t// ->leftJoin('users as applicant', 'leaves.UserId', '=', 'applicant.Id')\n\t\t// ->leftJoin('accesscontrols', 'accesscontrols.UserId', '=', 'applicant.Id')\n\t\t// ->leftJoin('users as approver', 'leavestatuses.UserId', '=', 'approver.Id')\n\t\t// ->select('leaves.Id','applicant.Name','leaves.Leave_Type','leaves.Leave_Term','leaves.Start_Date','leaves.End_Date','leaves.Reason','leaves.created_at as Application_Date','approver.Name as Approver','leavestatuses.Leave_Status as Status','leavestatuses.updated_at as Review_Date','leavestatuses.Comment')\n\t\t// ->where('accesscontrols.Show_Leave_To_Public', '=', 1)\n\t\t// ->orderBy('leaves.Id','desc')\n\t\t// ->get();\n\t\t$d=date('d');\n\n\t\tif ($start==null)\n\t\t{\n\n\t\t\tif($d>=21)\n\t\t\t{\n\n\t\t\t\t$start=date('d-M-Y', strtotime('first day of this month'));\n\t\t\t\t$start = date('d-M-Y', strtotime($start . \" +20 days\"));\n\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\t$start=date('d-M-Y', strtotime('first day of last month'));\n\t\t\t\t$start = date('d-M-Y', strtotime($start . \" +20 days\"));\n\n\t\t\t}\n\t\t}\n\n\t\tif ($end==null)\n\t\t{\n\t\t\tif($d>=21)\n\t\t\t{\n\n\t\t\t\t$end=date('d-M-Y', strtotime('first day of next month'));\n\t\t\t\t$end = date('d-M-Y', strtotime($end . \" +19 days\"));\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\t$end=date('d-M-Y', strtotime('first day of this month'));\n\t\t\t\t$end = date('d-M-Y', strtotime($end . \" +19 days\"));\n\n\t\t\t}\n\n\t\t}\n\n\t\t$mytimesheet = DB::table('timesheets')\n\t\t->select('timesheets.Id','timesheets.UserId','timesheets.Latitude_In','timesheets.Longitude_In','timesheets.Latitude_Out','timesheets.Longitude_Out','timesheets.Date',DB::raw('\"\" as Day'),'holidays.Holiday','timesheets.Site_Name','timesheets.Check_In_Type','leaves.Leave_Type','leavestatuses.Leave_Status',\n\t\t'timesheets.Time_In','timesheets.Time_Out','timesheets.Leader_Member','timesheets.Next_Person','timesheets.State','timesheets.Work_Description','timesheets.Remarks','approver.Name as Approver','timesheetstatuses.Status','leaves.Leave_Type','timesheetstatuses.Comment','timesheetstatuses.updated_at as Updated_At','files.Web_Path')\n\t\t->leftJoin( DB::raw('(select Max(Id) as maxid,TargetId from files where Type=\"Timesheet\" Group By TargetId) as maxfile'), 'maxfile.TargetId', '=', 'timesheets.Id')\n\t\t->leftJoin('files', 'files.Id', '=', DB::raw('maxfile.`maxid` and files.`Type`=\"Timesheet\"'))\n\t\t->leftJoin( DB::raw('(select Max(Id) as maxid,TimesheetId from timesheetstatuses Group By TimesheetId) as max'), 'max.TimesheetId', '=', 'timesheets.Id')\n\t\t->leftJoin('timesheetstatuses', 'timesheetstatuses.Id', '=', DB::raw('max.`maxid`'))\n\t\t->leftJoin('users as approver', 'timesheetstatuses.UserId', '=', 'approver.Id')\n\t\t// ->leftJoin('leaves','leaves.UserId','=',DB::raw('timesheets.Id AND str_to_date(timesheets.Date,\"%d-%M-%Y\") Between str_to_date(leaves.Start_Date,\"%d-%M-%Y\") and str_to_date(leaves.End_Date,\"%d-%M-%Y\")'))\n\t\t->leftJoin('leaves','leaves.UserId','=',DB::raw($me->UserId.' AND str_to_date(timesheets.Date,\"%d-%M-%Y\") Between str_to_date(leaves.Start_Date,\"%d-%M-%Y\") and str_to_date(leaves.End_Date,\"%d-%M-%Y\")'))\n\t\t->leftJoin( DB::raw('(select Max(Id) as maxid,LeaveId from leavestatuses Group By LeaveId) as maxleave'), 'maxleave.LeaveId', '=', 'leaves.Id')\n\t\t->leftJoin('leavestatuses', 'leavestatuses.Id', '=', DB::raw('maxleave.`maxid`'))\n\t\t->leftJoin('holidays',DB::raw('1'),'=',DB::raw('1 AND str_to_date(timesheets.Date,\"%d-%M-%Y\") Between str_to_date(holidays.Start_Date,\"%d-%M-%Y\") and str_to_date(holidays.End_Date,\"%d-%M-%Y\")'))\n\t\t->where('timesheets.UserId', '=', $me->UserId)\n\t\t->where(DB::raw('str_to_date(timesheets.Date,\"%d-%M-%Y\")'), '>=', DB::raw('str_to_date(\"'.$start.'\",\"%d-%M-%Y\")'))\n\t\t->where(DB::raw('str_to_date(timesheets.Date,\"%d-%M-%Y\")'), '<=', DB::raw('str_to_date(\"'.$end.'\",\"%d-%M-%Y\")'))\n\t\t->orderBy('timesheets.Id','desc')\n\t\t->get();\n\n\t\t$user = DB::table('users')->select('users.Id','StaffId','Name','Password','User_Type','Company_Email','Personal_Email','Contact_No_1','Contact_No_2','Nationality','Permanent_Address','Current_Address','Home_Base','DOB','NRIC','Passport_No','Gender','Marital_Status','Position','Emergency_Contact_Person',\n\t\t'Emergency_Contact_No','Emergency_Contact_Relationship','Emergency_Contact_Address','files.Web_Path')\n\t\t// ->leftJoin('files', 'files.TargetId', '=', DB::raw('users.`Id` and files.`Type`=\"User\"'))\n\t\t->leftJoin( DB::raw('(select Max(Id) as maxid,TargetId from files where Type=\"User\" Group By Type,TargetId) as max'), 'max.TargetId', '=', 'users.Id')\n\t\t->leftJoin('files', 'files.Id', '=', DB::raw('max.`maxid` and files.`Type`=\"User\"'))\n\t\t->where('users.Id', '=', $me->UserId)\n\t\t->first();\n\n\t\t$arrDate = array();\n\t\t$arrDate2 = array();\n\t\t$arrInsert = array();\n\n\t\tforeach ($mytimesheet as $timesheet) {\n\t\t\t# code...\n\t\t\tarray_push($arrDate,$timesheet->Date);\n\t\t}\n\n\t\t$startTime = strtotime($start);\n\t\t$endTime = strtotime($end);\n\n\t\t// Loop between timestamps, 1 day at a time\n\t\tdo {\n\n\t\t\t if (!in_array(date('d-M-Y', $startTime),$arrDate))\n\t\t\t {\n\t\t\t\t array_push($arrDate2,date('d-M-Y', $startTime));\n\t\t\t }\n\n\t\t\t $startTime = strtotime('+1 day',$startTime);\n\n\t\t} while ($startTime <= $endTime);\n\n\t\tforeach ($arrDate2 as $date) {\n\t\t\t# code...\n\t\t\tarray_push($arrInsert,array('UserId'=>$me->UserId, 'Date'=> $date, 'updated_at'=>date('Y-m-d H:i:s')));\n\n\t\t}\n\n\t\tDB::table('timesheets')->insert($arrInsert);\n\n\t\t$options= DB::table('options')\n\t\t->whereIn('Table', [\"users\",\"timesheets\"])\n\t\t->orderBy('Table','asc')\n\t\t->orderBy('Option','asc')\n\t\t->get();\n\n // $mytimesheet = DB::table('timesheets')\n // ->leftJoin('users as submitter', 'timesheets.UserId', '=', 'submitter.Id')\n // ->select('timesheets.Id','submitter.Name','timesheets.Timesheet_Name','timesheets.Date','timesheets.Remarks')\n // ->where('timesheets.UserId', '=', $me->UserId)\n\t\t\t// ->orderBy('timesheets.Id','desc')\n // ->get();\n\n\t\t\t// $hierarchy = DB::table('users')\n\t\t\t// ->select('L2.Id as L2Id','L2.Name as L2Name','L2.Timesheet_1st_Approval as L21st','L2.Timesheet_2nd_Approval as L22nd',\n\t\t\t// 'L3.Id as L3Id','L3.Name as L3Name','L3.Timesheet_1st_Approval as L31st','L3.Timesheet_2nd_Approval as L32nd')\n\t\t\t// ->leftJoin(DB::raw(\"(select users.Id,users.Name,users.SuperiorId,accesscontrols.Timesheet_1st_Approval,accesscontrols.Timesheet_2nd_Approval,accesscontrols.Timesheet_Final_Approval from users left join accesscontrols on users.Id=accesscontrols.UserId) as L2\"),'L2.Id','=','users.SuperiorId')\n\t\t\t// ->leftJoin(DB::raw(\"(select users.Id,users.Name,users.SuperiorId,accesscontrols.Timesheet_1st_Approval,accesscontrols.Timesheet_2nd_Approval,accesscontrols.Timesheet_Final_Approval from users left join accesscontrols on users.Id=accesscontrols.UserId) as L3\"),'L3.Id','=','L2.SuperiorId')\n\t\t\t// ->where('users.Id', '=', $me->UserId)\n\t\t\t// ->get();\n\t\t\t//\n\t\t\t// $final = DB::table('users')\n\t\t\t// ->select('users.Id','users.Name')\n\t\t\t// ->leftJoin('accesscontrols', 'accesscontrols.UserId', '=', 'users.Id')\n\t\t\t// ->where('Timesheet_Final_Approval', '=', 1)\n\t\t\t// ->get();\n\n\t\t\treturn view('mytimesheet', ['me' => $me, 'user' =>$user, 'mytimesheet' => $mytimesheet,'start' =>$start,'end'=>$end,'options' =>$options]);\n\n\t\t\t//return view('mytimesheet', ['me' => $me,'showleave' =>$showleave, 'mytimesheet' => $mytimesheet, 'hierarchy' => $hierarchy, 'final' => $final]);\n\n\t}", "public function endRoundStart() {\n\t\t$this->displayTeamScoreWidget(false);\n\t}", "public function setEndDateTime($timestamp);", "public function ended();", "function close() {\n\n if($this->time_start)\n $this->prn(\"\\nTime spent: \"\n .$this->endTimer().\" seconds\");\n\n if($this->format != \"plain\") \n $this->prn(\"\\n======================= \"\n .\"end logrecord ============================\\n\");\n\n $this->quit();\n }", "function Footer(){\n\t\t$this->Cell(190,0,'','T',1,'',true);\n\t\t\n\t\t//Go to 1.5 cm from bottom\n\t\t$this->SetY(-15);\n\t\t\t\t\n\t\t$this->SetFont('Arial','',8);\n\t\t\n\t\t//width = 0 means the cell is extended up to the right margin\n\t\t$this->Cell(0,10,'Page '.$this->PageNo().\" / {pages}\",0,0,'C');\n\t}", "public function Footer(){\n $this->SetFont('Arial','',8);\n $date = new Date();\n $this->SetTextColor(100);\n $this->SetFillColor(245);\n $this->SetY(-10);\n $str = \"Elaborado Por Mercurio\";\n $x = $this->GetStringWidth($str);\n $this->Cell($x+10,5,$str,'T',0,'L');\n $this->Cell(0,5,'Pagina '.$this->PageNo().' de {nb}','T',1,'R');\n }", "public function detailedtimesheetAction()\r\n {\r\n $project = $this->projectService->getProject($this->_getParam('projectid'));\r\n $client = $this->clientService->getClient($this->_getParam('clientid'));\r\n $task = $this->projectService->getTask($this->_getParam('taskid'));\r\n $user = $this->userService->getUserByField('username', $this->_getParam('username'));\r\n\t\t\r\n if (!$project && !$client && !$task && !$user) {\r\n return;\r\n }\r\n\r\n\t\tif ($task) { \r\n $this->view->records = $this->projectService->getDetailedTimesheet(null, $task->id);\r\n } else if ($project) {\r\n \r\n $start = null;\r\n $this->view->records = $this->projectService->getDetailedTimesheet(null, null, $project->id);\r\n } else if ($client) {\r\n \r\n $start = null;\r\n $this->view->records = $this->projectService->getDetailedTimesheet(null, null, null, $client->id);\r\n } else if ($user) {\r\n\t\t\t$this->view->records = $this->projectService->getDetailedTimesheet($user);\r\n\t\t}\r\n\r\n\t\t$this->view->task = $task;\r\n $this->renderRawView('timesheet/ajax-timesheet-details.php');\r\n }", "public function endTabs() {\n\t\t\treturn \"\"; \n\t\t}", "public function end_turn()\n\t{\n\t\t//\t\tpropre a la classe\n\t}", "public function finish()\n {\n // make sure the datetime column isn't blank\n $columns = $this->get_argument( 'columns' );\n if( !array_key_exists( 'datetime', $columns ) || 0 == strlen( $columns['datetime'] ) )\n throw lib::create( 'exception\\notice', 'The date/time cannot be left blank.', __METHOD__ );\n \n foreach( $columns as $column => $value ) $this->get_record()->$column = $value;\n \n // do not include the user_id if this is a site appointment\n if( 0 < $this->get_record()->address_id ) $this->get_record()->user_id = NULL;\n \n if( !$this->get_record()->validate_date() )\n throw lib::create( 'exception\\notice',\n sprintf(\n 'The participant is not ready for a %s appointment.',\n 0 < $this->get_record()->address_id ? 'home' : 'site' ), __METHOD__ );\n \n // no errors, go ahead and make the change\n parent::finish();\n }", "function Footer()\n {\n date_default_timezone_set('UTC+1');\n //Date\n $tDate = date('F j, Y, g:i:s a');\n // Position at 1.5 cm from bottom\n $this->SetY(-15);\n // Arial italic 8\n $this->SetFont('Arial', 'I', 12);\n // Text color in gray\n $this->SetTextColor(128);\n // Page number\n $this->Cell(0, 10,utf8_decode('Page ' . $this->PageNo().' \n CHUYC \n '.$tDate.'\n +237 693 553 454\n '.$this->Image(SITELOGO, 189, 280, 10, 10,'', URLROOT)), 0, 0, 'L');\n }", "function eo_schedule_end($format='d-m-Y',$id=''){\n\techo eo_get_schedule_end($format,$id);\n}", "public function unlockAction()\r\n {\r\n $timesheet = $this->byId();\r\n $this->projectService->unlockTimesheet($timesheet);\r\n $this->redirect('timesheet', 'edit', array('clientid'=>$timesheet->clientid, 'projectid'=>$timesheet->projectid, 'id'=>$timesheet->id));\r\n }", "function setEndTime($event, $time) {\n Timer::timers($event, array(\n 'stop' => $time, \n 'stopped' => true\n ));\n }", "function stats_end(){\n echo \"</table>\\n\";\n echo \"</TD></TR></TABLE>\\n\";\n echo \"</TD></TR></TABLE></CENTER>\\n\";\n echo \"<BR>\\n\";\n}", "function timesheetYear(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mytask=0, $perioduser='')\n{\n\tglobal $bc, $langs;\n\tglobal $form, $projectstatic, $taskstatic;\n\tglobal $periodyear, $displaymode ;\n\n\tglobal $transfertarray;\n\n\t$lastprojectid=0;\n\t$totalcol = array();\n\t$totalline = 0;\n\t$var=true;\n\n\t$numlines=count($lines);\n\tfor ($i = 0 ; $i < $numlines ; $i++)\n\t{\n\t\tif ($parent == 0) $level = 0;\n\n\t\tif ($lines[$i]->fk_parent == $parent)\n\t\t{\n\n\t\t\t// Break on a new project\n\t\t\tif ($parent == 0 && $lines[$i]->fk_project != $lastprojectid)\n\t\t\t{\n\t\t\t\t$totalprojet = array();\n\t\t\t\t$var = !$var;\n\t\t\t\t$lastprojectid=$lines[$i]->fk_project;\n\t\t\t}\n\n\t\t\tprint \"<tr \".$bc[$var].\">\\n\";\n\t\t\t// Ref\n\t\t\tprint '<td>';\n\t\t\t$taskstatic->fetch($lines[$i]->id);\n\t\t\t$taskstatic->label=$lines[$i]->label.\" (\".dol_print_date($lines[$i]->date_start,'day').\" - \".dol_print_date($lines[$i]->date_end,'day').')'\t;\n\t\t\t//print $taskstatic->getNomUrl(1);\n\t\t\tprint $taskstatic->getNomUrl(1,($showproject?'':'withproject'));\n\t\t\tprint '</td>';\n\n\t\t\t// Progress\n\t\t\tprint '<td align=\"right\">';\n\t\t\tprint $lines[$i]->progress.'% ';\n\t\t\tprint $taskstatic->getLibStatut(3);\n\t\t\t\n\t\t\tif ($taskstatic->fk_statut == 3)\n\t\t\t\t$transfertarray[] = $lines[$i]->id;\n\n\t\t\tprint '</td>';\n\n\t\t\t$totalline = 0;\n\t\t\tfor ($month=1;$month<= 12 ;$month++)\n\t\t\t{\n\t\t\t\t$szvalue = fetchSumMonthTimeSpent($taskstatic->id, $month, $periodyear, $perioduser, $displaymode);\n\t\t\t\t$totalline+=$szvalue;\n\t\t\t\t$totalprojet[$month]+=$szvalue;\n\t\t\t\tif ($displaymode==0)\n\t\t\t\t\tprint '<td align=right>'.($szvalue ? convertSecondToTime($szvalue, 'allhourmin'):\"\").'</td>';\n\t\t\t\telse\n\t\t\t\t\tprint '<td align=right>'.($szvalue ? price($szvalue):\"\").'</td>';\n\t\t\t\t// le nom du champs c'est à la fois le jour et l'id de la tache\n\t\t\t}\n\t\t\tif ($displaymode==0)\n\t\t\t\tprint '<td align=right>'.($totalline ? convertSecondToTime($totalline, 'allhourmin'):\"\").'</td>';\n\t\t\telse\n\t\t\t\tprint '<td align=right>'.($totalline ? price($totalline):\"\").'</td>';\n\n\n\t\t\t$inc++;\n\t\t\t$level++;\n\t\t\tif ($lines[$i]->id) timesheetYear($inc, $lines[$i]->id, $lines, $level, $projectsrole, $tasksrole, $mytask, $perioduser);\n\t\t\t$level--;\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//$level--;\n\t\t}\n\t}\n\t\n\tif ($level == 0)\n\t{\n\t\tprint \"<tr class='liste_total'>\\n\";\n\t\tprint '<td colspan=2 align=right><b>Total</b></td>';\n\t\tprint '</td>';\n\t\t$totalline = 0;\n\t\tfor ($month=1;$month<= 12 ;$month++)\n\t\t{\n\t\t\t// on affiche le total du projet\n\t\t\tif ($displaymode==0)\n\t\t\t\tprint '<td align=right>'.($totalgen[$month] ? convertSecondToTime($totalgen[$month], 'allhourmin'):\"\").'</td>';\n\t\t\telse\n\t\t\t\tprint '<td align=right>'.($totalgen[$month] ? price($totalgen[$month]):\"\").'</td>';\n\n\t\t\t$totalline+=$totalgen[$month];\n\t\t}\n\t\t// on affiche le total du projet\n\t\tif ($displaymode==0)\n\t\t\tprint '<td align=right>'.($totalline ? convertSecondToTime($totalline, 'allhourmin'):\"\").'</td>';\n\t\telse\n\t\t\tprint '<td align=right>'.($totalline ? price($totalline):\"\").'</td>';\n\n\t\tprint \"</tr>\\n\";\n\t}\n\treturn $inc;\n}", "public function unsetEndTime(): void\n {\n $this->endTime = [];\n }", "function end()\n\t{\n\t\t$this->over = true;\n\t}", "public function footer() {\n\t}", "public function endPage() {}", "public function addTableFooter() {\n\t\t// auto width\n\t\tforeach ($this->tableParams['auto_width'] as $col)\n\t\t\t$this->xls->getActiveSheet()->getColumnDimensionByColumn($col)->setAutoSize(true);\n\t\t// filter (has to be set for whole range)\n\t\tif (count($this->tableParams['filter']))\n\t\t\t$this->xls->getActiveSheet()->setAutoFilter(PHPExcel_Cell::stringFromColumnIndex($this->tableParams['filter'][0]).($this->tableParams['header_row']).':'.PHPExcel_Cell::stringFromColumnIndex($this->tableParams['filter'][count($this->tableParams['filter']) - 1]).($this->tableParams['header_row'] + $this->tableParams['row_count']));\n\t\t// wrap\n\t\tforeach ($this->tableParams['wrap'] as $col)\n\t\t\t$this->xls->getActiveSheet()->getStyle(PHPExcel_Cell::stringFromColumnIndex($col).($this->tableParams['header_row'] + 1).':'.PHPExcel_Cell::stringFromColumnIndex($col).($this->tableParams['header_row'] + $this->tableParams['row_count']))->getAlignment()->setWrapText(true);\n\t}", "private function Write_Monthly_Table() {\n\t\t$top = 445 + self::VERT_MARGIN;\n\t\t$left = self::HORZ_MARGIN;\n\t\t$label_width = 160;\n\t\t$table_left = $left + $label_width;\n\t\t$cell_width = 55;\n\t\t$row_height = 8.5;\n\t\t\n\t\t/**\n\t\t * Build label backgrounds\n\t\t */\n\t\t$this->pdf->setcolor('fill', 'gray', 0.75, 0, 0, 0);\n\t\t$this->Rect_TL($left, $top, $label_width + ($cell_width * 1), $row_height);\n\t\t$this->pdf->fill();\n\t\t\n\t\t/**\n\t\t * Add the strokes\n\t\t */\n\t\t$this->Rect_TL($table_left, $top, $cell_width, $row_height);\n\t//\t$this->Rect_TL($table_left + ($cell_width * 1), $top, $cell_width, $row_height);\n\t//\t$this->Rect_TL($table_left + ($cell_width * 2), $top, $cell_width, $row_height);\n\t\t$this->pdf->stroke();\n\t\t\n\t\t/**\n\t\t * Add the labels\n\t\t */\n\t\t$this->Text_TL(\"CURRENT PERIOD\",\n\t\t\t$left, $top, \n\t\t\t$label_width, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['LEFT']}\");\n\t\t\n\t\t$this->Text_TL(\"PERIOD\",\n\t\t\t$table_left, $top, \n\t\t\t$cell_width, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['CENTER']}\");\n\t\t\n\t\t/*$this->Text_TL(\"WEEK\",\n\t\t\t$table_left + ($cell_width * 1), $top, \n\t\t\t$cell_width, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['CENTER']}\");\n\t\t\n\t\t$this->Text_TL(\"MONTH\",\n\t\t\t$table_left + ($cell_width * 2), $top, \n\t\t\t$cell_width, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['CENTER']}\");*/\n\t\t\t\n\t\t$current_row = 1;\n\t\t$totals = array(\n\t\t\t'weekly' => 0,\n\t\t\t'biweekly' => 0,\n\t\t\t'semimonthly' => 0,\n\t\t\t'monthly' => 0,\n\t\t);\n\t\tforeach ($this->data['period'] as $label => $values) {\n\t\t\t/**\n\t\t\t * Special processing\n\t\t\t */\n\t\t\tswitch ($label) {\n\t\t\t\tcase 'nsf$':\n\t\t\t\t\tcontinue 2;\n\t\t\t\tcase 'debit returns':\n//\t\t\t\t\t$this->pdf->setcolor('fill', 'rgb', 1, 1, 176/255, 0);\n//\t\t\t\t\t$this->Rect_TL($table_left + ($cell_width * 1), $top + ($row_height * $current_row), $cell_width, $row_height);\n//\t\t\t\t\t$this->pdf->fill();\n\t\t\t\t\t\n//\t\t\t\t\t$this->Rect_TL($table_left + ($cell_width * 1), $top + ($row_height * $current_row), $cell_width, $row_height);\n//\t\t\t\t\t$this->pdf->stroke();\n\t\t\t\t\t/*$percentage = $values['month']? number_format($values['month'] / $this->data['monthly']['total debited']['month'] * 100, 1):0;\n\t\t\t\t\t$this->Text_TL($percentage.'%',\n\t\t\t\t\t\t$table_left + ($cell_width * 3), $top + ($row_height * $current_row), \n\t\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['CENTER']}\");*/\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'net cash collected':\n\t\t\t\t\t$this->pdf->setcolor('fill', 'rgb', 1, 1, 176/255, 0);\n\t\t\t\t\t$this->Rect_TL($table_left, $top + ($row_height * $current_row), $cell_width, $row_height);\n\t\t\t\t\t//$this->Rect_TL($table_left + ($cell_width * 1), $top + ($row_height * $current_row), $cell_width, $row_height);\n\t\t\t\t\t//$this->Rect_TL($table_left + ($cell_width * 2), $top + ($row_height * $current_row), $cell_width, $row_height);\n\t\t\t\t\t$this->pdf->fill();\n\t\t\t\t\t\n\t\t\t\t\t//$this->Text_TL(number_format($this->data['period']['total debited']['span'] - $this->data['period']['debit returns']['span'], 2),\n\t\t\t\t\t$this->Text_TL(number_format($this->data['period']['total debited']['span'] - $this->data['period']['nsf$']['span'], 2),\n\t\t\t\t\t\t$table_left, $top + ($row_height * $current_row), \n\t\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\t\t\t\t\n\t\t\t\t\t/*$this->Text_TL(number_format($this->data['monthly']['total debited']['week'] - $this->data['monthly']['debit returns']['week'], 2),\n\t\t\t\t\t\t$table_left + ($cell_width * 1), $top + ($row_height * $current_row), \n\t\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\t\t\t$this->Text_TL(number_format($this->data['monthly']['total debited']['month'] - $this->data['monthly']['debit returns']['month'], 2),\n\t\t\t\t\t\t$table_left + ($cell_width * 2), $top + ($row_height * $current_row), \n\t\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");*/\n\t\t\t\t\tbreak;\n\t\t\t\t//FORBIDDEN ROWS!\n\t\t\t\tcase 'moneygram deposit':\n\t\t\t\t//case 'credit card payments':\n\t\t\t\t\tcontinue 2;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t}\n\t\t\t$format_decimals = 0;\n\t\t\tswitch ($label) {\n\t\t\t\tcase 'new customers':\n\t\t\t\tcase 'card reactivations':\n\t\t\t\tcase 'reactivated customers':\n\t\t\t\tcase 'refunded customers':\n\t\t\t\tcase 'resend customers':\n\t\t\t\tcase 'cancelled customers':\n\t\t\t\tcase 'paid out customers (ach)':\n\t\t\t\tcase 'paid out customers (non-ach)':\n\t\t\t\t\t$format_decimals = 0;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$format_decimals = 2;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t$this->pdf->setcolor('fill', 'gray', 0.75, 0, 0, 0);\n\t\t\t$this->Rect_TL($left, $top + ($row_height * $current_row), $label_width, $row_height);\n\t\t\t$this->pdf->fill();\n\t\t\t\n\t\t\t$this->Rect_TL($table_left, $top + ($row_height * $current_row), $cell_width, $row_height);\n//\t\t\t$this->Rect_TL($table_left + ($cell_width * 1), $top + ($row_height * $current_row), $cell_width, $row_height);\n//\t\t\t$this->Rect_TL($table_left + ($cell_width * 2), $top + ($row_height * $current_row), $cell_width, $row_height);\n\t\t\t$this->pdf->stroke();\n\t\t\t\n\t\t\t$this->Text_TL(strtoupper($label),\n\t\t\t\t$left + $label_indent, $top + ($row_height * $current_row), \n\t\t\t\t$label_width - $label_indent, $row_height,\n\t\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['RIGHT']}\");\n\t\t\t\n\t\t\tif ($label != 'net cash collected') {\n\t\t\t\t$this->Text_TL(number_format($values['span'], $format_decimals),\n\t\t\t\t\t$table_left, $top + ($row_height * $current_row), \n\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\t\t\n\t\t\t\t/*$this->Text_TL(number_format($values['week'], $format_decimals),\n\t\t\t\t\t$table_left + ($cell_width * 1), $top + ($row_height * $current_row), \n\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\t\t\n\t\t\t\t$this->Text_TL(number_format($values['month'], $format_decimals),\n\t\t\t\t\t$table_left + ($cell_width * 2), $top + ($row_height * $current_row), \n\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");*/\n\t\t\t}\n\t\t\t\n\t\t\t$current_row++;\n\t\t}\n\t\t\n\t\t/**\n\t\t * Advances in Collection\n\t\t */\n\t\t$this->pdf->setcolor('fill', 'gray', 0.75, 0, 0, 0);\n\t\t$this->Rect_TL($left, $top + ($row_height * $current_row), $label_width, $row_height);\n\t\t$this->pdf->fill();\n\t\t\n\t\t$this->Rect_TL($table_left, $top + ($row_height * $current_row), $cell_width, $row_height);\n\t\t$this->pdf->stroke();\n\t\t\n\t\t$this->Text_TL(\"ADVANCES IN COLLECTION\",\n\t\t\t$left, $top + ($row_height * $current_row), \n\t\t\t$label_width, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['RIGHT']}\");\n\t\t\n\t\t$this->Text_TL(number_format($this->data['advances_collections'], 2),\n\t\t\t$table_left, $top + ($row_height * $current_row), \n\t\t\t$cell_width, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\n\t\t/**\n\t\t * Advances in Active\n\t\t */\n\t\t$this->pdf->setcolor('fill', 'gray', 0.75, 0, 0, 0);\n\t\t$this->Rect_TL($table_left + ($cell_width * 4), $top + ($row_height * $current_row), $cell_width * 2, $row_height);\n\t\t$this->pdf->fill();\n\t\t\n\t\t$this->Rect_TL($table_left + ($cell_width * 6), $top + ($row_height * $current_row), $cell_width, $row_height);\n\t\t$this->pdf->stroke();\n\t\t\n\t\t$this->Text_TL(\"ACTIVE ADVANCES OUT\",\n\t\t\t$table_left + ($cell_width * 4), $top + ($row_height * $current_row), \n\t\t\t$cell_width * 2, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['RIGHT']}\");\n\t\t\n\t\t$this->Text_TL(number_format($this->data['advances_active'], 2),\n\t\t\t$table_left + ($cell_width * 6), $top + ($row_height * $current_row), \n\t\t\t$cell_width, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\n\t}", "public function setEndtime($endtime){\n $this->_endtime = $endtime;\n }", "public function endTimer() {\n $this->time_end = microtime(true);\n $this->time = number_format(($this->time_end - $this->time_start), 5);\n static::$total_exec += $this->time;\n }", "function section_end(){\n\techo '</div>';\n\techo '</div>';\n}", "function Footer()\n\t{\n\t\t$this->SetY(-15);\n\t\t// Select Arial italic B\n\t\t$this->setfont('Arial','I',14);\n\t\t$this->cell(250,8,\"Proyecto Final, copyright &copy; 2019\",0,0,'c');\n\t\t// Print centered page numbre\n\t\t$this->Cell(0,10,'Pag.'.$this->PageNo(),0,0,'c');\n\t}", "public function endFunctionFirst() {\n\t\t/*$this->getAllStudents();\n\t\t$this->archive_budgetinfo_details();\n\t\t$this->archive_student_balance();\n\t\t$this->archive_grade_details();\n\t\t$this->archive_transcript_grades();\n\t\t$this->insert_rank(); //to fix\n\t\t/*$query1 = $this->conn->query(\"UPDATE system_settings SET edit_class ='No', student_transfer ='No' where sy_status ='Current'\") or die(\"failed1\");\n\t\t$query2 = $this->conn->query(\"UPDATE faculty SET enroll_privilege ='No'\") or die(\"failed4\");\n\t\t$query3 = $this->conn->query(\"UPDATE budget_info SET acc_amount = '0'\");\n\t\t$query4 = $this->conn->query(\"DELETE FROM announcements where holiday ='No'\");\n\t\t$query5 = $this->conn->query(\"DELETE from promote_list where prom_sy = (SELECT YEAR(sy_start) from system_settings where sy_status = 'Ended' ORDER BY 1 desc LIMIT 1)\");*/\n\t\t/*$this->promote_students();*/\n\t\t/*$query7 = $this->conn->query(\"DELETE FROM grades\");\n\t\tif($query1){\n\t\t\t$this->Message('Success!', 'The school year has been ended!', 'success', 'treasurer-end-trial');\n\t\t} else{\n\t\t\t$this->Message('Error!', 'Cannot end school year', 'error', 'treasurer-end-trial');\n\t\t}*/\n\t\t\n\t}", "function metabox_date_time($post){\n\t\tglobal $postmec;\n\t\tinclude $postmec->get_postmec_dir() . 'metaboxes/event_start_end_defining.php';\n\t}", "public static function hour()\n\t{\n\t\t$reservations = \\Model_Lessontime::find(\"all\", [\n\t\t\t\"where\" => [\n\t\t\t\t[\"deleted_at\", 0],\n\t\t\t\t[\"status\", 1],\n\t\t\t\t[\"freetime_at\", \"<=\", time() + 3600],\n\t\t\t\t[\"freetime_at\", \">=\", time()],\n\t\t\t]\n\t\t]);\n\n\t\tforeach($reservations as $reservation){\n\n\t\t\t// for teacher\n\t\t\t$url = \"http://game-bootcamp.com/teachers/top\";\n\n\t\t\t$body = \\View::forge(\"email/teachers/reminder_1hour\",[\"url\" => $url]);\n\t\t\t$sendmail = \\Email::forge(\"JIS\");\n\t\t\t$sendmail->from(\\Config::get(\"statics.info_email\"),\\Config::get(\"statics.info_name\"));\n\t\t\t$sendmail->to($reservation->teacher->email);\n\t\t\t$sendmail->subject(\"Your lesson will start.\");\n\t\t\t$sendmail->html_body(htmlspecialchars_decode($body));\n\n\t\t\t$sendmail->send();\n\n\t\t\t// for student\n\t\t\t$url = \"http://game-bootcamp.com/students/top\";\n\n\t\t\t$body = \\View::forge(\"email/students/reminder_1hour\",[\"url\" => $url]);\n\t\t\t$sendmail = \\Email::forge(\"JIS\");\n\t\t\t$sendmail->from(\\Config::get(\"statics.info_email\"),\\Config::get(\"statics.info_name\"));\n\t\t\t$sendmail->to($reservation->student->email);\n\t\t\t$sendmail->subject(\"Your lesson will start.\");\n\t\t\t$sendmail->html_body(htmlspecialchars_decode($body));\n\n\t\t\t$sendmail->send();\n\t\t}\n\t}", "public function timesheetAction(Employee $admin)\n {\n\t\t$validateForm = $this->createValidateForm($admin->getEmployee());\n\t\t$this->setActivity($admin->getEmployee()->getName().\" \".$admin->getEmployee()->getFirstname().\" timesheets are consulted\");\n $em = $this->getDoctrine()->getManager();\n $aTimesheets = $em->getRepository('BoAdminBundle:Timesheet')->getTsByEmployee($admin->getEmployee(),2);\n return $this->render('BoAdminBundle:Admin:timesheet.html.twig', array(\n 'employee' => $admin->getEmployee(),\n\t\t\t'validate_form' => $validateForm->createView(),\n\t\t\t'timesheets'=>$aTimesheets,\n\t\t\t'pm'=>\"personnel\",\n\t\t\t'sm'=>\"admin\",\n ));\n }", "public function indexAction()\r\n {\r\n \tini_set('memory_limit', '64M');\r\n $validFormats = array('weekly');\r\n $format = 'weekly'; // $this->_getParam('format', 'weekly');\r\n \r\n if (!in_array($format, $validFormats)) {\r\n $this->flash('Format not valid');\r\n $this->renderView('error.php');\r\n return;\r\n }\r\n\r\n $reportingOn = 'Dynamic';\r\n \r\n // -1 will mean that by default, just choose all timesheet records\r\n $timesheetid = -1;\r\n\r\n // Okay, so if we were passed in a timesheet, it means we want to view\r\n // the data for that timesheet. However, if that timesheet is locked, \r\n // we want to make sure that the tasks being viewed are ONLY those that\r\n // are found in that locked timesheet.\r\n $timesheet = $this->byId();\r\n\r\n $start = null;\r\n $end = null;\r\n $this->view->showLinks = true;\r\n $cats = array();\r\n\r\n if ($timesheet) {\r\n $this->_setParam('clientid', $timesheet->clientid);\r\n $this->_setParam('projectid', $timesheet->projectid);\r\n if ($timesheet->locked) {\r\n $timesheetid = $timesheet->id;\r\n $reportingOn = $timesheet->title;\r\n } else {\r\n $timesheetid = 0; \r\n $reportingOn = 'Preview: '.$timesheet->title;\r\n }\r\n if (is_array($timesheet->tasktype)) {\r\n \t$cats = $timesheet->tasktype;\r\n } \r\n\r\n $start = date('Y-m-d 00:00:01', strtotime($timesheet->from));\r\n $end = date('Y-m-d 23:59:59', strtotime($timesheet->to)); \r\n $this->view->showLinks = false;\r\n } else if ($this->_getParam('category')){\r\n \t$cats = array($this->_getParam('category'));\r\n }\r\n \r\n \r\n $project = $this->_getParam('projectid') ? $this->byId($this->_getParam('projectid'), 'Project') : null;\r\n\t\t\r\n\t\t$client = null;\r\n\t\tif (!$project) {\r\n \t$client = $this->_getParam('clientid') ? $this->byId($this->_getParam('clientid'), 'Client') : null;\r\n\t\t}\r\n\t\t\r\n $user = $this->_getParam('username') ? $this->userService->getUserByField('username', $this->_getParam('username')) : null;\r\n \r\n\t\t$this->view->user = $user;\r\n\t\t$this->view->project = $project;\r\n\t\t$this->view->client = $client ? $client : ( $project ? $this->byId($project->clientid, 'Client'):null);\r\n\t\t$this->view->category = $this->_getParam('category');\r\n \r\n if (!$start) {\r\n\t // The start date, if not set in the parameters, will be just\r\n\t // the previous monday\r\n\t $start = $this->_getParam('start', $this->calculateDefaultStartDate());\r\n\t // $end = $this->_getParam('end', date('Y-m-d', time()));\r\n\t $end = $this->_getParam('end', date('Y-m-d 23:59:59', strtotime($start) + (6 * 86400)));\r\n }\r\n \r\n // lets normalise the end date to make sure it's of 23:59:59\r\n\t\t$end = date('Y-m-d 23:59:59', strtotime($end));\r\n\r\n $this->view->title = $reportingOn;\r\n \r\n $order = 'endtime desc';\r\n if ($format == 'weekly') {\r\n $order = 'starttime asc';\r\n }\r\n\r\n $this->view->taskInfo = $this->projectService->getTimesheetReport($user, $project, $client, $timesheetid, $start, $end, $cats, $order);\r\n \r\n // get the hierachy for all the tasks in the task info. Make sure to record how 'deep' the hierarchy is too\r\n\t\t$hierarchies = array();\r\n\r\n\t\t$maxHierarchyLength = 0;\r\n\t\tforeach ($this->view->taskInfo as $taskinfo) {\r\n\t\t\tif (!isset($hierarchies[$taskinfo->taskid])) {\r\n\t\t\t\t$task = $this->projectService->getTask($taskinfo->taskid);\r\n\t\t\t\t$taskHierarchy = array();\r\n\t\t\t\tif ($task) {\r\n\t\t\t\t\t$taskHierarchy = $task->getHierarchy();\r\n\t\t\t\t\tif (count($taskHierarchy) > $maxHierarchyLength) {\r\n\t\t\t\t\t\t$maxHierarchyLength = count($taskHierarchy);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$hierarchies[$taskinfo->taskid] = $taskHierarchy;\r\n\t\t\t} \r\n\t\t}\r\n\t\r\n\t\t$this->view->hierarchies = $hierarchies;\r\n\t\t$this->view->maxHierarchyLength = $maxHierarchyLength;\r\n\r\n $this->view->startDate = $start;\r\n $this->view->endDate = $end;\r\n $this->view->params = $this->_getAllParams();\r\n $this->view->dayDivision = za()->getConfig('day_length', 8) / 4; // za()->getConfig('day_division', 2);\r\n $this->view->divisionTolerance = za()->getConfig('division_tolerance', 20);\r\n \r\n $outputformat = $this->_getParam('outputformat');\r\n if ($outputformat == 'csv') {\r\n \t$this->_response->setHeader(\"Content-type\", \"text/csv\");\r\n\t $this->_response->setHeader(\"Content-Disposition\", \"inline; filename=\\\"timesheet.csv\\\"\");\r\n\r\n\t echo $this->renderRawView('timesheet/csv-export.php');\r\n } else {\r\n\t\t\tif ($this->_getParam('_ajax')) {\r\n\t\t\t\t$this->renderRawView('timesheet/'.$format.'-report.php');\r\n\t\t\t} else {\r\n\t\t\t\t$this->renderView('timesheet/'.$format.'-report.php');\r\n\t\t\t}\r\n }\r\n }", "public function endPeriod() {\n $this->checkStopLoss();\n //Handle Trailing Stop\n $this->checkTrailingStop();\n $this->checkMarketIfTouched();\n //Check to see if take profit was hit\n $this->checkTakeProfit();\n }" ]
[ "0.65012527", "0.633065", "0.6235519", "0.6131447", "0.59576315", "0.576978", "0.56739116", "0.5628189", "0.56203437", "0.55798835", "0.55670357", "0.5550014", "0.5497997", "0.5479658", "0.5477319", "0.54718435", "0.5458773", "0.5458773", "0.54257894", "0.53933537", "0.5389331", "0.5371797", "0.53468174", "0.53136855", "0.530691", "0.5293245", "0.5290291", "0.5289144", "0.52729964", "0.52602696", "0.526021", "0.5245772", "0.5238381", "0.52339244", "0.5212318", "0.5206336", "0.5206066", "0.51909447", "0.51765597", "0.51762277", "0.5175008", "0.51745254", "0.5172034", "0.51717895", "0.51575184", "0.51561385", "0.5149841", "0.5146806", "0.51451033", "0.5144225", "0.5144225", "0.51240337", "0.512142", "0.512142", "0.512142", "0.512142", "0.5119592", "0.51128334", "0.5101997", "0.5094024", "0.509373", "0.5082607", "0.50652635", "0.50609964", "0.50609964", "0.50609964", "0.5044446", "0.5031335", "0.50235987", "0.5011786", "0.5007789", "0.5007456", "0.500377", "0.50021565", "0.49955156", "0.49955046", "0.4993538", "0.49836656", "0.4978525", "0.49771455", "0.4974806", "0.49671826", "0.49639916", "0.49637806", "0.49616373", "0.4956453", "0.49550876", "0.4954898", "0.49213684", "0.49198386", "0.49161562", "0.49139953", "0.49038795", "0.49009016", "0.48987374", "0.48938075", "0.4891163", "0.48867673", "0.48842895", "0.4880236", "0.48737478" ]
0.0
-1
END TIMESHEET / timesheet /
function approvedTimesheet($type=1, $pg=1, $limit=25) { $this->getMenu(); $form = array(); if($type==1) { $this->session->unset_userdata('client_no'); $this->session->unset_userdata('client_name'); $this->session->unset_userdata('project_no'); } elseif($type==2) { $this->session->unset_userdata('client_no'); $this->session->unset_userdata('client_name'); $this->session->unset_userdata('project_no'); if($this->input->post('client_no')) $form['client_no'] = $this->input->post('client_no'); if($this->input->post('client_name')) $form['client_name'] = $this->input->post('client_name'); if($this->input->post('project_no')) $form['project_no'] = $this->input->post('project_no'); $this->session->set_userdata($form); } if($this->session->userdata('client_no')) $form['client_no'] = $this->session->userdata('client_no'); if($this->session->userdata('client_name')) $form['client_name'] = $this->session->userdata('client_name'); if($this->session->userdata('project_no')) $form['project_no'] = $this->session->userdata('project_no'); if($limit) { $this->session->set_userdata('rpp', $limit); $this->rpp = $limit; } $limit = $limit ? $limit : $this->rpp; $this->data['done'] = $this->timesheetModel->getTimesheetDone(); $this->load->view('timesheet_approvedTimesheet',$this->data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function close_timesheet($timesheet)\n\t{\n\t\t$date = Carbon::now();\n\n\t\t$this->CI->timecard_model->timecard_update(\n\t\t\t$timesheet->id,\n\t\t\t$date->format('h'),\n\t\t\t$date->format('i'),\n\t\t\t$date->format('A'),\n\t\t\t$timesheet->user_id\n\t\t);\n\t}", "public function testCreateTimesheet()\n {\n }", "function testTimeSheet()\n{\n\tcreateClient('The Business', '1993-06-20', 'LeRoy', 'Jenkins', '1234567890', '[email protected]', 'The streets', 'Las Vegas', 'NV');\n\n\t//Create Project to assign task\n\tcreateProject('The Business', 'Build Website', 'Build a website for the Business.');\n\tcreateProject('The Business', 'Fix CSS', 'Restyle the website');\n\n\t//Create Tasks\n\tcreateTask('The Business', 'Build Website', 'Start the Project', 'This is the first task for Build Website.');\n\tcreateTask('The Business', 'Build Website', 'Register domain name', 'Reserach webservices and make a good url');\n\tcreateTask('The Business', 'Fix CSS', 'Start the Project', 'Dont be lazy');\n\n\t//Create Developer to record time\n\tcreateEmployee('SE', 'b.zucker', 'Developer', 'bz', 'Brent', 'Zucker', '4045801384', '[email protected]', 'Columbia St', 'Milledgeville', 'GA');\n\n\t//Create TimeSheet Entry\n\tcreateTimeSheet('b.zucker', 'The Business', 'Build Website', 'Start the Project', '2015-03-02 10-30-00', '2015-03-02 15-30-00');\n\t\n\t//prints out timesheet\n\techo \"<h3>TimeSheet</h3>\";\n\ttest(\"SELECT * FROM TimeSheet\");\n\n\t//deletes the timesheet\n\tdeleteTimeSheet('b.zucker', 'The Business', 'Build Website', 'Start the Project', '2015-03-02 10-30-00', '2015-03-02 15-30-00');\n\n\t//deletes the tasks\n\tdeleteTask('The Business', 'Build Website', 'Start the Project');\n\tdeleteTask('The Business', 'Build Website', 'Register domain name');\n\tdeleteTask('The Business', 'Fix CSS', 'Start the Project');\n\n\t//deletes the projects\n\tdeleteProject('The Business', 'Fix CSS');\n\tdeleteProject('The Business', 'Build Website');\n\t\n\t//deletes the client\n\tdeleteClient('The Business');\n\n\t//deletes employee\n\tdeleteEmployee('b.zucker');\n}", "private function endMonthSpacers()\n\t{\n\t\tif((8 - $this->weekDayNum) >= '1') {\n\t\t\t$this->calWeekDays .= \"\\t\\t<td colspan=\\\"\".(8 - $this->weekDayNum).\"\\\" class=\\\"spacerDays\\\">&nbsp;</td>\\n\";\n\t\t\t$this->outArray['lastday'] = (8 - $this->weekDayNum);\t\t\t\n\t\t}\n\t}", "function\tendTable() {\n\n\t\t/**\n\t\t *\n\t\t */\n\t\t$frm\t=\t$this->myDoc->currMasterPage->getFrameByFlowName( \"Auto\") ;\n\t\tfor ( $actRow=$this->myTable->getFirstRow( BRow::RTFooterTE) ; $actRow !== FALSE ; $actRow=$this->myTable->getNextRow()) {\n\t\t\t$this->punchTableRow( $actRow) ;\n\t\t}\n\t\t$frm->currVerPos\t+=\t$this->myTable->currVerPos ;\n\t\t$frm->currVerPos\t+=\t1.5 ;\t\t// now add the height of everythign we have output'\n\n\t\t/**\n\t\t * if there's less than 20 mm on this page\n\t\t *\tgoto next page\n\t\t */\n//\t\t$remHeight\t=\t$frm->skipLine(\t$this->myTablePar) ;\n//\t\tif ( $remHeight < mmToPt( $this->saveZone)) {\n//\t\t\t$this->tableFoot() ;\n//\t\t\t$this->myDoc->newPage() ;\n//\t\t\t$this->tableHead() ;\n//\t\t}\n\t}", "function end_table() {\n if ($this->_cellopen) {\n $this->end_cell();\n }\n // Close any open table rows\n if ($this->_rowopen) {\n $this->end_row();\n }\n ?></table><?php\n echo \"\\n\";\n\n $this->reset_table();\n }", "public function register_end()\n {\n echo \"Ended the Action \";\n date_default_timezone_set('Europe/Berlin');\n //Array that keeps the localtime \n $arrayt = localtime();\n //calculates seconds rn for further use\n $timeRN = $arrayt[0] + ($arrayt[1] * 60) + ($arrayt[2] * 60 * 60); //in seconds\n\n $jsondecode = file_get_contents($this->save);\n $decoded = json_decode($jsondecode, true);\n for ($i = 0; $i < count($decoded); $i++) {\n if ($decoded[$i][0]['Endtime'] == NULL) {\n $decoded[$i][0]['Endtime'] = $timeRN;\n $encoded = json_encode($decoded);\n file_put_contents($this->save, $encoded);\n }\n }\n }", "public function timesheetAction()\r\n {\r\n $project = $this->projectService->getProject($this->_getParam('projectid'));\r\n $client = $this->clientService->getClient($this->_getParam('clientid'));\r\n \r\n if (!$project && !$client) {\r\n return;\r\n }\r\n \r\n if ($project) {\r\n $start = date('Y-m-d', strtotime($project->started) - 86400);\r\n $this->view->tasks = $this->projectService->getSummaryTimesheet(null, null, $project->id, null, null, $start, null);\r\n } else {\r\n $start = date('Y-m-d', strtotime($client->created));\r\n $this->view->tasks = $this->projectService->getSummaryTimesheet(null, null, null, $client->id, null, $start, null);\r\n }\r\n\r\n $this->renderRawView('timesheet/ajax-timesheet-summary.php');\r\n }", "public function timeManagement() {\n\t\t$pageTitle = 'Time Management';\n\t\t// $stylesheet = '';\n\n\t\tinclude_once SYSTEM_PATH.'/view/header.php';\n\t\tinclude_once SYSTEM_PATH.'/view/academic-help/time-management.php';\n\t\tinclude_once SYSTEM_PATH.'/view/footer.php';\n\t}", "public function endRun(): void\n {\n $file = $this->getLogDir() . 'timeReport.json';\n $data = is_file($file) ? json_decode(file_get_contents($file), true) : [];\n $data = array_replace($data, $this->timeList);\n file_put_contents($file, json_encode($data, JSON_PRETTY_PRINT));\n }", "public function timeWorkshop() {\n\t\t$pageTitle = 'Time Management Strategies Workshop';\n\t\t// $stylesheet = '';\n\n\t\tinclude_once SYSTEM_PATH.'/view/header.php';\n\t\tinclude_once SYSTEM_PATH.'/view/academic-help/owsub-time.php';\n\t\tinclude_once SYSTEM_PATH.'/view/footer.php';\n\t}", "public function testUpdateTimesheet()\n {\n }", "public function close_sheet($columns) {\n echo \"</table>\";\n }", "public function whereTime() {\n\t\t$pageTitle = 'Where Does Time Go';\n\t\t// $stylesheet = '';\n\n\t\tinclude_once SYSTEM_PATH.'/view/header.php';\n\t\tinclude_once SYSTEM_PATH.'/view/academic-help/tmsub-where-time.php';\n\t\tinclude_once SYSTEM_PATH.'/view/footer.php';\n\t}", "function update_end()\n {\n }", "function createWorkbook($recordset, $StartDay, $EndDay)\n{\n\n global $objPHPExcel;\n $objPHPExcel->createSheet(1);\n $objPHPExcel->createSheet(2);\n\n $objPHPExcel->getDefaultStyle()->getFont()->setSize(7);\n\n // Set document properties\n $objPHPExcel->getProperties()->setCreator(\"HTC\")\n ->setLastModifiedBy(\"HTC\")\n ->setTitle(\"HTC - State Fair Schedule \" . date(\"Y\"))\n ->setSubject(\"State Fair Schedule \" . date(\"Y\"))\n ->setDescription(\"State Fair Schedule \" . date(\"Y\"));\n\n addHeaders($StartDay, $EndDay);\n addTimes($StartDay,$EndDay);\n // Add some data\n addWorksheetData($recordset);\n\n\n // adding data required for spreadsheet to work properly\n addStaticData();\n\n // Rename worksheet\n $objPHPExcel->setActiveSheetIndex(2)->setTitle('Overnight');\n $objPHPExcel->setActiveSheetIndex(1)->setTitle('Night');\n $objPHPExcel->setActiveSheetIndex(0)->setTitle('Morning');\n\n\n\n $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');\n\n $objWriter->save('../Export/excel/Schedule' . date(\"Y\") . '.xls');\n\n return 'Schedule' . date(\"Y\") . '.xls';\n\n}", "public function sectionEnd() {}", "public function sectionEnd() {}", "public function getDateTimeObjectEnd();", "function end();", "abstract public function bootEndTabSet();", "function createHourLogSheet($name, $data, &$workBook, $ambs){\n\t$file = 0;\n\t$excel = 1;\n\n\t$cols = array('Log ID', 'Date', 'Date Logged', 'Ambassador', 'Event Name', 'Hours', 'People', 'Schools', 'Experience', 'Questions', 'Would make your job better', 'Improvements you could make');\n\t$entries = array('id', 'eventDate', 'logTime', 'ambassador', 'eventName', 'hours', 'peopleInteracted', 'otherSchools', 'experience', 'questions', 'madeJobBetter', 'improvements');\n\n\t$numSemesterTours = count($data);\n\tif($excel)\n\t\t$tourSheet = & $workBook->add_worksheet($name. ' Hours');\n\tif($file)\n\t\tfwrite($f, \"\\nWorksheet: $name Tours\\n\");\n\t$numCols = count($cols);\n\n\t//Set the column widths\n\tfor($col = 0; $col < $numCols; $col++){\n\t\t$colName = $cols[$col];\n\t\t$colRef = $entries[$col];\t\n\t\t$maxWidth = getTextWidth($colName);\n\t\tif($excel)\n\t\t\t$tourSheet->write_string(0, $col, $colName);\n\t\tif($file)\n\t\t\tfwrite($f, \"Row: 0, Col: $col, $colRef: $colName, width:$maxWidth\\t\");\n\n\t\tfor($logNum = 0; $logNum < $numSemesterTours; $logNum++){\n\t\t\t$text = $data[$logNum][$colRef];\n\t\t\tif($colRef == 'ambassador')\n\t\t\t{\n\t\t\t\t$text = $ambs[\"$text\"]['name'];\n\t\t\t}\n\t\t\t$width = getTextWidth($text);\n\t\t\tif($width > $maxWidth){\n\t\t\t\t$maxWidth = $width;\n\t\t\t}\n\t\t\t/*\n\t\t\t //formats do not work at the moment\n\t\t\t if($col == 0){\n\t\t\t\t$tourSheet->set_row($logNum + 1, NULL, $formatOffset + ($tour % 2));\n\t\t\t}\n\t\t\t*/\n\t\t}\n\t\tif($file)\n\t\t\tfwrite($f, \"\\n\");\n\t\tif($excel)\n\t\t\t$tourSheet->set_column($col, $col, $maxWidth * (2.0/3.0));\n\t}\n\n\t//Now we just add all the logs to the right page\n\tfor($col = 0; $col < $numCols; $col++){\n\t\t$colRef = $entries[$col];\n\t\tfor($logNum = 0; $logNum < $numSemesterTours; $logNum++){\n\t\t\t$text = $data[$logNum][$colRef];\n\t\t\tif($colRef == 'ambassador')\n\t\t\t{\n\t\t\t\t$text = $ambs[\"$text\"]['name'];\n\t\t\t}\n if(is_numeric($text)){\n \tif ($colRef == 'hours') {\n $tourSheet->write_number($logNum + 1, $col, floatval($text));\n }\n else {\n\t\t\t\t $tourSheet->write_number($logNum + 1, $col, intval($text));\n }\n\t\t\t} else {\n\t\t\t\t$tourSheet->write_string($logNum + 1, $col, $text);\n\t\t\t}\n\t\t}\n\t}\n}", "function\ttableFoot() {\n\n\t\t/**\n\t\t *\n\t\t */\n\t\t$frm\t=\t$this->myDoc->currMasterPage->getFrameByFlowName( \"Auto\") ;\n\t\tif ( $this->myDoc->pageNr >= 1) {\n\t\t\tfor ( $actRow=$this->myTable->getFirstRow( BRow::RTFooterCT) ; $actRow !== FALSE ; $actRow=$this->myTable->getNextRow()) {\n\t\t\t\tif ( $actRow->isEnabled()) {\n\t\t\t\t\t$this->punchTableRow( $actRow) ;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$frm->currVerPos\t+=\t1.5 ;\t\t// now add the height of everything we have output'\n\t\t}\n\t\tfor ( $actRow=$this->myTable->getFirstRow( BRow::RTFooterPE) ; $actRow !== FALSE ; $actRow=$this->myTable->getNextRow()) {\n\t\t\t$this->punchTableRow( $actRow) ;\n\t\t}\n\t\t$frm->currVerPos\t+=\t1.5 ;\t\t// now add the height of everythign we have output'\n\t}", "function endTable()\n {\n if (! $this->tableIsOpen)\n die('ERROR: TABLE IS NOT STARTED');\n \n $this->documentBuffer .= \"</table>\\n\";\n \n $this->tableIsOpen = false;\n $this->tableLastRow = 0;\n }", "function Footer(){\n $this->SetY(-12);\n\n $this->Cell(0,5,'Page '.$this->PageNo(),0,0,'L');\n $this->Cell(0,5,iconv( 'UTF-8','cp874','วันที่พิมพ์ :'.date('d').'/'.date('m').'/'.(date('Y')+543)),0,0,\"R\");\n}", "public function _end_block()\n\t{\n\t\t//echo '</table>';\n\t}", "public function endMaintenancePeriod() : void\n {\n $this->getHesAdminDb()->update('\n UPDATE maintenance_periods SET end_time = now() WHERE end_time IS NULL\n ');\n }", "public function end(): void\n {\n }", "Public function end()\n\t{\n\t\t$this->endTimer = microtime(TRUE);\n\t}", "public function hasEndtime(){\n return $this->_has(8);\n }", "public function close_sheet($columns) {\n echo \"]\";\n }", "private function add_events()\r\n {\r\n $events = $this->events;\r\n foreach ($events as $time => $items)\r\n {\r\n $column = date('H', $time) / $this->hour_step + 1;\r\n foreach ($items as $item)\r\n {\r\n $content = $item['content'];\r\n $row = $item['index'] + 1;\r\n \r\n $cell_content = $this->getCellContents($row, $column);\r\n $cell_content .= $content;\r\n $this->setCellContents($row, $column, $cell_content);\r\n }\r\n }\r\n \r\n }", "abstract public function bootEndTab();", "public function finish()\n {\n parent::finish();\n \n // this widget must have a parent, and it's subject must be a participant\n if( is_null( $this->parent ) || 'participant' != $this->parent->get_subject() )\n throw new exc\\runtime(\n 'Appointment widget must have a parent with participant as the subject.', __METHOD__ );\n\n $db_participant = new db\\participant( $this->parent->get_record()->id );\n \n // determine the time difference\n $db_address = $db_participant->get_first_address();\n $time_diff = is_null( $db_address ) ? NULL : $db_address->get_time_diff();\n\n // need to add the participant's timezone information as information to the date item\n $site_name = bus\\session::self()->get_site()->name;\n if( is_null( $time_diff ) )\n $note = 'The participant\\'s time zone is not known.';\n else if( 0 == $time_diff )\n $note = sprintf( 'The participant is in the same time zone as the %s site.',\n $site_name );\n else if( 0 < $time_diff )\n $note = sprintf( 'The participant\\'s time zone is %s hours ahead of %s\\'s time.',\n $time_diff,\n $site_name );\n else if( 0 > $time_diff )\n $note = sprintf( 'The participant\\'s time zone is %s hours behind %s\\'s time.',\n abs( $time_diff ),\n $site_name );\n\n $this->add_item( 'datetime', 'datetime', 'Date', $note );\n\n // create enum arrays\n $modifier = new db\\modifier();\n $modifier->where( 'active', '=', true );\n $modifier->order( 'rank' );\n $phones = array();\n foreach( $db_participant->get_phone_list( $modifier ) as $db_phone )\n $phones[$db_phone->id] = $db_phone->rank.\". \".$db_phone->number;\n \n // create the min datetime array\n $start_qnaire_date = $this->parent->get_record()->start_qnaire_date;\n $datetime_limits = !is_null( $start_qnaire_date )\n ? array( 'min_date' => substr( $start_qnaire_date, 0, -9 ) )\n : NULL;\n\n // set the view's items\n $this->set_item( 'participant_id', $this->parent->get_record()->id );\n $this->set_item( 'phone_id', '', false, $phones );\n $this->set_item( 'datetime', '', true, $datetime_limits );\n\n $this->set_variable( \n 'is_supervisor', \n 'supervisor' == bus\\session::self()->get_role()->name );\n\n $this->finish_setting_items();\n }", "public function endCurrentRound(){\n global $tpl, $lng, $ilCtrl, $ilTabs;\n\n $ilTabs->activateTab(\"showCurrentRound\");\n\n $this->object->endCurrentRound();\n $ilCtrl->redirect($this, \"showCurrentRound\");\n }", "function actionbar_end(){\n\techo '</td></tr>';\n\techo '</thead>';\n\techo '</table>';\n\techo '</div>';\n}", "public function createAppointmentEndTime()\n {\n $dateTime = strtotime(\"+\" . $this->getEndTimeslot()->getWeight() * 900 . \" seconds\", $this->getAppointmentDate()->format('U'));\n $currentDateTime = new \\DateTime();\n $currentDateTime->setTimestamp($dateTime);\n $this->setHiddenAppointmentEndTime($currentDateTime);\n return;\n }", "public function index() {\n $currentDate = (new Datetime())->format('Y-m-d');\n \t$timesheets = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->get();\n \t$schedule = Schedule::whereDate('start_date','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->get();\n \t//Get total time worked\n \t$hours = 0;\n \tforeach ($timesheets as $timesheet) {\n\t \t$date1 = new Datetime($timesheet->start_time);\n\t\t\t$date2 = new Datetime($timesheet->end_time);\n\t\t\t$diff = $date2->diff($date1);\n\n $hours = $hours + (($diff->h * 60) + $diff->i);\n \t}\n //Get total breaks\n $breaks = 0;\n $first_timesheet = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->first();\n $last_timesheet = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->latest()->first();\n if($first_timesheet){\n $date1 = new Datetime($first_timesheet->start_time);\n $date2 = new Datetime($last_timesheet->end_time);\n $diff = $date2->diff($date1);\n $breaks = (($diff->h * 60) + $diff->i) - $hours;\n }\n\n $worked = $this->hoursandmins($hours);\n $breaks = $this->hoursandmins($breaks);\n // First Punch In in current day\n $first_punch_in = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->first();\n return view('attendance/index', ['timesheets'=>$timesheets, 'schedule'=>$schedule, 'first_punch_in'=>$first_punch_in, 'worked'=>$worked, 'breaks'=>$breaks, 'first_timesheet'=>$first_timesheet, 'last_timesheet'=>$last_timesheet]);\n }", "function mkMonthFoot(){\nreturn \"</table>\\n\";\n}", "public function getEnd() {}", "public function testGetTimesheets()\n {\n }", "public function get_endtime()\n {\n }", "protected function end() {\n // must have space after it\n return 'END ';\n }", "function doc_end () {\r\n\t}", "public function eighth_hour_clockout($timesheet)\n\t{\n\t\t$sent_already = $this->CI->clockout_notifications_model->exists(\n\t\t\t$timesheet->user_id,\n\t\t\t'CLOCKOUT_FIRST_8HOUR_WARNING'\n\t\t);\n\n\t\tif ($sent_already) return false;\n\n\t\t// Send notification to managers\n\t\t$this->CI->cfpslack_library->notify(\n\t\t\tsprintf(\n\t\t\t\t$this->CI->config->item('eighth_hour_5min_clockout'),\n\t\t\t\t$this->CI->user_model->get_name($timesheet->user_id),\n\t\t\t\t$timesheet->workorder_id,\n\t\t\t\t$timesheet->id\n\t\t\t)\n\t\t);\n\n\t\t// SMS the user\n\t\t$this->CI->sms_library->send(\n\t\t\t$timesheet->user_id,\n\t\t\t$this->CI->config->item('eighth_hour_sms'),\n\t\t\t$timesheet->workorder_id\n\t\t);\n\n\t\t// Mark sending\n\t\t$this->CI->clockout_notifications_model->create(\n\t\t\t$timesheet->user_id,\n\t\t\t'CLOCKOUT_FIRST_8HOUR_WARNING',\n\t\t\t$timesheet->id\n\t\t);\n\n\t\treturn true;\n\t}", "function table_end(){\n\techo '</table>';\n}", "public function ga_calendar_time_slots()\n {\n // Timezone\n $timezone = ga_time_zone();\n\n // Service & Provider ID\n $current_date = isset($_POST['current_month']) ? esc_html($_POST['current_month']) : '';\n $service_id = isset($_POST['service_id']) ? (int) $_POST['service_id'] : 0;\n $provider_id = isset($_POST['provider_id']) && 'ga_providers' == get_post_type($_POST['provider_id']) ? (int) $_POST['provider_id'] : 0;\n $form_id = isset($_POST['form_id']) ? (int) $_POST['form_id'] : 0;\n\n if ('ga_services' == get_post_type($service_id) && ga_valid_date_format($current_date)) {\n # ok\n } else {\n wp_die('Something went wrong.');\n }\n\n // Date Caption\n $date = new DateTime($current_date, new DateTimeZone($timezone));\n\n // Generate Slots\n $ga_calendar = new GA_Calendar($form_id, $date->format('n'), $date->format('Y'), $service_id, $provider_id);\n echo $ga_calendar->calendar_time_slots($date);\n wp_die();\n }", "public function end()\n {\n }", "function tablecell_close() {\n $this->doc .= '</td>';\n }", "function Footer()\n {\n $this->SetY(-12);\n $this->SetFont('Arial','B',5); \n $this->Cell(505,10,utf8_decode(\"TI. Fecha de creación: \").date(\"d-m-Y H:i\").\" \".\"Pag \".$this->PageNo(),0,0,'C'); \n }", "function Footer()\n {\n $this->SetY(-12);\n $this->SetFont('Arial','B',5); \n $this->Cell(505,10,utf8_decode(\"TI. Fecha de creación: \").date(\"d-m-Y H:i\").\" \".\"Pag \".$this->PageNo(),0,0,'C'); \n }", "public function Footer()\n {\n $this->SetFont('Arial', 'I', 8);\n $this->SetY(-15);\n $this->Write(4, 'Dokumen ini dicetak secara otomatis menggunakan sistem terkomputerisasi');\n\n $time = \"Dicetak pada tanggal \" . date('d-m-Y H:i:s') . \" WIB\";\n\n $this->SetX(-150);\n $this->Cell(0, 4, $time, 0, 0, 'R');\n }", "public function end();", "public function end();", "public function end();", "public function end();", "function FooterRR()\n {\n //Posición: a 2 cm del final\n $this->Ln();\n $this->SetY(-12);\n $this->SetFont('Arial','B',6);\n //Número de página\n $this->Cell(190,4,'Sistema de Control de Ventas y Facturacion \"BOUTIQUE DE ZAPATERIA\"','T',0,'L');\n $this->AliasNbPages();\n $this->Cell(0,4,'Pagina '.$this->PageNo(),'T',1,'R');\n }", "public function testGetTimesheet()\n {\n }", "public function getEnd();", "public function checkTimeEnd(): bool;", "function eo_the_end($format='d-m-Y',$id=''){\n\techo eo_get_the_end($format,$id);\n}", "private function endLap() {\n $lapCount = count( $this->laps ) - 1;\n if ( count( $this->laps ) > 0 ) {\n $this->laps[$lapCount]['end'] = $this->getCurrentTime();\n $this->laps[$lapCount]['total'] = $this->laps[$lapCount]['end'] - $this->laps[$lapCount]['start'];\n }\n }", "public function addtimeAction()\r\n {\r\n\t\t$date = $this->_getParam('start', date('Y-m-d'));\r\n\t\t$time = $this->_getParam('start-time');\r\n\r\n\t\tif (!$time) {\r\n\t\t\t$hour = $this->_getParam('start-hour');\r\n\t\t\t$min = $this->_getParam('start-min');\r\n\t\t\t$time = $hour.':'.$min;\r\n\t\t}\r\n\r\n\t\t$start = strtotime($date . ' ' . $time . ':00');\r\n $end = $start + $this->_getParam('total') * 3600;\r\n $task = $this->projectService->getTask($this->_getParam('taskid'));\r\n $user = za()->getUser();\r\n\r\n $this->projectService->addTimesheetRecord($task, $user, $start, $end);\r\n\r\n\t\t$this->view->task = $task;\r\n\t\t\r\n\t\tif ($this->_getParam('_ajax')) {\r\n\t\t\t$this->renderRawView('timesheet/timesheet-submitted.php');\r\n\t\t}\r\n }", "public function end() {}", "public function end() {}", "public function end() {}", "abstract protected function doEnd();", "public function Footer(){\n // Posición: a 1,5 cm del final\n $this->SetY(-20);\n // Arial italic 8\n $this->AddFont('Futura-Medium');\n $this->SetFont('Futura-Medium','',10);\n $this->SetTextColor(50,50,50);\n // Número de págin\n $this->Cell(3);\n $this->Cell(0,3,utf8_decode('Generado por GetYourGames'),0,0,\"R\");\n $this->Ln(4);\n $this->Cell(3);\n $this->Cell(0,3,utf8_decode(date(\"d-m-Y g:i a\").' - Página ').$this->PageNo(),0,0,\"R\");\n\n }", "public function mytimesheet($start = null, $end = null)\n\t{\n\n\t\t$me = (new CommonController)->get_current_user();\n\t\t// $auth = Auth::user();\n\t\t//\n\t\t// $me = DB::table('users')\n\t\t// ->leftJoin( DB::raw('(select Max(Id) as maxid,TargetId from files where Type=\"User\" Group By TargetId) as max'), 'max.TargetId', '=', 'users.Id')\n\t\t// ->leftJoin('files', 'files.Id', '=', DB::raw('max.`maxid` and files.`Type`=\"User\"'))\n\t\t// // ->leftJoin('accesscontrols', 'accesscontrols.UserId', '=', 'users.Id')\n\t\t// ->where('users.Id', '=',$auth -> Id)\n\t\t// ->first();\n\n\t\t// $showleave = DB::table('leaves')\n\t\t// ->leftJoin('leavestatuses', 'leaves.Id', '=', 'leavestatuses.LeaveId')\n\t\t// ->leftJoin('users as applicant', 'leaves.UserId', '=', 'applicant.Id')\n\t\t// ->leftJoin('accesscontrols', 'accesscontrols.UserId', '=', 'applicant.Id')\n\t\t// ->leftJoin('users as approver', 'leavestatuses.UserId', '=', 'approver.Id')\n\t\t// ->select('leaves.Id','applicant.Name','leaves.Leave_Type','leaves.Leave_Term','leaves.Start_Date','leaves.End_Date','leaves.Reason','leaves.created_at as Application_Date','approver.Name as Approver','leavestatuses.Leave_Status as Status','leavestatuses.updated_at as Review_Date','leavestatuses.Comment')\n\t\t// ->where('accesscontrols.Show_Leave_To_Public', '=', 1)\n\t\t// ->orderBy('leaves.Id','desc')\n\t\t// ->get();\n\t\t$d=date('d');\n\n\t\tif ($start==null)\n\t\t{\n\n\t\t\tif($d>=21)\n\t\t\t{\n\n\t\t\t\t$start=date('d-M-Y', strtotime('first day of this month'));\n\t\t\t\t$start = date('d-M-Y', strtotime($start . \" +20 days\"));\n\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\t$start=date('d-M-Y', strtotime('first day of last month'));\n\t\t\t\t$start = date('d-M-Y', strtotime($start . \" +20 days\"));\n\n\t\t\t}\n\t\t}\n\n\t\tif ($end==null)\n\t\t{\n\t\t\tif($d>=21)\n\t\t\t{\n\n\t\t\t\t$end=date('d-M-Y', strtotime('first day of next month'));\n\t\t\t\t$end = date('d-M-Y', strtotime($end . \" +19 days\"));\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\t$end=date('d-M-Y', strtotime('first day of this month'));\n\t\t\t\t$end = date('d-M-Y', strtotime($end . \" +19 days\"));\n\n\t\t\t}\n\n\t\t}\n\n\t\t$mytimesheet = DB::table('timesheets')\n\t\t->select('timesheets.Id','timesheets.UserId','timesheets.Latitude_In','timesheets.Longitude_In','timesheets.Latitude_Out','timesheets.Longitude_Out','timesheets.Date',DB::raw('\"\" as Day'),'holidays.Holiday','timesheets.Site_Name','timesheets.Check_In_Type','leaves.Leave_Type','leavestatuses.Leave_Status',\n\t\t'timesheets.Time_In','timesheets.Time_Out','timesheets.Leader_Member','timesheets.Next_Person','timesheets.State','timesheets.Work_Description','timesheets.Remarks','approver.Name as Approver','timesheetstatuses.Status','leaves.Leave_Type','timesheetstatuses.Comment','timesheetstatuses.updated_at as Updated_At','files.Web_Path')\n\t\t->leftJoin( DB::raw('(select Max(Id) as maxid,TargetId from files where Type=\"Timesheet\" Group By TargetId) as maxfile'), 'maxfile.TargetId', '=', 'timesheets.Id')\n\t\t->leftJoin('files', 'files.Id', '=', DB::raw('maxfile.`maxid` and files.`Type`=\"Timesheet\"'))\n\t\t->leftJoin( DB::raw('(select Max(Id) as maxid,TimesheetId from timesheetstatuses Group By TimesheetId) as max'), 'max.TimesheetId', '=', 'timesheets.Id')\n\t\t->leftJoin('timesheetstatuses', 'timesheetstatuses.Id', '=', DB::raw('max.`maxid`'))\n\t\t->leftJoin('users as approver', 'timesheetstatuses.UserId', '=', 'approver.Id')\n\t\t// ->leftJoin('leaves','leaves.UserId','=',DB::raw('timesheets.Id AND str_to_date(timesheets.Date,\"%d-%M-%Y\") Between str_to_date(leaves.Start_Date,\"%d-%M-%Y\") and str_to_date(leaves.End_Date,\"%d-%M-%Y\")'))\n\t\t->leftJoin('leaves','leaves.UserId','=',DB::raw($me->UserId.' AND str_to_date(timesheets.Date,\"%d-%M-%Y\") Between str_to_date(leaves.Start_Date,\"%d-%M-%Y\") and str_to_date(leaves.End_Date,\"%d-%M-%Y\")'))\n\t\t->leftJoin( DB::raw('(select Max(Id) as maxid,LeaveId from leavestatuses Group By LeaveId) as maxleave'), 'maxleave.LeaveId', '=', 'leaves.Id')\n\t\t->leftJoin('leavestatuses', 'leavestatuses.Id', '=', DB::raw('maxleave.`maxid`'))\n\t\t->leftJoin('holidays',DB::raw('1'),'=',DB::raw('1 AND str_to_date(timesheets.Date,\"%d-%M-%Y\") Between str_to_date(holidays.Start_Date,\"%d-%M-%Y\") and str_to_date(holidays.End_Date,\"%d-%M-%Y\")'))\n\t\t->where('timesheets.UserId', '=', $me->UserId)\n\t\t->where(DB::raw('str_to_date(timesheets.Date,\"%d-%M-%Y\")'), '>=', DB::raw('str_to_date(\"'.$start.'\",\"%d-%M-%Y\")'))\n\t\t->where(DB::raw('str_to_date(timesheets.Date,\"%d-%M-%Y\")'), '<=', DB::raw('str_to_date(\"'.$end.'\",\"%d-%M-%Y\")'))\n\t\t->orderBy('timesheets.Id','desc')\n\t\t->get();\n\n\t\t$user = DB::table('users')->select('users.Id','StaffId','Name','Password','User_Type','Company_Email','Personal_Email','Contact_No_1','Contact_No_2','Nationality','Permanent_Address','Current_Address','Home_Base','DOB','NRIC','Passport_No','Gender','Marital_Status','Position','Emergency_Contact_Person',\n\t\t'Emergency_Contact_No','Emergency_Contact_Relationship','Emergency_Contact_Address','files.Web_Path')\n\t\t// ->leftJoin('files', 'files.TargetId', '=', DB::raw('users.`Id` and files.`Type`=\"User\"'))\n\t\t->leftJoin( DB::raw('(select Max(Id) as maxid,TargetId from files where Type=\"User\" Group By Type,TargetId) as max'), 'max.TargetId', '=', 'users.Id')\n\t\t->leftJoin('files', 'files.Id', '=', DB::raw('max.`maxid` and files.`Type`=\"User\"'))\n\t\t->where('users.Id', '=', $me->UserId)\n\t\t->first();\n\n\t\t$arrDate = array();\n\t\t$arrDate2 = array();\n\t\t$arrInsert = array();\n\n\t\tforeach ($mytimesheet as $timesheet) {\n\t\t\t# code...\n\t\t\tarray_push($arrDate,$timesheet->Date);\n\t\t}\n\n\t\t$startTime = strtotime($start);\n\t\t$endTime = strtotime($end);\n\n\t\t// Loop between timestamps, 1 day at a time\n\t\tdo {\n\n\t\t\t if (!in_array(date('d-M-Y', $startTime),$arrDate))\n\t\t\t {\n\t\t\t\t array_push($arrDate2,date('d-M-Y', $startTime));\n\t\t\t }\n\n\t\t\t $startTime = strtotime('+1 day',$startTime);\n\n\t\t} while ($startTime <= $endTime);\n\n\t\tforeach ($arrDate2 as $date) {\n\t\t\t# code...\n\t\t\tarray_push($arrInsert,array('UserId'=>$me->UserId, 'Date'=> $date, 'updated_at'=>date('Y-m-d H:i:s')));\n\n\t\t}\n\n\t\tDB::table('timesheets')->insert($arrInsert);\n\n\t\t$options= DB::table('options')\n\t\t->whereIn('Table', [\"users\",\"timesheets\"])\n\t\t->orderBy('Table','asc')\n\t\t->orderBy('Option','asc')\n\t\t->get();\n\n // $mytimesheet = DB::table('timesheets')\n // ->leftJoin('users as submitter', 'timesheets.UserId', '=', 'submitter.Id')\n // ->select('timesheets.Id','submitter.Name','timesheets.Timesheet_Name','timesheets.Date','timesheets.Remarks')\n // ->where('timesheets.UserId', '=', $me->UserId)\n\t\t\t// ->orderBy('timesheets.Id','desc')\n // ->get();\n\n\t\t\t// $hierarchy = DB::table('users')\n\t\t\t// ->select('L2.Id as L2Id','L2.Name as L2Name','L2.Timesheet_1st_Approval as L21st','L2.Timesheet_2nd_Approval as L22nd',\n\t\t\t// 'L3.Id as L3Id','L3.Name as L3Name','L3.Timesheet_1st_Approval as L31st','L3.Timesheet_2nd_Approval as L32nd')\n\t\t\t// ->leftJoin(DB::raw(\"(select users.Id,users.Name,users.SuperiorId,accesscontrols.Timesheet_1st_Approval,accesscontrols.Timesheet_2nd_Approval,accesscontrols.Timesheet_Final_Approval from users left join accesscontrols on users.Id=accesscontrols.UserId) as L2\"),'L2.Id','=','users.SuperiorId')\n\t\t\t// ->leftJoin(DB::raw(\"(select users.Id,users.Name,users.SuperiorId,accesscontrols.Timesheet_1st_Approval,accesscontrols.Timesheet_2nd_Approval,accesscontrols.Timesheet_Final_Approval from users left join accesscontrols on users.Id=accesscontrols.UserId) as L3\"),'L3.Id','=','L2.SuperiorId')\n\t\t\t// ->where('users.Id', '=', $me->UserId)\n\t\t\t// ->get();\n\t\t\t//\n\t\t\t// $final = DB::table('users')\n\t\t\t// ->select('users.Id','users.Name')\n\t\t\t// ->leftJoin('accesscontrols', 'accesscontrols.UserId', '=', 'users.Id')\n\t\t\t// ->where('Timesheet_Final_Approval', '=', 1)\n\t\t\t// ->get();\n\n\t\t\treturn view('mytimesheet', ['me' => $me, 'user' =>$user, 'mytimesheet' => $mytimesheet,'start' =>$start,'end'=>$end,'options' =>$options]);\n\n\t\t\t//return view('mytimesheet', ['me' => $me,'showleave' =>$showleave, 'mytimesheet' => $mytimesheet, 'hierarchy' => $hierarchy, 'final' => $final]);\n\n\t}", "public function endRoundStart() {\n\t\t$this->displayTeamScoreWidget(false);\n\t}", "public function setEndDateTime($timestamp);", "public function ended();", "function close() {\n\n if($this->time_start)\n $this->prn(\"\\nTime spent: \"\n .$this->endTimer().\" seconds\");\n\n if($this->format != \"plain\") \n $this->prn(\"\\n======================= \"\n .\"end logrecord ============================\\n\");\n\n $this->quit();\n }", "function Footer(){\n\t\t$this->Cell(190,0,'','T',1,'',true);\n\t\t\n\t\t//Go to 1.5 cm from bottom\n\t\t$this->SetY(-15);\n\t\t\t\t\n\t\t$this->SetFont('Arial','',8);\n\t\t\n\t\t//width = 0 means the cell is extended up to the right margin\n\t\t$this->Cell(0,10,'Page '.$this->PageNo().\" / {pages}\",0,0,'C');\n\t}", "public function Footer(){\n $this->SetFont('Arial','',8);\n $date = new Date();\n $this->SetTextColor(100);\n $this->SetFillColor(245);\n $this->SetY(-10);\n $str = \"Elaborado Por Mercurio\";\n $x = $this->GetStringWidth($str);\n $this->Cell($x+10,5,$str,'T',0,'L');\n $this->Cell(0,5,'Pagina '.$this->PageNo().' de {nb}','T',1,'R');\n }", "public function detailedtimesheetAction()\r\n {\r\n $project = $this->projectService->getProject($this->_getParam('projectid'));\r\n $client = $this->clientService->getClient($this->_getParam('clientid'));\r\n $task = $this->projectService->getTask($this->_getParam('taskid'));\r\n $user = $this->userService->getUserByField('username', $this->_getParam('username'));\r\n\t\t\r\n if (!$project && !$client && !$task && !$user) {\r\n return;\r\n }\r\n\r\n\t\tif ($task) { \r\n $this->view->records = $this->projectService->getDetailedTimesheet(null, $task->id);\r\n } else if ($project) {\r\n \r\n $start = null;\r\n $this->view->records = $this->projectService->getDetailedTimesheet(null, null, $project->id);\r\n } else if ($client) {\r\n \r\n $start = null;\r\n $this->view->records = $this->projectService->getDetailedTimesheet(null, null, null, $client->id);\r\n } else if ($user) {\r\n\t\t\t$this->view->records = $this->projectService->getDetailedTimesheet($user);\r\n\t\t}\r\n\r\n\t\t$this->view->task = $task;\r\n $this->renderRawView('timesheet/ajax-timesheet-details.php');\r\n }", "public function endTabs() {\n\t\t\treturn \"\"; \n\t\t}", "public function end_turn()\n\t{\n\t\t//\t\tpropre a la classe\n\t}", "public function finish()\n {\n // make sure the datetime column isn't blank\n $columns = $this->get_argument( 'columns' );\n if( !array_key_exists( 'datetime', $columns ) || 0 == strlen( $columns['datetime'] ) )\n throw lib::create( 'exception\\notice', 'The date/time cannot be left blank.', __METHOD__ );\n \n foreach( $columns as $column => $value ) $this->get_record()->$column = $value;\n \n // do not include the user_id if this is a site appointment\n if( 0 < $this->get_record()->address_id ) $this->get_record()->user_id = NULL;\n \n if( !$this->get_record()->validate_date() )\n throw lib::create( 'exception\\notice',\n sprintf(\n 'The participant is not ready for a %s appointment.',\n 0 < $this->get_record()->address_id ? 'home' : 'site' ), __METHOD__ );\n \n // no errors, go ahead and make the change\n parent::finish();\n }", "function Footer()\n {\n date_default_timezone_set('UTC+1');\n //Date\n $tDate = date('F j, Y, g:i:s a');\n // Position at 1.5 cm from bottom\n $this->SetY(-15);\n // Arial italic 8\n $this->SetFont('Arial', 'I', 12);\n // Text color in gray\n $this->SetTextColor(128);\n // Page number\n $this->Cell(0, 10,utf8_decode('Page ' . $this->PageNo().' \n CHUYC \n '.$tDate.'\n +237 693 553 454\n '.$this->Image(SITELOGO, 189, 280, 10, 10,'', URLROOT)), 0, 0, 'L');\n }", "function eo_schedule_end($format='d-m-Y',$id=''){\n\techo eo_get_schedule_end($format,$id);\n}", "public function unlockAction()\r\n {\r\n $timesheet = $this->byId();\r\n $this->projectService->unlockTimesheet($timesheet);\r\n $this->redirect('timesheet', 'edit', array('clientid'=>$timesheet->clientid, 'projectid'=>$timesheet->projectid, 'id'=>$timesheet->id));\r\n }", "function setEndTime($event, $time) {\n Timer::timers($event, array(\n 'stop' => $time, \n 'stopped' => true\n ));\n }", "function stats_end(){\n echo \"</table>\\n\";\n echo \"</TD></TR></TABLE>\\n\";\n echo \"</TD></TR></TABLE></CENTER>\\n\";\n echo \"<BR>\\n\";\n}", "function timesheetYear(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mytask=0, $perioduser='')\n{\n\tglobal $bc, $langs;\n\tglobal $form, $projectstatic, $taskstatic;\n\tglobal $periodyear, $displaymode ;\n\n\tglobal $transfertarray;\n\n\t$lastprojectid=0;\n\t$totalcol = array();\n\t$totalline = 0;\n\t$var=true;\n\n\t$numlines=count($lines);\n\tfor ($i = 0 ; $i < $numlines ; $i++)\n\t{\n\t\tif ($parent == 0) $level = 0;\n\n\t\tif ($lines[$i]->fk_parent == $parent)\n\t\t{\n\n\t\t\t// Break on a new project\n\t\t\tif ($parent == 0 && $lines[$i]->fk_project != $lastprojectid)\n\t\t\t{\n\t\t\t\t$totalprojet = array();\n\t\t\t\t$var = !$var;\n\t\t\t\t$lastprojectid=$lines[$i]->fk_project;\n\t\t\t}\n\n\t\t\tprint \"<tr \".$bc[$var].\">\\n\";\n\t\t\t// Ref\n\t\t\tprint '<td>';\n\t\t\t$taskstatic->fetch($lines[$i]->id);\n\t\t\t$taskstatic->label=$lines[$i]->label.\" (\".dol_print_date($lines[$i]->date_start,'day').\" - \".dol_print_date($lines[$i]->date_end,'day').')'\t;\n\t\t\t//print $taskstatic->getNomUrl(1);\n\t\t\tprint $taskstatic->getNomUrl(1,($showproject?'':'withproject'));\n\t\t\tprint '</td>';\n\n\t\t\t// Progress\n\t\t\tprint '<td align=\"right\">';\n\t\t\tprint $lines[$i]->progress.'% ';\n\t\t\tprint $taskstatic->getLibStatut(3);\n\t\t\t\n\t\t\tif ($taskstatic->fk_statut == 3)\n\t\t\t\t$transfertarray[] = $lines[$i]->id;\n\n\t\t\tprint '</td>';\n\n\t\t\t$totalline = 0;\n\t\t\tfor ($month=1;$month<= 12 ;$month++)\n\t\t\t{\n\t\t\t\t$szvalue = fetchSumMonthTimeSpent($taskstatic->id, $month, $periodyear, $perioduser, $displaymode);\n\t\t\t\t$totalline+=$szvalue;\n\t\t\t\t$totalprojet[$month]+=$szvalue;\n\t\t\t\tif ($displaymode==0)\n\t\t\t\t\tprint '<td align=right>'.($szvalue ? convertSecondToTime($szvalue, 'allhourmin'):\"\").'</td>';\n\t\t\t\telse\n\t\t\t\t\tprint '<td align=right>'.($szvalue ? price($szvalue):\"\").'</td>';\n\t\t\t\t// le nom du champs c'est à la fois le jour et l'id de la tache\n\t\t\t}\n\t\t\tif ($displaymode==0)\n\t\t\t\tprint '<td align=right>'.($totalline ? convertSecondToTime($totalline, 'allhourmin'):\"\").'</td>';\n\t\t\telse\n\t\t\t\tprint '<td align=right>'.($totalline ? price($totalline):\"\").'</td>';\n\n\n\t\t\t$inc++;\n\t\t\t$level++;\n\t\t\tif ($lines[$i]->id) timesheetYear($inc, $lines[$i]->id, $lines, $level, $projectsrole, $tasksrole, $mytask, $perioduser);\n\t\t\t$level--;\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//$level--;\n\t\t}\n\t}\n\t\n\tif ($level == 0)\n\t{\n\t\tprint \"<tr class='liste_total'>\\n\";\n\t\tprint '<td colspan=2 align=right><b>Total</b></td>';\n\t\tprint '</td>';\n\t\t$totalline = 0;\n\t\tfor ($month=1;$month<= 12 ;$month++)\n\t\t{\n\t\t\t// on affiche le total du projet\n\t\t\tif ($displaymode==0)\n\t\t\t\tprint '<td align=right>'.($totalgen[$month] ? convertSecondToTime($totalgen[$month], 'allhourmin'):\"\").'</td>';\n\t\t\telse\n\t\t\t\tprint '<td align=right>'.($totalgen[$month] ? price($totalgen[$month]):\"\").'</td>';\n\n\t\t\t$totalline+=$totalgen[$month];\n\t\t}\n\t\t// on affiche le total du projet\n\t\tif ($displaymode==0)\n\t\t\tprint '<td align=right>'.($totalline ? convertSecondToTime($totalline, 'allhourmin'):\"\").'</td>';\n\t\telse\n\t\t\tprint '<td align=right>'.($totalline ? price($totalline):\"\").'</td>';\n\n\t\tprint \"</tr>\\n\";\n\t}\n\treturn $inc;\n}", "public function unsetEndTime(): void\n {\n $this->endTime = [];\n }", "function end()\n\t{\n\t\t$this->over = true;\n\t}", "public function footer() {\n\t}", "public function endPage() {}", "public function addTableFooter() {\n\t\t// auto width\n\t\tforeach ($this->tableParams['auto_width'] as $col)\n\t\t\t$this->xls->getActiveSheet()->getColumnDimensionByColumn($col)->setAutoSize(true);\n\t\t// filter (has to be set for whole range)\n\t\tif (count($this->tableParams['filter']))\n\t\t\t$this->xls->getActiveSheet()->setAutoFilter(PHPExcel_Cell::stringFromColumnIndex($this->tableParams['filter'][0]).($this->tableParams['header_row']).':'.PHPExcel_Cell::stringFromColumnIndex($this->tableParams['filter'][count($this->tableParams['filter']) - 1]).($this->tableParams['header_row'] + $this->tableParams['row_count']));\n\t\t// wrap\n\t\tforeach ($this->tableParams['wrap'] as $col)\n\t\t\t$this->xls->getActiveSheet()->getStyle(PHPExcel_Cell::stringFromColumnIndex($col).($this->tableParams['header_row'] + 1).':'.PHPExcel_Cell::stringFromColumnIndex($col).($this->tableParams['header_row'] + $this->tableParams['row_count']))->getAlignment()->setWrapText(true);\n\t}", "private function Write_Monthly_Table() {\n\t\t$top = 445 + self::VERT_MARGIN;\n\t\t$left = self::HORZ_MARGIN;\n\t\t$label_width = 160;\n\t\t$table_left = $left + $label_width;\n\t\t$cell_width = 55;\n\t\t$row_height = 8.5;\n\t\t\n\t\t/**\n\t\t * Build label backgrounds\n\t\t */\n\t\t$this->pdf->setcolor('fill', 'gray', 0.75, 0, 0, 0);\n\t\t$this->Rect_TL($left, $top, $label_width + ($cell_width * 1), $row_height);\n\t\t$this->pdf->fill();\n\t\t\n\t\t/**\n\t\t * Add the strokes\n\t\t */\n\t\t$this->Rect_TL($table_left, $top, $cell_width, $row_height);\n\t//\t$this->Rect_TL($table_left + ($cell_width * 1), $top, $cell_width, $row_height);\n\t//\t$this->Rect_TL($table_left + ($cell_width * 2), $top, $cell_width, $row_height);\n\t\t$this->pdf->stroke();\n\t\t\n\t\t/**\n\t\t * Add the labels\n\t\t */\n\t\t$this->Text_TL(\"CURRENT PERIOD\",\n\t\t\t$left, $top, \n\t\t\t$label_width, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['LEFT']}\");\n\t\t\n\t\t$this->Text_TL(\"PERIOD\",\n\t\t\t$table_left, $top, \n\t\t\t$cell_width, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['CENTER']}\");\n\t\t\n\t\t/*$this->Text_TL(\"WEEK\",\n\t\t\t$table_left + ($cell_width * 1), $top, \n\t\t\t$cell_width, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['CENTER']}\");\n\t\t\n\t\t$this->Text_TL(\"MONTH\",\n\t\t\t$table_left + ($cell_width * 2), $top, \n\t\t\t$cell_width, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['CENTER']}\");*/\n\t\t\t\n\t\t$current_row = 1;\n\t\t$totals = array(\n\t\t\t'weekly' => 0,\n\t\t\t'biweekly' => 0,\n\t\t\t'semimonthly' => 0,\n\t\t\t'monthly' => 0,\n\t\t);\n\t\tforeach ($this->data['period'] as $label => $values) {\n\t\t\t/**\n\t\t\t * Special processing\n\t\t\t */\n\t\t\tswitch ($label) {\n\t\t\t\tcase 'nsf$':\n\t\t\t\t\tcontinue 2;\n\t\t\t\tcase 'debit returns':\n//\t\t\t\t\t$this->pdf->setcolor('fill', 'rgb', 1, 1, 176/255, 0);\n//\t\t\t\t\t$this->Rect_TL($table_left + ($cell_width * 1), $top + ($row_height * $current_row), $cell_width, $row_height);\n//\t\t\t\t\t$this->pdf->fill();\n\t\t\t\t\t\n//\t\t\t\t\t$this->Rect_TL($table_left + ($cell_width * 1), $top + ($row_height * $current_row), $cell_width, $row_height);\n//\t\t\t\t\t$this->pdf->stroke();\n\t\t\t\t\t/*$percentage = $values['month']? number_format($values['month'] / $this->data['monthly']['total debited']['month'] * 100, 1):0;\n\t\t\t\t\t$this->Text_TL($percentage.'%',\n\t\t\t\t\t\t$table_left + ($cell_width * 3), $top + ($row_height * $current_row), \n\t\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['CENTER']}\");*/\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'net cash collected':\n\t\t\t\t\t$this->pdf->setcolor('fill', 'rgb', 1, 1, 176/255, 0);\n\t\t\t\t\t$this->Rect_TL($table_left, $top + ($row_height * $current_row), $cell_width, $row_height);\n\t\t\t\t\t//$this->Rect_TL($table_left + ($cell_width * 1), $top + ($row_height * $current_row), $cell_width, $row_height);\n\t\t\t\t\t//$this->Rect_TL($table_left + ($cell_width * 2), $top + ($row_height * $current_row), $cell_width, $row_height);\n\t\t\t\t\t$this->pdf->fill();\n\t\t\t\t\t\n\t\t\t\t\t//$this->Text_TL(number_format($this->data['period']['total debited']['span'] - $this->data['period']['debit returns']['span'], 2),\n\t\t\t\t\t$this->Text_TL(number_format($this->data['period']['total debited']['span'] - $this->data['period']['nsf$']['span'], 2),\n\t\t\t\t\t\t$table_left, $top + ($row_height * $current_row), \n\t\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\t\t\t\t\n\t\t\t\t\t/*$this->Text_TL(number_format($this->data['monthly']['total debited']['week'] - $this->data['monthly']['debit returns']['week'], 2),\n\t\t\t\t\t\t$table_left + ($cell_width * 1), $top + ($row_height * $current_row), \n\t\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\t\t\t$this->Text_TL(number_format($this->data['monthly']['total debited']['month'] - $this->data['monthly']['debit returns']['month'], 2),\n\t\t\t\t\t\t$table_left + ($cell_width * 2), $top + ($row_height * $current_row), \n\t\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");*/\n\t\t\t\t\tbreak;\n\t\t\t\t//FORBIDDEN ROWS!\n\t\t\t\tcase 'moneygram deposit':\n\t\t\t\t//case 'credit card payments':\n\t\t\t\t\tcontinue 2;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t}\n\t\t\t$format_decimals = 0;\n\t\t\tswitch ($label) {\n\t\t\t\tcase 'new customers':\n\t\t\t\tcase 'card reactivations':\n\t\t\t\tcase 'reactivated customers':\n\t\t\t\tcase 'refunded customers':\n\t\t\t\tcase 'resend customers':\n\t\t\t\tcase 'cancelled customers':\n\t\t\t\tcase 'paid out customers (ach)':\n\t\t\t\tcase 'paid out customers (non-ach)':\n\t\t\t\t\t$format_decimals = 0;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$format_decimals = 2;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t$this->pdf->setcolor('fill', 'gray', 0.75, 0, 0, 0);\n\t\t\t$this->Rect_TL($left, $top + ($row_height * $current_row), $label_width, $row_height);\n\t\t\t$this->pdf->fill();\n\t\t\t\n\t\t\t$this->Rect_TL($table_left, $top + ($row_height * $current_row), $cell_width, $row_height);\n//\t\t\t$this->Rect_TL($table_left + ($cell_width * 1), $top + ($row_height * $current_row), $cell_width, $row_height);\n//\t\t\t$this->Rect_TL($table_left + ($cell_width * 2), $top + ($row_height * $current_row), $cell_width, $row_height);\n\t\t\t$this->pdf->stroke();\n\t\t\t\n\t\t\t$this->Text_TL(strtoupper($label),\n\t\t\t\t$left + $label_indent, $top + ($row_height * $current_row), \n\t\t\t\t$label_width - $label_indent, $row_height,\n\t\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['RIGHT']}\");\n\t\t\t\n\t\t\tif ($label != 'net cash collected') {\n\t\t\t\t$this->Text_TL(number_format($values['span'], $format_decimals),\n\t\t\t\t\t$table_left, $top + ($row_height * $current_row), \n\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\t\t\n\t\t\t\t/*$this->Text_TL(number_format($values['week'], $format_decimals),\n\t\t\t\t\t$table_left + ($cell_width * 1), $top + ($row_height * $current_row), \n\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\t\t\n\t\t\t\t$this->Text_TL(number_format($values['month'], $format_decimals),\n\t\t\t\t\t$table_left + ($cell_width * 2), $top + ($row_height * $current_row), \n\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");*/\n\t\t\t}\n\t\t\t\n\t\t\t$current_row++;\n\t\t}\n\t\t\n\t\t/**\n\t\t * Advances in Collection\n\t\t */\n\t\t$this->pdf->setcolor('fill', 'gray', 0.75, 0, 0, 0);\n\t\t$this->Rect_TL($left, $top + ($row_height * $current_row), $label_width, $row_height);\n\t\t$this->pdf->fill();\n\t\t\n\t\t$this->Rect_TL($table_left, $top + ($row_height * $current_row), $cell_width, $row_height);\n\t\t$this->pdf->stroke();\n\t\t\n\t\t$this->Text_TL(\"ADVANCES IN COLLECTION\",\n\t\t\t$left, $top + ($row_height * $current_row), \n\t\t\t$label_width, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['RIGHT']}\");\n\t\t\n\t\t$this->Text_TL(number_format($this->data['advances_collections'], 2),\n\t\t\t$table_left, $top + ($row_height * $current_row), \n\t\t\t$cell_width, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\n\t\t/**\n\t\t * Advances in Active\n\t\t */\n\t\t$this->pdf->setcolor('fill', 'gray', 0.75, 0, 0, 0);\n\t\t$this->Rect_TL($table_left + ($cell_width * 4), $top + ($row_height * $current_row), $cell_width * 2, $row_height);\n\t\t$this->pdf->fill();\n\t\t\n\t\t$this->Rect_TL($table_left + ($cell_width * 6), $top + ($row_height * $current_row), $cell_width, $row_height);\n\t\t$this->pdf->stroke();\n\t\t\n\t\t$this->Text_TL(\"ACTIVE ADVANCES OUT\",\n\t\t\t$table_left + ($cell_width * 4), $top + ($row_height * $current_row), \n\t\t\t$cell_width * 2, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['RIGHT']}\");\n\t\t\n\t\t$this->Text_TL(number_format($this->data['advances_active'], 2),\n\t\t\t$table_left + ($cell_width * 6), $top + ($row_height * $current_row), \n\t\t\t$cell_width, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\n\t}", "public function setEndtime($endtime){\n $this->_endtime = $endtime;\n }", "public function endTimer() {\n $this->time_end = microtime(true);\n $this->time = number_format(($this->time_end - $this->time_start), 5);\n static::$total_exec += $this->time;\n }", "function section_end(){\n\techo '</div>';\n\techo '</div>';\n}", "function Footer()\n\t{\n\t\t$this->SetY(-15);\n\t\t// Select Arial italic B\n\t\t$this->setfont('Arial','I',14);\n\t\t$this->cell(250,8,\"Proyecto Final, copyright &copy; 2019\",0,0,'c');\n\t\t// Print centered page numbre\n\t\t$this->Cell(0,10,'Pag.'.$this->PageNo(),0,0,'c');\n\t}", "public function endFunctionFirst() {\n\t\t/*$this->getAllStudents();\n\t\t$this->archive_budgetinfo_details();\n\t\t$this->archive_student_balance();\n\t\t$this->archive_grade_details();\n\t\t$this->archive_transcript_grades();\n\t\t$this->insert_rank(); //to fix\n\t\t/*$query1 = $this->conn->query(\"UPDATE system_settings SET edit_class ='No', student_transfer ='No' where sy_status ='Current'\") or die(\"failed1\");\n\t\t$query2 = $this->conn->query(\"UPDATE faculty SET enroll_privilege ='No'\") or die(\"failed4\");\n\t\t$query3 = $this->conn->query(\"UPDATE budget_info SET acc_amount = '0'\");\n\t\t$query4 = $this->conn->query(\"DELETE FROM announcements where holiday ='No'\");\n\t\t$query5 = $this->conn->query(\"DELETE from promote_list where prom_sy = (SELECT YEAR(sy_start) from system_settings where sy_status = 'Ended' ORDER BY 1 desc LIMIT 1)\");*/\n\t\t/*$this->promote_students();*/\n\t\t/*$query7 = $this->conn->query(\"DELETE FROM grades\");\n\t\tif($query1){\n\t\t\t$this->Message('Success!', 'The school year has been ended!', 'success', 'treasurer-end-trial');\n\t\t} else{\n\t\t\t$this->Message('Error!', 'Cannot end school year', 'error', 'treasurer-end-trial');\n\t\t}*/\n\t\t\n\t}", "function metabox_date_time($post){\n\t\tglobal $postmec;\n\t\tinclude $postmec->get_postmec_dir() . 'metaboxes/event_start_end_defining.php';\n\t}", "public static function hour()\n\t{\n\t\t$reservations = \\Model_Lessontime::find(\"all\", [\n\t\t\t\"where\" => [\n\t\t\t\t[\"deleted_at\", 0],\n\t\t\t\t[\"status\", 1],\n\t\t\t\t[\"freetime_at\", \"<=\", time() + 3600],\n\t\t\t\t[\"freetime_at\", \">=\", time()],\n\t\t\t]\n\t\t]);\n\n\t\tforeach($reservations as $reservation){\n\n\t\t\t// for teacher\n\t\t\t$url = \"http://game-bootcamp.com/teachers/top\";\n\n\t\t\t$body = \\View::forge(\"email/teachers/reminder_1hour\",[\"url\" => $url]);\n\t\t\t$sendmail = \\Email::forge(\"JIS\");\n\t\t\t$sendmail->from(\\Config::get(\"statics.info_email\"),\\Config::get(\"statics.info_name\"));\n\t\t\t$sendmail->to($reservation->teacher->email);\n\t\t\t$sendmail->subject(\"Your lesson will start.\");\n\t\t\t$sendmail->html_body(htmlspecialchars_decode($body));\n\n\t\t\t$sendmail->send();\n\n\t\t\t// for student\n\t\t\t$url = \"http://game-bootcamp.com/students/top\";\n\n\t\t\t$body = \\View::forge(\"email/students/reminder_1hour\",[\"url\" => $url]);\n\t\t\t$sendmail = \\Email::forge(\"JIS\");\n\t\t\t$sendmail->from(\\Config::get(\"statics.info_email\"),\\Config::get(\"statics.info_name\"));\n\t\t\t$sendmail->to($reservation->student->email);\n\t\t\t$sendmail->subject(\"Your lesson will start.\");\n\t\t\t$sendmail->html_body(htmlspecialchars_decode($body));\n\n\t\t\t$sendmail->send();\n\t\t}\n\t}", "public function timesheetAction(Employee $admin)\n {\n\t\t$validateForm = $this->createValidateForm($admin->getEmployee());\n\t\t$this->setActivity($admin->getEmployee()->getName().\" \".$admin->getEmployee()->getFirstname().\" timesheets are consulted\");\n $em = $this->getDoctrine()->getManager();\n $aTimesheets = $em->getRepository('BoAdminBundle:Timesheet')->getTsByEmployee($admin->getEmployee(),2);\n return $this->render('BoAdminBundle:Admin:timesheet.html.twig', array(\n 'employee' => $admin->getEmployee(),\n\t\t\t'validate_form' => $validateForm->createView(),\n\t\t\t'timesheets'=>$aTimesheets,\n\t\t\t'pm'=>\"personnel\",\n\t\t\t'sm'=>\"admin\",\n ));\n }", "public function indexAction()\r\n {\r\n \tini_set('memory_limit', '64M');\r\n $validFormats = array('weekly');\r\n $format = 'weekly'; // $this->_getParam('format', 'weekly');\r\n \r\n if (!in_array($format, $validFormats)) {\r\n $this->flash('Format not valid');\r\n $this->renderView('error.php');\r\n return;\r\n }\r\n\r\n $reportingOn = 'Dynamic';\r\n \r\n // -1 will mean that by default, just choose all timesheet records\r\n $timesheetid = -1;\r\n\r\n // Okay, so if we were passed in a timesheet, it means we want to view\r\n // the data for that timesheet. However, if that timesheet is locked, \r\n // we want to make sure that the tasks being viewed are ONLY those that\r\n // are found in that locked timesheet.\r\n $timesheet = $this->byId();\r\n\r\n $start = null;\r\n $end = null;\r\n $this->view->showLinks = true;\r\n $cats = array();\r\n\r\n if ($timesheet) {\r\n $this->_setParam('clientid', $timesheet->clientid);\r\n $this->_setParam('projectid', $timesheet->projectid);\r\n if ($timesheet->locked) {\r\n $timesheetid = $timesheet->id;\r\n $reportingOn = $timesheet->title;\r\n } else {\r\n $timesheetid = 0; \r\n $reportingOn = 'Preview: '.$timesheet->title;\r\n }\r\n if (is_array($timesheet->tasktype)) {\r\n \t$cats = $timesheet->tasktype;\r\n } \r\n\r\n $start = date('Y-m-d 00:00:01', strtotime($timesheet->from));\r\n $end = date('Y-m-d 23:59:59', strtotime($timesheet->to)); \r\n $this->view->showLinks = false;\r\n } else if ($this->_getParam('category')){\r\n \t$cats = array($this->_getParam('category'));\r\n }\r\n \r\n \r\n $project = $this->_getParam('projectid') ? $this->byId($this->_getParam('projectid'), 'Project') : null;\r\n\t\t\r\n\t\t$client = null;\r\n\t\tif (!$project) {\r\n \t$client = $this->_getParam('clientid') ? $this->byId($this->_getParam('clientid'), 'Client') : null;\r\n\t\t}\r\n\t\t\r\n $user = $this->_getParam('username') ? $this->userService->getUserByField('username', $this->_getParam('username')) : null;\r\n \r\n\t\t$this->view->user = $user;\r\n\t\t$this->view->project = $project;\r\n\t\t$this->view->client = $client ? $client : ( $project ? $this->byId($project->clientid, 'Client'):null);\r\n\t\t$this->view->category = $this->_getParam('category');\r\n \r\n if (!$start) {\r\n\t // The start date, if not set in the parameters, will be just\r\n\t // the previous monday\r\n\t $start = $this->_getParam('start', $this->calculateDefaultStartDate());\r\n\t // $end = $this->_getParam('end', date('Y-m-d', time()));\r\n\t $end = $this->_getParam('end', date('Y-m-d 23:59:59', strtotime($start) + (6 * 86400)));\r\n }\r\n \r\n // lets normalise the end date to make sure it's of 23:59:59\r\n\t\t$end = date('Y-m-d 23:59:59', strtotime($end));\r\n\r\n $this->view->title = $reportingOn;\r\n \r\n $order = 'endtime desc';\r\n if ($format == 'weekly') {\r\n $order = 'starttime asc';\r\n }\r\n\r\n $this->view->taskInfo = $this->projectService->getTimesheetReport($user, $project, $client, $timesheetid, $start, $end, $cats, $order);\r\n \r\n // get the hierachy for all the tasks in the task info. Make sure to record how 'deep' the hierarchy is too\r\n\t\t$hierarchies = array();\r\n\r\n\t\t$maxHierarchyLength = 0;\r\n\t\tforeach ($this->view->taskInfo as $taskinfo) {\r\n\t\t\tif (!isset($hierarchies[$taskinfo->taskid])) {\r\n\t\t\t\t$task = $this->projectService->getTask($taskinfo->taskid);\r\n\t\t\t\t$taskHierarchy = array();\r\n\t\t\t\tif ($task) {\r\n\t\t\t\t\t$taskHierarchy = $task->getHierarchy();\r\n\t\t\t\t\tif (count($taskHierarchy) > $maxHierarchyLength) {\r\n\t\t\t\t\t\t$maxHierarchyLength = count($taskHierarchy);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$hierarchies[$taskinfo->taskid] = $taskHierarchy;\r\n\t\t\t} \r\n\t\t}\r\n\t\r\n\t\t$this->view->hierarchies = $hierarchies;\r\n\t\t$this->view->maxHierarchyLength = $maxHierarchyLength;\r\n\r\n $this->view->startDate = $start;\r\n $this->view->endDate = $end;\r\n $this->view->params = $this->_getAllParams();\r\n $this->view->dayDivision = za()->getConfig('day_length', 8) / 4; // za()->getConfig('day_division', 2);\r\n $this->view->divisionTolerance = za()->getConfig('division_tolerance', 20);\r\n \r\n $outputformat = $this->_getParam('outputformat');\r\n if ($outputformat == 'csv') {\r\n \t$this->_response->setHeader(\"Content-type\", \"text/csv\");\r\n\t $this->_response->setHeader(\"Content-Disposition\", \"inline; filename=\\\"timesheet.csv\\\"\");\r\n\r\n\t echo $this->renderRawView('timesheet/csv-export.php');\r\n } else {\r\n\t\t\tif ($this->_getParam('_ajax')) {\r\n\t\t\t\t$this->renderRawView('timesheet/'.$format.'-report.php');\r\n\t\t\t} else {\r\n\t\t\t\t$this->renderView('timesheet/'.$format.'-report.php');\r\n\t\t\t}\r\n }\r\n }", "public function endPeriod() {\n $this->checkStopLoss();\n //Handle Trailing Stop\n $this->checkTrailingStop();\n $this->checkMarketIfTouched();\n //Check to see if take profit was hit\n $this->checkTakeProfit();\n }" ]
[ "0.65012527", "0.633065", "0.6235519", "0.6131447", "0.59576315", "0.576978", "0.56739116", "0.5628189", "0.56203437", "0.55798835", "0.55670357", "0.5550014", "0.5497997", "0.5479658", "0.5477319", "0.54718435", "0.5458773", "0.5458773", "0.54257894", "0.53933537", "0.5389331", "0.5371797", "0.53468174", "0.53136855", "0.530691", "0.5293245", "0.5290291", "0.5289144", "0.52729964", "0.52602696", "0.526021", "0.5245772", "0.5238381", "0.52339244", "0.5212318", "0.5206336", "0.5206066", "0.51909447", "0.51765597", "0.51762277", "0.5175008", "0.51745254", "0.5172034", "0.51717895", "0.51575184", "0.51561385", "0.5149841", "0.5146806", "0.51451033", "0.5144225", "0.5144225", "0.51240337", "0.512142", "0.512142", "0.512142", "0.512142", "0.5119592", "0.51128334", "0.5101997", "0.5094024", "0.509373", "0.5082607", "0.50652635", "0.50609964", "0.50609964", "0.50609964", "0.5044446", "0.5031335", "0.50235987", "0.5011786", "0.5007789", "0.5007456", "0.500377", "0.50021565", "0.49955156", "0.49955046", "0.4993538", "0.49836656", "0.4978525", "0.49771455", "0.4974806", "0.49671826", "0.49639916", "0.49637806", "0.49616373", "0.4956453", "0.49550876", "0.4954898", "0.49213684", "0.49198386", "0.49161562", "0.49139953", "0.49038795", "0.49009016", "0.48987374", "0.48938075", "0.4891163", "0.48867673", "0.48842895", "0.4880236", "0.48737478" ]
0.0
-1
END TIMESHEET / Allowences /
public function allowance($pg=1, $limit=0) { $this->getMenu(); $form = array( 'client_name' => $this->input->get('client_name'), 'project_no' => $this->input->get('project_no'), ); if($limit) { $this->session->set_userdata('rpp', $limit); $this->rpp = $limit; } $limit = $limit ? $limit : $this->rpp; $totalRow = count($this->timesheetModel->getAllowance($form)); $this->data['form'] = $form; $this->data['pg'] = $this->setPaging($totalRow, $pg, $limit); $this->data['rows'] = $this->timesheetModel->getAllowance($form, $limit, $this->data['pg']['o']); $this->load->view('timesheet_allowance',$this->data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function close_timesheet($timesheet)\n\t{\n\t\t$date = Carbon::now();\n\n\t\t$this->CI->timecard_model->timecard_update(\n\t\t\t$timesheet->id,\n\t\t\t$date->format('h'),\n\t\t\t$date->format('i'),\n\t\t\t$date->format('A'),\n\t\t\t$timesheet->user_id\n\t\t);\n\t}", "public function createAppointmentEndTime()\n {\n $dateTime = strtotime(\"+\" . $this->getEndTimeslot()->getWeight() * 900 . \" seconds\", $this->getAppointmentDate()->format('U'));\n $currentDateTime = new \\DateTime();\n $currentDateTime->setTimestamp($dateTime);\n $this->setHiddenAppointmentEndTime($currentDateTime);\n return;\n }", "public function endPeriod() {\n $this->checkStopLoss();\n //Handle Trailing Stop\n $this->checkTrailingStop();\n $this->checkMarketIfTouched();\n //Check to see if take profit was hit\n $this->checkTakeProfit();\n }", "public function hasEndtime(){\n return $this->_has(8);\n }", "private function endMonthSpacers()\n\t{\n\t\tif((8 - $this->weekDayNum) >= '1') {\n\t\t\t$this->calWeekDays .= \"\\t\\t<td colspan=\\\"\".(8 - $this->weekDayNum).\"\\\" class=\\\"spacerDays\\\">&nbsp;</td>\\n\";\n\t\t\t$this->outArray['lastday'] = (8 - $this->weekDayNum);\t\t\t\n\t\t}\n\t}", "public function register_end()\n {\n echo \"Ended the Action \";\n date_default_timezone_set('Europe/Berlin');\n //Array that keeps the localtime \n $arrayt = localtime();\n //calculates seconds rn for further use\n $timeRN = $arrayt[0] + ($arrayt[1] * 60) + ($arrayt[2] * 60 * 60); //in seconds\n\n $jsondecode = file_get_contents($this->save);\n $decoded = json_decode($jsondecode, true);\n for ($i = 0; $i < count($decoded); $i++) {\n if ($decoded[$i][0]['Endtime'] == NULL) {\n $decoded[$i][0]['Endtime'] = $timeRN;\n $encoded = json_encode($decoded);\n file_put_contents($this->save, $encoded);\n }\n }\n }", "static function add_eb_nom_end(): void {\r\n\t\tself::add_acf_inner_field(self::ebs, self::eb_nom_end, [\r\n\t\t\t'label' => 'Nomination period end',\r\n\t\t\t'type' => 'text',\r\n\t\t\t'instructions' => 'e.g. March 26 @ 11 p.m.',\r\n\t\t\t'required' => 1,\r\n\t\t\t'conditional_logic' => [\r\n\t\t\t\t[\r\n\t\t\t\t\t[\r\n\t\t\t\t\t\t'field' => self::qualify_field(self::eb_finished),\r\n\t\t\t\t\t\t'operator' => '!=',\r\n\t\t\t\t\t\t'value' => '1',\r\n\t\t\t\t\t],\r\n\t\t\t\t],\r\n\t\t\t],\r\n\t\t\t'wrapper' => [\r\n\t\t\t\t'width' => '',\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'id' => '',\r\n\t\t\t],\r\n\t\t]);\r\n\t}", "function\tendTable() {\n\n\t\t/**\n\t\t *\n\t\t */\n\t\t$frm\t=\t$this->myDoc->currMasterPage->getFrameByFlowName( \"Auto\") ;\n\t\tfor ( $actRow=$this->myTable->getFirstRow( BRow::RTFooterTE) ; $actRow !== FALSE ; $actRow=$this->myTable->getNextRow()) {\n\t\t\t$this->punchTableRow( $actRow) ;\n\t\t}\n\t\t$frm->currVerPos\t+=\t$this->myTable->currVerPos ;\n\t\t$frm->currVerPos\t+=\t1.5 ;\t\t// now add the height of everythign we have output'\n\n\t\t/**\n\t\t * if there's less than 20 mm on this page\n\t\t *\tgoto next page\n\t\t */\n//\t\t$remHeight\t=\t$frm->skipLine(\t$this->myTablePar) ;\n//\t\tif ( $remHeight < mmToPt( $this->saveZone)) {\n//\t\t\t$this->tableFoot() ;\n//\t\t\t$this->myDoc->newPage() ;\n//\t\t\t$this->tableHead() ;\n//\t\t}\n\t}", "public function testCreateTimesheet()\n {\n }", "public function checkTimeEnd(): bool;", "public function endMaintenancePeriod() : void\n {\n $this->getHesAdminDb()->update('\n UPDATE maintenance_periods SET end_time = now() WHERE end_time IS NULL\n ');\n }", "public function unlockAction()\r\n {\r\n $timesheet = $this->byId();\r\n $this->projectService->unlockTimesheet($timesheet);\r\n $this->redirect('timesheet', 'edit', array('clientid'=>$timesheet->clientid, 'projectid'=>$timesheet->projectid, 'id'=>$timesheet->id));\r\n }", "public function endValidityPeriod()\n {\n\n return true;\n }", "public function sectionEnd() {}", "public function sectionEnd() {}", "public function get_endtime()\n {\n }", "public function mytimesheet($start = null, $end = null)\n\t{\n\n\t\t$me = (new CommonController)->get_current_user();\n\t\t// $auth = Auth::user();\n\t\t//\n\t\t// $me = DB::table('users')\n\t\t// ->leftJoin( DB::raw('(select Max(Id) as maxid,TargetId from files where Type=\"User\" Group By TargetId) as max'), 'max.TargetId', '=', 'users.Id')\n\t\t// ->leftJoin('files', 'files.Id', '=', DB::raw('max.`maxid` and files.`Type`=\"User\"'))\n\t\t// // ->leftJoin('accesscontrols', 'accesscontrols.UserId', '=', 'users.Id')\n\t\t// ->where('users.Id', '=',$auth -> Id)\n\t\t// ->first();\n\n\t\t// $showleave = DB::table('leaves')\n\t\t// ->leftJoin('leavestatuses', 'leaves.Id', '=', 'leavestatuses.LeaveId')\n\t\t// ->leftJoin('users as applicant', 'leaves.UserId', '=', 'applicant.Id')\n\t\t// ->leftJoin('accesscontrols', 'accesscontrols.UserId', '=', 'applicant.Id')\n\t\t// ->leftJoin('users as approver', 'leavestatuses.UserId', '=', 'approver.Id')\n\t\t// ->select('leaves.Id','applicant.Name','leaves.Leave_Type','leaves.Leave_Term','leaves.Start_Date','leaves.End_Date','leaves.Reason','leaves.created_at as Application_Date','approver.Name as Approver','leavestatuses.Leave_Status as Status','leavestatuses.updated_at as Review_Date','leavestatuses.Comment')\n\t\t// ->where('accesscontrols.Show_Leave_To_Public', '=', 1)\n\t\t// ->orderBy('leaves.Id','desc')\n\t\t// ->get();\n\t\t$d=date('d');\n\n\t\tif ($start==null)\n\t\t{\n\n\t\t\tif($d>=21)\n\t\t\t{\n\n\t\t\t\t$start=date('d-M-Y', strtotime('first day of this month'));\n\t\t\t\t$start = date('d-M-Y', strtotime($start . \" +20 days\"));\n\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\t$start=date('d-M-Y', strtotime('first day of last month'));\n\t\t\t\t$start = date('d-M-Y', strtotime($start . \" +20 days\"));\n\n\t\t\t}\n\t\t}\n\n\t\tif ($end==null)\n\t\t{\n\t\t\tif($d>=21)\n\t\t\t{\n\n\t\t\t\t$end=date('d-M-Y', strtotime('first day of next month'));\n\t\t\t\t$end = date('d-M-Y', strtotime($end . \" +19 days\"));\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\t$end=date('d-M-Y', strtotime('first day of this month'));\n\t\t\t\t$end = date('d-M-Y', strtotime($end . \" +19 days\"));\n\n\t\t\t}\n\n\t\t}\n\n\t\t$mytimesheet = DB::table('timesheets')\n\t\t->select('timesheets.Id','timesheets.UserId','timesheets.Latitude_In','timesheets.Longitude_In','timesheets.Latitude_Out','timesheets.Longitude_Out','timesheets.Date',DB::raw('\"\" as Day'),'holidays.Holiday','timesheets.Site_Name','timesheets.Check_In_Type','leaves.Leave_Type','leavestatuses.Leave_Status',\n\t\t'timesheets.Time_In','timesheets.Time_Out','timesheets.Leader_Member','timesheets.Next_Person','timesheets.State','timesheets.Work_Description','timesheets.Remarks','approver.Name as Approver','timesheetstatuses.Status','leaves.Leave_Type','timesheetstatuses.Comment','timesheetstatuses.updated_at as Updated_At','files.Web_Path')\n\t\t->leftJoin( DB::raw('(select Max(Id) as maxid,TargetId from files where Type=\"Timesheet\" Group By TargetId) as maxfile'), 'maxfile.TargetId', '=', 'timesheets.Id')\n\t\t->leftJoin('files', 'files.Id', '=', DB::raw('maxfile.`maxid` and files.`Type`=\"Timesheet\"'))\n\t\t->leftJoin( DB::raw('(select Max(Id) as maxid,TimesheetId from timesheetstatuses Group By TimesheetId) as max'), 'max.TimesheetId', '=', 'timesheets.Id')\n\t\t->leftJoin('timesheetstatuses', 'timesheetstatuses.Id', '=', DB::raw('max.`maxid`'))\n\t\t->leftJoin('users as approver', 'timesheetstatuses.UserId', '=', 'approver.Id')\n\t\t// ->leftJoin('leaves','leaves.UserId','=',DB::raw('timesheets.Id AND str_to_date(timesheets.Date,\"%d-%M-%Y\") Between str_to_date(leaves.Start_Date,\"%d-%M-%Y\") and str_to_date(leaves.End_Date,\"%d-%M-%Y\")'))\n\t\t->leftJoin('leaves','leaves.UserId','=',DB::raw($me->UserId.' AND str_to_date(timesheets.Date,\"%d-%M-%Y\") Between str_to_date(leaves.Start_Date,\"%d-%M-%Y\") and str_to_date(leaves.End_Date,\"%d-%M-%Y\")'))\n\t\t->leftJoin( DB::raw('(select Max(Id) as maxid,LeaveId from leavestatuses Group By LeaveId) as maxleave'), 'maxleave.LeaveId', '=', 'leaves.Id')\n\t\t->leftJoin('leavestatuses', 'leavestatuses.Id', '=', DB::raw('maxleave.`maxid`'))\n\t\t->leftJoin('holidays',DB::raw('1'),'=',DB::raw('1 AND str_to_date(timesheets.Date,\"%d-%M-%Y\") Between str_to_date(holidays.Start_Date,\"%d-%M-%Y\") and str_to_date(holidays.End_Date,\"%d-%M-%Y\")'))\n\t\t->where('timesheets.UserId', '=', $me->UserId)\n\t\t->where(DB::raw('str_to_date(timesheets.Date,\"%d-%M-%Y\")'), '>=', DB::raw('str_to_date(\"'.$start.'\",\"%d-%M-%Y\")'))\n\t\t->where(DB::raw('str_to_date(timesheets.Date,\"%d-%M-%Y\")'), '<=', DB::raw('str_to_date(\"'.$end.'\",\"%d-%M-%Y\")'))\n\t\t->orderBy('timesheets.Id','desc')\n\t\t->get();\n\n\t\t$user = DB::table('users')->select('users.Id','StaffId','Name','Password','User_Type','Company_Email','Personal_Email','Contact_No_1','Contact_No_2','Nationality','Permanent_Address','Current_Address','Home_Base','DOB','NRIC','Passport_No','Gender','Marital_Status','Position','Emergency_Contact_Person',\n\t\t'Emergency_Contact_No','Emergency_Contact_Relationship','Emergency_Contact_Address','files.Web_Path')\n\t\t// ->leftJoin('files', 'files.TargetId', '=', DB::raw('users.`Id` and files.`Type`=\"User\"'))\n\t\t->leftJoin( DB::raw('(select Max(Id) as maxid,TargetId from files where Type=\"User\" Group By Type,TargetId) as max'), 'max.TargetId', '=', 'users.Id')\n\t\t->leftJoin('files', 'files.Id', '=', DB::raw('max.`maxid` and files.`Type`=\"User\"'))\n\t\t->where('users.Id', '=', $me->UserId)\n\t\t->first();\n\n\t\t$arrDate = array();\n\t\t$arrDate2 = array();\n\t\t$arrInsert = array();\n\n\t\tforeach ($mytimesheet as $timesheet) {\n\t\t\t# code...\n\t\t\tarray_push($arrDate,$timesheet->Date);\n\t\t}\n\n\t\t$startTime = strtotime($start);\n\t\t$endTime = strtotime($end);\n\n\t\t// Loop between timestamps, 1 day at a time\n\t\tdo {\n\n\t\t\t if (!in_array(date('d-M-Y', $startTime),$arrDate))\n\t\t\t {\n\t\t\t\t array_push($arrDate2,date('d-M-Y', $startTime));\n\t\t\t }\n\n\t\t\t $startTime = strtotime('+1 day',$startTime);\n\n\t\t} while ($startTime <= $endTime);\n\n\t\tforeach ($arrDate2 as $date) {\n\t\t\t# code...\n\t\t\tarray_push($arrInsert,array('UserId'=>$me->UserId, 'Date'=> $date, 'updated_at'=>date('Y-m-d H:i:s')));\n\n\t\t}\n\n\t\tDB::table('timesheets')->insert($arrInsert);\n\n\t\t$options= DB::table('options')\n\t\t->whereIn('Table', [\"users\",\"timesheets\"])\n\t\t->orderBy('Table','asc')\n\t\t->orderBy('Option','asc')\n\t\t->get();\n\n // $mytimesheet = DB::table('timesheets')\n // ->leftJoin('users as submitter', 'timesheets.UserId', '=', 'submitter.Id')\n // ->select('timesheets.Id','submitter.Name','timesheets.Timesheet_Name','timesheets.Date','timesheets.Remarks')\n // ->where('timesheets.UserId', '=', $me->UserId)\n\t\t\t// ->orderBy('timesheets.Id','desc')\n // ->get();\n\n\t\t\t// $hierarchy = DB::table('users')\n\t\t\t// ->select('L2.Id as L2Id','L2.Name as L2Name','L2.Timesheet_1st_Approval as L21st','L2.Timesheet_2nd_Approval as L22nd',\n\t\t\t// 'L3.Id as L3Id','L3.Name as L3Name','L3.Timesheet_1st_Approval as L31st','L3.Timesheet_2nd_Approval as L32nd')\n\t\t\t// ->leftJoin(DB::raw(\"(select users.Id,users.Name,users.SuperiorId,accesscontrols.Timesheet_1st_Approval,accesscontrols.Timesheet_2nd_Approval,accesscontrols.Timesheet_Final_Approval from users left join accesscontrols on users.Id=accesscontrols.UserId) as L2\"),'L2.Id','=','users.SuperiorId')\n\t\t\t// ->leftJoin(DB::raw(\"(select users.Id,users.Name,users.SuperiorId,accesscontrols.Timesheet_1st_Approval,accesscontrols.Timesheet_2nd_Approval,accesscontrols.Timesheet_Final_Approval from users left join accesscontrols on users.Id=accesscontrols.UserId) as L3\"),'L3.Id','=','L2.SuperiorId')\n\t\t\t// ->where('users.Id', '=', $me->UserId)\n\t\t\t// ->get();\n\t\t\t//\n\t\t\t// $final = DB::table('users')\n\t\t\t// ->select('users.Id','users.Name')\n\t\t\t// ->leftJoin('accesscontrols', 'accesscontrols.UserId', '=', 'users.Id')\n\t\t\t// ->where('Timesheet_Final_Approval', '=', 1)\n\t\t\t// ->get();\n\n\t\t\treturn view('mytimesheet', ['me' => $me, 'user' =>$user, 'mytimesheet' => $mytimesheet,'start' =>$start,'end'=>$end,'options' =>$options]);\n\n\t\t\t//return view('mytimesheet', ['me' => $me,'showleave' =>$showleave, 'mytimesheet' => $mytimesheet, 'hierarchy' => $hierarchy, 'final' => $final]);\n\n\t}", "public function getEndDateTime();", "public function setEndDateTime($timestamp);", "public function setEndtime($endtime){\n $this->_endtime = $endtime;\n }", "public function getDateTimeObjectEnd();", "abstract public function bootEndTabSet();", "public function getEnd();", "protected function end() {\n // must have space after it\n return 'END ';\n }", "public function getEnd() {}", "public function finish()\n {\n // make sure the datetime column isn't blank\n $columns = $this->get_argument( 'columns' );\n if( !array_key_exists( 'datetime', $columns ) || 0 == strlen( $columns['datetime'] ) )\n throw lib::create( 'exception\\notice', 'The date/time cannot be left blank.', __METHOD__ );\n \n foreach( $columns as $column => $value ) $this->get_record()->$column = $value;\n \n // do not include the user_id if this is a site appointment\n if( 0 < $this->get_record()->address_id ) $this->get_record()->user_id = NULL;\n \n if( !$this->get_record()->validate_date() )\n throw lib::create( 'exception\\notice',\n sprintf(\n 'The participant is not ready for a %s appointment.',\n 0 < $this->get_record()->address_id ? 'home' : 'site' ), __METHOD__ );\n \n // no errors, go ahead and make the change\n parent::finish();\n }", "public function finish()\n {\n parent::finish();\n \n // this widget must have a parent, and it's subject must be a participant\n if( is_null( $this->parent ) || 'participant' != $this->parent->get_subject() )\n throw new exc\\runtime(\n 'Appointment widget must have a parent with participant as the subject.', __METHOD__ );\n\n $db_participant = new db\\participant( $this->parent->get_record()->id );\n \n // determine the time difference\n $db_address = $db_participant->get_first_address();\n $time_diff = is_null( $db_address ) ? NULL : $db_address->get_time_diff();\n\n // need to add the participant's timezone information as information to the date item\n $site_name = bus\\session::self()->get_site()->name;\n if( is_null( $time_diff ) )\n $note = 'The participant\\'s time zone is not known.';\n else if( 0 == $time_diff )\n $note = sprintf( 'The participant is in the same time zone as the %s site.',\n $site_name );\n else if( 0 < $time_diff )\n $note = sprintf( 'The participant\\'s time zone is %s hours ahead of %s\\'s time.',\n $time_diff,\n $site_name );\n else if( 0 > $time_diff )\n $note = sprintf( 'The participant\\'s time zone is %s hours behind %s\\'s time.',\n abs( $time_diff ),\n $site_name );\n\n $this->add_item( 'datetime', 'datetime', 'Date', $note );\n\n // create enum arrays\n $modifier = new db\\modifier();\n $modifier->where( 'active', '=', true );\n $modifier->order( 'rank' );\n $phones = array();\n foreach( $db_participant->get_phone_list( $modifier ) as $db_phone )\n $phones[$db_phone->id] = $db_phone->rank.\". \".$db_phone->number;\n \n // create the min datetime array\n $start_qnaire_date = $this->parent->get_record()->start_qnaire_date;\n $datetime_limits = !is_null( $start_qnaire_date )\n ? array( 'min_date' => substr( $start_qnaire_date, 0, -9 ) )\n : NULL;\n\n // set the view's items\n $this->set_item( 'participant_id', $this->parent->get_record()->id );\n $this->set_item( 'phone_id', '', false, $phones );\n $this->set_item( 'datetime', '', true, $datetime_limits );\n\n $this->set_variable( \n 'is_supervisor', \n 'supervisor' == bus\\session::self()->get_role()->name );\n\n $this->finish_setting_items();\n }", "function end();", "public function away_mode_end_time() {\n\n\t\t$current = current_time( 'timestamp' ); //The current time\n\n\t\t//if saved date is in the past update it to something in the future\n\t\tif ( isset( $this->settings['end'] ) && isset( $this->settings['enabled'] ) && $current < $this->settings['end'] ) {\n\t\t\t$end = $this->settings['end'];\n\t\t} else {\n\t\t\t$end = strtotime( date( 'n/j/y 6:00 \\a\\m', ( current_time( 'timestamp' ) + ( 86400 * 2 ) ) ) );\n\t\t}\n\n\t\t//Hour Field\n\t\t$content = '<select name=\"itsec_away_mode[away_end][hour]\" id=\"itsec_away_mode_away_mod_end_time\">';\n\n\t\tfor ( $i = 1; $i <= 12; $i ++ ) {\n\t\t\t$content .= '<option value=\"' . sprintf( '%02d', $i ) . '\" ' . selected( date( 'g', $end ), $i, false ) . '>' . $i . '</option>';\n\t\t}\n\n\t\t$content .= '</select>';\n\n\t\t//Minute Field\n\t\t$content .= '<select name=\"itsec_away_mode[away_end][minute]\" id=\"itsec_away_mode_away_mod_end_time\">';\n\n\t\tfor ( $i = 0; $i <= 59; $i ++ ) {\n\n\t\t\t$content .= '<option value=\"' . sprintf( '%02d', $i ) . '\" ' . selected( date( 'i', $end ), sprintf( '%02d', $i ), false ) . '>' . sprintf( '%02d', $i ) . '</option>';\n\t\t}\n\n\t\t$content .= '</select>';\n\n\t\t//AM/PM Field\n\t\t$content .= '<select name=\"itsec_away_mode[away_end][sel]\" id=\"itsec_away_mode\">';\n\t\t$content .= '<option value=\"am\" ' . selected( date( 'a', $end ), 'am', false ) . '>' . __( 'am', 'it-l10n-ithemes-security-pro' ) . '</option>';\n\t\t$content .= '<option value=\"pm\" ' . selected( date( 'a', $end ), 'pm', false ) . '>' . __( 'pm', 'it-l10n-ithemes-security-pro' ) . '</option>';\n\t\t$content .= '</select><br>';\n\t\t$content .= '<label for=\"itsec_away_mode_away_mod_end_time\"> ' . __( 'Set the time at which the admin dashboard should become available again.', 'it-l10n-ithemes-security-pro' ) . '</label>';\n\n\t\techo $content;\n\n\t}", "public function whereTime() {\n\t\t$pageTitle = 'Where Does Time Go';\n\t\t// $stylesheet = '';\n\n\t\tinclude_once SYSTEM_PATH.'/view/header.php';\n\t\tinclude_once SYSTEM_PATH.'/view/academic-help/tmsub-where-time.php';\n\t\tinclude_once SYSTEM_PATH.'/view/footer.php';\n\t}", "function testTimeSheet()\n{\n\tcreateClient('The Business', '1993-06-20', 'LeRoy', 'Jenkins', '1234567890', '[email protected]', 'The streets', 'Las Vegas', 'NV');\n\n\t//Create Project to assign task\n\tcreateProject('The Business', 'Build Website', 'Build a website for the Business.');\n\tcreateProject('The Business', 'Fix CSS', 'Restyle the website');\n\n\t//Create Tasks\n\tcreateTask('The Business', 'Build Website', 'Start the Project', 'This is the first task for Build Website.');\n\tcreateTask('The Business', 'Build Website', 'Register domain name', 'Reserach webservices and make a good url');\n\tcreateTask('The Business', 'Fix CSS', 'Start the Project', 'Dont be lazy');\n\n\t//Create Developer to record time\n\tcreateEmployee('SE', 'b.zucker', 'Developer', 'bz', 'Brent', 'Zucker', '4045801384', '[email protected]', 'Columbia St', 'Milledgeville', 'GA');\n\n\t//Create TimeSheet Entry\n\tcreateTimeSheet('b.zucker', 'The Business', 'Build Website', 'Start the Project', '2015-03-02 10-30-00', '2015-03-02 15-30-00');\n\t\n\t//prints out timesheet\n\techo \"<h3>TimeSheet</h3>\";\n\ttest(\"SELECT * FROM TimeSheet\");\n\n\t//deletes the timesheet\n\tdeleteTimeSheet('b.zucker', 'The Business', 'Build Website', 'Start the Project', '2015-03-02 10-30-00', '2015-03-02 15-30-00');\n\n\t//deletes the tasks\n\tdeleteTask('The Business', 'Build Website', 'Start the Project');\n\tdeleteTask('The Business', 'Build Website', 'Register domain name');\n\tdeleteTask('The Business', 'Fix CSS', 'Start the Project');\n\n\t//deletes the projects\n\tdeleteProject('The Business', 'Fix CSS');\n\tdeleteProject('The Business', 'Build Website');\n\t\n\t//deletes the client\n\tdeleteClient('The Business');\n\n\t//deletes employee\n\tdeleteEmployee('b.zucker');\n}", "public function finishSectionEdit($end = null) {\n list($id, $start, $type, $title) = array_pop($this->sectionedits);\n if(!is_null($end) && $end <= $start) {\n return;\n }\n $this->doc .= \"<!-- EDIT$id \".strtoupper($type).' ';\n if(!is_null($title)) {\n $this->doc .= '\"'.str_replace('\"', '', $title).'\" ';\n }\n $this->doc .= \"[$start-\".(is_null($end) ? '' : $end).'] -->';\n }", "function update_end()\n {\n }", "static function add_bod_nom_end(): void {\r\n\t\tself::add_acf_inner_field(self::bods, self::bod_nom_end, [\r\n\t\t\t'label' => 'Nomination period end',\r\n\t\t\t'type' => 'text',\r\n\t\t\t'instructions' => 'e.g. March 22 @ 11 p.m.',\r\n\t\t\t'required' => 1,\r\n\t\t\t'conditional_logic' => [\r\n\t\t\t\t[\r\n\t\t\t\t\t[\r\n\t\t\t\t\t\t'field' => self::qualify_field(self::bod_finished),\r\n\t\t\t\t\t\t'operator' => '!=',\r\n\t\t\t\t\t\t'value' => '1',\r\n\t\t\t\t\t],\r\n\t\t\t\t],\r\n\t\t\t],\r\n\t\t\t'wrapper' => [\r\n\t\t\t\t'width' => '',\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'id' => '',\r\n\t\t\t],\r\n\t\t]);\r\n\t}", "static function add_bod_voting_end(): void {\r\n\t\tself::add_acf_inner_field(self::bods, self::bod_voting_end, [\r\n\t\t\t'label' => 'Voting period end',\r\n\t\t\t'type' => 'text',\r\n\t\t\t'instructions' => 'e.g. March 29 @ 6 p.m.',\r\n\t\t\t'required' => 1,\r\n\t\t\t'conditional_logic' => [\r\n\t\t\t\t[\r\n\t\t\t\t\t[\r\n\t\t\t\t\t\t'field' => self::qualify_field(self::bod_finished),\r\n\t\t\t\t\t\t'operator' => '!=',\r\n\t\t\t\t\t\t'value' => '1',\r\n\t\t\t\t\t],\r\n\t\t\t\t],\r\n\t\t\t],\r\n\t\t\t'wrapper' => [\r\n\t\t\t\t'width' => '',\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'id' => '',\r\n\t\t\t],\r\n\t\t]);\r\n\t}", "public function end(): void\n {\n }", "public function end_turn()\n\t{\n\t\t//\t\tpropre a la classe\n\t}", "function section_end()\n\t\t{\n\t\t\t$output = '</div>'; // <!--end ace_control-->\n\t\t\t$output .= '<div class=\"ace_clear\"></div>';\n\t\t\t$output .= '</div>'; //<!--end ace_control_container-->\n\t\t\t$output .= '</div>'; //<!--end ace_section-->\n\t\t\treturn $output;\n\t\t}", "abstract public function bootEndTab();", "function AfterEdit(&$values,$where,&$oldvalues,&$keys,$inline,&$pageObject)\n{\n\n\t\tglobal $conn;\n\n$attend_id=$values['attend_id'];\n\n//select shecdule ID from timetable\n$sql_at= \"SELECT scheduleID,courseID,date,(end_time-start_time) AS hour FROM schedule_timetable WHERE id='$attend_id'\";\n$query_at=db_query($sql_at,$conn);\n$row_at=db_fetch_array($query_at);\n\n$scheduleID=$row_at['scheduleID'];\n\n//select related schedule id from schedule\n$sql_at2= \"SELECT programID,batchID,groupID FROM schedule WHERE scheduleID='$scheduleID'\";\n$query_at2=db_query($sql_at2,$conn);\n$row_at2=db_fetch_array($query_at2);\n\n$program=$row_at2['programID'];\n$batch=$row_at2['batchID'];\n$class=$row_at2['groupID'];\n\n//update program , batch, class to student_attendance table\n$date=$row_at['date'];\n$hour=$row_at['hour'];\n$course=$row_at['courseID'];\n$id=$keys['id'];\n$sql_up= \"Update student_attendance set programID ='$program', batchID='$batch',class='$class',course='$course',date='$date',hour='$hour' where id='$id'\";\n$query_up=db_exec($sql_up,$conn);\n\n//query the total hour for this module\n$sql_th= \"SELECT total_hour FROM program_course WHERE programID='$program' && CourseID=$course\";\n$query_th=db_query($sql_th,$conn);\n$row_th=db_fetch_array($query_th);\n\n$totalhour=$row_th['total_hour'];\n//the percentage wight of absentee ( $hour/$totalhour)\n$weight_absent=($hour/$totalhour*100);\n\n//query current attendance status for this student, program , module\n$studentID=$values['StudentID'];\n$sql_at3=\"SELECT Attendance FROM student_course WHERE StudentID=$studentID AND programID=$program AND CourseID=$course\";\n$query_at3=db_query($sql_at3,$conn);\n$row_at3=db_fetch_array($query_at3);\n\n$current_attendance=$row_at3['Attendance'];\n//update student_course attendance\n\n$net_attendance=$current_attendance-$weight_absent;\n\n$sql_ups= \"Update student_course SET Attendance='$net_attendance' where StudentID='$studentID' && programID='$program' && CourseID=$course\";\n$query_ups=db_exec($sql_ups,$conn);\n;\t\t\n}", "function weekviewFooter()\n\t {\n\t // Read the hours_lock id\n\t $periodid = $this->m_postvars[\"periodid\"];\n\t $viewdate = $this->m_postvars['viewdate'];\n $viewuser = $this->m_postvars['viewuser'];\n\n\t // If the periodid isnt numeric, then throw an error, no action can be\n // taken so no buttons are added to the footer.\n\t if (!is_numeric($periodid))\n\t {\n\t atkerror(\"Posted periodid isn't numeric\");\n\t return \"\";\n\t }\n\n\t // Retrieve the hours_lock record for the specified periodid\n\t $hourslocknode = &atkGetNode(\"timereg.hours_lock\");\n $hourlocks = $hourslocknode->selectDb(\"hours_lock.id='\".$periodid.\"'\n AND (hours_lock.userid='\".$viewuser.\"'\n OR hours_lock.userid IS NULL)\");\n atk_var_dump($hourlocks);\n\n // Don't display any buttons if there are no hourlocks found\n if (count($hourlocks)==0)\n {\n return \"\";\n }\n\n // Determine the approval status\n $hourlockapproved = ($hourlocks[0][\"approved\"]==1);\n\n $output = '<br />' . sprintf(atktext(\"hours_approve_thestatusofthisperiodis\"), $this->m_lockmode) . \": \";\n if ($hourlockapproved)\n {\n $output.= '<font color=\"#009900\">' . atktext(\"approved\") . '</font><br /><br />';\n }\n else\n {\n $output.= '<font color=\"#ff0000\">' . atktext(\"not_approved_yet\") . '</font><br /><br />';\n }\n\n // Add an approve or disapprove button to the weekview\n\t if (!$hourlockapproved)\n\t {\n\t $output.= atkButton(atktext(\"approve\"),\n dispatch_url(\"timereg.hours_approve\",\"approve\",\n array(\"periodid\"=>$periodid,\n \"viewuser\"=>$viewuser,\n \"viewdate\"=>$viewdate)),\n SESSION_NESTED) . \"&nbsp;&nbsp;\";\n\t }\n\t $output.= atkButton(atktext(\"disapprove\"),\n dispatch_url(\"timereg.hours_approve\",\"disapprove\",\n array(\"periodid\"=>$periodid,\n \"viewuser\"=>$viewuser,\n \"viewdate\"=>$viewdate)),\n SESSION_NESTED);\n\n\t // Return the weekview including button\n\t return $output;\n\t }", "function end_table() {\n if ($this->_cellopen) {\n $this->end_cell();\n }\n // Close any open table rows\n if ($this->_rowopen) {\n $this->end_row();\n }\n ?></table><?php\n echo \"\\n\";\n\n $this->reset_table();\n }", "private function isEndOfDay()\n {\n // > 10:00pm\n return (int) $this->block->confirmed_at->format('H') >= 22;\n }", "public function eighth_hour_clockout($timesheet)\n\t{\n\t\t$sent_already = $this->CI->clockout_notifications_model->exists(\n\t\t\t$timesheet->user_id,\n\t\t\t'CLOCKOUT_FIRST_8HOUR_WARNING'\n\t\t);\n\n\t\tif ($sent_already) return false;\n\n\t\t// Send notification to managers\n\t\t$this->CI->cfpslack_library->notify(\n\t\t\tsprintf(\n\t\t\t\t$this->CI->config->item('eighth_hour_5min_clockout'),\n\t\t\t\t$this->CI->user_model->get_name($timesheet->user_id),\n\t\t\t\t$timesheet->workorder_id,\n\t\t\t\t$timesheet->id\n\t\t\t)\n\t\t);\n\n\t\t// SMS the user\n\t\t$this->CI->sms_library->send(\n\t\t\t$timesheet->user_id,\n\t\t\t$this->CI->config->item('eighth_hour_sms'),\n\t\t\t$timesheet->workorder_id\n\t\t);\n\n\t\t// Mark sending\n\t\t$this->CI->clockout_notifications_model->create(\n\t\t\t$timesheet->user_id,\n\t\t\t'CLOCKOUT_FIRST_8HOUR_WARNING',\n\t\t\t$timesheet->id\n\t\t);\n\n\t\treturn true;\n\t}", "static function end(Reservation $res) {\n\t\t$db = new Db();\n\t\t$db->saveQry(\"INSERT INTO `#_reminder` (`reservation`, `status`) \".\n\t\t\t\t\"VALUES (?,?)\", $res->getId(), 'end');\n\t}", "public function checkLeaveApplyTimeArea($emp_seq_no,$company_id,$begin_time,$end_time)\n {\n if(empty($begin_time) || empty($end_time)) return 'no parameter';\n //$this->DBConn->debug = 1;\n $sql= <<<eof\n select count(*) cnt\n from hr_carding\n where psn_id = :emp_seqno\n and psn_seg_segment_no = :company_id\n and ((breakbegin is null and\n to_date(:begin_time, 'yyyy-mm-dd hh24:mi') between intime and outtime) or\n (breakbegin is not null and\n (to_date(:begin_time1, 'yyyy-mm-dd hh24:mi') between intime and\n breakbegin or to_date(:begin_time2, 'yyyy-mm-dd hh24:mi') between\n breakend and outtime)))\neof;\n $rs = $this->DBConn->GetOne($sql,array('emp_seqno'=>$emp_seq_no,\n 'company_id'=>$company_id,\n 'begin_time'=>$begin_time,\n 'begin_time1'=>$begin_time,\n 'begin_time2'=>$begin_time));\n if($rs==0) return '1';\n $sql = <<<eof\n select count(*) cnt\n from hr_carding\n where psn_id = :emp_seqno\n and psn_seg_segment_no = :company_id\n and ((breakbegin is null and\n to_date(:end_time, 'yyyy-mm-dd hh24:mi') between intime and\n outtime) or\n (breakbegin is not null and\n (to_date(:end_time1, 'yyyy-mm-dd hh24:mi') between intime and\n breakbegin or to_date(:end_time2, 'yyyy-mm-dd hh24:mi') between\n breakend and outtime)))\neof;\n $rs = $this->DBConn->GetOne($sql,array('emp_seqno'=>$emp_seq_no,\n 'company_id'=>$company_id,\n 'end_time'=>$end_time,\n 'end_time2'=>$end_time,\n 'end_time1'=>$end_time));\n if($rs==0) return '2';\n return 'ok';\n }", "public function unsetEndTime(): void\n {\n $this->endTime = [];\n }", "public function endRun(): void\n {\n $file = $this->getLogDir() . 'timeReport.json';\n $data = is_file($file) ? json_decode(file_get_contents($file), true) : [];\n $data = array_replace($data, $this->timeList);\n file_put_contents($file, json_encode($data, JSON_PRETTY_PRINT));\n }", "public function getEndTimestamp() {}", "function showEnd( $appctx )\n\t\t{\n\t\t$appctx->Moins() ;\n\t\t}", "function setEndTime($event, $time) {\n Timer::timers($event, array(\n 'stop' => $time, \n 'stopped' => true\n ));\n }", "private function endLap() {\n $lapCount = count( $this->laps ) - 1;\n if ( count( $this->laps ) > 0 ) {\n $this->laps[$lapCount]['end'] = $this->getCurrentTime();\n $this->laps[$lapCount]['total'] = $this->laps[$lapCount]['end'] - $this->laps[$lapCount]['start'];\n }\n }", "function eo_schedule_end($format='d-m-Y',$id=''){\n\techo eo_get_schedule_end($format,$id);\n}", "public function end();", "public function end();", "public function end();", "public function end();", "function cera_grimlock_footer() {\n\t\tdo_action( 'grimlock_prefooter', array(\n\t\t\t'callback' => 'cera_grimlock_prefooter_callback',\n\t\t) );\n\n\t\tdo_action( 'grimlock_footer', array(\n\t\t\t'callback' => 'cera_grimlock_footer_callback',\n\t\t) );\n\t}", "function SetEndTimestamp ($hunt_end_timestamp) {\n $hunt_division = mysql_result(@mysql_query(\"SELECT `hunt_division` FROM `hunts` WHERE `hunt_id` = '$this->hunt_id'\", $this->ka_db), 0, 'hunt_division');\n if (($this->Allowed('allhunts') == true) || (($this->Allowed('hunts') == true) && ($this->CheckDivision($hunt_division) == true))) {\n if (@mysql_query (\"UPDATE `hunts` SET `hunt_end_timestamp` = '$hunt_end_timestamp' WHERE `hunt_id` = $this->hunt_id\", $this->ka_db)) {\n $this->hunt_end_timestamp = $hunt_end_timestamp;\n return true;\n } else\n return false;\n } else {\n $this->roster_error = \"You do not have access to this function.\";\n return false;\n }\n }", "public function _end_block()\n\t{\n\t\t//echo '</table>';\n\t}", "public function rejectTimesheet() {\n $id = request('timesheetId');\n $notes = request('notes');\n Timesheet::find($id)->update([\n 'status'=>'rejected',\n 'notes'=>$notes\n ]);\n return back();\n }", "abstract protected function doEnd();", "function endTable()\n {\n if (! $this->tableIsOpen)\n die('ERROR: TABLE IS NOT STARTED');\n \n $this->documentBuffer .= \"</table>\\n\";\n \n $this->tableIsOpen = false;\n $this->tableLastRow = 0;\n }", "function doc_end () {\r\n\t}", "function eo_get_schedule_end($format='d-m-Y',$id=''){\n\tglobal $post;\n\t$event = $post;\n\n\tif(isset($id)&&$id!='') $event = eo_get_by_postid($id);\n\n\t$date = esc_html($event->reoccurrence_end.' '.$event->StartTime);\n\n\tif(empty($date)||$date==\" \")\n\t\treturn false;\n\n\treturn eo_format_date($date,$format);\n}", "function onlyEndInput($beginTime, $endTime){\n if($beginTime == null && $endTime != null) {\n return true;\n }\n else {\n return false;\n }\n}", "public function friendly_stop() {\n global $OUTPUT;\n\n $riskyediting = ($this->surveypro->riskyeditdeadline > time());\n $utilitylayoutman = new utility_layout($this->cm, $this->surveypro);\n $hassubmissions = $utilitylayoutman->has_submissions();\n\n if ($hassubmissions && (!$riskyediting)) {\n echo $OUTPUT->notification(get_string('applyusertemplatedenied01', 'mod_surveypro'), 'notifyproblem');\n $url = new \\moodle_url('/mod/surveypro/view_submissions.php', ['s' => $this->surveypro->id]);\n echo $OUTPUT->continue_button($url);\n echo $OUTPUT->footer();\n die();\n }\n\n if ($this->surveypro->template && (!$riskyediting)) { // This survey comes from a master template so it is multilang.\n echo $OUTPUT->notification(get_string('applyusertemplatedenied02', 'mod_surveypro'), 'notifyproblem');\n $url = new \\moodle_url('/mod/surveypro/view_userform.php', ['s' => $this->surveypro->id]);\n echo $OUTPUT->continue_button($url);\n echo $OUTPUT->footer();\n die();\n }\n }", "function Atv_boolPresensiTimeAllowed($day, $time_start, $time_end): bool\n{\n $result = false;\n // jika 'all' maka hanya boleh hari senin sampai jumat, atau hari yang ditentukan diluar itu\n if ((($day == Atv_setDayKegiatan('all')) && (Carbon_IsWorkDayNow())) || ($day == Carbon_DBDayNumOfWeek()))\n if ((Carbon_AnyTimeNow() >= $time_start) && (Carbon_AnyTimeNow() <= $time_end)) $result = true;\n return $result;\n}", "public function timeManagement() {\n\t\t$pageTitle = 'Time Management';\n\t\t// $stylesheet = '';\n\n\t\tinclude_once SYSTEM_PATH.'/view/header.php';\n\t\tinclude_once SYSTEM_PATH.'/view/academic-help/time-management.php';\n\t\tinclude_once SYSTEM_PATH.'/view/footer.php';\n\t}", "function unattended() {\n\t\tself::$_db->saveQry(\"SELECT `ID` FROM `#_reservations` \".\n\t\t\t\t\"WHERE (`status` = 'queued') \".\n\t\t\t\t\"AND `startTime` <= ?\",\n\t\t\t\tCalendar::unattended());\n\t\t\n\t\twhile($res = self::$_db->fetch_assoc())\n\t\t\tReservation::load($res['ID'])->unattended();\n\t}", "public function end()\n {\n }", "public function testUpdateTimesheet()\n {\n }", "public function ended();", "public function hasEndYear() {\n return $this->_has(15);\n }", "public function endTabs() {\n\t\t\treturn \"\"; \n\t\t}", "public function setEndAt($end_at)\n {\n $this->end_at = $end_at;\n }", "function eo_the_end($format='d-m-Y',$id=''){\n\techo eo_get_the_end($format,$id);\n}", "private function _retrieveEndDate()\n {\n global $preferences;\n\n $bdate = new \\DateTime($this->_begin_date);\n if ( $preferences->pref_beg_membership != '' ) {\n //case beginning of membership\n list($j, $m) = explode('/', $preferences->pref_beg_membership);\n $edate = new \\DateTime($bdate->format('Y') . '-' . $m . '-' . $j);\n while ( $edate <= $bdate ) {\n $edate->modify('+1 year');\n }\n $this->_end_date = $edate->format('Y-m-d');\n } else if ( $preferences->pref_membership_ext != '' ) {\n //case membership extension\n $dext = new \\DateInterval('P' . $this->_extension . 'M');\n $edate = $bdate->add($dext);\n $this->_end_date = $edate->format('Y-m-d');\n }\n }", "public function endQuestion($questionId, $time)\n\t{\n\t\t$sql = \"UPDATE questions SET end_time = $time WHERE id = $questionId\";\n\t\t$conn = mysqli_connect(SERVER_ADDRESS,USER_NAME,PASSWORD,DATABASE);\n\t\t$result = mysqli_query($conn,$sql);\n\t}", "function bookking_print_recent_activity($course, $isteacher, $timestart) {\n\n return false;\n}", "function haltDecrementation()\n {\n return ( //THIS BLOCK TEST WHETHER THE CURRENT DAY IS A SUNDAY\n date('N', intval($this->workTime)) == 7\n && // THIS BLOCK CHECKS THAT THE DATE HAS ASCENDED IN DECREMENTATION\n // MEANING THAT WE HAVE ENTERED A NEW MONTH\n (\n intval(date('m', $this->workTime - 86400))\n !=\n intval(date('m', intval($_GET['currT'])))\n || // IF IT WAS JUST A WEEK VIEW, WE WILL STOP NOW.\n $_GET['weekOrMonth'] == 'week'\n )\n );\n }", "public function setEndTime($endTime) {\r\n\t\t$this->endTime = $endTime;\r\n\t}", "function end_time($end_time=null)\n {\n if (isset($end_time)) $this->end_time = $end_time;\n return $this->end_time;\n }", "function roomify_conversations_add_end_date_field() {\n field_info_cache_clear();\n\n // \"conversation_book_end_date\" field.\n if (field_read_field('conversation_book_end_date') === FALSE) {\n $field = array(\n 'field_name' => 'conversation_book_end_date',\n 'type' => 'datetime',\n 'cardinality' => 1,\n 'locked' => 1,\n 'settings' => array(\n 'cache_count' => 4,\n 'cache_enabled' => 0,\n 'granularity' => array(\n 'day' => 'day',\n 'hour' => 0,\n 'minute' => 0,\n 'month' => 'month',\n 'second' => 0,\n 'year' => 'year',\n ),\n 'profile2_private' => FALSE,\n 'timezone_db' => '',\n 'todate' => '',\n 'tz_handling' => 'none',\n ),\n );\n field_create_field($field);\n }\n\n field_cache_clear();\n\n // \"conversation_book_end_date\" field instance.\n if (field_read_instance('roomify_conversation', 'conversation_book_end_date', 'standard') === FALSE) {\n $instance = array(\n 'field_name' => 'conversation_book_end_date',\n 'entity_type' => 'roomify_conversation',\n 'label' => 'End Date',\n 'bundle' => 'standard',\n 'required' => FALSE,\n 'widget' => array(\n 'type' => 'date_popup',\n ),\n 'settings' => array(\n 'default_value' => 'now',\n 'default_value2' => 'same',\n 'default_value_code' => '',\n 'default_value_code2' => '',\n 'user_register_form' => FALSE,\n ),\n );\n field_create_instance($instance);\n }\n}", "public function blockEnd() {\n $this->outputEditmode('</div>');\n }", "public function hasEndMonth() {\n return $this->_has(7);\n }", "public function getEndreservation($teetimeid){\n $this->layout->content = View::make('endreservation')->with('teetimeid', $teetimeid);\n }", "public function finish()\n {\n // we'll need the arguments to send to mastodon\n $args = $this->arguments;\n\n // replace the availability id with a unique key\n $db_availability = $this->get_record();\n unset( $args['id'] );\n $args['noid']['participant.uid'] = $db_availability->get_participant()->uid;\n $args['noid']['availability.monday'] = $db_availability->monday;\n $args['noid']['availability.tuesday'] = $db_availability->tuesday;\n $args['noid']['availability.wednesday'] = $db_availability->wednesday;\n $args['noid']['availability.thursday'] = $db_availability->thursday;\n $args['noid']['availability.friday'] = $db_availability->friday;\n $args['noid']['availability.saturday'] = $db_availability->saturday;\n $args['noid']['availability.sunday'] = $db_availability->sunday;\n $args['noid']['availability.start_time'] = $db_availability->start_time;\n $args['noid']['availability.end_time'] = $db_availability->end_time;\n\n parent::finish();\n\n // now send the same request to mastodon\n $mastodon_manager = lib::create( 'business\\cenozo_manager', MASTODON_URL );\n $mastodon_manager->push( 'availability', 'edit', $args );\n }", "public function endCurrentRound(){\n global $tpl, $lng, $ilCtrl, $ilTabs;\n\n $ilTabs->activateTab(\"showCurrentRound\");\n\n $this->object->endCurrentRound();\n $ilCtrl->redirect($this, \"showCurrentRound\");\n }", "public function add_working_time($empID, $start, $end) \n {\n \n require_once('models/Hours.class.php');\n \n if ($end <= $start)\n return false;\n \n //Check new hours are within the businesses opening hours\n $hours = new Hours($this->db);\n \n if (!$hours->checkWithinHours($start) || !$hours->checkWithinHours($end)){\n \n $this->redirect(\"WorkerAvailability.php?error=outside_opening_hours\");\n die();\n }\n \n while ($start < $end)\n {\n $sd = $start->format(\"Y-m-d H:i:s\");\n $q = $this->db->prepare(\"SELECT dateTime FROM TimeSlot WHERE dateTime = ?;\"); // check appointment exists\n $q->bind_param('s', $sd);\n \n if (!$q->execute())\n return false;\n \n $result = $q->get_result();\n\n if (mysqli_num_rows($result) > 0) \n {\n $cw = 1;\n $row = mysqli_fetch_array($result); \n \n $q = $this->db->prepare(\"SELECT dateTime, empID FROM CanWork WHERE empID = ? AND dateTime = ?;\"); // check CanWork not already updated\n \n $rows = 0;\n \n if ($q)\n {\n $q->bind_param('ss', $empID, $row['dateTime']);\n \n if (!$q->execute())\n return false;\n \n $result = $q->get_result();\n $rows = mysqli_num_rows($result);\n } \n \n \n \n if ($rows == 0) \n {\n $q = $this->db->prepare(\"INSERT INTO CanWork (empID, dateTime) VALUES (?, ?)\");\n $q->bind_param('ss', $empID, $row['dateTime']);\n \n if (!$q->execute())\n return false;\n }\n \n else return false; // overlaps not accepted\n }\n else \n {\n echo \"failed <br>\";\n // exception\n return false;\n }\n \n $start->modify('+'.MINIMUM_INTERVAL.' minutes');\n }\n \n return true;\n }", "public function hasEndYear() {\n return $this->_has(6);\n }", "public function testBookedSpacesEnd()\n {\n $room = $this->objFromFixture(\n \"BookableProduct\",\n \"fancyroom\"\n );\n\n $start = \"2017-06-17 15:00:00\";\n $end = \"2017-06-20 11:00:00\";\n\n // Check that we find the correct number of \n // already booked spaces in thei time period\n $total_places = SimpleBookings::getTotalBookedSpaces(\n $start,\n $end,\n $room->ID\n );\n\n $this->assertEquals(2, $total_places);\n }", "public function end() {}", "public function end() {}", "public function end() {}", "function GetEndTimestamp () {\n return $this->hunt_end_timestamp;\n }", "public function checkAutoFinish()\n {\n $hFunction = new \\Hfunction();\n $modelCompany = new QcCompany();\n $currentDateCheck = $hFunction->carbonNow();\n # lay thong tin dang hoa dong\n $dataRequest = $this->getAllInfoActivity();\n if ($hFunction->checkCount($dataRequest)) {\n foreach ($dataRequest as $request) {\n $requestDate = $request->requestDate();\n $checkDate = $hFunction->datetimePlusDay($modelCompany->getDefaultTimeBeginToWorkOfDate($requestDate), 1);\n if ($currentDateCheck > $checkDate) {# qua ngay tang ca\n $this->confirmFinish($request->requestId());\n }\n }\n }\n\n }", "function setEnd($end) {\n\t\t\t$this->end = $end;\n\t\t\treturn TRUE;\n\t\t}", "function eo_get_the_end($format='d-m-Y',$id='',$occurrence=0){\n\tglobal $post;\n\t$event = $post;\n\n\tif(isset($id)&&$id!='') $event = eo_get_by_postid($id);\n\n\tif(empty($event)) return false;\n\n\t$date = esc_html($event->EndDate).' '.esc_html($event->FinishTime);\n\n\tif(empty($date)||$date==\" \")\n\t\treturn false;\n\n\treturn eo_format_date($date,$format);\n}", "function setEndDateAndTime($end_date = \"\", $end_time) \n\t{\n\t\t$y = ''; $m = ''; $d = ''; $h = ''; $i = ''; $s = '';\n\t\tif (preg_match(\"/(\\d{4})-(\\d{2})-(\\d{2})/\", $end_date, $matches))\n\t\t{\n\t\t\t$y = $matches[1];\n\t\t\t$m = $matches[2];\n\t\t\t$d = $matches[3];\n\t\t}\n\t\tif (preg_match(\"/(\\d{2}):(\\d{2}):(\\d{2})/\", $end_time, $matches))\n\t\t{\n\t\t\t$h = $matches[1];\n\t\t\t$i = $matches[2];\n\t\t\t$s = $matches[3];\n\t\t}\n\t\t$this->end_date = sprintf('%04d%02d%02d%02d%02d%02d', $y, $m, $d, $h, $i, $s);\n\t}", "public function setEndTime(?Time $value): void {\n $this->getBackingStore()->set('endTime', $value);\n }" ]
[ "0.58446544", "0.5840452", "0.56942236", "0.56707174", "0.56699437", "0.56380737", "0.5503007", "0.54906905", "0.54873836", "0.5484309", "0.5477362", "0.54764307", "0.5412169", "0.537824", "0.537824", "0.5371143", "0.53669035", "0.53657734", "0.5303619", "0.52943504", "0.52921975", "0.5248716", "0.5244682", "0.522705", "0.5223323", "0.5203743", "0.5194543", "0.51896304", "0.5171097", "0.5156519", "0.5136462", "0.5112414", "0.5103241", "0.5073985", "0.50736314", "0.5069111", "0.5050521", "0.50488037", "0.5025623", "0.5024087", "0.50174105", "0.50137115", "0.50109863", "0.5007706", "0.5000334", "0.49995425", "0.4991526", "0.49815693", "0.49661374", "0.49559143", "0.49554053", "0.49541286", "0.49522582", "0.49485555", "0.49485555", "0.49485555", "0.49485555", "0.49387157", "0.4933071", "0.49315563", "0.49245703", "0.49244142", "0.49194935", "0.491137", "0.49104902", "0.49103186", "0.4909922", "0.49046293", "0.49037603", "0.49000776", "0.48985147", "0.48912606", "0.48908877", "0.48885667", "0.48785207", "0.4872449", "0.4863823", "0.48590714", "0.4855653", "0.4844357", "0.48425853", "0.483724", "0.48370215", "0.4831189", "0.4830907", "0.4827512", "0.48270914", "0.48262575", "0.48250982", "0.4821478", "0.4816457", "0.48140287", "0.48136818", "0.48136818", "0.48136818", "0.47970217", "0.4788947", "0.47854465", "0.47846252", "0.47822776", "0.47800565" ]
0.0
-1
/ Allowance Form /
public function allowance_form($id = 0) { $this->getMenu() ; $this->data['client_lists'] = $this->timesheetModel->clientListDropdown('client_name','client_id'); $this->data['form'] = $this->timesheetModel->getAllowanceDetail($id); $this->data['back'] = $this->data['site'] .'/project'; $this->data['approve'] = $this->data['site'] .'/project/request/'.$id; $this->data['cclient'] = ""; $this->load->view('timesheet_allowance_form',$this->data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function allowance() {\n $allowance = $this->db2->table('hr_allowances')->select('id', 'fkcoa_id', 'allowance', 'default_amount')->orderby('id')->get();\n return View::make('settings/allowance.allowance')->with(array('allowances' => $allowance));\n }", "public function allowAction()\n\t{\trequire_once( 'form.inc' );\n\n\t\tif( $this->_getParam('user') )\n\t\t{\tif( $this->db->allowRefund($this->_getParam('user')) )\n\t\t\t{\n\t\t\t}else\n\t\t\t{\n\t\t\t}\n\t\t}\n\n\t\t// Calculate the number for the past term\n\t\t$term = (date('Y') - 1900) * 10 + floor((date('m') - 1) / 4) * 4 + 1;\n\t\tif( $term % 10 == 1 )\n\t\t{\t$term -= 2;\n\t\t}else\n\t\t{\t$term -= 4;\n\t\t}\n\n\t\t// Add list of people who already have been enabled\n\t\t$this->view->user_allowed = implode( \", \", $this->db->getRefunds('REGULAR', $term));\n\n\t\t// Add list of users who got their refunds last term\n\t\t$this->view->user_options = $this->db->getRefunds('RECEIVED', $term);\n\t}", "public function edit(Allowance $allowance)\n {\n //\n }", "public function show(Allowance $allowance)\n {\n //\n }", "public function show(Allowance $allowance)\n {\n //\n }", "public function createUpdateNetformAllowance(){\n\t\tif(!empty($this->group_permissions) && in_array(24,$this->group_permissions)){\n\t\t\t$postData\t= $this->input->post();\n\t\t\tif(!empty($postData)){\n\t\t\t\t$result\t\t= $this->Netform_allowance_model->createUpdateNetformAllowance($postData);\n\t\t\t\tif($result){\n\t\t\t\t\tdie('DFGHJ');\n\t\t\t\t\t$message='<div class=\"alert alert-block alert-success\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\"><i class=\"ace-icon fa fa-times\"></i></button><p>Netform Allowance successfully created/updated.</p></div>';\n\t\t\t\t\t$this->session->set_flashdata('message',$message);\n\t\t\t\t\tredirect('netformallowances');\n\t\t\t\t}else{\n\t\t\t\t\tdie('HH');\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t\t$message='<div class=\"alert alert-block alert-danger\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\"><i class=\"ace-icon fa fa-times\"></i></button><p>'.$this->NotAuthorizedMsg.'</p></div>';\n\t\t\t$this->session->set_flashdata('message',$message);\n\t\t\tredirect('dashboard');\n\t\t}\n\t}", "public function getAllowSpecific();", "public function addAllowance() {\n $postData = Input::all();\n if (!empty($postData)) {\n $allowance = trim(Input::get('allowance'));\n $defamount = str_replace(\",\", \"\", trim(Input::get('default_amount')));\n $default_amount = trim(str_replace('$', '', $defamount));\n if ($default_amount != 0) {\n $allowance_type = 1;\n } else {\n $allowance_type = 2;\n }\n\n $checkStatus = 0;\n\n //$checkStatus = $this->db2->select($this->db2->raw('select count(id) as count from il_accounting_coa_level4 where level4_name=\"'.$name.'\"'));\n $allowanceQuery = $this->db2->table('hr_allowances')->select('id', 'fkcoa_id', 'allowance', 'default_amount')->where('allowance', '=', $allowance)->first();\n if (!$allowanceQuery) {\n //$insertCoa = $this->db2->table('il_accounting_coa_level4')->insertGetId(array('level4_name' => $name,'fklevel3_id' => 27,'edit_status' => 2));\n $insert = $this->db2->table('hr_allowances')->insert(array('allowance' => $allowance, 'fkcoa_id' => 0, 'default_amount' => $default_amount, 'allowance_type' => $allowance_type));\n if ($insert)\n return Redirect::to('config/allowance')->with(array('successalert' => 'Allowance added Successfully'));\n else\n return Redirect::to('config/allowance')->with(array('erroralert' => 'Server problem Try again'));\n } else {\n return Redirect::to('config/allowance')->with(array('erroralert' => 'Allowance name already exists'));\n }\n }\n return Redirect::to('config/allowance');\n }", "public function allowance($pg=1, $limit=0) {\n\t\t$this->getMenu();\n\t\t$form = array(\n\t\t\t'client_name' => $this->input->get('client_name'),\n\t\t\t'project_no' => \t$this->input->get('project_no'),\n\t\t);\n\t\n\t\tif($limit) {\n\t\t\t$this->session->set_userdata('rpp', $limit);\n\t\t\t$this->rpp = $limit;\n\t\t}\n\t\t\n\t\t$limit = $limit ? $limit : $this->rpp;\n\t\t$totalRow = count($this->timesheetModel->getAllowance($form));\n\t\t$this->data['form'] = $form;\n\t\t$this->data['pg'] = $this->setPaging($totalRow, $pg, $limit);\n\t\t$this->data['rows']\t= $this->timesheetModel->getAllowance($form, $limit, $this->data['pg']['o']);\n\t\t$this->load->view('timesheet_allowance',$this->data);\n\t}", "private function calculateRequiredApprovals() {\r\n\r\n if($this->commitments->requiresApproval() == true) {\r\n require_once('classes/tracking/approvals/Commitments.php');\r\n $this->addApproval(new \\tracking\\approval\\Commitments($this->trackingFormId));\r\n }\r\n\r\n // If the form doesn't have commitments, then we still want the Dean to review it\r\n // so we add this approval.\r\n if(!$this->commitments->requiresApproval()) {\r\n require_once('classes/tracking/approvals/DeanReview.php');\r\n $this->addApproval(new \\tracking\\approval\\DeanReview($this->trackingFormId));\r\n }\r\n\r\n if($this->COIRequiresApproval() == true) {\r\n require_once('classes/tracking/approvals/COI.php');\r\n $this->addApproval(new \\tracking\\approval\\COI($this->trackingFormId));\r\n } else {\r\n // there are no COI, but ORS still needs to review so apply ORSReview\r\n require_once('classes/tracking/approvals/ORSReview.php');\r\n $this->addApproval(new \\tracking\\approval\\ORSReview($this->trackingFormId));\r\n }\r\n\r\n if($this->compliance->requiresBehavioural() == true) {\r\n require_once('classes/tracking/approvals/EthicsBehavioural.php');\r\n $this->addApproval(new \\tracking\\approval\\EthicsBehavioural($this->trackingFormId));\r\n }\r\n\r\n\r\n/* if($this->compliance->requiresHealth() == true) {\r\n require_once('classes/tracking/approvals/EthicsHealth.php');\r\n $this->addApproval(new \\tracking\\approval\\EthicsHealth($this->trackingFormId));\r\n }\r\n\r\n if($this->compliance->requiresAnimal() == true) {\r\n require_once('classes/tracking/approvals/EthicsAnimal.php');\r\n $this->addApproval(new \\tracking\\approval\\EthicsAnimal($this->trackingFormId));\r\n }\r\n\r\n require_once('classes/tracking/approvals/EthicsBiohazard.php');\r\n if($this->compliance->requiresBiohazard() == true) {\r\n $this->addApproval(new \\tracking\\approval\\EthicsBiohazard($this->trackingFormId));\r\n }*/\r\n }", "function determineEligibility() {\n if (isset($_REQUEST['eligible_submitted'])) {\n /* eligible if:\n * a woman\n * aged 16-50\n * has ticked one of the 'partner' checkboxes\n */\n $eligibility = false;\n if(isset($_REQUEST['female']) and isset($_REQUEST['age'])) {\n\tif ($_REQUEST['female'] == \"yes\" and $_REQUEST['age'] == \"yes\") {\n\n\t foreach ($_REQUEST as $req=>$value) {\n\t if(strpos( $req , 'partner_' ) !== false) {\n\t $eligibility = true;\n\t }\n\t }\n\t $this->eligible = $eligibility;\n\t $_SESSION[\"eligible\"] = $this->eligible;\n\t}\n }\n if ($this->eligible === true) {\n\t/* eligible go to plain language statement */\n\t$_REQUEST['mode'] = \"introduction\";\n\treturn $this->showIntro();\n }\n else {\n\t/* otherwise, thanks for coming */\n\treturn $this->showIneligible();\n }\n }\n $output = $this->outputBoilerplate('eligibility.html');\n return $output;\n }", "public function editAllowance() {\n $id = Request::Segment(3);\n $allowance = $this->db2->table('hr_allowances')->select('id', 'fkcoa_id', 'allowance', 'default_amount')->where('id', $id)->first();\n $postData = Input::all();\n if (!empty($postData)) {\n $name = trim(Input::get('allowance'));\n $defamount = str_replace(\",\", \"\", trim(Input::get('default_amount')));\n $default_amount = trim(str_replace('$', '', $defamount));\n if ($default_amount != 0) {\n $allowance_type = 1;\n } else {\n $allowance_type = 2;\n }\n // /$coa = Input::get('coa_id');\n $currentDate = date('Y-m-d H:i:s', strtotime('now'));\n $checkStatus = 0;\n $allowance = $this->db2->table('hr_allowances')->select('id', 'fkcoa_id', 'allowance', 'default_amount')->where('id', '!=', $id)->where('allowance', '=', $name)->first();\n //$checkStatus = $this->db2->select($this->db2->raw('select count(id) as count from il_accounting_coa_level4 where id!='.$coa.' AND level4_name=\"'.$name.'\"'));\n if (!$allowance) {\n //$updateCoa = $this->db2->table('il_accounting_coa_level4')->where('id',$coa)->update(array('level4_name' => $name,'date_modified' => $currentDate));\n $update = $this->db2->table('hr_allowances')->where('id', $id)->update(array('allowance' => $name, 'default_amount' => $default_amount, 'allowance_type' => $allowance_type, 'date_modified' => $currentDate));\n if ($update)\n return Redirect::to('config/allowance')->with(array('successalert' => 'Allowance updated Successfully'));\n else\n return Redirect::to('config/allowance')->with(array('erroralert' => 'Server problem Try again'));\n } else {\n return Redirect::to('config/edit-allowance/' . $id)->with(array('erroralert' => 'Allowance name already exists'));\n }\n }\n return View::make('settings/allowance.editAllowance')->with(array('view' => $allowance, 'id' => $id));\n }", "function vistaportal_malpractice_insurance_form($form, &$form_state){\n\t$form = array();\n\t//liability carrier history\n\t$form['liability']['desc_1'] = '<p>Application for Malpractice Insurance Coverage\n\t\tPart I<br />Professional Liability Carrier History<br />\n\t\tHCP MUST CONDUCT CLAIMS-HISTORY VERIFICATIONS FROM ALL PROFESSIONAL LIABILITY CARRIERS<br />\n\t\tList ALL carriers for the last five (5) years if you are seeking locum tenens opportunities \n\t\tin commercial facilities<br />If you are seeking locum tenens work in government facilities, \n\t\tcarrier history covering ten (10) years is to be added on the “Application Addendum”<br />\n\t\t(You may submit copies of policy declaration pages for each carrier covering all periods \n\t\tof time)<br /></p>';\n\t$ins_fields['company_name'] = textfield('Company Name');\n\t$ins_fields['policy_num'] = textfield('Policy Number');\n\t$ins_fields['limits'] = textfield('Limits of Liability');\t\n\t$ins_fields['covered_from'] = date_popup('Covered From');\n\t$ins_fields['covered_to'] = date_popup('Covered To');\n\t$ins_fields['claims'] = textfield('Claims-Made Policy?');\n\t$ins_fields['retro'] = date_popup('Retro Exclusion Date for Prior Acts');\n\t$form['liability']['carrier'] = '<p>IF YOUR COVERAGE WAS/IS THROUGH AN EMPLOYER’S OR LOCUM \n\t\tTENENS ORGANIZATION’S CARRIER, BUT YOU DO NOT KNOW THE CARRIER INFORMATION, LIST EMPLOYER \n\t\tOR LOCUM TENENS COMPANY NAME AND THE PERIODS YOU WERE/ARE COVERED.</p>';\n\t$coverage_fields['name'] = textfield('Employer or Company Name');\n\t$coverage_fields['date'] = date_popup('Dates you were covered');\t\n\t$form['liability'][0]['ins_counter']['#type'] = \"hidden\";\n\t$form['liability'][0]['ins_counter']['#default_value'] = -1;\n\t$form['liability'][0]['add_ins'] = vistaportal_set($ins_fields, \n\t\t'Add another carrier', 'Remove another carrier', 3);\n\t$form['liability'][0]['coverage_counter']['#type'] = \"hidden\";\n\t$form['liability'][0]['coverage_counter']['#default_value'] = -1;\n\t$form['liability'][0]['add_cov'] = vistaportal_set($coverage_fields, \n\t\t'Add another employer', 'Remove another employer', 3);\n\t$form['liability'][0]['history'] = radios_yesno('Have there ever been, or are there currently pending\n\t\tany malpractice claims, suits, settlements or arbitration proceedings involving your \n\t\tprofessional practice? If “yes”, complete a Supplemental Claim History for each claim or suit.\n\t\t(If you have history of more than three claims or suits you may print additional Supplemental \n\t\tClaim History forms to complete.)');\n\t$form['liability'][0]['suit'] = radios_yesno('Are you aware of any acts, errors, omissions or \n\tcircumstances which may result in a malpractice claim or suit being made or brought against you?\n\tIf “yes”, complete a Supplemental Claim History sheet for each occurrence.');\t\n\t\n\t$form['liability'][0]['application_terms'] = terms_1($terms_desc); //@TODO\n\t$form['liability'][0]['application_terms']['#attributes']['class'] .= \n\t\t'edit-liability-application-terms required';\n\t$form['liability'][0]['application_terms']['#title'] = 'I Accept Terms';\n\t$form['liability'][0]['application_terms']['#rules'] = array( \n\t\tarray('rule' => 'chars[1]', 'error' => 'You must accept the Terms to continue.'));\n\t\n\t$form['liability']['desc_2'] = '<p>Application for Malpractice Insurance Coverage\n\t\tPart II<br />Supplemental Claims History<br />Please provide the following regarding \n\t\tany incident, claim, or suit or incident which may give rise to a claim whether dismissed,\n\t\tsettled out of court, judgment or pending. Answer all questions completely.This form should \n\t\tbe photocopied for use with each claim. Please type or print clearly.<br /></p>';\n\t\t\n\t$form['liability'][1]['defendant'] = textfield(\"Defendant's Name\");\n\t$form['liability'][1]['plaintiff'] = textfield(\"Claimant (Plaintiff’s) ID:\");\n\t$form['liability'][1]['location'] = textfield(\"Where did incident/alleged error occur?\");\n\t$form['liability'][1]['filed'] = checkbox('Claim Filed');\n\t$form['liability'][1]['reported'] = checkbox('Incident that has been reported to insurer');\n\t$form['liability'][1]['suit'] = textfield('If Suit Filed, County/State where case filed:');\n\t$form['liability'][1]['suit']['case_num'] = textfield('Case Number');\n\t$form['liability'][1]['attorney'] = textfield('Defendant Attorney Name/Address/Phone:');\t\n\t$form['liability'][1]['judgement'] = '<p>Please upload copies of final judgment, \n\t\tsettlement & release or other final disposition.<p>';\n\t$form['liability'][1]['status'] = fieldset('STATUS OF COMPLAINT');\n\t$form['liability'][1]['if_closed'] = checkboxes('If CLOSED:', array(\n\t\t'Court Judgement', 'Finding For You', 'Finding For Plaintiff', 'Determined By Judge',\n\t\t'Determined By Jury', 'Out OF Court Settlement', 'Case Dismissed', 'Against You',\n\t\t'Against All Defendants'));\n\t$form['liability'][1]['defendant_amount'] = textfield('Amount paid on your behalf:');\n\t$form['liability'][1]['total_amount'] = textfield('Total Settlement against all parties:');\n\t$form['liability'][1]['date_closed'] = date_popup('Date of closure, settlement, or dismissal');\n\t$form['liability'][1]['if_open'] = radios_yesno('Claim in suit');\n\t$form['liability'][1]['description'] = '<p><u>DESCRIPTION OF CLAIM</u> Provide enough information \n\t\tto allow evaluation:</p>';\n\t$form['liability'][1]['description']['error'] = textfield('Alleged act, error or omission \n\t\tupon which Claimant bases claim:');\n\t$form['liability'][1]['description']['extent'] = textfield('Description of type and \n\t\textent of injury or damage allegedly sustained:');\n\t$form['liability'][1]['description']['condition_start'] = textfield('Patient’s Condition \n\t\tat point of your involvement:');\n\t$form['liability'][1]['description']['condition_end'] = textfield('Patient’s Condition at \n\t\tend of your treatment?');\n\t$form['liability'][1]['description']['narration'] = textarea('Provide a narration of the case, \n\t\trelating events in chronological order emphasizing the dates of service and stating in \n\t\tdetail what was done each time the patient was seen professionally. You may use a separate \n\t\tsheet to complete, sign and date.');\n\t$form['liability'][1]['application_terms_supplemental'] = terms_1($terms_desc);//@TODO\n\t$form['liability'][1]['application_terms_supplemental']['#attributes']['class'] .= \n\t\t'edit-liability-application-terms_supplemental required';\n\t$form['liability'][1]['application_terms_supplemental']['#title'] = 'I Accept Terms';\n\t$form['liability'][1]['application_terms_supplemental']['#rules'] = array( \n\t\tarray('rule' => 'chars[1]', 'error' => 'You must accept the Terms to continue.'));\n\t\n\t$form['liability']['desc_3'] = '<p>Please provide the following regarding any incident, \n\t\tclaim, or suit or incident which may give rise to a claim whether dismissed, settled \n\t\tout of court, judgment or pending. Answer all questions completely. This form should \n\t\tbe photocopied for use with each claim. Please type or print clearly.</p>';\n\t$form['liability'][2]['defendant_name'] = textfield(\"Defendant's Name\");\n\t$form['liability'][2]['plaintiff_id'] = textfield('Claimant (Plaintiff’s) ID:');\n\t$form['liability'][2]['error_date'] = date_popup('Date of alleged error:');\n\t$form['liability'][2]['location'] = textfield('Where did incident/alleged error occur?');\n\t$form['liability'][2]['filed'] = checkbox('Claim Filed');\n\t$form['liability'][2]['reported'] = checkbox('Incident that has been reported to insurer');\n\t$form['liability'][2]['company_name'] = textfield('Name of Insurer');\n\t$form['liability'][2]['suit'] = textfield('If Suit Filed, County/State where case filed:');\n\t$form['liability'][2]['suit']['case_num'] = textfield('Case Number');\n\t$form['liability'][2]['attorney'] = textfield('Defendant Attorney Name/Address/Phone:');\n\t$form['liability'][2]['judgement'] = '<p>Please upload copies of final judgment, \n\t\tsettlement & release or other final disposition.<p>';\n\t$form['liability'][2]['status'] = fieldset('STATUS OF COMPLAINT');\t\n\t$form['liability'][2]['if_closed'] = checkboxes('If CLOSED:', array(\n\t\t'Court Judgement', 'Finding For You', 'Finding For Plaintiff', 'Determined By Judge',\n\t\t'Determined By Jury', 'Out OF Court Settlement', 'Case Dismissed', 'Against You',\n\t\t'Against All Defendants'));\n\t$form['liability'][2]['if_open'] = radios_yesno('Claim in suit');\n\t$form['liability'][2]['description'] = '<p><u>DESCRIPTION OF CLAIM</u> Provide enough information \n\t\tto allow evaluation:</p>';\n\t$form['liability'][2]['description']['error'] = textfield('Alleged act, error or omission \n\t\tupon which Claimant bases claim:');\n\t$form['liability'][2]['description']['extent'] = textfield('Description of type and \n\t\textent of injury or damage allegedly sustained:');\n\t$form['liability'][2]['description']['condition_start'] = textfield('Patient’s Condition \n\t\tat point of your involvement:');\n\t$form['liability'][2]['description']['condition_end'] = textfield('Patient’s Condition at \n\t\tend of your treatment?');\n\t$form['liability'][2]['description']['narration'] = textarea('Provide a narration of the case, \n\t\trelating events in chronological order emphasizing the dates of service and stating in \n\t\tdetail what was done each time the patient was seen professionally. You may use a separate \n\t\tsheet to complete, sign and date.');\n\t$form['liability'][2]['application_terms_supplemental'] = terms_1($terms_desc);//@TODO\n\t$form['liability'][2]['application_terms_supplemental']['#attributes']['class'] .= \n\t\t'edit-liability-application-terms_supplemental required';\n\t$form['liability'][2]['application_terms_supplemental']['#title'] = 'I Accept Terms';\n\t$form['liability'][2]['application_terms_supplemental']['#rules'] = array( \n\t\tarray('rule' => 'chars[1]', 'error' => 'You must accept the Terms to continue.'));\t\n\t\t\t\t\t\t\t\t\t\nreturn $form;\n\t\n}", "public function update(Request $request, Allowance $allowance)\n {\n //\n }", "public function update(Request $request, Allowance $allowance)\n {\n //\n }", "private function approve() {\n\n }", "public function authorize()\n {\n return true; // todos pueden usar este form...\n }", "public function getAllow() {\r\n\t\treturn $this -> allow;\r\n\t}", "public function getExplicitlyAllowAndDeny() {}", "public function userwise_payspec(){\n\t\t//restricted this area, only for admin\n\t\tpermittedArea();\n\t\t\t\t\n\t\t$data['userDebit'] = $this->ledger_model->userDebit();\n\t\t$data['userCredit'] = $this->ledger_model->userCredit();\n\t\t\n\t\t\t\n\t\t\n\t\ttheme('userwise_payspec',$data);\n\t}", "public function authorize()\n {\n return true;\n // return Gate::allows('create-article'); //via form request\n }", "public function getAllow() {\r\n return $this->allow;\r\n }", "public function authorize()\n {\n return true; // I do not know how to create authorisation for the back-end and the time constraints of the project did not allow me to get to this stage either. It is something I would like to learn to do in the future however.\n }", "function mark_as_awarded()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\tif(!empty($data['list'])) $result = $this->_bid->mark_as_awarded(explode('--',$data['list']));\n\t\t\n\t\t$data['msg'] = !empty($result['boolean']) && $result['boolean']? 'The selected bids have been marked as awarded.': 'ERROR: The selected bids could not be awarded.';\n\t\tif(!empty($result['not_awarded'])) {\n\t\t\t$data['msg'] .= \"<BR><BR>The following bids do not qualify to be awarded: \";\n\t\t\tforeach($result['not_awarded'] AS $row){\n\t\t\t\t$data['msg'] .= \"<BR>\".$row['provider'].\" (\".$row['bid_currency'].format_number($row['bid_amount'],3).\")\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t$data['area'] = 'refresh_list_msg';\n\t\t$this->load->view('addons/basic_addons', $data);\n\t}", "function approve(){\n\t\t$points= $this->ref('currently_requested_to_id')->get('points_available');\n\t\tif($points < 3000)\n\t\t\t$this->api->js()->univ()->errorMessage(\"Not suficcient points available, [ $points ]\")->execute();\n\t\t// Send point to the requester and less from your self ... \n\n\t\t$purchaser= $this->add('Model_MemberAll')->addCondition(\"id\",$this['request_from_id'])->tryLoadAny();\n\t\t$purchaser['points_available'] = $purchaser['points_available'] + 3000;\n\t\t$purchaser->save();\n\n\t\t$seller=$this->add('Model_MemberAll')->addCondition(\"id\",$this['currently_requested_to_id'])->tryLoadAny();\n\t\t$seller['points_available'] = $seller['points_available'] - 3000;\n\t\t$seller->save();\n\n\t\tif($this->api->auth->model->id == 1)\n\t\t\t$this['status']='Approved By Admin';\n\t\telse\n\t\t\t$this['status']='Approved';\n\n\t\t$this->save();\n\n\n\t}", "function wac_allowed_bids(){\n\t$allowed = wac_setting_field('allowed_bids');\n\treturn (empty($allowed) || $allowed <= 0)? 0 : $allowed;\n}", "protected function allow() {\n\t\t\n\t\treturn true;\n\t}", "function urlDeclined()\r\n\t{\r\n\t\t$input_def['id'] = 'urlDeclined';\r\n\t\t$input_def['name'] = 'urlDeclined';\r\n\t\t$input_def['type'] = 'text';\r\n\t\t$inputValue = '';\r\n\t\tif(isset($_POST[$input_def['name']]) && (wpklikandpay_option::getStoreConfigOption('wpklikandpay_store_urloption', $input_def['name']) == ''))\r\n\t\t{\r\n\t\t\t$inputValue = wpklikandpay_tools::varSanitizer($_POST[$input_def['name']], '');\r\n\t\t}\r\n\t\telseif(wpklikandpay_option::getStoreConfigOption('wpklikandpay_store_urloption', $input_def['name']) != '')\r\n\t\t{\r\n\t\t\t$inputValue = wpklikandpay_option::getStoreConfigOption('wpklikandpay_store_urloption', $input_def['name']);\r\n\t\t}\r\n\t\t$input_def['value'] = $inputValue;\r\n\r\n\t\techo wpklikandpay_form::check_input_type($input_def);\r\n\t}", "public function saveAllowance($request, $action, $allowance, $timestamp)\n {\n return false;\n }", "public function form()\n {\n $this->number('month', '贷款月数')\n ->min(1)\n ->max(360)\n ->required();\n $this->number('total', '贷款总额')\n ->required();\n $this->rate('rate', '贷款利率')\n ->required();\n $this->radio('type', '还款方式')\n ->options(Loan::$typeMap)\n ->required();\n\n $this->html('等额本金法与等额本息法并没有很大的优劣之分,大部分是根据每个人的现状和需求而定的。');\n $this->html('<a target=\"_blank\" href=\"https://zhuanlan.zhihu.com/p/61140535\">等额本息和等额本金的区别!</a>');\n }", "function accountwithdrawal()\n\t\t\t{\n\t\t\t\techo\"<h3>You are withdrawing from main account</h3>\";\n\t\t\t\techo\"<br/><hr/>\";\n\t\t\t\techo\"<form action='industrynemurabinik' method='post' style=''>\";\n\t\t\t\techo\"Given to:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='text' name='nameofperson' placeholder='enter name of person assigned' size='32' required='required'/><br/><br/>\";\n\t\t\t\techo\"enter amount<input type='text' name='amount' placeholder='enter amount to withdraw' size='32' required='required'/><br/><br/>\";\n\t\t\t\t\n\t\t\t\t$vote=mysqli_query($con,\"select * from voteheads where termit='one'\");\n\t\t\t\techo\"amount use: <select name='votehead' style='width:39%;'>\";\n\t\t\t\twhile($head=mysqli_fetch_array($vote))\n\t\t\t\t{\n\t\t\t\t\techo\"<option>\".$head['name'].\"</option>\";\n\t\t\t\t}\n\t\t\t\techo\"<option>other</option>\";\n\t\t\t\techo\"</select><br/><br/>\";\n\t\t\t\techo\"<input type='submit' value='withdraw cash'/>\";\n\t\t\t\techo\"</form>\";\n\t\t\t\t//end of making payments\n\t\t\t}", "public function rolewise_payspec(){\n\t\t//restricted this area, only for admin\n\t\tpermittedArea();\n\t\t\t\t\n\t\t$data['roleDebit'] = $this->ledger_model->roleDebit();\n\t\t$data['roleCredit'] = $this->ledger_model->roleCredit();\n\t\t\n\t\t\n\t\t\n\t\ttheme('rolewise_payspec',$data);\n\t}", "public function rules()\n {\n return [\n 'name' => 'required',\n 'reward' => 'required|integer|max:' . auth()->user()->bag->coins,\n 'content' => 'required',\n 'voting_date' => 'required|date|after:today',\n ];\n }", "function can_process() {\t\n\n\tif ($_POST['expd_percentage_amt'] == \"\"){\n\t\tdisplay_error(trans(\"You need to provide the maximum monthly pay limit percentage for employee loan.\"));\n\t\tset_focus('expd_percentage_amt');\n\t\treturn false;\n\t} \n\tif (!check_num('expd_percentage_amt'))\t{\n\t\tdisplay_error(trans(\"Maximum EMI Limit should be a positive number\"));\n\t\tset_focus('login_tout');\n\t\treturn false;\n\t}\n\tif (!check_num('ot_factor'))\t{\n\t\tdisplay_error(trans(\"OT Multiplication Factor should be a positive number\"));\n\t\tset_focus('ot_factor');\n\t\treturn false;\n\t}\n\tif($_POST['monthly_choice'] == 1 && ( $_POST['BeginDay'] != 1 || $_POST['EndDay'] != 31 )) {\n\t\tdisplay_error(trans(\"For Current Month the Begin Date should be 1 and end date should be 31.\"));\n\t\tset_focus('BeginDay');\n\t\tset_focus('EndDay');\n\t\treturn false;\n\t}\n\t\t\n\tif (strlen($_POST['salary_account']) > 0 || strlen($_POST['paid_from_account']) > 0) {\n\t\tif (strlen($_POST['salary_account']) == 0 && strlen($_POST['paid_from_account']) > 0) {\n\t\t\tdisplay_error(trans(\"The Net Pay Debit Code cannot be empty.\"));\n\t\t\tset_focus('salary_account');\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (strlen($_POST['salary_account']) > 0 && strlen($_POST['paid_from_account']) == 0 ) {\n\t\t\tdisplay_error(trans(\"The Net Pay Credit Code cannot be empty.\"));\n\t\t\tset_focus('paid_from_account');\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\tif (strlen($_POST['travel_debit']) > 0 || strlen($_POST['travel_credit']) > 0) {\n\t\tif (strlen($_POST['travel_debit']) == 0 && strlen($_POST['travel_credit']) > 0) {\n\t\t\tdisplay_error(trans(\"The Travel Debit Code cannot be empty.\"));\n\t\t\tset_focus('travel_debit');\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (strlen($_POST['travel_debit']) > 0 && strlen($_POST['travel_credit']) == 0 ) {\n\t\t\tdisplay_error(trans(\"The Travel Credit Code cannot be empty.\"));\n\t\t\tset_focus('travel_credit');\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\tif (strlen($_POST['petrol_debit']) > 0 || strlen($_POST['petrol_credit']) > 0) {\n\t\tif (strlen($_POST['petrol_debit']) == 0 && strlen($_POST['petrol_credit']) > 0) {\n\t\t\tdisplay_error(trans(\"The Petrol Debit Code cannot be empty.\"));\n\t\t\tset_focus('petrol_debit');\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (strlen($_POST['petrol_debit']) > 0 && strlen($_POST['petrol_credit']) == 0 ) {\n\t\t\tdisplay_error(trans(\"The Petrol Credit Code cannot be empty.\"));\n\t\t\tset_focus('petrol_credit');\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\tif (strlen($_POST['debit_encashment']) > 0 || strlen($_POST['credit_encashment']) > 0) {\n\t\tif (strlen($_POST['debit_encashment']) == 0 && strlen($_POST['credit_encashment']) > 0) {\n\t\t\tdisplay_error(trans(\"The Encashment Debit Code cannot be empty.\"));\n\t\t\tset_focus('debit_encashment');\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (strlen($_POST['debit_encashment']) > 0 && strlen($_POST['credit_encashment']) == 0 ) {\n\t\t\tdisplay_error(trans(\"The Encashment Credit Code cannot be empty.\"));\n\t\t\tset_focus('credit_encashment');\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\treturn true;\t\n}", "protected function _isAllowed()\n {\n \treturn true;\n }", "function show_form( $atts=null, $form=true ) {\n global $wpdb, $isPolitical, $currencySymbol, $eligibility;\n \n $check_security = $this->check_security();\n \n if($check_security!==true) {\n return false;\n exit();\n }\n \n extract( shortcode_atts( array(\n 'amounts' => null,\n 'amount_as_input' => null,\n 'source' => null,\n 'thanks_url' => null,\n 'custom_amt_off' => 'false',\n 'button' => 'Submit',\n 'default_state' => null\n ), $atts ) );\n if(isset($_GET['amounts']) && !empty($_GET['amounts'])) {\n $amounts = $_GET['amounts'];\n }\n \n if(isset($_GET['source'])) {\n $source = $_GET['source'];\n } else if(isset($_GET['refcode'])) {\n $source = $_GET['refcode'];\n }\n \n if($amounts) {\n $amounts = explode(',', $amounts);\n $this->custom_amt_options = array();\n \n foreach($amounts as $amount) {\n $ths_amt = round($amount, 0);\n $ths_amt = (string) $ths_amt;\n $this->custom_amt_options[$ths_amt*100] = '$'.$ths_amt;\n }\n $this->custom_amt_options['custom'] = '<label for=\"custom_dollar_amt\">Other:</label> $<input type=\"text\" %s class=\"amount custom_dollar_amt\" /> <small>('.strtoupper($currencySymbol).')</small>';\n }\n \n $form_fields = '';\n // Loop through and generate the elements\n \n if(isset($source) && !empty($source)) {\n $form_fields .= '<input type=\"hidden\" name=\"Source\" value=\"'.$source.'\" />';\n }\n \n if(isset($this->config_errors) && !empty($this->config_errors)) {\n $form_fields .= $this->config_errors;\n }\n foreach($this->fieldsets as $fieldset_name => $fields) {\n if($isPolitical!=='true' && $fieldset_name=='Employment') {\n continue;\n } else {\n if(isset($thanks_url)) {\n $form_fields .= '<input type=\"hidden\" value=\"'.$thanks_url.'\" id=\"thanks_url\" />';\n }\n $form_fields .= '<fieldset><legend>'.$fieldset_name.'</legend>';\n if(isset($fields['html_intro'])) {\n $form_fields .= $fields['html_intro'];\n unset($fields['html_intro']);\n }\n foreach($fields as $field_key => $field) {\n if(!isset($field['type'])) {\n var_dump($field);\n }\n switch($field['type']) {\n case 'text':\n if(!isset($field['show_pre_div']) || $field['show_pre_div']=='true') {\n $form_fields .= '\n <div class=\"input';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= ' error';\n }\n $form_fields .= '\">';\n }\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= '<div class=\"errMsg\">This field cannot be left blank.</div>';\n }\n if(isset($field['slug'])) {\n if(!isset($field['show_label']) || $field['show_label']!='false') {\n $form_fields .= '\n <label for=\"'.$field['slug'].'\">'.$field['label'];\n if($field['required']=='true') { $form_fields .= ' <span class=\"required\">*</span>'; }\n $form_fields .= '</label>';\n }\n $form_fields .= '<input type=\"text\" ';\n $form_fields .= 'name=\"'.$field['slug'].'\" id=\"'.$field['slug'].'\" value=\"';\n if(isset($_POST[$field['slug']])) {\n $form_fields .= $_POST[$field['slug']];\n }\n $form_fields .= '\"';\n } else {\n if(!isset($field['show_label']) || $field['show_label']!='false') {\n $form_fields .= '\n <label for=\"'.$field['id'].'\">'.$field['label'];\n if($field['required']=='true') { $form_fields .= ' <span class=\"required\">*</span>'; }\n $form_fields .= '</label>';\n }\n $form_fields .= '<input type=\"text\" ';\n $form_fields .= ' id=\"'.$field['id'].'\" value=\"\"';\n }\n if(!empty($field['label']) && (!isset($field['show_placeholder']) || $field['show_placeholder']=='true')) {\n $form_fields .= ' placeholder=\"'.$field['label'].'\"';\n }\n $form_fields .= ' />';\n if(!isset($field['show_post_div']) || $field['show_post_div']=='true') {\n $form_fields .= '</div>';\n }\n break;\n case 'file':\n $file = true;\n $form_fields .= '\n <div class=\"file';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= ' error';\n }\n $form_fields .= '\">';\n if(isset($field['error']) && $field['error']===true && $field['required']=='true') {\n $form_fields .= '<div class=\"errMsg\">You must provide a '.$field['label'].'.</div>';\n } else if(isset($field['error']) && $field['error']===true) {\n $form_fields .= '<div class=\"errMsg\">There was a problem uploading your file.</div>';\n }\n \n $form_fields .= '\n <label for=\"'.$field['slug'].'\">'.$field['label'];\n if($field['required']=='true') { $form_fields .= ' <span class=\"required\">*</span>'; }\n $form_fields .= '</label>\n <input type=\"file\" name=\"'.$field['slug'].'\" id=\"'.$field['slug'].'\" />\n </div>\n ';\n break;\n case 'hidden':\n $form_fields .= '<input type=\"hidden\" name=\"'.$field['slug'].'\" id=\"'.$field['slug'].'\" value=\"';\n if(isset($_POST[$field['slug']])) {\n $form_fields .= $_POST[$field['slug']];\n } else if(isset($field['value'])) {\n $form_fields .= $field['value'];\n }\n $form_fields .= '\" />';\n break;\n case 'password':\n $form_fields .= '\n <div class=\"password ';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= ' error';\n }\n $form_fields .= '\">';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= '<div class=\"errMsg\">This field cannot be left blank.</div>';\n }\n $form_fields .= '\n <label for=\"'.$field['slug'].'\">'.$field['label'];\n if($field['required']=='true') { $form_fields .= ' <span class=\"required\">*</span>'; }\n $form_fields .= '</label>\n <input type=\"password\" name=\"'.$field['slug'].'\" id=\"'.$field['slug'].'\" value=\"';\n if(isset($_POST[$field['slug']])) {\n $form_fields .= $_POST[$field['slug']];\n }\n $form_fields .= '\"/>\n </div>\n ';\n break;\n case 'textarea':\n $form_fields .= '\n <div class=\"textarea';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= ' error';\n }\n $form_fields .= '\">';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= '<div class=\"errMsg\">This field cannot be left blank.</div>';\n }\n $form_fields .= '\n <label for=\"'.$field['slug'].'\">'.$field['label'];\n if($field['required']=='true') { $form_fields .= ' <span class=\"required\">*</span>'; }\n $form_fields .= '</label>\n <textarea name=\"'.$field['slug'].'\" id=\"'.$field['slug'].'\">';\n if(isset($_POST[$field['slug']])) {\n $form_fields .= $_POST[$field['slug']];\n }\n $form_fields .= '</textarea>\n </div>\n ';\n break;\n case 'checkbox':\n if(isset($field['options']) && !empty($field['options'])) {\n $form_fields .= '<fieldset id=\"ngp_'.$field['slug'].'\" class=\"checkboxgroup';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= ' error\">\n <div class=\"errMsg\">You must check at least one.</div>';\n } else {\n $form_fields .= '\">';\n }\n $form_fields .= '<legend>'.$field['label'];\n if($field['required']=='true') $form_fields .= '<span class=\"required\">*</span>';\n $form_fields .= '</legend>';\n $i = 0;\n foreach($field['options'] as $val) {\n $i++;\n $form_fields .= '<div class=\"checkboxoption\"><input type=\"checkbox\" value=\"'.$val.'\" name=\"'.$field['slug'].'['.$i.']['.$val.']\" id=\"option_'.$i.'_'.$field['slug'].'\" class=\"'.$field['slug'].'\" /> <label for=\"option_'.$i.'_'.$field['slug'].'\">'.$val.'</label></div>'.\"\\r\\n\";\n }\n $form_fields .= '</fieldset>';\n } else {\n $form_fields .= '<div id=\"ngp_'.$field['slug'].'\" class=\"checkbox\">';\n $form_fields .= '<div class=\"checkboxoption\"><input type=\"checkbox\" name=\"'.$field['slug'].'\" id=\"'.$field['slug'].'\" class=\"'.$field['slug'].'\" /> <label for=\"'.$field['slug'].'\">'.$field['label'].'</label></div>'.\"\\r\\n\";\n $form_fields .= '</div>';\n }\n break;\n case 'radio':\n if(isset($field['slug'])) {\n $form_fields .= '\n <fieldset id=\"radiogroup_'.$field['slug'].'\" class=\"radiogroup';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= ' error';\n }\n } else {\n $form_fields .= '\n <fieldset id=\"radiogroup_'.$field['id'].'\" class=\"radiogroup';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= ' error';\n }\n }\n $form_fields .= '\"><legend>'.$field['label'];\n if($field['required']=='true') { $form_fields .= '<span class=\"required\">*</span>'; }\n $form_fields .= '</legend>';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= '<div class=\"errMsg\">You must select an option.</div>';\n }\n $i = 0;\n if($field['label']=='Amount' && isset($this->custom_amt_options)) {\n $the_options = $this->custom_amt_options;\n } else {\n $the_options = $field['options'];\n }\n \n if(isset($_GET['amt']) && empty($_POST)) {\n if(strpos($_GET['amt'], '.')===false) {\n $get_amt = $_GET['amt'];\n } else {\n $get_amt = $_GET['amt'];\n }\n \n if(array_key_exists($get_amt, $the_options)) {\n $amt = $get_amt;\n } else {\n $custom_amt = $_GET['amt'];\n }\n } else if(isset($_POST['custom_dollar_amt'])) {\n $custom_amt = $_POST['custom_dollar_amt'];\n } else if(isset($field['slug']) && isset($_POST[$field['slug']])) {\n $amt = $_POST[$field['slug']];\n }\n \n foreach($the_options as $val => $labe) {\n $i++;\n if($val=='custom' && $custom_amt_off=='false') {\n $replace = (isset($custom_amt)) ? 'value=\"'.$custom_amt.'\"' : '';\n $form_fields .= '<div class=\"radio custom-donation-amt\">'.sprintf($labe, $replace).'</div>'.\"\\r\\n\";\n } else {\n $form_fields .= '<div class=\"radio\"><input type=\"radio\" value=\"'.$val.'\"';\n if(isset($field['slug'])) {\n $form_fields .= ' name=\"'.$field['slug'].'\"';\n $form_fields .= ' id=\"'.$i.'_'.$field['slug'].'\" class=\"amount '.$field['slug'].'\"';\n } else {\n $form_fields .= ' id=\"'.$i.'_'.$field['id'].'\" class=\"amount '.$field['id'].'\"';\n }\n if(isset($amt) && $amt==$val) {\n $form_fields .= ' checked';\n }\n $form_fields .= '> <label for=\"'.$i.'_';\n if(isset($field['slug'])) {\n $form_fields .= $field['slug'];\n } else {\n $form_fields .= $field['id'];\n }\n $form_fields .= '\">'.$labe.'</label></div>'.\"\\r\\n\";\n }\n }\n $form_fields .= '</fieldset>';\n break;\n case 'select':\n if(!isset($field['show_pre_div']) || $field['show_pre_div']=='true') {\n $form_fields .= '\n <div class=\"input';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= ' error';\n }\n $form_fields .= '\">';\n }\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= '<div class=\"errMsg\">You must select an option.</div>';\n }\n if(isset($field['slug'])) {\n if(!isset($field['show_label']) || $field['show_label']!='false') {\n $form_fields .= '\n <label for=\"'.$field['slug'].'\">'.$field['label'];\n if($field['required']=='true') { $form_fields .= ' <span class=\"required\">*</span>'; }\n $form_fields .= '</label>';\n }\n $form_fields .= '<select name=\"'.$field['slug'].'\" id=\"'.$field['slug'].'\">'.\"\\r\\n\";\n } else {\n if(!isset($field['show_label']) || $field['show_label']!='false') {\n $form_fields .= '\n <label for=\"'.$field['id'].'\">'.$field['label'];\n if($field['required']=='true') { $form_fields .= ' <span class=\"required\">*</span>'; }\n $form_fields .= '</label>';\n }\n $form_fields .= '<select id=\"'.$field['id'].'\">'.\"\\r\\n\";\n }\n $field_ref = (isset($field['slug'])) ? $field['slug'] : $field['id'];\n if($field_ref!='State' && $field_ref!='cardExpiryMonth' && $field_ref!='cardExpiryYear') {\n $form_fields .= '\n <option>Select an option...</option>\n ';\n }\n foreach($field['options'] as $key => $val) {\n $form_fields .= '<option value=\"'.$key.'\"';\n if(isset($field['slug']) && isset($_POST[$field['slug']]) && $_POST[$field['slug']]==$key) {\n $form_fields .= ' selected=\"selected\"';\n } else if(!empty($default_state) && $default_state==$key) {\n $form_fields .= ' selected=\"selected\"';\n }\n $form_fields .= '>'.$val.'</option>'.\"\\r\\n\";\n }\n $form_fields .= '</select>';\n if(!isset($field['show_post_div']) || $field['show_post_div']=='true') {\n $form_fields .= '</div>';\n }\n break;\n case 'multiselect':\n $form_fields .= '\n <div class=\"multiselect ';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= ' error';\n }\n $form_fields .= '\">';\n if(isset($field['error']) && $field['error']===true) {\n $form_fields .= '<div class=\"errMsg\">This field cannot be left blank.</div>';\n }\n $form_fields .= '\n <label for=\"'.$field['slug'].'\">'.$field['label'];\n if($field['required']=='true') { $form_fields .= ' <span class=\"required\">*</span>'; }\n $form_fields .= '</label>\n <select multiple name=\"'.$field['slug'].'\" id=\"'.$field['slug'].'\">'.\"\\r\\n\";\n foreach($field['options'] as $key => $val) {\n $form_fields .= '<option value=\"'.$key.'\">'.$val.'</option>'.\"\\r\\n\";\n }\n $form_fields .= '\n </select>\n </div>\n ';\n break;\n }\n }\n $form_fields .= '</fieldset>';\n }\n }\n \n $return = '';\n \n if(!empty($form_fields)) {\n $return .= '<div id=\"stripe-msgs\" style=\"display:none;\"></div><form name=\"stripe_payment\" class=\"stripe_payment_submission\" id=\"stripe-payment-form\" action=\"'.$_SERVER['REQUEST_URI'].'\" method=\"post\">';\n \n // if(function_exists('wp_nonce_field')) {\n // $return .= wp_nonce_field('stripe_nonce_field', 'stripe_add', true, false);\n // }\n \n $return .= $form_fields;\n \n $return .= '<div class=\"submit\">\n <input type=\"submit\" value=\"'.$button.'\" />\n </div>\n <div class=\"stripe-payment-form-row-progress\">\n <span class=\"message\"></span>\n </div>';\n if($isPolitical==='true') {\n $return .= str_replace('{{button}}', $button, $eligibility);\n }\n // $return .= '<p class=\"addtl-donation-footer-info\">'.str_replace(\"\\r\\n\", '<br />', str_replace('&lt;i&gt;', '<i>', str_replace('&lt;/i&gt;', '</i>', str_replace('&lt;u&gt;', '<u>', str_replace('&lt;/u&gt;', '</u>', str_replace('&lt;b&gt;', '<b>', str_replace('&lt;/b&gt;', '</b>', get_option('stripe_payments_footer_info')))))))).'</p>';\n $return .= '</form>';\n \n return $return;\n }\n }", "function applies()\n\t{\n\t\t$applies=(get_param('page','')=='cms_quiz') && ((get_param('type')=='_ed') || (get_param('type')=='ad'));\n\t\treturn array($applies,NULL,false);\n\t}", "public function createAllowance(Paysera_WalletApi_Entity_Allowance $allowance)\n {\n $requestData = $this->mapper->encodeAllowance($allowance);\n $responseData = $this->post('allowance', $requestData);\n return $this->mapper->decodeAllowance($responseData);\n }", "function recommends_req_wizard_verification($form, &$form_state) {\n \n $output_info = array(\n 'prefix' => $form_state['prefix'],\n 'firstname' => $form_state['firstname'],\n 'lastname' => $form_state['lastname'],\n 'initial' => $form_state['initial'],\n 'suffix' => $form_state['suffix'],\n 's_email' => $form_state['s_email'],\n 's_school' => $form_state['s_school'],\n 's_req_date' => $form_state['s_req_date'],\n 's_master_doc' => $form_state['s_master_doc'],\n 's_comments' => $form_state['s_comments'],\n \t);\n \t\n \t $email_values = array(\n 'email' => $form_state['s_email'],\n 'message' => \"\\n\" . \"\\n\" .\n \"Name Prefix: \" . $output_info['prefix'] . \"\\n\" .\n \"First Name: \" . $output_info['firstname'] . \"\\n\" .\n \"Initial: \" . $output_info['initial'] . \"\\n\" .\n \"Last Name: \" . $output_info['lastname'] . \"\\n\" .\n \"Name Suffix: \" . $output_info['suffix'] . \"\\n\" .\n \"Student Email: \" . $output_info['s_email'] . \"\\n\" .\n \"Statement of intent, Point of view : \" . \"\\n\" . $output_info['s_comments'] . \"\\n\"\n );\n \n for ($i = 1; $i <= $form_state['num_schools']; $i++) {\n\t\t\n\t\t$output_schools[$i] = array(\n \t'r_email'=> $form_state['s_email'],\n \t'num_schools'=> $form_state['num_schools'],\n \t'r_school'=> $form_state['schoolname'][$i],\n \t'r_program'=> $form_state['schoolprogram'][$i],\n \t'r_program'=> $form_state['schoolprogram'][$i],\n \t 'r_school_contact_email' => $form_state['r_school_contact_email'][$i],\n \t 'r_school_contact_postal' => $form_state['r_school_contact_postal'][$i],\n \t'r_school_contact'=> $form_state['r_school_contact_postal'][$i],\n \t'r_date_due_month' => $form_state['r_date_due'][$i]['month'],\n 'r_date_due_day' => $form_state['r_date_due'][$i]['day'],\n 'r_date_due_year' => $form_state['r_date_due'][$i]['year'],\n \t'r_status'=> \"Initial\",\n\t\t\n \t);\n }\n $email_values['message'] = $email_values['message'] .\n \"\\n\" . \"Schools to receive recommendation.\" . \"\\n\\n\";\n \n $school_values = array(array());\n \n for ($i = 1; $i <= $output_schools[1]['num_schools']; $i++) {\t\n \t\n \t$email_values['message'] = $email_values['message'] . $output_schools[$i]['r_school'] . \"\\n\" .\n \t\"School Program/Position: \" .\n \t\n \t$output_schools[$i]['r_program'] . \"\\n\" .\n \t\"School contact postal: \" .\n \t$output_schools[$i]['r_school_contact_postal'] . \"\\n\" . \n \t\"School contact email: \" .\n \t$output_schools[$i]['r_school_contact_email'] . \"\\n\" . \t\n \t\"Final Date required by school: \" . \n \t$output_schools[$i]['r_date_due_month'] . \"/\" . \n \t$output_schools[$i]['r_date_due_day'] . \"/\" . \n \t$output_schools[$i]['r_date_due_year'] . \"\\n\\n\";\n \n };\n \n for ($i = 1; $i <= $form_state['num_courses']; $i++) {\n\t\t\n\t\t$pid = $form_state['input']['crsname'][$i]['i_pid'];\n\t\t\n\t\t$output_courses[$i] = array(\n \t'c_email' => $form_state['s_email'],\n \t'num_courses' => $form_state['num_courses'],\n \t'c_course' => $form_state['coursenum'][$i],\n \t'c_semester' => $form_state['coursesemester'][$i],\n \t'c_year' => $form_state['courseyear'][$i],\n \t'c_other' => $form_state['courseother'][$i],\n \t);\n \t\n }\n \n $email_values['message'] = $email_values['message'] .\n \"\\n\" . \"Courses in which enrolled with the professor.\" . \"\\n\";\n \n $course_values = array(array());\n \n for ($i = 1; $i <= $output_courses[1]['num_courses']; $i++) {\t\n \t\n \t$email_values['message'] = $email_values['message'] . \n \t\"\\n\" . \"Course: \" .\n \t\n \t$output_courses[$i]['c_course'] . \" \" .\n \t\"Semester: \" . \n \t$output_courses[$i]['c_semester'] .\n \t\" Year: \" . \n \t$output_courses[$i]['c_year'] . \"\\n\\n\" . $output_courses[$i]['c_other'] ;\n \n }; \n \n \n $msg = \"Please review the following information that you entered. Press Finish to send the information or cancel to abort the operation\";\n drupal_set_message('<pre id=rqmsgsize>' . print_r($msg, TRUE) . print_r($email_values['message'], TRUE) . '</pre>');\n \n // We will have many fields with the same name, so we need to be able to\n // access the form hierarchically.\n $form['#tree'] = TRUE;\n\n $form['description'] = array(\n '#type' => 'item',\n );\n\n if (empty($form_state['num_courses'])) {\n $form_state['num_courses'] = 1;\n }\n\n \n\n // Adds \"Add another course\" button\n $form['add_course'] = array(\n '#type' => 'submit',\n '#value' => t('Cancel'),\n '#submit' => array('recommends_req_intro'),\n );\n\n\n return $form;\n}", "protected function computeAllowed() {\n\t\tif($this->tees) {\n\t\t\t$this->exact_handicap = $this->player->handicap;\n\t\t\t$a = $this->player->allowed($this->tees);\n\t\t\t$this->handicap = array_sum($a); // playing handicap\n\t\t\t$this->save();\n\t\t\tif($this->hasDetails()) {\t\t\t\t\n\t\t\t\t$i = 0;\n\t\t\t\tforeach($this->getScoreWithHoles()->each() as $score) {\n\t\t\t\t\t$score->allowed = $a[$i++];\n\t\t\t\t\t$score->save();\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\n\t}", "public function authorize()\n {\n return Gate::allows('create', Borrowing::class);\n }", "public function authorize()\n {\n // return true;\n return access()->allow('store-monthly-meter-unit');\n }", "public function approveAndEarmark() {\n // Check if user has enough money available on card to pay for amount on authorization request.\n // Assumption: it's enough to check if the available balance is no greater than the amount that has been authorized.\n if ($this->card->availableBalance() > $this->authorizationRequest->getAuthorizedAmount()) {\n // Approve request.\n $this->authorizationRequest->approve();\n // Earmark the amount in the authorization request on the card.\n $this->card->earmark($this->authorizationRequest);\n } else {\n throw new Exception(\"User does not have enough money available on their card.\");\n }\n }", "public function getAllow(): string\n {\n return $this->allow;\n }", "function effect() {\n\t\t$request = $this->_request;\n\t\t$context = $request->getContext();\n\t\t$contextId = $context->getId();\n\t\t$user = $request->getUser();\n\t\tif (!is_a($user, 'User')) return AUTHORIZATION_DENY;\n\n\t\t$userId = $user->getId();\n\t\t$submission = $this->getAuthorizedContextObject(ASSOC_TYPE_SUBMISSION);\n\n\t\t$accessibleWorkflowStages = array();\n\t\t$workflowStages = Application::getApplicationStages();\n\t\tforeach ($workflowStages as $stageId) {\n\t\t\t$accessibleStageRoles = $this->_getAccessibleStageRoles($userId, $contextId, $submission, $stageId);\n\t\t\tif (!empty($accessibleStageRoles)) {\n\t\t\t\t$accessibleWorkflowStages[$stageId] = $accessibleStageRoles;\n\t\t\t}\n\t\t}\n\n\t\t$this->addAuthorizedContextObject(ASSOC_TYPE_ACCESSIBLE_WORKFLOW_STAGES, $accessibleWorkflowStages);\n\n\t\t// Does the user have a role which matches the requested workflow?\n\t\tif (!is_null($this->_workflowType)) {\n\t\t\t$workflowTypeRoles = Application::getWorkflowTypeRoles();\n\t\t\tforeach ($accessibleWorkflowStages as $stageId => $roles) {\n\t\t\t\tif (array_intersect($workflowTypeRoles[$this->_workflowType], $roles)) {\n\t\t\t\t\treturn AUTHORIZATION_PERMIT;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn AUTHORIZATION_DENY;\n\n\t\t// User has at least one role in any stage in any workflow\n\t\t} elseif (!empty($accessibleWorkflowStages)) {\n\t\t\treturn AUTHORIZATION_PERMIT;\n\t\t}\n\n\t\treturn AUTHORIZATION_DENY;\n\t}", "public static function Allow_optin() {\n\t\tupdate_option( 'xlp_is_opted', 'yes', false );\n\n\t\t//try to push data for once\n\t\t$data = self::collect_data();\n\n\t\t//posting data to api\n\t\tXL_API::post_tracking_data( $data );\n\t}", "public function askForFeeConfirmation()\n {\n }", "public function authorize()\n {\n return Gate::allows('admin.booking.edit', $this->booking);\n }", "function um_add_security_checks( $args ) {\r\n\tif ( is_admin() ) {\r\n\t\treturn;\r\n\t} ?>\r\n\r\n\t<input type=\"hidden\" name=\"timestamp\" class=\"um_timestamp\" value=\"<?php echo current_time( 'timestamp' ) ?>\" />\r\n\r\n\t<p class=\"<?php echo UM()->honeypot; ?>_name\">\r\n\t\t<label for=\"<?php echo UM()->honeypot . '_' . $args['form_id']; ?>\"><?php _e( 'Only fill in if you are not human' ); ?></label>\r\n\t\t<input type=\"text\" name=\"<?php echo UM()->honeypot; ?>\" id=\"<?php echo UM()->honeypot . '_' . $args['form_id']; ?>\" class=\"input\" value=\"\" size=\"25\" autocomplete=\"off\" />\r\n\t</p>\r\n\r\n\t<?php\r\n}", "function sopac_multibranch_hold_request_validate($form, &$form_state) {\n global $user;\n //profile_load_profile($user);\n //profile_load_profile(&$user);\n\n if ($user->uid) {\n if ($user->bcode_verified) {\n return;\n }\n else {\n form_set_error(NULL, t('Verify your card to request this item'));\n }\n }\n else {\n form_set_error(NULL, t('Please login to request a hold.'));\n }\n drupal_goto($form_state['values']['destination']);\n}", "public function isAllow()\n {\n return $this->allow;\n }", "function showIneligible() {\n $output = $this->outputBoilerplate('ineligible.html');\n return $output;\n }", "public function getAllowCheck()\n {\n return $this->allow_check;\n }", "function show_deny() {\n\t\t\tshow_error(\n\t\t\t\t'403 Forbidden',\n\t\t\t\t'You do not have sufficient clearance to view this page.'\n\t\t\t);\n\t\t}", "function fb_authorize_action() {\n\n if (!empty($_POST) && wp_verify_nonce($_POST['afap_fb_authorize_nonce'], 'afap_fb_authorize_action')) {\n\n include('inc/cores/fb-authorization.php');\n\n } else {\n\n die('No script kiddies please');\n\n }\n\n }", "static function allowed()\n {\n\n }", "public function rules()\n {\n return [\n 'rewardable_type' => 'required|string|max:20',\n 'rewardable_id' => 'required|numeric',\n 'reward_type' => 'required|string|max:10',\n 'reward_value' => 'required|numeric|between:1,100',\n ];\n }", "public function authorize()\n {\n return true; //[ *1. default=false ]\n }", "function feature_license_regulatory_approval_add() {\n\n// feature_license_add_exclusions_form_validate(&$form_stats);\n\n feature_license_add_exclusions_form_submit();\n return drupal_get_form('feature_license_add_exclusions_form');\n}", "function manage_bonus_plans(){}", "public function authorize()\n\t{\n\t\t$expenses = $this->input('expense_ids');\n\t\tif($expenses != null && count($expenses) > 0) {\n\t\t\t$reportId = Expense::find($expenses[0])->report_id;\n\t\t\t$report = ExpenseReport::find($reportId);\n\t\t\tif($report->status) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "function afap_form_action() {\n\n if (!empty($_POST) && wp_verify_nonce($_POST['afap_form_nonce'], 'afap_form_action')) {\n\n include('inc/cores/save-settings.php');\n\n } else {\n\n die('No script kiddies please!!');\n\n }\n\n }", "public function action_allowed_fields() {\n return array();\n }", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('sales/mfb_myflyingbox/offer');\n }", "public function getFormProtection() {}", "function sample(){\n\t\t$price = 10;\n\t\t$tax = number_format($price * .095,2); // Set tax\n\t\t$amount = number_format($price + $tax,2); // Set total amount\n\n\n \t$this->authorizenet->setFields(\n\t\tarray(\n\t\t'amount' => '10.00',\n\t\t'card_num' => '370000000000002',\n\t\t'exp_date' => '04/17',\n\t\t'first_name' => 'James',\n\t\t'last_name' => 'Angub',\n\t\t'address' => '123 Main Street',\n\t\t'city' => 'Boston',\n\t\t'state' => 'MA',\n\t\t'country' => 'USA',\n\t\t'zip' => '02142',\n\t\t'email' => '[email protected]',\n\t\t'card_code' => '782',\n\t\t)\n\t\t);\n\t\t$response = $this->authorizenet->authorizeAndCapture();\n\n\t\t/*print_r($response);*/\n\n\t\tif ($response->approved) {\n\t\techo \"approved\";\n /*echo \"APPROVED\";*/\n\t\t} else {\n echo FALSE;\n\t\t/*echo \"DENIED \".AUTHORIZENET_API_LOGIN_ID.\" \".AUTHORIZENET_TRANSACTION_KEY;*/\n\t\t}\n\n }", "public function showInvestmentForm()\n\t{\n\t\t//get id of logged in user\n\t\ttry\n\t\t{\n\t\t\t//get user id from auth\n\t\t\t$userId = Auth::id();\n\t\t\t//get investment related data from trait,all count and sum\n\t\t\t$countInvData = $this->GetOwnerDetails($userId);\n\t\t\t//send data to view\n\t \treturn view('owner.add_investment',['countInvData'=>$countInvData]);\n\t\t}\n\t catch(Exception $e){\n\t\t \tabort(403, $e->getMessage());\n\t\t}\n\t}", "public function authorize()\n {\n return true; //CUANDO GENERAMOS UN request TENEMOS QUE ESPECIFICAR QUE ESTA AUTORIZADFO PONIENDO TRUE\n }", "public function approve_advertiser(Request $request)\n {\n\n }", "public function postKeyloanTerm(Request $request)\n {\n $input = Input::all();\n $loanId = isset($input['loanId']) ? $input['loanId'] : null;\n $loanType = isset($input['type']) ? $input['type'] : null;\n $amount = isset($input['loan_amount']) ? $input['loan_amount'] : null;\n $loanTenure = isset($input['loan_tenure']) ? $input['loan_tenure'] : null;\n $endUseList = isset($input['end_use']) ? $input['end_use'] : null;\n //if loan is selected\n $companySharePledged = isset($input['companySharePledged']) ? $input['companySharePledged'] : null;\n $bscNscCode = isset($input['bscNscCode']) ? $input['bscNscCode'] : null;\n //$id = $input['id'];\n $loan = null;\n $fieldsArr = [];\n $rulesArr = [];\n $messagesArr = [];\n $user = Auth::getUser();\n $userProfile = Auth::getUser()->userProfile();\n\n //$guarantors=$input['guarantors'];\n $fieldsArr['guarantors']=$input['guarantors'];\n $rulesArr['guarantors']='Required';\n $messagesArr['guarantors.required']=\"Guarantors is required\";\n\n $fieldsArr['amount']=$input['amount'];\n $rulesArr['amount']='Required|numeric';\n $messagesArr['amount.required']=\"Amount is required\"; \n\n $fieldsArr['purpose']=$input['purpose'];\n $rulesArr['purpose']='Required';\n $messagesArr['purpose.required']=\"Purpose is required\"; \n\n $fieldsArr['facility']=$input['facility'];\n $rulesArr['facility']='Required';\n $messagesArr['facility.required']=\"Facility is required\";\n\n $fieldsArr['tenor']=$input['tenor'];\n $rulesArr['tenor']='Required|numeric|max:120';\n $messagesArr['tenor.required']=\"Tenor is required\"; \n\n $fieldsArr['interest_rate']=$input['interest_rate'];\n $rulesArr['interest_rate']='Required|numeric|max:25';\n $messagesArr['interest_rate.required']=\"Interest is required\"; \n\n $fieldsArr['processing_fee']=$input['processing_fee'];\n $rulesArr['processing_fee']='Required|numeric';\n $messagesArr['processing_fee.required']=\"Processing Fees is required\"; \n\n $fieldsArr['legal_fee']=$input['legal_fee'];\n $rulesArr['legal_fee']='Required|numeric';\n $messagesArr['legal_fee.required']=\"Legal Fees is required\";\n\n\n\n $validator = Validator::make($fieldsArr, $rulesArr, $messagesArr);\n if ($validator->fails()) {\n return Redirect::back()->withErrors($validator)->withInput();\n } else {\n //$user = Auth::getUser();\n //$userProfile = Auth::getUser()->userProfile();\n $input['user_id'] = $user->id;\n if (isset($loanId)) {\n if (isset($loans)) {\n $salesAreaDetailId = $loans->id;\n } else {\n $salesAreaDetailId = null;\n }\n }\n\n $user = Auth::user();\n if (isset($user)) {\n $userID = $user->id;\n $userEmail = $user->email;\n }\n if (isset($userID)) {\n $mobileAppEmail = DB::table('mobile_app_data')->where('Email', $userEmail)\n ->where('status', 0)\n ->first();\n }\n }\n\n $loansStatus = LoansStatus::updateOrCreate(['loan_id' => $loanId], ['loan_id' => $loanId, 'sentApprovar' => 'Y']);\n $loansStatus = Loan::updateOrCreate(['id' => $loanId], ['id' => $loanId, 'status' => '22']);\n $loansStatus->save();\n \n $loan = PraposalKeyloanterms::updateOrCreate(['loan_id' => $loanId], [\n /* 'promoterBackground' => @$input['promoterBackground'],*/\n 'guarantors' => @$input['guarantors'],\n 'amount' => @$input['amount'],\n 'purpose'=> @$input['purpose'],\n 'borrower'=> @$input['borrower'],\n // 'businessDescription'=> @$input['businessDescription'], \n 'facility'=> @$input['facility'],\n 'tenor'=> @$input['tenor'], \n 'interest_rate'=> @$input['interest_rate'],\n 'processing_fee'=> @$input['processing_fee'], \n 'legal_fee'=> @$input['legal_fee'],\n 'repayment_schedule'=> @$input['repayment_schedule'], \n 'prepayment_penalty'=> @$input['prepayment_penalty'], \n 'security'=> @$input['security'], \n 'pre_disbursement_conditions'=> @$input['pre_disbursement_conditions'], \n 'fin_conv_debt_ebitda'=> @$input['fin_conv_debt_ebitda'], \n 'fin_conv_debt_equity_ratio'=> @$input['fin_conv_debt_equity_ratio'],\n 'fin_conv_current_ratio'=> @$input['fin_conv_current_ratio'], \n 'fin_conv_interest_cov_ratio'=> @$input['fin_conv_interest_cov_ratio'],\n 'fin_conv_other'=> @$input['fin_conv_other'], \n //'other_convenants_standerds_withaddiotion'=> @$input['other_convenants_standerds_withaddiotion'], \n 'other_convenants_standerds_withaddiotion'=> @$input['other_convenants_standerds_withaddiotion'], \n //'loan_purpose'=> @$input['loan_purpose'] 'KYC'=> @$input['KYC'], \n 'recomndation'=> @$input['recomndation'], \n 'lastRowriskMitigants'=> @$input['lastRowriskMitigants'], \n\n\n //'loan_purpose'=> $input['loan_purpose']\n ] );\n //dd( $input);\n // $redirectUrl = $this->generateRedirectURL('loans/praposal/checklist', $endUseList, $loanType, $amount, $loanTenure, $companySharePledged, $bscNscCode, $loanId);\n //$redirectUrl = $this->generateRedirectURL('loans/praposal/checklist', $endUseList, $loanType, $amount, $loanTenure, $companySharePledged, $bscNscCode, $loanId);\n\n //return Redirect::to($redirectUrl);\n //$redirectUrl = 'home';\n\n\n if($user->isApproverUser()){\n $redirectUrl = $this->generateRedirectURL('loans/praposal/approver', $endUseList, $loanType, $amount, $loanTenure, $companySharePledged, $bscNscCode, $loanId);\n }else{\n $redirectUrl = 'home';\n}\nreturn Redirect::to($redirectUrl)->with('message', 'Proposal Has beed forwarded to approver');;\n\n}", "public function approve_submission(Request $request)\n {\n }", "public function setAllow($value) {\r\n $this->allow = $value;\r\n }", "function eve_api_enter_api_form($form, &$form_state) {\n $form['verify']['info'] = array(\n '#type' => 'item',\n '#title' => t('Verify Blue Status'),\n '#description' => t('Please enter your EVE API Key in order to verify you qualify for an account. Please ensure your key matches the options listed below.'),\n '#weight' => 0,\n );\n\n $allow_expires = variable_get('eve_api_require_expires', FALSE) ? t('You may set an expiry, but the preferred method is to tick the box \"No Expiry\".') : t('Please tick the box \"No Expiry\".');\n $allow_type = variable_get('eve_api_require_type', TRUE) ? t('Please set this to \"All\".') : t('You may select your main character or \"All\".');\n\n $form['verify']['help_character'] = array(\n '#type' => 'item',\n '#title' => t('Character:'),\n '#description' => $allow_type,\n '#weight' => 10,\n );\n\n $form['verify']['help_type'] = array(\n '#type' => 'item',\n '#title' => t('Type:'),\n '#description' => t('Please set this to \"Character\".'),\n '#weight' => 20,\n );\n\n $form['verify']['help_expire'] = array(\n '#type' => 'item',\n '#title' => t('Expires:'),\n '#description' => $allow_expires,\n '#weight' => 30,\n );\n\n $form['verify']['help_mask'] = array(\n '#type' => 'item',\n '#title' => t('Access Mask:'),\n '#description' => t('Click <a href=\"@mask\" target=\"_blank\">here</a> to create a new key with the correct access mask pre-selected.', array('@mask' => 'http://community.eveonline.com/support/api-key/CreatePredefined?accessMask=' . variable_get('eve_api_access_mask', 268435455))),\n '#weight' => 40,\n );\n\n $form['verify']['keyID'] = array(\n '#type' => 'textfield',\n '#title' => t('Key ID'),\n '#description' => t('Please enter your Key ID.'),\n '#required' => TRUE,\n '#size' => 20,\n '#maxlength' => 15,\n '#weight' => 50,\n );\n\n $form['verify']['vCode'] = array(\n '#type' => 'textfield',\n '#title' => t('Verification Code'),\n '#description' => t('Please enter your Verification Code.'),\n '#required' => TRUE,\n '#size' => 80,\n '#maxlength' => 64,\n '#weight' => 60,\n );\n\n if (!variable_get('eve_api_enable', FALSE)) {\n drupal_set_message(t('Registrations temporarily disabled.'), 'error', FALSE);\n $form['buttons']['next']['#disabled'] = TRUE;\n }\n\n $form['#validate'][] = 'eve_api_enter_api_form_validate';\n\n return $form;\n}", "public static function privacy_policy_guide()\n {\n }", "public function getAccrualTypeAllowableValues()\n {\n return [\n self::ACCRUAL_TYPE_FILING,\n self::ACCRUAL_TYPE_ACCRUAL,\n ];\n }", "abstract function abilityGet();", "function index(){\n\t\tif(!empty($this->group_permissions) && in_array(24,$this->group_permissions)){\n\t\t\t$data['js']\t\t= array('jquery-min','bootstrap','jquery-ui','confirmation','jquery.mCustomScrollbar','jquery.selectBoxIt','jquery.dataTables.bootstrap.min','jquery.dataTables.min','parsley.min'); \n\t\t\t$data['css']\t= array('common','managequote','jquery.dataTables.min','bootstrap','pop-up-model','jquery-ui','jquery.mCustomScrollbar','font-awesome.min','');\n\t\t\t$data['title']\t= 'Netform Allowance';\n\t\t\t$filterForm\t= '';$filteredOrders=array();$filterData\t= array();\n\t\t\t$netformAllowances\t\t= array();//$this->Netform_allowance_model->getAllNetformAllowance();\n\t\t\t/*if(!empty($postData)){\n\t\t\t\t\t$orderStatus\t= !empty($postData['order_status']) ? $postData['order_status'] : ''; \n\t\t\t\t\t$shipDateFrom\t= !empty($postData['ship_date_from']) ? $postData['ship_date_from'] : ''; \n\t\t\t\t\t$shipDateTo\t\t= !empty($postData['ship_date_to']) ? $postData['ship_date_to'] : ''; \n\t\t\t\t\t$shippMethod\t= !empty($postData['shipping_method']) ? $postData['shipping_method'] : ''; \n\t\t\t\t\t$shippLocation\t= !empty($postData['shipping_location']) ? $postData['shipping_location'] : '';\n\t\t\t\t\t$filterData\t\t= array('order_status'=>$orderStatus,'ship_date_from'=>$shipDateFrom,\n\t\t\t\t\t\t\t\t\t\t'ship_date_to'=>$shipDateTo,'shipp_method'=>$shippMethod,\n\t\t\t\t\t\t\t\t\t\t'shipp_location'=>$shippLocation);\n\t\t\t\t\t$orders\t\t\t= $this->Order_model->getFilterOrders($filterData);\n\t\t\t}*/\n\t\t\t$data['netformAllowances']\t= $netformAllowances;\n\t\t\t//$data['filterData']\t\t= $filterData;\n\t\t\t$this->load->view('frontend/netform_allowance', $data);\n\t\t}else{\n\t\t\t$message='<div class=\"alert alert-block alert-danger\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\"><i class=\"ace-icon fa fa-times\"></i></button><p>'.$this->NotAuthorizedMsg.'</p></div>';\n\t\t\t$this->session->set_flashdata('message',$message);\n\t\t\tredirect('dashboard');\n\t\t}\n\t}", "public function checkCreditLimit() {\n \n Mage::getModel('storesms/apiClient')->checkCreditLimit(); \n \n }", "public function user_is_allowed()\n {\n //check if the record exist\n if (! $this->record) {\n $this->build_error('These record does not exist or it may not belong to you',404);\n }\n\n //check if the user is the owner of the entry\n if(!isOwner($this->record)) {\n $this->build_error('you are not the owner of this task');\n }\n\n //check if the incomming entries type is Array\n if (!is_array($this->request->entries)) {\n $this->build_error('Please the entries must be an Array');\n }\n }", "public function formAction() {}", "public function isXfaForm() {}", "public function getFreeBaggageAllowance()\n {\n return isset($this->FreeBaggageAllowance) ? $this->FreeBaggageAllowance : null;\n }", "public function run()\n {\n $sort = 0;\n\n $page = FormBuilder::createPage('SuranceBay Signature Agreement', UserStatusHistory::STATUS_SURANCE_BAY);\n\n $section = FormBuilder::createSection('SuranceBay Signature Agreement', $page->id, $sort++);\n FormBuilder::addSubline($section, 'Please read and agree to the terms below.');\n FormBuilder::createField(\"I hereby authorize Surancebay, LLC and it’s general agency customers (the \\\"Authorized Parties\\\") to affix or append a copy of my signature, as set forth below, to any and all required signature fields on forms and agreements of any insurance carrier (a “Carrier“) designated by me through the SURELC software, business submission, or through any other means, including without limitation, by email or orally. The Authorized Parties shall be permitted to complete and submit all such forms and agreements on my behalf for the purposes of becoming authorized to sell Carrier insurance products. I hereby release, indemnify and hold harmless the Authorized Parties against any and all claims, demands, losses, damages, and causes of action, including expenses, costs and reasonable attorney’s fees which they may sustain or incur as a result of carrying out the authority granted hereunder.<br><br>By my signature below, I certify that the information I have submitted to the Authorized Parties is correct to the best of my knowledge and acknowledge that I have read and reviewed the forms and agreements which the Authorized Parties have been authorized to affix my signature. I agree to indemnify and hold any third party harmless from and against any and all claims, demands, losses, damages, and causes of action, including expenses, costs and reasonable attorney’s fees which such third party may incur as a result of its reliance on any form or agreement bearing my signature pursuant to this authorization.\", FormField::TYPE_HTML, FormField::WIDTH_FULL, $section->id);\n FormBuilder::createField('I agree to the terms.', FormField::TYPE_CHECKBOX, FormField::WIDTH_FULL, $section->id);\n\n $section = FormBuilder::createSection('Printed Name', $page->id, $sort++);\n FormBuilder::createField('', FormField::TYPE_TEXT, FormField::WIDTH_HALF, $section->id, '', 1);\n\n $section = FormBuilder::createSection('Signature', $page->id, $sort++);\n FormBuilder::addSubline($section, 'Please make sure to sign your full name. Initials are not accepted. Illegible signatures are not accepted.');\n FormBuilder::createField('', FormField::TYPE_SIGNATURE, FormField::WIDTH_HALF, $section->id);\n }", "private function _displayForm()\n\t{\n\t\t$transactions = array('0'=>$this->l('Authorization'),'1'=>$this->l('Preauthorization'),'2'=>$this->l('Preauthorization confirmation'),'3'=>$this->l('Callback'), '5' => $this->l('Recurring transaction'), '6' => $this->l('Successive transaction'), '7' => $this->l('Preauthentication'), '8' => $this->l('Preauthentication confirmation'), '9' => $this->l('Cancellation of Preauthentication'), 'O' => $this->l('Delayed authorization'), 'P' => $this->l('Delayed authorization confirmation'), 'Q' => $this->l('Delayed authorization cancellation'), 'R' => $this->l('Released initial recurring deferred'), 'S' => $this->l('Successive recurrent released'));\n\t\t\n\t\t$transact = 0;\n\t\t$transact2 = 0;\n\t\t$transact3 = 0;\n\t\tif ( (Tools::getValue('trans') == \"\") and (isset($this->trans)) )\n\t\t\t$transact = $this->trans;\n\t\telse\n\t\t\t$transact = Tools::getValue('trans');\n\t\tif ( (Tools::getValue('trans2') == \"\") and (isset($this->trans2)) )\n\t\t\t$transact2 = $this->trans2;\n\t\telse\n\t\t\t$transact2 = Tools::getValue('trans2');\n\t\tif ( (Tools::getValue('trans3') == \"\") and (isset($this->trans3)) )\n\t\t\t$transact3 = $this->trans3;\n\t\telse\n\t\t\t$transact3 = Tools::getValue('trans3');\n\t\t// obtenemos las monedas dadas de alta en la tienda\n\t\t$currencies = Currency::getCurrencies();\n\t\tif ( (Tools::getValue('nombre') == \"\") and (isset($this->nombre)) )\n\t\t\t$nombre = $this->nombre;\n\t\telse\n\t\t\t$nombre = Tools::getValue('nombre');\n\t\tif ( (Tools::getValue('nombre2') == \"\") and (isset($this->nombre2)) )\n\t\t\t$nombre2 = $this->nombre2;\n\t\telse\n\t\t\t$nombre2 = Tools::getValue('nombre2');\n\t\tif ( (Tools::getValue('nombre3') == \"\") and (isset($this->nombre3)) )\n\t\t\t$nombre3 = $this->nombre3;\n\t\telse\n\t\t\t$nombre3 = Tools::getValue('nombre3');\n\t\tif ( (Tools::getValue('clave') == \"\") and (isset($this->clave)) )\n\t\t\t$clave = $this->clave;\n\t\telse\n\t\t\t$clave = Tools::getValue('clave');\n\t\tif ( (Tools::getValue('clave2') == \"\") and (isset($this->clave2)) )\n\t\t\t$clave2 = $this->clave2;\n\t\telse\n\t\t\t$clave2 = Tools::getValue('clave2');\n\t\tif ( (Tools::getValue('clave3') == \"\") and (isset($this->clave3)) )\n\t\t\t$clave3 = $this->clave3;\n\t\telse\n\t\t\t$clave3 = Tools::getValue('clave3');\n\t\t// Opciones para el select de monedas.\n\t\tif ( (Tools::getValue('moneda') == \"\") and (isset($this->moneda)) )\n\t\t\t$moneda = $this->moneda;\n\t\telse\n\t\t\t$moneda = Tools::getValue('moneda');\n\t\tif ( (Tools::getValue('moneda2') == \"\") and (isset($this->moneda2)) )\n\t\t\t$moneda2 = $this->moneda2;\n\t\telse\n\t\t\t$moneda2 = Tools::getValue('moneda2');\n\t\tif ( (Tools::getValue('moneda3') == \"\") and (isset($this->moneda3)) )\n\t\t\t$moneda3 = $this->moneda3;\n\t\telse\n\t\t\t$moneda3 = Tools::getValue('moneda3');\n\t\t\n\t\tif ( (Tools::getValue('codigo') == \"\") and (isset($this->codigo)) )\n\t\t\t$codigo = $this->codigo;\n\t\telse\n\t\t\t$codigo = Tools::getValue('codigo');\n\t\tif ( (Tools::getValue('codigo2') == \"\") and (isset($this->codigo2)) )\n\t\t\t$codigo2 = $this->codigo2;\n\t\telse\n\t\t\t$codigo2 = Tools::getValue('codigo2');\n\t\tif ( (Tools::getValue('codigo3') == \"\") and (isset($this->codigo3)) )\n\t\t\t$codigo3 = $this->codigo3;\n\t\telse\n\t\t\t$codigo3 = Tools::getValue('codigo3');\n\t\tif ( (Tools::getValue('terminal') == \"\") and (isset($this->terminal)) )\n\t\t\t$terminal = $this->terminal;\n\t\telse\n\t\t\t$terminal = Tools::getValue('terminal');\n\t\tif ( (Tools::getValue('terminal2') == \"\") and (isset($this->terminal2)) )\n\t\t\t$terminal2 = $this->terminal2;\n\t\telse\n\t\t\t$terminal2 = Tools::getValue('terminal2');\n\t\tif ( (Tools::getValue('terminal3') == \"\") and (isset($this->terminal3)) )\n\t\t\t$terminal3 = $this->terminal3;\n\t\telse\n\t\t\t$terminal3 = Tools::getValue('terminal3');\n\t\t// Opciones para activar/desactivar SSL\n\t\t$ssl = Tools::getValue('ssl', $this->ssl);\n\t\t$ssl_si = ($ssl == 'si') ? ' checked=\"checked\" ' : '';\n\t\t$ssl_no = ($ssl == 'no') ? ' checked=\"checked\" ' : '';\n\t\t// Opciones para el comportamiento en error en el pago\n\t\t$error_pago = Tools::getValue('error_pago', $this->error_pago);\n\t\t$error_pago_si = ($error_pago == 'si') ? ' checked=\"checked\" ' : '';\n\t\t$error_pago_no = ($error_pago == 'no') ? ' checked=\"checked\" ' : '';\n\t\t// Opciones para activar los idiomas\n\t\t$idiomas_estado = Tools::getValue('idiomas_estado', $this->idiomas_estado);\n\t\t$idiomas_estado_si = ($idiomas_estado == 'si') ? ' checked=\"checked\" ' : '';\n\t\t$idiomas_estado_no = ($idiomas_estado == 'no') ? ' checked=\"checked\" ' : '';\n\t\t\n\t\t// Opciones entorno\n\t\tif (!isset($_POST['urltpv']))\n\t\t\t$entorno = Tools::getValue('env', $this->env);\n\t\telse\n\t\t\t$entorno = $_POST['urltpv'];\n\t\t$entorno_real_redsys = ($entorno==0) ? ' selected=\"selected\" ' : '';\n\t\t$entorno_t_redsys = ($entorno==1) ? ' selected=\"selected\" ' : '';\t\t\n\t\t$entorno_real_sermepa = ($entorno==2) ? ' selected=\"selected\" ' : '';\n\t\t$entorno_t_sermepa = ($entorno==3) ? ' selected=\"selected\" ' : '';\n\t\t// Opciones entorno 2\n\t\tif (!isset($_POST['urltpv2']))\n\t\t\t$entorno2 = Tools::getValue('env2', $this->env2);\n\t\telse\n\t\t\t$entorno2 = $_POST['urltpv2'];\n\t\t$entorno_real_redsys2 = ($entorno2==0) ? ' selected=\"selected\" ' : '';\n\t\t$entorno_t_redsys2 = ($entorno2==1) ? ' selected=\"selected\" ' : '';\t\t\n\t\t$entorno_real_sermepa2 = ($entorno2==2) ? ' selected=\"selected\" ' : '';\n\t\t$entorno_t_sermepa2 = ($entorno2==3) ? ' selected=\"selected\" ' : '';\n\t\t// Opciones entorno 3\n\t\tif (!isset($_POST['urltpv3']))\n\t\t\t$entorno3 = Tools::getValue('env3', $this->env3);\n\t\telse\n\t\t\t$entorno3 = $_POST['urltpv3'];\n\t\t$entorno_real_redsys3 = ($entorno3==0) ? ' selected=\"selected\" ' : '';\n\t\t$entorno_t_redsys3 = ($entorno3==1) ? ' selected=\"selected\" ' : '';\t\t\n\t\t$entorno_real_sermepa3 = ($entorno3==2) ? ' selected=\"selected\" ' : '';\n\t\t$entorno_t_sermepa3 = ($entorno3==3) ? ' selected=\"selected\" ' : '';\n\t\t// Opciones del tipo de firma\n\t\t$tipofirma = Tools::getValue('tipofirma', $this->tipofirma);\n\t \t$tipofirma_a = ($tipofirma==0) ? ' checked=\"checked\" ' : '';\n\t \t$tipofirma_c = ($tipofirma==1) ? ' checked=\"checked\" ' : '';\n \t\t$tipofirma2 = Tools::getValue('tipofirma2', $this->tipofirma2);\n\t \t$tipofirma_a2 = ($tipofirma2==0) ? ' checked=\"checked\" ' : '';\n\t \t$tipofirma_c2 = ($tipofirma2==1) ? ' checked=\"checked\" ' : '';\n\t \t$tipofirma3 = Tools::getValue('tipofirma3', $this->tipofirma3);\n\t \t$tipofirma_a3 = ($tipofirma3==0) ? ' checked=\"checked\" ' : '';\n\t \t$tipofirma_c3 = ($tipofirma3==1) ? ' checked=\"checked\" ' : '';\n\t \n\t // Opciones notificacion\n\t $notificacion = Tools::getValue('notificacion', $this->notificacion);\n\t\t$notificacion_s = ($notificacion==1) ? ' checked=\"checked\" ' : '';\n\t\t$notificacion_n = ($notificacion==0) ? ' checked=\"checked\" ' : '';\n\t\t// Opciones multimoneda\n\t $multimoneda = Tools::getValue('multimoneda', $this->multimoneda);\n\t\t$multimoneda_s = ($multimoneda==1) ? ' checked=\"checked\" ' : '';\n\t\t$multimoneda_n = ($multimoneda==0) ? ' checked=\"checked\" ' : '';\n\t\t\n\t\t// Mostar formulario\n\t\t$this->_html .=\n\t\t'<form action=\"'.$_SERVER['REQUEST_URI'].'\" method=\"post\">\n\t\t\t<fieldset>\n\t\t\t<legend><img src=\"../img/admin/contact.gif\" />'.$this->l('Virtual POS configuration').'</legend>\n\t\t\t\t<table border=\"0\" width=\"100%\" cellpadding=\"0\" cellspacing=\"4\" id=\"form\" style=\"font-size:12px;margin-bottom:3px\">\n\t\t\t\t\t<tr><td colspan=\"2\">\n\t\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t<legend>'.$this->l('Commerce configuration').' 1</legend>\n\t\t\t\t\t\t<table border=\"0\" width=\"100%\" cellpadding=\"2\" cellspacing=\"3\" style=\"font-size:12px\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Redsys environment').'</td>\n\t\t\t\t\t\t\t\t\t<td><select style=\"width:150px\" name=\"urltpv\">\n\t\t\t\t\t\t\t\t\t\t<option value=\"0\"'.$entorno_real_redsys.'>'.$this->l('Real Redsys').'</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"1\"'.$entorno_t_redsys.'>'.$this->l('Testing Redsys').'</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"2\"'.$entorno_real_sermepa.'>'.$this->l('Real Sermepa').'</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"3\"'.$entorno_t_sermepa.'>'.$this->l('Testing Sermepa').'</option>\n\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Commerce name').'</td><td><input type=\"text\" name=\"nombre\" value=\"'.htmlentities($nombre, ENT_COMPAT, 'UTF-8').'\" style=\"width: 200px;\" /></div></td>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Secret Key encryption').'</td><td><input type=\"text\" size=\"25\" maxlength=\"20\" name=\"clave\" value=\"'.$clave.'\" style=\"width: 200px;\" /></td>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Terminal number').'</td><td><input type=\"text\" style=\"width:20px\" maxlength=\"3\" name=\"terminal\" value=\"'.$terminal.'\" style=\"width: 80px;\" /> &nbsp;\n\t\t\t\t\t\t\t\t\t'.$this->l('Currency').' &nbsp; <select style=\"width:130px\" name=\"moneda\" style=\"width: 80px;\"><option value=\"\"></option>';\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$monedaselected = '';\n\t\t\t\t\t\t\t\t\t\tforeach ($currencies AS $currency) {\n\t\t\t\t\t\t\t\t\t\t\tif ($moneda == $currency[\"iso_code_num\"]) \n\t\t\t\t\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\t\t\t\t\t$monedaselected = ' selected=\"selected\" ';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t$monedaselected = '';\n\t\t\t\t\t\t\t\t\t\t\t$this->_html .= '<option value=\"'.$currency['iso_code_num'].'\"'.$monedaselected.'>'.$currency['name'].'</option>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$this->_html .= '</select>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Commerce number (FUC)').'</td><td><input type=\"text\" maxlength=\"9\" name=\"codigo\" value=\"'.$codigo.'\" style=\"width: 200px;\" /></td>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Signature type').'</td><td><input type=\"radio\" name=\"tipofirma\" id=\"tipofirma_c\" value=\"1\"'.$tipofirma_c.'/>&nbsp;'.$this->l('Full').'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=\"radio\" name=\"tipofirma\" id=\"tipofirma_a\" value=\"0\"'.$tipofirma_a.'/>&nbsp;'.$this->l('Full extended').'</td>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Transaction type').'</td>\n\t\t\t\t\t\t\t\t<td><select name=\"trans\" style=\"width: 200px;\"><option value=\"\"></option>';\n\t\t\t\t\t\t\t\t\t$transactionselected = '';\n\t\t\t\t\t\t\t\t\tforeach($transactions as $codigoTrans => $descripcionTrans) \n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif ($transact == $codigoTrans) \n\t\t\t\t\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\t\t\t\t\t$transactionselected = ' selected=\"selected\" ';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t$transactionselected = '';\n\t\t\t\t\t\t\t\t\t\t\t$this->_html .= '<option value=\"'.$codigoTrans.'\"'.$transactionselected.'>'.$descripcionTrans.'</option>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$this->_html .= '</select>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t</td></tr>\n\t\t\t\t\t<tr><td colspan=\"2\">\n\t\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t<legend>'.$this->l('Commerce configuration').' 2</legend>\n\t\t\t\t\t\t<table border=\"0\" width=\"100%\" cellpadding=\"2\" cellspacing=\"3\" style=\"font-size:12px\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Redsys environment').'</td>\n\t\t\t\t\t\t\t\t\t<td><select style=\"width:150px\" name=\"urltpv2\">\n\t\t\t\t\t\t\t\t\t\t<option value=\"0\"'.$entorno_real_redsys2.'>'.$this->l('Real Redsys').'</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"1\"'.$entorno_t_redsys2.'>'.$this->l('Testing Redsys').'</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"2\"'.$entorno_real_sermepa2.'>'.$this->l('Real Sermepa').'</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"3\"'.$entorno_t_sermepa2.'>'.$this->l('Testing Sermepa').'</option>\n\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Commerce name').'</td><td><input type=\"text\" name=\"nombre2\" value=\"'.htmlentities($nombre2, ENT_COMPAT, 'UTF-8').'\" style=\"width: 200px;\" /></td>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Secret Key encryption').'</td><td><input type=\"text\" size=\"25\" maxlength=\"20\" name=\"clave2\" value=\"'.$clave2.'\" style=\"width: 200px;\" /></td>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Terminal number').'</td><td><input type=\"text\" style=\"width:20px\" maxlength=\"3\" name=\"terminal2\" value=\"'.$terminal2.'\" style=\"width: 80px;\" /> &nbsp;\n\t\t\t\t\t\t\t\t\t'.$this->l('Currency').' &nbsp; <select style=\"width:130px\" name=\"moneda2\" style=\"width: 80px;\"><option value=\"\"></option>';\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$monedaselected2 = '';\n\t\t\t\t\t\t\t\t\t\tforeach ($currencies AS $currency) {\n\t\t\t\t\t\t\t\t\t\t\tif ($moneda2 == $currency[\"iso_code_num\"]) \n\t\t\t\t\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\t\t\t\t\t$monedaselected2 = ' selected=\"selected\" ';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t$monedaselected2 = '';\n\t\t\t\t\t\t\t\t\t\t\t$this->_html .= '<option value=\"'.$currency['iso_code_num'].'\"'.$monedaselected2.'>'.$currency['name'].'</option>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$this->_html .= '</select>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Commerce number (FUC)').'</td><td><input type=\"text\" maxlength=\"9\" name=\"codigo2\" value=\"'.$codigo2.'\" style=\"width: 200px;\" /></td>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Signature type').'</td><td><input type=\"radio\" name=\"tipofirma2\" id=\"tipofirma_c2\" value=\"1\"'.$tipofirma_c2.'/>&nbsp;'.$this->l('Full').'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=\"radio\" name=\"tipofirma2\" id=\"tipofirma_a2\" value=\"0\"'.$tipofirma_a2.'/>&nbsp;'.$this->l('Full extended').'</td>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Transaction type').'</td>\n\t\t\t\t\t\t\t\t<td><select name=\"trans2\" style=\"width: 200px;\"><option value=\"\"></option>';\n\t\t\t\t\t\t\t\t\t$transactionselected2 = '';\n\t\t\t\t\t\t\t\t\tforeach($transactions as $codigoTrans => $descripcionTrans) \n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif ($transact2 == $codigoTrans) \n\t\t\t\t\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\t\t\t\t\t$transactionselected2 = ' selected=\"selected\" ';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t$transactionselected2 = '';\n\t\t\t\t\t\t\t\t\t\t\t$this->_html .= '<option value=\"'.$codigoTrans.'\"'.$transactionselected2.'>'.$descripcionTrans.'</option>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$this->_html .= '</select>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t</td></tr>\n\t\t\t\t\t<tr><td colspan=\"2\">\n\t\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t<legend>'.$this->l('Commerce configuration').' 3</legend>\n\t\t\t\t\t\t<table border=\"0\" width=\"100%\" cellpadding=\"2\" cellspacing=\"3\" style=\"font-size:12px\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Redsys environment').'</td>\n\t\t\t\t\t\t\t\t\t<td><select style=\"width:150px\" name=\"urltpv3\">\n\t\t\t\t\t\t\t\t\t\t<option value=\"0\"'.$entorno_real_redsys3.'>'.$this->l('Real Redsys').'</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"1\"'.$entorno_t_redsys3.'>'.$this->l('Testing Redsys').'</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"2\"'.$entorno_real_sermepa3.'>'.$this->l('Real Sermepa').'</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"3\"'.$entorno_t_sermepa3.'>'.$this->l('Testing Sermepa').'</option>\n\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Commerce name').'</td><td><input type=\"text\" name=\"nombre3\" value=\"'.htmlentities($nombre3, ENT_COMPAT, 'UTF-8').'\" style=\"width: 200px;\" /></td>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Secret Key encryption').'</td><td><input type=\"text\" size=\"25\" maxlength=\"20\" name=\"clave3\" value=\"'.$clave3.'\" style=\"width: 200px;\" /></td>\n\t\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Terminal number').'</td><td><input type=\"text\" style=\"width:20px\" maxlength=\"3\" name=\"terminal3\" value=\"'.$terminal3.'\" style=\"width: 80px;\" /> &nbsp;\n\t\t\t\t\t\t\t\t\t'.$this->l('Currency').' &nbsp; <select style=\"width:130px\" name=\"moneda3\" style=\"width: 80px;\"><option value=\"\"></option>';\t\t\t\t\n\t\t\t\t\t\t\t\t\t$monedaselected3 = '';\n\t\t\t\t\t\t\t\t\tforeach ($currencies AS $currency) {\n\t\t\t\t\t\t\t\t\t\tif ($moneda3 == $currency[\"iso_code_num\"]) \n\t\t\t\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\t\t\t\t$monedaselected3 = ' selected=\"selected\" ';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t$monedaselected3 = '';\n\t\t\t\t\t\t\t\t\t\t$this->_html .= '<option value=\"'.$currency['iso_code_num'].'\"'.$monedaselected3.'>'.$currency['name'].'</option>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$this->_html .= '</select>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Commerce number (FUC)').'</td><td><input type=\"text\" maxlength=\"9\" name=\"codigo3\" value=\"'.$codigo3.'\" style=\"width: 200px;\" /></td>\n\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Signature type').'</td><td><input type=\"radio\" name=\"tipofirma3\" id=\"tipofirma_c3\" value=\"1\"'.$tipofirma_c3.'/>&nbsp;'.$this->l('Full').'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=\"radio\" name=\"tipofirma3\" id=\"tipofirma_a3\" value=\"0\"'.$tipofirma_a3.'/>&nbsp;'.$this->l('Full extended').'</td>\n\t\t\t\t\t\t\t<td style=\"height: 25px;\">'.$this->l('Transaction type').'</td>\n\t\t\t\t\t\t\t<td><select name=\"trans3\" style=\"width: 200px;\"><option value=\"\"></option>';\n\t\t\t\t\t\t\t\t\t$transactionselected3 = '';\n\t\t\t\t\t\t\t\t\tforeach($transactions as $codigoTrans => $descripcionTrans) \n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif ($transact3 == $codigoTrans) \n\t\t\t\t\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\t\t\t\t\t$transactionselected3 = ' selected=\"selected\" ';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t$transactionselected3 = '';\n\t\t\t\t\t\t\t\t\t\t\t$this->_html .= '<option value=\"'.$codigoTrans.'\"'.$transactionselected3.'>'.$descripcionTrans.'</option>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$this->_html .= '</select>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t</td></tr>\t\t\t\t\t\n\t\t\t\t</table>\n\t\t\t</fieldset>\n\t\t\t<br>\n\t\t\t<fieldset>\n\t\t\t<legend><img src=\"../img/admin/cog.gif\" />'.$this->l('Customization').'</legend>\n\t\t\t\t<table border=\"0\" width=\"680\" cellpadding=\"0\" cellspacing=\"0\" id=\"form\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=\"450\" style=\"height: 25px;\">'.$this->l('Multicurrency activation (only in stores with more than one terminal)').'</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<input type=\"radio\" name=\"multimoneda\" id=\"multimoneda_1\" value=\"1\"'.$multimoneda_s.'/>\n\t\t\t\t\t\t\t<img src=\"../img/admin/enabled.gif\" alt=\"'.$this->l('Enabled').'\" title=\"'.$this->l('Enabled').'\" />\n\t\t\t\t\t\t\t<input type=\"radio\" name=\"multimoneda\" id=\"multimoneda_0\" value=\"0\"'.$multimoneda_n.'/>\n\t\t\t\t\t\t\t<img src=\"../img/admin/disabled.gif\" alt=\"'.$this->l('Disabled').'\" title=\"'.$this->l('Disabled').'\" />\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=\"450\" style=\"height: 25px;\">'.$this->l('HTTP notification (if disabled not process order and empty your cart)').'</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<input type=\"radio\" name=\"notificacion\" id=\"notificacion_1\" value=\"1\"'.$notificacion_s.'/>\n\t\t\t\t\t\t\t<img src=\"../img/admin/enabled.gif\" alt=\"'.$this->l('Enabled').'\" title=\"'.$this->l('Enabled').'\" />\n\t\t\t\t\t\t\t<input type=\"radio\" name=\"notificacion\" id=\"notificacion_0\" value=\"0\"'.$notificacion_n.'/>\n\t\t\t\t\t\t\t<img src=\"../img/admin/disabled.gif\" alt=\"'.$this->l('Disabled').'\" title=\"'.$this->l('Disabled').'\" />\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=\"340\" style=\"height: 25px;\">'.$this->l('URL validation with SSL').'</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<input type=\"radio\" name=\"ssl\" id=\"ssl_1\" value=\"si\" '.$ssl_si.'/>\n\t\t\t\t\t\t\t<img src=\"../img/admin/enabled.gif\" alt=\"'.$this->l('Enabled').'\" title=\"'.$this->l('Enabled').'\" />\n\t\t\t\t\t\t\t<input type=\"radio\" name=\"ssl\" id=\"ssl_0\" value=\"no\" '.$ssl_no.'/>\n\t\t\t\t\t\t\t<img src=\"../img/admin/disabled.gif\" alt=\"'.$this->l('Disabled').'\" title=\"'.$this->l('Disabled').'\" />\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=\"340\" style=\"height: 25px;\">'.$this->l('On error, allowing choose another payment method').'</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<input type=\"radio\" name=\"error_pago\" id=\"error_pago_1\" value=\"si\" '.$error_pago_si.'/>\n\t\t\t\t\t\t\t<img src=\"../img/admin/enabled.gif\" alt=\"'.$this->l('Enabled').'\" title=\"'.$this->l('Enabled').'\" />\n\t\t\t\t\t\t\t<input type=\"radio\" name=\"error_pago\" id=\"error_pago_0\" value=\"no\" '.$error_pago_no.'/>\n\t\t\t\t\t\t\t<img src=\"../img/admin/disabled.gif\" alt=\"'.$this->l('Disabled').'\" title=\"'.$this->l('Disabled').'\" />\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=\"340\" style=\"height: 25px;\">'.$this->l('Enable languages in POS').'</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<input type=\"radio\" name=\"idiomas_estado\" id=\"idiomas_estado_si\" value=\"si\" '.$idiomas_estado_si.'/>\n\t\t\t\t\t\t\t<img src=\"../img/admin/enabled.gif\" alt=\"'.$this->l('Enabled').'\" title=\"'.$this->l('Enabled').'\" />\n\t\t\t\t\t\t\t<input type=\"radio\" name=\"idiomas_estado\" id=\"idiomas_estado_no\" value=\"no\" '.$idiomas_estado_no.'/>\n\t\t\t\t\t\t\t<img src=\"../img/admin/disabled.gif\" alt=\"'.$this->l('Disabled').'\" title=\"'.$this->l('Disabled').'\" />\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</fieldset>\n\t\t\t<br>\n\t\t<input class=\"button\" name=\"btnSubmit\" value=\"'.$this->l('Save configuration').'\" type=\"submit\" />\n\t\t</form>';\n\t}", "function dataObjectEffect() {\n\t\t$galleyId = (int)$this->getDataObjectId();\n\t\tif (!$galleyId) return AUTHORIZATION_DENY;\n\n\t\t// Need a valid submission in request.\n\t\t$submission =& $this->getAuthorizedContextObject(ASSOC_TYPE_SUBMISSION);\n\t\tif (!is_a($submission, 'Submission')) return AUTHORIZATION_DENY;\n\n\t\t// Make sure the galley belongs to the submission.\n\t\t$articleGalleyDao = DAORegistry::getDAO('ArticleGalleyDAO');\n\t\t$galley = $articleGalleyDao->getById($galleyId, $submission->getId());\n\t\tif (!is_a($galley, 'ArticleGalley')) return AUTHORIZATION_DENY;\n\n\t\t// Save the Galley to the authorization context.\n\t\t$this->addAuthorizedContextObject(ASSOC_TYPE_GALLEY, $galley);\n\t\treturn AUTHORIZATION_PERMIT;\n\t}", "public function deleteAllowance() {\n $id = Request::Segment(3);\n //$coa = Request::Segment(5);\n $checkStatus = $this->db2->select($this->db2->raw('select count(id) as count from hr_emp_allowance where fkAllowId=' . $id));\n if ($checkStatus[0]->count == 0) {\n //$delete = $this->db2->table('il_accounting_coa_level4')->where('id','=',$coa)->delete();\n $delete = $this->db2->table('hr_allowances')->where('id', '=', $id)->delete();\n if ($delete)\n return Redirect::to('config/allowance')->with(array('successalert' => 'Allowance Deleted Successfully'));\n else\n return Redirect::to('config/allowance')->with(array('erroralert' => 'Server problem Try again'));\n } else {\n return Redirect::to('config/allowance')->with(array('erroralert' => 'Allowance already assigned so it cannot be deleted'));\n }\n }", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')\n ->isAllowed('admin/system/convert/professio_budgetmailer');\n }", "public function acceptOrDenyAction(Request $request)\n {\n $ad = (int)$request->attributes->get('ad');\n $offer = (int)$request->attributes->get('offer');\n $type = $request->attributes->get('action');\n $userAttr = $this->user->getAttributes();\n $isTest = (int)$request->attributes->get('test');\n $testResult = (int)$request->attributes->get('result');\n $validCSRF = $this->validateCSRF();\n if($isTest == 1 && $testResult == 0)\n {\n $userAttr = array('id' => (int)$request->attributes->get('user'));\n $ad = (int)$request->attributes->get('id');\n $offer = (int)$request->attributes->get('id2');\n $type = 'accepter';\n $validCSRF = true;\n }\n elseif($isTest == 1 && $testResult == 1)\n {\n $userAttr = array('id' => (int)$request->attributes->get('elUser1'));\n $ad = (int)$request->attributes->get('id');\n $offer = (int)$request->attributes->get('id2');\n $type = 'accepter';\n $validCSRF = true;\n }\n elseif($this->isTest)\n {\n $userAttr = array('id' => 2);\n $validCSRF = true;\n }\n $data = $this->enMan->getRepository('AdItemsBundle:AdsOffersPropositions')->propositonExists($ad, $offer, (int)$userAttr['id']);\n if($validCSRF === true && ($type == 'accepter' || $type == 'refuser') && isset($data['id_ad']) && $data['id_ad'] == $ad && isset($data['id_of']) && $offer == $data['id_of'])\n {\n // access tests case\n if($isTest == 1)\n {\n return new Response(parent::testAccess($testResult, 1), 200);\n }\n $this->enMan->getConnection()->beginTransaction();\n try\n {\n $tplVals = array('{AD_TITLE}', '{OFFER_NAME}', '{LOGIN}');\n $realVals = array($data['adName'], $data['offerName'], $this->user->getUser());\n switch($type)\n {\n case 'accepter':\n // add offer to ads_offers table\n $aofEnt = new AdsOffers;\n $aofEnt->setAdsIdAd($this->enMan->getReference('Ad\\ItemsBundle\\Entity\\Ads', $ad));\n $aofEnt->setOffersIdOf($this->enMan->getReference('Catalogue\\OffersBundle\\Entity\\Offers', $offer));\n $aofEnt->setAddedDate('');\n $this->enMan->persist($aofEnt);\n $this->enMan->flush();\n\n $i = 1;\n\n // notify ad's author about the new offer\n $template = str_replace($tplVals, $realVals, file_get_contents(rootDir.'messages/offer_accepted.message'));\n // $templateMail = str_replace($tplVals, $realVals, file_get_contents(rootDir.'mails/offer_accepted.maildoc'));\n $title = \"Proposition a été acceptée\";\n $message = \"Proposition a été correctement acceptée\";\n\n // update ads_modified table with the last modification\n $this->enMan->getRepository('AdItemsBundle:AdsModified')->adModified($ad, 'offer_accepted');\n break;\n case 'refuser':\n $i = -1;\n $template = str_replace($tplVals, $realVals, file_get_contents(rootDir.'messages/offer_denied.message'));\n // $templateMail = str_replace($tplVals, $realVals, file_get_contents(rootDir.'mails/offer_denied.maildoc'));\n $title = \"Proposition a été réfusée\";\n $message = \"Proposition a été correctement supprimée\";\n break;\n }\n $q = $this->enMan->createQueryBuilder()->delete('Ad\\ItemsBundle\\Entity\\AdsOffersPropositions', 'aop')\n ->where('aop.ads_id_ad = ?1 AND aop.offers_id_of = ?2 AND aop.users_id_us = ?3')\n ->setParameter(1, $ad)\n ->setParameter(2, $offer)\n ->setParameter(3, $userAttr['id'])\n ->getQuery();\n $p = $q->execute();\n\n // update offers quantity for this ad\n $this->enMan->getRepository('AdItemsBundle:Ads')->updateOffersQuantity($i, $ad);\t\t\n\n // Send private message\n $author = $this->enMan->getReference('User\\ProfilesBundle\\Entity\\Users', (int)$userAttr['id']);\n $messageVals = array(\n 'title' => $title,\n 'content' => $template,\n 'type' => 2,\n 'state' => 1\n );\n $this->enMan->getRepository('MessageMessagesBundle:Messages')->sendPm($author, $this->enMan->getReference('User\\ProfilesBundle\\Entity\\Users', $data['id_us']), $messageVals);\n\n $emtEnt = new EmailsTemplates;\n $mail = \\Swift_Message::newInstance()\n ->setSubject($title)\n ->setFrom($this->from['mail'])\n ->setTo($data['email'])\n ->setContentType(\"text/html\")\n ->setBody($emtEnt->getHeaderTemplate().$template.$emtEnt->getFooterTemplate());\n $this->get('mailer')->send($mail);\n\n // commit SQL transaction\n $this->enMan->getConnection()->commit();\n if($this->isTest)\n {\n return new Response('accepted_successfully');\n }\n $ret['isError'] = 0;\n $ret['message'] = $message;\n }\n catch(Exception $e)\n {\n $this->enMan->getConnection()->rollback();\n $this->enMan->close();\n throw $e;\n }\n }\n elseif($validCSRF === false)\n {\n $ret['isError'] = 1;\n $ret['message'] = \"Votre session a expiré. Veuillez réessayer\";\n }\n else\n {\n // access tests case\n if($isTest == 1)\n {\n return new Response(parent::testAccess($testResult, 0), 200);\n }\n $ret['isError'] = 1;\n $ret['message'] = \"Une erreur s'est produite\";\n }\n echo json_encode($ret);\n\tdie();\n }", "public function valiteForm();", "public function authorize()//AQUI QUE VALIDA USUÀRIO\r\n {\r\n return true;\r\n }", "public function rules()\n {\n return [\n 'award_title' => 'required|string', \n 'award_desc' =>'required|string',\n //'award_link' =>'url',\n 'date_awarded' =>'date',\n 'organization' =>'required|string',\n 'award_attachment' =>'required|image|mimes:jpeg,jpg,gif,png,pdf',\n\n ];\n }", "public function authorize()\n {\n// return Gate::allows('admin.discount.delete', $this->discount);\n return true;\n }", "function Add_Manual_ACH($application_id, $request)\n{\n\t$log = get_log(\"scheduling\");\n\t$holidays = Fetch_Holiday_List();\n\t$pd_calc = new Pay_Date_Calc_3($holidays);\n\t$payment_amt = round($request->amount, 2);\n\n\t$comment = \"Manual ACH Request - \" . $request->payment_description;\n\n\tif ($request->edate == 'select')\n\t{\n\t\t$due_date = $request->scheduled_date?date(\"Y-m-d\", strtotime($request->scheduled_date)):NULL;\n\t}\n\telse\n\t{\n\t\t$due_date = date('Y-m-d', strtotime($request->edate));\n\t}\n\n\tif(!$due_date)\n\t{\n\t\t$_SESSION['error_message'] = \"No date was selected for Manual ACH\";\n\t\treturn false;\n\t}\n\n\t$action_date = $pd_calc->Get_Business_Days_Backward($due_date, 1);\n\n\t//It's possible that this will put the action date in the past, which is bad.\n\t//If that happens, use the scheduled date as the action date instead. [jeffd][IMPACT #13616]\n\tif(strtotime($action_date) < strtotime(date('Y-m-d')))\n\t{\n\t\t$action_date = $due_date;\n\t\t$due_date = $pd_calc->Get_Business_Days_Forward($due_date, 1);\n\t}\n\n\t$amounts = array();\n\t//pay down amounts other than principal first [#27768]\n\t$log->Write(\"[Agent:{$_SESSION['agent_id']}][AppID:{$application_id}] Adding Manual ACH of {$payment_amt} for {$application_id} on date {$due_date}\");\n\n\t//[#46151] Adjust balance info, accounting for scheduled payments\n\t//between now and the manual ACH due date\n\t$schedule = Fetch_Schedule($application_id);\n\t$balance_info = Fetch_Balance_Information($application_id);\n\tforeach($schedule as $e)\n\t{\n\t\tif($e->status == 'scheduled' && strtotime($e->date_effective) < strtotime($due_date))\n\t\t{\n\t\t\tforeach($e->amounts as $ea)\n\t\t\t{\n\t\t\t\t$balance_info->{$ea->event_amount_type . '_balance'} += $ea->amount;\n\t\t\t}\n\t\t}\n\t}\n\n\t$balance = array(\n\t\t'principal' => $balance_info->principal_balance,\n\t\t'service_charge' => $balance_info->service_charge_balance,\n\t\t'fee' => $balance_info->fee_balance,\n\t\t);\n\n\t$amounts = AmountAllocationCalculator::generateAmountsFromBalance($payment_amt, $balance);\n\n\t$payment = Schedule_Event::MakeEvent($action_date, $due_date, $amounts, 'manual_ach', $comment,'scheduled','manual');\n\tRecord_Event($application_id, $payment);\n\n\treturn true;\n}", "function can_process()\n{\n\tglobal $controller,$Mode;\n\treturn \n\t\t\t(!is_empty($_POST['transaction_reason'], ' Designation Reason')) &&\n\t\t\t(!is_empty($_POST['unit_id'], 'Unit')) && \n\t\t\t(!is_empty($_POST['department_id'], 'Department')) &&\n\t\t\t(!is_empty($_POST['employee_id'], 'Employee')) &&\n\t\t\t(\n\t\t\t\t( ($_POST['employee_id'] > 0) && ($_POST['employee_leave_id'] > 0)) ?\n\t\t\t\t//(greater_sanity_check($_POST['deduct_leave'],$_POST['remaining_leave'],\"Deduction Leaves\",\"Remaining Leaves\",1)) && \n\t\t\t\tis_number($_POST['deduct_leave'], \"Deduction Leaves\") &&\n\t\t\t\t!is_empty($_POST['deduct_leave'], \"Deduction Leaves\"):\n\t\t\t\t0\n\t\t\t)\n\t\t\t;\n}", "function wpachievements_submit_score() {\r\n if( is_user_logged_in() ) {\r\n $type='scoresubmit'; $uid=''; $postid='';\r\n if( !function_exists(WPACHIEVEMENTS_CUBEPOINTS) && !function_exists(WPACHIEVEMENTS_MYCRED) ){\r\n if(function_exists('is_multisite') && is_multisite()){\r\n $points = (int)get_blog_option(1, 'wpachievements_score_points');\r\n } else{\r\n $points = (int)get_option('wpachievements_score_points');\r\n }\r\n }\r\n if(empty($points)){$points=0;}\r\n wpachievements_new_activity($type, $uid, $postid, $points);\r\n }\r\n }", "public function getPermitsAwarded()\n {\n if (!$this->isUnderConsideration()) {\n throw new ForbiddenException(\n 'This application is not in the correct state to return permits awarded ('.$this->status->getId().')'\n );\n }\n\n $irhpPermitApplication = $this->getFirstIrhpPermitApplication();\n return $irhpPermitApplication->countPermitsAwarded();\n }", "public function authorize()\n {\n if(!isset($this->action)){\n return false;\n }\n\n if($this->action === \"add\"){\n return Auth::guard('api')->check();\n }else if($this->action === \"update\" || $this->action === \"delete\"){\n if(empty($this->income) || Helper::getStringType($this->income) !== \"integer\"){\n return false;\n }\n\n // not existing or deleted\n if(empty((new Income)->income($this->income))){\n return false;\n }\n\n return Income::canModify(Auth::guard('api')->id(), $this->income) && Auth::guard('api')->check();\n }\n\n return false;\n }", "function wp_aff_check_clickbank_transaction() {\n if (WP_AFFILIATE_ENABLE_CLICKBANK_INTEGRATION == '1') {\n if (isset($_REQUEST['cname']) && isset($_REQUEST['cprice'])) {\n $aff_id = wp_affiliate_get_referrer();\n if (!empty($aff_id)) {\n $sale_amt = strip_tags($_REQUEST['cprice']);\n $txn_id = strip_tags($_REQUEST['cbreceipt']);\n $item_id = strip_tags($_REQUEST['item']);\n $buyer_email = strip_tags($_REQUEST['cemail']);\n $debug_data = \"Commission tracking debug data from ClickBank transaction:\" . $aff_id . \"|\" . $sale_amt . \"|\" . $buyer_email . \"|\" . $txn_id . \"|\" . $item_id;\n wp_affiliate_log_debug($debug_data, true);\n wp_aff_award_commission_unique($aff_id, $sale_amt, $txn_id, $item_id, $buyer_email);\n }\n }\n }\n}", "public function authorize()\n {\n\t\t\n\n \n return false;\n }", "public function authorize()\n { \n //放入購物車時驗證權限 無則發送403\n $v = Auth::user()->verify;\n if(!$v){\n return false;\n }\n return true;\n \n }" ]
[ "0.666877", "0.653318", "0.62010396", "0.6135518", "0.6135518", "0.5928328", "0.5922367", "0.59173685", "0.5827409", "0.5764999", "0.57626355", "0.5760657", "0.5725124", "0.5713842", "0.5713842", "0.5708393", "0.5693649", "0.5667777", "0.56657183", "0.5622624", "0.5610964", "0.5598494", "0.55978847", "0.55621195", "0.55603343", "0.5553471", "0.5494004", "0.5491063", "0.5482641", "0.5471191", "0.54679966", "0.54517823", "0.54372424", "0.54272455", "0.5420933", "0.5414021", "0.54093546", "0.53998756", "0.53997463", "0.53849447", "0.536282", "0.5360401", "0.5319002", "0.53179437", "0.53006935", "0.5294433", "0.52824974", "0.5275184", "0.5273779", "0.5269843", "0.5258933", "0.52527016", "0.5239248", "0.5231658", "0.5223945", "0.5222968", "0.52217025", "0.5215479", "0.5215416", "0.5214076", "0.5211252", "0.5204769", "0.5203845", "0.52016866", "0.5200523", "0.5200255", "0.5193267", "0.5188705", "0.5188457", "0.51837075", "0.51819843", "0.5179308", "0.51760674", "0.51755387", "0.51723933", "0.51684785", "0.5161065", "0.51547414", "0.5150816", "0.5150503", "0.5146562", "0.51403886", "0.5140148", "0.51392376", "0.5133486", "0.5128344", "0.51279026", "0.5124602", "0.51239556", "0.51200306", "0.51176435", "0.51098585", "0.51087755", "0.5103857", "0.5098219", "0.5094511", "0.50832576", "0.5082286", "0.5079643", "0.50786346" ]
0.5936264
5
Log transaction status to log file if enabled
protected function logResult($aResult) { if ((bool)Registry::getConfig()->getShopConfVar('blMollieLogTransactionInfo') === true) { $sMessage = date("Y-m-d h:i:s")." Transaction handled: ".print_r($aResult, true)." \n"; $sLogFilePath = getShopBasePath().'/log/'.$this->sLogFileName; $oLogFile = fopen($sLogFilePath, "a"); if ($oLogFile) { fwrite($oLogFile, $sMessage); fclose($oLogFile); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function logTransaction($text){\n\t$fp = fopen (PAYPAL_LOG_FILE , 'a');\n\tfwrite ($fp, $text . \"\\n\");\n\tfclose ($fp );\n\tchmod (PAYPAL_LOG_FILE , 0600);\n}", "public final function withLog ()\n {\n\n $this->withLog = true;\n\n }", "public function log ($transaction_id, $status, $order_id)\n\t{\n\t\t// See if we should update an existing order or insert a new one.\n\t\t$query = tep_db_query(\"SELECT status FROM \" . self::DB_PAYMENTS_TABLE . \" WHERE payment_id = '\" . tep_db_input($transaction_id) . \"' AND status = 'paid'\");\n\t\t$rows = tep_db_fetch_array($query);\n\n\t\tif ($rows > 0)\n\t\t{\n\t\t\ttep_db_query(\"UPDATE \" . self::DB_PAYMENTS_TABLE . \" SET status = '\" . tep_db_input($status) . \"' WHERE payment_id = '\" . tep_db_input($transaction_id) . \"' AND osc_order_id = '\" . tep_db_input($order_id) . \"'\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttep_db_query(\"INSERT INTO \" . self::DB_PAYMENTS_TABLE . \" (payment_id, status, osc_order_id) VALUES('\" . tep_db_input($transaction_id) . \"', '\" . tep_db_input($status) . \"', '\" . tep_db_input($order_id) . \"')\");\n\t\t}\n\t}", "Public Function logTransaction($Text, $status = 'message', $output = '') {\n\t\tif ($this->debugLogging == true) {\n\t\t\techo \"{$this->ApiName()}\\t$Text\\r\\n\";\n\t\t}\n\t\tif($this->jobId)\n\t\t{\n\t\t $db = $this->DB();\n\t\t $name = mysql_real_escape_string($Text, $db);\n\t\t $output = mysql_real_escape_string($output);\n\t\t $sql = \"INSERT INTO bevomedia_queue_log (description, queueId, status, output) VALUES ('$name', (SELECT id FROM bevomedia_queue WHERE jobId='{$this->jobId}'), '$status', '$output')\";\n mysql_query($sql, $db);\n\t\t} else { // Do filesystem logging\n \t\tif ($this->logFileName === NULL)\n \t\t\t$this->setLogFileName ( $this->temp_dir() . \"/\" . $this->ApiName() . \"_log_\" . time () );\n \t\t@mkdir ( dirname ( $this->LogFileName ), 0777, true );\n \t\t\n \t\t$fp = fopen ( $this->LogFileName, 'a' );\n \t\tfwrite ( $fp, date ( 'r' ) . $Text . \"\\r\\n\" );\n \t\tfclose ( $fp );\n\t\t}\n\t}", "public function isLogEnable() {\n return Mage::getStoreConfigFlag(self::XML_PATH_ENABLE);\n }", "public function isLogEnabled(){\n\n\t\treturn $this->_log_enabled;\n\t}", "protected function writeLog() {\n $messages = func_get_args();\n\n if ($messages[0] === true) {\n array_shift($messages);\n\n if (!self::DEBUG) {\n return false;\n }\n }\n\n if (self::DEBUG) {\n array_unshift($messages, '[' . date('h:i:s') . '] ');\n }\n\n // append output to file (with exclusive lock)\n $filename = $this->tempPath() . self::LOGFILE_STUB;\n if (false === file_put_contents($filename , implode(' ', $messages), FILE_APPEND|LOCK_EX)) {\n echo '<p>Failed appending to log '.$filename.'</p>';\n }\n\n return true;\n }", "abstract public function getTransactionStatus();", "public function trackTransaction() {\n\t\t\n\t\tif ( ! empty( $this->commerce_event ) ) {\n\t\t\t$this->trackEvent( $this->commerce_event );\n\t\t\t$this->commerce_event = '';\n\t\t}\n\t}", "private function log() {\n // Skip the RSS feed because those requests happen too often.\n if (stripos($_SERVER['REQUEST_URI'], '/blocks/homework_diary/feed') === 0) {\n return false;\n }\n\n global $USER;\n $filename = dirname(dirname(__DIR__)) . '/log.txt';\n $file = fopen ($filename, 'a+');\n $line = date('Y-m-d H:i:s')\n . \"\\t\" . $_SERVER['REMOTE_ADDR']\n . \"\\t\" . $_SERVER['HTTP_X_FORWARDED_FOR']\n . \"\\t\" . $_SERVER['HTTP_USER_AGENT']\n . \"\\t\" . ($USER ? $USER->id : '')\n . \"\\t\" . $_SERVER['REQUEST_URI']\n . \"\\t\" . var_export($_GET, true)\n . \"\\t\" . var_export($_POST, true) . PHP_EOL;\n fwrite($file, $line);\n fclose($file);\n return true;\n }", "public function isLoggingForced() {\n return Mage::getStoreConfigFlag(static::XML_PATH_FORCE_LOG);\n }", "public function enableLogging() {\n $this->debug = true;\n }", "public function _transaction_status_check()\n {\n if (!$this->_transaction_in_progress) {\n return;\n }\n $this->rollback();\n }", "public function logStatus($status = null)\n {\n if (is_null($status)) {\n $status = $this->status;\n } else {\n $this->status = $status;\n $this->save();\n }\n\n $this->logs()->create(['status' => $status]);\n }", "public function setActivityLogging($status){\n $this->enableActivityLogging = (bool) $status;\n }", "public function isInTransaction()\n {\n return $this->_getWriteAdapter()->getTransactionLevel() > 0;\n }", "public function log() {\r\n\t\t$this->resource->log();\r\n\t}", "public function status()\n {\n if (!$this->config->get('onego_status') || !$this->user->hasPermission('modify', 'sale/order')) {\n $this->response->setOutput('');\n return;\n }\n \n $this->language->load('total/onego');\n \n $orderId = (int) $this->request->get['order_id'];\n $operations = OneGoTransactionsLog::getListForOrder($orderId);\n foreach ($operations as $row) {\n if ($row['success'] && empty($statusSuccess)) {\n $statusSuccess = $row;\n break;\n } else if (!$row['success'] && empty($statusFailure)) {\n $statusFailure = $row;\n }\n }\n if (!empty($statusSuccess)) {\n if ($statusSuccess['operation'] == OneGoSDK_DTO_TransactionEndDto::STATUS_DELAY) {\n // delayed transaction\n $expiresOn = strtotime($statusSuccess['inserted_on']) + $statusSuccess['expires_in'];\n if ($expiresOn <= time()) {\n // transaction expired\n $this->data['onego_status_success'] = sprintf(\n $this->language->get('transaction_status_expired'), date('Y-m-d H:i:s', $expiresOn));\n } else {\n // transaction delayed\n $this->data['onego_status_success'] = sprintf(\n $this->language->get('transaction_status_delayed'), \n date('Y-m-d H:i', strtotime($statusSuccess['inserted_on'])),\n date('Y-m-d H:i:s', $expiresOn));\n \n // enable transaction completion actions\n $this->data['onego_allow_status_change'] = true;\n $confirmStatuses = OneGoConfig::getArray('confirmOnOrderStatus');\n $cancelStatuses = OneGoConfig::getArray('cancelOnOrderStatus');\n $this->data['confirm_statuses'] = $confirmStatuses;\n $this->data['cancel_statuses'] = $cancelStatuses;\n $this->data['onego_btn_confirm'] = $this->language->get('button_confirm_transaction');\n $this->data['onego_btn_cancel'] = $this->language->get('button_cancel_transaction');\n $this->data['onego_btn_delay'] = $this->language->get('button_delay_transaction');\n\n }\n } else {\n $this->data['onego_status_success'] = sprintf(\n $this->language->get('transaction_status_'.strtolower($statusSuccess['operation'])),\n date('Y-m-d H:i', strtotime($statusSuccess['inserted_on'])));\n }\n } \n if (!empty($statusFailure)) {\n $this->data['onego_status_failure'] = sprintf(\n $this->language->get('transaction_operation_failed'),\n date('Y-m-d H:i', strtotime($statusFailure['inserted_on'])),\n $statusFailure['operation'],\n $statusFailure['error_message']);\n } else if (empty($statusSuccess)) {\n $this->data['onego_status_undefined'] = $this->language->get('transaction_status_undefined');\n }\n $this->data['onego_status'] = $this->language->get('onego_status');\n $this->data['order_id'] = $orderId;\n $this->data['token'] = $this->session->data['token'];\n\n $this->data['confirm_confirm'] = $this->language->get('confirm_transaction_confirm');\n $this->data['confirm_cancel'] = $this->language->get('confirm_transaction_cancel');\n $this->data['delay_periods'] = $this->language->get('delay_period');\n $this->data['delay_for_period'] = $this->language->get('delay_for_period');\n $this->data['confirm_delay'] = $this->language->get('confirm_transaction_delay');\n $this->data['status_will_confirm'] = $this->language->get('transaction_will_confirm');\n $this->data['status_will_cancel'] = $this->language->get('transaction_will_cancel');\n \n $this->template = 'total/onego_status.tpl';\n $this->response->setOutput($this->render());\n }", "public static function transactionLevel()\n {\n }", "protected function SwitchLoggingState()\n {\n $migrationRecorderStateHandler = $this->getMigrationRecorderStateHandler();\n $isActive = $migrationRecorderStateHandler->isDatabaseLoggingActive();\n try {\n $migrationRecorderStateHandler->toggleDatabaseLogging();\n $isActive = $migrationRecorderStateHandler->isDatabaseLoggingActive();\n $toasterMessage = true === $isActive\n ? 'chameleon_system_core.cms_module_header.migration_recording_activated'\n : 'chameleon_system_core.cms_module_header.migration_recording_deactivated';\n } catch (AccessDeniedException $e) {\n $toasterMessage = 'chameleon_system_core.error.access_denied';\n }\n\n $toasterMessage = $this->getTranslator()->trans($toasterMessage);\n\n return json_encode([\n 'enabled' => $isActive,\n 'toasterMessage' => $toasterMessage,\n ]);\n }", "public static function twispay_tw_logTransaction( $data ) {\n global $wpdb;\n\n /* Extract the WooCommerce order. */\n $order = wc_get_order($data['id_cart']);\n\n $already = $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM \" . $wpdb->prefix . \"twispay_tw_transactions WHERE transactionId = '%s'\", $data['transactionId']) );\n if ( $already ) {\n /* Update the DB with the transaction data. */\n $wpdb->query( $wpdb->prepare( \"UPDATE \" . $wpdb->prefix . \"twispay_tw_transactions SET status = '%s' WHERE transactionId = '%d'\", $data['status'], $data['transactionId'] ) );\n } else {\n\n $checkout_url = ((false !== $order) && (true !== $order)) ? ( esc_url( wc_get_checkout_url() . 'order-pay/' . explode('_', $data['id_cart'])[0] . '/?pay_for_order=true&key=' . $order->get_data()['order_key']) ) : (\"\");\n\n $wpdb->get_results( $wpdb->prepare( \"INSERT INTO `\" . $wpdb->prefix . \"twispay_tw_transactions` (`status`, `id_cart`, `identifier`, `orderId`, `transactionId`, `customerId`, `cardId`, `checkout_url`) VALUES ('%s', '%s', '%s', '%d', '%d', '%d', '%d', '%s');\", $data['status'], $data['id_cart'], $data['identifier'], $data['orderId'], $data['transactionId'], $data['customerId'], $data['cardId'], $checkout_url ) );\n }\n }", "private function log($text){\r\n if ($this->debug){\r\n $fp = fopen('logs/BRUnit_output.txt','a');\r\n fwrite($fp, date('l jS \\of F Y h:i:s A'). ': ' . $text.\"\\n\");\r\n fclose($fp);\r\n }\r\n }", "public function store_tag_status() {\n $app = $this->app;\n $log_id = $app->request->post(\"log_id\");\n $tag_id = $app->request->post(\"tag_id\");\n $srv = new LogService($this->getEntityManager(), $app, $this->getUser());\n $srv->store_new_tag_status($log_id, $tag_id);\n }", "function upgrade_log_start() {\n global $CFG, $upgradeloghandle;\n\n if (!empty($_SESSION['upgraderunning'])) {\n return; // logging already started\n }\n\n @ignore_user_abort(true); // ignore if user stops or otherwise aborts page loading\n $_SESSION['upgraderunning'] = 1; // set upgrade indicator\n if (empty($CFG->dbsessions)) { // workaround for bug in adodb, db session can not be restarted\n session_write_close(); // from now on user can reload page - will be displayed warning\n }\n make_upload_directory('upgradelogs');\n ob_start('upgrade_log_callback', 2); // function for logging to disk; flush each line of text ASAP\n register_shutdown_function('upgrade_log_finish'); // in case somebody forgets to stop logging\n}", "public function getTxStatus()\n {\n return $this->tx_status;\n }", "public function fileLogActive() {\n\t\treturn isset($this->loggers['file']);\n\t}", "private function _log($text) {\n $date = date('d-m-Y H:i:s');\n $message = \"[{$date}]: $text \\n\";\n\n file_put_contents($this->_logFile, $message, FILE_APPEND);\n return true;\n }", "function write_log($msg) {\n global $transaction_ID;\n $todays_date = date(\"Y-m-d H:i:s\");\n $file = fopen(\"process.log\",\"a\");\n fputs($file,$todays_date. \" [\".$transaction_ID.\"] \". $msg.\"\\n\");\n fclose($file);\n}", "protected function _logTraffic() {\n if ('testing' !== APPLICATION_ENV) {\n $lastRequest = $this->_client->getLastRequest();\n $lastResponse = $this->_client->getLastResponse();\n $filename = date('Y-m-d') . '-gofilex.log';\n $logMessage = \"\\n\";\n $logMessage .= '[REQUEST]' . \"\\n\";\n $logMessage .= $lastRequest . \"\\n\\n\";\n $logMessage .= '[RESPONSE]' . \"\\n\";\n $logMessage .= $lastResponse . \"\\n\\n\";\n\n $logger = Garp_Log::factory($filename);\n $logger->log($logMessage, Garp_Log::INFO);\n }\n }", "protected function _updateStatus()\n {\n $this->_writeStatusFile(\n array(\n 'time' => time(),\n 'done' => ($this->_currentItemCount == $this->_totalFeedItems),\n 'count' => $this->_currentItemCount,\n 'total' => $this->_totalFeedItems,\n 'message' => \"Importing content. Item \" . $this->_currentItemCount\n . \" of \" . $this->_totalFeedItems . \".\"\n )\n );\n }", "public function transaction(): bool {\n\t\t$this->transactionCounter++;\n\n\t\tif ($this->transactionCounter === 1) {\n\t\t\treturn \\Covex\\Stream\\FileSystem::register($this->protocolName, $this->baseDir);\n\t\t}\n\n\t\treturn $this->transactionCounter >= 0;\n\t}", "function logit($func, $arr=array()) \n\t{\n\t\tif(!isset($this->pth)||empty($this->pth)){\n\t\t\t$cfg = Mage::getConfig();\n\t\t\t$this->pth = $cfg->getBaseDir();\n\t\t}\n\t\t$f = $this->pth . '/magento_log.txt';\n\t\t\n\t\t// If, debug mode is off or module is live then, truncate & delete the file\n\t\tif (!$this->getConfigData('debug') || !$this->getConfigData('test')) {\n\t\t\tif (file_exists($f)) {\n\t\t\t\t$FH = @fopen($f, \"w\");\n\t\t\t\tfclose($FH);\n\t\t\t\t@unlink($f);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\n\t\t// do not log in live mode\n\t\tif (!$this->getConfigData('test')) return;\n\t\t\n\t\tif (!is_writable($f)) return;\n\t\t\n\t\t$a = '';\n\t\tif(count($arr)>0) $a = var_export($arr,true);\n\t\t\n\t\t// card details should never be stored anywhere not even in the logs\n\t\t$cleanCard = \"<creditcard>\n\t\t\t\t\t\t<cardnumber>xxxxxxxxxxxxxxxx</cardnumber>\n\t\t\t\t\t\t<cardexpmonth>xx</cardexpmonth>\n\t\t\t\t\t\t<cardexpyear>xx</cardexpyear>\n\t\t\t\t\t\t<cvmvalue>xxx</cvmvalue>\n\t\t\t\t\t\t<cvmindicator>provided</cvmindicator>\n\t\t\t\t\t</creditcard>\";\n\t\t$a = preg_replace('/<creditcard>(.*)<\\/creditcard>/smUi', $cleanCard, $a);\n\t\t@file_put_contents($f , '----- Inside ' . $func . ' =1= ' . date('d/M/Y H:i:s') . ' -----' . \"\\n\" . $a, FILE_APPEND);\n\t}", "public function enableLog(bool $enable) : void\n {\n Util::$enableLog = $enable;\n }", "public function setIsTransaction($status)\n {\n $this->isTransaction = $status;\n }", "public static function updateStatus($status) {\n $status = strtoupper($status);\n if($status == 'UP' || $status == 'DOWN') {\n $newRecord = strtoupper($status) .','. time() . PHP_EOL;\n $insertNewRecord = file_put_contents(self::LOG_FILE, $newRecord, FILE_APPEND|LOCK_EX);\n $insertNewRecord == true ? $statusMessage = 'success'.PHP_EOL : $statusMessage = 'error'.PHP_EOL;\n return $statusMessage;\n }\n else { return 'error'.PHP_EOL; }\n }", "public function getTransactionLog()\n {\n if($this->transactionLog==null)\n {\n $this->transactionLog = new TransactionLog();\n }\n return $this->transactionLog;\n }", "function create_run_log() {\n\n\t\t$this->log = new Log();\n\t\t$this->log->set_workflow_id( $this->get_id() );\n\t\t$this->log->set_date( new DateTime() );\n\n\t\tif ( $this->is_tracking_enabled() ) {\n\t\t\t$this->log->set_tracking_enabled( true );\n\n\t\t\tif ( $this->is_conversion_tracking_enabled() ) {\n\t\t\t\t$this->log->set_conversion_tracking_enabled( true );\n\t\t\t}\n\t\t}\n\n\t\t$this->log->save();\n\t\t$this->log->store_data_layer( $this->data_layer() );\n\n\t\tdo_action( 'automatewoo_create_run_log', $this->log, $this );\n\t}", "public function printTSlog() {}", "public function printTSlog() {}", "public function isTransactionActive()\n {\n return $this->conn->isTransactionActive();\n }", "private function writeToLog($status, $tag, $message)\n {\n if ($this->log_status == \"ALL\" || $this->log_status == $status)\n {\n $date = date('[Y-m-d H:i:s]');\n $msg = \"$date: [$tag][$status] - $message\" . PHP_EOL;\n file_put_contents($this->log_file, $msg, FILE_APPEND);\n }\n }", "public function transaction(): bool\r\n {\r\n return $this->instance->inTransaction() === true;\r\n }", "public function logCallback($transaction)\n {\n $this->logger->debug(\n print_r($this->filterDebugData($this->toArray($transaction)), true),\n array('source' => $this->plugin->id. '-' . self::CALLBACK)\n );\n }", "public function isNeedLog($flag) {\n $this->isNeedLog = $flag;\n }", "function atkWriteLog($text)\n{\n\tif (atkconfig(\"debug\") > 0 && atkconfig(\"debuglog\"))\n\t{\n\t\tatkWriteToFile($text, atkconfig(\"debuglog\"));\n\t}\n}", "function logger($path, $status, $message) {\n $logMsg = \"[\" . timestamp() . \"] : \" . $status . \" : \" . $message . \"\\n\";\n file_put_contents($path, $logMsg, FILE_APPEND | LOCK_EX);\n}", "public function enableLogging($path) {\n\t\t$this->_logger = new Zend_Log(new Zend_Log_Writer_Stream($path.'simpleDb.log'));\n\t}", "public function grabLog(){\n $logDir = Mage::getBaseDir('log') . DS;\n\n // archived directory where we will move them after storing on db\n\t\t$archivedDir = $logDir . $this->_archived . DS;\n\n // create archived directory if not exists\n Mage::getConfig()->getOptions()->createDirIfNotExists($archivedDir);\n\n foreach (glob($logDir . \"*\" . $this->_ext) as $file) {\n // get filename without extension\n $filename = basename($file, $this->_ext);\n\n // check if the file is in allowed list to store on db\n if(!in_array($filename, $this->_allowed_files)){\n continue;\n }\n\n // rename the file before moving to archive directory\n $filename_new = $filename . '-' . time() . $this->_ext;\n\n // get file contents\n $content = file_get_contents($file);\n $content = preg_replace('/^.*(?:DEBUG).*$/m', \"\\n\", $content);\n $content = preg_replace('#[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\+[0-9]{2}:[0-9]{2}#iU', \"\\n\", $content);\n $content = explode(\"\\n\",$content);\n $content = array_map('trim',$content);\n $content = implode(\"\\n\", array_unique($content)) . \"\\n Check log file at ({$archivedDir}) on server for full information\";\n\n // prepare data to save\n $data = array(\n 'title' => $filename . 'log',\n 'last_time' => date('Y-m-d h:i:s', time()),\n 'error' => $content,\n 'file' => $this->_archived . DS . $filename_new,\n );\n\n $model = Mage::getModel('tlog/log')->load(0);\n $model->setData($data);\n $model->save();\n\n // move to archive folder\n rename($file, $archivedDir . $filename_new);\n\n $this->send(array('file' => $archivedDir . $filename_new));\n }\n return true;\n\t}", "public static function log_save()\n {\n if (empty(self::$log) or self::$configuration['core']['log_threshold'] < 1) {\n return;\n }\n\n // Filename of the log\n $filename = self::log_directory().date('Y-m-d').'.log'.EXT;\n\n if (! is_file($filename)) {\n // Write the SYSPATH checking header\n file_put_contents($filename,\n '<?php defined(\\'SYSPATH\\') or die(\\'No direct script access.\\'); ?>'.PHP_EOL.PHP_EOL);\n\n // Prevent external writes\n chmod($filename, 0644);\n }\n\n // Messages to write\n $messages = array();\n\n do {\n // Load the next mess\n list($date, $type, $text) = array_shift(self::$log);\n\n // Add a new message line\n $messages[] = $date.' --- '.$type.': '.$text;\n } while (! empty(self::$log));\n\n // Write messages to log file\n file_put_contents($filename, implode(PHP_EOL, $messages).PHP_EOL, FILE_APPEND);\n }", "public function beginTransaction()\n {\n $ret = (bool)$this->PDO->beginTransaction();\n $ret == false && MyErrorHandler::exceptionLogger('beginTransaction() error', fileName);\n return (bool)$ret;\n }", "public function isTransaction()\n {\n return $this->_isTransaction;\n }", "function db_log ($username,$domain,$action,$data)\n{\n global $CONF;\n \n if ($CONF['logging'] == 'YES')\n {\n $result = db_query (\"INSERT INTO log (timestamp,username,domain,action,data) VALUES (NOW(),'$username','$domain','$action','$data')\");\n if ($result['rows'] != 1)\n {\n return false;\n }\n else\n {\n return true;\n }\n }\n}", "public function isTransaction(): bool\n {\n return $this->inTransaction();\n }", "public function log($content){\n \t\ttry{\n \t\t\t$resp = file_put_contents($this->logFileName, date('Y-m-d H:i:s').$content.\"\\n\", FILE_APPEND);\n \t\t\tif($resp){\n \t\t\t\treturn true;\n \t\t\t} else {\n \t\t\t\terror_log(\"UNBXD_MODULE:Error while appending the contents to log file\");\n \t\t\t\treturn false;\n \t\t\t}\n \t\t\treturn true;\n \t\t}catch(Exception $ex) {\n \t\t\terror_log(\"UNBXD_MODULE:Error while appending the contents to log file\");\n \t\t\tMage::throwException($ex->getMessage());\n \t\t\treturn false;\n \t\t}\n \t}", "public function isLoggingEnabled()\n {\n return (bool) $this->getSetting( 'LoggingEnabled' );\n }", "public function logging_enabled() {\n\n\t\t$this->logging_enabled = ( 'yes' === get_option( 'wc_avatax_debug' ) );\n\n\t\t/**\n\t\t * Filter whether debug logging is enabled.\n\t\t *\n\t\t * @since 1.0.0\n\t\t * @param bool $logging_enabled Whether debug logging is enabled.\n\t\t */\n\t\treturn apply_filters( 'wc_avatax_logging_enabled', $this->logging_enabled );\n\t}", "public function logIndividualTransaction( $paymentLogObj, $txStatus, $type, $array )\n {\n //foreach ( $this->txClasses as $type => $array ){\n $level = $type. 'Level';\n $typekey = strtolower($type);\n foreach( $array as $id => $typeObject ){\n $levelObj = new $level();\n \n // common logs\n $this->payment_type_log['payment_log_id'] = $paymentLogObj->getString('id');\n $this->payment_type_log[ $typekey.'_id'] = $id;\n $this->payment_type_log[ $typekey.'_title'] = $typeObject->getString('title');\n $this->payment_type_log['discount_id'] = $typeObject->getString('discount_id');\n $this->payment_type_log['amount'] = $typeObject->getPrice();\n $this->payment_type_log['renewal_date'] = $txStatus ? $typeObject->getNextRenewalDate() : $typeObject->getString('renewal_date');\n $this->payment_type_log['level'] = $typeObject->getString('level');\n $this->payment_type_log['level_label'] = $levelObj->showLevel($typeObject->getString('level'));\n \n /**\n ** @ Discount code modification for Duration Type : Store in log\n */ \n\n $discountCodeObj = new DiscountCode($typeObject->getString('discount_id'));\n \n if(($discountCodeObj->type ==\"duration\") && ($discountCodeObj->status == \"A\") && $discountCodeObj->expire_date >= date('Y-m-d')){\n $amont = intval($discountCodeObj->amount);\n \n function mth($date_str, $months)\n {\n $date = new Datetime($date_str);\n $start_day = $date->format('j');\n\n $date->modify(\"+{$months} month\");\n $end_day = $date->format('j');\n\n if ($start_day != $end_day)\n $date->modify('last day of last month');\n\n return $date;\n }\n \n $amont = $amont + 12; //Add One Year\n\n $result = mth($typeObject->getString('renewal_date'), $amont);\n\n if ($typeObject->renewal_date == '0000-00-00'){\n $today = date(\"Y-m-d\");\n $result = mth($today, $amont);\n }\n\n \n $result = (array) $result;\n $d = $result['date'];\n $d = explode(\" \", $d);\n \n $this->payment_type_log['renewal_date'] = $d[0]; \n }\n\n\n // different logs\n $this->logForSeparateTypes( $typeObject, $levelObj, $typekey );\n \n $loggerName = 'Payment'.$type.'Log';\n $loggerObj = new $loggerName( $this->payment_type_log );\n // just to confirm.. not so necessary\n if ( $this->payment_type_log['payment_log_id'] ) {\n $loggerObj->save();\n }\n }\n //}\n }", "function log_result($word) {\n\t$fp = fopen(\"./log.txt\",\"a\");\t\n\tflock($fp, LOCK_EX) ;\n\tfwrite($fp,$word.\":执行日期:\".strftime(\"%Y%m%d%H%I%S\",time()).\"\\t\\n\");\n\tflock($fp, LOCK_UN); \n\tfclose($fp);\n}", "public function enableRequestLog()\n {\n $this->loggingRequests = true;\n }", "protected function _debug()\n {\n $file = self::DEFAULT_LOG_FILE;\n Mage::getModel('core/log_adapter', $file)->log($this->_debugData);\n }", "public function write()\n {\n echo 'file log write...';\n }", "function transaction_check(){\n }", "public function isTransactionActive()\n {\n return $this->transactionNestingLevel > 0;\n }", "public function hasTransactions();", "function write_debug () {\n /*\necho $this->log_debug;\n\n $fp = fopen (\"backup/debug/battle\".$this->user['battle'].\".txt\",\"a\"); //открытие\n flock ($fp,LOCK_EX); //БЛОКИРОВКА ФАЙЛА\n fputs($fp , $this->log_debug) ; //работа с файлом\n fflush ($fp); //ОЧИЩЕНИЕ ФАЙЛОВОГО БУФЕРА И ЗАПИСЬ В ФАЙЛ\n flock ($fp,LOCK_UN); //СНЯТИЕ БЛОКИРОВКИ\n fclose ($fp); //закрытие\n $this->log_debug = '';\n */\n\n//die();\n }", "public function getTransactionStatus(TransactionEntity $transaction);", "protected function _WritePendingExportLogs()\n\t{\n\t\tif(count($this->_exportErrors) == 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tforeach($this->_exportErrors as $module => $typeLog) {\n\t\t\tforeach($typeLog as $type => $log) {\n\t\t\t\t$query = sprintf(\"insert into [|PREFIX|]export_session (type,module,log,data) values ('log','%s','%s','%s')\", $GLOBALS['ISC_CLASS_DB']->Quote($module), $GLOBALS['ISC_CLASS_DB']->Quote($type), $GLOBALS['ISC_CLASS_DB']->Quote($log));\n\t\t\t\t$GLOBALS['ISC_CLASS_DB']->Query($query);\n\t\t\t}\n\t\t}\n\t}", "public function _log($text)\n {\n if (!Mage::getStoreConfigFlag('simple_relevance/general/debug')) {\n return; // if the debug flag is false in the config, do nothing\n }\n\n Mage::log($text, null, 'SimpleRelevance_Integration.log');\n }", "function log_connection() {\r\n $USE_FILE = FALSE;\r\n\r\n if ($USE_FILE === TRUE) {\r\n _conn_log_file();\r\n } else {\r\n _conn_log_db();\r\n }\r\n}", "public function getUseTransactionFlag()\n\t\t{\n\t\t\treturn $this->use_transaction;\n\t\t}", "public function setLog($value = false) {\n $this->config[\"log\"] = $value;\n return true;\n }", "public function logTrace()\n {\n $output = new Output(Output::MODE_FILE, $this->getLogPath());\n $output->open();\n \\DebugHelper::dump()->showtrace($output);\n $output->close();\n }", "public function write_log($operation, $info_to_log){}", "function frl_perform_update(){\n\n\t$task_for_out = frl_get_tasks();\n\t$log_for_out = frl_get_log();\n\t$log_queue = frl_get_log_queue();\n\n\t$step = count($log_for_out);\n\tif($step > $log_queue){\n\t\tfrl_perform_reset();\n\t\treturn;\n\t}\n\n\t//add action into log\n\t$new_line = $log_queue[$step]; \n\tarray_unshift($log_for_out, $new_line);\n\n\t$file = dirname(__FILE__).'/data/log-out.csv'; \n $csv_handler = fopen($file,'w');\n foreach ($log_for_out as $l) {\n \tfputcsv($csv_handler, $l, \",\");\n }\n fclose($csv_handler);\n\n //change status of task\n if($new_line[2] == 'Запрос уточнения'){\n \t//change status to Ждет уточнения\n \t$task_for_out = frl_change_task_status($task_for_out, $new_line[4], 'Ждет уточнения');\n }\n\n if($new_line[2] == 'Отклик на задачу'){\n \t//change status to Подтверждено\n \t$task_for_out = frl_change_task_status($task_for_out, $new_line[4], 'Подтверждено');\n }\n\n $file = dirname(__FILE__).'/data/tasks-out.csv';\n $csv_handler = fopen($file,'w');\n foreach ($task_for_out as $t) {\n \tfputcsv($csv_handler, $t, \",\");\n }\n fclose($csv_handler);\n\n}", "public function inTransaction(): bool;", "public function logStatus()\n {\n //piece to handle the login/logout\n $u = $this->isAuth();\n $lstr = ($u) ? '<a href=\"/user/main\">' . $u .\n '</a> <a href=\"/user/logout\">[logout]</a>' :\n '<a href=\"/user/login\">login</a>';\n $this->template->write('logged', $lstr);\n }", "public function transactional();", "public function onTP_Storelog($data)\n\t{\n\t\t$log_write = $this->params->get('log_write', '0');\n\n\t\tif ($log_write == 1)\n\t\t{\n\t\t\t$plgPaymentAuthorizenetHelper = new plgPaymentAuthorizenetHelper;\n\t\t\t$log = $plgPaymentAuthorizenetHelper->Storelog($this->_name, $data);\n\t\t}\n\t}", "private function send_log() {\n MessageLogger::add_log($this->log);\n $this->log = \"\";\n }", "public function store() {\n $logData = \"=========================================\\n\";\n $logData .= \"Date Time: \".$this->record_date.\"\\n\";\n $logData .= $this->title.\" (\".$this->type.\") \\n\";\n if(!empty($this->data)) {\n $logData .= var_export($this->data, true).\"\\n\";\n }\n \n file_put_contents($this->file, $logData, FILE_APPEND);\n \n }", "public function log($msg)\n {\n $this->file->filePutContents($this->logFile, $this->config->x_shop_name.\" \".date('c').\" \".var_export($msg, true).\"\\n\", FILE_APPEND | LOCK_EX);\n }", "private function record_transaction( $details ) {\n\n\t\tglobal $wpdb;\n\n\t\t$sql_cols = \"user_id, timestamp, \";\n\t\t$sql_vals = \"'\" . $details['custom'] . \"','\" . current_time( 'mysql' ) . \"',\";\n\t\t$txn_cols = $this->record_transaction_columns();\n\t\tforeach ( $txn_cols as $column ) {\n\t\t\tif ( isset( $details[ $column ] ) ) {\n\t\t\t\t$sql_cols.= $column . \",\";\n\t\t\t\t$sql_vals.= \"'\" . $details[ $column ] . \"',\";\n\t\t\t}\n\t\t}\n\t\t$sql = \"INSERT INTO \" . $wpdb->prefix . $this->transaction_table . \" ( \" . rtrim( $sql_cols, ',' ) . \" ) VALUES ( \" . rtrim( $sql_vals, ',' ) . \" )\";\n\t\t\n\t\t$result = $wpdb->query( $sql );\n\t\t\n\t\treturn;\n\t}", "public function testLoggerFileLog()\n {\n $logger = $this->getMockBuilder('Cake\\Log\\Engine\\FileLog')->setMethods(['log'])->getMock();\n\n $message = json_encode([\n 'method' => 'GET',\n 'path' => '_stats',\n 'data' => []\n ], JSON_PRETTY_PRINT);\n\n $logger->expects($this->once())->method('log')->with(\n $this->equalTo('debug'),\n $this->equalTo($message)\n );\n\n Log::setConfig('elasticsearch', $logger);\n\n $connection = ConnectionManager::get('test');\n $connection->logQueries(true);\n $result = $connection->request('_stats');\n $connection->logQueries(false);\n\n $this->assertNotEmpty($result);\n }", "private function writelog() {\r\n\r\n $dir = APP_PATH . 'tmp/log';\r\n //IF 'tmp/log' is file, delete it.\r\n if (is_file($dir)) {\r\n unlink(APP_PATH . 'tmp/log');\r\n }\r\n //IF 'tmp/log' is not exists, create it as folder.\r\n if (!dir_exists($dir)) {\r\n __mkdirs(APP_PATH . 'tmp/log');\r\n }\r\n //IF 'tmp/log' is exists as folder, the create logs under it.\r\n if (dir_exists($dir) && is_dir($dir)) {\r\n $date = date(\"Y-m-d H:i:s\", time());\r\n $arr = array('-', ':');\r\n $date = trim(str_replace($arr, '', $date));\r\n $cnt = $this->spArgs('msg');\r\n $str = $date . '\\t' . $cnt;\r\n file_put_contents(APP_PATH . 'tmp/log/log_' . $date . '.log', $str, FILE_APPEND);\r\n }\r\n return TRUE;\r\n }", "public function transactionLevel();", "public function isLoggingEnabled()\n {\n return $this->getConfigValue(self::XML_PATH . 'logging/enable') ? true : false;\n }", "public function isTransactionEnabled()\n {\n return $this->getRepository() instanceof TransactionAwareInterface;\n }", "public function getTransactionStatus() \n {\n return $this->_fields['TransactionStatus']['FieldValue'];\n }", "public function getTransactionStatus() \n {\n return $this->_fields['TransactionStatus']['FieldValue'];\n }", "public function isInTransaction();", "public function testSetLogger() {\n $file_name = getLogFileName();\n $message = 'The sky is the daily bread of the eyes.';\n setOutputDestination($file_name);\n Terminus::getLogger()->debug($message);\n $output = retrieveOutput($file_name);\n $this->assertFalse(strpos($output, $message) !== false);\n Terminus::setLogger(['debug' => true, 'format' => 'json']);\n Terminus::getLogger()->debug($message);\n $output = retrieveOutput($file_name);\n $this->assertTrue(strpos($output, $message) !== false);\n resetOutputDestination($file_name);\n }", "public function beginTransaction(): bool\n {\n ($this->currentTransactionLevel == 0)\n ? parent::beginTransaction()\n : $this->exec(\"SAVEPOINT LEVEL$this->currentTransactionLevel\");\n ++$this->currentTransactionLevel;\n return true;\n }", "private function transactionStatus(){\n $data = [\n 'Initiator' => ' ',\n 'SecurityCredential' => ' ',\n 'CommandID' => 'TransactionStatusQuery',\n 'TransactionID' => ' ',\n 'PartyA' => ' ',\n 'IdentifierType' => '1',\n 'QueueTimeOutURL' => $this->apiBaseUrl.'/mobilepay/tran_status/time_out',\n 'ResultURL' => $this->apiBaseUrl.'/mobilepay/tran_status/result',\n 'Remarks' => ' ',\n 'Occasion' => ' '\n ];\n return $this->remotePostCall('mpesa/transactionstatus/v1/query', $data);\n }", "public function supports_transaction_status_query()\n\t\t{\n\t\t\treturn true;\n\t\t}", "public function testRollbarLoggerEnabled(): void\n {\n Rollbar::init([\n 'access_token' => $this->getTestAccessToken(),\n 'environment' => 'testing-php',\n \"enabled\" => true,\n 'verbose_logger' => $this->verboseLogger,\n ]);\n\n Rollbar::log(Level::WARNING, \"Testing PHP Notifier\");\n\n $this->assertVerboseLogsConsecutive(\n ['level' => LogLevel::INFO, 'messageRegEx' => 'Attempting to log: \\[warning\\] Testing PHP Notifier'],\n ['level' => LogLevel::INFO, 'messageRegEx' => 'Occurrence'],\n );\n }", "protected function createLogFile() {}", "protected function log() {\n }", "public function transactionStart()\n\t{\n\t\treturn;\n\t}", "public function updateCitizenIncomeGainLogLog($transaction_id,$status,$country_citizen_distribute_amount,$friend_follower_distribute_amount,$citizen_affiliator_amount,$store_affiliation_amount,$purchaser_distribute_amount,$sixthcontinent_amount,$amount,$user_id,$store_id,$discount_amount,$total_amount,$count,$cron_status,$job_status) {\n \n /** get entity manager object **/\n \n $this->container->get('doctrine')->resetEntityManager();\n /** reset the EM and all aias **/\n $this->container->set('doctrine.orm.entity_manager', null);\n $this->container->set('doctrine.orm.default_entity_manager', null);\n /** get a fresh EM **/\n $this->entityManager = $this->container->get('doctrine')->getEntityManager(); \n \n $em = $this->getDoctrine()->getManager();\n $time = new \\DateTime(\"now\");\n \n $citizen_income_log_check = $em\n ->getRepository('PaymentPaymentDistributionBundle:CitizenIncomeGainLog')\n ->findOneBy(array('transactionId' => (string)$transaction_id));\n if(count($citizen_income_log_check) > 0) {\n $citizen_income_log_check->setStatus($status);\n $citizen_income_log_check->setJobStatus($job_status);\n $citizen_income_log_check->setUpdatedAt($time);\n /** persist the store object **/\n $em->persist($citizen_income_log_check);\n /** save the store info **/\n $em->flush();\n }else {\n $citizen_income_log = new CitizenIncomeGainLog();\n /** set CitizenIncomeGainLog fields **/ \n $citizen_income_log->setTransactionId($transaction_id);\n $citizen_income_log->setCitizenAffiliateAmount($citizen_affiliator_amount);\n $citizen_income_log->setShopAffiliateAmount($store_affiliation_amount);\n $citizen_income_log->setFriendsFollowerAmount($friend_follower_distribute_amount);\n $citizen_income_log->setPurchaserUserAmount($purchaser_distribute_amount);\n $citizen_income_log->setCountryCitizenAmount($country_citizen_distribute_amount);\n $citizen_income_log->setSixthcontinentAmount($sixthcontinent_amount);\n $citizen_income_log->setTotalAmount($total_amount);\n $citizen_income_log->setDistributedAmount($amount);\n $citizen_income_log->setDiscountAmount($discount_amount);\n $citizen_income_log->setUserId($user_id);\n $citizen_income_log->setShopId($store_id);\n $citizen_income_log->setCitizenCount($count);\n $citizen_income_log->setCronStatus($cron_status);\n $citizen_income_log->setStatus($status);\n $citizen_income_log->setCreatedAt($time);\n $citizen_income_log->setUpdatedAt($time);\n $citizen_income_log->setApprovedAt($time);\n $citizen_income_log->setJobStatus($job_status);\n /** persist the store object **/\n $em->persist($citizen_income_log);\n /** save the store info **/\n $em->flush();\n } \n \n return true;\n }", "public function testLogQuery()\n {\n $logFile = 'arc_query_log.txt';\n\n $this->assertFalse(file_exists($logFile));\n\n $this->fixture->logQuery('query1');\n\n $this->assertTrue(file_exists($logFile));\n unlink($logFile);\n }" ]
[ "0.5941456", "0.5879254", "0.5803468", "0.56015104", "0.5590931", "0.5580433", "0.55592716", "0.5541566", "0.5515048", "0.5503192", "0.5459863", "0.5445838", "0.5442169", "0.5423118", "0.540655", "0.53847724", "0.5373138", "0.53659827", "0.53584564", "0.53444844", "0.53341764", "0.53217536", "0.5309757", "0.5294441", "0.5285667", "0.5235904", "0.52169466", "0.5211113", "0.5203256", "0.5188006", "0.51876926", "0.518741", "0.516124", "0.5156012", "0.5128564", "0.51119524", "0.5103944", "0.51019853", "0.51019853", "0.5097245", "0.5081511", "0.5060911", "0.50518394", "0.5049843", "0.5047161", "0.50452626", "0.5039289", "0.50342095", "0.50329465", "0.5027387", "0.5024833", "0.5014887", "0.50022364", "0.5002116", "0.49885204", "0.49847993", "0.4982379", "0.49819934", "0.49816847", "0.49811065", "0.497944", "0.4971222", "0.49607927", "0.49580914", "0.4956203", "0.4951731", "0.49487567", "0.49384207", "0.4937534", "0.49328995", "0.49318025", "0.4930517", "0.49275014", "0.4904472", "0.49008822", "0.49002463", "0.48996872", "0.48973972", "0.48933396", "0.48808953", "0.48787898", "0.48749322", "0.48707342", "0.48634994", "0.48628545", "0.48566425", "0.48562384", "0.4855825", "0.4855825", "0.48539132", "0.48497948", "0.48439643", "0.4837173", "0.48327523", "0.4832092", "0.48320064", "0.48319542", "0.48290756", "0.48289844", "0.48263857" ]
0.494455
67
Check for given external trans id
protected function handleExternalTransId($oTransaction, Order $oOrder) { $sExternalTransactionId = false; if (isset($oTransaction, $oTransaction->details, $oTransaction->details->paypalReference)) { $sExternalTransactionId = $oTransaction->details->paypalReference; } if (isset($oTransaction, $oTransaction->details, $oTransaction->details->transferReference)) { $sExternalTransactionId = $oTransaction->details->transferReference; } if ($sExternalTransactionId !== false) { $oOrder->mollieSetExternalTransactionId($sExternalTransactionId); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function checkTransID($transaction_id, $client_id) {\n\t\tLoader::loadModels($this, array(\"Transactions\"));\n\n\t\t$transaction = $this->Transactions->getByTransactionId($transaction_id, $client_id);\n\n\t\tif ($transaction) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function HasFailedTrans() {}", "function is_previously_used_txn_id ($txn_id) {\r\n\t\tglobal $db;\r\n\t\tif (!$result = $db->query(\"SELECT id FROM registrations WHERE pp_txn_id = '$txn_id'\")) {\r\n\t\t\tif (DEBUG == true) { error_log(($msg = \"Error running query: $sql\") . PHP_EOL, 3, LOG_FILE); }\r\n\t\t\tdie($msg);\r\n\t\t}\r\n\t\treturn $result->num_rows;\r\n\t}", "function checkExistInTransaction($fund_id)\n{\n\tglobal $mysqli;\n\t$select_tran = \"select transaction_id from usaid_fund_transaction_detail where ledger_type_id='\".$fund_id.\"'\";\n\t$result_tran = $mysqli->query($select_tran) or die('Error'. $mysqli->error);\n\t$total_record = $result_tran->num_rows;\n\tif($total_record<1) return true;\n\telse return false;\n}", "protected function transactionIDExists(&$record) {\n \n $trxn_id = $record['transmission_number'] . '-' . $record['transaction_number'];\n\n $dao = CRM_Core_DAO::executeQuery(\n \"SELECT id, contact_id FROM civicrm_contribution WHERE trxn_id = %1\",\n array(\n 1 => array($trxn_id, 'String')\n )\n );\n\n if ($dao->fetch()) {\n $message = ts(\n \"Duplicate transaction number (%1) - already exists for contribution id %2 (%3) - KID number '%4' at line %5. %6\",\n array(\n 1 => $record['transaction_number'],\n 2 => $dao->id,\n 3 => $this->getDisplayName($dao->contact_id),\n 4 => $record['kid'],\n 5 => $record['line_no'],\n 6 => $this->test ? ts('Record will not be imported.') : ts('Record was not imported.')\n )\n );\n $this->addReportLine('warning', $message);\n if (!$this->test)\n $this->createFailureTableEntry($record, $message);\n return true;\n }\n \n return false; \n \n }", "public static function checkId($id) {\n\n $session = Yii::$app->session;\n\n if (isset($session['order']) && array_search($id, $session['order']) !== false) {\n return 'true';\n } else {\n return 'false';\n }\n }", "function transaction_check(){\n }", "public function isIdValid($id)\n {\n \treturn $this->mgrOrder->isIdValid($id);\n }", "function check_txnid($tnxid){\n\t\t\t\tglobal $link;\n\t\t\t\t// $dbName= 'EventAdvisors';\n\t\t\t\t// $link = mysqli_connect($host, $user, $pass,$dbName);\n\t\t\t\t// mysql_select_db($db_name);\n\n\t\t\t\treturn true;\n\t\t\t\t\n\t\t\t\t$valid_txnid = true;\n\t\t\t\t//get result set\n\t\t\t\t$sql = mysqli_query( $con, \"SELECT * FROM payments WHERE txnid = '\".$tnxid.\"' \");\t\t\n\t\t\t\t\n\t\t\t\tif($row = mysqli_fetch_array($sql)) {\n\t\t\t\t\t$valid_txnid = false;\n\t\t\t\t}\n\t\t\t\treturn $valid_txnid;\n\t\t\t}", "function ajx_exists( $id = false )\n\t{\n\t\t// get language name\n\t\t$name = $_REQUEST['key'];\n\t\t$language_id = $_REQUEST['language_id'];\n\t\t\n\t\tif ( $this->is_valid_name( $name, $id, $language_id )) {\n\n\t\t// if the language name is valid,\n\t\t\t\n\t\t\techo \"true\";\n\t\t} else {\n\t\t// if invalid language name,\n\t\t\t\n\t\t\techo \"false\";\n\t\t}\n\t}", "function checkFoundOrdersForId($u_id)\n\t\t{\n\t\t\t$db = dbConnect::getInstance();\n \t\t $mysqli = $db->getConnection();\n\t\t\t$query = \" select * from check_tb where u_id = '\".$u_id.\"' \"; \n $res = $mysqli->query($query) or die (mysqli_error($mysqli));\n\t\t\tif(mysqli_num_rows($res) > 0)\n\t\t\t{\n\t\t\t\treturn true;\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function check($id);", "function checkVatID_it($vat_id) {\n\t\tif (strlen($vat_id) != 13)\n\t\t\treturn 0;\n\n\t\tif ($this->live_check = true) {\n\n\t\t\treturn $this->live($vat_id);\n\n\t\t} else {\n\t\t\treturn 9; // es gibt keinen algorithmus\n\t\t}\n\t}", "function verify_vendor_id($vendor_id) // Colorize: green\n { // Colorize: green\n return isset($vendor_id) // Colorize: green\n && // Colorize: green\n is_int($vendor_id) // Colorize: green\n && // Colorize: green\n $vendor_id > 0; // Colorize: green\n }", "private function _vtc_get_tran_id($result)\n\t{\n\t if(!isset($result['data'])) return false;\n\t $data = $result[\"data\"];\n\t $string = explode('|',$data);\n\t $tran_id = isset($string[0]) ? $string[0] : 0;\n\t return $tran_id;\n\t}", "function get_transaction_by_id($id){\n $str_query=\"select * from pos_transaction where transaction_id='$id'\";\n if(!$this->query($str_query)){\n return false;\n }\n return $this->fetch();\n }", "function load_transbyoid($order_id='')\r\n\t{\r\n\t\t$transid = $this->db->query(\"select transid from king_orders where id = ? \",$order_id)->row()->transid;\r\n\t\tredirect('admin/trans/'.$transid);\r\n\t}", "function isMsgSentId($conv, $msg_id, $account){\n\t\tglobal $db;\n\t\t$statement = $db->prepare('SELECT * FROM msg_conversation WHERE by_bot=1 AND conv_id = :conv AND msg_id = :msg_id AND accountID=:account');\n\t\t$statement->execute(array(':conv' => $conv, ':msg_id' => $msg_id, ':account'=>$account));\n\t\tif($statement->rowCount() == 0)\n\t\t\treturn false;\n\t\treturn $statement->fetch();\n\t}", "function checkTransaction_exist($jm_txnid)\n\t{\n\t\t$query = null;\n\t\t$query = $this->db->get_where('jm_membership_payment', array(//making selection\n\t\t\t'jm_txnid' => $jm_txnid\n\t\t));\t\t\n\t\t\n\t\tif ($query->num_rows() > 0) {\n\t\t\treturn 0;\t\t\t\n\t\t} else {\n\t\t\treturn 1;\t\t\t\n\t\t}\n\t}", "public function check_order_id()\n {\n // return $NotifController->index();\n $order_id = $this->request->getVar('order_id');\n $typeSearch = $this->request->getVar('tos');\n switch ($typeSearch) {\n case 'hasil':\n return $this->cari_hasil($order_id);\n break;\n case 'registrasi_detail':\n return $this->cari_registrasi_detail($order_id);\n break;\n case 'reschedule':\n return $this->cari_reshcedule($order_id);\n break;\n default:\n # code...\n break;\n }\n }", "function checkTxnid($txnid) {\n\tglobal $db;\n\n\t$txnid = $db->real_escape_string($txnid);\n\t$results = $db->query('SELECT * FROM `payments` WHERE txnid = \\'' . $txnid . '\\'');\n\n\treturn ! $results->num_rows;\n}", "public function isExternal()\n\t{\n\t\tif($this->external_id == null){\n\t\t\treturn false;\n\t\t}\n\t\telse \n\t\t\treturn true;\n\t}", "public function requireByExternalId($externalId);", "public function isValidId($id);", "function nvp_CheckTransaction($hash) {\r\n $hash= loginDB_real_escape_string($hash);\r\n $query=\"SELECT `id` from `op_transactions` WHERE `hash`='\".$hash.\"'\";\r\n $data= simple_query($query);\r\n if (!empty($data)) {\r\n return ($data['id']);\r\n } else {\r\n return (false);\r\n }\r\n}", "public function isTransactionPartOf($id)\n {\n if ( $this->isTransactionPart() ) {\n return $id == $this->_transaction->id;\n } else {\n return false;\n }\n }", "public function isChecking($id) {\n return ($id==11201);\n }", "public static function isExternalDepartment( $did ) {\n\t\t$db = JFactory::getDbo();\n\t\t$query = \"SELECT `external_link` FROM `#__obhelpdesk3_departments` WHERE id=\" . $did . \"\";\n\t\t$db->setQuery( $query );\n\t\tif ( $external_link = $db->loadResult() ) {\n\t\t\treturn $external_link;\n\t\t}\n\n\t\treturn false;\n\t}", "public function checkvertid($str)\n {\n if(!empty($this->model('Tid_model')->getTid($str)[0][\"tid\"])){\n $this->incomingData[\"vertid\"] = $this->model('Tid_model')->getTid($str)[0][\"tid\"];\n $this->checkfromid = $this->model('Tid_model')->getTid($str)[0][\"from_id\"];\n $this->statustid = $this->model('Tid_model')->getTid($str)[0][\"status_tid\"];\n if($this->incomingData[\"fromid\"]==$this->checkfromid){\n if($this->statustid==\"1\"){\n if(!empty($this->model('Ticket_model')->getTidToday($str))){\n $this->incomingData[\"statustid\"]=\"FAILED 16\";\n return $this->incomingData; \n }\n else{\n $this->incomingData[\"statustid\"]=\"OK\"; \n return $this->incomingData;\n }\n }\n else{\n $this->incomingData[\"statustid\"]=\"FAILED 10\";\n return $this->incomingData;\n }\n }\n else{\n $this->incomingData[\"statustid\"]=\"FAILED 11\";\n return $this->incomingData;\n }\n }\n else{\n $this->incomingData[\"statustid\"]=\"FAILED 06\";\n return $this->incomingData;\n }\n }", "function verify_transaction($trans_status)\n {\n //Lets Check what is the status\n switch($trans_status)\n {\n case \"Subscription-Payment-Failed\":\n case \"Subscription-Canceled\":\n {\n $this->status = 'cancelled';\n $this->gatewayStatus = $trans_status;\n }\n break;\n \n case \"Success\":\n case \"Subscription-Payment-Success\":\n\n {\n $this->status = 'ok';\n $this->gatewayStatus = 'Completed';\n return true;\n }\n break;\n \n case \"Subscription-Expired\":\n { \n $this->status = 'failed';\n $this->gatewayStatus = $trans_status;\n }\n break;\n \n default:\n {\n $this->status = 'other';\n $this->gatewayStatus = $trans_status;\n }\n }\n \n return false;\n }", "function checkVatID_si($vat_id) {\n\t\tif (strlen($vat_id) != 10)\n\t\t\treturn 0;\n\t\tif ((int) $vat_id[2] == 0)\n\t\t\treturn 0;\n\n\t\t$checksum = (int) $vat_id[9];\n\t\t$checkval = 0;\n\n\t\tfor ($i = 2; $i <= 8; $i ++)\n\t\t\t$checkval += (int) $vat_id[10 - $i] * $i;\n\t\t$checkval = $this->modulo($checkval, 11) == 10 ? 0 : 11 - $this->modulo($checkval, 11);\n\t\tif ($checksum != $checkval)\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t}", "private function verifyID($urlID) {\n\t\t# However, returns true if the url is a valid custom-one\n\t\t# Note that the ID must ALWAYS be in base10\n\t\tif(!isset($urlID)) {\n\t\t\tthrow new Exception(\"Missing parameter, aborting.\", 0);\n\t\t}\n\n\t\tif(preg_match(\"/^[0-9]+$/\", $urlID)) {\n\t\t\t# The id submitted seems to be a normal int'y id\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\t$this->log->logInfo(\"Invalid ID submitted - {$urlID}\");\n\t\t\theader(\"Location:{$this->siteURL}error/201\");\n\t\t\tdie;\n\t\t}\n\t}", "private function chkOrgId ()\n\t\t{\n\t\t\t/* Check Org Id in main table */\n\t\t\t$dbs = new DB ( $this->config['database'] ) ;\n\t\t\t$c = $dbs->query (\"SELECT COUNT (*) AS C FROM tbl_vpn_org WHERE org_id = '\" . trim($this->c) . \"'\");\n\t\t\t$dbs->CloseConnection ();\n\t\t\t\n\t\t\treturn $c[0]['C']; /* return 1 or 0 */\n\t\t}", "function checkVatID_ie($vat_id) {\n\t\tif (strlen($vat_id) != 10)\n\t\t\treturn 0;\n\t\tif (!checkVatID_ie_new($vat_id) && !checkVatID_ie_old($vat_id))\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t}", "public function getTransactionID();", "function get_transaction_status($transaction_id){\n $mid = $this->credentials.mid;\n $url = \"https://apps-uat.phonepe.com/v3/transaction/$mid/$transaction_id/status\";\n $salt_key = $this->credentials.salt_key;\n $salt_index = $this->credentials.salt_index;\n $_sha256 =hash(\"sha256\", \"/v3/transaction/$mid/$transaction_id/status$salt_key\");\n $request = new HttpRequest();\n $request->setUrl($url);\n $request->setMethod(HTTP_METH_GET);\n $request->setHeaders(array(\n \"x-verify\" => \"$_sha256###$salt_index\",\n \"x-client-id\" => $this->credentials.client_id,\n \"Content-Type\" => 'application/json',\n ));\n try {\n $response = $request->send();\n return $response->getBody();\n } catch (Exception $ex) {\n return $ex;\n }\n }", "public function DetalharNotaTranporte($_id)\n {\n $sql = new Sql();\n $sql->select('SELECT * FROM notatransporte WHERE id = :id',\n array\n (\n ':id' = $_id\n ));\n }", "private function isPublicIdUnique($id) {\r\n\r\n\t\t\t$sql = Connection::getHandle()->prepare(\r\n \"SELECT COUNT(*) FROM bs_customer_addresses WHERE public_id = ?\");\r\n\r\n\t\t\t$sql->execute(array($id));\r\n\t\t\t$row = $sql->fetch(PDO::FETCH_ASSOC);\r\n\r\n\t\t\treturn ($row['count'] > 0 ? false : true);\r\n\t\t}", "function tflash_id_exits($id) {\n return TFLASH::id_exists($id);\n}", "protected function _fcpoCheckTxid()\n {\n $blAppointedError = false;\n $sTxid = $this->_oFcpoHelper->fcpoGetSessionVariable('fcpoTxid');\n\n $sTestOxid = '';\n if ($sTxid) {\n $sQuery = \"SELECT oxid FROM fcpotransactionstatus WHERE FCPO_TXACTION = 'appointed' AND fcpo_txid = '\" . $sTxid . \"'\";\n $sTestOxid = $this->_oFcpoDb->getOne($sQuery);\n }\n\n if (!$sTestOxid) {\n $blAppointedError = true;\n $this->oxorder__oxfolder = new oxField('ORDERFOLDER_PROBLEMS', oxField::T_RAW);\n $oLang = $this->_oFcpoHelper->fcpoGetLang();\n $sCurrentRemark = $this->oxorder__oxremark->value;\n $sAddErrorRemark = $oLang->translateString('FCPO_REMARK_APPOINTED_MISSING');\n $sNewRemark = $sCurrentRemark.\" \".$sAddErrorRemark;\n $this->oxorder__oxremark = new oxField($sNewRemark, oxField::T_RAW);\n }\n $this->_fcpoSetAppointedError($blAppointedError);\n\n return $blAppointedError;\n }", "protected abstract function getTranslationIdentifier();", "function check_short($short)\n{\n\tglobal $id_new;\n\tif (empty($short))\n\t\treturn false;\n\t$query = \"SELECT attrib,id FROM xx_reports WHERE typ='funct'\";\n\t$res = db_query($query);\n\twhile ($f = db_fetch($res))\n\t{\n\t\t$h=explode(\"|\",$f[\"attrib\"]);\n\t\tif (($h[0] == $short) && (trim($f[\"id\"]) != $id_new))\n\t\t\treturn false;\n\t}\n\treturn true;\n}", "function checkVatID_sk($vat_id) {\n\t\tif (strlen($vat_id) != 12)\n\t\t\treturn 0;\n\t\tif (!is_numeric(substr($vat_id, 2)))\n\t\t\treturn 0;\n\n\t\tif ($this->live_check = true) {\n\n\t\t\treturn $this->live($vat_id);\n\n\t\t} else {\n\t\t\treturn 9; // es gibt keinen algorithmus\n\t\t}\n\n\t}", "function is_valid_company($id) {\n\t\t$str = \"SELECT * FROM company WHERE Comany_ID = $id\";\n\t\t$req = mysqli_query($link,$str);\n\t\t$num = mysqli_num_rows($req);\n\t\tif($num == 1) return true;\n\t\telse return false;\n\t}", "public function checkClientID($id){\r\n \t$this->db->select('vclient_fname','vclient_id');\r\n \t$this->db->from('vclient');\r\n \t$this->db->where('vclient_id',$id);\r\n \t$query = $this->db->get();\r\n \tif($query->num_rows()===1){\r\n \t\treturn TRUE;\r\n \t}\r\n \telse{\r\n \t\treturn FALSE;\r\n \t}\r\n\r\n }", "public function isExternalPaymentUrl();", "private static function verifyID($entry, $id)\n {\n $idhtml = htmlspecialchars($id);\n //$idpattern = (isset($entry['id_pattern']) ? $entry['id_pattern'] : '%[^A-Za-z0-9_\\\\-]%');\n //if ($idhtml == null || preg_match($idpattern, $idhtml)) {\n return ($idhtml != null);\n }", "public function checkExistLanguageShortTitle($language_short_title, $id = 0)\n {\n \t$language_short_title = iconv('windows-1251', 'utf-8', strtolower(iconv('utf-8', 'windows-1251', $language_short_title)));\n \tif($id){\n\t\t\t$result = $this -> db -> fetchRow('SELECT * FROM '.self::LANGUAGES_TABLE.' WHERE lang_id!=? AND LOWER(short_title) = ?', array($id, $language_short_title)); \t \t\t\n \t} else {\n\t\t\t$result = $this -> db -> fetchRow('SELECT * FROM '.self::LANGUAGES_TABLE.' WHERE LOWER(short_title) = ?', $language_short_title); \t\n \t}\n\n\t\tif(!empty($result)) {\n\t\t\treturn 1;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n }", "function n_checkID($genid, $parms=NULL)\r\n{\r\n if (empty($genid)) return FALSE;\r\n if (preg_match('%^([a-z\\d]{6,8})$%i', $genid, $matches)) // base32 code\r\n $genid = base32_float($matches);\r\n\r\n if (is_array($parms)) {\r\n $service = trim($parms['service']);\r\n $timeAt = trim($parms['timeAt']);\r\n }\r\n else if (is_string($parms))\r\n $service = $parms;\r\n $service = preg_match(\"%^([a-z][a-z_]{2,})%i\", $service, $matches) ? strtoupper($matches[1]) : '';\r\n\r\n if (preg_match('%^([0]{0,1})([\\d])([\\d]{6})([\\d]{2})$%', $genid, $matcharr)\r\n || preg_match('%^([1])([\\d])([\\d]{5})([\\d][\\d]{2})$%', $genid, $matcharr)\r\n || preg_match('%^([2])([\\d])([\\d]{7})([\\d]{2})$%', $genid, $matcharr)\r\n || preg_match('%([3])([\\d])([\\d]{7})([\\d][\\d]{2})$%', $genid, $matcharr)) {\r\n $ntype = intval($matcharr[1]);\r\n $rn = intval($matcharr[2]);\r\n $id = $matcharr[3];\r\n $s2 = $matcharr[4];\r\n //if ($cf_debug) echo (\"n_checkID: ntype=$ntype, rn=$rn, id=$id\\n\");\r\n }\r\n\r\n if (strlen($s2)==3) { // with day-check\r\n $t = $s2{0};\r\n if ($timeAt!=='0' && $t!='0') {\r\n $time = strlen($timeAt) ? strtotime($timeAt) : time();\r\n if ($time <= 0) $time = time(); // invalid time\r\n $numTry = 0;\r\n while ($numTry < 2) {\r\n $parmarr = array(\r\n 'service' => $service,\r\n 'rn' => $rn,\r\n 'timeAt' => date('Y-m-d H:i:s', $time - 43200*$numTry),\r\n );\r\n $s = n_makeID($id, $parmarr, $ntype);\r\n //if ($cf_debug) echo (\"n_checkID: s=$s, msig=\".-strlen($s).\"\\n\");\r\n if ($s && preg_match(\"%\".substr($genid, -strlen($s)).\"$%\", $s))\r\n return $id;\r\n $numTry++;\r\n }\r\n return FALSE;\r\n }\r\n }\r\n\r\n $parmarr = array(\r\n 'service' => $service,\r\n 'rn' => $rn,\r\n 'timeAt' => '0',\r\n );\r\n $s = n_makeID($id, $parmarr, $ntype);\r\n //if ($cf_debug) echo (\"n_checkID: s=$s, msig=\".-strlen($s).\"\\n\");\r\n if (($ntype==0 && intval($s)==intval($genid))\r\n || ($s && preg_match(\"%\".substr($genid, -strlen($s)).\"$%\", $s)))\r\n return $id;\r\n\r\n return FALSE;\r\n}", "public function is_transaction_exist() {\n\n $transaction = $this->ci->generic_model->retrieve_one(\n \"transaction_general\",\n array(\n \"package_id\" => $this->ci->input->post(\"package_id\"),\n \"package_type\" => $this->ci->input->post(\"package_type\")\n )\n );\n\n if ($transaction) { // there exists an object.\n return TRUE;\n } else { // object is not found.\n $this->ci->form_validation->set_message(\"is_transaction_exist\", \"Paket belum dibeli.\");\n return FALSE;\n }\n }", "function cp_CheckTransaction($hash)\n{\n $hash = mysql_real_escape_string($hash);\n $query = \"SELECT `id` from `op_transactions` WHERE `hash`='\" . $hash . \"'\";\n $data = simple_query($query);\n if (!empty($data)) {\n return false;\n }\n return true;\n}", "function validate_existance($request, $language, $id = 0)\n{\n global $db;\n\n // Check, if bank_account name exist or not\n $statement = $db->prepare(\"SELECT * FROM `bank_accounts` WHERE `account_name` = ? AND `id` != ?\");\n $statement->execute(array($request->post['account_name'], $id));\n if ($statement->rowCount() > 0) {\n throw new Exception($language->get('error_account_name_exist'));\n }\n\n // Check, if bank_account code exist or not\n $statement = $db->prepare(\"SELECT * FROM `bank_accounts` WHERE `account_no` = ? AND `id` != ?\");\n $statement->execute(array($request->post['account_no'], $id));\n if ($statement->rowCount() > 0) {\n throw new Exception($language->get('error_account_no_exist'));\n }\n}", "function is_valid_tagid($tagid){\n $data = array(\"tag_id\"=>$tagid);\n $status = CallAPI(\"ussd.myfarmnow.com/api/verifytagid\", $data);\n if($status == 1){\n return true;\n }elseif($status == 0){\n return false;\n }else{\n return \" invalid tag number\";\n }\n}", "function chk_teach_id(){\n\n\t\t$Q = $this->teach_lgn->chk_teach_id();\n\n\t\tif ($Q) {\n\t\t\t\n\t\t\treturn FALSE;\n\t\t}\n\t\telse{\n\n\t\t\treturn TRUE;\n\t\t}\n\n\t}", "public static function checkParise($id) {\n\t if (!$id) return false;\n\t $cookie = json_decode(Util_Cookie::get('GOU-PRAISE', true), true);\n\t if(in_array('zdm_'.$id, $cookie)) return true;\n\t return false;\n\t}", "function check_client_record($id){\r\n $record = $this->select(\"*\", array(\"client_id\"=>$id),false, \"tbl_records\" );\r\n if ($record) {\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n }", "function isvalid_ID( $id = null, $request_param = null ) {\n\n\t\t\tif ( ! is_null( $request_param ) && ! empty( $_REQUEST[ $request_param ] ) ) {\n\t\t\t\t$id = (int) $_REQUEST[ $request_param ];\n\t\t\t}\n\n\t\t\tif ( is_null( $id ) ) {\n\t\t\t\t$id = $this->id;\n\t\t\t}\n\n\t\t\t$id = (int) $id;\n\n\t\t\treturn ( $id > 0 );\n\t\t}", "function checkTxnid($txnid) {\n //Sample code from the reference\n\n $db = configDB();\n $q = $db->prepare('SELECT * FROM payments WHERE txnid = ?');\n $result = $q->execute(array($txnid));\n return !$q->rowCount();\n}", "private function isVendorCampaign(): bool\n {\n $id = $this->readImproved([\n 'what' => [$this->table. '.id'],\n 'where' => [\n $this->table. '.vendorId' => $this->vendorId,\n $this->table. '.id' => $this->id,\n ]\n ]);\n\n return !is_null($id);\n }", "function cpay_CheckTransaction($hash) {\r\n $hash = loginDB_real_escape_string($hash);\r\n $query = \"SELECT `id` from `op_transactions` WHERE `hash`='\" . $hash . \"'\";\r\n $data = simple_query($query);\r\n if (empty($data)) {\r\n return (true);\r\n } else {\r\n return (false);\r\n }\r\n}", "function valid_idsystem($str){\n\t\t$systemExists = $this->DAO->entitySelection('system',array('idSystem' => $str),TRUE);\n\t\tif($systemExists['data']){\n\t\t\t\treturn TRUE;\n\t }else{\n\t\t\t$this->form_validation->set_message('valid_idsystem','The field {field} doesnt exists');\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function has_translation($data, $language_id = FALSE)\n {\n return TRUE;\n }", "public function checkIfOrderExist($orderId);", "function _existsInDatabase($id)\n {\n $conn = getConn();\n $sql = \"SELECT RubriekID FROM Rubriek WHERE RubriekID = ?\";\n $stmt = sqlsrv_prepare($conn, $sql, array($id));\n if (!$stmt) {\n die(print_r(sqlsrv_errors(), true));\n }\n sqlsrv_execute($stmt);\n if (sqlsrv_execute($stmt)) {\n $row = sqlsrv_has_rows( $stmt );\n if ($row === true){\n return true;\n }\n }\n return false;\n }", "private function searchTransactionID()\r\n {\r\n if ($this->transactionID > 0 && $this->transactionID < 100000000000000000000)\r\n {\r\n // retrieve product, supplier, repair agent details from database\r\n $result = mysql_query(\"SELECT TransactionID, PurchaseDate, PurchasePrice\r\n FROM TransactionProducts_VIEW\r\n WHERE TransactionID = $this->transactionID AND Keycode = $this->keycode\");\r\n \r\n // store transaction results for use later\r\n $this->transactionResult = mysql_fetch_array($result);\r\n \r\n \r\n \r\n }\r\n }", "protected function isIntranet(): bool\n\t{\n\t\treturn\n\t\t\tisset($this->arResult['SITE']['DOMAIN_ID']['CURRENT']) &&\n\t\t\t(\n\t\t\t\t$this->arResult['SITE']['DOMAIN_ID']['CURRENT'] === '0' ||\n\t\t\t\t$this->arResult['SITE']['DOMAIN_ID']['CURRENT'] === ''\n\t\t\t);\n\t}", "private function check_ID($id){\r\n\r\n $query = \"SELECT FROM users WHERE oauth_uid = ?\";\r\n $data = $this->_db->get_Row($query, $id);\r\n\r\n return ($this->_db->count_Rows($data) > 0) ? true : false;\r\n }", "public function isValid($id);", "public function hasMoneyid(){\n return $this->_has(3);\n }", "function checkIfCityInUse($id)\r\n {\r\n $sql=\"SELECT city_id\r\n\t FROM edms_our_company\r\n\t\t WHERE city_id=$id LIMIT 0, 1\";\r\n $result=dbQuery($sql);\r\n \r\n if(dbNumRows($result)>0)\r\n {\r\n return true;\r\n }\r\n\r\n $sql=\"SELECT city_id\r\n\t FROM edms_customer\r\n\t\t WHERE city_id=$id LIMIT 0, 1\";\r\n $result=dbQuery($sql);\r\n \r\n if(dbNumRows($result)>0)\r\n {\r\n return true;\r\n }\r\n\r\n $sql=\"SELECT city_id\r\n\t FROM edms_guarantor\r\n\t\t WHERE city_id=$id LIMIT 0, 1\";\r\n $result=dbQuery($sql);\r\n \r\n if(dbNumRows($result)>0)\r\n {\r\n return true;\r\n }\r\n\r\n $sql=\"SELECT city_id\r\n\t FROM edms_vehicle_dealer\r\n\t\t WHERE city_id=$id LIMIT 0, 1\";\r\n $result=dbQuery($sql);\r\n \r\n if(dbNumRows($result)>0)\r\n {\r\n return true;\r\n }\r\n\r\n return false;\r\n }", "public function get_check() {\n\t\tif($id = Input::get('rel_id')) {\n\t\t\tif($id_list = Cookie::get('divec_cart')) {\n\t\t\t\tif(in_array($id, explode('-', $id_list))) {\n\t\t\t\t\t$this->response(array('success' => 'true'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->response(array('success' => 'false'));\n\t}", "public function verifyElementId($element){}", "function checkVatID_ie_new($vat_id) {\n\t\t$checksum = strtoupper(substr($vat_id, -1));\n\t\t$checkval = 0;\n\t\t$checkchar = 'A';\n\t\tfor ($i = 2; $i <= 8; $i ++)\n\t\t\t$checkval += (int) $vat_id[10 - $i] * $i;\n\t\t$checkval = $this->modulo($checkval, 23);\n\t\tif ($checkval == 0) {\n\t\t\t$checkchar = 'W';\n\t\t} else {\n\t\t\tfor ($i = $checkval -1; $i > 0; $i --)\n\t\t\t\t$checkchar ++;\n\t\t}\n\t\tif ($checkchar != $checksum)\n\t\t\treturn false;\n\n\t\treturn true;\n\t}", "function check_partner() {\n global $_REQUEST;\n global $sess;\n global $config;\n if (! eregi(\"^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]$\",$_REQUEST['partner_id'])) { // czy format partner_id OK\n return false;\n } else $partner_id=$_REQUEST['partner_id'];\n \n if (! eregi(\"^[0-9A-Za-z]+$\",$_REQUEST['code'])) { // czy format code OK\n return false;\n } else $code=$_REQUEST['code'];\n \n // sprawdz czy mamy takiego partnera w bazie\n include_once(\"include/metabase.inc\");\n $database = new my_Database;\n $check_id=$database->sql_select(\"id\",\"partners\",\"partner_id=$partner_id\");\n if (empty($check_id)) {\n return false;\n }\n // sprawdz czy zgadza sie suma kontrolna code\n $my_code=md5(\"partner_id.$partner_id.$config->salt\"); // prawidlowy kod kontrolny\n if ($code!=$my_code) {\n return false;\n }\n \n return $partner_id;\n \n }", "public function validacion(){\n\t\t$this->inicializa();\n\t\t$client=Cliente::find(1);\n\t\t$id=$client->transaccion.\"\";\n\t\t// si en la transaccion aparece el id del cliente que esta en la base de datos entonces la transaccion le pertenece\n\t\t// y por tanto es valida\n\t\t$transaction = $this->pasarela->transaction()->find(\"{$id}\");\n\t\t\n\t\tif($client->token==$transaction->customer['id'])\n\t\t\treturn true;\n\t\treturn false;\n\t\t//return response()->json($transaction);\n\t}", "function check_id($id) {\n\tif ( !preg_match( '/^[A-z0-9]+$/', $id ) ) {\n\t\treturn false;\n\t}\n\t# Check\tif the directory actually exists\n\tglobal $basedir;\n\tif ( !file_exists( $basedir . \"/\" . $id . \"/\" ) ) {\n\t\treturn false;\n\t}\n\treturn true;\n}", "private function validateId()\n {\n return is_numeric($this->id) && (int)$this->id >= 1;\n }", "function cemhub_is_an_allowed_external_campaign_source_id($campaing_source_id, $webform_node_id) {\n $webform_settings = cemhub_get_integrated_webform_settings_by_node_id($webform_node_id);\n $allowed_external_campaign_sources = list_extract_allowed_values($webform_settings->external_campaign_source, 'list_text', FALSE);\n\n return in_array($campaing_source_id, $allowed_external_campaign_sources);\n}", "function is_digital($id){\n if($this->db->get_where('product',array('product_id'=>$id))->row()->download == 'ok'){\n return true;\n } else {\n return false;\n }\n }", "public function testCanGetTranslationById()\n {\n // Call the service requesting translation #1\n $responseTranslation = $this->translationService->getTranslationById(1);\n\n // Check the response is a translation entity\n $this->assertInstanceOf('Jobs\\Entity\\Translation', $responseTranslation);\n $this->assertInstanceOf('Jobs\\Entity\\Language', $responseTranslation->getLanguage());\n $this->assertInstanceOf('Jobs\\Entity\\Job', $responseTranslation->getJob());\n\n // Check that the returned entity is our dummy translation\n $this->assertEquals(1, $responseTranslation->getId());\n $this->assertEquals('English name', $responseTranslation->getName());\n $this->assertEquals('English description', $responseTranslation->getDescription());\n $this->assertEquals(1, $responseTranslation->getLanguage()->getId());\n $this->assertEquals('en', $responseTranslation->getLanguage()->getName());\n $this->assertEquals(1, $responseTranslation->getJob()->getId());\n $this->assertEquals(1, $responseTranslation->getJob()->getDepartment()->getId());\n $this->assertEquals('It Department', $responseTranslation->getJob()->getDepartment()->getName());\n }", "function verify_region_id($region_id) // Colorize: green\n { // Colorize: green\n return isset($region_id) // Colorize: green\n && // Colorize: green\n is_int($region_id) // Colorize: green\n && // Colorize: green\n $region_id > 0; // Colorize: green\n }", "public function valide_messageid() {\n\t\tif (empty ( $this->getMessageId () )) {\n\t\t\t$this->onDebug ( $this->getMessageId (), 2 );\n\t\t\t$this->onError ( \"Il faut un message id renvoye par O365 pour travailler\" );\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "private function checkIsExists(): bool\n {\n $where = [\n $this->table. '.vendorId' => $this->vendorId,\n $this->table. '.campaign' => $this->campaign,\n ];\n\n if (!is_null($this->id)) {\n $where[$this->table. '.id !='] = $this->id;\n }\n\n $id = $this->readImproved([\n 'what' => [$this->table. '.id'],\n 'where' => $where\n ]);\n\n return !is_null($id);\n }", "function cargar_registro_venta_id($id) {\n return true;\n }", "public function accountIdExists($id){\n try{\n $sql = 'SELECT idaccount FROM accounts WHERE idaccount=:id';\n $query = pdo()->prepare($sql);\n $query->bindValue(':id', $id, PDO::PARAM_INT);\n $query->execute();\n $res = $query->fetch(PDO::FETCH_ASSOC);\n $query->closeCursor();\n if($res){\n return true;\n }\n }\n catch(Exception $e)\n {\n trigger_error('Echec lors de la vérification si le compte(ID) existe : '.$e->getMessage(), E_USER_ERROR);\n }\n return false;\n }", "function checkVatID_c($vat_id) {\n\t\tif (strlen($vat_id) != 10)\n\t\t\treturn 0;\n\n\t\t// LUHN-10 code http://www.ee.unb.ca/tervo/ee4253/luhn.html\n\n\t\t$id = substr($vat_id, 1);\n\t\t$checksum = 0;\n\t\tfor ($i = 9; $i > 0; $i --) {\n\t\t\t$digit = $vat_id {\n\t\t\t\t$i};\n\t\t\tif ($i % 2 == 1)\n\t\t\t\t$digit *= 2;\n\t\t\tif ($digit >= 10) {\n\t\t\t\t$checksum += $digit -10 + 1;\n\t\t\t} else {\n\t\t\t\t$checksum += $digit;\n\t\t\t}\n\t\t}\n\t\tif ($this->modulo($checksum, 10) == 0)\n\t\t\treturn 1;\n\n\t\treturn 0;\n\t} // Canada\n\n\t// belgien\n\tfunction checkVatID_be($vat_id) {\n\t\tif (strlen($vat_id) != 11)\n\t\t\treturn 0;\n\n\t\t$checkvals = (int) substr($vat_id, 2, -2);\n\t\t$checksum = (int) substr($vat_id, -2);\n\n\t\tif (97 - $this->modulo($checkvals, 97) != $checksum)\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t} // end belgien\n\n\t// daenemark\n\tfunction checkVatID_dk($vat_id) {\n\t\tif (strlen($vat_id) != 10)\n\t\t\treturn 0;\n\n\t\t$weights = array (2, 7, 6, 5, 4, 3, 2, 1);\n\t\t$checksum = 0;\n\n\t\tfor ($i = 0; $i < 8; $i ++)\n\t\t\t$checksum += (int) $vat_id[$i +2] * $weights[$i];\n\t\tif ($this->modulo($checksum, 11) > 0)\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t} // end daenemark\n\n\t// deutschland\n\tfunction checkVatID_de($vat_id) {\n\t\tif (strlen($vat_id) != 11)\n\t\t\treturn 0;\n\n\t\t$prod = 10;\n\t\t$checkval = 0;\n\t\t$checksum = (int) substr($vat_id, -1);\n\n\t\tfor ($i = 2; $i < 10; $i ++) {\n\t\t\t$checkval = $this->modulo((int) $vat_id[$i] + $prod, 10);\n\t\t\tif ($checkval == 0)\n\t\t\t\t$checkval = 10;\n\t\t\t$prod = $this->modulo($checkval * 2, 11);\n\t\t} // end for($i = 2; $i < 10; $i++)\n\t\t$prod = $prod == 1 ? 11 : $prod;\n\t\tif (11 - $prod != $checksum)\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t} // end deutschland\n\n\t// estland\n\tfunction checkVatID_ee($vat_id) {\n\n\t\tif (strlen($vat_id) != 11)\n\t\t\treturn 0;\n\t\tif (!is_numeric(substr($vat_id, 2)))\n\t\t\treturn 0;\n\n\t\tif ($this->live_check = true) {\n\n\t\t\treturn $this->live($vat_id);\n\n\t\t} else {\n\t\t\treturn 9; // es gibt keinen algorithmus\n\t\t}\n\t} // end estland\n\n\t// finnland\n\tfunction checkVatID_fi($vat_id) {\n\t\tif (strlen($vat_id) != 10)\n\t\t\treturn 0;\n\n\t\t$weights = array (7, 9, 10, 5, 8, 4, 2);\n\t\t$checkval = 0;\n\t\t$checksum = (int) substr($vat_id, -1);\n\n\t\tfor ($i = 0; $i < 8; $i ++)\n\t\t\t$checkval += (int) $vat_id[$i +2] * $weights[$i];\n\n\t\tif (11 - $this->modulo($checkval, 11) != $checksum)\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t} // end finnland\n\n\t// frankreich\n\tfunction checkVatID_fr($vat_id) {\n\t\tif (strlen($vat_id) != 13)\n\t\t\treturn 0;\n\t\tif (!is_numeric(substr($vat_id), 4))\n\t\t\treturn 0;\n\n\t\tif ($this->live_check = true) {\n\n\t\t\treturn $this->live($vat_id);\n\n\t\t} else {\n\t\t\treturn 9; // es gibt keinen algorithmus\n\t\t}\n\n\t} // end frankreich\n\n\t// griechenland\n\tfunction checkVatID_el($vat_id) {\n\t\tif (strlen($vat_id) != 11)\n\t\t\treturn 0;\n\n\t\t$checksum = substr($vat_id, -1);\n\t\t$checkval = 0;\n\n\t\tfor ($i = 1; $i <= 8; $i ++)\n\t\t\t$checkval += (int) $vat_id[10 - $i] * pow(2, $i);\n\t\t$checkval = $this->modulo($checkval, 11) > 9 ? 0 : $this->modulo($checkval, 11);\n\t\tif ($checkval != $checksum)\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t} // end griechenland\n\n\t// grossbrittanien\n\tfunction checkVatID_gb($vat_id) {\n\t\tif (strlen($vat_id) != 11 && strlen($vat_id) != 14)\n\t\t\treturn 0;\n\t\tif (!is_numeric(substr($vat_id, 2)))\n\t\t\treturn 0;\n\n\t\tif ($this->live_check = true) {\n\n\t\t\treturn $this->live($vat_id);\n\n\t\t} else {\n\t\t\treturn 9; // es gibt keinen algorithmus\n\t\t}\n\n\t} // end grossbrittanien\n\n\t/********************************************\n\t* irland *\n\t********************************************/\n\t// irland switch\n\tfunction checkVatID_ie($vat_id) {\n\t\tif (strlen($vat_id) != 10)\n\t\t\treturn 0;\n\t\tif (!checkVatID_ie_new($vat_id) && !checkVatID_ie_old($vat_id))\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t} // end irland switch\n\n\t// irland alte methode\n\tfunction checkVatID_ie_old($vat_id) {\n\t\t// in neue form umwandeln\n\t\t$transform = array (substr($vat_id, 0, 2), '0', substr($vat_id, 4, 5), $vat_id[2], $vat_id[9]);\n\t\t$vat_id = join('', $transform);\n\n\t\t// nach neuer form pruefen\n\t\treturn checkVatID_ie_new($vat_id);\n\t} // end irland alte methode\n\n\t// irland neue methode\n\tfunction checkVatID_ie_new($vat_id) {\n\t\t$checksum = strtoupper(substr($vat_id, -1));\n\t\t$checkval = 0;\n\t\t$checkchar = 'A';\n\t\tfor ($i = 2; $i <= 8; $i ++)\n\t\t\t$checkval += (int) $vat_id[10 - $i] * $i;\n\t\t$checkval = $this->modulo($checkval, 23);\n\t\tif ($checkval == 0) {\n\t\t\t$checkchar = 'W';\n\t\t} else {\n\t\t\tfor ($i = $checkval -1; $i > 0; $i --)\n\t\t\t\t$checkchar ++;\n\t\t}\n\t\tif ($checkchar != $checksum)\n\t\t\treturn false;\n\n\t\treturn true;\n\t} // end irland neue methode\n\t/* end irland\n\t********************************************/\n\n\t// italien\n\tfunction checkVatID_it($vat_id) {\n\t\tif (strlen($vat_id) != 13)\n\t\t\treturn 0;\n\n\t\tif ($this->live_check = true) {\n\n\t\t\treturn $this->live($vat_id);\n\n\t\t} else {\n\t\t\treturn 9; // es gibt keinen algorithmus\n\t\t}\n\t} // end italien\n\n\t// lettland\n\tfunction checkVatID_lv($vat_id) {\n\n\t\tif (strlen($vat_id) != 13)\n\t\t\treturn 0;\n\t\tif (!is_numeric(substr($vat_id, 2)))\n\t\t\treturn 0;\n\n\t\tif ($this->live_check = true) {\n\n\t\t\treturn $this->live($vat_id);\n\n\t\t} else {\n\t\t\treturn 9; // es gibt keinen algorithmus\n\t\t}\n\t} // end lettland\n\n\t// litauen\n\tfunction checkVatID_lt($vat_id) {\n\n\t\tif ((strlen($vat_id) != 13) || (strlen($vat_id) != 11))\n\t\t\treturn 0;\n\t\tif (!is_numeric(substr($vat_id, 2)))\n\t\t\treturn 0;\n\n\t\tif ($this->live_check = true) {\n\n\t\t\treturn $this->live($vat_id);\n\n\t\t} else {\n\t\t\treturn 9; // es gibt keinen algorithmus\n\t\t}\n\t} // end litauen\n\n\t// luxemburg\n\tfunction checkVatID_lu($vat_id) {\n\t\tif (strlen($vat_id) != 10)\n\t\t\treturn 0;\n\n\t\t$checksum = (int) substr($vat_id, -2);\n\t\t$checkval = (int) substr($vat_id, 2, 6);\n\t\tif ($this->modulo($checkval, 89) != $checksum)\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t} // luxemburg\n\n\t// malta\n\tfunction checkVatID_mt($vat_id) {\n\n\t\tif (strlen($vat_id) != 10)\n\t\t\treturn 0;\n\t\tif (!is_numeric(substr($vat_id, 2)))\n\t\t\treturn 0;\n\n\t\tif ($this->live_check = true) {\n\n\t\t\treturn $this->live($vat_id);\n\n\t\t} else {\n\t\t\treturn 9; // es gibt keinen algorithmus\n\t\t}\n\t} // end malta\n\n\t// niederlande\n\tfunction checkVatID_nl($vat_id) {\n\t\tif (strlen($vat_id) != 14)\n\t\t\treturn 0;\n\t\tif (strtoupper($vat_id[11]) != 'B')\n\t\t\treturn 0;\n\t\tif ((int) $vat_id[12] == 0 || (int) $vat_id[13] == 0)\n\t\t\treturn 0;\n\n\t\t$checksum = (int) $vat_id[10];\n\t\t$checkval = 0;\n\n\t\tfor ($i = 2; $i <= 9; $i ++)\n\t\t\t$checkval += (int) $vat_id[11 - $i] * $i;\n\t\t$checkval = $this->modulo($checkval, 11) > 9 ? 0 : $this->modulo($checkval, 11);\n\n\t\tif ($checkval != $checksum)\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t} // end niederlande\n\n\t// oesterreich\n\tfunction checkVatID_at($vat_id) {\n\t\tif (strlen($vat_id) != 11)\n\t\t\treturn 0;\n\t\tif (strtoupper($vat_id[2]) != 'U')\n\t\t\treturn 0;\n\n\t\t$checksum = (int) $vat_id[10];\n\t\t$checkval = 0;\n\n\t\tfor ($i = 3; $i < 10; $i ++)\n\t\t\t$checkval += $this->cross_summa((int) $vat_id[$i] * ($this->is_even($i) ? 2 : 1));\n\t\t$checkval = substr((string) (96 - $checkval), -1);\n\n\t\tif ($checksum != $checkval)\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t} // end oesterreich\n\n\t// polen\n\tfunction checkVatID_pl($vat_id) {\n\t\tif (strlen($vat_id) != 12)\n\t\t\treturn 0;\n\n\t\t$weights = array (6, 5, 7, 2, 3, 4, 5, 6, 7);\n\t\t$checksum = (int) $vat_id[11];\n\t\t$checkval = 0;\n\t\tfor ($i = 0; $i < count($weights); $i ++)\n\t\t\t$checkval += (int) $vat_id[$i +2] * $weights[$i];\n\t\t$checkval = $this->modulo($checkval, 11);\n\n\t\tif ($checkval != $checksum)\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t} // end polen\n\n\t// portugal\n\tfunction checkVatID_pt($vat_id) {\n\t\tif (strlen($vat_id) != 11)\n\t\t\treturn 0;\n\n\t\t$checksum = (int) $vat_id[10];\n\t\t$checkval = 0;\n\n\t\tfor ($i = 2; $i < 10; $i ++) {\n\t\t\t$checkval += (int) $vat_id[11 - $i] * $i;\n\t\t}\n\t\t$checkval = (11 - $this->modulo($checkval, 11)) > 9 ? 0 : (11 - $this->modulo($checkval, 11));\n\t\tif ($checksum != $checkval)\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t} // end portugal\n\n\t// schweden\n\tfunction checkVatID_se($vat_id) {\n\t\tif (strlen($vat_id) != 14)\n\t\t\treturn 0;\n\t\tif ((int) substr($vat_id, -2) < 1 || (int) substr($vat_id, -2) > 94)\n\t\t\treturn 0;\n\t\t$checksum = (int) $vat_id[11];\n\t\t$checkval = 0;\n\n\t\tfor ($i = 0; $i < 10; $i ++)\n\t\t\t$checkval += $this->cross_summa((int) $vat_id[10 - $i] * ($this->is_even($i) ? 2 : 1));\n\t\tif ($checksum != ($this->modulo($checkval, 10) == 0 ? 0 : 10 - $this->modulo($checkval, 10)))\n\t\t\treturn 0;\n\n\t\t$checkval = 0;\n\t\tfor ($i = 0; $i < 13; $i ++)\n\t\t\t$checkval += (int) $vat_id[13 - $i] * ($this->is_even($i) ? 2 : 1);\n\t\tif ($this->modulo($checkval, 10) > 0)\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t} // end schweden\n\n\t// slowakische republik\n\tfunction checkVatID_sk($vat_id) {\n\t\tif (strlen($vat_id) != 12)\n\t\t\treturn 0;\n\t\tif (!is_numeric(substr($vat_id, 2)))\n\t\t\treturn 0;\n\n\t\tif ($this->live_check = true) {\n\n\t\t\treturn $this->live($vat_id);\n\n\t\t} else {\n\t\t\treturn 9; // es gibt keinen algorithmus\n\t\t}\n\n\t} // end slowakische republik\n\n\t// slowenien\n\tfunction checkVatID_si($vat_id) {\n\t\tif (strlen($vat_id) != 10)\n\t\t\treturn 0;\n\t\tif ((int) $vat_id[2] == 0)\n\t\t\treturn 0;\n\n\t\t$checksum = (int) $vat_id[9];\n\t\t$checkval = 0;\n\n\t\tfor ($i = 2; $i <= 8; $i ++)\n\t\t\t$checkval += (int) $vat_id[10 - $i] * $i;\n\t\t$checkval = $this->modulo($checkval, 11) == 10 ? 0 : 11 - $this->modulo($checkval, 11);\n\t\tif ($checksum != $checkval)\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t} // end slowenien\n\n\t// spanien\n\tfunction checkVatID_es($vat_id) {\n\t\t// Trim country info\n\t\t$vat_id = substr($vat_id, 2);\n\n\t\t// Is it a naturalized foreigner?\n\t\tif (strtoupper($vat_id[0]) == 'X')\n\t\t\t$vat_id = substr($vat_id, 1); // Truncated $vat_id is validated as a regular one\n\n\t\t// Length check \n\t\tif (strlen($vat_id) > 9) // $vat_id at this point should be 9 chars at most\n\n\n\n\t\t\treturn 0;\n\n\t\t// Is it a company?\n\t\tif (!is_numeric($vat_id[0])) {\n\t\t\t$allowed = array ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H');\n\t\t\t$checkval = false;\n\n\t\t\tfor ($i = 0; $i < count($allowed); $i ++) {\n\t\t\t\tif (strtoupper($vat_id[0]) == $allowed[$i])\n\t\t\t\t\t$checkval = true;\n\t\t\t} // end for($i=0; $i<count($allowed); $i++)\n\t\t\tif (!$checkval)\n\t\t\t\treturn 9; // Few more letters are allowed, but not likely to happen\n\n\t\t\t$vat_len1 = strlen($vat_id) - 1;\n\n\t\t\t$checksum = (int) $vat_id[$vat_len1];\n\t\t\t$checkval = 0;\n\n\t\t\tfor ($i = 1; $i < $vat_len1; $i ++)\n\t\t\t\t$checkval += $this->cross_summa((int) $vat_id[$i] * ($this->is_even($i) ? 1 : 2));\n\n\t\t\tif ($checksum != 10 - $this->modulo($checkval, 10))\n\t\t\t\treturn 0;\n\n\t\t\treturn 1;\n\t\t} // end Is it a company?\n\n\t\t// Is it an Individual? (or naturalized foreigner)\n\t\tif (!is_numeric($vat_id[strlen($vat_id) - 1])) {\n\t\t\t$allowed1 = \"TRWAGMYFPDXBNJZSQVHLCKE\";\n\n\t\t\t$vat_len1 = strlen($vat_id) - 1;\n\n\t\t\t$checksum = strtoupper($vat_id[$vat_len1]);\n\t\t\t$checkval = $this->modulo((int) substr($vat_id, 0, $vat_len1), 23);\n\n\t\t\tif ($checksum != $allowed1[$checkval])\n\t\t\t\treturn 0;\n\n\t\t\t$this->vat_mod = array ('status' => $allowed1[$checkval]);\n\n\t\t\treturn 1;\n\t\t} // end Is it an Individual?\n\n\t\treturn 0; // No match found\n\t} // end spanien\n\n\t// tschechien\n\tfunction checkVatID_cz($vat_id) {\n\n\t\tif ((strlen($vat_id) != 10) || (strlen($vat_id) != 11) || (strlen($vat_id) != 12))\n\t\t\treturn 0;\n\t\tif (!is_numeric(substr($vat_id, 2)))\n\t\t\treturn 0;\n\n\t\tif ($this->live_check = true) {\n\n\t\t\treturn $this->live($vat_id);\n\n\t\t} else {\n\t\t\treturn 9; // es gibt keinen algorithmus\n\t\t}\n\t} // end tschechien\n\n\t// ungarn\n\tfunction checkVatID_hu($vat_id) {\n\n\t\tif (strlen($vat_id) != 10)\n\t\t\treturn 0;\n\t\tif (!is_numeric(substr($vat_id, 2)))\n\t\t\treturn 0;\n\n\t\tif ($this->live_check = true) {\n\n\t\t\treturn $this->live($vat_id);\n\n\t\t} else {\n\t\t\treturn 9; // es gibt keinen algorithmus\n\t\t}\n\t} // end ungarn\n\n\t// zypern\n\tfunction checkVatID_cy($vat_id) {\n\n\t\tif (strlen($vat_id) != 11)\n\t\t\treturn 0;\n\n\t\tif ($this->live_check = true) {\n\n\t\t\treturn $this->live($vat_id);\n\n\t\t} else {\n\t\t\treturn 9; // es gibt keinen algorithmus\n\t\t}\n\t} // end zypern\n\n\t/*******************************************************************/\n\n\t/********************************************************************\n\t* mathematische Hilfsfunktionen *\n\t********************************************************************/\n\t// modulo berechnet den rest einer division von $val durch $param\n\tfunction modulo($val, $param) {\n\t\treturn $val - (floor($val / $param) * $param);\n\t} // end function modulo($val, $param)\n\n\t// stellt fest, ob eine zahl gerade ist\n\tfunction is_even($val) {\n\t\treturn ($val / 2 == floor($val / 2)) ? true : false;\n\t} // end function is_even($val)\n\n\t// errechnet die quersumme von $val\n\tfunction cross_summa($val) {\n\t\t$val = (string) $val;\n\t\t$sum = 0;\n\t\tfor ($i = 0; $i < strlen($val); $i ++)\n\t\t\t$sum += (int) $val[$i];\n\t\treturn $sum;\n\t} // end function cross_summa((string) $val)\n\t/*******************************************************************/\n\n\t/********************************************************************\n\t* Live Check *\n\t********************************************************************/\n\t// Live Check überprüft die USTid beim Bundesamt für Finanzen\n\tfunction live($abfrage_nummer) {\n\n\t\t$eigene_nummer = STORE_OWNER_VAT_ID;\n\n\t\t/* Hier wird der String für den POST per URL aufgebaut */\n\t\t$ustid_post = \"eigene_id=\".$eigene_nummer.\"&abfrage_id=\".$abfrage_nummer.\"\";\n\n\t\t/* Zur Verbindung mit dem Server wird CURL verwendet */\n\t\t/* mit curl_init wird zunächst die URL festgelegt */\n\n\t\t$ch = curl_init(\"http://wddx.bff-online.de//ustid.php?\".$ustid_post.\"\");\n\n\t\t/* Hier werden noch einige Parameter für CURL gesetzt */\n\t\tcurl_setopt($ch, CURLOPT_HEADER, 0); /* Header nicht in die Ausgabe */\n\t\tcurl_setopt($ch, CURLOPT_NOBODY, 0); /* Ausgabe nicht in die HTML-Seite */\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); /* Umleitung der Ausgabe in eine Variable ermöglichen */\n\n\t\t/* Aufruf von CURL und Ausgabe mit WDDX deserialisieren */\n\n\t\t$des_out = wddx_deserialize(curl_exec($ch));\n\t\tcurl_close($ch);\n\n\t\t/* Die deserialisierte Ausgabe in ein Array schreiben */\n\n\t\twhile (list ($key, $val) = each($des_out)) {\n\t\t\t$ergebnis[$key] = $val;\n\t\t}\n\n\t\tif ($ergebnis[fehler_code] == '200') {\n\t\t\treturn 1;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '201') {\n\t\t\treturn 0;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '202') {\n\t\t\treturn 0;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '203') {\n\t\t\treturn 0;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '204') {\n\t\t\treturn 0;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '205') {\n\t\t\treturn 9;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '206') {\n\t\t\treturn 9;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '207') {\n\t\t\treturn 9;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '208') {\n\t\t\treturn 9;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '209') {\n\t\t\treturn 0;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '210') {\n\t\t\treturn 0;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '666') {\n\t\t\treturn 9;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '777') {\n\t\t\treturn 9;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '888') {\n\t\t\treturn 9;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '999') {\n\t\t\treturn 9;\n\t\t} else {\n\t\t\treturn 9;\n\t\t}\n\n\t} // end function Live\n\t/*******************************************************************/\n}", "function isValid() {\n return( BitBase::verifyId( $this->mContentId ) );\n }", "function checkTWId($twid)\n{\n $ret = false;\n if (preg_match(\"/^[A-Z][12]\\d{8}$/\", $twid)) {\n $letters = 'ABCDEFGHJKLMNPQRSTUVXYWZIO';\n\n $c1 = substr($twid, 0, 1); //'A'\n $n12 = strpos($letters, $c1) + 10;\n// echo $n12 . '<hr>';\n $n1 = (int)($n12 / 10);\n $n2 = $n12 % 10;\n $n3 = substr($twid, 1, 1);\n $n4 = substr($twid, 2, 1);\n $n5 = substr($twid, 3, 1);\n $n6 = substr($twid, 4, 1);\n $n7 = substr($twid, 5, 1);\n $n8 = substr($twid, 6, 1);\n $n9 = substr($twid, 7, 1);\n $n10 = substr($twid, 8, 1);\n $n11 = substr($twid, 9, 1);\n\n $sum = $n1 * 1 + $n2 * 9 + $n3 * 8 + $n4 * 7 + $n5 * 6 + $n6 * 5 + $n7 * 4 + $n8 * 3 + $n9 * 2 + $n10 * 1 + $n11 * 1;\n $ret = ($sum % 10 == 0);\n\n\n }\n return $ret;\n\n}", "function checkOrderIsMine($orderNum ,$u_id)\n\t\t{\n\t\t\t$db = dbConnect::getInstance();\n \t\t $mysqli = $db->getConnection();\n\t\t\t$query = \" select * from check_tb where id= '\".$orderNum.\"' and u_id ='\".$u_id.\"' and status = '3'\"; \n $res = $mysqli->query($query) or die (mysqli_error($mysqli));\n\t\t\tif(mysqli_num_rows($res) > 0)\n\t\t\t{\n\t\t\t\treturn true;\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function exists_instance_with_external_id($class_id, $external_id) {\n\t\t$external_id = $this->conn->quote($external_id);\n\t\t$sql = \"select id from omp_instances where external_id=$external_id and class_id=$class_id limit 1\";\n\t\t$inst_id = $this->conn->fetchColumn($sql);\n\t\treturn $inst_id;\n\t}", "public function isValidTransactionId($id)\n {\n // if we've already got a transaction database ID, we're fine\n if (isset($this->_transactionDatabaseID)) {\n return true;\n }\n\n try {\n // inserts the new transaction and retrieves the database row ID\n $this->_transactionDatabaseID = intval($this->_insertTransaction($id));\n return true;\n } catch (Exception $e) {\n return false;\n }\n }", "public function isTranslated();", "public function checkExistLanguageTitle($language_title, $id = 0)\n {\n \t//$language_title = iconv('windows-1251', 'utf-8', strtolower(iconv('utf-8', 'windows-1251', $language_title)));\n \t//$language_title = mb_detect_encoding($language_title, 'utf-8');\n\n \tif($id){\n\t\t\t$result = $this -> db -> fetchRow('SELECT * FROM '.self::LANGUAGES_TABLE.' WHERE lang_id!=? AND LOWER(title) = ?', array($id, $language_title)); \t \t\t\n \t} else {\n\t\t\t$result = $this -> db -> fetchRow('SELECT * FROM '.self::LANGUAGES_TABLE.' WHERE LOWER(title) = ?', $language_title); \t\n \t}\n\n\t\tif(!empty($result)) {\n\t\t\treturn 1;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n }", "public function findTransitonIdByUntranslatedName(string $issueIdOrKey, string $untranslatedName): string\n {\n $this->log->debug('findTransitonIdByUntranslatedName=');\n\n $prj = new ProjectService($this->getConfiguration());\n $pkey = explode('-', $issueIdOrKey);\n $transitionArray = $prj->getProjectTransitionsToArray($pkey[0]);\n\n $this->log->debug('getTransitions result='.var_export($transitionArray, true));\n\n foreach ($transitionArray as $trans) {\n if (strcasecmp($trans['name'], $untranslatedName) === 0 ||\n strcasecmp($trans['untranslatedName'] ?? '', $untranslatedName) === 0) {\n return $trans['id'];\n }\n }\n\n // transition keyword not found\n throw new JiraException(\"Transition name '$untranslatedName' not found on JIRA Server.\");\n }", "public function checkCaseId($id)\n {\n try {\n $prepared_query = $this->conn->prepare(\"SELECT * FROM CASES WHERE deleted = 0 AND ID = :id\");\n $prepared_query->bindParam(\":id\", $id, PDO::PARAM_INT);\n $prepared_query->execute();\n $res = $prepared_query->fetchAll(PDO::FETCH_ASSOC);\n\n return sizeof($res) > 0;\n\n } catch (PDOException $ex) {\n }\n }", "private function validateId($id):void {\n // Only condition that can be considered invalid $id\n if($id === \"\") {\n if(isset($this->logger))\n $this->logger->error('UId can not be null.');\n throw new COARNotificationException('UId can not be null.');\n }\n\n $pattern = '/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/';\n\n if (!filter_var($id, FILTER_VALIDATE_URL) && (preg_match($pattern, $id) === 0)) {\n if(isset($this->logger))\n $this->logger->warning(\"(UId: '$id') Uid is neither a valid URL nor an UUID.\");\n }\n\n\n }", "public function checkCodeExist($id, $code) {\n\t\t$query = $this->db->get_where ( \"languages\", array (\n\t\t\t\t\"code\" => $code\n\t\t) );\n\t\t$lang1 = $this->getLangById ( $id );\n\t\tif ($query->num_rows () > 0) {\n\t\t\t$lang = $query->row ();\n\t\t\tif ($lang->code == $lang1->code)\n\t\t\t\treturn true;\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function license_exists($lic) {\n\tglobal $DB;\n\n\tif(!isset($lic) || empty($lic) || is_null($lic)) {\n\t\treturn true;\n\t}\n\t$lic = $DB->EscapeQueryStmt($lic);\n\t$DB->Query(\"SELECT COUNT(*) AS TOT FROM Account WHERE License = '{$lic}'\");\n\t$tot = $DB->GetRow();\n\treturn (isset($tot[\"TOT\"]) && intval($tot[\"TOT\"]) > 0);\n}", "function check_manifesto_delivered($manifesto_id=0)\r\n\t{\r\n\t\tif($manifesto_id)\r\n\t\t{\r\n\t\t\t$manifesto_det=$this->db->query(\"select * from pnh_m_manifesto_sent_log where id=?\",$manifesto_id);\r\n\t\t\tif($manifesto_det->num_rows())\r\n\t\t\t{\r\n\t\t\t\t$manifesto_det=$manifesto_det->row_array();\r\n\t\t\t\t\r\n\t\t\t\t$transit_inv=$this->db->query(\"select invoice_no from pnh_invoice_transit_log where sent_log_id=? and status=3\",$manifesto_id)->result_array();\r\n\t\t\t\t\r\n\t\t\t\tif($transit_inv)\r\n\t\t\t\t{\r\n\t\t\t\t\t$t_inv_list=array();\r\n\t\t\t\t\tforeach($transit_inv as $tinv)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$t_inv_list[]=$tinv['invoice_no'];\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$m_inv=explode(',',$manifesto_det['sent_invoices']);\r\n\t\t\t\t\t\r\n\t\t\t\t\t$not_found=0;\r\n\t\t\t\t\tforeach($m_inv as $minv)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(in_array($minv, $t_inv_list))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t$not_found=1;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!$not_found)\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\telse \r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}", "function isIdVerified($table_name=NULL,$id=NULL){\r\n\t\tif($id==null && $table_name==null) return array();\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->where(array('id'=>$id));\r\n\t\t$recordSet = $this->db->get($table_name);\r\n\t\t$data=$recordSet->result() ;\r\n\t\tif(count($data)>0){\r\n \t\t\treturn true;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}" ]
[ "0.6375174", "0.5950269", "0.5932059", "0.5866741", "0.5721588", "0.5676948", "0.5613976", "0.56112474", "0.55717045", "0.5514305", "0.54926556", "0.5478129", "0.5475195", "0.5474773", "0.54436654", "0.54330903", "0.53774047", "0.53511", "0.53507257", "0.5344483", "0.53439814", "0.53316545", "0.53259265", "0.5324189", "0.53189015", "0.5302836", "0.5279919", "0.52610725", "0.5258843", "0.5255729", "0.5243435", "0.5235004", "0.5212301", "0.52115166", "0.5206776", "0.5203358", "0.5200499", "0.51838946", "0.51781857", "0.51677877", "0.5166939", "0.5160216", "0.5159035", "0.51493484", "0.5144237", "0.5132847", "0.5130663", "0.5112479", "0.5108686", "0.5107564", "0.50959337", "0.5093637", "0.5083309", "0.5072514", "0.5070249", "0.50668913", "0.50666356", "0.5064259", "0.50636494", "0.50625426", "0.50530785", "0.5049535", "0.5044608", "0.5036311", "0.5030044", "0.5029059", "0.5020984", "0.50165814", "0.501317", "0.5008549", "0.50064754", "0.50049543", "0.50018436", "0.49986842", "0.49936986", "0.49866655", "0.49810895", "0.49739096", "0.4968657", "0.49629638", "0.49565974", "0.49542233", "0.49506143", "0.4948549", "0.49433213", "0.49392268", "0.49368444", "0.49349996", "0.49201825", "0.49148616", "0.49129176", "0.49088487", "0.49056533", "0.49033266", "0.49010214", "0.49005935", "0.4896908", "0.48923475", "0.48905715", "0.4877213" ]
0.53371793
21
Process transaction status after payment and in the webhook
public function processTransaction(Order $oOrder, $sType = 'webhook') { /** @var PaymentBase $oPaymentModel */ $oPaymentModel = $oOrder->mollieGetPaymentModel(); try { $oTransaction = $oPaymentModel->getApiEndpointByOrder($oOrder)->get($oOrder->oxorder__oxtransid->value, ["embed" => "payments"]); $aResult = $this->handleTransactionStatus($oTransaction, $oOrder, $sType); } catch(\Exception $exc) { $aResult = ['success' => false, 'status' => 'exception', 'error' => $exc->getMessage()]; } $aResult['transactionId'] = $oOrder->oxorder__oxtransid->value; $aResult['orderId'] = $oOrder->getId(); $aResult['type'] = $sType; $this->logResult($aResult); return $aResult; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function after_process() {\n\t\t $requestParamList = array(\"MID\" => MODULE_PAYMENT_PAYTM_MERCHANT_ID , \"ORDERID\" => $_POST['ORDERID']);\n\n\t\t $paytmParamsStatus = array();\n /* body parameters */\n $paytmParamsStatus[\"body\"] = array(\n /* Find your MID in your Paytm Dashboard at https://dashboard.paytm.com/next/apikeys */\n \"mid\" => $requestParamList['MID'],\n /* Enter your order id which needs to be check status for */\n \"orderId\" => $requestParamList['ORDERID'],\n );\n $checksumStatus = PaytmChecksum::generateSignature(json_encode($paytmParamsStatus[\"body\"], JSON_UNESCAPED_SLASHES), MODULE_PAYMENT_PAYTM_MERCHANT_KEY);\n /* head parameters */\n $paytmParamsStatus[\"head\"] = array(\n /* put generated checksum value here */\n \"signature\" => $checksumStatus\n );\n /* prepare JSON string for request */\n $post_data_status = json_encode($paytmParamsStatus, JSON_UNESCAPED_SLASHES);\n $paytstsusmurl = $this->paytmurl.PaytmConstants::ORDER_STATUS_URL; \n $ch = curl_init($paytstsusmurl);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data_status);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));\n $responseJson = curl_exec($ch);\n $responseStatusArray = json_decode($responseJson, true);\n\t\t if($responseStatusArray['body']['resultInfo']['resultStatus']=='TXN_SUCCESS' && $responseStatusArray['body']['txnAmount']==$_POST['TXNAMOUNT'])\n\t\t {\n\t\t \tglobal $insert_id;\n\t\t\t $status_comment=array();\n\t\t\t if(isset($_POST)){\n\t\t\t\t if(isset($_POST['ORDERID'])){\n\t\t\t\t \t$status_comment[]=\"Order Id: \" . $_POST['ORDERID'];\n\t\t\t\t }\n\t\t\t\t\n\t\t\t\t if(isset($_POST['TXNID'])){\n\t\t\t\t\t $status_comment[]=\"Paytm TXNID: \" . $_POST['TXNID'];\n\t\t\t\t }\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$sql_data_array = array('orders_id' => $insert_id,\n 'orders_status_id' => MODULE_PAYMENT_PAYTM_ORDER_STATUS_ID,\n 'date_added' => 'now()',\n 'customer_notified' => '0',\n 'comments' => implode(\"\\n\", $status_comment));\n\n\t\t\tzen_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);\n\t\t}\n\t\telse{\n\t\t\tzen_redirect(zen_href_link(FILENAME_CHECKOUT_SHIPPING, 'error_message=' . urlencode(\"It seems some issue in server to server communication. Kindly connect with administrator.\"), 'SSL', true, false));\n\t\t}\n }", "public function webhook() {\n\n\t\t$this->log( 'Fire webhook' );\n\n\t\t/* \n\t\t * Received redirect from acquiring service with succesful order status\n\t\t */\n\t\tif( $_SERVER['REQUEST_METHOD'] == 'POST' and isset( $_POST['payment_id'] ) ) {\n\n\t\t\t$this->log( 'Received callback from acquiring service with order processing status' );\n\t\t\t$this->log( print_r($_POST, true ) );\n\n\t\t\t// Get payment UUID\n\t\t\t$paymentcode = isset( $_POST['payment_id'] ) ? $_POST['payment_id'] : null;\n\n\t\t\t// Get our Order ID returned through acquiring\n\t\t\t$order_id = isset ( $_POST['cf'] ) ? $_POST['cf'] : null;\n\n\t\t\t// Get Order status (ОК, КО, CANCEL, CHARGEBACK)\n\t\t\t$status = isset ( $_POST['status'] ) ? $_POST['status'] : null;\n\n\t\t\t// Get Order signature to verify payment validity\n\t\t\t$sign = isset ( $_POST['sign'] ) ? $_POST['sign'] : null;\n\t\t\t$sign_check = md5( $this->merchant_id . $paymentcode . $status . $order_id . $this->secret_word );\n\n\t\t\t$order = wc_get_order( $order_id );\n\n\t\t\t// Validate payment data\n\t\t\tif( $sign == $sign_check ) {\n\n\t\t\t\tswitch( $status ) {\n\t\t\t\t\tcase 'OK':\n\t\t\t\t\t\t// Payment succesful\n\n\t\t\t\t\t\t// Check if Order stay in our payment method\n\t\t\t\t\t\tif( $order->get_payment_method() == $this->id ) {\n\n\t\t\t\t\t\t\t// Link acquiring payment UUID with our Order\n\t\t\t\t\t\t\tif( strlen( $paymentcode ) ) {\n\t\t\t\t\t\t\t\tupdate_post_meta( $order_id, '_' . $this->id . '_paymentcode', $paymentcode );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Set Order status to Processing\n\t\t\t\t\t\t\t$order->update_status('processing');\n\n\t\t\t\t\t\t\t$this->log( 'Payment processed sucesfully' );\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// Wrong payment method\n\t\t\t\t\t\t\t$this->log( 'Wrong payment method' );\n\t\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'КО':\n\t\t\t\t\t// Do nothing. Keep order status as is\n\t\t\t\t\t\t$this->log( 'Payment not processed' );\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'CANCEL':\n\t\t\t\t\t\t// Do nothing. Keep order status as is\n\t\t\t\t\t\t$this->log( 'Payment cancelled by acquirer' );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Clear http output. \n\t\techo '0';\n\t\texit;\n \t}", "public function webhook()\n {\n $this->paymentSettings = $this->getPaymentSettings();\n $payload = file_get_contents(\"php://input\");\n $signature = (isset($_SERVER['HTTP_X_PAYSTACK_SIGNATURE']) ? $_SERVER['HTTP_X_PAYSTACK_SIGNATURE'] : '');\n /* It is a good idea to log all events received. Add code *\n * here to log the signature and body to db or file */\n if (!$signature) {\n // only a post with paystack signature header gets our attention\n exit();\n }\n // confirm the event's signature\n if ($signature !== hash_hmac('sha512', $payload, $this->paymentSettings['secret_key'])) {\n // silently forget this ever happened\n exit();\n }\n $webhook_response = json_decode($payload, true);\n if ('charge.success' != $webhook_response['event']) {\n exit;\n }\n try {\n $orderId = $this->updatePaymentStatus($webhook_response['data']['reference']);\n } catch (Exception $e) {\n // Invalid payload\n http_response_code(400);\n exit();\n }\n http_response_code(200);\n exit();\n }", "public function transaction_process()\n {\n //treat as a robot, to avoid redirection or cookie issues.\n //shouldn't need to do this anymore\n //define('IS_ROBOT',true);\n\n //transId\n //transStatus\n // Y - successful\n // C - cancelled\n //transTime\n //authAmount\n //authCurrency\n //authAmountString\n //rawAuthMessage\n //rawAuthCode\n //callbackPW\n //cardType\n //countryString\n //countryMatch\n // Y - match\n // N - no match\n // B - comparison not available\n // I - contact country not supplied\n // S - card issue country not available\n //AVS\n // 1234\n // 1 - card verification\n // 2 - postcode AVS check\n // 3 - address AVS check\n // 4 - country comparison check\n // values\n // 0 - not supported\n // 1 - not checked\n // 2 - matched\n // 4 - not matched\n // 8 - partially matched\n //cartId\n //M_sessionId\n //M_customerId\n //name\n //address\n //postcode\n //country\n //tel\n //fax\n //email\n //amount\n //currency\n //description\n\n trigger_error('DEBUG TRANSACTION: start worldpay transaction process');\n\n $response = $_POST;\n\n //Check to make sure this is valid\n if (!($response[\"cartId\"]) && ($response[\"M_customerId\"])) {\n //Not stuff returned\n return;\n }\n\n if (strlen(trim($this->get(\"callback_password\"))) > 0) {\n if ($this->get(\"callback_password\") != $response[\"callbackPW\"]) {\n //password does not match\n return false;\n }\n }\n\n //transaction id is saved by \"cartId\"\n $trans_id = intval($response[\"cartId\"]);\n $transaction =& geoTransaction::getTransaction($trans_id);\n trigger_error('DEBUG TRANSACTION: paypal:transaction_process() - right AFTER - transaction: ' . print_r($transaction, 1));\n\n //save response data\n $transaction->set('worldpay_response', $response);\n $transaction->save();\n\n //make sure all of transaction info matches with what was passed back.\n if ($transaction->getUser() != $response[\"M_customerId\"]) {\n //something is wrong, do not proceed\n trigger_error('ERROR TRANSACTION: Invalid user set for transaction: ' . $trans_id);\n return;\n }\n if ($transaction->getGatewayTransaction() != $response[\"M_sessionId\"]) {\n //something is wrong, do not proceed\n trigger_error('ERROR TRANSACTION: Invalid session id set for transaction: ' . $trans_id);\n return;\n }\n if ($transaction->getAmount() != $response[\"authAmount\"] || $transaction->getStatus()) {\n //something is wrong, do not proceed\n trigger_error('ERROR TRANSACTION: Invalid transaction data returned for transaction: ' . $trans_id);\n return;\n }\n\n //worldpay transloads whatever result page is shown onto their own server, and displays it without CSS for \"security.\"\n //it *does* complete this POST, though, so we can go ahead right now and mark the transaction as success/failed in the database\n //but set our normal success/failure functions to not render the page -- instead echo just a redirect to transaction_result.php to return the user fully to the local site\n\n if ($response[\"transStatus\"] == \"C\") {\n //cancelled -- fail\n self::_failure($transaction, $response[\"transStatus\"], \"Worldpay said: \" . $response['rawAuthMessage'], true);\n } elseif ($response[\"transStatus\"] != \"Y\") {\n //fail\n self::_failure($transaction, $response[\"transStatus\"], \"Worldpay said: \" . $response['rawAuthMessage'], true);\n } else {\n //success\n self::_success($transaction->getInvoice()->getOrder(), $transaction, geoPaymentGateway::getPaymentGateway(self::getType()), true);\n }\n\n $db = DataAccess::getInstance();\n $target = str_replace($db->get_site_setting('classifieds_file_name'), 'transaction_result.php?transaction=' . $transaction->getId(), $db->get_site_setting('classifieds_url'));\n echo '<meta http-equiv=\"refresh\" content=\"1; url=' . $target . '\">';\n }", "public function processPayment();", "public function execute() {\n $request = $this->getRequest()->getParams();\n \n $order_id = strip_tags($request[\"orderId\"]);\n $order = $this->objectManagement->create('Magento\\Sales\\Model\\Order')->loadByIncrementId($order_id);\n $validateOrder = $this->validateWebhook($request, $order);\n\n $transactionId = $request['referenceId'];\n\n $mageOrderStatus = $order->getStatus();\n\n if($mageOrderStatus === 'pending') {\n\n if(!empty($validateOrder['status']) && $validateOrder['status'] === true) {\n if($request['txStatus'] == 'SUCCESS') {\n $request['additional_data']['cf_transaction_id'] = $transactionId;\n $this->logger->info(\"Cashfree Notify processing started for cashfree transaction_id(:$transactionId)\");\n $this->processPayment($transactionId, $order);\n $this->logger->info(\"Cashfree Notify processing complete for cashfree transaction_id(:$transactionId)\");\n return;\n } elseif($request['txStatus'] == 'FAILED' || $request['txStatus'] == 'CANCELLED') {\n $orderStatus = self::STATE_CANCELED;\n $this->processWebhookStatus($orderStatus, $order);\n $this->logger->info(\"Cashfree Notify change magento order status to (:$orderStatus) cashfree transaction_id(:$transactionId)\");\n return;\n } elseif($request['txStatus'] == 'USER_DROPPED') {\n $orderStatus = self::STATE_CLOSED;\n $this->processWebhookStatus($orderStatus, $order);\n $this->logger->info(\"Cashfree Notify change magento order status to (:$orderStatus) cashfree transaction_id(:$transactionId)\");\n return;\n } else {\n $orderStatus = self::STATE_PENDING_PAYMENT;\n $this->processWebhookStatus($orderStatus, $order);\n $this->logger->info(\"Cashfree Notify change magento order status to (:$orderStatus) cashfree transaction_id(:$transactionId)\");\n return;\n }\n } else {\n $errorMsg = $validateOrder['errorMsg'];\n $this->logger->info(\"Cashfree Notify processing payment for cashfree transaction_id(:$transactionId) is failed due to ERROR(: $errorMsg)\");\n return;\n }\n } else {\n $this->logger->info(\"Order has been already in processing state for cashfree transaction_id(:$transactionId)\");\n return;\n }\n }", "public function process_gateway_notification() {\r\n\t\t$order_id = self::get_post_var( 'OrderID' );\r\n\t\t$message = self::get_post_var( 'Message' );\r\n\t\t$status_code = self::get_post_var( 'StatusCode' );\r\n\t\t$prev_status_code = self::get_post_var( 'PreviousStatusCode' );\r\n\t\t$session_id = explode( ' ', self::get_post_var( 'OrderDescription' ) );\r\n\r\n\t\tif ( is_numeric( $status_code ) ) {\r\n\t\t\t$processed = WPSC_Purchase_Log::INCOMPLETE_SALE;\r\n\t\t\tswitch ( $status_code ) {\r\n\t\t\t\tcase PS_TRX_RESULT_SUCCESS:\r\n\t\t\t\t\t$processed = WPSC_Purchase_Log::ACCEPTED_PAYMENT;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase PS_TRX_RESULT_REFERRED:\r\n\t\t\t\t\t$processed = WPSC_Purchase_Log::PAYMENT_DECLINED;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase PS_TRX_RESULT_DECLINED:\r\n\t\t\t\t\t$processed = WPSC_Purchase_Log::PAYMENT_DECLINED;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase PS_TRX_RESULT_DUPLICATE:\r\n\t\t\t\t\t$processed = ( PS_TRX_RESULT_SUCCESS === $prev_status_code )\r\n\t\t\t\t\t\t? WPSC_Purchase_Log::ACCEPTED_PAYMENT\r\n\t\t\t\t\t\t: WPSC_Purchase_Log::PAYMENT_DECLINED;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase PS_TRX_RESULT_FAILED:\r\n\t\t\t\t\t$processed = WPSC_Purchase_Log::INCOMPLETE_SALE;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\twp_die( 'Unsupported StatusCode. Please contact support.',\r\n\t\t\t\t\t\t'Unsupported StatusCode',\r\n\t\t\t\t\t\tarray( 'response' => 400 )\r\n\t\t\t\t\t);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\t$data = array(\r\n\t\t\t\t'processed' => $processed,\r\n\t\t\t\t'transactid' => $order_id,\r\n\t\t\t\t'notes' => $message,\r\n\t\t\t\t'date' => time(),\r\n\t\t\t);\r\n\t\t\twpsc_update_purchase_log_details( $session_id[4], $data, 'sessionid' );\r\n\r\n\t\t\tswitch ( $processed ) {\r\n\t\t\t\tcase WPSC_Purchase_Log::ACCEPTED_PAYMENT:\r\n\t\t\t\t\ttransaction_results( $session_id, false, $order_id );\r\n\t\t\t\t\t// Thank you for purchasing.\r\n\t\t\t\t\t$this->go_to_transaction_results( $session_id[4] );\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase WPSC_Purchase_Log::PAYMENT_DECLINED:\r\n\t\t\t\t\t// Sorry, your transaction was not accepted.\r\n\t\t\t\t\t$this->go_to_transaction_results( null );\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\t// Thank you, your purchase is pending.\r\n\t\t\t\t\t$this->go_to_transaction_results( $session_id[4] );\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\twp_die( 'Unexpected response from the payment gateway. Please contact support.',\r\n\t\t\t\t'Unexpected response from the payment gateway',\r\n\t\t\t\tarray( 'response' => 400 )\r\n\t\t\t);\r\n\t\t}\r\n\t}", "public function callback()\n {\n \n $status = request()->status;\n\n //if payment is successful\n if ($status == 'successful') {\n \n $transactionID = Flutterwave::getTransactionIDFromCallback();\n $data = Flutterwave::verifyTransaction($transactionID); \n \n \n //{{$data =(object)$data;}};\n //return view('tickets.pay', compact('data'));\n //dd($data);\n\n }\n elseif ($status == 'cancelled'){\n //Put desired action/code after transaction has been cancelled here\n }\n else{\n\n //Put desired action/code after transaction has failed here\n }\n\n return redirect()->route('dashboard.index')->with('success', 'payment done succefuly');\n // Get the transaction from your DB using the transaction reference (txref)\n // Check if you have previously given value for the transaction. If you have, redirect to your successpage else, continue\n // Confirm that the currency on your db transaction is equal to the returned currency\n // Confirm that the db transaction amount is equal to the returned amount\n // Update the db transaction record (including parameters that didn't exist before the transaction is completed. for audit purpose)\n // Give value for the transaction\n // Update the transaction to note that you have given value for the transaction\n // You can also redirect to your success page from here\n\n }", "public function webhook(Request $request)\n {\n $verified = Flutterwave::verifyWebhook();\n \n // if it is a charge event, verify and confirm it is a successful transaction\n if ($verified && $request->event == 'charge.completed' && $request->data->status == 'successful') {\n $verificationData = Flutterwave::verifyPayment($request->data['id']);\n if ($verificationData['status'] === 'success') {\n // process for successful charge\n \n }\n \n }\n \n // if it is a transfer event, verify and confirm it is a successful transfer\n if ($verified && $request->event == 'transfer.completed') {\n \n $transfer = Flutterwave::transfers()->fetch($request->data['id']);\n \n if($transfer['data']['status'] === 'SUCCESSFUL') {\n // update transfer status to successful in your db\n } else if ($transfer['data']['status'] === 'FAILED') {\n // update transfer status to failed in your db\n // revert customer balance back\n } else if ($transfer['data']['status'] === 'PENDING') {\n // update transfer status to pending in your db\n }\n \n }\n }", "public function callback_return(){\r\n\r\n $this->log('Entering callback_return', 'info');\r\n $flowApi = $this->getFlowApi();\r\n $service = 'payment/getStatus';\r\n $method = 'GET';\r\n\r\n $token = filter_input(INPUT_POST, 'token');\r\n $params = array(\r\n \"token\" => $token\r\n );\r\n\r\n try {\r\n $this->log('Calling the flow service: '.$service);\r\n $this->log('With params: '.json_encode($params));\r\n $result = $flowApi->send($service, $params, $method);\r\n\r\n $this->log('Flow result: '.json_encode($result));\r\n\r\n if (isset($result[\"message\"])) {\r\n throw new \\Exception($result[\"message\"]);\r\n }\r\n\r\n $order_id = $result['commerceOrder'];\r\n $status = $result['status'];\r\n\r\n $order = $this->getOrder($order_id);\r\n\r\n $order_status = $order->get_status();\r\n\r\n if ($this->userCanceledPayment($status, $result)) {\r\n $this->log('User canceled the payment. Redirecting to checkout...', 'info');\r\n $this->redirectToCheckout();\r\n }\r\n\r\n $amountInStore = round(number_format($order->get_total(), 0, ',', ''));\r\n $amountPaidInFlow = $result[\"amount\"];\r\n $this->log('Amount in store: '.$amountInStore);\r\n\r\n if ($amountPaidInFlow != $amountInStore) {\r\n throw new Exception('The amount has been altered. Aborting...');\r\n }\r\n \r\n /*if($this->isTesting($result)){\r\n $this->log('Setting up the production simulation...');\r\n $this->setProductionEnvSimulation($status, $result);\r\n }*/\r\n \r\n if ($this->isPendingInFlow($status)) {\r\n\r\n $this->clearCart();\r\n\r\n if($this->userGeneratedCoupon($status, $result)){\r\n\r\n if(!empty( $this->get_option('return_url'))){\r\n $this->redirectTo($this->get_option('return_url'));\r\n }\r\n }\r\n\r\n $this->redirectToCouponGenerated($order);\r\n } elseif($this->isPaidInFlow($status)) {\r\n\r\n if($this->isPendingInStore($order_status)){\r\n\r\n $this->payOrder($order);\r\n }\r\n\r\n $this->redirectToSuccess($order);\r\n } else {\r\n\r\n if($this->isRejectedInFlow($status)){\r\n if($this->isPendingInStore($order_status)){\r\n $this->rejectOrder($order);\r\n }\r\n }\r\n\r\n if($this->isCancelledInFlow($status)){\r\n\r\n if($this->isPendingInStore($order_status)){\r\n $this->cancelOrder($order);\r\n }\r\n }\r\n\r\n $this->redirectToFailure($order);\r\n }\r\n\r\n } catch(Exception $e) {\r\n $this->log('Unexpected error: '.$e->getCode(). ' - '.$e->getMessage(), 'error');\r\n $this->redirectToError();\r\n }\r\n \r\n wp_die();\r\n }", "public function webhook_action ()\n\t{\n\t\ttry\n\t\t{\n\t\t\t$id = isset($_GET['order_id']) ? $_GET['order_id'] : 0;\n\n\t\t\tif (empty($id))\n\t\t\t{\n\t\t\t\theader(\"HTTP/1.0 404 Not Found\");\n\t\t\t\tdie(\"No order ID received\");\n\t\t\t}\n\n\t\t\t$transaction_id = $this->get_transaction_id_from_order_id($id);\n\t\t\t$payment = self::get_api()->payments->get($transaction_id);\n\n\t\t\t$this->update_status($id, $payment->status);\n\t\t\t$this->log($transaction_id, $payment->status, $id);\n\t\t}\n\t\tcatch (Mollie_API_Exception $e)\n\t\t{\n\t\t\techo \"API call failed: \" . htmlspecialchars($e->getMessage());\n\t\t}\n\n\t\tdie(\"OK\");\n\t}", "public function transaction_process()\n {\n $this->_post_vars = array_merge($_GET, $_POST);\n\n if (!isset($this->_post_vars['cart_order_id'])) {\n //process as an INS signal\n return $this->_processINS();\n }\n //Need to add <base ...> tag so it displays correctly\n geoView::getInstance()->addBaseTag = true;\n\n //VARIABLES PASSED-BACK\n //order_number - 2Checkout order number\n //card_holder_name\n //street_address\n //city\n //state\n //zip\n //country\n //email\n //phone\n //cart_order_id\n //credit_card_processed\n //total\n //ship_name\n //ship_street_address\n //ship_city\n //ship_state\n //ship_country\n //ship_zip\n trigger_error('DEBUG TRANSACTION: Top of transaction_process.');\n\n if (!$this->get('testing_mode')) {\n //check the hash\n $hash = $this->_genHash(false);\n if (!$hash || ($this->_post_vars['key'] !== $hash)) {\n //NOTE: if testing mode turned on, it will skip the normal demo mode checks.\n trigger_error('DEBUG TRANSACTION: Payment failure, secret word/MD5 hash checks failed.');\n self::_failure($transaction, 2, \"No response from server, check vendor settings\");\n return;\n }\n //gets this far, the md5 hash check passed, so safe to proceed.\n }\n\n //true if $_SERVER['HTTP_REFERER'] is blank or contains a value from $referer_array\n trigger_error('DEBUG TRANSACTION: MD5 hash check was successful.');\n\n trigger_error('DEBUG TRANSACTION: 2checkout vars: ' . print_r($this->_post_vars, 1));\n //get objects\n $transaction = geoTransaction::getTransaction($this->_post_vars['cart_order_id']);\n if (!$transaction || $transaction->getID() == 0) {\n //failed to reacquire the transaction, or transaction does not exist\n trigger_error('DEBUG TRANSACTION: Could not find transaction using: ' . $this->_post_vars['cart_order_id']);\n self::_failure($transaction, 2, \"No response from server\");\n return;\n }\n $invoice = $transaction->getInvoice();\n $order = $invoice->getOrder();\n\n //store transaction data\n $transaction->set('twocheckout_response', $this->_post_vars);\n //transaction will be saved when order is saved.\n\n if (($this->_post_vars[\"order_number\"]) && ($this->_post_vars[\"cart_order_id\"])) {\n //if ($this->_post_vars[\"credit_card_processed\"] == \"Y\")\n if (strcmp($this->_post_vars[\"credit_card_processed\"], \"Y\") == 0) {\n //CC processed ok, now do stuff on our end\n //Might want to add further checks, like to check MD5 hash (if possible),\n //or check that the total is correct.\n trigger_error('DEBUG TRANSACTION: Payment success!');\n //let the objects do their thing to make this active\n self::_success($order, $transaction, $this);\n } else {\n //error in transaction, possibly declined\n trigger_error('DEBUG TRANSACTION: Payment failure, credit card not processed.');\n self::_failure($transaction, $this->_post_vars[\"credit_card_processed\"], \"2Checkout: Card not approved\");\n }\n } else {\n trigger_error('DEBUG TRANSACTION: Payment failure, no order number or cart order ID.');\n self::_failure($transaction, 2, \"No response from server\");\n }\n }", "public function webhook()\n {\n $bodyReceived = file_get_contents('php://input');\n\n // Receive HTTP headers that you received from PayPal webhook.\n $headers = getallheaders();\n\n /**\n * Uppercase all the headers for consistency\n */\n $headers = array_change_key_case($headers, CASE_UPPER);\n\n $signatureVerification = new \\PayPal\\Api\\VerifyWebhookSignature();\n $signatureVerification->setWebhookId(env('PAYPAL_WEBHOOK_ID'));\n $signatureVerification->setAuthAlgo($headers['PAYPAL-AUTH-ALGO']);\n $signatureVerification->setTransmissionId($headers['PAYPAL-TRANSMISSION-ID']);\n $signatureVerification->setCertUrl($headers['PAYPAL-CERT-URL']);\n $signatureVerification->setTransmissionSig($headers['PAYPAL-TRANSMISSION-SIG']);\n $signatureVerification->setTransmissionTime($headers['PAYPAL-TRANSMISSION-TIME']);\n\n $webhookEvent = new \\PayPal\\Api\\WebhookEvent();\n $webhookEvent->fromJson($bodyReceived);\n $signatureVerification->setWebhookEvent($webhookEvent);\n $request = clone $signatureVerification;\n\n try {\n $output = $signatureVerification->post($this->apiContext);\n } catch(\\Exception $ex) {\n print_r($ex->getMessage());\n exit(1);\n }\n\n $verificationStatus = $output->getVerificationStatus();\n $responseArray = json_decode($request->toJSON(), true);\n\n $event = $responseArray['webhook_event']['event_type'];\n\n if ($verificationStatus == 'SUCCESS')\n {\n switch($event)\n {\n case 'BILLING.SUBSCRIPTION.CANCELLED':\n case 'BILLING.SUBSCRIPTION.SUSPENDED':\n case 'BILLING.SUBSCRIPTION.EXPIRED':\n case 'BILLING_AGREEMENTS.AGREEMENT.CANCELLED':\n\n // $user = User::where('payer_id',$responseArray['webhook_event']['resource']['payer']['payer_info']['payer_id'])->first();\n $this->updateStatus($responseArray['webhook_event']['resource']['payer']['payer_info']['payer_id'], 0);\n break;\n }\n }\n echo $verificationStatus;\n exit(0);\n }", "public function callback_confirm(){\r\n\r\n $this->log('Entering the confirm callback', 'info');\r\n\r\n try{\r\n\r\n $flowApi = $this->getFlowApi();\r\n $service = 'payment/getStatus';\r\n $method = 'GET';\r\n\r\n $token = filter_input(INPUT_POST, 'token');\r\n $params = array(\r\n \"token\" => $token\r\n );\r\n \r\n $this->log('Calling the flow service: '.$service);\r\n $this->log('With params: '.json_encode($params));\r\n $result = $flowApi->send($service, $params, $method);\r\n $this->log('Flow response: '.json_encode($result));\r\n if (isset($result[\"message\"])) {\r\n throw new \\Exception($result[\"message\"]);\r\n }\r\n\r\n $order_id = $result['commerceOrder'];\r\n $order = $this->getOrder($order_id);\r\n $status = $result['status'];\r\n\r\n $amountInStore = round(number_format($order->get_total(), 0, ',', ''));\r\n $amountPaidInFlow = $result[\"amount\"];\r\n $this->log('Amount in store: '.$amountInStore);\r\n\r\n if ($amountPaidInFlow != $amountInStore) {\r\n throw new Exception('The amount has been altered. Aborting...');\r\n }\r\n\r\n /*if($this->isTesting($result)){\r\n $this->setProductionEnvSimulation($status, $result);\r\n }*/\r\n\r\n if($this->isPendingInFlow($status)){\r\n $this->setOrderAsPending($order);\r\n }\r\n elseif($this->isPaidInFlow($status)){\r\n $this->payOrder($order);\r\n }\r\n elseif($this->isCancelledInFlow($status)){\r\n $this->cancelOrder($order);\r\n }\r\n else{\r\n $this->rejectOrder($order);\r\n }\r\n\r\n } catch(Exception $e) {\r\n error_log($e->getMessage());\r\n $this->log('Unexpected error: '.$e->getCode(). ' - '.$e->getMessage(), 'error');\r\n }\r\n }", "function it_exchange_paypal_pro_addon_process_webhook( $request ) {\n\n\t$general_settings = it_exchange_get_option( 'settings_general' );\n\t$settings = it_exchange_get_option( 'addon_paypal_pro' );\n\n\t$subscriber_id = !empty( $request['subscr_id'] ) ? $request['subscr_id'] : false;\n\t$subscriber_id = !empty( $request['recurring_payment_id'] ) ? $request['recurring_payment_id'] : $subscriber_id;\n\n\tif ( !empty( $request['txn_type'] ) ) {\n\n\t\tswitch( $request['txn_type'] ) {\n\n\t\t\tcase 'web_accept':\n\t\t\t\tswitch( strtolower( $request['payment_status'] ) ) {\n\n\t\t\t\t\tcase 'completed' :\n\t\t\t\t\t\tit_exchange_paypal_pro_addon_update_transaction_status( $request['txn_id'], $request['payment_status'] );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'reversed' :\n\t\t\t\t\t\tit_exchange_paypal_pro_addon_update_transaction_status( $request['parent_txn_id'], $request['reason_code'] );\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'subscr_payment':\n\t\t\t\tswitch( strtolower( $request['payment_status'] ) ) {\n\t\t\t\t\tcase 'completed' :\n\t\t\t\t\t\tif ( !it_exchange_paypal_pro_addon_update_transaction_status( $request['txn_id'], $request['payment_status'] ) ) {\n\t\t\t\t\t\t\t//If the transaction isn't found, we've got a new payment\n\t\t\t\t\t\t\tit_exchange_paypal_pro_addon_add_child_transaction( $request['txn_id'], $request['payment_status'], $subscriber_id, $request['mc_gross'] );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t//If it is found, make sure the subscriber ID is attached to it\n\t\t\t\t\t\t\tit_exchange_paypal_pro_addon_update_subscriber_id( $request['txn_id'], $subscriber_id );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tit_exchange_paypal_pro_addon_update_subscriber_status( $subscriber_id, 'active' );\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'subscr_signup':\n\t\t\t\tit_exchange_paypal_pro_addon_update_subscriber_status( $subscriber_id, 'active' );\n\t\t\t\tbreak;\n\n\t\t\tcase 'recurring_payment_suspended':\n\t\t\t\tit_exchange_paypal_pro_addon_update_subscriber_status( $subscriber_id, 'suspended' );\n\t\t\t\tbreak;\n\n\t\t\tcase 'subscr_cancel':\n\t\t\t\tit_exchange_paypal_pro_addon_update_subscriber_status( $subscriber_id, 'cancelled' );\n\t\t\t\tbreak;\n\n\t\t\tcase 'subscr_eot':\n\t\t\t\tit_exchange_paypal_pro_addon_update_subscriber_status( $subscriber_id, 'deactivated' );\n\t\t\t\tbreak;\n\n\t\t}\n\n\t} else {\n\n\t\t//These IPNs don't have txn_types, why PayPal!? WHY!?\n\t\tif ( !empty( $request['reason_code'] ) ) {\n\n\t\t\tswitch( $request['reason_code'] ) {\n\n\t\t\t\tcase 'refund' :\n\t\t\t\t\tit_exchange_paypal_pro_addon_update_transaction_status( $request['parent_txn_id'], $request['payment_status'] );\n\t\t\t\t\tit_exchange_paypal_pro_addon_add_refund_to_transaction( $request['parent_txn_id'], $request['mc_gross'] );\n\t\t\t\t\tif ( $subscriber_id )\n\t\t\t\t\t\tit_exchange_paypal_pro_addon_update_subscriber_status( $subscriber_id, 'refunded' );\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n}", "private function __processTransaction($txnId){\n\t\t$this->log(\"Processing Trasaction: {$txnId}\", 'paypal');\n\t\t//Put the afterPaypalNotification($txnId) into your app_controller.php\n\t\t$this->afterPaypalNotification($txnId);\n\t}", "public function callback(){\n $data = Rave::verifyTransaction(request()->txref);\n dd($data); // view the data response\n if ($data->status == 'success') {\n if(session()->get($this->requestVar)['']['page_type'] == 'cart'){\n $cartCollection = Cart::getContent();\n $payer = new Payer();\n $payer->setPaymentMethod('flutterwave');\n \n $item_1 = new Item();\n \n $item_1->setName(__('messages.site_name')) \n ->setCurrency('USD')\n ->setQuantity(1)\n ->setPrice($request->get('total_price_pal')); \n \n $item_list = new ItemList();\n $item_list->setItems(array($item_1));\n \n $amount = new Amount();\n $amount->setCurrency('USD')\n ->setTotal($request->get('total_price_pal'));\n \n $transaction = new Transaction();\n $transaction->setAmount($amount)\n ->setItemList($item_list)\n ->setDescription('Your transaction description');\n \n $redirect_urls = new RedirectUrls();\n $redirect_urls->setReturnUrl(URL::route('status')) \n ->setCancelUrl(URL::route('status'));\n \n $payment = new Payment();\n $payment->setIntent('Sale')\n ->setPayer($payer)\n ->setRedirectUrls($redirect_urls)\n ->setTransactions(array($transaction));\n try {\n $payment->create($this->_api_context);\n } catch (\\PayPal\\Exception\\PPConnectionException $ex) {\n if (\\Config::get('app.debug')) {\n \\Session::put('error',__('successerr.connection_timeout'));\n return Redirect::route('paywithpaypal');\n \n } else {\n \\Session::put('error',__('successerr.error1'));\n return Redirect::route('paywithpaypal');\n \n }\n }\n \n foreach($payment->getLinks() as $link) {\n if($link->getRel() == 'approval_url') {\n $redirect_url = $link->getHref();\n $data=array();\n $finalresult=array();\n $result=array();\n $input = $request->input();\n $cartCollection = Cart::getContent();\n $setting=Setting::find(1);\n $gettimezone=$this->gettimezonename($setting->timezone);\n date_default_timezone_set($gettimezone);\n $date = date('d-m-Y H:i');\n $getuser=AppUser::find(Session::get('login_user'));\n $store=new Order();\n $store->user_id=$getuser->id;\n \n $store->total_price=number_format($request->get(\"total_price_pal\"), 2, '.', '');\n $store->order_placed_date=$date;\n $store->order_status=0;\n \n $store->latlong= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"lat_long_or\")));\n $store->name=$getuser->name;\n \n $store->address=strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"address_pal\")));\n $store->email=$getuser->email;\n \n $store->payment_type= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"payment_type_pal\")));\n \n $store->notes=strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"note_or\")));\n \n $store->city= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"city_or\")));\n \n $store->shipping_type= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"shipping_type_pal\")));\n \n $store->subtotal=number_format($request->get(\"subtotal_pal\"), 2, '.', '');\n \n $store->delivery_charges=number_format($request->get(\"charage_pal\"), 2, '.', '');\n \n $store->phone_no= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"phone_pal\")));\n $store->pay_pal_paymentId=$payment->getId();\n $store->delivery_mode=$store->shipping_type;\n $store->notify=1;\n $store->save();\n foreach ($cartCollection as $ke) {\n $getmenu=itemli::where(\"menu_name\",$ke->name)->first();\n $result['ItemId']=(string)isset($getmenu->id)?$getmenu->id:0;\n $result['ItemName']=(string)$ke->name;\n $result['ItemQty']=(string)$ke->quantity;\n $result['ItemAmt']=number_format($ke->price, 2, '.', '');\n $totalamount=(float)$ke->quantity*(float)$ke->price;\n $result['ItemTotalPrice']=number_format($totalamount, 2, '.', '');\n $ingredient=array();\n $inter_ids=array();\n foreach ($ke->attributes[0] as $val) {\n $ls=array();\n $inter=Ingredient::find($val);\n $ls['id']=(string)$inter->id;\n $inter_ids[]=$inter->id;\n $ls['category']=(string)$inter->category;\n $ls['item_name']=(string)$inter->item_name;\n $ls['type']=(string)$inter->type;\n $ls['price']=(string)$inter->price;\n $ls['menu_id']=(string)$inter->menu_id;\n $ingredient[]=$ls;\n }\n \n $result['Ingredients']=$ingredient;\n $finalresult[]=$result;\n $adddesc=new OrderResponse();\n $adddesc->set_order_id=$store->id;\n $adddesc->item_id=$result[\"ItemId\"];\n $adddesc->item_qty=$result[\"ItemQty\"];\n $adddesc->ItemTotalPrice=number_format($result[\"ItemTotalPrice\"], 2, '.', '');\n $adddesc->item_amt=$result[\"ItemAmt\"];\n $adddesc->ingredients_id=implode(\",\",$inter_ids);\n $adddesc->save();\n }\n $data=array(\"Order\"=>$finalresult);\n $addresponse=new FoodOrder();\n $addresponse->order_id=$store->id;\n $addresponse->desc=json_encode($data);\n $addresponse->save();\n \n break;\n }\n }\n \n } \n \n \n \n //Payment from basket checkout page\n \n if(session()->get($this->requestVar)['']['page_type'] == 'basket'){\n $cartCollection = Cart::getContent();\n $payer = new Payer();\n $payer->setPaymentMethod('flutterwave');\n \n $item_1 = new Item();\n \n $item_1->setName(__('messages.site_name')) \n ->setCurrency('USD')\n ->setQuantity(1)\n ->setPrice($request->get('total_price_pal')); \n \n $item_list = new ItemList();\n $item_list->setItems(array($item_1));\n \n $amount = new Amount();\n $amount->setCurrency('USD')\n ->setTotal($request->get('total_price_pal'));\n \n $transaction = new Transaction();\n $transaction->setAmount($amount)\n ->setItemList($item_list)\n ->setDescription('Your transaction description');\n \n $redirect_urls = new RedirectUrls();\n $redirect_urls->setReturnUrl(URL::route('status')) \n ->setCancelUrl(URL::route('status'));\n \n $payment = new Payment();\n $payment->setIntent('Sale')\n ->setPayer($payer)\n ->setRedirectUrls($redirect_urls)\n ->setTransactions(array($transaction));\n try {\n $payment->create($this->_api_context);\n } catch (\\PayPal\\Exception\\PPConnectionException $ex) {\n if (\\Config::get('app.debug')) {\n \\Session::put('error',__('successerr.connection_timeout'));\n return Redirect::route('paywithpaypal');\n \n } else {\n \\Session::put('error',__('successerr.error1'));\n return Redirect::route('paywithpaypal');\n \n }\n }\n \n foreach($payment->getLinks() as $link) {\n if($link->getRel() == 'approval_url') {\n $redirect_url = $link->getHref();\n $data=array();\n $finalresult=array();\n $result=array();\n $input = $request->input();\n $cartCollection = Cart::getContent();\n $setting=Setting::find(1);\n $gettimezone=$this->gettimezonename($setting->timezone);\n date_default_timezone_set($gettimezone);\n $date = date('d-m-Y H:i');\n $getuser=AppUser::find(Session::get('login_user'));\n $store=new Order();\n $store->user_id=$getuser->id;\n \n $store->total_price=number_format($request->get(\"total_price_pal\"), 2, '.', '');\n $store->order_placed_date=$date;\n $store->order_status=0;\n \n $store->latlong= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"lat_long_or\")));\n $store->name=$getuser->name;\n \n $store->address=strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"address_pal\")));\n $store->email=$getuser->email;\n \n $store->payment_type= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"payment_type_pal\")));\n \n $store->notes=strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"note_or\")));\n \n $store->city= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"city_or\")));\n \n $store->shipping_type= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"shipping_type_pal\")));\n \n $store->subtotal=number_format($request->get(\"subtotal_pal\"), 2, '.', '');\n \n $store->delivery_charges=number_format($request->get(\"charage_pal\"), 2, '.', '');\n \n $store->phone_no= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"phone_pal\")));\n $store->pay_pal_paymentId=$payment->getId();\n $store->delivery_mode=$store->shipping_type;\n $store->notify=1;\n $store->save();\n foreach ($cartCollection as $ke) {\n $getmenu=itemli::where(\"menu_name\",$ke->name)->first();\n $result['ItemId']=(string)isset($getmenu->id)?$getmenu->id:0;\n $result['ItemName']=(string)$ke->name;\n $result['ItemQty']=(string)$ke->quantity;\n $result['ItemAmt']=number_format($ke->price, 2, '.', '');\n $totalamount=(float)$ke->quantity*(float)$ke->price;\n $result['ItemTotalPrice']=number_format($totalamount, 2, '.', '');\n $ingredient=array();\n $inter_ids=array();\n foreach ($ke->attributes[0] as $val) {\n $ls=array();\n $inter=Ingredient::find($val);\n $ls['id']=(string)$inter->id;\n $inter_ids[]=$inter->id;\n $ls['category']=(string)$inter->category;\n $ls['item_name']=(string)$inter->item_name;\n $ls['type']=(string)$inter->type;\n $ls['price']=(string)$inter->price;\n $ls['menu_id']=(string)$inter->menu_id;\n $ingredient[]=$ls;\n }\n \n $result['Ingredients']=$ingredient;\n $finalresult[]=$result;\n $adddesc=new OrderResponse();\n $adddesc->set_order_id=$store->id;\n $adddesc->item_id=$result[\"ItemId\"];\n $adddesc->item_qty=$result[\"ItemQty\"];\n $adddesc->ItemTotalPrice=number_format($result[\"ItemTotalPrice\"], 2, '.', '');\n $adddesc->item_amt=$result[\"ItemAmt\"];\n $adddesc->ingredients_id=implode(\",\",$inter_ids);\n $adddesc->save();\n }\n $data=array(\"Order\"=>$finalresult);\n $addresponse=new FoodOrder();\n $addresponse->order_id=$store->id;\n $addresponse->desc=json_encode($data);\n $addresponse->save();\n \n break;\n }\n }\n \n \n }\n \n }\n }", "public function webhook(){\r\n\t\t\r\n\t\t$json = array();\r\n\r\n\t\tif($this->request->server['REQUEST_METHOD'] == 'POST'){\r\n\t\t\t\r\n\t\t\t$post = array();\r\n\t\t\tif(isset($this->request->post['coin_short_name']) && $this->request->post['coin_short_name'] != '' && isset($this->request->post['address']) && $this->request->post['address'] != '' && isset($this->request->post['type']) && $this->request->post['type'] != ''){\r\n\t\t\t\t$post = $this->request->post;\r\n\t\t\t}else{\r\n\t\t\t\t$post_json = json_decode(file_get_contents('php://input'),TRUE);\r\n\r\n\t\t\t\tif(isset($post_json['coin_short_name']) && $post_json['coin_short_name'] != '' && isset($post_json['address']) && $post_json['address'] != '' && isset($post_json['type']) && $post_json['type'] != '' ){\r\n\t\t\t\t\t$post = $post_json;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$json['flag'] = 0;\r\n\t\t\t\t\t$json['msg'] = \"Required paramters are not found\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(!empty($post)){\r\n\r\n\t\t\t\tif($post['type'] == 'receive'){\r\n\t\t\t\t\t$this->load->model('checkout/order');\r\n\r\n\t\t\t\t\t$address = $post['address'];\r\n\r\n\t\t\t\t\t/*** check if address exists in oc_coinremitter_order ***/\r\n\t\t\t\t\t$this->load->model('extension/coinremitter/payment/coinremitter');\r\n\t\t\t\t\t$order_info = $this->model_extension_coinremitter_payment_coinremitter->getOrderByAddress($address);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!empty($order_info)){\r\n\r\n\t\t\t\t\t\tif($order_info['payment_status'] == 'pending' || $order_info['payment_status'] == 'under paid'){\r\n\r\n\t\t\t\t\t\t\t$orderId = $order_info['order_id'];\r\n\r\n\t\t\t\t\t\t\t$order_cart = $this->model_checkout_order->getOrder($orderId);\r\n\t\t\t\t\t\t\tif(!empty($order_cart)){\r\n\r\n\t\t\t\t\t\t\t\t/*** check if expired time of invoice is defined or not. If defined then check if invoice has any transaction or not. If no transaction is found and invoice time is expired then change invoice status as expired ***/\r\n\r\n\t\t\t\t\t\t\t\t/*** Get webhook by address***/\r\n\t\t\t\t\t\t\t\t$status = '';\r\n\t\t\t\t\t\t\t\tif(isset($order_info['expire_on']) && $order_info['expire_on'] != ''){\r\n\t\t\t\t\t\t\t\t\tif(time() >= strtotime($order_info['expire_on'])){\r\n\t\t\t\t\t\t\t\t\t\t$getWebhookByAddressRes = $this->model_extension_coinremitter_payment_coinremitter->getWebhookByAddress($address);\t\r\n\t\t\t\t\t\t\t\t\t\tif(empty($getWebhookByAddressRes)){\r\n\t\t\t\t\t\t\t\t\t\t\t//update payment_status,status as expired\r\n\t\t\t\t\t\t\t\t\t\t\t$status = 'expired';\r\n\t\t\t\t\t\t\t\t\t\t\t$update_arr = array('payment_status' => $status);\r\n\t\t\t\t\t\t\t\t\t\t\t$this->model_extension_coinremitter_payment_coinremitter->updateOrder($orderId,$update_arr);\r\n\t\t\t\t\t\t\t\t\t\t\t$update_arr = array('status' => ucfirst($status));\r\n\t\t\t\t\t\t\t\t\t\t\t$this->model_extension_coinremitter_payment_coinremitter->updatePaymentStatus($orderId,$update_arr);\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\tif($order_cart['order_status'] != 'Canceled'){\r\n\t\t\t\t\t\t\t\t\t\t\t\t/*** Update order history status to canceled, add comment ***/\r\n\t\t\t\t\t\t $comments = 'Order #'.$orderId;\r\n\t\t\t\t\t\t $is_customer_notified = true;\r\n\t\t\t\t\t\t $this->model_checkout_order->addHistory($orderId, 7, $comments, $is_customer_notified); // 7 = Canceled\t\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tif($status == ''){\r\n\r\n\t\t\t\t\t\t\t\t\t$coin = $post['coin_short_name'];\r\n\t\t\t\t\t\t\t\t\t$trxId = $post['id'];\r\n\r\n\t\t\t\t\t\t\t\t\t/*** now get wallet data from oc_coinremitter_wallet with use of coin ***/\r\n\t\t\t\t\t\t\t\t\t$wallet_info = $this->model_extension_coinremitter_payment_coinremitter->getWallet($coin);\r\n\t\t\t\t\t\t\t\t\tif(!empty($wallet_info)){\r\n\r\n\t\t\t\t\t\t\t\t\t\t/*** now get transaction from coinremitter api call ***/\r\n\t\t\t\t\t\t\t\t\t\t$get_trx_params = array(\r\n\t\t\t\t\t\t\t\t\t\t\t'url'\t\t=> 'get-transaction',\r\n\t\t\t\t\t\t\t\t\t\t\t'api_key'\t=>\t$wallet_info['api_key'],\r\n\t\t\t\t\t\t 'password'\t=>\t$wallet_info['password'],\r\n\t\t\t\t\t\t 'id'\t\t=>\t$trxId,\r\n\t\t\t\t\t\t 'coin'\t\t=>\t$coin\r\n\t\t\t\t\t\t\t\t\t\t);\r\n\r\n\t\t\t\t\t\t\t\t\t\t$getTransaction = $this->obj_curl->commonApiCall($get_trx_params);\r\n\t\t\t\t\t\t\t\t\t\tif(!empty($getTransaction) && isset($getTransaction['flag']) && $getTransaction['flag'] == 1){\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t$transaction = $getTransaction['data'];\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tif(isset($transaction['type']) && $transaction['type'] == 'receive'){\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t/*** now check if transaction exists in oc_coinremitter_webhook or not if does not exist then insert else update confirmations ***/\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$webhook_info = $this->model_extension_coinremitter_payment_coinremitter->getWebhook($transaction['id']);\r\n\t\t\t\t\t\t\t\t\t\t\t\tif(empty($webhook_info)){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t//insert record\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$insert_arr = array(\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'order_id' => $orderId,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'address' => $transaction['address'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'transaction_id' => $transaction['id'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'txId' => $transaction['txid'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'explorer_url' => $transaction['explorer_url'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'paid_amount' => $transaction['amount'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'coin' => $transaction['coin_short_name'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'confirmations' => $transaction['confirmations'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'paid_date' => $transaction['date']\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$inserted_id = $this->model_extension_coinremitter_payment_coinremitter->addWebhook($insert_arr);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif($inserted_id > 0){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$json['flag'] = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$json['msg'] = \"Inserted successfully\";\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$json['flag'] = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$json['msg'] = \"system error. Please try again later.\";\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t//update confirmations if confirmation is less than 3\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif($webhook_info['confirmations'] < 3){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$update_confirmation = array(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'confirmations' => $transaction['confirmations'] <= 3 ? $transaction['confirmations'] : 3 \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->model_extension_coinremitter_payment_coinremitter->updateTrxConfirmation($webhook_info['transaction_id'],$update_confirmation);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t} \r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$json['flag'] = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$json['msg'] = \"confirmations updated successfully\";\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t/*** order paid process start ***/\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t/*** Now, get all webhook transactions which have lesser than 3 confirmations ***/\r\n\t\t\t\t\t\t\t\t\t\t\t\t$webhook_res = $this->model_extension_coinremitter_payment_coinremitter->getSpecificWebhookTrxByAddress($address);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t/*** Get wallet info if and only if webhook_res has atleast one data ***/\r\n\t\t\t\t\t\t\t\t\t\t\t\tif(!empty($webhook_res)){\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ($webhook_res as $webhook) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/*** Get confirmation from coinremitter api (get-transaction) ***/\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$get_trx_params['id'] = $webhook['transaction_id']; \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$getTransactionRes = $this->obj_curl->commonApiCall($get_trx_params);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(!empty($getTransactionRes) && isset($getTransactionRes['flag']) && $getTransactionRes['flag'] == 1){\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$transactionData = $getTransactionRes['data'];\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$update_confirmation = array(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'confirmations' => $transactionData['confirmations'] <= 3 ? $transactionData['confirmations'] : 3 \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->model_extension_coinremitter_payment_coinremitter->updateTrxConfirmation($webhook['transaction_id'],$update_confirmation);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t/*** Get sum of paid amount of all transations which have 3 or more than 3 confirmtions ***/\r\n\t\t\t\t\t\t\t\t\t\t\t\t$total_paid_res = $this->model_extension_coinremitter_payment_coinremitter->getTotalPaidAmountByAddress($address);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t$total_paid = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\tif(isset($total_paid_res['total_paid']) && $total_paid_res['total_paid'] > 0 ){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$total_paid = $total_paid_res['total_paid'];\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$status = '';\r\n\t\t\t\t\t\t\t\t\t\t\t\tif($total_paid == $order_info['crp_amount']){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$status = 'paid';\r\n\t\t\t\t\t\t\t\t\t\t\t\t}else if($total_paid > $order_info['crp_amount']){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$status = 'over paid';\r\n\t\t\t\t\t\t\t\t\t\t\t\t}else if($total_paid != 0 && $total_paid < $order_info['crp_amount']){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$status = 'under paid';\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\tif($status != ''){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t//update payment_status,status\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$update_arr = array('payment_status' => $status);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$this->model_extension_coinremitter_payment_coinremitter->updateOrder($orderId,$update_arr);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$update_arr = array('status' => ucfirst($status));\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$this->model_extension_coinremitter_payment_coinremitter->updatePaymentStatus($orderId,$update_arr);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif($status == 'paid' || $status == 'over paid' || $status == 'under paid'){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/*** Update order status as complete ***/\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->add_order_success_history($orderId);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t/*** order paid process end ***/\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\t\t\t$json['flag'] = 0; \r\n\t\t\t\t\t\t\t\t\t\t\t\t$json['msg'] = 'Transaction type is not receive';\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\t\t$msg = 'Something went wrong while getting transactions. Please try again later'; \r\n\t\t\t\t\t\t\t\t\t\t\tif(isset($getTransaction['msg']) && $getTransaction['msg'] != ''){\r\n\t\t\t\t\t\t\t\t\t\t\t\t$msg = $getTransaction['msg']; \r\n\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\t$json['flag'] = 0; \r\n\t\t\t\t\t\t\t\t\t\t\t$json['msg'] = $msg; \r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\t$json['flag'] = 0;\r\n\t\t\t\t\t\t\t\t\t\t$json['msg'] = \"Wallet not found\";\t\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t$json['flag'] = 0;\r\n\t\t\t\t\t\t\t\t\t$json['msg'] = \"Order is expired\";\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t$json['flag'] = 0;\r\n\t\t\t\t\t\t\t\t$json['msg'] = \"Order not found\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t$json['flag'] = 0;\r\n\t\t\t\t\t\t\t$json['msg'] = \"Order status is neither a 'pending' nor a'under paid'\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t$json['flag'] = 0;\r\n\t\t\t\t\t\t$json['msg'] = \"Address not found\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$json['flag'] = 0;\r\n\t\t\t\t\t$json['msg'] = \"Invalid type\";\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t$json['flag'] = 0;\r\n\t\t\t\t$json['msg'] = \"Required paramters are not found\";\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t$json['flag'] = 0;\r\n\t\t\t$json['msg'] = \"Only post request allowed\";\r\n\t\t}\r\n\t\t\r\n\t\t$this->response->addHeader('Content-Type: application/json');\r\n\t\t$this->response->setOutput(json_encode($json));\r\n\t}", "function handle_transaction()\n\t{\t\n\t\tif ((file_exists(get_file_base().'/data_custom/ecommerce.log')) && (is_writable_wrap(get_file_base().'/data_custom/ecommerce.log')))\n\t\t{\n\t\t\t$myfile=fopen(get_file_base().'/data_custom/ecommerce.log','at');\n\t\t\tfwrite($myfile,serialize($_POST).chr(10));\n\t\t\tfclose($myfile);\n\t\t}\n\n\t\t// assign posted variables to local variables\n\t\t$purchase_id=post_param('custom','-1');\n\n\t\t$txn_type=post_param('txn_type',NULL);\n\n\t\tif ($txn_type=='cart')\n\t\t{\t\n\t\t\trequire_lang('shopping');\n\t\t\t$item_name=do_lang('CART_ORDER',$purchase_id);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$item_name=(substr(post_param('txn_type',''),0,6)=='subscr')?'':post_param('item_name','');\n\t\t}\n\n\t\t$payment_status=post_param('payment_status',''); // May be blank for subscription\n\t\t$reason_code=post_param('reason_code','');\n\t\t$pending_reason=post_param('pending_reason','');\n\t\t$memo=post_param('memo','');\n\t\t$mc_gross=post_param('mc_gross',''); // May be blank for subscription\n\t\t$tax=post_param('tax','');\n\t\tif (($tax!='') && (intval($tax)>0) && ($mc_gross!='')) $mc_gross=float_to_raw_string(floatval($mc_gross)-floatval($tax));\n\t\t$mc_currency=post_param('mc_currency',''); // May be blank for subscription\n\t\t$txn_id=post_param('txn_id',''); // May be blank for subscription\n\t\t$parent_txn_id=post_param('parent_txn_id','-1');\n\t\t$receiver_email=post_param('receiver_email',null);\n\t\tif ($receiver_email===null) $receiver_email=post_param('business');\n\n\t\t// post back to PayPal system to validate\n\t\tif (!ecommerce_test_mode())\n\t\t{\n\t\t\trequire_code('files');\n\t\t\t$pure_post=isset($GLOBALS['PURE_POST'])?$GLOBALS['PURE_POST']:$_POST;\n\t\t\t$x=0;\n\t\t\t$res=mixed();\n\t\t\tdo\n\t\t\t{\n\t\t\t\t$res=http_download_file('https://'.(ecommerce_test_mode()?'www.sandbox.paypal.com':'www.paypal.com').'/cgi-bin/webscr',NULL,false,false,'ocPortal',$pure_post+array('cmd'=>'_notify-validate'));\n\t\t\t\t$x++;\n\t\t\t}\n\t\t\twhile ((is_null($res)) && ($x<3));\n\t\t\tif (is_null($res)) my_exit(do_lang('IPN_SOCKET_ERROR'));\n\t\t\tif (!(strcmp($res,'VERIFIED')==0))\n\t\t\t{\n\t\t\t\tif (post_param('txn_type','')=='send_money') exit('Unexpected'); // PayPal has been seen to mess up on send_money transactions, making the IPN unverifiable\n\t\t\t\tmy_exit(do_lang('IPN_UNVERIFIED').' - '.$res.' - '.flatten_slashed_array($pure_post),strpos($res,'<html')!==false);\n\t\t\t}\n\t\t}\n\n\t\t$txn_type=str_replace('-','_',post_param('txn_type'));\n\t\tif ($txn_type=='subscr-modify')\n\t\t{\n\t\t\t$payment_status='SModified';\n\t\t\t$txn_id=post_param('subscr_id').'-m';\n\t\t}\n\t\telseif ($txn_type=='subscr_signup')\n\t\t{\n\t\t\t$payment_status='Completed';\n\t\t\t$mc_gross=post_param('mc_amount3');\n\t\t\tif (post_param_integer('recurring')!=1) my_exit(do_lang('IPN_SUB_RECURRING_WRONG'));\n\t\t\t$txn_id=post_param('subscr_id');\n\t\t}\n\t\telseif ($txn_type=='subscr_eot' || $txn_type=='recurring_payment_suspended_due_to_max_failed_payment')\n\t\t{\n\t\t\t$payment_status='SCancelled';\n\t\t\t$txn_id=post_param('subscr_id').'-c';\n\t\t}\n\t\telseif ($txn_type=='subscr_payment' || $txn_type=='subscr_failed' || $txn_type=='subscr_cancel')\n\t\t{\n\t\t\texit();\n\t\t}\n\n\t\t$primary_paypal_email=get_value('primary_paypal_email');\n\n\t\tif (!is_null($primary_paypal_email))\n\t\t{\n\t\t\tif ($receiver_email!=$primary_paypal_email) my_exit(do_lang('IPN_EMAIL_ERROR'));\n\t\t} else\n\t\t{\n\t\t\tif ($receiver_email!=$this->_get_payment_address()) my_exit(do_lang('IPN_EMAIL_ERROR'));\n\t\t}\n\n\t\tif (addon_installed('shopping'))\n\t\t{\n\t\t\tif (preg_match('#'.str_replace('xxx','.*',preg_quote(do_lang('shopping:CART_ORDER','xxx'),'#')).'#',$item_name)!=0)\n\t\t\t{\n\t\t\t\t$this->store_shipping_address($purchase_id);\n\t\t\t}\n\t\t}\n\n\t\treturn array($purchase_id,$item_name,$payment_status,$reason_code,$pending_reason,$memo,$mc_gross,$mc_currency,$txn_id,$parent_txn_id);\n\t}", "abstract protected function handlePayment();", "private function processPayment($data){\n $p_cust_id_cliente = env('EPAYCO_P_CUST_ID_CLIENTE');\n $p_key = env('EPAYCO_P_KEY');\n $x_ref_payco = $data->x_ref_payco;\n $x_transaction_id = $data->x_transaction_id;\n $x_amount = $data->x_amount;\n $x_currency_code = $data->x_currency_code;\n $x_signature = $data->x_signature;\n $signature = hash('sha256', $p_cust_id_cliente . '^' . $p_key . '^' . $x_ref_payco . '^' . $x_transaction_id . '^' . $x_amount . '^' . $x_currency_code);\n $x_response = $data->x_response;\n $x_response_reason_text = $data->x_response_reason_text;\n $x_id_invoice = $data->x_id_invoice;\n $x_autorizacion = $data->x_approval_code;\n\n //Validamos la firma\n if ($x_signature != $signature) {\n die(\"Firma no valida\");\n }\n\n $this->saveTransaction($data);\n NotificationController::notify('delivery', $data->x_extra3, $x_amount,$data->x_extra5,\"0\");\n\n return response()->json([\n 'success' => true,\n 'message' => 'transacción procesada'\n ],200);\n\n }", "public function paypalWebhookHandler(Request $request)\n {\n \t$input = @file_get_contents(\"php://input\");\n \t\t$event = json_decode($input);\n \t\tif (isset($event) && $event->event_type=='PAYMENT.SALE.COMPLETED') {\n \t\t\t$subscriptionId = $event->resource->billing_agreement_id;\n \t\t\t$patmentDetails = PaymentDetail::where('payment_id', $subscriptionId)->where('payment_status', 'initiated')->first();\n \t\t\tif (!isset($patmentDetails->payment_id)) {\n \t\t\t\treturn \"Payment Details not found.\";\n \t\t\t}\n \t\t\t$paymentData = json_decode($paymentDetails->payment_data);\n \t\t\tif (!is_object($payment_data)) {\n \t\t\t\treturn \"Invalid payment details.\";\n \t\t\t}\n \t\t\t$email = $paymentData->payerEmail;\n \t\t\t$userData = User::where('paypal_email', $email)->first();\n \t\t\tif (!isset($userId->id)) {\n \t\t\t\treturn \"User data not found.\";\n \t\t\t}\n \t\t\t$userId = $userData->id;\n \t\t\tPaymentDetail::where('pay_id', $patmentDetails->pay_id)->where('payment_using', 'paypal')->update(['payment_status'=>'completed', 'updated_ip'=>$request->ip()]);\n \t\t\t$data = array(\n\t\t\t\t'payment_id'=>$subscriptionId,\n\t\t\t\t'payment_using'=>'paypal',\n\t\t\t\t'payment_status'=>'success',\n\t\t\t\t'payment_data'=>json_encode($patmentDetails->payment_data),\n\t\t\t\t'created_ip'=>$request->ip()\n\t\t\t);\n\t\t\t$paymentId = PaymentDetail::insertGetId($data);\n \t\t\t$dataForSubscription = array(\n\t\t\t\t'payment_id'=>$paymentId,\n\t\t\t\t'user_id'=>$userId,\n\t\t\t\t'plan_id'=>$paymentData->planId,\n\t\t\t\t'is_active'=>1,\n\t\t\t\t'next_payment_date'=>date(\"Y-m-d H:i:s\", strtotime('+1 months'))\n\t\t\t);\n\t\t\tUserSubscription::where('user_id', $userId)->update(['is_active'=>0]);\n\t\t\tUserSubscription::insert($dataForSubscription);\n\t\t\treturn \"Subscription updated successfully !\";\n \t\t}else if (isset($event) && ($event->event_type=='PAYMENT.SALE.DENIED')) {\n\t\t\t/*For unsuccessfull payment/renew*/\n\t\t\t$subscriptionId = $event->resource->billing_agreement_id;\n\t\t\t$patmentDetails = PaymentDetail::where('payment_id', $subscriptionId)->first();\n \t\t\tif (!isset($patmentDetails->payment_id)) {\n \t\t\t\treturn \"Payment Details not found.\";\n \t\t\t}\n \t\t\t$paymentData = json_decode($paymentDetails->payment_data);\n \t\t\tif (!is_object($payment_data)) {\n \t\t\t\treturn \"Invalid payment details.\";\t\n \t\t\t}\n \t\t\t$email = $paymentData->payerEmail;\n \t\t\t$userData = User::where('paypal_email', $email)->first();\n \t\t\tif (!isset($userId->id)) {\n \t\t\t\treturn \"User data not found!\";\n \t\t\t}\n \t\t\t$userId = $userData->id;\n\t\t\tUserSubscription::where('user_id', $userId)->update(['is_active'=>0]);\n\t\t\treturn \"User subscription renew failed.\";\n \t\t}else{\n\t\t\treturn \"Event not handled in webhook.\";\n \t\t\tdie();\n\t\t}\n }", "function successpayment()\n {\n\n /* Check for allowed IP */\n if ($this->config['allow_ip']) {\n $allowed_ip = explode(',', $this->config['allow_ip']);\n $valid_ip = in_array($_SERVER['REMOTE_ADDR'], $allowed_ip);\n if (!$valid_ip) {\n // TODO log\n return false;\n }\n }\n\n $response['orderId'] = $_POST['orderId'];\n $response['serviceName'] = $_POST['serviceName'];\n $response['eshopAccount'] = $_POST['eshopAccount'];\n $response['paymentStatus'] = $_POST['paymentStatus'];\n $response['userName'] = $_POST['userName'];\n $response['userEmail'] = $_POST['userEmail'];\n $response['paymentData'] = $_POST['paymentData'];\n $response['hash'] = $_POST['hash'];\n\n if (!empty($response['hash'])) {\n\n $order = uc_order_load($response['orderId']);\n if (!count($order))\n trigger_error('RBK Money : Полученный orderId (' . $response['orderId'] . ') не найден в базе', E_USER_WARNING);\n\n $string = $this->config['eshopId'] . '::' . $response['orderId'] . '::' . $response['serviceName'] . '::' . $response['eshopAccount'] . '::' . number_format($order->order_total, 2, '.', '') . '::' . $this->config['recipientCurrency'] . '::' . $response['paymentStatus'] . '::' . $response['userName'] . '::' . $response['userEmail'] . '::' . $response['paymentData'] . '::' . $this->config['secretKey'];\n $crc = md5($string);\n\n if ($response['hash'] == $crc) {\n list($dataBill) = $this->qs('*', array('id' => $response['orderId']));\n switch ($response['paymentStatus']) {\n case self::STATUS_PROCESS:\n $this->owner->payTransaction($dataBill['owner_id'], PAY_PAID);\n /*uc_order_update_status($response['orderId'], 'processing');\n uc_order_comment_save($response['orderId'], $order->uid, t('RBK Money: payment processing'), $type = 'admin', $status = 1, $notify = FALSE);*/\n break;\n case self::STATUS_SUCCESS:\n $this->owner->payTransaction($dataBill['owner_id'], PAY_PAID);\n /*uc_payment_enter($response['orderId'], 'RBK Money', $order->order_total, $order->uid, NULL, NULL);\n uc_cart_complete_sale($order);\n uc_order_comment_save($response['orderId'], $order->uid, t('RBK Money: payment successful'), $type = 'admin', $status = 1, $notify = FALSE);*/\n break;\n }\n } elseif ($response['hash'] !== $crc) {\n /*uc_order_update_status($response['orderId'], 'canceled');\n uc_order_comment_save($response['orderId'], $order->uid, t('MD5 checksum fail, possible fraud. Order canceled'), $type = 'admin', $status = 1, $notify = FALSE);\n watchdog('uc_rbkmoney', 'MD5 checksum fail, possible fraud. Order canceled');*/\n trigger_error('RBK Money : Полученный hash не верный', E_USER_WARNING);\n }\n }\n }", "public function processPayment() {\n\n\t\t//create the GTPayConnector instance\n\t\t$gtpayConnector = new GTPayConnector();\n\n\t\t//create the VpcConfig instance\n\t\t$vpcConfig = new VpcConfig();\n\n\t\t//get the vpc xml object\n\t\t$vpcXMLConf = \"\";\n\t\t$vpcXMLConf = $vpcConfig->loadVpcConfig();\n\n\t\t// confirm that the configurations of vpc were loaded;\n\t\tif($vpcXMLConf == null) {\n\n\t\t\t//go to the error interface\n\t\t\t$data['error_msg'] = \"Could not Load the Virtual Payment client Details\";\n\t\t\t$data['page_titile'] = \"xxOnline shoe | error\";\n\t\t\t$data['responseData'] = \"\";\n\n\t\t\t$this->load->view(\"error-page\", $data);\n\t\t\t$this->load->view(\"partials/footer\");\n\t\t\treturn;\n\t\t}\n\n\t\t//get the vpc details\n\t\t$vpcUrl = $vpcConfig->getVpcURL($vpcXMLConf);\n\t\t$vpcSalt = $vpcConfig->getVpvSalt($vpcXMLConf);\n\t\t$vpcSaltType = $vpcConfig->getVpcSaltType($vpcXMLConf);\n\t\t$marchantcode = $vpcConfig->getCustomerCode($vpcXMLConf);\n\n\t\t//the transaction log\n\t\t$transactionLog = array();\n\n\t\t// set the salt\n\t\t$gtpayConnector->setSalt($vpcSalt);\n\n\t\t//remove the data that you dont need to send to the payment client\n\t\tunset($_POST['shoeimage']);\n\t\tunset($_POST['submit']);\n\t\t// add the customer code to the post data\n\t\t$_POST['gtp_CustomerCode'] = $marchantcode;\n\n\t\t//sort the post data before encrypting\n\t\tksort($_POST);\n\n\t\t//add the Virtual Payment Client post data to the transaction data\n\t\tforeach ($_POST as $key => $value) {\n\t\t\t\n\t\t\tif(strlen($value) > 0) {\n\t\t\t\t$gtpayConnector->addTransactionFields($key, $value);\n\n\t\t\t\t// add the post data to the transactionLog\n\t\t\t\t$transactionLog[$key] = $value;\n\t\t\t}\n\t\t}\n\t\t//get the date and time when the payment request is made\n\t\t$date = new DateTime();\n\t\t$date->setTimeZone(new DateTimeZone('UTC'));\n\t\t$transactionDate = $date->format('Y-m-d\\TH-i-s\\Z');\n\n\t\t//add the date of the transaction\n\t\t$transactionLog[\"transactDate\"] = $transactionDate;\n\n\t\t//log the trasaction on your database\n\t\t$this->transactions->logTransaction($transactionLog);\n\n\t\t// set the salt type\n\t\t$gtpayConnector->setSaltType($vpcSaltType);\n\n\t\t// make oneway hash of the Transaction and add it to the digital order\n\t\t$transactionHash = $gtpayConnector->hashAllTransactionData();\n\n\t\t$gtpayConnector->addTransactionFields(\"gtp_TransDate\", $transactionDate);\n\t\t$gtpayConnector->addTransactionFields(\"gtp_SecureHash\", $transactionHash);\n\t\t$gtpayConnector->addTransactionFields(\"gtp_SecureHashType\", $vpcSaltType);\n\n\t\t//obtain the redirection url\n\t\t$vpcUrl = $gtpayConnector->getDigitalOrderURL($vpcUrl);\n\n\t\t// send the payment request\n\t\theader(\"Location: \".$vpcUrl);\n\t}", "public function status()\n {\n if (!$this->config->get('onego_status') || !$this->user->hasPermission('modify', 'sale/order')) {\n $this->response->setOutput('');\n return;\n }\n \n $this->language->load('total/onego');\n \n $orderId = (int) $this->request->get['order_id'];\n $operations = OneGoTransactionsLog::getListForOrder($orderId);\n foreach ($operations as $row) {\n if ($row['success'] && empty($statusSuccess)) {\n $statusSuccess = $row;\n break;\n } else if (!$row['success'] && empty($statusFailure)) {\n $statusFailure = $row;\n }\n }\n if (!empty($statusSuccess)) {\n if ($statusSuccess['operation'] == OneGoSDK_DTO_TransactionEndDto::STATUS_DELAY) {\n // delayed transaction\n $expiresOn = strtotime($statusSuccess['inserted_on']) + $statusSuccess['expires_in'];\n if ($expiresOn <= time()) {\n // transaction expired\n $this->data['onego_status_success'] = sprintf(\n $this->language->get('transaction_status_expired'), date('Y-m-d H:i:s', $expiresOn));\n } else {\n // transaction delayed\n $this->data['onego_status_success'] = sprintf(\n $this->language->get('transaction_status_delayed'), \n date('Y-m-d H:i', strtotime($statusSuccess['inserted_on'])),\n date('Y-m-d H:i:s', $expiresOn));\n \n // enable transaction completion actions\n $this->data['onego_allow_status_change'] = true;\n $confirmStatuses = OneGoConfig::getArray('confirmOnOrderStatus');\n $cancelStatuses = OneGoConfig::getArray('cancelOnOrderStatus');\n $this->data['confirm_statuses'] = $confirmStatuses;\n $this->data['cancel_statuses'] = $cancelStatuses;\n $this->data['onego_btn_confirm'] = $this->language->get('button_confirm_transaction');\n $this->data['onego_btn_cancel'] = $this->language->get('button_cancel_transaction');\n $this->data['onego_btn_delay'] = $this->language->get('button_delay_transaction');\n\n }\n } else {\n $this->data['onego_status_success'] = sprintf(\n $this->language->get('transaction_status_'.strtolower($statusSuccess['operation'])),\n date('Y-m-d H:i', strtotime($statusSuccess['inserted_on'])));\n }\n } \n if (!empty($statusFailure)) {\n $this->data['onego_status_failure'] = sprintf(\n $this->language->get('transaction_operation_failed'),\n date('Y-m-d H:i', strtotime($statusFailure['inserted_on'])),\n $statusFailure['operation'],\n $statusFailure['error_message']);\n } else if (empty($statusSuccess)) {\n $this->data['onego_status_undefined'] = $this->language->get('transaction_status_undefined');\n }\n $this->data['onego_status'] = $this->language->get('onego_status');\n $this->data['order_id'] = $orderId;\n $this->data['token'] = $this->session->data['token'];\n\n $this->data['confirm_confirm'] = $this->language->get('confirm_transaction_confirm');\n $this->data['confirm_cancel'] = $this->language->get('confirm_transaction_cancel');\n $this->data['delay_periods'] = $this->language->get('delay_period');\n $this->data['delay_for_period'] = $this->language->get('delay_for_period');\n $this->data['confirm_delay'] = $this->language->get('confirm_transaction_delay');\n $this->data['status_will_confirm'] = $this->language->get('transaction_will_confirm');\n $this->data['status_will_cancel'] = $this->language->get('transaction_will_cancel');\n \n $this->template = 'total/onego_status.tpl';\n $this->response->setOutput($this->render());\n }", "public function processPaypal(){\r\n\t// and redirect to thransaction details page\r\n\t}", "function handleSinglePayment(&$input, &$ids, &$objects) {\r\n $contribution =& $objects['contribution'];\r\n require_once 'CRM/Core/Transaction.php';\r\n $transaction = new CRM_Core_Transaction();\r\n if ($input[\"transStatus\"]==\"Y\") {\r\n $this->completeTransaction($input,$ids,$objects,$transaction,false);// false= not recurring\r\n $output = '<div id=\"logo\"><h1>Thank you</h1><p>Your payment was successful.</p><p>Please <a href=\"' . $ids[\"thankyoupage\"] . '\">click here to return to our web site</a></p>';\r\n echo CRM_Utils_System::theme( $output, true, false );\r\n }\r\n else if ($input[\"transStatus\"]==\"C\") {\r\n $this->cancelled($objects,$transaction);\r\n $output = '<h1>Transaction Cancelled</h1><p>Your payment was cancelled or rejected.</p><p>Please contact us by phone or email regarding your payment.</p><p><a href=\"' . $ids[\"cancelpage\"] . '\">Click here to return to our web site</a></p>';\r\n echo CRM_Utils_System::theme( $output, true, false );\r\n }\r\n else {\r\n CRM_Core_Error::debug_log_message(\"Unrecognized transStatus for single payment=\".$input[\"transStatus\"]);\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : Unrecognized transStatus for single payment=\".$input[\"transStatus\"]);\r\n $output = '<h1>Error</h1><p>There was an error while processing your payment.</p><p>Please contact us by phone or email regarding your payment.</p><p><a href=\"' . $ids[\"cancelpage\"] . '\">Click here to return to our web site</a></p>';\r\n echo CRM_Utils_System::theme( $output, true, false );\r\n return false;\r\n }\r\n // completeTransaction handles the transaction commit\r\n return true;\r\n }", "public function processPayment(){\r\n return true;\r\n }", "public function hookPaymentReturn()\n {\n }", "public function execute() {\n\n $id = trim((string)$this->getRequest()->getParam('transId', NULL));\n $refId = (int)trim((string)$this->getRequest()->getParam('refId', NULL));\n\n if (!$id || !$refId) {\n http_response_code(400);\n die('Invalid response');\n }\n\n $service = $this->config->getComGateService();\n try {\n $status = $service->getStatus($id);\n }\n catch(\\Exception $e) {\n $status = false;\n }\n\n if (!$status) {\n http_response_code(400);\n die('Malformed response');\n }\n\n $order_id = (int)@$status['refId'];\n $order = $this->getOrder($order_id);\n if (!$order->getId()) {\n http_response_code(400);\n\n //trigger_error('No Order [' . $order_id . ']');\n die('No Order');\n }\n\n $response = $this->createResponse();\n\n if (!in_array($order->getStatus() , array(\n \\Magento\\Sales\\Model\\Order::STATE_NEW,\n \\Magento\\Sales\\Model\\Order::STATE_HOLDED,\n \\Magento\\Sales\\Model\\Order::STATE_PENDING_PAYMENT,\n \\Magento\\Sales\\Model\\Order::STATE_PAYMENT_REVIEW\n ))) {\n\n $response->setHttpResponseCode(200);\n return $response;\n }\n\n if (!empty($status['code'])) {\n http_response_code(400);\n die('Payment error');\n }\n\n if (($status['price'] != round($order->getGrandTotal() * 100)) || ($status['curr'] != $order->getOrderCurrency()->getCurrencyCode())) {\n http_response_code(400);\n die('Payment sum or currency mismatch');\n }\n\n $invoice = $order->getInvoiceCollection()->getFirstItem();\n $payment = $order->getPayment();\n\n if (($status['status'] == 'CANCELLED') && ($order->getStatus() != \\Magento\\Sales\\Model\\Order::STATE_HOLDED)) {\n\n $payment->getMethodInstance()->cancel($payment);\n\n $order->addStatusHistoryComment('ComGate (notification): Payment failed');\n $order->save();\n }\n else if (($status['status'] == 'PAID') && ($order->getStatus() != \\Magento\\Sales\\Model\\Order::STATE_PROCESSING)) {\n \n \\ComGate\\ComGateGateway\\Api\\AgmoPaymentsHelper::updatePaymentTransaction($payment, array(\n 'id' => $id,\n 'state' => $status['status']\n ));\n\n $payment->capture();\n\n $order->addStatusHistoryComment('ComGate (notification): Payment success');\n $order->save();\n }\n else if (($status['status'] == 'AUTHORIZED') && ($order->getStatus() != \\Magento\\Sales\\Model\\Order::STATE_PAYMENT_REVIEW)) {\n\n \\ComGate\\ComGateGateway\\Api\\AgmoPaymentsHelper::updatePaymentTransaction($payment, array(\n 'id' => $id,\n 'state' => $status['status']\n ));\n\n $payment->getMethodInstance()->authorize($payment, $order->getGrandTotal());\n\n $order->addStatusHistoryComment('ComGate (notification): Payment authorized');\n $order->save();\n }\n\n $response->setHttpResponseCode(200);\n return $response;\n }", "function execute()\n{\n\t\n\n\n\n\n\t$arr = array_merge($this->amount,$this->customer,$this->creditCard,$this->options);\n\t\n\t$collection = Braintree_Transaction::search(array(\n Braintree_TransactionSearch::customerId()->is($arr['customer']['id']),\n));\nif($collection->maximumCount() > 0)\n{\n\n$result = Braintree_Transaction::sale(\n array(\n 'customerId' => $arr['customer']['id'],\n 'amount' => $arr['amount']\n )\n);\nif ($result->success) {\necho json_encode(array('type'=>'success','response'=>'payment amount: '.$arr['amount'].' Your transaction id : '.$result->transaction->id));\n\tdo_action('payment_made',array('message'=>'payment amount: '.$arr['amount'].' transaction id : '.$result->transaction->id));\n\n}elseif ($result->transaction) \n{\n\techo json_encode(array('type'=>'error','response'=>$result->message));\n\n} else {\n\techo json_encode(array('type'=>'error','response'=>$result->message));\n\n\t\n}\n}else{\n\n$result = Braintree_Transaction::sale($arr);\n\nif ($result->success) {\n\tdo_action('payment_made',array('message'=>'payment amount: '.$arr['amount'].' transaction id : '.$result->transaction->id));\n\t\necho json_encode(array('type'=>'success','response'=>'Payment Amount : '.$arr['amount'].'Your transaction id : '.$result->transaction->id));\n}elseif ($result->transaction) \n{\n\techo json_encode(array('type'=>'error','response'=>$result->message));\n\n} else {\n\techo json_encode(array('type'=>'error','response'=>$result->message));\n\n\t\n}\n\n\n\n\t\n}\n\t\n}", "public function callback()\n {\n $transaction = PaytmWallet::with('receive');\n\n $response = $transaction->response(); // To get raw response as array\n $invoiceId = $this->getInvoiceId($response['ORDERID']);\n \\Storage::put('/txn/_' . $response['ORDERID'] . '.json', json_encode($response));\n\n if ($transaction->isSuccessful()) {\n $payment = (new \\Modules\\Payments\\Helpers\\PaymentEngine('paytm', $response))->transact();\n toastr()->success('Payment received successfully', langapp('response_status'));\n return redirect()->route('invoices.index');\n }\n // Schedule Job to check transaction\n RecheckPaytmStatus::dispatch($response['ORDERID'])->delay(now()->addMinutes(3));\n toastr()->warning('We will verify your transaction shortly', langapp('response_status'));\n return redirect()->route('invoices.index');\n }", "public function handleTransactionWebhook(Wallet $wallet, $payload);", "public function actionStatus()\n {\n \n $merchant_pass = $GLOBALS['env']['fch_merch_pass']; //укажите Ваш пароль мерчанта\n\n $post_hash = $_POST['verificate_hash'];\n unset($_POST['verificate_hash']);\n \n $my_hash = \"\";\n foreach ($_POST AS $key_post=>$one_post) if ($my_hash==\"\") {$my_hash = $one_post;}\n else $my_hash = $my_hash.\"::\".$one_post;\n \n $my_hash = $my_hash.\"::\".$merchant_pass;\n $my_hash = hash ( \"sha256\", $my_hash);\n \n if ($my_hash==$post_hash){\n $date = date(\"Y-m-d\");\n $dtime = date(\"Y-m-d H:i:s\");\n $id = $_POST['user_id'];\n $sum = $_POST['amount'];\n $cur = 'usd';\n if(Journal::checkBatch($id, $post_hash)){\n Log::add($id.' '.$_POST['payed_paysys'].\" fchange batch error \".$sum);\n exit('fchange batch error');\n }\n\n $wallet_types=['balance', 'gridPay'];\n $wallet_type = (isset($_POST['wallet_type'])&&\n in_array($_POST['wallet_type'],$wallet_types))? $_POST['wallet_type']:'balance' ;\n \n User::addVal($id,$sum,$wallet_type);\n if($wallet_type == 'gridPay'){\n Journal::addFromArray(['type'=>'gridpay_add_fchange',\n 'user'=>$id,\n 'sum'=>$sum,\n 'date'=>$dtime,\n 'cur'=>$cur,\n //'rate'=>$stage['price'],\n 'name'=>'GridPay addition',\n 'detail'=>$post_hash,\n 'adr'=>'fchange',\n ]);\n }else{\n Journal::add('add',$id,$sum,$dtime,\"Addition\",0,\"complete\",1, $cur,$post_hash, 'fchange'); \n } \n //Log::add($id.' '. $dtime.' '.$cur.\" fchange payment is complete\".' '.$sum);\n echo \"*ok*\";\n }else{\n Log::add($id.' '.$_POST['payed_paysys'].\" fchange hash error \".$sum);\n exit('fchange hash error');\n }\n exit;\n }", "protected function processPayment() {\n\t\t$this->renderResponse( $this->adapter->doPayment() );\n\t}", "protected function processPayment() {\n\t\t$this->renderResponse( $this->adapter->doPayment() );\n\t}", "function successful_request($atos_response) {\n\t\t\tglobal $woocommerce;\n\n\t\t\tif (isset($atos_response)) {\n\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tswitch ($atos_response['code_reponse']) {\n\t\t\t\t\t\t// transaction authorised\n\t\t\t\t\t\tcase 'ok':\n\t\t\t\t\t\t\t$transauthorised = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$transauthorised = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\tif ($transauthorised == true) {\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t// put code here to update/store the order with the a successful transaction result\n\t\t\t\t\t\t$order_id \t \t= $atos_response['order_id'];\n\t\t\t\t\t\t$order = &new WC_Order( $order_id );\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tif ($order->status !== 'completed') {\n\t\t\t\t\t\t\tif ($order->status == 'processing') {\n\t\t\t\t\t\t\t\t// This is the second call - do nothing\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$order->payment_complete();\n\t\t\t\t\t\t\t\t//Add admin order note\n\t\t\t\t\t\t\t\t$order->add_order_note('Paiement Atos: REUSSI<br><br>Référence Transaction: ' . $order_id);\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$order->add_order_note('info<br><br>Response Code: ' . $atos_response['real_response_code'] . '<br> Bank Code:' . $atos_response['real_code']);\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//Add customer order note\n\t\t\t\t\t\t\t\t$order->add_order_note('Paiement réussi','customer');\n\t\t\t\t\t\t\t\t// Empty the Cart\n\t\t\t\t\t\t\t\t$woocommerce->cart->empty_cart();\n\t\t\t\t\t\t\t\t//update order status\n\t\t\t\t\t\t\t\t$order->update_status('processing');\n\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// put code here to update/store the order with the a failed transaction result\n\t\t\t\t\t\t$order_id \t \t= $atos_response['order_id'];\n\t\t\t\t\t\t$order \t\t\t= new woocommerce_order( (int) $order_id );\t\t\t\t\t\n\t\t\t\t\t\t$order->update_status('failed');\n\t\t\t\t\t\t//Add admin order note\n\t\t\t\t\t\t$order->add_order_note('Paiement Atos: ECHEC<br><br>Référence Transaction: ' . $order_id);\n\t\t\t\t\t\t//Add customer order note\n\t\t\t\t\t\t$order->add_order_note('Paiement échoué','customer');\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\t//$nOutputProcessedOK = 30;\n\t\t\t\t\t//$szOutputMessage = \"Error updating website system, please ask the developer to check code\";\n\t\t\t\t}\n\t\t\t\t//echo string back for gateway to read - this confirms the script ran correctly.\n\t\t\t\t//echo(\"StatusCode=\".$nOutputProcessedOK.\"&Message=\".$szOutputMessage);\n\t\t\t}\n\t\t}", "public function process_payment() {\n\n // Saves a suggestions group\n (new MidrubBasePaymentsCollectionBraintreeHelpers\\Process)->prepare();\n\n }", "public function handle_webhook() {\n\t\t$payload = file_get_contents( 'php://input' );\n\t\tif ( ! empty( $payload ) && $this->validate_webhook( $payload ) ) {\n\t\t\t$data = json_decode( $payload, true );\n\t\t\t$event_data = $data['event']['data'];\n\n\t\t\tself::log( 'Webhook received event: ' . print_r( $data, true ) );\n\n\t\t\tif ( ! isset( $event_data['metadata']['order_id'] ) ) {\n\t\t\t\t// Probably a charge not created by us.\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\t$order_id = $event_data['metadata']['order_id'];\n\n\t\t\t$this->_update_order_status( wc_get_order( $order_id ), $event_data['timeline'] );\n\n\t\t\texit; // 200 response for acknowledgement.\n\t\t}\n\n\t\twp_die( 'Coinbase Webhook Request Failure', 'Coinbase Webhook', array( 'response' => 500 ) );\n\t}", "public function confirmPayment(){\n $response = $this->client->queryTransaction(Input::get('AccessCode'));\n $transactionResponse = $response->Transactions[0];\n\n if ($transactionResponse->TransactionStatus) {\n //echo 'Payment successful! ID: '.$transactionResponse->TransactionID;\n /*\n echo $transactionResponse->Options[0]['Value'].' <br/>';\n echo $transactionResponse->Options[1]['Value'].' <br/>';\n echo $transactionResponse->Options[2]['Value'];\n */\n $transaction = new IcePayTransaction();\n $transaction->user_id = Auth::user()->id;\n $transaction->tid = $transactionResponse->TransactionID; //transaction id or transaction bordereaux\n $transaction->sender_email = Auth::user()->email;//$payer['email']; //sender's email\n $transaction->receiver_email = $transactionResponse->Options[1]['Value']; //receiver's email or number\n $transaction->type = 'EWAY_'.$transactionResponse->Options[0]['Value'];\n $transaction->status = 'pending';//$transaction_json['related_resources'][0]['sale']['state'];\n $transaction->amount = $transactionResponse->TotalAmount / 100; //total amount deducted and transferred\n $transaction->currency = $transactionResponse->Options[2]['Value'];\n $transaction->save();\n \n $email = Auth::user()->email;//$payer['email'];\n $username = Auth::user()->username;\n \n Mail::send(['html'=>'emails.auth.transactions'], array('tdate' => date('Y-m-d H:i:s'),\n 'tid' => $transactionResponse->TransactionID,\n 'sender_email'=>Auth::user()->email,\n 'sender_number'=>Auth::user()->number,\n 'receiver_email'=>$transaction->receiver_email,\n 'receiver_number'=>$transaction->receiver_email,\n 'status'=>'PENDING',\n 'amount'=> ($transaction->amount - $transactionResponse->Options[3]['Value'] ) .' '.$transaction->currency,\n 'charge'=>$transactionResponse->Options[3]['Value'].' '.$transaction->currency,\n 'total'=>$transaction->amount . ' '.$transaction->currency,\n 'mode'=>$transaction->type)\n , function($message) use ($email, $username){\n\t\t \t\t\t$message->to(array($email,'[email protected]','[email protected]', '[email protected]'), $username)->subject('Transaction Receipt');\n\t\t\t \t});\n return Redirect::route('dashboard')\n\t\t\t \t->with('alertMessage', 'EWAY Transaction Successful');\n \n } else {\n $errors = str_split($transactionResponse->ResponseMessage); //previously splitte the string at the ', ' points\n foreach ($errors as $error) {\n $errmsg .= \"Payment failed: \".\\Eway\\Rapid::getMessage($error).\"<br>\";\n }\n return Redirect::route('dashboard')\n\t\t\t \t->with('alertError', $errmsg);\n }\n }", "function it_exchange_authorizenet_addon_process_transaction( $status, $transaction_object ) {\n\t// If this has been modified as true already, return.\n\tif ( $status )\n\t\treturn $status;\n\n\t// Do we have valid CC fields?\n\tif ( ! it_exchange_submitted_purchase_dialog_values_are_valid( 'authorizenet' ) )\n\t\treturn false;\n\n\t// Grab CC data\n\t$cc_data = it_exchange_get_purchase_dialog_submitted_values( 'authorizenet' );\n\n\t// Make sure we have the correct $_POST argument\n\tif ( ! empty( $_POST[it_exchange_get_field_name('transaction_method')] ) && 'authorizenet' == $_POST[it_exchange_get_field_name('transaction_method')] ) {\n\t\ttry {\n\t\t\t$settings = it_exchange_get_option( 'addon_authorizenet' );\n\n\t\t\t$api_url = !empty( $settings['authorizenet-sandbox-mode'] ) ? AUTHORIZE_NET_AIM_API_SANDBOX_URL : AUTHORIZE_NET_AIM_API_LIVE_URL;\n\t\t\t$api_username = !empty( $settings['authorizenet-sandbox-mode'] ) ? $settings['authorizenet-sandbox-api-login-id'] : $settings['authorizenet-api-login-id'];\n\t\t\t$api_password = !empty( $settings['authorizenet-sandbox-mode'] ) ? $settings['authorizenet-sandbox-transaction-key'] : $settings['authorizenet-transaction-key'];\n\t\t\t$it_exchange_customer = it_exchange_get_current_customer();\n\n\t\t\t$subscription = false;\n\t\t\t$it_exchange_customer = it_exchange_get_current_customer();\n\t\t\t$customer_id = is_numeric( $it_exchange_customer->ID ) ? $it_exchange_customer->ID : substr( md5( $it_exchange_customer->ID ), 0, 20 );\n\t\t\t$reference_id = substr( it_exchange_create_unique_hash(), 20 );\n\n\t\t\tremove_filter( 'the_title', 'wptexturize' ); // remove this because it screws up the product titles in PayPal\n\t\t\t$cart = it_exchange_get_cart_products();\n\t\t\tif ( 1 === absint( count( $cart ) ) ) {\n\t\t\t\tforeach( $cart as $product ) {\n\t\t\t\t\tif ( it_exchange_product_supports_feature( $product['product_id'], 'recurring-payments', array( 'setting' => 'auto-renew' ) ) ) {\n\t\t\t\t\t\tif ( it_exchange_product_has_feature( $product['product_id'], 'recurring-payments', array( 'setting' => 'auto-renew' ) ) ) {\n\t\t\t\t\t\t\t$trial_enabled = it_exchange_get_product_feature( $product['product_id'], 'recurring-payments', array( 'setting' => 'trial-enabled' ) );\n\t\t\t\t\t\t\t$trial_interval = it_exchange_get_product_feature( $product['product_id'], 'recurring-payments', array( 'setting' => 'trial-interval' ) );\n\t\t\t\t\t\t\t$trial_interval_count = it_exchange_get_product_feature( $product['product_id'], 'recurring-payments', array( 'setting' => 'trial-interval-count' ) );\n\t\t\t\t\t\t\t$auto_renew = it_exchange_get_product_feature( $product['product_id'], 'recurring-payments', array( 'setting' => 'auto-renew' ) );\n\t\t\t\t\t\t\t$interval = it_exchange_get_product_feature( $product['product_id'], 'recurring-payments', array( 'setting' => 'interval' ) );\n\t\t\t\t\t\t\t$interval_count = it_exchange_get_product_feature( $product['product_id'], 'recurring-payments', array( 'setting' => 'interval-count' ) );\n\n\t\t\t\t\t\t\tswitch( $interval ) {\n\t\t\t\t\t\t\t\tcase 'year':\n\t\t\t\t\t\t\t\t\t$duration = 12; //The max you can do in Authorize.Net is 12 months (1 year)\n\t\t\t\t\t\t\t\t\t$unit = 'months'; //lame\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'week':\n\t\t\t\t\t\t\t\t\t$duration = $interval_count * 7;\n\t\t\t\t\t\t\t\t\t$unit = 'days'; //lame\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'day':\n\t\t\t\t\t\t\t\t\t$duration = $interval_count;\n\t\t\t\t\t\t\t\t\t$unit = 'days';\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'month':\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t$duration = $interval_count;\n\t\t\t\t\t\t\t\t\t$unit = 'months';\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$duration = apply_filters( 'it_exchange_authorizenet_addon_process_transaction_subscription_duration', $duration, $product );\n\n\t\t\t\t\t\t\t$trial_unit = NULL;\n\t\t\t\t\t\t\t$trial_duration = 0;\n\t\t\t\t\t\t\tif ( $trial_enabled ) {\n\t\t\t\t\t\t\t\t$allow_trial = true;\n\t\t\t\t\t\t\t\t//Should we all trials?\n\t\t\t\t\t\t\t\tif ( 'membership-product-type' === it_exchange_get_product_type( $product['product_id'] ) ) {\n\t\t\t\t\t\t\t\t\tif ( is_user_logged_in() ) {\n\t\t\t\t\t\t\t\t\t\tif ( function_exists( 'it_exchange_get_session_data' ) ) {\n\t\t\t\t\t\t\t\t\t\t\t$member_access = it_exchange_get_session_data( 'member_access' );\n\t\t\t\t\t\t\t\t\t\t\t$children = (array)it_exchange_membership_addon_get_all_the_children( $product['product_id'] );\n\t\t\t\t\t\t\t\t\t\t\t$parents = (array)it_exchange_membership_addon_get_all_the_parents( $product['product_id'] );\n\t\t\t\t\t\t\t\t\t\t\tforeach( $member_access as $prod_id => $txn_id ) {\n\t\t\t\t\t\t\t\t\t\t\t\tif ( $prod_id === $product['product_id'] || in_array( $prod_id, $children ) || in_array( $prod_id, $parents ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$allow_trial = false;\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$allow_trial = apply_filters( 'it_exchange_authorizenet_addon_process_transaction_allow_trial', $allow_trial, $product['product_id'] );\n\t\t\t\t\t\t\t\tif ( $allow_trial && 0 < $trial_interval_count ) {\n\t\t\t\t\t\t\t\t\tswitch ( $trial_interval ) {\n\t\t\t\t\t\t\t\t\t\tcase 'year':\n\t\t\t\t\t\t\t\t\t\t\t$trial_duration = 12; //The max you can do in Authorize.Net is 12 months (1 year)\n\t\t\t\t\t\t\t\t\t\t\t//$trial_unit = 'months'; //lame\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\tcase 'week':\n\t\t\t\t\t\t\t\t\t\t\t$trial_duration = $interval_count * 7;\n\t\t\t\t\t\t\t\t\t\t\t//$trial_unit = 'days'; //lame\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\tcase 'day':\n\t\t\t\t\t\t\t\t\t\tcase 'month':\n\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t$trial_duration = $interval_count;\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$trial_duration = apply_filters( 'it_exchange_authorizenet_addon_process_transaction_subscription_trial_duration', $trial_duration, $product );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$subscription = true;\n\t\t\t\t\t\t\t$product_id = $product['product_id'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( $settings['evosnap-international'] && function_exists( 'it_exchange_convert_country_code' ) ) {\n\t\t\t\t$country = it_exchange_convert_country_code( $transaction_object->billing_address['country'] );\n\t\t\t} else {\n\t\t\t\t$country = $transaction_object->billing_address['country'];\n\t\t\t}\n\n\t\t\t$billing_zip = preg_replace( '/[^A-Za-z0-9\\-]/', '', $transaction_object->billing_address['zip'] );\n\n\t\t\tif ( ! empty( $transaction_object->shipping_address ) ) {\n\t\t\t\t$shipping_zip = preg_replace( '/[^A-Za-z0-9\\-]/', '', $transaction_object->shipping_address['zip'] );\n\t\t\t} else {\n\t\t\t\t$shipping_zip = '';\n\t\t\t}\n\n\t\t\tif ( $subscription ) {\n\t\t\t\t$upgrade_downgrade = it_exchange_get_session_data( 'updowngrade_details' );\n\t\t\t\tif ( !empty( $upgrade_downgrade ) ) {\n\t\t\t\t\tforeach( $cart as $product ) {\n\t\t\t\t\t\tif ( !empty( $upgrade_downgrade[$product['product_id']] ) ) {\n\t\t\t\t\t\t\t$product_id = $product['product_id'];\n\t\t\t\t\t\t\tif ( !empty( $upgrade_downgrade[$product_id]['old_transaction_id'] )\n\t\t\t\t\t\t\t\t&& !empty( $upgrade_downgrade[$product_id]['old_transaction_method'] ) ) {\n\t\t\t\t\t\t\t\t$transaction_fields = array(\n\t\t\t\t\t\t\t\t\t'ARBUpdateSubscriptionRequest' => array(\n\t\t\t\t\t\t\t\t\t\t'merchantAuthentication' => array(\n\t\t\t\t\t\t\t\t\t\t\t'name'\t\t\t => $api_username,\n\t\t\t\t\t\t\t\t\t\t\t'transactionKey' => $api_password,\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t'refId' => $reference_id,\n\t\t\t\t\t\t\t\t\t\t'subscriptionId' => $upgrade_downgrade[$product_id]['old_transaction_id'],\n\t\t\t\t\t\t\t\t\t\t'subscription' => array(\n\t\t\t\t\t\t\t\t\t\t\t'name' => it_exchange_get_cart_description(),\n\t\t\t\t\t\t\t\t\t\t\t'paymentSchedule' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t'interval' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'length' => $duration,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'unit' => $unit,\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t'startDate' => date_i18n( 'Y-m-d' ),\n\t\t\t\t\t\t\t\t\t\t\t\t'totalOccurrences' => 9999, // To submit a subscription with no end date (an ongoing subscription), this field must be submitted with a value of “9999.”\n\t\t\t\t\t\t\t\t\t\t\t\t'trialOccurrences' => $trial_duration, //optional\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t'amount' => $transaction_object->total,\n\t\t\t\t\t\t\t\t\t\t\t'trialAmount' => 0.00,\n\t\t\t\t\t\t\t\t\t\t\t'payment' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t'creditCard' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'cardNumber' => $cc_data['number'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t'expirationDate' => $cc_data['expiration-month'] . $cc_data['expiration-year'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t'cardCode' => $cc_data['code'],\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t'order' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t'description' => it_exchange_get_cart_description(),\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t'customer' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t'id' => $customer_id,\n\t\t\t\t\t\t\t\t\t\t\t\t'email' => $it_exchange_customer->data->user_email,\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t'billTo' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t'firstName' => $cc_data['first-name'],\n\t\t\t\t\t\t\t\t\t\t\t\t'lastName' => $cc_data['last-name'],\n\t\t\t\t\t\t\t\t\t\t\t\t'address' => $transaction_object->billing_address['address1'] . ( !empty( $transaction_object->shipping_address['address2'] ) ? ', ' . $transaction_object->billing_address['address2'] : '' ),\n\t\t\t\t\t\t\t\t\t\t\t\t'city' => $transaction_object->billing_address['city'],\n\t\t\t\t\t\t\t\t\t\t\t\t'state' => $transaction_object->billing_address['state'],\n\t\t\t\t\t\t\t\t\t\t\t\t'zip' => $billing_zip,\n\t\t\t\t\t\t\t\t\t\t\t\t'country' => $country,\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// If we have the shipping info, we may as well include it in the fields sent to Authorize.Net\n\t\t\t\t\tif ( !empty( $transaction_object->shipping_address ) ) {\n\t\t\t\t\t\t$transaction_fields['ARBUpdateSubscriptionRequest']['subscription']['shipTo']['address'] = $transaction_object->shipping_address['address1'] . ( !empty( $transaction_object->shipping_address['address2'] ) ? ', ' . $transaction_object->shipping_address['address2'] : '' );\n\t\t\t\t\t\t$transaction_fields['ARBUpdateSubscriptionRequest']['subscription']['shipTo']['city'] = $transaction_object->shipping_address['city'];\n\t\t\t\t\t\t$transaction_fields['ARBUpdateSubscriptionRequest']['subscription']['shipTo']['state'] = $transaction_object->shipping_address['state'];\n\t\t\t\t\t\t$transaction_fields['ARBUpdateSubscriptionRequest']['subscription']['shipTo']['zip'] = $shipping_zip;\n\t\t\t\t\t\t$transaction_fields['ARBUpdateSubscriptionRequest']['subscription']['shipTo']['country'] = $transaction_object->shipping_address['country'];\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$transaction_fields = array(\n\t\t\t\t\t\t'ARBCreateSubscriptionRequest' => array(\n\t\t\t\t\t\t\t'merchantAuthentication' => array(\n\t\t\t\t\t\t\t\t'name'\t\t\t => $api_username,\n\t\t\t\t\t\t\t\t'transactionKey' => $api_password,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'refId' => $reference_id,\n\t\t\t\t\t\t\t'subscription' => array(\n\t\t\t\t\t\t\t\t'name' => it_exchange_get_cart_description(),\n\t\t\t\t\t\t\t\t'paymentSchedule' => array(\n\t\t\t\t\t\t\t\t\t'interval' => array(\n\t\t\t\t\t\t\t\t\t\t'length' => $duration,\n\t\t\t\t\t\t\t\t\t\t'unit' => $unit,\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t'startDate' => date_i18n( 'Y-m-d' ),\n\t\t\t\t\t\t\t\t\t'totalOccurrences' => 9999, // To submit a subscription with no end date (an ongoing subscription), this field must be submitted with a value of “9999.”\n\t\t\t\t\t\t\t\t\t'trialOccurrences' => $trial_duration, //optional\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'amount' => $transaction_object->total,\n\t\t\t\t\t\t\t\t'trialAmount' => 0.00,\n\t\t\t\t\t\t\t\t'payment' => array(\n\t\t\t\t\t\t\t\t\t'creditCard' => array(\n\t\t\t\t\t\t\t\t\t\t'cardNumber' => $cc_data['number'],\n\t\t\t\t\t\t\t\t\t\t'expirationDate' => $cc_data['expiration-month'] . $cc_data['expiration-year'],\n\t\t\t\t\t\t\t\t\t\t'cardCode' => $cc_data['code'],\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'order' => array(\n\t\t\t\t\t\t\t\t\t'description' => it_exchange_get_cart_description(),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'customer' => array(\n\t\t\t\t\t\t\t\t\t'id' => $customer_id,\n\t\t\t\t\t\t\t\t\t'email' => $it_exchange_customer->data->user_email,\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'billTo' => array(\n\t\t\t\t\t\t\t\t\t'firstName' => $cc_data['first-name'],\n\t\t\t\t\t\t\t\t\t'lastName' => $cc_data['last-name'],\n\t\t\t\t\t\t\t\t\t'address' => $transaction_object->billing_address['address1'] . ( !empty( $transaction_object->shipping_address['address2'] ) ? ', ' . $transaction_object->billing_address['address2'] : '' ),\n\t\t\t\t\t\t\t\t\t'city' => $transaction_object->billing_address['city'],\n\t\t\t\t\t\t\t\t\t'state' => $transaction_object->billing_address['state'],\n\t\t\t\t\t\t\t\t\t'zip' => $billing_zip,\n\t\t\t\t\t\t\t\t\t'country' => $country,\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\n\t\t\t\t\t// If we have the shipping info, we may as well include it in the fields sent to Authorize.Net\n\t\t\t\t\tif ( !empty( $transaction_object->shipping_address ) ) {\n\t\t\t\t\t\t$transaction_fields['ARBCreateSubscriptionRequest']['subscription']['shipTo']['address'] = $transaction_object->shipping_address['address1'] . ( !empty( $transaction_object->shipping_address['address2'] ) ? ', ' . $transaction_object->shipping_address['address2'] : '' );\n\t\t\t\t\t\t$transaction_fields['ARBCreateSubscriptionRequest']['subscription']['shipTo']['city'] = $transaction_object->shipping_address['city'];\n\t\t\t\t\t\t$transaction_fields['ARBCreateSubscriptionRequest']['subscription']['shipTo']['state'] = $transaction_object->shipping_address['state'];\n\t\t\t\t\t\t$transaction_fields['ARBCreateSubscriptionRequest']['subscription']['shipTo']['zip'] = $shipping_zip;\n\t\t\t\t\t\t$transaction_fields['ARBCreateSubscriptionRequest']['subscription']['shipTo']['country'] = $transaction_object->shipping_address['country'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$transaction_fields = array(\n\t\t\t\t\t'createTransactionRequest' => array(\n\t\t\t\t\t\t'merchantAuthentication' => array(\n\t\t\t\t\t\t\t'name'\t\t\t => $api_username,\n\t\t\t\t\t\t\t'transactionKey' => $api_password,\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'refId' => $reference_id,\n\t\t\t\t\t\t'transactionRequest' => array(\n\t\t\t\t\t\t\t'transactionType' => 'authCaptureTransaction',\n\t\t\t\t\t\t\t'amount' => $transaction_object->total,\n\t\t\t\t\t\t\t'payment' => array(\n\t\t\t\t\t\t\t\t'creditCard' => array(\n\t\t\t\t\t\t\t\t\t'cardNumber' => $cc_data['number'],\n\t\t\t\t\t\t\t\t\t'expirationDate' => $cc_data['expiration-month'] . $cc_data['expiration-year'],\n\t\t\t\t\t\t\t\t\t'cardCode' => $cc_data['code'],\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'order' => array(\n\t\t\t\t\t\t\t\t'description' => it_exchange_get_cart_description(),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'customer' => array(\n\t\t\t\t\t\t\t\t'id' => $customer_id,\n\t\t\t\t\t\t\t\t'email' => $it_exchange_customer->data->user_email,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'billTo' => array(\n\t\t\t\t\t\t\t\t'firstName' => $cc_data['first-name'],\n\t\t\t\t\t\t\t\t'lastName' => $cc_data['last-name'],\n\t\t\t\t\t\t\t\t'address' => $transaction_object->billing_address['address1'] . ( !empty( $transaction_object->shipping_address['address2'] ) ? ', ' . $transaction_object->billing_address['address2'] : '' ),\n\t\t\t\t\t\t\t\t'city' => $transaction_object->billing_address['city'],\n\t\t\t\t\t\t\t\t'state' => $transaction_object->billing_address['state'],\n\t\t\t\t\t\t\t\t'zip' => $billing_zip,\n\t\t\t\t\t\t\t\t'country' => $country,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\t// If we have the shipping info, we may as well include it in the fields sent to Authorize.Net\n\t\t\t\tif ( !empty( $transaction_object->shipping_address ) ) {\n\t\t\t\t\t$transaction_fields['createTransactionRequest']['transactionRequest']['shipTo']['address'] = $transaction_object->shipping_address['address1'] . ( !empty( $transaction_object->shipping_address['address2'] ) ? ', ' . $transaction_object->shipping_address['address2'] : '' );\n\t\t\t\t\t$transaction_fields['createTransactionRequest']['transactionRequest']['shipTo']['city'] = $transaction_object->shipping_address['city'];\n\t\t\t\t\t$transaction_fields['createTransactionRequest']['transactionRequest']['shipTo']['state'] = $transaction_object->shipping_address['state'];\n\t\t\t\t\t$transaction_fields['createTransactionRequest']['transactionRequest']['shipTo']['zip'] = $shipping_zip;\n\t\t\t\t\t$transaction_fields['createTransactionRequest']['transactionRequest']['shipTo']['country'] = $transaction_object->shipping_address['country'];\n\t\t\t\t}\n\n\t\t\t\t$transaction_fields['createTransactionRequest']['transactionRequest']['retail']['marketType'] = 0; //ecommerce\n\t\t\t\t$transaction_fields['createTransactionRequest']['transactionRequest']['retail']['deviceType'] = 8; //Website\n\t\t\t}\n\n\t\t\t$transaction_fields = apply_filters( 'it_exchange_authorizenet_transaction_fields', $transaction_fields );\n\n\t\t\t$query = array(\n\t\t 'headers' => array(\n\t\t 'Content-Type' => 'application/json',\n\t\t\t\t),\n\t 'body' => json_encode( $transaction_fields ),\n\t\t\t\t'timeout' => 30\n\t\t\t);\n\n\t\t\t$response = wp_remote_post( $api_url, $query );\n\n\t\t\tif ( !is_wp_error( $response ) ) {\n\t\t\t\t$body = preg_replace('/\\xEF\\xBB\\xBF/', '', $response['body']);\n\t\t\t\t$obj = json_decode( $body, true );\n\n\t\t\t\tif ( isset( $obj['messages'] ) && isset( $obj['messages']['resultCode'] ) && $obj['messages']['resultCode'] == 'Error' ) {\n\t\t\t\t\tif ( ! empty( $obj['messages']['message'] ) ) {\n\t\t\t\t\t\t$error = reset( $obj['messages']['message'] );\n\t\t\t\t\t\tit_exchange_add_message( 'error', $error['text'] );\n\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( $subscription ) {\n\t\t\t\t\tif ( !empty( $obj['subscriptionId'] ) ) {\n\t\t\t\t\t\t$txn_id = it_exchange_add_transaction( 'authorizenet', $reference_id, 1, $it_exchange_customer->id, $transaction_object );\n\t\t\t\t\t\tit_exchange_recurring_payments_addon_update_transaction_subscription_id( $txn_id, $obj['subscriptionId'] );\n\t\t\t\t\t\tit_exchange_authorizenet_addon_update_subscriber_id( $txn_id, $obj['subscriptionId'] );\n\t\t\t\t\t\treturn $txn_id;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ( !empty( $transaction['messages'] ) ) {\n\t\t\t\t\t\t\tforeach( $transaction['messages'] as $message ) {\n\t\t\t\t\t\t\t\t$exception[] = '<p>' . $message['text'] . '</p>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthrow new Exception( implode( $exception ) );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$transaction = $obj['transactionResponse'];\n\t\t\t\t\t$transaction_id = $transaction['transId'];\n\n\t\t\t\t\tswitch( $transaction['responseCode'] ) {\n\t\t\t\t\t\tcase '1': //Approved\n\t\t\t\t\t\tcase '4': //Held for Review\n\t\t\t\t\t\t\t//Might want to store the account number - $transaction['accountNumber']\n\t\t\t\t\t\t\treturn it_exchange_add_transaction( 'authorizenet', $transaction_id, $transaction['responseCode'], $it_exchange_customer->id, $transaction_object );\n\t\t\t\t\t\tcase '2': //Declined\n\t\t\t\t\t\tcase '3': //Error\n\t\t\t\t\t\t\tif ( !empty( $transaction['messages'] ) ) {\n\t\t\t\t\t\t\t\tforeach( $transaction['messages'] as $message ) {\n\t\t\t\t\t\t\t\t\t$exception[] = '<p>' . $message['description'] . '</p>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ( !empty( $transaction['errors'] ) ) {\n\t\t\t\t\t\t\t\tforeach( $transaction['errors'] as $error ) {\n\t\t\t\t\t\t\t\t\t$exception[] = '<p>' . $error['errorText'] . '</p>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tthrow new Exception( implode( $exception ) );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow new Exception( $response->get_error_message() );\n\t\t\t}\n\t\t}\n\t\tcatch( Exception $e ) {\n\t\t\tit_exchange_add_message( 'error', $e->getMessage() );\n\t\t\tit_exchange_flag_purchase_dialog_error( 'authorizenet' );\n\t\t\treturn false;\n\t\t}\n\n\t} else {\n\t\tit_exchange_add_message( 'error', __( 'Unknown error. Please try again later.', 'LION' ) );\n\t\tit_exchange_flag_purchase_dialog_error( 'authorizenet' );\n\t}\n\treturn false;\n\n}", "public function process_payment() {\n\n\n global $admin_settings;\n\n check_ajax_referer( 'kp-korapay-pay-nonce', 'kp_sec_code' );\n\n $tx_ref = $_POST['reference'];\n $status = $_POST['status'];\n $secret_key = $admin_settings->get_option_value( 'secret_key' );\n $amount=$_POST['amount'];\n $args = array(\n 'post_type' => 'payment_list',\n 'post_status' => 'publish',\n 'post_title' => $tx_ref,\n );\n\n $payment_record_id = wp_insert_post( $args, true );\n\n if ( ! is_wp_error( $payment_record_id )) {\n\n $post_meta = array(\n '_kp_korapay_payment_amount' => 'NGN'.' '.$_POST['amount'],\n '_kp_korapay_payment_fullname' => $_POST['first_name'].' '.$_POST['last_name'],\n '_kp_korapay_payment_customer' => $_POST['email'],\n '_kp_korapay_payment_status' => $status,\n '_kp_korapay_payment_tx_ref' => $tx_ref,\n );\n\n $this->_add_post_meta( $payment_record_id, $post_meta );\n\n }\n $redirect_url_key = $status === 'success' ? 'success_redirect_url' : 'failed_redirect_url';\n\n echo json_encode( array( 'status' => $status, 'redirect_url' => $admin_settings->get_option_value( $redirect_url_key ) ) );\n\n die();\n\n }", "public function webhookAction()\n {\n $modelWebhook = Mage::getModel('chargepayment/webhook');\n\n $isDebugCard = Mage::getModel('chargepayment/creditCard')->isDebug();\n $isDebugJs = Mage::getModel('chargepayment/creditCardJs')->isDebug();\n $isDebugKit = Mage::getModel('chargepayment/creditCardKit')->isDebug();\n $isDebugHosted = Mage::getModel('chargepayment/hosted')->isDebug();\n\n $isDebug = $isDebugCard || $isDebugJs || $isDebugKit || $isDebugHosted ? true : false;\n\n if ($isDebug) {\n Mage::log(file_get_contents('php://input'), null, CheckoutApi_ChargePayment_Model_Webhook::LOG_FILE);\n Mage::log(json_decode(file_get_contents('php://input')), null, CheckoutApi_ChargePayment_Model_Webhook::LOG_FILE);\n }\n\n if (!$this->getRequest()->isPost()) {\n $this->getResponse()->setHttpResponseCode(400);\n return;\n }\n\n $request = new Zend_Controller_Request_Http();\n $key = $request->getHeader('Authorization');\n\n if (!$modelWebhook->isValidPublicKey($key)) {\n $this->getResponse()->setHttpResponseCode(401);\n return;\n }\n\n $data = json_decode(file_get_contents('php://input'));\n\n if (empty($data)) {\n $this->getResponse()->setHttpResponseCode(400);\n return;\n }\n\n $eventType = $data->eventType;\n\n if (!$modelWebhook->isValidResponse($data)) {\n $this->getResponse()->setHttpResponseCode(400);\n return;\n }\n\n switch ($eventType) {\n case CheckoutApi_ChargePayment_Model_Webhook::EVENT_TYPE_CHARGE_CAPTURED:\n $result = $modelWebhook->captureOrder($data);\n break;\n case CheckoutApi_ChargePayment_Model_Webhook::EVENT_TYPE_CHARGE_REFUNDED:\n $result = $modelWebhook->refundOrder($data);\n break;\n case CheckoutApi_ChargePayment_Model_Webhook::EVENT_TYPE_CHARGE_VOIDED:\n $result = $modelWebhook->voidOrder($data);\n break;\n case CheckoutApi_ChargePayment_Model_Webhook::EVENT_TYPE_INVOICE_CANCELLED:\n $result = $modelWebhook->voidOrder($data);\n break;\n default:\n $this->getResponse()->setHttpResponseCode(500);\n return;\n }\n\n $httpCode = $result ? 200 : 400;\n\n $this->getResponse()->setHttpResponseCode($httpCode);\n }", "public function getPaymentStatus()\n {\n $payment_id = Session::get('paypal_payment_id');\n\n /** clear the session payment ID **/\n Session::forget('paypal_payment_id');\n \n if (empty(Input::get('PayerID')) || empty(Input::get('token'))) {\n\n \\Session::put('error', 'Payment failed');\n return Redirect::to('/');\n\n }\n\n $payment = Payment::get($payment_id, $this->_api_context);\n $execution = new PaymentExecution();\n $execution->setPayerId(Input::get('PayerID'));\n\n /**Execute the payment **/\n $result = $payment->execute($execution, $this->_api_context);\n \n if ($result->getState() == 'approved') {\n\n#-------------------SE ALMACENA LA COMPRA--------------------#\n #$this->saveOrder();\n #$usuario = Auth::id();\n #$cliente = 16;#NO TENGO CLARO DE DONDE OBTENGO EL SESSION DEL CLIENTE\n\n $cliente = 16;\n $usuario = Auth::id();#NO TENGO CLARO DE DONDE OBTENGO EL SESSION DEL CLIENTE\n\n $total = Cart::total();\n \n DB::beginTransaction();\n try {//db transaccion \n $id = DB::table('Ventas')->insertGetId( ['total' => $total,'id_user' => $usuario, 'id_cliente' => $cliente]);\n\n #--- ALMACENANDO DETALLE_PAGO\n $id_tipo_pago=1; # Por el momento 1 por paypal, solamente funcionando, una vez se coloque otro tipo de pago debe hacerce un casopara almacenar cada tipo de pago\n\n # $cliente = 3; #Por el momento se coloca cliente de manera manual\n\n DB::table('ventas_detalle_pago')->insert( ['id_venta' => $id, 'id_tipo_pago' => $id_tipo_pago,'id_user' => $usuario,'id_cliente' => $cliente,'referencia' => $payment_id]);\n\n \n foreach (Cart::content() as $item) { \n\n #----Buscando el precio en la tabla curso\n if($item->model->id_categoria == 1){\n\n $product = DB::table('products AS P')\n ->join('Cursos AS C', 'C.id_curso', '=', 'P.id_curso') \n #id_p tiene el id delcurso paquete o promocion segun sea el caso\n ->select('C.id_curso AS id_p','C.precio AS precio','C.nombre AS nombre')\n ->where('P.id', '=', $item->id )->first();\n\n \n #---Buscando el precio en la tabla promociones\n } if($item->model->id_categoria == 3){\n\n $product = DB::table('products AS P')\n ->join('Promociones AS C', 'C.id_promocion', '=', 'P.id_promocion') \n \n ->select('C.id_promocion AS id_p','C.precio AS precio','C.nombre AS nombre')\n ->where('P.id', '=', $item->id )->first(); \n \n\n\n #---Buscando el precio en la tabla paquetes\n } if($item->model->id_categoria == 2){\n\n $product = DB::table('products AS P')\n ->join('Paquetes AS C', 'C.id_paquete', '=', 'P.id_paquete') \n \n ->select('C.id_paquete AS id_p','C.precio AS precio','C.nombre AS nombre')\n ->where('P.id', '=', $item->id )->first(); \n } \n #---- ALMACENADO VENTAS_DETALLE\n $id_venta_d=DB::table('Ventas_Detalle')->insertGetId(['id_venta' => $id, 'id_producto' => $item->id, 'precio_venta' => $product->precio]);\n\n\n\n #--- ALMACENANDO VENTAS_SUBDETALLE - UNA SENTENCIA SEGUN SEA LA CATEGORIA\n\n if($item->model->id_categoria == 1){\n\n DB::table('ventas_subdetalle')->insert( ['id_venta_d' => $id_venta_d, 'id_curso' => $product->id_p,'precio' => $product->precio,'nombre' => $product->nombre]); #SE TRAE AL PRECIO Y NOMBRE DEL OBJETO PRODUCTO ( CURSO ) \n\n } elseif($item->model->id_categoria == 3){\n\n DB::table('ventas_subdetalle')->insert( ['id_venta_d' => $id_venta_d, 'id_promocion' => $product->id_p,'precio' => $product->precio,'nombre' => $product->nombre]); #SE TRAE AL PRECIO Y NOMBRE DEL OBJETO PRODUCTO PROMOCION) \n\n\n } elseif($item->model->id_categoria == 2){\n\n DB::table('ventas_subdetalle')->insert( ['id_venta_d' => $id_venta_d, 'id_paquete' => $product->id_p,'precio' => $product->precio,'nombre' => $product->nombre]); #SE TRAE AL PRECIO Y NOMBRE DEL OBJETO PRODUCTO (PAQUETE) \n\n }\n\n\n \n /*\n DB::table('Ventas_Detalle')->insert(\n ['id_producto' => $item->id, 'precio_venta' => $product->precio]); */\n \n } //foreach\n DB::commit(); // todo ok\n\n }catch(Exception $e){\n \n DB::rollback();\n\n } // catch\n\n\n\n\n \n#------------------------------------------------------------#\n\n\n\n \\Session::put('success', 'Payment success');\n \\Session::forget('cart');# inicializando carrito\n return redirect()->route('cart.index')->withSuccessMessage('Su pago ha sido recibido de forma exitosa bajo el #'. $payment_id); \n\n\n }\n\n \\Session::put('error', 'Payment failed');\n return Redirect::to('/');\n\n }", "public function webhook(Request $request): void\n {\n if (! $request->has('id')) {\n return;\n }\n\n $payment = Mollie::api()->orders()->get($request->id);\n\n $order = $this->findOrder($payment->id);\n\n switch ($payment->status) {\n case 'paid':\n $this->isPaid($order, Carbon::parse($payment->paidAt), $payment->method);\n break;\n case 'authorized':\n $this->isAuthorized($order, Carbon::parse($payment->authorizedAt), $payment->method);\n break;\n case 'completed':\n $this->isCompleted($order, Carbon::parse($payment->completedAt), $payment->method);\n break;\n case 'expired':\n $this->isExpired($order, Carbon::parse($payment->expiredAt));\n break;\n case 'canceled':\n $this->isCanceled($order, Carbon::parse($payment->canceledAt));\n break;\n }\n }", "public function processTransaction() {\n // Uses the CURL library for php to establish a connection,\n // submit the post, and record the response.\n if(function_exists('curl_init') && extension_loaded('curl')) {\n $request = curl_init($this->getEnvironment()); // Initiate curl object\n curl_setopt($request, CURLOPT_HEADER, 0); // Set to 0 to eliminate header info from response\n curl_setopt($request, CURLOPT_RETURNTRANSFER, 1); // Returns response data instead of TRUE(1)\n curl_setopt($request, CURLOPT_POSTFIELDS, $this->getNVP()); // Use HTTP POST to send the data\n curl_setopt($request, CURLOPT_SSL_VERIFYPEER, FALSE); // Uncomment this line if you get no gateway response.\n $postResponse = curl_exec($request); // Execute curl post and store results in $post_response\n \n // Additional options may be required depending upon your server configuration\n // you can find documentation on curl options at http://www.php.net/curl_setopt\n curl_close($request); // close curl object\n \n // Get the response.\n $this->response = $postResponse; \n return TRUE;\n }\n else {\n return FALSE;\n }\n }", "public function handleGatewayCallback()\n {\n $paymentDetails = Paystack::getPaymentData();\n\n //dd($paymentDetails['status']);\n\n }", "public function handleGatewayCallback()\n {\n $paymentDetails = Paystack::getPaymentData();\n if($paymentDetails['status'])\n {\n $userSubscriptionPlan = UserSubscriptionPlan::where('reference_id',$paymentDetails['data']['reference'])->first();\n if($userSubscriptionPlan)\n {\n $userSubscriptionPlan->status = $paymentDetails['data']['status'];\n $userSubscriptionPlan->transaction_date = $paymentDetails['data']['transaction_date'];\n $userSubscriptionPlan->ip_address = $paymentDetails['data']['ip_address'];\n $userSubscriptionPlan->subscription_date = date(\"Y-m-d\");\n $userSubscriptionPlan->is_expired = 0;\n $userSubscriptionPlan->expired_date = date(\"Y-m-d\", strtotime(\"+\".$userSubscriptionPlan->subscription->validity_period.\" days\"));\n if($userSubscriptionPlan->save())\n {\n $input = array(\n 'user_id' => $userSubscriptionPlan->user_id,\n 'business_id' => $userSubscriptionPlan->business->id,\n 'user_subscription_plan_id' => $userSubscriptionPlan->id,\n 'is_blocked' => 1,\n );\n switch ($userSubscriptionPlan->subscription->type) {\n case 'business':\n $input = array_intersect_key($input, BusinessBanner::$updatable);\n $businessBanner = BusinessBanner::create($input);\n if($businessBanner->save())\n {\n return redirect('my-account')->with('success', \"Business Banner has been added successfully added. Please add your business banner.\");\n }else\n {\n return redirect('my-account')->with('warning', \"Business Banner could not be added. Please contact admin.\");\n }\n break;\n\n case 'event':\n $input = array_intersect_key($input, EventBanner::$updatable);\n $eventBanner = EventBanner::create($input);\n if($eventBanner->save())\n {\n return redirect('my-account')->with('success', \"Event Banner has been added successfully added. Please add your Event banner.\");\n }else\n {\n return redirect('my-account')->with('warning', \"Event Banner could not be added. Please contact admin.\");\n }\n break;\n\n case 'sponsor':\n $input = array_intersect_key($input, HomePageBanner::$updatable);\n $homePageBanner = HomePageBanner::create($input);\n if($homePageBanner->save())\n {\n return redirect('my-account')->with('success', \"Sponsor Banner has been added successfully added. Please add your Sponsor banner.\");\n }else\n {\n return redirect('my-account')->with('warning', \"Sponsor Banner could not be added. Please contact admin.\");\n }\n break;\n\n case 'premium':\n $user = User::whereId(Auth::id())->update(['user_role_id' => 4]);\n if ($user) {\n return redirect('my-account')->with('success', \"Premium plan has been activated successfully. Please add your Sponsor banner.\");\n } else {\n return redirect('my-account')->with('warning', \"Premium Plan could not be activated. Please contact admin.\");\n }\n break;\n }\n }else\n {\n return redirect('my-account')->with('error', \"Subscription plan could not be updated. Please contact admin.\");\n }\n \n }else\n {\n return redirect('my-account')->with('error', \"User Subscription plan could not be created. Please contact admin.\");\n }\n var_dump($userSubscriptionPlan);\n }else\n {\n $userSubscriptionPlan = UserSubscriptionPlan::where('reference_id',$paymentDetails['data']['reference'])->first();\n $userSubscriptionPlan->status = \"failure\";\n $userSubscriptionPlan->save();\n return redirect('my-account')->with('error', $paymentDetails['message']);\n }\n //dd($paymentDetails);\n // Now you have the payment details,\n // you can store the authorization_code in your db to allow for recurrent subscriptions\n // you can then redirect or do whatever you want\n }", "public function process_payment() {\n\n\t\t$this->get_handler()->log( 'Processing payment' );\n\n\t\tcheck_ajax_referer( 'wc_' . $this->get_handler()->get_processing_gateway()->get_id() . '_apple_pay_process_payment', 'nonce' );\n\n\t\t$response = stripslashes( SV_WC_Helper::get_post( 'payment' ) );\n\n\t\t$this->get_handler()->store_payment_response( $response );\n\n\t\ttry {\n\n\t\t\t$result = $this->get_handler()->process_payment();\n\n\t\t\twp_send_json_success( $result );\n\n\t\t} catch ( \\Exception $e ) {\n\n\t\t\t$this->get_handler()->log( 'Payment failed. ' . $e->getMessage() );\n\n\t\t\twp_send_json_error( array(\n\t\t\t\t'message' => $e->getMessage(),\n\t\t\t\t'code' => $e->getCode(),\n\t\t\t) );\n\t\t}\n\t}", "public function callback() {\r\n\t\t//1 pending,2 processing,3 shipped,4 \"\",5 complete,6 \"\",7 canceled,8 denied,9 Canceled Reversal,10 Failed,11 Refunded,12 Reversed,13 Chargeback,14 Expired,15 Processed,16 Voided,17 \"\",\r\n\t\t$this->load->model('checkout/order');\r\n\r\n\t\t\tif (isset($this->request->get['Ds_Order'])) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t// Recogemos la clave del comercio para autenticar\r\n\t\t\t\t$clave = $this->config->get('redsys_clave');\t\r\n\t\t\t\t// Recogemos datos de respuesta\r\n\t\t\t\t$total = $_GET[\"Ds_Amount\"];\r\n\t\t\t\t$pedido = $_GET[\"Ds_Order\"];\r\n\t\t\t\t$codigo = $_GET[\"Ds_MerchantCode\"];\r\n\t\t\t\t$moneda = $_GET[\"Ds_Currency\"];\r\n\t\t\t\t$respuesta = $_GET[\"Ds_Response\"];\r\n\t\t\t\t$firma_remota = $_GET[\"Ds_Signature\"];\r\n\t\t\t\t$fecha= $_GET[\"Ds_Date\"];\r\n\t\t\t\t$hora= $_GET[\"Ds_Hour\"];\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t// Cálculo del SHA1\r\n\t\t\t\t$mensaje = $total . $pedido . $codigo . $moneda . $respuesta . $clave;\r\n\t\t\t\t$firma_local = strtoupper(sha1($mensaje));\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tif ($firma_local == $firma_remota){\r\n\t\t\t\t\t\t\t// Formatear variables\r\n\t\t\t\t\t\t\t$respuesta = intval($respuesta);\r\n\r\n\t\t\t\t\t\t\tif ($respuesta < 101){\r\n\t\t\t\t\t\t\t\t\t//$this->model_checkout_order->addOrderHistory($idPedido, 5);\r\n\t\t\t\t\t\t\t\t\t$this->response->redirect($this->url->link('checkout/success'));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\t\r\n\t\t\t\t\t\t\t\t\t//$this->model_checkout_order->addOrderHistory($idPedido, 7);\r\n\t\t\t\t\t\t\t\t\t$this->response->redirect($this->url->link('checkout/failure'));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}// if (firma_local=firma_remota)\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t//$this->model_checkout_order->addOrderHistory($idPedido, 7);\r\n\t\t\t\t\t\t\t\t\t$this->response->redirect($this->url->link('checkout/failure'));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\r\n\t\t\t} \r\n\t\t\telse if (isset($this->request->post['Ds_Order'])){\r\n\t\t\t\t\r\n\t\t\t\t//Recuperamos Id_pedido\r\n\t\t\t\t$idPedido=$this->request->post['Ds_Order'];\r\n\t\t\t\t$idPedido=substr($idPedido,0,8);\r\n\t\t\t\t$idPedido=ltrim($idPedido,\"0\");\r\n\t\t\t\t$order = $this->model_checkout_order->getOrder($idPedido);\r\n\t\t\t\t\r\n\t\t\t\t// Recogemos la clave del comercio para autenticar\r\n\t\t\t\t$clave = $this->config->get('redsys_clave');\t\r\n\t\t\t\t// Recogemos datos de respuesta\r\n\t\t\t\t$total = $_POST[\"Ds_Amount\"];\r\n\t\t\t\t$pedido = $_POST[\"Ds_Order\"];\r\n\t\t\t\t$codigo = $_POST[\"Ds_MerchantCode\"];\r\n\t\t\t\t$moneda = $_POST[\"Ds_Currency\"];\r\n\t\t\t\t$respuesta = $_POST[\"Ds_Response\"];\r\n\t\t\t\t$firma_remota = $_POST[\"Ds_Signature\"];\r\n\t\t\t\t$fecha= $_POST[\"Ds_Date\"];\r\n\t\t\t\t$hora= $_POST[\"Ds_Hour\"];\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t// Cálculo del SHA1\r\n\t\t\t\t$mensaje = $total . $pedido . $codigo . $moneda . $respuesta . $clave;\r\n\t\t\t\t$firma_local = strtoupper(sha1($mensaje));\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tif ($firma_local == $firma_remota){\r\n\t\t\t\t\t\t\t// Formatear variables\r\n\t\t\t\t\t\t\t$respuesta = intval($respuesta);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif ($respuesta < 101){\r\n\t\t\t\t\t\t\t\t\t$this->model_checkout_order->addOrderHistory($idPedido, 5);\r\n\t\t\t\t\t\t\t\t\t//$this->response->redirect($this->url->link('checkout/success'));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t$this->model_checkout_order->addOrderHistory($idPedido, 7);\r\n\t\t\t\t\t\t\t\t\t//$this->response->redirect($this->url->link('checkout/failure'));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}// if (firma_local=firma_remota)\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t$this->model_checkout_order->addOrderHistory($idPedido, 7);\r\n\t\t\t\t\t\t\t\t\t//$this->response->redirect($this->url->link('checkout/failure'));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\techo (\"No hay respuesta del TPV\");\r\n\t\t\t}\t\t\r\n\t\t\r\n\t}", "public function onUserRequestTransactionReturn(Payment_Model_Order $order, array $params = array()) {\n\n $user_request = $order->getSource();\n $user = $order->getUser();\n\n if ($user_request->payment_status == 'pending') {\n return 'pending';\n }\n\n $pollURL = $_SESSION['paynow_payment_begin']['pollurl'];\n\n $ch = curl_init();\n\n //set the url, number of POST vars, POST data\n curl_setopt($ch, CURLOPT_URL, $pollURL);\n curl_setopt($ch, CURLOPT_POST, 0);\n curl_setopt($ch, CURLOPT_POSTFIELDS, '');\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\n //execute post\n $result = curl_exec($ch);\n\n if ($result) {\n\n //close connection\n $msg = $this->parseMsg($result);\n }\n\n if ($msg['status'] == 'Cancelled' || $msg['status'] == 'created but not paid' || $msg['status'] == 'Failed') {\n return 'cancel';\n }\n\n $gateway_order_id = $msg['paynowreference'];\n\n // Let's log it\n $this->getGateway()->getLog()->log('Return (Paynow): '\n . print_r($params, true), Zend_Log::INFO);\n\n //$gateway_profile_id = $gateway_order_id = $params['charge_id'];\n // Update order with profile info and complete status?\n $order->state = 'complete';\n $order->gateway_order_id = $gateway_order_id;\n $order->save();\n\n $user_request->payment_status = 'active';\n $user_request->gateway_profile_id = $gateway_order_id;\n $user_request->save();\n\n $paymentStatus = 'okay';\n\n //Insert transaction\n /*\n * Here 'siteeventticket_paymentrequest' is used for \"Advanced Events - Events Booking, Tickets Selling & Paid Events\" payment requests.\n * Here 'sitestoreproduct_paymentrequest' is used for \"Stores / Marketplace - Ecommerce\" payment requests. \n */\n if ($order->source_type == 'siteeventticket_paymentrequest') {\n $transactionsTable = Engine_Api::_()->getDbtable('transactions', 'siteeventticket');\n $orderIdColumnName = 'order_id';\n } elseif ($order->source_type == 'sitestoreproduct_paymentrequest') {\n $transactionsTable = Engine_Api::_()->getDbtable('transactions', 'sitestoreproduct');\n $orderIdColumnName = 'parent_order_id';\n }\n\n $transactionParams = array(\n 'user_id' => $order->user_id,\n 'sender_type' => 1,\n 'gateway_id' => Engine_Api::_()->sitegateway()->getGatewayColumn(array('columnName' => 'gateway_id', 'plugin' => 'Sitegateway_Plugin_Gateway_Paynow')),\n 'date' => new Zend_Db_Expr('NOW()'),\n 'payment_order_id' => $order->order_id,\n \"$orderIdColumnName\" => $order->source_id,\n 'type' => 'payment',\n 'state' => $paymentStatus,\n 'gateway_transaction_id' => $gateway_order_id,\n 'amount' => $user_request->response_amount,\n 'currency' => Engine_Api::_()->sitegateway()->getCurrency()\n );\n $transactionsTable->insert($transactionParams);\n\n $transactionParams = array_merge($transactionParams, array('resource_type' => $order->source_type));\n Engine_Api::_()->sitegateway()->insertTransactions($transactionParams);\n\n // Get benefit setting\n $giveBenefit = $transactionsTable->getBenefitStatus($user);\n\n // Check payment status\n if ($paymentStatus == 'okay' || ($paymentStatus == 'pending' && $giveBenefit)) {\n\n $user_request->gateway_profile_id = $gateway_profile_id;\n\n // Payment success\n $user_request->onPaymentSuccess();\n\n return 'active';\n } else if ($paymentStatus == 'pending') {\n\n $user_request->gateway_profile_id = $gateway_profile_id;\n\n // Payment pending\n $user_request->onPaymentPending();\n\n return 'pending';\n } else if ($paymentStatus == 'failed') {\n // Cancel order and advertiesment?\n $order->onFailure();\n $user_request->onPaymentFailure();\n\n // Payment failed\n throw new Payment_Model_Exception('Your payment could not be completed due to some reason, Please contact to site admin.');\n } else {\n // This is a sanity error and cannot produce information a user could use to correct the problem.\n throw new Payment_Model_Exception('There was an error processing your ' .\n 'transaction. Please try again later.');\n }\n }", "public function handle_result() {\n\t\t\t\tif ( ! isset( $_REQUEST['order-id'] ) || empty( $_REQUEST['order-id'] ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t$response = file_get_contents( 'php://input' );\n\t\t\t\t$jsonResponse = json_decode( $response );\n\t\t\t\t$responseArray = json_decode($response,true);\n\t\t\t\t\n\t\t\t\t$order = wc_get_order( $_REQUEST['order-id'] );\n\t\t\t\t\n\t\t\t $order->add_order_note( $this->generateTable($responseArray),'success' );\n\t\t\t // Only Log when test mode is enabled\n\t\t\t if( 'yes' == $this->get_option( 'test_enabled' ) ) {\n\t\t\t \t$order->add_order_note( $response );\n\t\t\t }\n\t\t\t \n\n\t\t\t\tif ( isset( $jsonResponse->transactionStatus ) && 'APPROVED' == $jsonResponse->transactionStatus ) {\n\t\t\t\t\t\t// Complete this order, otherwise set it to another status as per configurations\n\t\t\t\t\t\t$order->payment_complete();\n\t\t\t\t\t\t$order->update_status( $this->get_option( 'success_payment_status' ), __( 'Havano Payment was Successful.', 'havanao' ) );\t\n\t\t\t\t} else {\n\t\t\t\t\t$order->update_status( $this->get_option( 'errored_payment_status' ), __( 'Havano Payment was Successful.', 'havanao' ) );\t\n\t\t\t\t}\n\t\t\t}", "public function getPaymentStatus(Request $request){\n\n $payment_id = Session::get('paypal_payment_id');\n\n // clear the session payment ID\n Session::forget('paypal_payment_id');\n \n if (empty($request->input('PayerID')) || empty($request->input('token'))) {\n $request->session()->flash('error', 'Your payment failed');\n return redirect()->route('subscriber_account');\n }\n \n $payment = Payment::get($payment_id, $this->_api_context);\n \n // PaymentExecution object includes information necessary\n // to execute a PayPal account payment.\n // The payer_id is added to the request query parameters\n // when the user is redirected from paypal back to your site\n $execution = new PaymentExecution();\n $execution->setPayerId($request->input('PayerID'));\n \n //Execute the payment\n $result = $payment->execute($execution, $this->_api_context);\n \n if ($result->getState() == 'approved') { // payment made \n // insert to DB users_subscription \n $user = DB::table('users')->where('email', Auth::user()->email)->first(); \n\n // change users type to 2\n DB::table('users')->where('email', $user->email)->update([\n 'subscription_type' => 2\n ]);\n\n // insert users_subscription\n $started_time_stamp = date(\"Y-m-d H:i:s\");\n $next_month = date(\"Y-m-d H:i:s\", strtotime(\"$started_time_stamp +1 month\"));\n\n // subscriber_type = 1: free, 2: monthly, 3: yearly\n $id = DB::table('users_subscription')->insertGetId([\n 'user_id' => $user->id,\n 'started_time_stamp' => $started_time_stamp,\n 'subscriber_type' => 2,\n 'status' => 1,\n 'subscription_ends_time_stamp' => $next_month\n ]);\n\n // change users type to 2\n DB::table('users')->where('email', $user->email)->update([\n 'subscription_type' => 2,\n 'subscription_id' => $id\n ]);\n\n $request->session()->flash('success', 'Your payment has been processed successfully.');\n return redirect()->route('subscriber_account');\n }\n \n return view('subscriber/account/payment_status', compact('author'));\n }", "public function successAction() {\n \n //Grab the database ID\n $collection = Mage::getModel('CardstreamHosted/CardstreamHosted_Trans')->getCollection();\n $collection->addFilter('transactionunique', $_POST['transactionUnique']);\n $transrow = $collection->toArray();\n \n //Grab the database ID\n \n if( isset( $transrow['items'][0]['id'] ) ){\n \n $transid = $transrow['items'][0]['id'];\n \n }else{\n \n $transid = false;\n \n }\n\n if( $transid ){\n \n //We have a transaction ID\n \n $trans = $transrow['items'][0];\n \n // Get the last four of the card used.\n if( isset( $_POST['cardNumberMask'] ) ){\n \n $lastfour = substr($_POST['cardNumberMask'], -4, strlen($_POST['cardNumberMask']) );\n \n }else{\n \n $lastfour = false;\n \n }\n \n //If threeDSEnrolled has been sent, insert it into the database. Otherwise, insert nothing.\n \n if( isset( $_POST['threeDSEnrolled'] ) ){\n \n $threeDSEnrolled = $_POST['threeDSEnrolled'];\n \n }else{\n \n $threeDSEnrolled = false;\n \n }\n \n //If threeDSAuthenticated has been sent, insert it into the database. Otherwise, insert nothing.\n \n if( isset( $_POST['threeDSAuthenticated'] ) ){\n \n $threeDSAuthenticated = $_POST['threeDSAuthenticated'];\n \n }else{\n \n $threeDSAuthenticated = false;\n \n }\n \n //If cardType has been sent, insert it into the database. Otherwise, insert nothing.\n if( isset( $_POST['cardType'] ) ){\n \n $cardType = $_POST['cardType'];\n \n }else{\n \n $cardType = false;\n \n }\n \n //Update the database with the transaction result\n $trn = Mage::getModel('CardstreamHosted/CardstreamHosted_Trans')->loadById( $trans['id'] );\n $trn->setxref( $_POST['xref'] )\n ->setresponsecode( $_POST['responseCode'] )\n ->setmessage( $_POST['responseMessage'] )\n ->setthreedsenrolled( $threeDSEnrolled )\n ->setthreedsauthenticated( $threeDSAuthenticated )\n ->setlastfour( $lastfour )\n ->setcardtype( $cardType )\n ->save();\n\n if( $_POST['responseCode'] === \"0\") {\n\n if( $_POST['amountReceived'] == $trans['amount'] ){\n\n //Load order\n $order = Mage::getModel('sales/order');\n $order->loadByIncrementId( $trans['orderid'] );\n\n if( $order->getId() ){\n\n $order->sendNewOrderEmail();\n $order->true;\n\n if( !$order->canInvoice() ) {\n\n //Add order comment and update status - Although we cant invoice, its important to record the transaction outcome.\n $order->addStatusToHistory( Mage::getStoreConfig('payment/CardstreamHosted_standard/successfulpaymentstatus'), $this->buildordermessage(), 0);\n $order->save();\n\n //when order cannot create invoice, need to have some logic to take care\n $order->addStatusToHistory(\n $order->getStatus(),\n Mage::helper('CardstreamHosted')->__('Order cannot create invoice')\n );\n\n }else{\n\n //need to save transaction id\n $order->getPayment()->setTransactionId( $_POST['xref'] );\n $order->save();\n $converter = Mage::getModel('sales/convert_order');\n $invoice = $converter->toInvoice($order);\n\n foreach($order->getAllItems() as $orderItem) {\n\n if(!$orderItem->getQtyToInvoice()) {\n continue;\n }\n\n $item = $converter->itemToInvoiceItem($orderItem);\n $item->setQty($orderItem->getQtyToInvoice());\n $invoice->addItem($item);\n }\n\n $invoice->collectTotals();\n $invoice->register()->capture();\n $CommentData = \"Invoice \" . $invoice->getIncrementId() . \" was created\";\n\n Mage::getModel('core/resource_transaction')\n ->addObject($invoice)\n ->addObject($invoice->getOrder())\n ->save();\n\n //Add order comment and update status.\n $order->addStatusToHistory( Mage::getStoreConfig('payment/CardstreamHosted_standard/successfulpaymentstatus'), $this->buildordermessage(), 0);\n\n $order->save();\n\n }\n\n }\n\n $this->_redirect('checkout/onepage/success');\n\n }else{\n\n $order = Mage::getModel('sales/order');\n $order->loadByIncrementId( $trans['orderid'] );\n\n if( $order->getId() ){\n\n //Add order comment and update status\n $order->addStatusToHistory( Mage::getStoreConfig('payment/CardstreamHosted_standard/order_status'), $this->buildordermessage(), 0);\n $order->addStatusToHistory( Mage::getStoreConfig('payment/CardstreamHosted_standard/order_status'), \"The amount paid did not match the amount due.\", 0);\n\n $order->save();\n\n }\n\n $session = Mage::getSingleton('checkout/session');\n $session->setQuoteId( $trans['quoteid'] );\n Mage::getModel('sales/quote')->load($session->getQuoteId())->setIsActive(true)->save();\n\n $message = \"The amount paid did not match the amount due. Please contact us for more information\";\n $session->addError($message);\n $this->_redirect('checkout/cart');\n\n }\n \n }else{\n \n $order = Mage::getModel('sales/order');\n $order->loadByIncrementId( $trans['orderid'] );\n\n if( $order->getId() ){\n\n //Add order comment and update status.\n $order->addStatusToHistory( Mage::getStoreConfig('payment/CardstreamHosted_standard/unsuccessfulpaymentstatus'), $this->buildordermessage(), 0);\n $order->save(); \n\n }\n\n $session = Mage::getSingleton('checkout/session');\n $session->setQuoteId( $trans['quoteid'] );\n Mage::getModel('sales/quote')->load($session->getQuoteId())->setIsActive(true)->save();\n\n $this->loadLayout();\n\n $block = $this->getLayout()->createBlock(\n 'Mage_Core_Block_Template',\n 'CardstreamHosted/standard_failure',\n array('template' => 'CardstreamHosted/standard/failure.phtml')\n );\n\n $this->getLayout()->getBlock('content')->append($block);\n\n $this->renderLayout();\n \n }\n \n }else{\n \n $order = Mage::getModel('sales/order');\n $order->loadByIncrementId( Mage::getSingleton('checkout/session')->getCardstreamHostedOrderId() );\n\n if( $order->getId() ){\n\n //Add order comment and update status.\n $order->addStatusToHistory( Mage::getStoreConfig('payment/CardstreamHosted_standard/order_status'), $this->buildordermessage(), 0);\n $order->addStatusToHistory( Mage::getStoreConfig('payment/CardstreamHosted_standard/order_status'), \"Unable to locate the transaction in the CardstreamHosted table\", 0);\n $order->save(); \n\n }\n \n $session = Mage::getSingleton('checkout/session');\n $session->setQuoteId( Mage::getSingleton('checkout/session')->getCardstreamHostedQuoteId() );\n Mage::getModel('sales/quote')->load($session->getQuoteId())->setIsActive(true)->save();\n \n $message = \"Unable to locate transaction. Please contact us for payment status.\";\n $session->addError($message);\n $this->_redirect('checkout/cart');\n \n }\n \n }", "public function process()\n {\n // Check for required fields\n if (in_array(false, $this->required_fields)) {\n $fields = array();\n foreach ($this->required_fields as $key => $field) {\n if (!$field) {\n $fields[] = $key;\n }\n }\n throw new Kohana_Exception('payment.required', implode(', ', $fields));\n }\n\n $fields = '';\n foreach ($this->authnet_values as $key => $value) {\n $fields .= $key.'='.urlencode($value).'&';\n }\n\n $post_url = ($this->test_mode) ?\n 'https://certification.authorize.net/gateway/transact.dll' : // Test mode URL\n 'https://secure.authorize.net/gateway/transact.dll'; // Live URL\n\n $ch = curl_init($post_url);\n\n // Set custom curl options\n curl_setopt_array($ch, $this->curl_config);\n\n // Set the curl POST fields\n curl_setopt($ch, CURLOPT_POSTFIELDS, rtrim($fields, '& '));\n\n //execute post and get results\n $response = curl_exec($ch);\n \n curl_close($ch);\n \n if (!$response) {\n throw new Kohana_Exception('payment.gateway_connection_error');\n }\n\n // This could probably be done better, but it's taken right from the Authorize.net manual\n // Need testing to opimize probably\n $heading = substr_count($response, '|');\n\n for ($i=1; $i <= $heading; $i++) {\n $delimiter_position = strpos($response, '|');\n\n if ($delimiter_position !== false) {\n $response_code = substr($response, 0, $delimiter_position);\n \n $response_code = rtrim($response_code, '|');\n \n if ($response_code == '') {\n throw new Kohana_Exception('payment.gateway_connection_error');\n }\n\n switch ($i) {\n case 1:\n $this->response = (($response_code == '1') ? explode('|', $response) : false); // Approved\n\n $this->transaction = true;\n \n return $this->transaction;\n default:\n $this->transaction = false;\n \n return $this->transaction;\n }\n }\n }\n }", "function cp_transactions() {\r\n global $wpdb;\r\n\r\n // check to prevent php \"notice: undefined index\" msg when php strict warnings is on\r\n if ( isset( $_GET['action'] ) ) $theswitch = $_GET['action']; else $theswitch = '';\r\n\r\n switch ( $theswitch ) {\r\n\r\n // mark transaction as paid\r\n case 'setPaid':\r\n\r\n $update = \"UPDATE \" . $wpdb->prefix . \"cp_order_info SET payment_status = 'Completed' WHERE id = '\". $_GET['id'] .\"'\";\r\n $wpdb->query( $update );\r\n ?>\r\n <p style=\"text-align:center;padding-top:50px;font-size:22px;\"><?php _e('Updating transaction entry.....','appthemes') ?><br /><br /><img src=\"<?php echo bloginfo('template_directory') ?>/images/loader.gif\" alt=\"\" /></p>\r\n <meta http-equiv=\"refresh\" content=\"0; URL=?page=transactions\">\r\n\r\n <?php\r\n\r\n break;\r\n\r\n\r\n // mark transaction as unpaid\r\n case 'unsetPaid':\r\n\r\n $update = \"UPDATE \" . $wpdb->prefix . \"cp_order_info SET payment_status = 'Pending' WHERE id = '\". $_GET['id'] .\"'\";\r\n $wpdb->query( $update );\r\n ?>\r\n <p style=\"text-align:center;padding-top:50px;font-size:22px;\"><?php _e('Updating transaction entry.....','appthemes') ?><br /><br /><img src=\"<?php echo bloginfo('template_directory') ?>/images/loader.gif\" alt=\"\" /></p>\r\n <meta http-equiv=\"refresh\" content=\"0; URL=?page=transactions\">\r\n\r\n <?php\r\n\r\n break;\r\n\r\n\r\n // delete transaction entry\r\n case 'delete':\r\n\r\n $delete = \"DELETE FROM \" . $wpdb->prefix . \"cp_order_info WHERE id = '\". $_GET['id'] .\"'\";\r\n $wpdb->query( $delete );\r\n ?>\r\n <p style=\"text-align:center;padding-top:50px;font-size:22px;\"><?php _e('Deleting transaction entry.....','appthemes') ?><br /><br /><img src=\"<?php echo bloginfo('template_directory') ?>/images/loader.gif\" alt=\"\" /></p>\r\n <meta http-equiv=\"refresh\" content=\"0; URL=?page=transactions\">\r\n\r\n <?php\r\n\r\n break;\r\n\r\n\r\n // show the table of all transactions\r\n default:\r\n?>\r\n <div class=\"wrap\">\r\n <div class=\"icon32\" id=\"icon-themes\"><br /></div>\r\n <h2><?php _e('Order Transactions','appthemes') ?></h2>\r\n\r\n <?php cp_admin_info_box(); ?>\r\n\r\n <table id=\"tblspacer\" class=\"widefat fixed\">\r\n\r\n <thead>\r\n <tr>\r\n <th scope=\"col\" style=\"width:35px;\">&nbsp;</th>\r\n <th scope=\"col\"><?php _e('Payer Name','appthemes') ?></th>\r\n <th scope=\"col\" style=\"text-align: center;\"><?php _e('Payer Status','appthemes') ?></th>\r\n <th scope=\"col\"><?php _e('Ad Title','appthemes') ?></th>\r\n <th scope=\"col\"><?php _e('Item Description','appthemes') ?></th>\r\n <th scope=\"col\" style=\"width:125px;\"><?php _e('Transaction ID','appthemes') ?></th>\r\n <th scope=\"col\"><?php _e('Payment Type','appthemes') ?></th>\r\n <th scope=\"col\"><?php _e('Payment Status','appthemes') ?></th>\r\n <th scope=\"col\"><?php _e('Total Amount','appthemes') ?></th>\r\n <th scope=\"col\" style=\"width:150px;\"><?php _e('Date Paid','appthemes') ?></th>\r\n <th scope=\"col\" style=\"text-align:center;width:100px;\"><?php _e('Actions','appthemes') ?></th>\r\n </tr>\r\n </thead>\r\n\r\n <?php\r\n // must be higher than personal edition so let's query the db\r\n $sql = \"SELECT o.*, p.post_title \"\r\n . \"FROM \" . $wpdb->prefix . \"cp_order_info o, $wpdb->posts p \"\r\n . \"WHERE o.ad_id = p.id \"\r\n . \"ORDER BY o.id desc\";\r\n\r\n $results = $wpdb->get_results( $sql );\r\n\r\n if ( $results ) {\r\n $rowclass = '';\r\n $i=1;\r\n ?>\r\n\r\n <tbody id=\"list\">\r\n\r\n <?php\r\n foreach ( $results as $result ) {\r\n\r\n $rowclass = 'even' == $rowclass ? 'alt' : 'even';\r\n ?>\r\n\r\n <tr class=\"<?php echo $rowclass ?>\">\r\n <td style=\"padding-left:10px;\"><?php echo $i ?>.</td>\r\n\r\n <td><strong><?php echo $result->first_name ?> <?php echo $result->last_name ?></strong><br /><a href=\"mailto:<?php echo $result->payer_email ?>\"><?php echo $result->payer_email ?></a></td>\r\n <td style=\"text-align: center;\">\r\n <?php if ($result->payer_status == 'verified') { ?><img src=\"<?php bloginfo('template_directory'); ?>/images/paypal_verified.gif\" alt=\"\" title=\"\" /><br /><?php } ?>\r\n <?php echo ucfirst($result->payer_status) ?>\r\n </td>\r\n <td><a href=\"post.php?action=edit&post=<?php echo $result->ad_id ?>\"><?php echo $result->post_title ?></a></td>\r\n <td><?php echo $result->item_name ?></td>\r\n <td><?php echo $result->txn_id ?></td>\r\n <td><?php echo ucfirst($result->payment_type) ?></td>\r\n <td><?php echo ucfirst($result->payment_status) ?></td>\r\n <td><?php echo $result->mc_gross ?> <?php echo $result->mc_currency ?></td>\r\n <td><?php echo mysql2date(get_option('date_format') .' '. get_option('time_format'), $result->payment_date) ?></td>\r\n <td style=\"text-align:center\">\r\n <?php\r\n echo '<a onclick=\"return confirmBeforeDelete();\" href=\"?page=transactions&amp;action=delete&amp;id='. $result->id .'\" title=\"'. __('Delete', 'appthemes') .'\"><img src=\"'. get_bloginfo('template_directory') .'/images/cross.png\" alt=\"'. __('Delete', 'appthemes') .'\" /></a>&nbsp;&nbsp;&nbsp;';\r\n if(strtolower($result->payment_status) == 'completed')\r\n echo '<br /><a href=\"?page=transactions&amp;action=unsetPaid&amp;id='. $result->id .'\" title=\"'. __('Mark as Unpaid', 'appthemes') .'\">'. __('Unmark Paid', 'appthemes') .'</a>';\r\n else\r\n echo '<br /><a href=\"?page=transactions&amp;action=setPaid&amp;id='. $result->id .'\" title=\"'. __('Mark as Paid', 'appthemes') .'\">'. __('Mark Paid', 'appthemes') .'</a>';\r\n ?>\r\n </td>\r\n </tr>\r\n\r\n <?php\r\n\r\n $i++;\r\n\r\n } // end for each\r\n ?>\r\n\r\n </tbody>\r\n\r\n <?php\r\n\r\n } else {\r\n\r\n ?>\r\n\r\n <tr>\r\n <td>&nbsp;</td><td colspan=\"10\"><?php _e('No transactions found.','appthemes') ?></td>\r\n </tr>\r\n\r\n <?php\r\n } // end $results\r\n ?>\r\n\r\n </table> <!-- this is ok -->\r\n\r\n\r\n <div class=\"icon32\" id=\"icon-themes\"><br /></div>\r\n <h2><?php _e('Membership Orders','appthemes') ?></h2>\r\n <table id=\"tblspacer\" class=\"widefat fixed\">\r\n\r\n <thead>\r\n <tr>\r\n <th scope=\"col\" style=\"width:35px;\">&nbsp;</th>\r\n <th scope=\"col\"><?php _e('Payer Name','appthemes') ?></th>\r\n <th scope=\"col\" style=\"text-align: center;\"><?php _e('Payer Status','appthemes') ?></th>\r\n <th scope=\"col\"><?php _e('Item Description','appthemes') ?></th>\r\n <th scope=\"col\" style=\"width:125px;\"><?php _e('Transaction ID','appthemes') ?></th>\r\n <th scope=\"col\"><?php _e('Payment Type','appthemes') ?></th>\r\n <th scope=\"col\"><?php _e('Payment Status','appthemes') ?></th>\r\n <th scope=\"col\"><?php _e('Total Amount','appthemes') ?></th>\r\n <th scope=\"col\" style=\"width:150px;\"><?php _e('Date Paid','appthemes') ?></th>\r\n <th scope=\"col\" style=\"text-align:center;width:100px;\"><?php _e('Actions','appthemes') ?></th>\r\n </tr>\r\n </thead>\r\n\r\n\r\n\t\t<?php\r\n // seperate table for membership orders\r\n $sql = \"SELECT * \"\r\n . \"FROM \" . $wpdb->prefix . \"cp_order_info \"\r\n . \"WHERE ad_id = 0 \"\r\n . \"ORDER BY id desc\";\r\n\r\n $results = $wpdb->get_results($sql);\r\n\r\n if ($results) {\r\n $rowclass = '';\r\n $i=1;\r\n ?>\r\n\r\n <tbody id=\"list\">\r\n\r\n <?php\r\n foreach ( $results as $result ) {\r\n\r\n $rowclass = 'even' == $rowclass ? 'alt' : 'even';\r\n ?>\r\n\r\n <tr class=\"<?php echo $rowclass ?>\">\r\n <td style=\"padding-left:10px;\"><?php echo $i ?>.</td>\r\n\t\t\t\t\t<?php $payer = get_user_by('email', $result->payer_email); ?>\r\n <?php //TODO - LOOKUP CUSTOMER BY PAYPAL EMAIL CUSTOM PROFILE FIELD ?>\r\n <td><strong><?php echo $result->first_name ?> <?php echo $result->last_name ?></strong><br /><a href=\"<?php if(isset($payer->ID) && $payer) echo get_bloginfo('url').'/wp-admin/user-edit.php?user_id='.$payer->ID; else echo 'mailto:'.$result->payer_email; ?>\"><?php echo $result->payer_email ?></a></td>\r\n <td style=\"text-align: center;\">\r\n <?php if ($result->payer_status == 'verified') { ?><img src=\"<?php bloginfo('template_directory'); ?>/images/paypal_verified.gif\" alt=\"\" title=\"\" /><br /><?php } ?>\r\n <?php echo ucfirst($result->payer_status) ?>\r\n </td>\r\n <td><?php echo $result->item_name ?></td>\r\n <td><?php echo $result->txn_id ?></td>\r\n <td><?php echo ucfirst($result->payment_type) ?></td>\r\n <td><?php echo ucfirst($result->payment_status) ?></td>\r\n <td><?php echo $result->mc_gross ?> <?php echo $result->mc_currency ?></td>\r\n <td><?php echo mysql2date(get_option('date_format') .' '. get_option('time_format'), $result->payment_date) ?></td>\r\n <td style=\"text-align:center\">\r\n <?php\r\n echo '<a onclick=\"return confirmBeforeDelete();\" href=\"?page=transactions&amp;action=delete&amp;id='. $result->id .'\" title=\"'. __('Delete', 'appthemes') .'\"><img src=\"'. get_bloginfo('template_directory') .'/images/cross.png\" alt=\"'. __('Delete', 'appthemes') .'\" /></a>&nbsp;&nbsp;&nbsp;';\r\n if(strtolower($result->payment_status) == 'completed')\r\n echo '<br /><a href=\"?page=transactions&amp;action=unsetPaid&amp;id='. $result->id .'\" title=\"'. __('Mark as Unpaid', 'appthemes') .'\">'. __('Unmark Paid', 'appthemes') .'</a>';\r\n else\r\n echo '<br /><a href=\"?page=transactions&amp;action=setPaid&amp;id='. $result->id .'\" title=\"'. __('Mark as Paid', 'appthemes') .'\">'. __('Mark Paid', 'appthemes') .'</a>';\r\n ?>\r\n </td>\r\n </tr>\r\n\r\n <?php\r\n\r\n $i++;\r\n\r\n } // end for each\r\n ?>\r\n\r\n </tbody>\r\n\r\n <?php\r\n\r\n } else {\r\n\r\n ?>\r\n\r\n <tr>\r\n <td>&nbsp;</td><td colspan=\"9\"><?php _e('No transactions found.','appthemes') ?></td>\r\n </tr>\r\n\r\n <?php\r\n } // end $results\r\n ?>\r\n\r\n </table> <!-- this is ok -->\r\n\r\n\r\n </div><!-- end wrap -->\r\n\r\n <?php\r\n } // endswitch\r\n ?>\r\n\r\n\r\n\r\n <script type=\"text/javascript\">\r\n /* <![CDATA[ */\r\n function confirmBeforeDelete() { return confirm(\"<?php _e('WARNING: Are you sure you want to delete this transaction entry?? (This cannot be undone)', 'appthemes'); ?>\"); }\r\n /* ]]> */\r\n </script>\r\n\r\n<?php\r\n\r\n}", "public function execute()\n {\n try {\n $paymentResponse = $this->getRequest()->getPost();\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n $messageMessenger = $objectManager->get('Magento\\Framework\\Message\\ManagerInterface');\n\n if ($paymentResponse) {\n $responseCode = (string)$paymentResponse['TURKPOS_RETVAL_Sonuc'];\n $orderId = (string)$paymentResponse['TURKPOS_RETVAL_Siparis_ID'];\n $order = $this->orderFactory->create()->load($orderId, 'increment_id');\n\n if ($this->config->isAllowDebug()) {\n $this->logger->info(__('Response from Param for order id %1', $order->getId()));\n $this->logger->info(__('Response code: %1', $responseCode));\n }\n\n if ($order->getId()) {\n if ($responseCode == self::SUCCESS_STATUS) {\n $transactionId = (string)$paymentResponse['TURKPOS_RETVAL_Islem_ID'];\n $order->getPayment()->addData([\n 'cc_trans_id' => $transactionId, \n 'tranRes' => $paymentResponse['TURKPOS_RETVAL_Sonuc_Str'],\n 'tranDate' => $paymentResponse['TURKPOS_RETVAL_Islem_Tarih'],\n 'tranAmount' => $paymentResponse['TURKPOS_RETVAL_Tahsilat_Tutari'],\n 'docId' => $paymentResponse['TURKPOS_RETVAL_Dekont_ID'],\n 'tranResponseCode' => $paymentResponse['TURKPOS_RETVAL_Banka_Sonuc_Kod'],\n ])->save();\n \n $order->getPayment()->getMethodInstance()->capture($order->getPayment(), $order->getGrandTotal());\n $redirectUrl = $this->frontendUrlBuilder->setScope($order->getStoreId())->getUrl('checkout/onepage/success');\n $messageMessenger->addSuccess($paymentResponse['TURKPOS_RETVAL_Sonuc_Str']);\n return $this->resultRedirectFactory->create()->setUrl($redirectUrl);\n } else {\n $order->getPayment()->addData([\n 'tranRes' => $paymentResponse['TURKPOS_RETVAL_Sonuc_Str'],\n 'tranDate' => $paymentResponse['TURKPOS_RETVAL_Islem_Tarih'],\n 'tranResponseCode' => $paymentResponse['TURKPOS_RETVAL_Banka_Sonuc_Kod'],\n ])->save();\n \n $order->getPayment()->setAdditionalInformation('tranRes', $order->getPayment()->getData('tranRes'));\n $order->getPayment()->setAdditionalInformation('tranDate', $order->getPayment()->getData('tranDate'));\n $order->getPayment()->setAdditionalInformation('tranResponseCode', $order->getPayment()->getData('tranResponseCode'));\n $this->paymentResource->save($order->getPayment());\n \n $redirectUrl = $this->frontendUrlBuilder->setScope($order->getStoreId())->getUrl('checkout/onepage/failure');\n $messageMessenger->addError($paymentResponse['TURKPOS_RETVAL_Sonuc_Str']);\n return $this->resultRedirectFactory->create()->setUrl($redirectUrl);\n }\n }\n }\n } catch (Exception $e) {\n $this->logger->critical($e->getMessage());\n }\n\n if ($checkoutFailPage = $this->config->getCheckoutFailurePage()) {\n $redirectUrl = $this->pageHelper->getPageUrl($checkoutFailPage);\n return $this->resultRedirectFactory->create()->setUrl($redirectUrl);\n }\n\n return $this->resultRedirectFactory->create()->setPath('checkout/onepage/failure');\n }", "public function hookPaymentReturn($params)\n {\n if ($this->active == false)\n return;\n\n $order = $params['order'];\n\n $logger = new FileLogger(); //0 == nivel de debug. Sin esto logDebug() no funciona.\n $logger->setFilename(_PS_ROOT_DIR_.\"/kushkiLogs/\".date('Y-m-d').\".log\");\n\n\n if ($order->getCurrentOrderState()->id != Configuration::get('PS_OS_ERROR')){\n $this->smarty->assign('status', 'ok');\n\n\n // asignación sesiones normal\n $cookie = new Cookie('cookie_ticket_number');\n $cookiePdfUrl = new Cookie('cookie_kushkiPdfUrl');\n $cookie_flag = new Cookie('cookie_flag');\n\n // asignación sesiones transfer\n $cookie_transfer_flag = new Cookie('transfer_flag');\n // asignación sesiones card_async\n $cookie_card_async_flag = new Cookie('card_async_flag');\n\n\n if(isset($cookie_card_async_flag->variable_name) and (int)$cookie_card_async_flag->variable_name === 1){\n $this->smarty->assign('is_card_async', $cookie_card_async_flag->variable_name);\n $cookie_card_async_ticketNumber = new Cookie('card_async_ticketNumber');\n $cookie_card_async_status = new Cookie('card_async_status');\n $cookie_card_async_transactionReference = new Cookie('card_async_transactionReference');\n $_body_main_card_async = new Cookie('_body_main_card_async');\n\n $var_card_async_created = date('Y/m/d', $_body_main_card_async->variable_name);\n $this->smarty->assign('card_async_created', $var_card_async_created);\n\n if(isset($cookie_card_async_ticketNumber->variable_name) ) {\n $this->smarty->assign('card_async_ticketNumber', $cookie_card_async_ticketNumber->variable_name);\n }\n if(isset($cookie_card_async_transactionReference->variable_name) ) {\n $this->smarty->assign('card_async_transactionReference', $cookie_card_async_transactionReference->variable_name);\n }\n\n if(isset($cookie_flag->variable_name) and (int)$cookie_flag->variable_name===1) {\n\n $logger->logInfo(\" * Payment status on card_async: \".$cookie_card_async_status->variable_name.\", ticket number: \" . $cookie_card_async_ticketNumber->variable_name . \" whit reference: \" . $order->reference . \" - orden id: \" . $order->id);\n PrestaShopLogger::addLog('Kushki pago status: '.$cookie_card_async_status->variable_name.' en orden ' . $order->id . ' con referencia ' . $order->reference . ' y numero de ticket: ' . $cookie_card_async_ticketNumber->variable_name, 1);\n $cookie_flag->variable_name = 0;\n $cookie_flag->write();\n }\n }\n\n\n if(isset($cookie_transfer_flag->variable_name) and (int)$cookie_transfer_flag->variable_name === 1){\n\n // asignación sesiones transfer\n $cookie_transfer_ticketNumber = new Cookie('transfer_ticketNumber');\n $cookie_transfer_status = new Cookie('transfer_status');\n $cookie_transfer_statusDetail = new Cookie('transfer_statusDetail');\n $cookie_transfer_trazabilityCode = new Cookie('transfer_trazabilityCode');\n $_body_main = new Cookie('_body_main');\n $_bankName = new Cookie('_bankName');\n\n if(isset($cookie_flag->variable_name) and (int)$cookie_flag->variable_name === 1) {\n\n $logger->logInfo(\" * Payment status: \".$cookie_transfer_status->variable_name.\", ticket number: \" . $cookie_transfer_ticketNumber->variable_name . \" whit reference: \" . $order->reference . \" - orden id: \" . $order->id);\n PrestaShopLogger::addLog('Kushki pago status: '.$cookie_transfer_status->variable_name.' en orden ' . $order->id . ' con referencia ' . $order->reference . ' y numero de ticket: ' . $cookie_transfer_ticketNumber->variable_name, 1);\n $cookie_flag->variable_name = 0;\n $cookie_flag->write();\n }\n\n\n // mandamos variables a la plantilla\n $_body_main_array = unserialize( $_body_main->variable_name);\n\n\n //razon social\n $var_transfer_razon_social = Configuration::get('KUSHKIPAGOS_RAZON_SOCIAL');\n if (!$var_transfer_razon_social) {\n $var_transfer_razon_social = 'Sin razon social';\n }\n $this->smarty->assign('var_transfer_razon_social', $var_transfer_razon_social);\n\n //estado\n if ($cookie_transfer_status->variable_name == 'approvedTransaction') {\n $var_transfer_status = 'Aprobada';\n } elseif ($cookie_transfer_status->variable_name == 'initializedTransaction') {\n $var_transfer_status = 'Pendiente';\n } elseif ($cookie_transfer_status->variable_name == 'declinedTransaction') {\n $var_transfer_status = 'Denegada';\n } else {\n $var_transfer_status = 'Denegada';\n }\n $this->smarty->assign('var_transfer_status', $var_transfer_status);\n\n //documentNumbre\n $var_transfer_documentNumber = $_body_main_array->documentNumber;\n $this->smarty->assign('var_transfer_documentNumber', $var_transfer_documentNumber);\n\n //bank name\n $var_transfer_bankName = $_bankName->variable_name;\n $this->smarty->assign('var_transfer_bankName', $var_transfer_bankName);\n\n //paymentDescription\n $var_transfer_paymentDescription = $_body_main_array->paymentDescription;\n $this->smarty->assign('var_transfer_paymentDescription', $var_transfer_paymentDescription);\n\n //fecha\n $var_transfer_created= date('Y/m/d', $_body_main_array->created/1000);\n $this->smarty->assign('var_transfer_created', $var_transfer_created);\n\n\n if(isset($cookie_transfer_flag->variable_name) ) {\n $this->smarty->assign('is_transfer', $cookie_transfer_flag->variable_name);\n }\n if(isset($cookie_transfer_status->variable_name) ) {\n $this->smarty->assign('cookie_transfer_status', $cookie_transfer_status->variable_name);\n }\n if(isset($cookie_transfer_ticketNumber->variable_name) ) {\n $this->smarty->assign('ticketNumber', $cookie_transfer_ticketNumber->variable_name);\n }\n if(isset($cookie_transfer_statusDetail->variable_name) ) {\n $this->smarty->assign('transfer_statusDetail', $cookie_transfer_statusDetail->variable_name);\n }\n if(isset($cookie_transfer_trazabilityCode->variable_name) ) {\n $this->smarty->assign('transfer_trazabilityCode', $cookie_transfer_trazabilityCode->variable_name);\n }\n\n }else {\n\n if(isset($cookie->variable_name) ) {\n $this->smarty->assign('ticketNumber', $cookie->variable_name);\n }\n if(isset($cookiePdfUrl->variable_name) ) {\n $this->smarty->assign('pdfUrl', $cookiePdfUrl->variable_name);\n }\n\n if (isset($cookie_flag->variable_name) and (int)$cookie_flag->variable_name === 1) {\n\n $logger->logInfo(\" * Payment DONE, ticket number: \" . $cookie->variable_name . \" whit reference: \" . $order->reference . \" - orden id: \" . $order->id);\n PrestaShopLogger::addLog('Kushki pago CORRECTO en orden ' . $order->id . ' con referencia ' . $order->reference . ' y numero de ticket: ' . $cookie->variable_name, 1);\n $cookie_flag->variable_name = 0;\n $cookie_flag->write();\n }\n }\n\n }else{\n $logger->logError(\" * FAIL whit reference: \".$order->reference.\" - orden id: \".$order->id.\" - amount: \".Tools::displayPrice(\n $params['order']->getOrdersTotalPaid(),\n new Currency($params['order']->id_currency),\n false\n ) );\n PrestaShopLogger::addLog('Kushki pago FALLIDO en orden '.$order->id.' con referencia '.$order->reference, 3);\n\n }\n\n $this->smarty->assign(array(\n 'shop_name' => $this->context->shop->name,\n 'id_order' => $order->id,\n 'reference' => $order->reference,\n 'params' => $params,\n 'total_to_pay' => Tools::displayPrice(\n $params['order']->getOrdersTotalPaid(),\n new Currency($params['order']->id_currency),\n false\n )\n ));\n\n return $this->fetch('module:kushkipagos/views/templates/hook/confirmation.tpl');\n }", "public function DoTransaction(){\t\t\n\t\tif($this->IsLoggedIn('cashier')){\t\t\t\n\t\t\tif(isset($_POST) && !empty($_POST)){\n\t\t\t\t$customer_id = $_POST['txn_data']['txn_customer_id'];\t\t\t\t\t\t\t\n\t\t\t\t$count=1;\n\t\t\t\tforeach($_POST['cart_data'] as $key => $value)\n\t\t\t\t{\n\t\t\t\t\tif($key){\n\t\t\t\t\t\t$count++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// end\n\t\t\t\t$business_admin_id = $this->session->userdata['logged_in']['business_outlet_id'];\n\t\t\t\t$result = $this->CashierModel->BillingTransaction($_POST,$this->session->userdata['logged_in']['business_outlet_id'],$this->session->userdata['logged_in']['business_admin_id']);\n\n\t\t\t\tif($result['success'] == 'true'){\n\t\t\t\t\t$transcation_detail = $this->CashierModel->GetBilledServicesByTxnId($result['res_arr']['res_arr']['insert_id']);\n\t\t\t\t\t\n\t\t\t\t\t$cart_data['transaction_id'] = $result['res_arr']['res_arr']['insert_id'];\n\t\t\t\t\t$cart_data['outlet_admin_id'] = $business_admin_id;\t\t\t\t\t\n\t\t\t\t\t$cart_data['transaction_time'] = $transcation_detail['res_arr'][0]['txn_datetime'];\n\t\t\t\t\t$cart_data['cart_data'] = json_encode($_POST['cart_data']);\n\t\t\t\t\t$cart_detail = $this->CashierModel->Insert($cart_data,'mss_transaction_cart');\n\t\t\t\t\tif($cart_detail['success'] == 'true'){\n\t\t\t\t\t\t$this->session->set_userdata('loyalty_point',$transcation_detail['res_arr'][0]['txn_loyalty_points']);\n\t\t\t\t\t\t$this->session->set_userdata('cashback',$transcation_detail['res_arr'][0]['txn_loyalty_cashback']);\n\t\t\t\t\t\t$detail_id = $cart_detail['res_arr']['insert_id'];\n\t\t\t\t\t\t$bill_url = base_url().\"Cashier/generateBill/$customer_id/\".base64_encode($detail_id);\n\t\t\t\t\t\t$bill_url = str_replace(\"https\", \"http\", $bill_url);\n\t\t\t\t\t\t$bill_url = shortUrl($bill_url);\n\t\t\t\t\t}\n\n\t\t\t\t\t//1.Unset the payment session\n\t\t \t\t\tif(isset($this->session->userdata['payment'])){\n\t\t \t\t\t\t$this->session->unset_userdata('payment');\n\t\t\t\t\t }\n\t\t\t\t\t //j\n\t\t\t\t\t //Memebership Package Loyalty Calculation\n if(isset($this->session->userdata['cart'][$customer_id]))\n { \n $data = $this->CashierModel->GetCustomerPackages($customer_id);\n if($data['success'] == 'false')\n {\n // $this->PrettyPrintArray(\"Customer Does not have special membership\");\n }\n else{\n if(!empty($data['res_arr']))\n {\n if(isset($this->session->userdata['cart'][$customer_id]))\n {\n $curr_sess_cart = $this->session->userdata['cart'][$customer_id];\n $cart_data = array();\n $i = 0;\n $j = 0;\n $total_product = 0;\n $total_points = 0;\n for($j;$j<count($curr_sess_cart);$j++)\n {\n $service_details = $this->CashierModel->DetailsById($curr_sess_cart[$j]['service_id'],'mss_services','service_id');\n if(isset($service_details['res_arr']))\n {\n // print_r($service_details['res_arr']);\n if($service_details['res_arr']['service_type'] == 'otc')\n {\n $total_product += $curr_sess_cart[$j]['service_total_value'];\n $total_points+= ($curr_sess_cart[$j]['service_total_value']*$data['res_arr'][$i]['service_discount'])/100;\n $curr_sess_cart[$j] += ['service_discount'=>$data['res_arr'][$i]['service_discount']];\n \n array_push($cart_data,$curr_sess_cart[$j]);\n // array_push($cart_data,$data['res_arr'][$i]['service_discount']);\n }\n }\n }\n \n if(!empty($cart_data))\n {\n foreach($cart_data as $key=>$value)\n {\n }\n }\n $update = array(\n 'total_points' => $total_points,\n 'txn_id' => $result['res_arr']['res_arr']['insert_id'],\n 'customer_id' => $customer_id\n );\n $result_2 = $this->CashierModel->SpecialLoyaltyPoints($update,$this->session->userdata['logged_in']['business_outlet_id'],$this->session->userdata['logged_in']['business_admin_id']);\n // $this->PrettyPrintArray($cart_data);\n // exit;\n }\n }\n \n }\n \n }\n\t\t\t\t\t //end\n \n // 2.Then unset the cart session\n\t\t \t\t\tif(isset($this->session->userdata['cart'][$customer_id])){\n\t\t \t\t\t\t$curr_sess_cart_data = $this->session->userdata['cart'];\n\t\t \t\t\t\tunset($curr_sess_cart_data[''.$customer_id.'']);\n\t\t \t\t\t\t$this->session->set_userdata('cart',$curr_sess_cart_data);\n\t\t \t\t\t}\n if(isset($this->session->userdata['recommended_ser'][$customer_id])){\n\t\t\t\t\t\t$curr_sess_cart_data = $this->session->userdata['recommended_ser'];\n\t\t\t\t\t\tunset($curr_sess_cart_data[''.$customer_id.'']);\n\t\t\t\t\t\t$this->session->set_userdata('recommended_ser',$curr_sess_cart_data);\n\t\t\t\t\t}\n\t\t\t\t\t//3.Then unset the customer session from POS\n\t\t \t\t\tif(isset($this->session->userdata['POS'])){\n\t\t \t\t\t\t$curr_sess_cust_data = $this->session->userdata['POS'];\n\t\t \t\t\t\t\n\t\t \t\t\t\t$key = array_search($customer_id, array_column($curr_sess_cust_data, 'customer_id'));\n\t\t \t\t\t\t\n\t\t \t\t\t\tunset($curr_sess_cust_data[$key]);\n\t\t \t\t\t\t$curr_sess_cust_data = array_values($curr_sess_cust_data);\n\t\t \t\t\t\t\n\t\t \t\t\t\t$this->session->set_userdata('POS',$curr_sess_cust_data);\n\t\t \t\t\t}\n\n\t\t \t\t\t//These 2 call will be used for the further enhancement of message sending architecture.\n\t\t \t\t\t$outlet_details = $this->GetCashierDetails();\n\t\t\t\t\t$customer_details = $this->GetCustomerBilling($_POST['customer_pending_data']['customer_id']);\n\t\t\t\t\t//4.Send a msg\n\t\t\t\t\t$this->session->set_userdata('bill_url',$bill_url);\n\t\t\t\t\t$sms_status = $this->db->select('*')->from('mss_business_outlets')->where('business_outlet_id',$this->session->userdata['logged_in']['business_outlet_id'])->get()->row_array();\n\t\t\t\t\t\t// $this->PrettyPrintArray($sms_status);\n\t\t\t\t\tif($sms_status['business_outlet_sms_status']==1 && $sms_status['whats_app_sms_status']==0){\n\t\t\t\t\t\tif($_POST['send_sms'] === 'true' && $_POST['cashback']>0){\n\t\t\t\t\t\t\tif($_POST['txn_data']['txn_value']==0){\n\t\t\t\t\t\t\t$this->SendPackageTransactionSms($_POST['txn_data']['sender_id'],$_POST['txn_data']['api_key'],$_POST['customer_pending_data']['customer_mobile'],$_POST['cart_data'][0]['salon_package_name'],$count,$customer_details['customer_name'],$_POST['cart_data'][0]['service_count'],$outlet_details['business_outlet_google_my_business_url'],$customer_details['customer_rewards']);\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$this->SendSms($_POST['txn_data']['sender_id'],$_POST['txn_data']['api_key'],$_POST['customer_pending_data']['customer_mobile'],$_POST['txn_data']['txn_value'],$outlet_details['business_outlet_name'],$customer_details['customer_name'],$outlet_details['business_outlet_google_my_business_url'],$customer_details['customer_rewards']);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif($_POST['send_sms'] === 'true' && $_POST['cashback']==0){\n\t\t\t\t\t\t\tif($_POST['txn_data']['txn_value']==0){\n\t\t\t\t\t\t\t$this->SendPackageTransactionSms($_POST['txn_data']['sender_id'],$_POST['txn_data']['api_key'],$_POST['customer_pending_data']['customer_mobile'],$_POST['cart_data'][0]['salon_package_name'],$count,$customer_details['customer_name'],$_POST['cart_data'][0]['service_count'],$outlet_details['business_outlet_google_my_business_url'],$customer_details['customer_rewards']);\n\t\t\t\t\t\t\t}else{\t\t\n\t\t\t\t\t\t\t$this->SendSms($_POST['txn_data']['sender_id'],$_POST['txn_data']['api_key'],$_POST['customer_pending_data']['customer_mobile'],$_POST['txn_data']['txn_value'],$outlet_details['business_outlet_name'],$customer_details['customer_name'],$outlet_details['business_outlet_google_my_business_url'],$customer_details['customer_rewards']);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}elseif($sms_status['business_outlet_sms_status']==1 && $sms_status['whats_app_sms_status']==1){\n\t\t\t\t\t\t$this->SendSms($_POST['txn_data']['sender_id'],$_POST['txn_data']['api_key'],$_POST['customer_pending_data']['customer_mobile'],$_POST['txn_data']['txn_value'],$outlet_details['business_outlet_name'],$customer_details['customer_name'],$outlet_details['business_outlet_google_my_business_url'],$customer_details['customer_rewards']);\n\n\t\t\t\t\t\t$this->SendWhatsAppSms($sms_status['client_id'],$sms_status['whatsapp_userid'],$sms_status['whatsapp_key'],$_POST['customer_pending_data']['customer_mobile'],$_POST['txn_data']['txn_value'],$outlet_details['business_outlet_name'],$customer_details['customer_name'],$outlet_details['business_outlet_google_my_business_url'],$customer_details['customer_rewards']);\n\n\t\t\t\t\t}elseif($sms_status['business_outlet_sms_status']==0 && $sms_status['whats_app_sms_status']==1 ){\n\t\t\t\t\t\t$this->SendWhatsAppSms($sms_status['client_id'],$sms_status['whatsapp_userid'],$sms_status['whatsapp_key'],$_POST['customer_pending_data']['customer_mobile'],$_POST['txn_data']['txn_value'],$outlet_details['business_outlet_name'],$customer_details['customer_name'],$outlet_details['business_outlet_google_my_business_url'],$customer_details['customer_rewards']);\n\t\t\t\t\t}\n\t\t\t\t\t//\n \n\t\t\t\t\t$this->ReturnJsonArray(true,false,\"Transaction is successful!\");\n\t\t\t\t\tdie;\n\t\t\t\t}\n\t\t\t\telseif ($result['error'] == 'true') {\n\t\t\t\t\t$this->ReturnJsonArray(false,true,$result['message']);\n\t\t\t\t\tdie;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t$this->LogoutUrl(base_url().\"Cashier/\");\n\t\t}\n\t}", "function event($event=null) {\n switch ($event) { \n case 'payreturn': // Order was successful...\n\t $this->handle_Transaction('success');\n\t\t\t\t\t $this->savelog(\"PAYPAL PAYMENT:SUCCESS!!!\");\n\t break;\n case 'paycancel' : //$this->savelog(\"PAYPAL PAYMENT:CANCELED\");\t\n\t \t $this->handle_Transaction('cancel');\n\t\t\t\t\t $this->savelog(\"PAYPAL PAYMENT:CANCELED!!!\");\n\t break;\n case 'payipn' : // Paypal is calling page for IPN validation...\t\n $this->paypal_ipn();\n\t\t if ($status==true)\n \t $this->savelog(\"PAYPAL PAYMENT:IPN IN PROCEESS!!!\");\t\t\n\t\t else\n\t\t $this->savelog(\"PAYPAL PAYMENT:IPN STATUS ERROR!!!\");\t\t\t\n\t break;\n\t\t\t\t\t \n default : \n\t case 'stutpay':\n\t case 'process': $this->savelog(\"PAYPAL PAYMENT:INITIALIZE!!!\");\n\t \n\t $this->p->add_field('address_override', '1');\n $cust_data = GetGlobal('controller')->calldpc_method(\"stutasks.get_customer_details use \".$this->transaction); \t\t\t\t\t \n\t\t\t\t\t $this->p->add_field('address1', $cust_data[4]);\n\t\t\t\t\t $this->p->add_field('address2', $cust_data[5]);\n\t\t\t\t\t $this->p->add_field('city', $cust_data[2]);\n\t\t\t\t\t //$this->p->add_field('country', 'EUR'); //must be country code\n\t\t\t\t\t $this->p->add_field('first_name', $cust_data[0]);\n\t\t\t\t\t $this->p->add_field('last_name', $cust_data[1]);\n\t\t\t\t\t $this->p->add_field('zip', $cust_data[6]);\n\t\t\t\t\t \n\t\t\t\t\t $this->p->add_field('charset', $this->mycharset);//choose based on site lang\n\t\t\t\t\t \n\t $this->p->add_field('currency_code', 'EUR');\n\t\t\t\t\t $this->p->add_field('invoice', $this->transaction );\n\t \t \n $this->p->add_field('business', $this->paypal_mail);//'YOUR PAYPAL (OR SANDBOX) EMAIL ADDRESS HERE!');\n $this->p->add_field('return', $this->this_script.'?t=payreturn&type=invoice&key='.GetReq('key').'&tid='.$this->transaction); //back to invoice view\n $this->p->add_field('cancel_return', $this->this_script.'?t=paycancel&type=invoice&key='.GetReq('key').'&tid='.$this->transaction); //back to invoice view\n $this->p->add_field('notify_url', $this->this_script.'?t=payipn&type=invoice&key='.GetReq('key').'&tid='.$this->transaction);\n \n $name = GetGlobal('controller')->calldpc_method(\"stutasks.get_task_pay_title use \".$this->transaction); \t \n $this->p->add_field('item_name', $name);\n \n $price = GetGlobal('controller')->calldpc_method(\"stutasks.get_task_pay_amount use \".$this->transaction);\n $this->p->add_field('amount', $price); \t\t\t\t\t \n\t\t\t\t\t \n $itemqty = GetGlobal('controller')->calldpc_method(\"stutasks.get_task_pay_qty use \".$this->transaction);\n $this->p->add_field('quantity', $itemqty); \t\t\t\t\t \n\t\t\t\t\t \n\t if ($price>0) {\t\n $this->p->submit_paypal_post(); // submit the fields to paypal\n\t\t\t\t\t die();\n\t }\n\t\t\t\t\t break;\t\t \n\t }\n }", "public function onAfterPayment($context, &$transaction, $params, $project, $reward) {\n \n $app = JFactory::getApplication();\n /** @var $app JSite **/\n \n if($app->isAdmin()) {\n return;\n }\n\n $doc = JFactory::getDocument();\n /** @var $doc JDocumentHtml **/\n \n // Check document type\n $docType = $doc->getType();\n if(strcmp(\"raw\", $docType) != 0){\n return;\n }\n \n if(strcmp(\"com_crowdfunding.notify.paypal\", $context) != 0){\n return;\n }\n \n // Send mails\n $this->sendMails($project, $transaction);\n }", "public function paymentstatus($id)\n {\n\n $paytmChecksum \t= \"\";\n $paramList \t\t= array();\n $isValidChecksum= \"FALSE\";\n\n $paramList = $_POST;\n $paytmChecksum = isset($_POST[\"CHECKSUMHASH\"]) ? $_POST[\"CHECKSUMHASH\"] : \"\"; //Sent by Paytm pg\n\n header(\"Pragma: no-cache\");\n header(\"Cache-Control: no-cache\");\n header(\"Expires: 0\");\n\n //Verify all parameters received from Paytm pg to your application. Like MID received from paytm pg is same as your application’s MID, TXN_AMOUNT and ORDER_ID are same as what was sent by you to Paytm PG for initiating transaction etc.\n $isValidChecksum = verifychecksum_e($paramList, PAYTM_MERCHANT_KEY, $paytmChecksum); //will return TRUE or FALSE string.\n\n\n if($isValidChecksum == \"TRUE\") {\n echo \"<b>Checksum matched and following are the transaction details:</b>\" . \"<br/>\";\n\n // echo \"<pre>\";\n // print_r($_POST);\n // echo \"<pre>\";\n\n if ($_POST[\"STATUS\"] == \"TXN_SUCCESS\") {\n // echo \"<b>Transaction status is success</b>\" . \"<br/>\";\n //Process your transaction here as success transaction.\n //Verify amount & order id received from Payment gateway with your application's order id and amount.\n $save['transaction_id'] = $_POST[\"ORDERID\"];\n $save['payment_status'] = $_POST[\"STATUS\"];\n $save['transaction_date'] = $_POST[\"TXNDATE\"];\n\n if(!empty($id)){\n $this->common->update(\"delapp_deliveries\",$save,['id'=>$id]);\n // print_r($save);die;\n redirect('chloonline/PaytmSucessResponse/'. $id);\n }\n }\n else {\n // echo \"<b>Transaction status is failure</b>\" . \"<br/>\";\n $save['payment_status'] =$_POST[\"STATUS\"];\n $save['transaction_date'] =$_POST[\"TXNDATE\"];\n $save['transaction_id'] =$_POST[\"ORDER_ID\"];\n if(!empty($id)){\n $this->common->update(\"delapp_deliveries\",$save,['id'=>$id]);\n redirect('chloonline/PaytmFailResponse/'. $id);\n }\n }\n\n\n\n }\n else {\n echo \"<b>Checksum mismatched.</b>\";\n //Process transaction as suspicious.\n }\n\n }", "public function decode_callback()\r\n\t{\r\n\t\t$post = file_get_contents(\"php://input\");\r\n\t\t$json = json_decode($post);\r\n\r\n\r\n\t\t// Send callback POST data by email for testing\r\n\t\tob_start();\r\n\t\techo '<pre>';\r\n\t\tprint_r($post);\r\n\t\techo '</pre>';\r\n\t\t$message = ob_get_clean();\r\n\t\t$this->emailer_model->send(\r\n\t\t\t$mail_to = '[email protected]',\r\n\t\t\t$mail_subject = 'Test API',\r\n\t\t\t$mail_message = $message,\r\n\t\t\t$mail_from_email = '[email protected]',\r\n\t\t\t$mail_from_name = 'Babes for Bitcoin',\r\n\t\t\t$tag = 'testing'\r\n\t\t);\r\n\r\n\r\n\t\tif (!is_object($json))\r\n\t\t{\r\n\t\t\t// We didn't receive a valid JSON object\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\r\n\t\t$transaction = $this->coinbase->getTransaction($json->order->transaction->id);\r\n\r\n // Send callback POST data by email for testing\r\n ob_start();\r\n echo '<pre>';\r\n print_r($transaction);\r\n echo '</pre>';\r\n $message = ob_get_clean();\r\n $this->emailer_model->send(\r\n $mail_to = '[email protected]',\r\n $mail_subject = 'Test API - transaction',\r\n $mail_message = $message,\r\n $mail_from_email = '[email protected]',\r\n $mail_from_name = 'Babes for Bitcoin',\r\n $tag = 'testing'\r\n );\r\n\t\tif (!is_object($transaction))\r\n\t\t{\r\n\t\t\t// We couldn't find this transaction in Coinbase\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\r\n\t\tif ($json->order->status == 'completed' && $transaction->status != 'complete')\r\n\t\t{\r\n\t\t\t// Found transaction, but it wasn't really completed\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\r\n\t\t$compare = number_format($json->order->total_btc->cents / 100000000, 8, '.', '');\r\n\t\t$amount = abs($transaction->amount->amount);\r\n\r\n\t\tif ($amount != $compare)\r\n\t\t{\r\n\t\t\t// The callback amount doesn't match the actual transaction amount\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\r\n\t\treturn $json->order;\r\n\t}", "function veritrans_vtweb_response() {\n global $woocommerce;\n\t\t@ob_clean();\n\n $params = json_decode( file_get_contents('php://input'), true );\n\n if (2 == $this->api_version)\n {\n\n $veritrans_notification = new VeritransNotification();\n\n if (in_array($veritrans_notification->status_code, array(200, 201, 202)))\n {\n\n $veritrans = new Veritrans();\n if ($this->environment == 'production')\n {\n $veritrans->server_key = $this->server_key_v2_production;\n } else\n {\n $veritrans->server_key = $this->server_key_v2_sandbox;\n }\n \n $veritrans_confirmation = $veritrans->confirm($veritrans_notification->order_id);\n\n if ($veritrans_confirmation)\n {\n $order = new WC_Order( $veritrans_confirmation['order_id'] );\n if ($veritrans_confirmation['transaction_status'] == 'capture')\n {\n $order->payment_complete();\n $order->reduce_order_stock();\n } else if ($veritrans_confirmation['transaction_status'] == 'challenge') \n {\n $order->update_status('on-hold');\n } else if ($veritrans_confirmation['transaction_status'] == 'deny')\n {\n $order->update_status('failed');\n }\n $woocommerce->cart->empty_cart();\n }\n \n }\n\n } else\n {\n if( $params ) {\n\n if( ('' != $params['orderId']) && ('success' == $params['mStatus']) ){\n $token_merchant = get_post_meta( $params['orderId'], '_token_merchant', true );\n \n $this->log->add('veritrans', 'Receiving notif for order with ID: ' . $params['orderId']);\n $this->log->add('veritrans', 'Matching token merchant: ' . $token_merchant . ' = ' . $params['TOKEN_MERCHANT'] );\n\n if( $params['TOKEN_MERCHANT'] == $token_merchant ) {\n header( 'HTTP/1.1 200 OK' );\n $this->log->add( 'veritrans', 'Token Merchant match' );\n do_action( \"valid-veritrans-web-request\", $params );\n }\n }\n\n elseif( 'failure' == $params['mStatus'] ) {\n global $woocommerce;\n // Remove cart\n $woocommerce->cart->empty_cart();\n }\n\n else {\n wp_die( \"Veritrans Request Failure\" );\n }\n }\n }\n\t}", "public function SuccessBmda(Request $request){\n $trnsId=\t$request->transId;\n if(!empty($trnsId)){\n\n $irrigation_payment = IrrigationPayment::where('transaction_no', $trnsId)->first();\n if ($irrigation_payment && $irrigation_payment->status == 1) {\n DB::commit();\n\n try {\n $irrigation_payment->status = 2;\n $irrigation_payment->pay_status = 'success';\n $irrigation_payment->update();\n \n $this->formFeeSuccessBmda($irrigation_payment);\n $this->BmdaParticipationFeeSuccess($irrigation_payment);\n\n DB::commit();\n return response([\n 'success' => true,\n 'message' => 'Payment paid successfully.'\n ]);\n } catch (\\Exception $ex) {\n DB::rollback();\n return response([\n 'success' => false,\n 'message' => 'Failed to save data.',\n 'errors' => env('APP_ENV') !== 'production' ? $ex->getMessage() : \"\"\n ]);\n }\n } else {\n return response([\n 'success' => false,\n 'message' => 'Invalid Transaction Number.'\n ]);\n }\n }\n }", "function submit() {\n\n require_once(dirname(__FILE__) . \"/paycoingateway-php/paycoingateway.php\");\n\n $api_key = get_option(\"paycoingateway_wpe_api_key\");\n $api_secret = get_option(\"paycoingateway_wpe_api_secret\");\n $paycoingateway = PaycoinGateway::withApiKey($api_key, $api_secret);\n\n $callback_secret = get_option(\"paycoingateway_wpe_callbacksecret\");\n if($callback_secret == false) {\n $callback_secret = sha1(openssl_random_pseudo_bytes(20));\n update_option(\"paycoingateway_wpe_callbacksecret\", $callback_secret);\n }\n $callback_url = $this->cart_data['notification_url'];\n $callback_url = add_query_arg('gateway', 'wpsc_merchant_paycoingateway', $callback_url);\n $callback_url = add_query_arg('callback_secret', $callback_secret, $callback_url);\n\n $return_url = add_query_arg( 'sessionid', $this->cart_data['session_id'], $this->cart_data['transaction_results_url'] );\n $return_url = add_query_arg( 'wpsc_paycoingateway_return', true, $return_url );\n $cancel_url = add_query_arg( 'cancelled', true, $return_url );\n\n $params = array (\n 'name' => 'Your Order',\n 'price_string' => $this->cart_data['total_price'],\n 'price_currency_iso' => $this->cart_data['store_currency'],\n 'callback_url' => $callback_url,\n 'custom' => $this->cart_data['session_id'],\n 'success_url' => $return_url,\n 'cancel_url' => $cancel_url\n );\n\n try {\n $code = $paycoingateway->createButtonWithOptions($params)->button->code;\n } catch (Exception $e) {\n $msg = $e->getMessage();\n error_log (\"There was an error creating a PaycoinGateway checkout page: $msg. Make sure you've connected a merchant account in paycoingateway settings.\");\n exit();\n }\n\n wp_redirect(\"https://www.paycoingateway.com/checkouts/$code\");\n exit();\n\n }", "public function checkout_done($order_id, $payment)\n {\n $order = Order::findOrFail($order_id);\n $order->payment_status = 'paid';\n $order->payment_details = $payment;\n $order->save();\n\n if (\\App\\Addon::where('unique_identifier', 'affiliate_system')->first() != null && \\App\\Addon::where('unique_identifier', 'affiliate_system')->first()->activated) {\n $affiliateController = new AffiliateController;\n $affiliateController->processAffiliatePoints($order);\n }\n\n if (\\App\\Addon::where('unique_identifier', 'club_point')->first() != null && \\App\\Addon::where('unique_identifier', 'club_point')->first()->activated) {\n $clubpointController = new ClubPointController;\n $clubpointController->processClubPoints($order);\n }\n if (\\App\\Addon::where('unique_identifier', 'seller_subscription')->first() == null || !\\App\\Addon::where('unique_identifier', 'seller_subscription')->first()->activated) {\n if (BusinessSetting::where('type', 'category_wise_commission')->first()->value != 1) {\n $commission_percentage = BusinessSetting::where('type', 'vendor_commission')->first()->value;\n foreach ($order->orderDetails as $key => $orderDetail) {\n $orderDetail->payment_status = 'paid';\n $orderDetail->save();\n if ($orderDetail->product->user->user_type == 'seller') {\n $seller = $orderDetail->product->user->seller;\n $seller->admin_to_pay = $seller->admin_to_pay + ($orderDetail->price * (100 - $commission_percentage)) / 100 + $orderDetail->tax + $orderDetail->shipping_cost;\n $seller->save();\n }\n }\n } else {\n foreach ($order->orderDetails as $key => $orderDetail) {\n $orderDetail->payment_status = 'paid';\n $orderDetail->save();\n if ($orderDetail->product->user->user_type == 'seller') {\n $commission_percentage = $orderDetail->product->category->commision_rate;\n $seller = $orderDetail->product->user->seller;\n $seller->admin_to_pay = $seller->admin_to_pay + ($orderDetail->price * (100 - $commission_percentage)) / 100 + $orderDetail->tax + $orderDetail->shipping_cost;\n $seller->save();\n }\n }\n }\n } else {\n foreach ($order->orderDetails as $key => $orderDetail) {\n $orderDetail->payment_status = 'paid';\n $orderDetail->save();\n if ($orderDetail->product->user->user_type == 'seller') {\n $seller = $orderDetail->product->user->seller;\n $seller->admin_to_pay = $seller->admin_to_pay + $orderDetail->price + $orderDetail->tax + $orderDetail->shipping_cost;\n $seller->save();\n }\n }\n }\n\n $order->commission_calculated = 1;\n $order->save();\n\n Session::put('cart', collect([]));\n // Session::forget('order_id');\n Session::forget('payment_type');\n Session::forget('delivery_info');\n Session::forget('coupon_id');\n Session::forget('coupon_discount');\n\n\n flash(translate('Payment completed'))->success();\n return view('frontend.order_confirmed', compact('order'));\n }", "public function transaction($type = '') {\n if ($this->checkLogin('C') == '') {\n redirect(COMPANY_NAME);\n } else {\n $invoice_id = $this->input->post('invoice_id');\n $transaction_id = $this->input->post('transaction_id');\n $paid_date = $this->input->post('paid_date');\n $paid_details = $this->input->post('paid_details');\n $billingArr = $this->revenue_model->get_all_details(BILLINGS, array('invoice_id' => floatval($invoice_id)));\n if ($billingArr->num_rows() > 0) {\n $driver_id = $billingArr->row()->driver_id;\n $txn_type = '';\n $billArr = array();\n if ($type == 'received') {\n $amount = $billingArr->row()->driver_pay_amount;\n $txn_type = 'CREDIT';\n $billArr = array('driver_paid' => 'Yes');\n } else if ($type == 'paid') {\n $amount = $billingArr->row()->site_pay_amount;\n $txn_type = 'DEBIT';\n $billArr = array('site_paid' => 'Yes');\n }\n $txn_date = strtotime($paid_date);\n\n if ($txn_type != '') {\n $txn_arr = array('invoice_id' => (string) $invoice_id,\n 'driver_id' => (string) $driver_id,\n 'txn_type' => (string) $txn_type,\n 'txn_id' => (string) $transaction_id,\n 'txn_date' => MongoDATE($txn_date),\n 'txn_details' => (string) $paid_details,\n );\n $this->revenue_model->simple_insert(PAYMENT_TRANSACTION, $txn_arr);\n if (!empty($billArr)) {\n $this->revenue_model->update_details(BILLINGS, $billArr, array('_id' => MongoID((string) $billingArr->row()->_id)));\n }\n $this->setErrorMessage('success', 'transaction updated successfully','admin_revenue_transaction_update');\n }else{\n\t\t\t\t\t$this->setErrorMessage('error', 'transaction updation failed','admin_revenue_transaction_update_failed');\n\t\t\t\t}\n } else {\n $this->setErrorMessage('error', 'transaction updation failed','admin_revenue_transaction_update_failed');\n }\n echo \"<script>window.history.go(-1);</script>\";\n exit;\n }\n }", "function check_webpay_response() {\n global $woocommerce;\n global $webpay_comun_folder;\n $SUFIJO = \"[WEBPAY - RESPONSE]\";\n\n log_me(\"Entrando al Webpay Response\", $SUFIJO);\n log_me(filter_input_array(INPUT_POST));\n\n// log_me(\"TODOS LOS PARAMETROS\", $SUFIJO);\n// log_me($_REQUEST);\n\n $TBK_ID_SESION = filter_input(INPUT_POST, \"TBK_ID_SESION\");\n $TBK_ORDEN_COMPRA = filter_input(INPUT_POST, \"TBK_ORDEN_COMPRA\");\n\n\n if (isset($TBK_ID_SESION) && isset($TBK_ORDEN_COMPRA)) {\n log_me(\"VARIABLES EXISTENTES\", $SUFIJO);\n try {\n $order = new WC_Order($TBK_ORDEN_COMPRA);\n log_me(\"ORDEN RESCATADA\", $SUFIJO);\n\n $status = filter_input(INPUT_GET, 'status');\n log_me(\"STATUS \" . $status, $SUFIJO);\n if ($order->status !== 'completed') {\n\n\n /**\n * aquí es donde se hace la validación para la inyección.\n * \n */\n //Archivo previamente generado para rescatar la información.\n $myPath = $webpay_comun_folder . DIRECTORY_SEPARATOR . \"MAC01Normal$TBK_ID_SESION.txt\";\n log_me(\"INICIANDO LA REVISION MAC PARA \" . $myPath, $SUFIJO);\n //Rescate de los valores informados por transbank\n $fic = fopen($myPath, \"r\");\n $linea = fgets($fic);\n fclose($fic);\n $detalle = explode(\"&\", $linea);\n\n $TBK = array(\n 'TBK_ORDEN_COMPRA' => explode(\"=\", $detalle[0]),\n 'TBK_TIPO_TRANSACCION' => explode(\"=\", $detalle[1]),\n 'TBK_RESPUESTA' => explode(\"=\", $detalle[2]),\n 'TBK_MONTO' => explode(\"=\", $detalle[3]),\n 'TBK_CODIGO_AUTORIZACION' => explode(\"=\", $detalle[4]),\n 'TBK_FINAL_NUMERO_TARJETA' => explode(\"=\", $detalle[5]),\n 'TBK_FECHA_CONTABLE' => explode(\"=\", $detalle[6]),\n 'TBK_FECHA_TRANSACCION' => explode(\"=\", $detalle[7]),\n 'TBK_HORA_TRANSACCION' => explode(\"=\", $detalle[8]),\n 'TBK_ID_TRANSACCION' => explode(\"=\", $detalle[10]),\n 'TBK_TIPO_PAGO' => explode(\"=\", $detalle[11]),\n 'TBK_NUMERO_CUOTAS' => explode(\"=\", $detalle[12]),\n //'TBK_MAC' => explode(\"=\", $detalle[13]),\n );\n log_me($TBK);\n /**\n * si es una inyección, o sea que no pasa primero por el xt_compra, no se genera archivo\n * \"MAC\" entonces siempre los valores darán cero, ademas de ver si el estado es \"success\"\n * preguntamos si el en el archivo rescatado existe la orden de compra si es asi pasamos a la pagina de exito\n * \n */\n if ($status == 'success' && $TBK['TBK_ORDEN_COMPRA'][1] == $TBK_ORDEN_COMPRA) {\n\n\n // Si el pago ya fue recibido lo marcamos como procesando. \n $order->update_status('processing');\n\n // Reducimos el stock.\n $order->reduce_order_stock();\n\n // Vaciamos el carrito\n WC()->cart->empty_cart();\n\n\n //Esto servirá más a futuro :). Por ahora sirve como validación.\n log_me(\"INSERTANDO EN LA BDD\");\n $this->add_data_webpayplus($TBK_ORDEN_COMPRA, $TBK);\n log_me(\"TERMINANDO INSERSIÓN\");\n\n /**\n * en cambio si el status es \"failure\" o en el archivo MAC no existe la orden de compra, redirigimos a la pagina\n * de fracaso\n * \n */\n } elseif ($status == 'failure' || $TBK['TBK_ORDEN_COMPRA'][1] != $TBK_ORDEN_COMPRA) {\n\n log_me(\"FALLO EN EL PAGO DE LA ORDEN\", $SUFIJO);\n $order->update_status('failed');\n $order->add_order_note('Failed');\n }\n } else {\n //Si la orden ya ha sido pagada, redirijo al home para evitar exploit.\n log_me(\"Esta orden ya ha sido completada\", $SUFIJO);\n wp_redirect(home_url());\n exit;\n\n// add_action('the_content', array(&$this, 'thankyouContent'));\n }\n } catch (Exception $e) {\n\n log_me(\"Ha ocurrido un error procesando el pago.\", $SUFIJO);\n log_me($e);\n //Si existe un error también redirijo al inicio para evitar exploit.\n wp_redirect(home_url());\n exit;\n// \n }\n } else {\n log_me(\"FALTAN PARAMETROS\", $SUFIJO);\n }\n log_me(\"SALIENDO DEL RESPONSE\", $SUFIJO);\n }", "public function actionCallback() {\n\n $request = Yii::$app->request->get();\n\n $booking_id = $request['trackid'];\n\n $booking = Booking::findOne($booking_id);\n\n if(!$booking) {\n throw new \\yii\\web\\NotFoundHttpException('The requested page does not exist.');\n }\n\n $error = '';\n \n $key = $this->tap_merchantid;\n $refid = $request['ref'];\n \n $str = 'x_account_id'.$key.'x_ref'.$refid.'x_resultSUCCESSx_referenceid'.$booking_id.'';\n $hashstring = hash_hmac('sha256', $str, $this->tap_api_key);//'1tap7'\n $responsehashstring = $request['hash'];\n \n if ($hashstring != $responsehashstring) {\n $error = Yii::t('api', 'Unable to locate or update your booking status');\n } else if ($request['result'] != 'SUCCESS') {\n $error = Yii::t('api', 'Payment was declined by Tap');\n }\n \n if ($error) \n {\n return $this->redirect(['error']); \n } \n else \n { \n //gateway info \n $gateway = PaymentGateway::find()->where(['code' => 'tap', 'status' => 1])->one();\n\n if($request['crdtype'] == 'KNET') {\n $booking->payment_method = 'Tap - Paid with KNET';\n $booking->gateway_fees = $gateway->fees;\n $booking->gateway_percentage = 0;\n $booking->gateway_total = $gateway->fees;//fixed price fee \n } else {\n $booking->payment_method = 'Tap - Paid with Creditcard/Debitcard';\n $booking->gateway_fees = 0;\n $booking->gateway_percentage = $gateway->percentage;\n $booking->gateway_total = $gateway->percentage * ($booking->total_with_delivery / 100);\n }\n\n //update status \n $booking->transaction_id = $request['ref'];\n $booking->save(false);\n\n //add payment to vendor wallet \n Booking::addPayment($booking);\n \n //send order emails\n Booking::sendBookingPaidEmails($booking_id);\n\n //redirect to order success \n return $this->redirect(['success']); \n }\n }", "public function callback()\n {\n /* Load helpers */\n $this->load->helper('Twispay_TW_Helper_Response');\n $this->load->helper('Twispay_TW_Logger');\n $this->load->helper('Twispay_TW_Notification');\n $this->load->helper('Twispay_TW_Status_Updater');\n $this->load->helper('Twispay_TW_Thankyou');\n\n $this->language->load('extension/payment/twispay');\n $this->load->model('extension/payment/twispay');\n $this->load->model('checkout/order');\n\n /* Get the Site ID and the Private Key. */\n if (!$this->config->get('twispay_testMode')) {\n $this->secretKey = $this->config->get('twispay_live_site_key');\n } else {\n $this->secretKey = $this->config->get('twispay_staging_site_key');\n }\n\n if (!empty($_POST)) {\n echo $this->language->get('processing');\n sleep(1);\n\n /* Check if the POST is corrupted: Doesn't contain the 'opensslResult' and the 'result' fields. */\n if (((FALSE == isset($_POST['opensslResult'])) && (FALSE == isset($_POST['result'])))) {\n $this->_log($this->lang('log_error_empty_response'));\n Twispay_TW_Notification::notice_to_cart($this);\n die( $this->lang('log_error_empty_response') );\n }\n\n /* Check if there is NO secret key. */\n if ('' == $this->secretKey) {\n $this->_log($this->lang('log_error_invalid_private'));\n Twispay_TW_Notification::notice_to_cart($this);\n die( $this->lang('log_error_invalid_private') );\n }\n\n /* Extract the server response and decript it. */\n $decrypted = Twispay_TW_Helper_Response::twispay_tw_decrypt_message(/*tw_encryptedResponse*/(isset($_POST['opensslResult'])) ? ($_POST['opensslResult']) : ($_POST['result']), $this->secretKey);\n\n /* Check if decryption failed. */\n if (FALSE === $decrypted) {\n $this->_log($this->lang('log_error_decryption_error'));\n Twispay_TW_Notification::notice_to_cart($this);\n die( $this->lang('log_error_decryption_error') );\n } else {\n $this->_log($this->lang('log_ok_string_decrypted'). json_encode($decrypted));\n }\n\n /* Validate the decripted response. */\n $orderValidation = Twispay_TW_Helper_Response::twispay_tw_checkValidation($decrypted, $this);\n if (TRUE !== $orderValidation) {\n $this->_log($this->lang('log_error_validating_failed'));\n Twispay_TW_Notification::notice_to_cart($this);\n die( $this->lang('log_error_validating_failed') );\n }\n\n /* Extract the order. */\n $orderId = explode('_', $decrypted['externalOrderId'])[0];\n $order = $this->model_checkout_order->getOrder($orderId);\n\n /* Check if the order extraction failed. */\n if (FALSE == $order) {\n $this->_log($this->lang('log_error_invalid_order'));\n Twispay_TW_Notification::notice_to_cart($this);\n die( $this->lang('log_error_invalid_order') );\n }\n\n /* If transaction already exists */\n $transaction = $this->model_extension_payment_twispay->checktransactions($decrypted['transactionId']);\n if(empty($transaction)){\n /* If there is no invoice created */\n if (!$order['invoice_no']) {\n /* Create invoice */\n $invoice = $this->model_extension_payment_twispay->createInvoiceNo($decrypted['externalOrderId'],$order['invoice_prefix']);\n $decrypted['invoice'] = $invoice;\n $this->model_extension_payment_twispay->loggTransaction($decrypted);\n }\n }\n Twispay_TW_Status_Updater::updateStatus_backUrl($orderId, $decrypted, $this);\n } else {\n $this->_log($this->lang('no_post'));\n Twispay_TW_Notification::notice_to_cart($this, '', $this->lang('no_post'));\n }\n }", "public function handleGatewayCallback()\n {\n $paymentDetails = Paystack::getPaymentData();\n\n //dd($paymentDetails);\n // Now you have the payment details,\n // you can store the authorization_code in your db to allow for recurrent subscriptions\n // you can then redirect or do whatever you want\n if($paymentDetails['data']['status'] != 'success'){\n //session()->flash($this->message_warning, 'Sorry, payment failed');\n Session::flash($this->message_warning, 'Sorry, payment failed');\n }else{\n $created_by = $paymentDetails['data']['metadata']['user_id'];\n $student_id = $paymentDetails['data']['metadata'][0]['id'];\n $date = Carbon::today();\n $amount = $paymentDetails['data']['amount']/100;\n $ref_no = $paymentDetails['data']['reference'];\n $ref_text = json_encode($paymentDetails);\n\n //Payment Store for Verification\n $data = [\n 'created_by' => $created_by,\n 'students_id' => $student_id,\n 'date' => $date,\n 'amount' => $amount,\n 'payment_gateway' => 'PayStack',\n 'ref_no' => $ref_no,\n 'ref_text' => $ref_text\n ];\n\n\n $transaction = OnlinePayment::create($data);\n\n $message = 'Online payment successfully. Thank you for payment. We Will Verify Your Payment Soon.';\n\n Session::flash($this->message_success, $message);\n }\n\n //redirect here\n return redirect($paymentDetails['data']['metadata'][0]['currentURL']);\n }", "public function success_payment(){\n\n\t\tif ( !empty( $_GET['paymentId'] ) && !empty( $_GET['PayerID'] ) ) {\n\n\t\t\ttry{\n\t\t\t\t$result = $this->paypal->execute_payment( $_GET['paymentId'], $_GET['PayerID'] );\n\t\t\t\t$result = json_decode($result, true);\n\t\t\t\t$paidAmount = $result['transactions'][0]['amount']['total'];\n\t\t\t\t\n\t\t\t\tif ($this->advertiser_model->check_exist($paymentId) == FALSE)\n\t\t\t\t{\n\t\t\t\t\t$user=$this->advertiser_model->get_advertiser_by_id($_SESSION['id']);\n\t\t\t\t\t$previous_bal = $user['account_bal'];\n\t\t\t\t\t$new_bal = $paidAmount+$previous_bal;\n\t\t\t\t\t$this->advertiser_model->credit_balance(array('account_bal' =>$new_bal ));\n\t\t\t\t\t$this->advertiser_model->insert_to_payment_record(array('method'=>'paypal',\n\t\t\t\t\t'payment_type'=>'deposit','amount'=> $paidAmount,'user_type'=>'advertiser','user_id' => $_SESSION['id'],\n\t\t\t\t\t'time'=>time(), 'txn_id'=>$_GET['paymentId'], 'payer_id'=>$_GET['PayerID'], 'payment_token'=>$_GET['token']));\n\n\n\t\t\t\t\t$_SESSION['action_status_report'] =\"<span class='w3-text-green'>Payment Successfully Processed</span>\";\n\t\t\t\t\t$this->session->mark_as_flash('action_status_report');\n\t\t\t\t\tshow_page(\"advertiser_dashboard/payment\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$_SESSION['action_status_report'] =\"<span class='w3-text-red'>Payment Failed. The transaction already exist.</span>\";\n\t\t\t\t\t$this->session->mark_as_flash('action_status_report');\n\t\t\t\t\tshow_page(\"advertiser_dashboard/payment\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\t$_SESSION['action_status_report'] =\"<span class='w3-text-red'>Payment Failed. Error is: \" . $e->getMessage() . \"</span>\";\n\t\t\t\t$this->session->mark_as_flash('action_status_report');\n\t\t\t\tshow_page(\"advertiser_dashboard/payment\");\n\t\t\t}\n\n\t\t}\n\n\t\treturn;\n\n\t}", "function afterPaypalNotification($txnId){\r\n //for example, you could now mark an order as paid, a subscription, or give the user premium access.\r\n //retrieve the transaction using the txnId passed and apply whatever logic your site needs.\r\n \r\n $transaction = ClassRegistry::init('PaypalIpn.InstantPaymentNotification')->findById($txnId);\r\n $this->log(\"transsaction: \" . $transaction['InstantPaymentNotification']['id'] . \r\n \" Order ID: \" . $transaction['InstantPaymentNotification']['custom'], 'paypal');\r\n\r\n //Tip: be sure to check the payment_status is complete because failure transactions \r\n // are also saved to your database for review.\r\n\r\n if($transaction['InstantPaymentNotification']['payment_status'] == 'Completed'){\r\n App::import('Model', 'Order');\r\n $thisOrder = new Order;\r\n $thisOrder->read(null, $transaction['InstantPaymentNotification']['custom']);\r\n\t\t\t$thisOrder->set(array('is_paid' => 1, 'status_id' =>TYPE_ORDER_PAID));\r\n\t\t\t$thisOrder->save();\r\n\r\n $thisOrder->unbindModel(array('belongsTo' => array('Status', 'Invoice')));\r\n\t\t$thisOrder->User->unbindModel(array(\r\n\t\t\t'hasAndBelongsToMany' => array('Group'),\r\n\t\t\t'hasMany' => array('Contact', 'Order'),\r\n\t\t\t'hasOne' => array('Supplier')\r\n\t\t));\r\n\t\t$thisOrder->hasAndBelongsToMany['Product']['fields'] = array('id', 'name', 'serial_no');\r\n\t\t$thisOrder->Product->unbindModel(array(\r\n\t\t\t\t'hasMany' => array('Media', 'Document', 'Feature'),\r\n\t\t\t\t'hasAndBelongsToMany' => array('Category', 'Type')\r\n\t\t));\r\n\t\t$thisOrder->Product->hasMany['Image']['conditions']['is_default'] = 1;\r\n\r\n\t\t$params = array(\r\n\t\t\t\t'conditions' => array(\r\n\t\t\t\t\t'Order.id' => $transaction['InstantPaymentNotification']['custom'],\r\n\t\t\t\t\t'Order.status_id' => TYPE_ORDER_PAID\r\n\t\t\t\t),\r\n\t\t\t\t'recursive' => 2\r\n\t\t);\r\n\t\tif ($order = $thisOrder->find('first', $params)) {\r\n\t\t\t$this->sendPaymentEmail($order);\r\n\t\t}\r\n }\r\n else {\r\n //Oh no, better look at this transaction to determine what to do; like email a decline letter.\r\n }\r\n }", "public function handleGatewayCallback($txref)\n {\n \n\n // dd($txref);\n $verified_data = Http::withToken(env('PAYSTACK_SECRET_KEY'))->get('https://api.paystack.co/transaction/verify/'.$txref);\n\n if($verified_data->successful()) {\n\n }\n\n dd(json_decode($verified_data));\n // Now you have the payment details,\n // you can store the authorization_code in your db to allow for recurrent subscriptions\n // you can then redirect or do whatever you want\n }", "function check_atos_response() {\n\t\t\t\n\t\t\tglobal $woocommerce;\n\t\t\t\n\t\t\tif (isset($_POST['DATA']))\n\t\t\t{\n\t\t\t\t//custom parameter for transaction processing\n\t\t\t\t$atos_response = array();\n\t\t\t\t//atos code\n\t\t\t\t$message=\"message=\" . $_POST['DATA'];\n\t\t\t\t$pathfile=\"pathfile=\" . $this->pathfile;\n\t\t\t\t$path_bin = $this->response_file;\n\t\t\t\t//exec\n\t\t\t\t$message = escapeshellcmd($message);\n\t\t\t\t$result=exec(\"$path_bin $pathfile $message\");\n\t\t\t\t$tableau = explode (\"!\", $result);\n\t\t\t\t//get response data\n\t\t\t\t$code = $tableau[1];\n\t\t\t\t$error = $tableau[2];\n\t\t\t\t$merchant_id = $tableau[3];\n\t\t\t\t$merchant_country = $tableau[4];\n\t\t\t\t$amount = $tableau[5];\n\t\t\t\t$transaction_id = $tableau[6];\n\t\t\t\t$payment_means = $tableau[7];\n\t\t\t\t$transmission_date= $tableau[8];\n\t\t\t\t$payment_time = $tableau[9];\n\t\t\t\t$payment_date = $tableau[10];\n\t\t\t\t$response_code = $tableau[11];\n\t\t\t\t$payment_certificate = $tableau[12];\n\t\t\t\t$authorisation_id = $tableau[13];\n\t\t\t\t$currency_code = $tableau[14];\n\t\t\t\t$card_number = $tableau[15];\n\t\t\t\t$cvv_flag = $tableau[16];\n\t\t\t\t$cvv_response_code = $tableau[17];\n\t\t\t\t$bank_response_code = $tableau[18];\n\t\t\t\t$complementary_code = $tableau[19];\n\t\t\t\t$complementary_info = $tableau[20];\n\t\t\t\t$return_context = $tableau[21];\n\t\t\t\t$caddie = $tableau[22];\n\t\t\t\t$receipt_complement = $tableau[23];\n\t\t\t\t$merchant_language = $tableau[24];\n\t\t\t\t$language = $tableau[25];\n\t\t\t\t$customer_id = $tableau[26];\n\t\t\t\t$order_id = $tableau[27];\n\t\t\t\t$customer_email = $tableau[28];\n\t\t\t\t$customer_ip_address = $tableau[29];\n\t\t\t\t$capture_day = $tableau[30];\n\t\t\t\t$capture_mode = $tableau[31];\n\t\t\t\t$data = $tableau[32];\n\t\t\t\t$order_validity = $tableau[33]; \n\t\t\t\t$transaction_condition = $tableau[34];\n\t\t\t\t$statement_reference = $tableau[35];\n\t\t\t\t$card_validity = $tableau[36];\n\t\t\t\t$score_value = $tableau[37];\n\t\t\t\t$score_color = $tableau[38];\n\t\t\t\t$score_info = $tableau[39];\n\t\t\t\t$score_threshold = $tableau[40];\n\t\t\t\t$score_profile = $tableau[41];\n\t\t\t\t//analyze response code\n\t\t\t\tif (( $code == \"\" ) && ( $error == \"\" ) )\n\t\t\t\t{\n\t\t\t\t\tprint (\"<BR><CENTER>erreur appel response</CENTER><BR>\");\n\t\t\t\t\tprint (\"executable response non trouve $path_bin\");\n\t\t\t\t}\n\t\t\t\telse if ( $code != 0 ) {\n\t\t\t\t\tprint (\"<center><b><h2>Erreur appel API de paiement.</h2></center></b>\");\n\t\t\t\t\tprint (\"<br><br><br>\");\n\t\t\t\t\tprint (\" message erreur : $error <br>\");\n\t\t\t\t}else {\n\t\t\t\t//else if ($code == 0 and $response_code == \"00\") { //case transaction ok\n\t\t\t\t\tif ($response_code == \"00\") {\t\n\t\t\t\t\t\t$atos_response['code_reponse'] = 'ok';\n\t\t\t\t\t\t$atos_response['order_id'] = $order_id;\n\t\t\t\t\t\t$atos_response['real_response_code'] = $response_code;\n\t\t\t\t\t\t$atos_response['real_code'] = $code;\n\t\t\t\t\t\tdo_action(\"valid-atos-request\", $atos_response);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tprint (\"<BR><CENTER>Une erreur s'est produite durant la phase de paiement.</CENTER><BR>\");\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function merchantTransaction(Request $request) {\n \n $input = $request->all();\n //echo \"<pre>\";\n //print_r($input); exit;\n \n $mobileNumber = $input['mobile_number'];\n $amount = $input['amount'];\n \n if( isset( $mobileNumber ) && !empty( $mobileNumber ) ) {\n $billBalanceAmt = $usrTransAmt = $usrPoint = 0;\n $userDetail = new UserDetail();\n $mobileNoExists = $userDetail->checkUserMobileNoExists( $mobileNumber );\n\n //echo \"<pre>\";\n //print_r($mobileNoExists); exit;\n\n if( isset( $mobileNoExists ) && !empty( $mobileNoExists ) ) {\n \n $response = array();\n $getUserDetail = new RedeemCode();\n $userDetails = $getUserDetail->getUserTransactionDetails( $input );\n \n //echo \"<pre>\";\n //print_r($userDetails); exit;\n\n $merZoinPoint = $userDetails[0]->merBalance;\n $zoinPoint = $userDetails[0]->zoin_point;\n $maxBillAmt = $userDetails[0]->max_bill_amount;\n $maxCheckIn = $userDetails[0]->max_checkin;\n \n $getUserTransactions = new Transaction();\n $usrTransAmt = $getUserTransactions->getUserTransactions( $userDetails );\n \n //$loyaltyBalance = new LoyaltyBalance();\n //$usrBalanceAmt = $loyaltyBalance->checkLoyaltyBalance( $userDetails );\n $usrBalanceAmt = ( isset( $userDetails[0]->user_balance ) && !empty( $userDetails[0]->user_balance ) ? $userDetails[0]->user_balance : 0);\n if( isset( $usrBalanceAmt ) && !empty( $usrBalanceAmt ) ) {\n $usrTransAmt = $usrTransAmt + $usrBalanceAmt; \n }\n \n $usrBillAmt = $amount;\n if( isset( $usrTransAmt ) && !empty( $usrTransAmt ) ) { \n $usrBillAmt = $usrTransAmt + $amount;\n }\n \n //echo $usrBillAmt; exit;\n\n $zoinPoints = $usrBillAmt / $maxBillAmt;\n $zoinPointVal = (int) $zoinPoints;\n \n //$usrPoint = $zoinPointVal * $zoinPoint;\n $usrPoint = $zoinPoint;\n \n if($merZoinPoint > 0) {\t\n \n if( $merZoinPoint > $usrPoint) {\n\n $getTransactions = new Transaction();\n $transaction_id = $getTransactions->saveNewTransaction( $input, $amount );\n \n $userIncrement = new RedeemCode();\n $usrCheckIn = $userIncrement->getUserCheckInIncrement( $input );\n \n $getTransactionRecords = new Transaction();\n $transactionRecords = $getTransactionRecords->getTransactionDetails( $transaction_id );\n\n /* echo \"<pre>\";\n print_r($transactionRecords);\n exit; */\n\n $notifiDetailSave = new Notification();\n $notifiDetailSave->saveTransactionNotification( $transactionRecords );\n\n if( $usrBillAmt >= $maxBillAmt && $usrCheckIn >= $maxCheckIn ) {\n \n // $billBalAmt = $usrBillAmt % $maxBillAmt; //Balance Amount\n\n $loyaltyUser = new LoyaltyBalance();\n $existUser = $loyaltyUser->checkLoyaltyBalance( $userDetails ); \n \n if( empty( $existUser ) ) {\n $saveLoyaltyBalance = new LoyaltyBalance();\n $saveLoyaltyBalance->saveUserLoyaltyBalance( $userDetails );\n }\n\n $loyaltyMerchant = new LoyaltyBalance();\n $existMerchant = $loyaltyMerchant->checkMerchantLoyaltyBalance( $userDetails ); \n \n if( empty( $existMerchant ) ) {\n $saveLoyaltyBalance = new LoyaltyBalance();\n $saveLoyaltyBalance->saveMerchantLoyaltyBalance( $userDetails );\n }\n \n $getUsrBalance = new ZoinBalance();\n $usrTotAmt = $getUsrBalance->getUserBalance( $userDetails );\n \n if( isset( $usrTotAmt ) && !empty( $usrTotAmt ) ) {\n \n DB::table('zoin_balance')->where('vendor_or_user_id', $userDetails[0]->user_id)->increment('zoin_balance', $usrPoint);\n \n } else {\n \n $userDetailSave = new ZoinBalance(); \n $userDetailSave->vendor_or_user_id = $userDetails[0]->user_id; \n $userDetailSave->zoin_balance = $usrPoint;\n $userDetailSave->save(); \n }\n\n $billBalanceAmt = $usrBillAmt - $maxBillAmt; //Balance Amount\n if( isset( $billBalanceAmt ) && !empty( $billBalanceAmt ) ) {\n //$saveUserBalance = new LoyaltyBalance();\n //$saveUserBalance->userLoyaltyBalanceIncrement( $userDetails[0]->user_id, $billBalanceAmt );\n $saveUserBalance = new RedeemCode();\n $saveUserBalance->userLoyaltyBalanceIncrement( $userDetails, $billBalanceAmt );\n } else {\n $saveUserBalDec = new RedeemCode();\n $saveUserBalDec->userLoyaltyBalanceDecrement( $userDetails, $billBalanceAmt );\n }\n \n //Zoin Merchant Balance reduce\n DB::table('zoin_balance')->where('vendor_or_user_id', $userDetails[0]->vendor_id)->decrement('zoin_balance', $usrPoint);\n\n $notifiDetailSave = new Notification();\n $notifiDetailSave->saveUserPointNotification( $userDetails[0]->vendor_id, $userDetails[0]->user_id, $usrPoint, $transactionRecords['transaction_id'] );\n\n $notifiDetailsSave = new Notification();\n $notifiDetailsSave->saveMerchantPointNotification( $userDetails[0]->vendor_id, $userDetails[0]->user_id, $usrPoint, $transactionRecords['transaction_id'] );\n\n DB::table('transactions')->where(['vendor_id' => $userDetails[0]->vendor_id])->where(['user_id' => $userDetails[0]->user_id])->where(['loyalty_id' => $userDetails[0]->loyalty_id])->update( ['status'=> Config::get('constant.NUMBER.ONE') ] );\n DB::table('loyalty_balance')->where('user_id', $userDetails[0]->user_id)->increment('claimed_loyalty');\n DB::table('loyalty_balance')->where('vendor_id', $userDetails[0]->vendor_id)->increment('claimed_loyalty');\n\n if( $usrCheckIn >= $maxCheckIn ) {\n \n $balCheckIn = $usrCheckIn - $maxCheckIn; //Balance Checkin \n // DB::table('loyalty_balance')->where(['user_id' => $userDetails[0]->user_id])->update( ['total_loyalty'=> $balCheckIn ] ); \n DB::table('redeem_code')->where(['vendor_id' => $userDetails[0]->vendor_id])->where(['user_id' => $userDetails[0]->user_id])->where(['loyalty_id' => $userDetails[0]->loyalty_id])->update( ['user_checkin'=> $balCheckIn ] ); \n }\t\n \n $this->__getUserResponseDetails( $userDetails, $usrBillAmt );\n $response['transaction_id'] = $transactionRecords['transaction_id'];\n $response['message'] = $this->printTransanctionCompleted();\n return response()->json(['success' => $this->successStatus, 'message' => $response ], $this->successStatusCode );\n \n } else {\n \n $this->__getUserResponseDetails( $userDetails, $usrBillAmt );\n $response['transaction_id'] = $transactionRecords['transaction_id'];\n $response['message'] = $this->printTransanctionCompleted();\n return response()->json(['success' => $this->successStatus, 'message' => $response ], $this->successStatusCode );\n \n }\n \n } else {\n //echo \"Merchant Point is not enough\";\n return response()->json(['success' => $this->failureStatus, 'message' => $this->printMerchantPoint() ], $this->failureStatusCode );\n }\n } else {\n //echo \"Merchant Balance is not enough\";\n return response()->json(['success' => $this->failureStatus, 'message' => $this->printMerchantBalance() ], $this->failureStatusCode );\n }\n\n\n } else { \n \n return response()->json(['success' => $this->failureStatus, 'message' => $this->printCorrectMobileNumber() ], $this->failureStatusCode );\n } \n \n } else {\n \n return response()->json(['success' => $this->failureStatus, 'message' => $this->printMobileNoMissing() ], $this->failureStatusCode );\n } \n \n }", "function storePayment($agent_id,$month,$amount){\n \n\n if(request()->status == 0){\n\n $user = User::where([['userable_id', $agent_id],['role_id', env('AGENT')]] )\n ->first();\n\n $invoice = env('IRS_CODE').date('Ymd').$user->userable_id.random_int(0,9).strtotime(date('Ymdhsi',time()));\n\n $remittance = Remittance::create([\n 'agent_id'=> $user->userable_id,\n 'lga_id'=> $user->lga_id,\n 'amount'=> $amount,\n 'month'=> $month,\n 'payment_type'=> 'bank',\n 'transaction_reference'=> request()->reference,\n 'invoice'=> $invoice,\n 'mac_id'=> request()->ip()\n ]);\n\n\n return redirect( env('APP_URL').'/home#/remittance')->with('message', request()->reference.' has initialized!');\n\n\n }\n else if(request()->status == 1){\n\n \n DB::beginTransaction();\n try {\n\n $remits = Remittance::where('transaction_reference', request()->reference )->firstorFail();\n\n if($remits->status == 'success' )\n {\n return response()->json([\n 'status' => 'error',\n 'message' => 'transaction has updated before'\n ]);\n }\n \n//\n// $remit->update([\n// 'status' => 'success',\n// 'mac_id'=> request()->ip()\n// ]);\n\n $res = '';\n $curl = curl_init();\n\n $reference= request()->reference;\n $type='bank';\n $string = $reference.$type; //concatenate these values\n $mac = env('MAC_KEY');\n $hash = hash_hmac('sha512',$string,$mac, false);\n \t$token = env('MONETA_TOKEN');\n\n\n curl_setopt_array($curl, array(\n CURLOPT_URL => env('MONETA_URL').\"/transaction/verify/bank/\".$reference.\"?hash=\".$hash,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 0,\n CURLOPT_FOLLOWLOCATION => true,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"GET\",\n CURLOPT_HTTPHEADER => array(\n \"Authorization: Bearer $token\",\n \t\t\t\t\t\t \"Accept: application/json\"\n ),\n ));\n \n\n $response = curl_exec($curl);\n\n $err = curl_error($curl);\n curl_close($curl);\n \n if ($err) {\n return response()->json([\n 'status' => 'error',\n 'message' => 'error occurred!'\n ]);\n\n }\n\n $result = json_decode($response, true);\n\n\n if($result['status'] == 'success'){\n\n $payment_date = $result['customer']['updated_at'];\n if($result['customer']['Status'] == 1){\n\n $bank = $result['transaction']['BankName'].' '.$result['transaction']['BranchName'];\n\n\n $unremitObj = UnremittedCash::where([['agent_id', $remits->agent_id],['month',$remits->month]]);\n\n $unremitObj->decrement('amount', $result['customer']['AmountDue']);\n\n $unremit = $unremitObj->first();\n\n // $remittance->update(['invoice_id'=>$unremit->invoice_id]);\n\n $remits->status = 'success';\n $remits->mac_id = request()->ip();\n $remits->timestamps = false;\n $remits->bank = $bank;\n $remits->updated_at = date(\"Y-m-d H:i:s\", strtotime($payment_date));\n $remits->invoice_id = $unremit->invoice_id;\n $res = $remits->save();\n\n // set invoice id of unremitted to empty\n $unremitObj->update(['invoice_id'=>'']);\n//\n// if($response)\n// echo 'success';\n// else\n// echo 'failed';\n\n\n\n } else {\n\n return response()->json([\n 'status' => 'error',\n 'message' => 'Unpaid transaction reference.'\n ]);\n }\n\n } else {\n return response()->json([\n 'status' => 'error',\n 'message' => $result['message']\n ]);\n\n\n }\n\n\n\n\n DB::commit();\n //return 'success';\n if($res)\n return 'success';\n else \n return 'failed';\n\n\n }\n catch(\\Exception $ex){\n\n if (isset($ex->errorInfo[2])) {\n $msg = $ex->errorInfo[2];\n } else {\n $msg = $ex->getMessage();\n }\n\n // rollback operation for failure\n DB::rollback();\n\n // return $msg;\n return response()->json([\n 'status' => 'error',\n 'data' => $msg\n ]);\n\n }\n\n\n\n\n }\n\n\n }", "function thrive_transactions_callblack() {\n\n\t// Always check for nonce before proceeding...\n\t$nonce = filter_input( INPUT_GET, 'nonce', FILTER_SANITIZE_STRING );\n\n\t// If INPUT_GET is empty try input post\n\tif ( empty( $nonce ) ) {\n\n\t\t$nonce = filter_input( INPUT_POST, 'nonce', FILTER_SANITIZE_STRING );\n\n\t}\n\n\tif ( ! wp_verify_nonce( $nonce, 'thrive-transaction-request' ) ) \n\t{\n\n\t\tdie( \n\t\t\t__( 'Invalid Request. Your session has already expired (invalid nonce). \n\t\t\t\tPlease go back and refresh your browser. Thanks!', 'thrive' ) \n\t\t);\n\n\t}\n\n\t$method = filter_input( INPUT_POST, 'method', FILTER_SANITIZE_ENCODED );\n\n\tif ( empty( $method ) ) {\n\t\t// try get action\n\t\t$method = filter_input( INPUT_GET, 'method', FILTER_SANITIZE_ENCODED );\n\t}\n\n\t$allowed_callbacks = array(\n\n\t\t// Tickets/Tasks callbacks\n\t\t'thrive_transaction_add_ticket',\n\t\t'thrive_transaction_delete_ticket',\n\t\t'thrive_transaction_fetch_task',\n\t\t'thrive_transaction_edit_ticket',\n\t\t'thrive_transaction_complete_task',\n\t\t'thrive_transaction_renew_task',\n\n\t\t// Comments callback functions.\n\t\t'thrive_transaction_add_comment_to_ticket',\n\t\t'thrive_transaction_delete_comment',\n\n\t\t// Project callback functions.\n\t\t'thrive_transactions_update_project',\n\t\t'thrive_transactions_delete_project',\n\t);\n\n\tif ( function_exists( $method ) ) {\n\t\tif ( in_array( $method, $allowed_callbacks ) ) {\n\t\t\t// execute the callback\n\t\t\t$method();\n\t\t} else {\n\t\t\tthrive_api_message(array(\n\t\t\t\t'message' => 'method is not listed in the callback',\n\t\t\t));\n\t\t}\n\t} else {\n\t\tthrive_api_message(array(\n\t\t\t'message' => 'method not allowed or method does not exists',\n\t\t));\n\t}\n\n\tthrive_api_message(array(\n\t\t\t'message' => 'transaction callback executed',\n\t\t));\n}", "function sendPaymentProof(Transaction $transaction,$payment_proof_url)\n {\n $transaction->payment_url = $payment_proof_url;\n $this->transactionRepo->save($transaction);\n //if the last status is not \"need checking\", change it\n $transactionStatus = $this->transactionStatusRepo->findByTransactionMostRecent($transaction);\n if (!$transactionStatus->isNeedChecking()){\n $transactionStatus = $this->addStatus($transaction,TransactionStatus::STATUS_NEED_CHECKING,null);\n }\n return $transactionStatus;\n }", "function _exp_checkout_do_payment() {\n global $event_details;\n $event_id = $event_details['ID'];\n\n if ( is_null( $event_id ) ) {\n return false;\n }\n\n $regis_id = $this->erm->get_regis_id();\n $post_ID = $_SESSION['__epl']['post_ID'];\n $this->ecm->setup_event_details( $event_id );\n $_totals = $this->erm->calculate_totals();\n $total = $_totals['money_totals']['grand_total'];\n\n $this->epl->load_file( 'libraries/gateways/twocheckout/twocheckout.php' );\n $twocheckout_response = new TCO_Payment();\n $twocheckout_response->setAcctInfo();\n $response = $twocheckout_response->getResponse();\n if ( is_array( $response )) {\n $data['post_ID'] = $post_ID;\n $data['_epl_regis_status'] = '5';\n $data['_epl_grand_total'] = $total;\n $data['_epl_payment_amount'] = $response['total'];\n $data['_epl_payment_date'] = current_time( 'mysql' );\n $data['_epl_payment_method'] = '_tco';\n $data['_epl_transaction_id'] = $response['order_number'];\n\n $data = apply_filters( 'epl_tco_response_data', $data, $response );\n\n $this->erm->update_payment_data( $data );\n\n return true;\n } else {\n $error = 'ERROR: ' . 'MD5 Hash does not match! Contact the seller!';\n }\n }", "public function handleGatewayCallback()\n {\n\n $paymentDetails = Paystack::getPaymentData();\n if ($paymentDetails['data']['status'] == \"success\") {\n if ($paymentDetails['data']['metadata']['type'] == 'DATA') {\n $data = new Buydata();\n $data->data = $paymentDetails['data']['metadata']['data'];\n $data->email = $paymentDetails['data']['metadata']['email'];\n $data->telephone = $paymentDetails['data']['metadata']['telephone'];\n $data->status = \"Successful\";\n $data->amount = $paymentDetails['data']['metadata']['Amount'];\n $data->save();\n Nexmo::message()->send([\n 'to' => '2348136088266',\n 'from' => '2348136088266',\n 'text' => 'I just made a payment for DATA - Name ' . Auth::user()->name . '-NUMBER ' . $paymentDetails['data']['metadata']['telephone'] . \" Amount \".$paymentDetails['data']['metadata']['Amount']\n ]);\n Session::flash('message', 'Data subscription successfull,you will recieve your data shortly');\n $data = Data_Price::all();\n return view('data_transaction')\n ->with('data', $data);\n }\n if ($paymentDetails['data']['metadata']['type'] == 'WAEC') {\n $pin = WaecCard::where('ref_id', $paymentDetails['data']['metadata']['ref_id'])\n ->first();\n $pin->Usage_status = 'USED';\n $pin->save();\n $scratch = new ScatchCard();\n Session::put('pin', $pin->card_pin);\n Session::put('ref_id', $pin->ref_id);\n $scratch->user_id = Auth::user()->id;\n $scratch->scratch_name = 'WAEC';\n $scratch->card_pin = $pin->card_pin;\n $scratch->ref_id = $paymentDetails['data']['metadata']['ref_id'];\n $scratch->price = $paymentDetails['data']['metadata']['price'];\n $scratch->year = $paymentDetails['data']['metadata']['year'];\n $scratch->Usage_status = 'USED';\n $scratch->save();\n Nexmo::message()->send([\n 'to' => '2348136088266',\n 'from' => '2348136088266',\n 'text' => 'I just made a payment for WEAC CARD - Name ' . Auth::user()->name . ' SERIAL: ' . $paymentDetails['data']['metadata']['ref_id'] . \" Price: \".$paymentDetails['data']['metadata']['price']\n ]);\n Session::flash('Waec_Success', 'CONGRATULATIONS,You have Successfully Purchased A Scratch Card Pin');\n return view('Scratch');\n }\n if ($paymentDetails['data']['metadata']['type'] == 'NECO') {\n $pin = NecoCard::where('ref_id', $paymentDetails['data']['metadata']['ref_id'])\n ->first();\n $pin->Usage_status = 'USED';\n $pin->save();\n $scratch = new ScatchCard();\n Session::put('pin', $pin->card_pin);\n Session::put('ref_id', $pin->ref_id);\n $scratch->user_id = Auth::user()->id;\n $scratch->scratch_name = 'NECO';\n $scratch->card_pin = $pin->card_pin;\n $scratch->ref_id = $paymentDetails['data']['metadata']['ref_id'];\n $scratch->price = $paymentDetails['data']['metadata']['price'];\n $scratch->year = $paymentDetails['data']['metadata']['year'];\n $scratch->Usage_status = 'USED';\n $scratch->save();\n Nexmo::message()->send([\n 'to' => '2348136088266',\n 'from' => '2348136088266',\n 'text' => 'I just made a payment for NECO CARD - Name ' . Auth::user()->name . ' SERIAL: ' . $paymentDetails['data']['metadata']['ref_id'] . \" Price: \".$paymentDetails['data']['metadata']['price']\n ]);\n Session::flash('Neco_Success', 'CONGRATULATIONS,You have Successfully Purchased A Scratch Card Pin');\n return view('Scratch');\n }\n if ($paymentDetails['data']['metadata']['type'] == 'WAECGCE') {\n $pin = WaecGceCard::where('ref_id', $paymentDetails['data']['metadata']['ref_id'])\n ->first();\n $pin->Usage_status = 'USED';\n $pin->save();\n $scratch = new ScatchCard();\n Session::put('pin', $pin->card_pin);\n Session::put('ref_id', $pin->ref_id);\n $scratch->user_id = Auth::user()->id;\n $scratch->scratch_name = 'WACEGCE';\n $scratch->card_pin = $pin->card_pin;\n $scratch->ref_id = $paymentDetails['data']['metadata']['ref_id'];\n $scratch->price = $paymentDetails['data']['metadata']['price'];\n $scratch->year = $paymentDetails['data']['metadata']['year'];\n $scratch->Usage_status = 'USED';\n $scratch->save();\n Nexmo::message()->send([\n 'to' => '2348136088266',\n 'from' => '2348136088266',\n 'text' => 'I just made a payment for NECO GCE CARD - Name ' . Auth::user()->name . ' SERIAL: ' . $paymentDetails['data']['metadata']['ref_id'] . \" Price: \".$paymentDetails['data']['metadata']['price']\n ]);\n Session::flash('WaecGce_Success', 'CONGRATULATIONS,You have Successfully Purchased A Scratch Card Pin');\n return view('Scratch');\n }\n } elseif ($paymentDetails['data']['success'] == \"failed\") {\n Session::flash('trans_error', 'Oops,Transaction not successfull,Kindly try Again later');\n Return view('TransError');\n }\n\n\n }", "public function transaction_status(Request $request) {\n\n Log::info(\"TransactionController->transaction_status :- Inside \");\n $organization_id = Session::get('organization_id');\n\n $transaction = Transaction::select('transactions.*','transactions.transaction_type_id', 'transactions.mobile', 'transactions.id', 'transactions.date', 'transactions.total', DB::raw('COALESCE(transactions.reference_no, \"\") AS reference_no'), 'transactions.order_no', 'people.display_name', DB::raw('IF(persons.crm_code IS NULL, businesses.bcrm_code, persons.crm_code) AS code'))\n ->leftjoin('people', function($query){\n $query->on('transactions.people_id','=','people.person_id');\n $query->orWhere('transactions.people_id','=','people.business_id');\n })\n ->leftjoin('persons', 'people.person_id', '=', 'persons.id')\n ->leftjoin('businesses', 'people.person_id', '=', 'businesses.id')\n ->where('transactions.id', $request->id)\n ->first();\n\n $business = Organization::select('businesses.alias AS business')\n ->leftjoin('businesses', 'businesses.id', '=', 'organizations.business_id')\n ->where('organizations.id', $organization_id)->first()->business;\n\n $transaction_type = AccountVoucher::find($transaction->transaction_type_id);\n\n if($transaction_type->name == \"goods_receipt_note\" || $transaction_type->name == \"credit_note\") {\n\n if($transaction->transaction_type_id != null)\n {\n $transaction_type_name = Transaction::select('transactions.id','transactions.transaction_type_id','account_vouchers.display_name AS voucher_type')\n ->leftjoin('account_vouchers', 'account_vouchers.id', '=', 'transactions.transaction_type_id')\n ->where('transactions.transaction_type_id',$transaction->transaction_type_id)\n ->first();\n }\n\n $items = TransactionItem::where('transaction_id', $transaction->id)->get();\n\n foreach ($items as $item) {\n $stock = InventoryItemStock::find($item->item_id);\n\n $inventory_item = InventoryItem::find($item->item_id);\n\n $purchase_tax_value = TaxGroup::select(DB::raw('SUM(taxes.value) AS value'))\n ->leftjoin('group_tax', 'group_tax.group_id', '=', 'tax_groups.id')\n ->leftjoin('taxes', 'group_tax.tax_id', '=', 'taxes.id')\n ->where('tax_groups.organization_id', $organization_id)\n ->where('tax_groups.id', $inventory_item->purchase_tax_id)\n ->groupby('tax_groups.id')->first();\n\n\n if($inventory_item->purchase_tax_id != null)\n {\n $purchase_tax_amount = Custom::two_decimal(($purchase_tax_value->value/100) * ($inventory_item->purchase_price));\n\n $purchase_tax_price = Custom::two_decimal($inventory_item->purchase_price + $purchase_tax_amount);\n }\n else{\n $purchase_tax_price = $inventory_item->purchase_price;\n }\n\n $t_items = TransactionItem::select('transaction_items.*',DB::raw('SUM(transaction_items.quantity)'))\n ->where('transaction_items.transaction_id', $transaction->id)\n ->where('transaction_items.item_id', $item->item_id)->first();\n\n if($stock != null) {\n if($request->status == \"1\") {\n\n $inventory_stock = $stock->in_stock + $item->quantity;\n\n $stock->in_stock = $inventory_stock;\n $stock->date = $transaction->date;\n $data = json_decode($stock->data, true);\n\n /*$data[] = [\"date\" => $transaction->date, \"in_stock\" => $inventory_stock];*/\n\n $data[] = [\"transaction_id\" => $transaction->id,\"entry_id\" => $transaction->entry_id,\"voucher_type\" => $transaction_type_name->voucher_type,\"order_no\" => $transaction->order_no,\"quantity\" => $t_items->quantity,\"date\" => date('Y-m-d H:i:s'), \"in_stock\" => $inventory_stock,'purchase_price' => $purchase_tax_price,'sale_price' => $inventory_item->base_price,'status' => 1];\n\n $stock->data = json_encode($data);\n\n } else if($request->status == \"0\") {\n\n //$inventory_stock = $stock->in_stock - $item->quantity;\n\n if($stock->in_stock <= $item->quantity)\n {\n $inventory_stock = 0.00;\n }else{\n $inventory_stock = $stock->in_stock - $item->quantity;\n }\n\n $stock->in_stock = $inventory_stock;\n $stock->date = $transaction->date;\n\n $data = json_decode($stock->data, true);\n\n /*$data[] = [\"date\" => $transaction->date, \"in_stock\" => $inventory_stock];*/\n\n $data[] = [\"transaction_id\" => $transaction->id,\"entry_id\" => $transaction->entry_id,\"voucher_type\" => $transaction_type_name->voucher_type,\"order_no\" => $transaction->order_no,\"quantity\" => $t_items->quantity,\"date\" => date('Y-m-d H:i:s'), \"in_stock\" => $inventory_stock,'purchase_price' => $purchase_tax_price,'sale_price' => $inventory_item->base_price,'status' => 1];\n\n $stock->data = json_encode($data);\n } \n \n $stock->save();\n }\n \n }\n \n\n } else if($transaction_type->name == \"delivery_note\" || $transaction_type->name == \"debit_note\" || $transaction_type->name == \"job_invoice_cash\") {\n\n if($transaction->transaction_type_id != null)\n {\n $transaction_type_name = Transaction::select('transactions.id','transactions.transaction_type_id','account_vouchers.display_name AS voucher_type')\n ->leftjoin('account_vouchers', 'account_vouchers.id', '=', 'transactions.transaction_type_id')\n ->where('transactions.transaction_type_id',$transaction->transaction_type_id)\n ->first();\n }\n\n $items = TransactionItem::where('transaction_id', $transaction->id)->get();\n\n foreach ($items as $item) {\n $stock = InventoryItemStock::find($item->id);\n\n $inventory_item = InventoryItem::find($item->item_id);\n\n $purchase_tax_value = TaxGroup::select(DB::raw('SUM(taxes.value) AS value'))->leftjoin('group_tax', 'group_tax.group_id', '=', 'tax_groups.id')->leftjoin('taxes', 'group_tax.tax_id', '=', 'taxes.id')->where('tax_groups.organization_id', $organization_id)->where('tax_groups.id', $inventory_item->purchase_tax_id)->groupby('tax_groups.id')->first();\n\n\n if($inventory_item->purchase_tax_id != null)\n {\n $purchase_tax_amount = Custom::two_decimal(($purchase_tax_value->value/100) * ($inventory_item->purchase_price));\n\n $purchase_tax_price = Custom::two_decimal($inventory_item->purchase_price + $purchase_tax_amount);\n }\n else{\n $purchase_tax_price = $inventory_item->purchase_price;\n }\n\n $t_items = TransactionItem::select('transaction_items.*',DB::raw('SUM(transaction_items.quantity)'))\n ->where('transaction_items.transaction_id', $transaction->id)\n ->where('transaction_items.item_id', $item->item_id)->first();\n\n if($stock != null) {\n if($request->status == \"1\") {\n\n //$inventory_stock = $stock->in_stock - $item->quantity;\n\n if($stock->in_stock <= $item->quantity)\n {\n $inventory_stock = 0.00;\n }else{\n $inventory_stock = $stock->in_stock - $item->quantity;\n }\n\n $stock->in_stock = $inventory_stock;\n $stock->date = $transaction->date;\n $data = json_decode($stock->data, true);\n\n /*$data[] = [\"date\" => $transaction->date, \"in_stock\" => $inventory_stock];*/\n\n $data[] = [\"transaction_id\" => $transaction->id,\"entry_id\" => $transaction->entry_id,\"voucher_type\" => $transaction_type_name->voucher_type,\"order_no\" => $transaction->order_no,\"quantity\" => $t_items->quantity,\"date\" => date('Y-m-d H:i:s'), \"in_stock\" => $inventory_stock,'purchase_price' => $purchase_tax_price,'sale_price' => $inventory_item->base_price,'status' => 1];\n\n $stock->data = json_encode($data);\n\n } \n else if($request->status == \"0\") {\n\n $inventory_stock = $stock->in_stock + $item->quantity;\n\n $stock->in_stock = $inventory_stock ;\n $stock->date = $transaction->date;\n $data = json_decode($stock->data, true);\n\n $data[] = [\"date\" => $transaction->date, \"in_stock\" => $inventory_stock];\n\n $data[] = [\"transaction_id\" => $transaction->id,\"entry_id\" => $transaction->entry_id,\"voucher_type\" => $transaction_type_name->voucher_type,\"order_no\" => $transaction->order_no,\"quantity\" => $t_items->quantity,\"date\" => date('Y-m-d H:i:s'), \"in_stock\" => $inventory_stock,'purchase_price' => $inventory_item->purchase_price,'sale_price' => $inventory_item->base_price,'status' => 1];\n\n\n $stock->data = json_encode($data);\n }\n $stock->save();\n } \n }\n }\n\n \n $transaction->approval_status = $request->status;\n $transaction->save();\n\n $business_name = Session::get('business');\n\n if($transaction->approval_status == 1) {\n\n if($transaction_type->name == \"receipt\" || $transaction_type->name == \"purchase_order\" || $transaction_type->name == \"sale_order\" || $transaction_type->name == \"sales\" || $transaction_type->name == \"sales_cash\" || $transaction_type->name == \"delivery_note\" || $transaction_type->name == \"job_invoice\" || $transaction_type->name == \"job_invoice_cash\") {\n\n switch ($transaction_type->name) {\n case 'receipt':\n $message = \"Dear \".$transaction->display_name.\",\". \"\\n\\n\" .\"Payment of Rs. \".$transaction->total.\" on 11-May-18 for the Invoice \".$transaction->order_no.\" has been received.\". \"\\n\\n\" .\"Thanks for choosing \".$business_name. \"\\n\\n\" .\"Your Propel ID: \".$transaction->code;\n break;\n\n case 'purchase_order':\n $message = \"You have a new order from My Company for Rs. \".$transaction->total. \"\\n\\n\" .\"Your Propel ID: \".$transaction->code;\n break;\n\n case 'sale_order':\n $message = \"Dear \".$transaction->display_name.\",\". \"\\n\\n\" .\"your purchase order has been confirmed. Order ref:\".$transaction->order_no.\" Amount: Rs.\".$transaction->total. \"\\n\\n\" .\"Thanks for choosing \".$business_name. \"\\n\\n\" .\"Your Propel ID: \".$transaction->code;\n break;\n\n case 'sales':\n $message = \"Dear \".$transaction->display_name.\",\". \"\\n\\n\" .\"Thanks for choosing PropelSoft. \n Invoice with Ref:1236 for Rs. \".$transaction->total.\" has been created on 11-May-18.\". \"\\n\\n\" .\"Your Propel ID: \".$transaction->code;\n break;\n\n case 'sales_cash':\n $message = \"Dear \".$transaction->display_name.\",\". \"\\n\\n\" .\"Your Payment of Rs. \".$transaction->total.\" has been received for the Invoice \".$transaction->order_no.\"\". \"\\n\\n\" .\"Thanks for choosing \".$business_name. \"\\n\\n\" .\"Your Propel ID: \".$transaction->code;\n break;\n\n case 'job_invoice':\n $message = \"Dear \".$transaction->display_name.\",\". \"\\n\\n\" .\"Thanks for choosing PropelSoft. \n Invoice for Rs. \".$transaction->total.\" has been created on Today.\". \"\\n\\n\" .\"Your Propel ID: \".$transaction->code;\n break;\n\n case 'job_invoice_cash':\n $message = \"Dear \".$transaction->display_name.\",\". \"\\n\\n\" .\"Your Payment of Rs. \".$transaction->total.\" has been received for the Invoice \".$transaction->order_no.\"\". \"\\n\\n\" .\"Thanks for choosing \".$business_name. \"\\n\\n\" .\"Your Propel ID: \".$transaction->code;\n break;\n\n case 'delivery_note':\n $message = \"Dear \".$transaction->display_name.\",\". \"\\n\\n\" .\"Your order for \".$transaction->reference_no. \" of Rs. \".$transaction->total.\" has been delivered. Ref: \".$transaction->order_no. \"\\n\\n\" .\"Thanks for choosing \".$business_name. \"\\n\\n\" .\"Your Propel ID: \".$transaction->code;\n break;\n }\n\n if($transaction->mobile != \"\") {\n\n //$this->dispatch(new SendSms(config('constants.sms.user'), config('constants.sms.pass'), config('constants.sms.sender'), $transaction->mobile, $message));\n //$this->dispatch(new SendTransactionEmail());\n\n //Custom::send_transms(config('constants.sms.user'), config('constants.sms.pass'), config('constants.sms.sender'), $transaction->mobile, $message);\n }\n }\n }\n \n\n if($transaction->entry_id != null) {\n $entry = AccountEntry::find($transaction->entry_id);\n $entry->status = $request->status;\n $entry->save();\n }\n Log::info(\"TransactionController->transaction_status :- Return \");\n\n return response()->json(array('result' => 'Success'));\n }", "public function __processTransaction(CakeEvent $event) {\n\t\t$txnId = $event->subject()->id;\n\t\t$this->log(__d('paypal_ipn', 'Processing Trasaction: %s', $txnId), 'paypal');\n\t\t//Put the afterPaypalNotification($txnId) into your AppController.php\n\t\tif (method_exists($this, 'afterPaypalNotification')) {\n\t\t\t$this->afterPaypalNotification($txnId);\n\t\t}\n\t}", "public function check_azericard_response($request_status) {\r\n\r\n global $woocommerce;\r\n\r\n if ($_POST[\"ORDER\"]) {\r\n\r\n $order_id = ltrim($_POST[\"ORDER\"], \"0\");\r\n\r\n if($order_id !== ''){\r\n try{\r\n $order = new WC_Order( $order_id );\r\n $hash = $checkhash = true;\r\n $transauthorised = false;\r\n if($order->status !== 'completed'){\r\n if($this->checkCallbackData($_POST)){\r\n $status = strtolower($status);\r\n\r\n if($request_status == '0' || $request_status == '1'){\r\n $transauthorised = true;\r\n $this->msg['message'] = __('Thank you for shopping with us. Your account has been charged and your transaction is successful. We will be shipping your order to you soon.', 'azericard');\r\n $this->msg['class'] = 'woocommerce_message';\r\n if($order->status !== 'processing'){\r\n update_post_meta( $order_id, 'order_rrn', $_POST['RRN']);\r\n update_post_meta( $order_id, 'order_int_ref', $_POST['INT_REF']);\r\n $order -> payment_complete();\r\n $order -> add_order_note( __('Azericard payment successful<br/>Unnique Id from Azericard: '.$_POST[\"ORDER\"], 'azericard'));\r\n $order -> add_order_note($this->msg['message']);\r\n $woocommerce->cart->empty_cart();\r\n }\r\n }else{\r\n $this->msg['class'] = 'woocommerce_error';\r\n $this->msg['message'] = __('Thank you for shopping with us. However, the transaction has been declined.', 'azericard');\r\n $order->add_order_note(__('Transaction Declined: ', 'azericard').$_REQUEST['Error']);\r\n }\r\n }else{\r\n $this->msg['class'] = 'error';\r\n $this->msg['message'] = __('Security Error. Illegal access detected', 'azericard');\r\n }\r\n if(!$transauthorised){\r\n $order->update_status('failed');\r\n $order->add_order_note('Failed');\r\n $order->add_order_note($this->msg['message']);\r\n }\r\n add_action('the_content', array(&$this, 'showMessage'));\r\n }\r\n }catch(Exception $e){\r\n $msg = \"Error\";\r\n }\r\n }\r\n }\r\n }", "public function process() {\n\t\t$this->log('Process accessed', 'paypal');\n\t\tif ($this->request->is('post')) {\n\t\t\t$this->log('POST ' . print_r($_POST, true), 'paypal');\n\t\t}\n\t\tif ($this->InstantPaymentNotification->isValid($_POST)) {\n\t\t\t$this->log('POST Valid', 'paypal');\n\t\t\t$notification = $this->InstantPaymentNotification->buildAssociationsFromIPN($_POST);\n\n\t\t\t$existingIPNId = $this->InstantPaymentNotification->searchIPNId($notification);\n\t\t\tif ($existingIPNId !== false) {\n\t\t\t\t$notification['InstantPaymentNotification']['id'] = $existingIPNId;\n\t\t\t}\n\n\t\t\t$this->InstantPaymentNotification->saveAll($notification);\n\t\t\t$this->__processTransaction($this->InstantPaymentNotification->id);\n\t\t} else {\n\t\t\t$this->log('POST Not Validated', 'paypal');\n\t\t}\n\t\treturn $this->redirect('/');\n\t}", "public function execute()\n {\n $request = $this->getRequest()->getParams();\n $responseContent = [\n 'success' => false,\n 'redirect_url' => 'checkout/#payment',\n 'parameters' => []\n ];\n\n if(empty($request['cf_id']) === false) {\n $resultRedirect = $this->resultRedirectFactory->create();\n $orderIncrementId = $request['cf_id'];\n $order = $this->orderFactory->create()->loadByIncrementId($orderIncrementId);\n $validateOrder = $this->checkRedirectOrderStatus($orderIncrementId, $order);\n if ($validateOrder['status'] == \"SUCCESS\") {\n $mageOrderStatus = $order->getStatus();\n if($mageOrderStatus === 'pending') {\n $this->processPayment($validateOrder['transaction_id'], $order);\n }\n $this->messageManager->addSuccess(__('Your payment was successful'));\n $resultRedirect->setPath('checkout/onepage/success');\n return $resultRedirect;\n\n } else if ($validateOrder['status'] == \"CANCELLED\") {\n $this->messageManager->addWarning(__('Your payment was cancel'));\n $this->checkoutSession->restoreQuote();\n $resultRedirect->setPath('checkout/cart');\n return $resultRedirect;\n } else if ($validateOrder['status'] == \"FAILED\") {\n $this->messageManager->addErrorMessage(__('Your payment was failed'));\n $order->cancel()->save();\n $resultRedirect->setPath('checkout/onepage/failure');\n return $resultRedirect;\n } else if($validateOrder['status'] == \"PENDING\"){\n $this->checkoutSession->restoreQuote();\n $this->messageManager->addWarning(__('Your payment is pending'));\n $resultRedirect->setPath('checkout/cart');\n return $resultRedirect;\n } else{\n $this->checkoutSession->restoreQuote();\n $this->messageManager->addErrorMessage(__('There is an error. Payment status is pending'));\n $resultRedirect->setPath('checkout/cart');\n return $resultRedirect;\n }\n } else {\n $order = $this->checkoutSession->getLastRealOrder();\n $code = 400;\n \n $transactionId = $request['additional_data']['cf_transaction_id'];\n \n if(empty($transactionId) === false && $request['additional_data']['cf_order_status'] === 'PAID')\n {\n $orderId = $order->getIncrementId();\n $validateOrder = $this->validateSignature($request, $order);\n if(!empty($validateOrder['status']) && $validateOrder['status'] === true) {\n $mageOrderStatus = $order->getStatus();\n if($mageOrderStatus === 'pending') {\n $this->processPayment($transactionId, $order);\n }\n\n $responseContent = [\n 'success' => true,\n 'redirect_url' => 'checkout/onepage/success/',\n 'order_id' => $orderId,\n ];\n\n $code = 200;\n } else {\n $responseContent['message'] = $validateOrder['errorMsg'];\n }\n\n $response = $this->resultFactory->create(ResultFactory::TYPE_JSON);\n $response->setData($responseContent);\n $response->setHttpResponseCode($code);\n return $response;\n } else {\n $responseContent['message'] = \"Cashfree Payment details missing.\";\n }\n }\n\n //update/disable the quote\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n $quote = $objectManager->get('Magento\\Quote\\Model\\Quote')->load($order->getQuoteId());\n $quote->setIsActive(true)->save();\n $this->checkoutSession->setFirstTimeChk('0');\n \n $response = $this->resultFactory->create(ResultFactory::TYPE_JSON);\n $response->setData($responseContent);\n $response->setHttpResponseCode($code);\n return $response;\n }", "public function getPaymentStatus(Request $request){\n\n\t\t$purchase_id = ($request->session()->has('purchase_id'))? $request->session()->get('purchase_id') : 0;\n\t\t$_tienda='';\n\t\t$purchase= Purchase::find($purchase_id);\n\t\tif($purchase->shop_id == 1)$_tienda='eagletekmexico';\n\t\tif($purchase->shop_id == 2)$_tienda='ziotrobotik';\n\n\t\t// Get the payment ID before session clear\n\t\t$payment_id = Session::get('paypal_payment_id');\n\n\t\t// clear the session payment ID\n\t\tSession::forget('paypal_payment_id');\n\n\t\tif (empty($request->input('PayerID')) || empty($request->input('token'))) {\n\t\t\tif($purchase_id){\n\t\t\t\t$purchase->status=4;\n\t \t\t$purchase->save();\n\t\t\t}\n\t\t\tSession::flash('alert', 'Proceso de pago no completado.');\n\t\t\tSession::flash('alert-class', 'alert-danger');\n\t\t\treturn redirect('/shopping-cart');\n\t\t}\n\n\t\t$payment = Payment::get($payment_id, $this->_api_context);\n\n\t\t// PaymentExecution object includes information necessary\n\t\t// to execute a PayPal account payment.\n\t\t// The payer_id is added to the request query parameters\n\t\t// when the user is redirected from paypal back to your site\n\t\t$execution = new PaymentExecution();\n\t\t$execution->setPayerId($request->input('PayerID'));\n\n\t\t//Execute the payment\n\t\t$result = $payment->execute($execution, $this->_api_context);\n\n\t\tif ($result->getState() == 'approved') { // payment made\n\t\t \t// Payment is successful do your business logic here\n\t\t\tif($purchase_id){\n \t\t$purchase->status=3;\n \t\t$purchase->save();\n\t\t\t}\n\t\t\tCart::destroy();\n\t\t\tSession::forget('session_discount_code');\n \tSession::forget('session_type_discount');\n \tSession::forget('session_discount');\n\t\t \tSession::flash('alert', 'Pago procesado correctamente!');\n\t\t \tSession::flash('alert-class', 'alert-success');\n\t\t return redirect('/shopping-cart/payment-success');\n\t\t}\n\n\t\t$purchase->status = 4;\n\t\t$purchase->save();\n\n\t\tSession::flash('alert', 'Ocurrió un error inesperado y el proceso de pago ha fallado.');\n\t\tSession::flash('alert-class', 'alert-danger');\n\t\treturn redirect('/shopping-cart');\n\t}", "public function status() {\n $payment_id = Session::get('paypal_payment_id');\n // clear the session payment ID\n Session::forget('paypal_payment_id');\n if (empty(Input::get('PayerID')) || empty(Input::get('token'))) {\n return Redirect::route('main.index')\n ->with('error', 'Payment failed');\n }\n $payment = Payment::get($payment_id, $this->_api_context);\n // PaymentExecution object includes information necessary \n // to execute a PayPal account payment. \n // The payer_id is added to the request query parameters\n // when the user is redirected from paypal back to your site\n $execution = new PaymentExecution();\n $execution->setPayerId(Input::get('PayerID'));\n \n //Execute the payment\n $result = $payment->execute($execution, $this->_api_context);\n // echo '<pre>';print_r($result);echo '</pre>';exit; // DEBUG RESULT, remove it later\n if ($result->getState() == 'approved') { // payment made\n Cart::destroy();\n\n return Redirect::route('main.index')\n ->with('success', 'Payment success');\n }\n return Redirect::route('main.index')\n ->with('error', 'Payment failed');\n }", "public function onTP_Processpayment($data, $vars = array())\n\t{\n\t\t$isValid = true;\n\t\t$error = array();\n\t\t$error['code']\t= '';\n\t\t$error['desc']\t= '';\n\t\t$trxnstatus = '';\n\n\t\t// 1.Check IPN data for validity (i.e. protect against fraud attempt)\n\t\t$isValid = $this->isValidIPN($data);\n\n\t\tif (!$isValid)\n\t\t{\n\t\t\t$data['error'] = 'Invalid response received.';\n\t\t}\n\n\t\t// 2. Check that merchant_id is correct\n\t\tif ($isValid )\n\t\t{\n\t\t\tif ($this->getMerchantID() != $data['merchant_id'])\n\t\t\t{\n\t\t\t\t$isValid = false;\n\t\t\t\t$data['error'] = \"The received merchant_id does not match the one that was sent.\";\n\t\t\t}\n\t\t}\n\n\t\t// 3.compare response order id and send order id in notify URL\n\t\tif ($isValid )\n\t\t{\n\t\t\tif (!empty($vars) && $data['custom_str1'] != $vars->order_id )\n\t\t\t{\n\t\t\t\t$isValid = false;\n\t\t\t\t$trxnstatus = 'ERROR';\n\t\t\t\t$data['error'] = \"ORDER_MISMATCH\" . \"Invalid ORDERID; notify order_is \"\n\t\t\t\t. $vars->order_id . \", and response \" . $data['custom_str1'];\n\t\t\t}\n\t\t}\n\n\t\t// Check that the amount is correct\n\n\t\tif ($isValid )\n\t\t{\n\t\t\tif (!empty($vars))\n\t\t\t{\n\t\t\t\t// Check that the amount is correct\n\t\t\t\t$order_amount = (float) $vars->amount;\n\t\t\t\t$return_resp['status'] = '0';\n\t\t\t\t$data['total_paid_amt'] = (float) $data['amount_gross'];\n\t\t\t\t$epsilon = 0.01;\n\n\t\t\t\tif (($order_amount - $data['total_paid_amt']) > $epsilon)\n\t\t\t\t{\n\t\t\t\t\t$trxnstatus = 'ERROR';\n\t\t\t\t\t$isValid = false;\n\t\t\t\t\t$data['error'] = \"ORDER_AMOUNT_MISTMATCH - order amount= \"\n\t\t\t\t\t. $order_amount . ' response order amount = ' . $data['total_paid_amt'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Translaet Payment status\n\t\tif ($trxnstatus == 'ERROR')\n\t\t{\n\t\t\t$newStatus = $this->translateResponse($trxnstatus);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$newStatus = $this->translateResponse($data['payment_status']);\n\t\t}\n\n\t\t// Fraud attempt? Do nothing more!\n\t\t// *if(!$isValid) return false;\n\n\t\t$data['status'] = $newStatus;\n\n\t\t// Error Handling\n\t\t$error = array();\n\t\t$error['code']\t= 'ERROR';\n\t\t$error['desc']\t= (isset($data['error'])?$data['error']:'');\n\n\t\t$result = array(\n\t\t\t\t\t\t'order_id' => $data['custom_str1'],\n\t\t\t\t\t\t'transaction_id' => $data['pf_payment_id'],\n\t\t\t\t\t\t'buyer_email' => $data['email_address'],\n\t\t\t\t\t\t'status' => $newStatus,\n\t\t\t\t\t\t'txn_type' => '',\n\t\t\t\t\t\t'total_paid_amt' => (float) $data['amount_gross'],\n\t\t\t\t\t\t'raw_data' => $data,\n\t\t\t\t\t\t'error' => $error ,\n\t\t\t\t\t\t);\n\n\t\treturn $result;\n\t}", "public function complete(){\n\n\t\tif (isset($_GET[\"paymentId\"]) && $_GET[\"paymentId\"] == session('paypal_payment_id')) {\n\t\t\t$result = $this->paypal->execute_payment($_GET[\"paymentId\"], $_GET[\"PayerID\"], $this->mode);\n \n\t\t\t// get amount\n\t\t\t$amount = $result->transactions[0]->amount;\n\t\t\t$amount = $amount->total;\n\n\t\t\t// get Transaction Id\n\t\t\t$transactions = $result->getTransactions();\n\t\t\t$related_resources = $transactions[0]->getRelatedResources();\n\t\t\t$sale = $related_resources[0]->getSale();\n\t\t\t$get_transaction_fee = $sale->getTransactionFee();\n\t\t\t$sale_id = $sale->getId();\n\n\n\t\t\tif(!empty($result) && $result->state == 'approved'){\n\n\t\t\t\trequire_once 'orders.php';\n\t\t\t\t$data_order = (object)array(\n\t\t\t\t\t'payment_type' => $this->payment_type,\n\t\t\t\t\t'amount' => $amount,\n\t\t\t\t\t'txt_id' => $sale_id,\n\t\t\t\t\t'transaction_fee' => $get_transaction_fee->getValue(),\n\t\t\t\t\t'order_details' => session('order_details'),\n\t\t\t\t);\n\t\t\t\tunset_session('order_details');\n\t\t\t\tunset_session('paypal_payment_id');\t\n\t\t\t\t$order = new orders();\n\t\t\t\tif(!$order->save_order($data_order)){\n\t\t\t\t\tredirect(cn(\"checkout/unsuccess\"));\n\t\t\t\t};\n\t\t\t\t/*---------- Add funds to user balance ----------*/\n\t\t\t\tredirect(cn(\"checkout/success\"));\n\t\t\t}else{\n\t\t\t\tredirect(cn(\"checkout/unsuccess\"));\n\t\t\t}\n\n\t\t}else{\n\t\t\tredirect(cn(\"checkout/unsuccess\"));\n\t\t}\n\t}", "public function handle()\n {\n $status = Status::where('slug', 'inprocessing')->orWhere('slug', 'pending')->where('group', 'payments')->pluck('id');\n\n $this->info($status);\n\n Payment::whereIn('status_id', $status)->latest()->get()\n ->each(function ($item, $key){\n\n $merchangeAccount = 'main_zrobleno_com_ua';\n $dataString = $merchangeAccount.\";\".$item->order_reference;\n\n $encryptKey = 'b4e6d63112a7f44df282a2921dc08ab4ab14b18f';\n $merchangeSignature = hash_hmac(\"md5\", $dataString, $encryptKey);\n\n\n $response = Http::post('https://api.wayforpay.com/api', [\n 'transactionType' => 'CHECK_STATUS',\n 'merchantAccount' => $merchangeAccount,\n 'orderReference' => $item->order_reference,\n 'merchantSignature' => $merchangeSignature,\n 'apiVersion' => 1\n ]);\n\n $response = $response->json();\n \n $this->log('CheckPaymentStatus $response', $response);\n\n $statusString = strtolower($response['transactionStatus'] ?? '');\n $this->info($statusString);\n\n $status = PaymentStatus::slug($statusString)->first();\n if($status) {\n if( $status->slug === 'approved') {\n $account = Account::find($item->account_id);\n $newBalance = $account->balance + $item->value;\n $account->update(['balance' => $newBalance]);\n\n $user = User::find($account->user_id)->first();\n }\n\n $item->update(['status_id' => $status->id]);\n\n// $this->info(json_encode($response));\n }\n\n });\n }", "public function postProcess() {\n \n $this->_verifyPaymentOptionAvailability();\n $this->_validateCart();\n $this->_generatePagSeguroRequestData();\n $additional_infos = $this->_validateOrder();\n $this->_setAdditionalRequestData($additional_infos);\n $this->_setNotificationUrl();\n $this->_performPagSeguroRequest();\n \n }", "public function paymentResult(PaymentResultRequest $request)\n { \n $amount = $request->amount;\n $tran = $request->tran;\n //mac dinh thanh cong\n $status = PaymentStatus::SUCCESS;\n $error = '';\n \n $inputData = file_get_contents('php://input');\n $this->_log('paymentResult $inputData:'. $inputData);\n\n $this->save_payment_result($request->tran->id, $inputData);\n\n\n //thông tin đơn hàng\n $invoice_order = $request->tran->invoice->invoice_orders[0];\n if(!$invoice_order)\n {\n $this->_log('Empty invoice order');\n $status = PaymentStatus::FAILED;\n return $this->_ouput($request, $status, $error);\n }\n \n if(!$inputData || $inputData == '{\"type\":\"ping\"}') {\n $status = PaymentStatus::NONE;\n return $this->_ouput($request, $status, $error);\n }\n \n $payResponse = json_decode($inputData);\n if(!$payResponse) {\n $status = PaymentStatus::NONE;\n return $this->_ouput($request, $status, $error);\n }\n\n //return NULL;\n if (!isset($payResponse->data)) {\n $status = PaymentStatus::FAILED;\n\t return $this->_ouput($request, $status, $error);\n }\n \n $reponse = $payResponse->data;\n // Kiem tra amount\n $amount_pay = $reponse->amount_received;\n if (fv($amount_pay) < fv($amount)) {\n \n $status = PaymentStatus::FAILED;\n\t $error = lang('error_payment_amount_invalid');\n\t return $this->_ouput($request, $status, $error, $reponse);\n }\n \n // Kiem tra dia chi nhan\n $receive_address= $invoice_order->btc_address;\n $address = $reponse->address;\n if ($address != $receive_address) \n {\n $status = PaymentStatus::FAILED;\n $error = lang('error_payment_btc_address_invalid', $address);\n return $this->_ouput($request, $status, $error, $reponse);\n }\n \n // Kiem tra confirmations (la so lan ma blockio da confirm thuong la >4 lan )\n $confirmations = (int)$reponse->confirmations;\n if ($confirmations < $this->setting('confirmations')) \n {\n $status = PaymentStatus::NONE;\n $error = lang('error_payment_confirmations_invalid', $confirmations);\n return $this->_ouput($request, $status, $error, $reponse);\n }\n\n //neu thanh cong\n return $this->_ouput($request, $status, $error, $reponse);\n }", "function hook_commerce_adyen_notification($event_code, \\stdClass $order, \\stdClass $data) {\n switch ($event_code) {\n case \\Commerce\\Adyen\\Payment\\Notification::CANCELLATION:\n $transaction = commerce_adyen_get_transaction_instance('payment', $order);\n $transaction->setStatus(COMMERCE_PAYMENT_STATUS_FAILURE);\n $transaction->save();\n\n commerce_order_status_update($order, 'canceled');\n break;\n }\n}", "public function process_payment(){\n if($this->input->server('REQUEST_METHOD') == 'POST') {\n \n // Get all field values.\n $form_fields = $this->input->post(NULL);\n \n //Set Requiered parameter to be pass to merchant payment process\n $parameter = array(\n 'schedule_id' => $form_fields['schedule_id'],\n 'exception_id' => $form_fields['exception_id'],\n 'school_id' => $form_fields['school_id'],\n 'percentage' => $form_fields['percentage'],\n 'schedule_type' => $form_fields['schedule_type'],\n 'session_name' => $form_fields['session_name'],\n 'session_id' => $form_fields['session_id'],\n 'penalty' => $form_fields['penalty'],\n 'user_id' => $form_fields['user_id'],\n 'amount' => $form_fields['amount'],\n 'revenue_head' => $form_fields['revhead']\n );\n \n //initiate pay process : Send the parameter to pay merchant\n $this->pay->process($parameter);\n \n \n }else{\n \n //Set error message for any request other than POST\n $error_msg = $this->lang->line('invalid_req_method'); \n $this->main->set_notification_message(MSG_TYPE_ERROR, $error_msg);\n \n // Redirect to payment set, showing notifiction messages if there are.\n redirect(site_url('payment/myschedule'));\n } \n \n }", "function _process($data)\n {\t\t\n\t\t$post = JFactory::getApplication()->input->get($_POST);\n \t\n \t$orderpayment_id = @$data['ssl_invoice_number'];\n \t\n \t$errors = array();\n \t$send_email = false;\n \t\n \t// load the orderpayment record and set some values\n JTable::addIncludePath( JPATH_ADMINISTRATOR.'/components/com_tienda/tables' );\n $orderpayment = JTable::getInstance('OrderPayments', 'TiendaTable');\n $orderpayment->load( $orderpayment_id );\n if (empty($orderpayment_id) || empty($orderpayment->orderpayment_id))\n {\n $errors[] = JText::_('VIRTUALMERCHANT MESSAGE INVALID ORDERPAYMENTID');\n return count($errors) ? implode(\"\\n\", $errors) : '';\n }\n $orderpayment->transaction_details = $data['ssl_result_message'];\n $orderpayment->transaction_id = $data['ssl_txn_id'];\n $orderpayment->transaction_status = $data['ssl_result'];\n \n // check the stored amount against the payment amount \n \tTienda::load( 'TiendaHelperBase', 'helpers._base' );\n $stored_amount = TiendaHelperBase::number( $orderpayment->get('orderpayment_amount'), array( 'thousands'=>'' ) );\n $respond_amount = TiendaHelperBase::number( $data['ssl_amount'], array( 'thousands'=>'' ) );\n if ($stored_amount != $respond_amount ) {\n \t$errors[] = JText::_('VIRTUALMERCHANT MESSAGE AMOUNT INVALID');\n \t$errors[] = $stored_amount . \" != \" . $respond_amount;\n }\n \n // set the order's new status and update quantities if necessary\n Tienda::load( 'TiendaHelperOrder', 'helpers.order' );\n Tienda::load( 'TiendaHelperCarts', 'helpers.carts' );\n $order = JTable::getInstance('Orders', 'TiendaTable');\n $order->load( $orderpayment->order_id );\n if (count($errors)) \n {\n // if an error occurred \n $order->order_state_id = $this->params->get('failed_order_state', '10'); // FAILED\n }\n\t\telse\n {\n $order->order_state_id = $this->params->get('payment_received_order_state', '17');; // PAYMENT RECEIVED\n\n // do post payment actions\n $setOrderPaymentReceived = true;\n \n // send email\n $send_email = true;\n }\n\n // save the order\n if (!$order->save())\n {\n \t$errors[] = $order->getError();\n }\n \n // save the orderpayment\n if (!$orderpayment->save())\n {\n \t$errors[] = $orderpayment->getError(); \n }\n \n if (!empty($setOrderPaymentReceived))\n {\n $this->setOrderPaymentReceived( $orderpayment->order_id );\n }\n \n if ($send_email)\n {\n // send notice of new order\n Tienda::load( \"TiendaHelperBase\", 'helpers._base' );\n $helper = TiendaHelperBase::getInstance('Email');\n $model = Tienda::getClass(\"TiendaModelOrders\", \"models.orders\");\n $model->setId( $orderpayment->order_id );\n $order = $model->getItem();\n $helper->sendEmailNotices($order, 'new_order');\n }\n\n return count($errors) ? implode(\"\\n\", $errors) : ''; \n\n \treturn true;\n }", "public function process_payment( $order_id ) {\n\n\t\t\t\t$order = wc_get_order( $order_id );\n\t\t\t\t$phone = $this->sanatizePhone( $_POST['havanao_phone_number'] );\n\t\t\t\t$timestamp = date( 'Ymdhis' );\n\n\t\t\t\t// Do transaction push to customer\n\t\t\t\t$data = [\n\t\t\t\t\t'customer' => $phone,\n\t\t\t\t\t'amount' => (int) $order->get_total(),\n\t\t\t\t\t'transactionid' => implode(\"-\", str_split(strtoupper(uniqid('WCTXN')), 4)). '-'.$order_id,\n\t\t\t\t\t'comment' => __('Payment for order number ') . $order_id,\n\t\t\t\t\t'callback_url' => add_query_arg( 'order-id', $order_id, $this->callBackURL ),\n\t\t\t\t];\n\n\t\t\t\t// Add Authentication to the URL \n\t\t\t\t$this->gateway_url = $this->gateway_url.'?api_token=' . $this->havanao_api_key;\n\t\t\n\n\t\t\t\t$response = wp_remote_post(\n\t\t\t\t\t$this->gateway_url, \n\t\t\t\t\t['body' => json_encode( $data ),'timeout' => 45 ]\n\t\t\t\t);\n\t\t\t \t\n\t\t\t // ONLY LOG ON TEST ENABLED\n\t\t\t if( 'yes' == $this->get_option( 'test_enabled' ) ) {\n\t\t\t\t\t$order->add_order_note(json_encode( $data ));\n\t\t\t\t\t$order->add_order_note($this->gateway_url);\n\t\t\t\t}\n\t\t\t\t// Log request and response to havanao\n\t\t\t\tif ( ! is_wp_error( $response ) ) {\n\t\t\t\t\t\n\t\t\t\t\t$order->add_order_note($response['body']);\n\t\t\t\t\t\n\t\t\t\t\t$response = json_decode( $response['body'] );\n\n\t\t\t\t\tif ( isset( $response->code ) && '200' == $response->code ) {\n\t\t\t\t\t\t// Mark as on-hold (we're awaiting the havanao payment)\n\t\t\t\t\t\t$order->update_status( $this->get_option( 'pending_payment_status' ), __( 'Awaiting havanao payment.', 'havanao' ) );\n\n\t\t\t\t\t\t// Reduce stock levels\n\t\t\t\t\t\twc_reduce_stock_levels( $order_id );\n\n\t\t\t\t\t\t// Remove cart\n\t\t\t\t\t\tWC()->cart->empty_cart();\n\n\t\t\t\t\t\t// Return thankyou redirect\n\t\t\t\t\t\treturn array(\n\t\t\t\t\t\t\t'result' => 'success',\n\t\t\t\t\t\t\t'redirect' => $this->get_return_url( $order ),\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\twc_add_notice( __( 'There was an error making the payment.', 'havanao' ), 'error' );\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t // Only Log when test mode is enabled\n\t\t\t\t if( 'yes' == $this->get_option( 'test_enabled' ) ) {\n\t\t\t\t \t$order->add_order_note($this->gateway_url);\n\t\t\t\t\t\t// Add error to the note\n\t\t\t\t\t\t$order->add_order_note($response->get_error_message(),'error');\n\t\t\t\t }\n\t\t\t\t\t\n\t\t\t\t\twc_add_notice( __( 'There was an error making the payment. Please try again.', 'havanao' ), 'error' );\n\t\t\t\t\t$order->update_status( $this->get_option( 'errored_payment_status' ), __( 'There was an error making the payment.', 'havanao' ) );\n\t\t\t\t\t// return;\n\t\t\t\t}\n\n\n\t\t\t\t// Return thankyou redirect\n\t\t\t\treturn array(\n\t\t\t\t\t'result' => 'success',\n\t\t\t\t\t'redirect' => $this->get_return_url( $order ),\n\t\t\t\t);\n\t\t\t}", "public function handleGatewayCallback()\n {\n $paystack = new Paystack();\n $paymentDetails = $paystack->getPaymentData();\n\n $email = $paymentDetails['data']['customer']['email'];\n if ($paymentDetails['message'] == \"Verification successful\") {\n $user = User::where('email', $email)->first();\n\n if ($user) {\n $user->premium_user = true;\n $user->save();\n return response()->json($user, 200);\n }\n }\n\n // Now you have the payment details,\n // you can store the authorization_code in your db to allow for recurrent subscriptions\n // you can then redirect or do whatever you want\n }", "public function Success(Request $request){\n $trnsId=\t$request->transId;\n if(!empty($trnsId)){\n $irrigation_payment = IrrigationPayment::where('transaction_no', $trnsId)->first();\n if ($irrigation_payment && $irrigation_payment->status == 1) {\n\n DB::beginTransaction();\n\n $irrigation_payment->status = 2;\n $irrigation_payment->pay_status = 'success';\n $irrigation_payment->update();\n\n\n $this->pumpOptPaymentSuccess($irrigation_payment);\n $this->smartCardPaymentSuccess($irrigation_payment);\n $this->waterTestingPaymentSuccess($irrigation_payment);\n\n DB::commit();\n return response([\n 'success' => true,\n 'message' => 'Payment paid successfully.'\n ]);\n } else {\n DB::rollback();\n return response([\n 'success' => false,\n 'message' => 'Invalid Transaction Number.'\n ]);\n }\n }\n }", "protected function amount_transition_status() {\n\t\t$amount_transition_status = $this->amount_transition_status ;\n\n\t\t// Reset status transition variable.\n\t\t$this->amount_transition_status = false ;\n\n\t\tif ( ! $amount_transition_status ) {\n\t\t\treturn ;\n\t\t}\n\n\t\tdo_action( 'wc_cs_admin_funds_txn_amount_status_' . $amount_transition_status, $this ) ;\n\t}" ]
[ "0.7246488", "0.710137", "0.7083715", "0.70771575", "0.6995198", "0.69459534", "0.6883255", "0.6849654", "0.6816678", "0.67923343", "0.6740759", "0.6598025", "0.6569707", "0.6548487", "0.6540716", "0.65167886", "0.6512809", "0.650607", "0.6503937", "0.6467046", "0.642772", "0.6377646", "0.6356322", "0.6354786", "0.62927747", "0.6282208", "0.6280515", "0.62723744", "0.6263328", "0.62601596", "0.62461466", "0.62413406", "0.62357175", "0.6235628", "0.620793", "0.620793", "0.6201167", "0.6196015", "0.6194074", "0.61850303", "0.61771077", "0.6176937", "0.6176197", "0.6174027", "0.61655736", "0.61649954", "0.6159047", "0.6155017", "0.61506665", "0.61495125", "0.613685", "0.6130093", "0.61251503", "0.60948384", "0.6084441", "0.6074277", "0.6055442", "0.60407454", "0.60395163", "0.6038078", "0.603198", "0.60254073", "0.60093606", "0.60052705", "0.60050917", "0.59992737", "0.5997173", "0.5996069", "0.59944516", "0.5993509", "0.59841406", "0.5983823", "0.5972601", "0.59724975", "0.5971315", "0.5950687", "0.5950529", "0.59492207", "0.5948289", "0.59475756", "0.5944761", "0.59384996", "0.5935357", "0.5933104", "0.59288913", "0.5926762", "0.59241825", "0.5923535", "0.5913645", "0.5908018", "0.58973587", "0.5896892", "0.58965856", "0.58953637", "0.589303", "0.58911574", "0.58909255", "0.588793", "0.5887483", "0.5873415", "0.586901" ]
0.0
-1
Run the database seeds.
public function run() { // $regionals = [ 'DKI Jakarta' => ['Central Jakarta', 'South Jakarta'], 'West Java' => ['Bandung'], ]; foreach ($regionals as $province => $districts) { foreach ($districts as $district) { $regional = Regional::create([ 'province' => $province, 'district' => $district, ]); $this->createSpot($regional); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
don't include it when running from scripts / SEND SMS
function send_sms($to, $message) { LOG_MSG('INFO',"send_sms(): START to=[$to]"); // Retrieve SMS Gateway Details $smsgateway_resp=db_lib_smsgateway_select(); if ( $smsgateway_resp[0]['STATUS'] != 'OK' ) { LOG_MSG('ERROR',"send_sms(): Error loading sms gateway"); } // Send SMS only if Gateway is found if ( $smsgateway_resp[0]['NROWS'] == 1 ) { $plain_message=$message; $smsgateway_id=$smsgateway_resp[0]['smsgateway_id']; $status='FAILED'; $username=$smsgateway_resp[0]['username']; $password=$smsgateway_resp[0]['password']; $api_key=$smsgateway_resp[0]['api_key']; $default_sender_id=$smsgateway_resp[0]['default_sender_id']; $to=urlencode($to); $message=urlencode($message); $gateway_url=$smsgateway_resp[0]['gateway_url']; // Generate the URL base on the provider if ( $smsgateway_resp[0]['name'] == 'SolutionsInfini' ) { // http://alerts.sinfini.com/api/web2sms.php?workingkey=##API_KEY##&sender=##DEFAULT_SENDER_ID##&to=##MOBILE_TO##&message=##MESSAGE## $search=array('##API_KEY##', '##DEFAULT_SENDER_ID##', '##MOBILE_TO##', '##MESSAGE##'); $replace=array($api_key, $default_sender_id, $to, $message); $url=str_replace($search,$replace,$gateway_url); } elseif ( $smsgateway_resp[0]['name'] == 'SMSGupshup' ) { // http://enterprise.smsgupshup.com/GatewayAPI/rest?method=SendMessage&send_to=##MOBILE_TO##&msg=##MESSAGE##&msg_type=TEXT&userid=##USERNAME##&auth_scheme=plain&password=##PASSWORD##&v=1.1&format=text $search=array('##USERNAME##', '##PASSWORD##', '##MOBILE_TO##', '##MESSAGE##'); $replace=array($username, $password, $to, $message); $url=str_replace($search,$replace,$gateway_url); } // Send SMS $ch=curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response=curl_exec($ch); curl_close($ch); if ( strpos($response,'GID') ) $status='SUCCESS'; LOG_MSG('INFO',"send_sms(): $response"); // Add SMS Sent Details $smssent_resp=db_smssent_insert( $smsgateway_id, $default_sender_id, $to, $plain_message, $url, $response, $status); if ( $smssent_resp['STATUS'] != 'OK' ) { LOG_MSG('ERROR',"send_sms(): Error while inserting in SMSSent talble from=[$from] to=[$to]"); } } LOG_MSG('INFO',"send_sms(): END"); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testShouldAllowToSendSms()\n\t {\n\t\tdefine(\"GNOKII_COMMAND\", \"sh \" . __DIR__ . \"/mock/mock.sh\");\n\t\tdefine(\"SMSC_NUMBER\", \"+79043490000\");\n\n\t\t$sender = new PhpGnokii();\n\t\t$this->assertTrue($sender->send(\"+79526191914\", \"test\"));\n\t }", "function schedulesms() {\n \t\t\n \t\tConfigure::write('debug', 0);\n \t\t\n \t\t$this->send(true, $_REQUEST['message'], $_REQUEST['mobile'], $_REQUEST['skey'], $_REQUEST['senderid'], \n \t\t\t\t\t\t\t$_REQUEST['group'], $_REQUEST['tag'], $_REQUEST['date'], $_REQUEST['response']);\n \t\t\n \t}", "function send_sms()\n\t{\n\t\t$config['functions']['send_sms'] = array('function' => 'Xmlrpc.rpc_send_sms');\n\t\t$this->xmlrpcs->initialize($config);\n\t\t$this->xmlrpcs->serve();\n\t}", "public function sms(){\n//\t$this->coreApp();\n}", "function _sms($alarm)\n {\n }", "function send($sendnow=false, $skey=null, $mess=null, $recipient=null, $senderid=null, $widget=false) {\r\n \t\t$sendnow = (boolean)$sendnow;\r\n \t\t$widget = (boolean)$widget;\r\n \t\t\r\n \t\t//echo $sendnow.'-'.$skey.'-'.$mess.'-'.$recipient.'-'.$senderid;exit;\r\n \t\t//pr($_REQUEST); exit;\r\n\t\t\r\n\n\t\t$this->write(date('Y-m-d H:i:s') .' :: '. $_SERVER['REMOTE_ADDR']);\n\n \t\tif(!$sendnow) {\r\n\r\n \t\t\t$skey = urldecode(trim($_REQUEST['skey']));\r\n\t \t\t$mess = urldecode(trim($_REQUEST['message']));\r\n\t \t\t$recipient = filter_var(urldecode(trim($_REQUEST['recipient'])), FILTER_SANITIZE_STRING);\r\n\t \t\t\r\n\t \t\t// Sender ID is optional\r\n\t \t\tif(isset($_REQUEST['senderid'])) $senderid = filter_var(urldecode(trim($_REQUEST['senderid'])),FILTER_SANITIZE_STRING);\r\n\t \t\telse $senderid = '';\r\n\t \t\t\r\n\t \t\t// Response is optional\r\n\t \t\tif(isset($_REQUEST['response'])) $response_format = trim($_REQUEST['response']);\r\n\t \t\telse $response_format = 'xml';\r\n\t \t\t\r\n \t\t}\r\n\r\n \t\t/* url decode the message if coming from widget\t*/\r\n \t\tif($widget) {\r\n \t\t\t$mess = urldecode($mess);\r\n \t\t}\r\n \t\t\r\n \t\tif(FREE_SMS_SERVER_DOWN) {\r\n\r\n \t\t\tif(!$sendnow) $this->_throwError($this->_errorMsgEnvelope($this->_errorMsg($sendnow, UNAVAILABLE_MESSAGE)), $response_format);\r\n \t\t\telse return UNAVAILABLE_MESSAGE;\r\n \t\t\t\r\n \t\t}\r\n \t\t\r\n \t\tif(NINE_TO_NINE_ACTIVATED) {\r\n\r\n \t\t\tif(!$sendnow) $this->_throwError($this->_errorMsgEnvelope($this->_errorMsg($sendnow, NINE_TO_NINE_ACTIVATED_MESSAGE)), $response_format);\r\n \t\t\telse return NINE_TO_NINE_ACTIVATED_MESSAGE;\r\n \t\t\t\r\n \t\t}\r\n \t\t\r\n \t\t/*\tGet Remote Address\t*/\r\n\t\t$remote_addr = $this->getRemoteAddr();\r\n\t\t\r\n\t\t/*\tGet Client IP is available (from widget)*/\r\n\t\t$client_ip = 0;\r\n\t\tif(isset($_REQUEST['client_ip']) && !empty($_REQUEST['client_ip']))\r\n\t\t\t$client_ip = $_REQUEST['client_ip'];\r\n\t\t\r\n \t\t/*\tCorrect Encoding\t*/\r\n \t\t$mess = iconv('UTF-8', 'ASCII//TRANSLIT', $mess);\r\n \t\t\r\n \t\t$original_message = $mess;\r\n \t\t\r\n \t\t/*\tConvert newlines to spaces\t*/\r\n \t\t$mess = str_replace(\"\\r\\n\", \"\\n\", $mess);\r\n \t\t\r\n \t\t$output = '';\r\n \t\t\r\n \t\tif(!$skey || !$mess || !$recipient) {\r\n \t\t\t\r\n \t\t\t$return_message = 'One or more parameters are missing';\r\n \t\t\t$output = $this->_errorMsgEnvelope($this->_errorMsg($sendnow, $return_message));\r\n \t\t\t\r\n \t\t\tif(!$sendnow) $this->_throwError($output, $response_format); \r\n \t\t\telse return $return_message;\r\n \t\t\t\r\n \t\t}\r\n \t\t\r\n \t\t$domain = $this->checkSecretKey($skey);\r\n \t\t//pr($domain);exit;\r\n \t\tif($domain) {\r\n \t\t\t\r\n \t\t\t$domain_id = $domain['0'];\r\n \t\t\t$from = $domain_name = $domain['1'];\r\n \t\t\t$plan_id = $domain['2'];\r\n \t\t\t$server = $domain['3'];\r\n \t\t\t$ip = $domain['4'];\r\n \t\t\t$category_id = $domain['5'];\r\n \t\t\t$verify = $domain['6'];\r\n \t\t\t$per_day_limit = $domain['7'];\r\n \t\t\t$user_id = $domain['8'];\r\n \t\t\t$widget_restriction_on_user = $domain['9'];\r\n \t\t\t\r\n \t\t\t/*\tSMS's are accepted only from widgets */\r\n \t\t\tif(!$sendnow && $widget_restriction_on_user) {\r\n \t\t\t\t\r\n \t\t\t\t$return_message = 'Use of API is suspended from your account. Instead use SMS WIDGET';\r\n\t \t\t\t$output = $this->_errorMsgEnvelope($this->_errorMsg($sendnow, $return_message));\r\n\t \t\t\t\r\n\t\t\t\tif(!$sendnow) $this->_throwError($output, $response_format); \r\n\t \t\t\telse return $return_message;\r\n\t \t\t\t\r\n \t\t\t}\r\n \t\t\r\n\t\t\t/*\tCheck for Spam\t*/\r\n\t\t\tif($this->checkIfSpam($mess)) {\r\n\t\t\t\t\r\n\t\t\t\t/*\tAdd to spam table\t*/\r\n\t\t\t\t$this->markAsSpam($recipient, $mess, $domain_id, $remote_addr, $client_ip);\r\n\t\t\t\t\r\n\t\t\t\t$return_message = 'Spam and Abusive messages are strictly prohibited';\r\n\t \t\t\t$output = $this->_errorMsgEnvelope($this->_errorMsg($sendnow, $return_message));\r\n\t \t\t\t\r\n\t\t\t\tif(!$sendnow) $this->_throwError($output, $response_format); \r\n\t \t\t\telse return $return_message;\r\n\t\t\t}\r\n\r\n\t\t\t/*\tAdd freesmsapi footer */\r\n\t\t\t$mess = $this->charLimit($mess);\r\n\t\t\t$mess = $mess . FREE_SMS_FOOTER;\r\n\t\t\t\r\n \t\t\t/* check if suspended\t*/\r\n \t\t\t$terminate = $this->checkUserSuspended($user_id);\r\n\t\t\tif(!empty($terminate)) {\r\n\t\t\t\t$return_message = $terminate;\r\n\t\t\t\t$output = $this->_errorMsgEnvelope($this->_errorMsg($sendnow, $return_message));\r\n\t \t\t\t\r\n\t\t\t\tif(!$sendnow) $this->_throwError($output, $response_format); \r\n\t \t\t\telse return $return_message;\r\n\t\t\t}\r\n \t\t\t\r\n \t\t\t/*\tGet sms vendor details\t*/\r\n \t\t\t$this->getSmsVendor($domain_id);\r\n \t\t\t//pr($this->sms_vendor_details);\r\n \t\t\t\r\n \t\t\tif(!$sendnow && NOW > VERIFY_START_DATE && !$verify) {\r\n\r\n \t\t\t\t/*\tCheck if Sender ID is purchased or not, \r\n\t\t \t\t * if purchased then dont show verify mobile number box\r\n\t\t \t\t*/\r\n \t\t\t\tif(!$this->get_alias($domain_id)) {\r\n\r\n\t \t\t\t\t$return_message = 'Please verify your Mobile Number to enjoy Uninterrupted Service';\r\n\t \t\t\t\t$output = $this->_errorMsgEnvelope($this->_errorMsg($sendnow, $return_message));\r\n\t \t\t\t\t\r\n\t \t\t\t\tif(!$sendnow) $this->_throwError($output, $response_format); \r\n\t \t\t\t\telse return $return_message;\r\n\t\t\t \t\r\n\t\t\t \t} /*else if(!$this->check_alias_purchase($domain_id)) {\r\n\r\n\t \t\t\t\t$output .= '<error><message>Please verify your Mobile Number to enjoy Uninterrupted Service.</message></error>';\r\n\t \t\t\t\t$this->_throwError($output, $response_format);\r\n\t\t\t \t\r\n\t\t\t \t}*/\r\n \t\t\t\t\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\t// Check sub - domain\r\n \t\t\tif(!IS_TEST_SERVER && SUBDOMAIN_LOCK) {\r\n \t\t\t\t\r\n \t\t\t\tif(!$sendnow && $_SERVER['SERVER_NAME'] != $server.'.'.SERVERNAME) {\r\n\t \t\t\t\t$return_message = 'Invalid Sub-domain';\r\n\t \t\t\t\t$output = $this->_errorMsgEnvelope($this->_errorMsg($sendnow, $return_message));\r\n\t \t\t\t\t\r\n\t \t\t\t\tif(!$sendnow) $this->_throwError($output, $response_format); \r\n\t \t\t\t\telse return $return_message;\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\t\r\n \t\t\t// Check IP\r\n \t\t\tif(!IS_TEST_SERVER && IP_LOCK) {\r\n\r\n \t\t\t\t // for new widget || for old too\r\n \t\t\t\tif(($sendnow && $widget) || (!$sendnow)) {\n \r\n \t\t\t\t\tif(!ip2long($ip)) $return_message = 'Invalid IP Address';\r\n\t \t\t\t\telse if($remote_addr != $ip) {\r\n\t \t\t\t\t\tunset($cond);\r\n\t \t\t\t\t\t$cond['conditions']['DomainIp.domain_id'] = $domain_id;\r\n\t \t\t\t\t\t$cond['conditions']['DomainIp.ip'] = ip2long($remote_addr);\r\n\t \t\t\t\t\t$cond['conditions']['DomainIp.status'] = 0;\r\n\t \t\t\t\t\tif($this->DomainIp->find('count', $cond) == 0) {\r\n\t \t\t\t\t\t\t//if(!$this->traceroute($remote_addr, $ip, $domain_id)) {\r\n\t \t\t\t\t\t\t\t//$return_message = 'Invalid IP Address, SMS\\'s are accepted only from the IP Address '.$ip;\r\n\t \t\t\t\t\t\t\t$return_message = 'Invalid Domain, Requests are accepted only from the domain \"'.$domain_name.'\" with an IP Address '.$ip;\r\n\t \t\t\t\t\t\t\t//$return_message = '';\r\n\t \t\t\t\t\t\t//}\t\r\n\t \t\t\t\t\t}\r\n\t \t\t\t\t}\r\n\t \t\t\t\t\n\t\t\t\t\tif(isset($return_message)) {\n\t\r\n\t \t\t\t\t\t$output = $this->_errorMsgEnvelope($this->_errorMsg($sendnow, $return_message));\r\n\t \t\t\t\t\r\n\t\t \t\t\t\tif(!$sendnow) $this->_throwError($output, $response_format); \r\n\t\t \t\t\t\telse return $return_message;\n\t\t\t\t\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n \t\t\t\t}\r\n \t\t\t\t\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\t\r\n \t\t\t// check total number of messages send today and exit if limit exceeded\r\n \t\t\t$this->Message->setSource($server.'_log');\r\n \t\t\t$message_count = $this->Message->find('count', array('conditions'=>array('created'=>date('Y-m-d'), 'domain_id'=>$domain_id)));\r\n \t\t\t\r\n \t\t\t/*$condition['conditions']['id'] = $plan_id;\r\n \t\t\t$condition['fields'] = array('sms', 'interval');\r\n \t\t\t$allowed = $this->Plan->find('all', $condition);\r\n \t\t\t$per_day_limit = $allowed['0']['Plan']['sms'];*/\r\n \t\t\t\r\n \t\t\tif($message_count >= $per_day_limit) {\r\n \t\t\t\t\r\n \t\t\t\t$return_message = 'Your daily sms limit has reached ('.$per_day_limit.' SMS)';\r\n \t\t\t\t$output = $this->_errorMsgEnvelope($this->_errorMsg($sendnow, $return_message));\r\n \t\t\t\t\r\n \t\t\t\tif(!$sendnow) $this->_throwError($output, $response_format); \r\n \t\t\t\telse return $return_message;\r\n \t\t\t\t\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\t$mobile_number = explode(',', $recipient);\r\n \t\t\t$invalid_mobile = '';\r\n \t\t\t$success = '';\r\n \t\t\t$failed = '';\r\n \t\t\t\r\n \t\t\t\r\n \t\t\t//should not be more than 50 in single request\r\n \t\t\t$allowed_recipient = MAX_RECIPIENT;\r\n \t\t\tif(count($mobile_number) > $allowed_recipient) {\r\n \t\t\t\t\r\n \t\t\t\t$return_message = 'You are tyring to send SMS to '.count($mobile_number).' recipients, While max recipient limit is '.MAX_RECIPIENT.'. Please rectify the above error and then try again';\r\n \t\t\t\t$output = $this->_errorMsgEnvelope($this->_errorMsg($sendnow, $return_message));\r\n \t\t\t\t\r\n \t\t\t\tif(!$sendnow) $this->_throwError($output, $response_format);\r\n \t\t\t\telse return $return_message;\r\n \t\t\t\t\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\t\r\n \t\t\t//should not be more than 100 in single request\r\n \t\t\t/*$allowed_recipient = MAX_RECIPIENT;\r\n \t\t\tif(count($mobile_number) > $allowed_recipient) {\r\n \t\t\t\t$tmp = array_slice($mobile_number, 0, $allowed_recipient);\r\n \t\t\t\t\r\n \t\t\t\tfor($i=count($tmp); $i<count($mobile_number); $i++)\r\n \t\t\t\t\t$maxlimitreached[] = $mobile_number[$i];\r\n \t\t\t\t\r\n \t\t\t\t$mobile_number = $tmp;\r\n \t\t\t}*/\r\n \t\t\t\r\n \t\t\t\r\n \t\t\t/*\tShould be reduced to $per_day_limit\t*/\r\n \t\t\t$big_count = $message_count + count($mobile_number);\r\n \t\t\tif($big_count > $per_day_limit) {\r\n \t\t\t\t\r\n \t\t\t\t$reduce_to = $big_count - $per_day_limit;\r\n \t\t\t\t$reduce_to = count($mobile_number) - $reduce_to;\r\n \t\t\t\t$mobile_number = array_slice($mobile_number, 0, $reduce_to);\r\n \t\t\t\t\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\t/*if(!ONLY_DEVELOPER_SECTION) {\r\n\t \t\t\t//get advertisement related to category\r\n\t \t\t\t//$adv_cond['conditions'] = array('adv_send != quantity');\r\n\t \t\t\t$adv_cond['conditions']['status'] = '0';\r\n\t \t\t\t$adv_cond['conditions']['category_id'] = $category_id;\r\n\t \t\t\t$adv_cond['conditions']['launch_date'] = date('Y-m-d');\r\n\t \t\t\t$adv_cond['conditions']['0'] = 'adv_send <> quantity';\r\n\t \t\t\t$adv_cond['fields'] = array('id', 'content', 'adv_send', 'quantity');\r\n\t \t\t\t$this->AdvContent->unbindAll();\r\n\t \t\t\t$content = $this->AdvContent->find('all', $adv_cond);\r\n\t\r\n\t \t\t\t//add advertisement to message\r\n\t \t\t\tif(!empty($content)) {\r\n\t \t\t\t\t\r\n\t \t\t\t\t$p = 0;\r\n\t \t\t\t\t$content_present = true;\r\n\t \t\t\t\tforeach($content as $c) {\r\n\t \t\t\t\t\t$content_data[$p]['id'] = $c['AdvContent']['id'];\r\n\t \t\t\t\t\t$content_data[$p]['content'] = $c['AdvContent']['content'];\r\n\t \t\t\t\t\t$content_data[$p]['actual'] = $c['AdvContent']['quantity'];\r\n\t \t\t\t\t\t$content_data[$p]['remaining'] = $c['AdvContent']['quantity'] - $c['AdvContent']['adv_send'];\r\n\t \t\t\t\t\t$p++;\r\n\t \t\t\t\t}\r\n\t \t\t\t\t\r\n\t \t\t\t} else $content_present = false;\r\n \t\t\t}*/\r\n \t\t\t\r\n \t\t\t$p = 0;\r\n \t\t\t\t\t\t\r\n\t\t\t/*\tGet senderid */\r\n \t\t\tif(SHOW_SENDER_ID) {\r\n\t \t\t\tif(!$senderid) $senderid = SMS_SENDER_ID;\r\n\t\t\t\telse {\r\n\t\t\t\t\t$val['Alias.domain_id'] = $domain_id;\r\n\t\t\t\t\t$val['Alias.name'] = $senderid;\r\n\t\t\t\t\t$val['Alias.publish'] = '1';\r\n\t\t\t\t\t$val['Alias.status'] = '0';\r\n\t\t\t\t\t$this->Alias->unBindAll();\r\n\t\t\t\t\tif($this->Alias->find('count', array('conditions'=>$val)) == 0) $senderid = SMS_SENDER_ID;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n \t\t\t\t$senderid = SMS_SENDER_ID;\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\t$mobile_number = array_filter($mobile_number);\r\n \t\t\t\r\n \t\t\tforeach($mobile_number as $v) {\r\n \t\t\t\t$to = filter_var($v, FILTER_SANITIZE_NUMBER_INT);\r\n \t\t\t\t$to = trim($to);\r\n \t\t\t\t\r\n \t\t\t\t//check if mobile number is valid\r\n \t\t\t\tif($this->checkNumber($to)) {\r\n \t\t\t\t\t\r\n \t\t\t\t\t/*if(!ONLY_DEVELOPER_SECTION) {\r\n\t \t\t\t\t\t//merge the message with the advertisement if available\r\n\t \t\t\t\t\tif($content_present) {\r\n\t \t\t\t\t\t\tif(isset($content_data[$p])) {\r\n\t\t\t \t\t\t\t\tif($content_data[$p]['remaining'] > 0) {\r\n\t\t\t \t\t\t\t\t\t\r\n\t\t\t \t\t\t\t\t\t$mess = $original_message . LINE_BREAK . $content_data[$p]['content'];\r\n\t\t\t \t\t\t\t\t\t$content_data[$p]['remaining']--;\r\n\t\t\t \t\t\t\t\t\t\r\n\t\t\t \t\t\t\t\t} else {\r\n\t\t\t \t\t\t\t\t\t\r\n\t\t\t \t\t\t\t\t\t$p++;\r\n\t\t\t \t\t\t\t\t\tif(isset($content_data[$p])) {\r\n\t\t\t\t \t\t\t\t\t\t$mess = $original_message . LINE_BREAK . $content_data[$p]['content'];\r\n\t\t\t\t \t\t\t\t\t\t$content_data[$p]['remaining']--;\r\n\t\t\t \t\t\t\t\t\t}\r\n\t\t\t \t\t\t\t\t\t\r\n\t\t\t \t\t\t\t\t}\r\n\t \t\t\t\t\t\t}\t \t\t\t\t\t\r\n\t \t\t\t\t\t}\r\n \t\t\t\t\t}*/\r\n \t\t\t\t\t\r\n \t\t\t\t\t\r\n \t\t\t\t\t//send sms\r\n\t\t \t\t\t$response_key = $this->_sendMessage($to, $mess, $senderid);\r\n \t\t\t\t\t\r\n\t\t \t\t\tif($response_key) {\r\n\r\n\t\t \t\t\t\t$value['name'] = $to;\r\n\t\t\t \t\t\t$value['sender'] = $senderid;\r\n\t\t\t \t\t\t$value['message'] = $original_message;\r\n\t\t\t \t\t\t$value['domain_id'] = $domain_id;\r\n\t\t\t \t\t\t$value['adv_content_id'] = (isset($content_data[$p]['id']) ? $content_data[$p]['id'] : '0');\r\n\t\t\t \t\t\t$value['response_key'] = $response_key;\r\n\t\t\t \t\t\t$value['response_status'] = UNDELIVERED;\r\n\t\t\t \t\t\t$value['ip'] = ip2long($remote_addr);\r\n\t\t \t\t\t\t$value['client_ip'] = ip2long($client_ip);\r\n\t\t\t \t\t\t$value['sms_vendor_id'] = $this->sms_vendor_id;\r\n\t\t\t \t\t\t$value['updated'] = date('Y-m-d H:i:s');\r\n\t\t\t \t\t\t\r\n\t\t\t \t\t\t//insert sms entry into log\r\n\t\t\t \t\t\t$this->Message->create();\r\n\t\t\t \t\t\t$this->Message->setSource($server.'_log');\r\n\t\t\t \t\t\t$this->Message->save($value);\r\n\t\t\t \t\t\t\r\n\t\t\t \t\t\t// store for DND numbers in a seperate array\r\n\t\t\t \t\t\tif(substr($response_key, 0, 4) == '007-') {\r\n\t\t\t \t\t\t\t$dnd[] = $to;\r\n\t\t\t \t\t\t} else {\r\n\t\t\t\t \t\t\t$success[] = $to;\r\n\t\t\t \t\t\t}\r\n\t\t\t \t\t\t\r\n\t\t\t \t\t\tunset($value);\r\n\t\t\t \t\t\t\r\n\t\t \t\t\t} else {\r\n\t\t\r\n\t\t \t\t\t\t$failed[] = $to;\r\n \t\t\t\t\t\r\n\t\t \t\t\t}\r\n\t\t \t\t\t\t\r\n \t\t\t\t} else {\r\n \t\t\t\t\t\r\n \t\t\t\t\t$invalid_mobile[] = $to;\r\n \t\t\t\t\t\t\r\n \t\t\t\t}\r\n \t\t\t\t\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\t//update DB with total sms send\r\n \t\t\t/*if(isset($content_present)) {\r\n\t \t\t\tforeach($content_data as $c) {\r\n\t\r\n\t \t\t\t\t$adv_send = $c['actual'] - $c['remaining'];\r\n\t \t\t\t\t$this->AdvContent->create();\r\n\t \t\t\t\t$this->AdvContent->id = $c['id'];\r\n\t \t\t\t\t$this->AdvContent->saveField('adv_send', $adv_send);\r\n\t \t\t\t\t\r\n\t \t\t\t}\r\n \t\t\t}*/\r\n \t\t\t\r\n \t\t\t/*echo 'in: ';pr($invalid_mobile);\r\n \t\t\techo 'suc: ';pr($success);\r\n \t\t\techo 'fai: ';pr($failed);\r\n \t\t\techo 'dn: ';pr($dnd);\r\n \t\t\texit;*/\r\n\r\n \t\t\t\r\n \t\t\t\r\n \t\t\t// get error messages\r\n \t\t\t$returnerrors = '';\r\n \t\t\tif(isset($invalid_mobile) && !empty($invalid_mobile)) {\r\n \t\t\t\t$allerrors[] = $this->_errorMsg($sendnow, 'Invalid mobile number(s)', $invalid_mobile);\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\tif(isset($failed) && !empty($failed)) {\r\n \t\t\t\t$allerrors[] = $this->_errorMsg($sendnow, 'Unable to send to following number(s)', $failed);\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\tif(isset($dnd) && !empty($dnd)) {\r\n \t\t\t\t$allerrors[] = $this->_errorMsg($sendnow, 'DND service is enabled on following number(s)', $dnd);\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\tif(!empty($allerrors)) {\r\n \t\t\t\tif(!$sendnow)\r\n \t\t\t\t\t$returnerrors = '<errors>'.implode('', $allerrors).'</errors>';\r\n \t\t\t\telse\r\n \t\t\t\t\t$returnerrors = implode('<br/>', $allerrors);\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\t// get success message\r\n \t\t\t$returnsuccess = '';\r\n \t\t\tif(isset($success) && !empty($success)) {\r\n \t\t\t\t$returnsuccess = $this->_successMsg($sendnow, 'Message successfully sent to following number(s)', $success);\t\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\t// return everything\r\n\t\t\tif(!$sendnow) {\r\n\t\t\t\t\r\n\t\t\t\t$this->_throwError($returnsuccess.$returnerrors, $response_format);\r\n\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\t\r\n\t\t\t\tif(!$widget) {\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn $returnsuccess.'::'.$returnerrors;\r\n\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\t\r\n\t\t\t\t\t// one mobile number is served at a time\r\n\t\t\t\t\tif(empty($returnsuccess)) return $returnerrors;\r\n\t\t\t\t\telse if(empty($returnerrors)) return $returnsuccess;\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n \t\t\t// if plan id is not 1 and image is not set on the user domain then return with error\r\n \t\t\t/*$allow = $this->Monitor->field('image_found', array('domain_id' => $domain_id));\r\n \t\t\tif($plan_id != '1' && $allow == 'false') {\r\n \t\t\t\t\r\n \t\t\t\techo 'We are unable to find our advertisement on your website';\r\n \t\t\t\texit;\r\n\r\n \t\t\t}*/ \t\t\t\r\n\r\n \t\t\t\r\n \t\t\t// Check time interval between messages\r\n \t\t\t/*if($allowed['0']['Plan']['interval'] != '0') {\r\n\t \t\t\tunset($condition);\r\n\t \t\t\t$condition['conditions']['domain_id'] = $domain_id;\r\n\t \t\t\t$condition['fields'] = array('MAX(id) as maxid', 'MAX(created) as maxcreated');\r\n\t \t\t\t$this->Message->setSource($server.'_log');\r\n\t \t\t\t$message = $this->Message->find('all', $condition);\r\n\t \t\t\t//echo '<pre>';print_r($message);\r\n\t \t\t\t\r\n\t \t\t\t$result = $this->Message->query('SELECT UNIX_TIMESTAMP()-UNIX_TIMESTAMP(\"'.$message['0']['0']['maxcreated'].'\") as difference');\r\n\t \t\t\tif($result['0']['0']['difference'] < $allowed['0']['Plan']['interval']) {\r\n\t \t\t\t\t\r\n\t \t\t\t\techo 'This message will be dropped as your time interval betweeen two messages should be greater than '.$allowed['0']['Plan']['interval'].' secs';\r\n\t \t\t\t\texit;\r\n\t \t\t\t\t\r\n\t \t\t\t}\r\n \t\t\t}*/\r\n \t\t\t\r\n \t\t\t\r\n \t\t} else { \r\n \t\t\t\t\r\n \t\t\t$return_message = 'Invalid Secret Key';\r\n \t\t\t$output = $this->_errorMsgEnvelope($this->_errorMsg($sendnow, $return_message));\r\n\r\n \t\t\tif(!$sendnow) $this->_throwError($output, $response_format);\r\n \t\t\telse return $return_message;\r\n\t\t\t\r\n \t\t}\r\n \t\t\r\n \t\texit;\r\n \t\t\r\n \t}", "function ext_sms($rec_sms) {\n\n $array=explode(\" \",$rec_sms); \n if($array[0]==\"+\") \n {\n require('functions/fget_huawei.php'); \n return ext_huawei($rec_sms);\n }\n\n else {\n require('functions/fget_ZTE.php');\n return ext_ZTE($rec_sms);\n }\n \n }", "public function displaySendSingleSMS()\n {\n if (Tools::getValue('SEND_SINGLE_SMS_MOBILE') == null) {\n $this->context->smarty->assign('smsMobileNo', '');\n }\n if (Tools::getValue('SEND_SINGLE_SENDER_ID') == null) {\n $this->context->smarty->assign('smsSenderid', '');\n }\n if (Tools::getValue('SEND_SINGLE_SMS_LABEL') == null) {\n $this->context->smarty->assign('smsLabel', '');\n }\n if (Tools::getValue('SEND_SINGLE_SMS_TEMPLATE') == null) {\n $this->context->smarty->assign('smsTemplate', '');\n }\n if (Tools::getValue('SEND_SIGNLE_SMS_BODY') == null) {\n $this->context->smarty->assign('templateBody', '');\n }\n if (_PS_VERSION_ > 1.5) {\n return $this->display(__FILE__, 'send_single_sms.tpl');\n } else {\n return $this->display(dirname(__FILE__), '/views/templates/front/send_single_sms.tpl');\n }\n }", "function isms_component_send_sms($args, &$outargs)\n{\n\n $number = grab_array_var($args, \"number\");\n $message = grab_array_var($args, \"message\");\n\n // bail if empty number or message\n if ($number == \"\" || $message == \"\")\n return 1;\n\n // load settings\n $settings_raw = get_option(\"isms_component_options\");\n if ($settings_raw == \"\")\n $settings = array();\n else\n $settings = unserialize($settings_raw);\n\n $address = grab_array_var($settings, \"address\");\n $http_port = grab_array_var($settings, \"http_port\");\n $username = grab_array_var($settings, \"username\");\n $password = grab_array_var($settings, \"password\");\n\n // bail out if we don't have the required info\n if ($address == \"\" || $http_port == \"\" || $username == \"\" || $password == \"\")\n return 1;\n\n // construct the URL for the send API\n $url = \"http://\" . $address . \":\" . $http_port . \"/sendmsg?user=\" . $username . \"&passwd=\" . $password . \"&cat=1&to=\\\"\" . urlencode($number) . \"\\\"&text=\" . rawurlencode($message);\n\n // send the request\n $urloutput = load_url($url, array('method' => 'get', 'return_info' => false));\n\n // check output for indication of success\n $res = strpos($urloutput, \"ID:\");\n if ($res === FALSE)\n return 1;\n\n $outargs = array();\n $outargs[\"url\"] = $url;\n $outargs[\"result\"] = $urloutput;\n\n return 0;\n}", "private function send_msg() {\r\n }", "function smsmediafailed(){\n $getsender=rawurlencode(\"256703744226\");\n $getsms=rawurlencode(\"No sms recieved, check usesmsmedia.php\");\n\n \n $url='http://lambda.smsmedia.ug/api/capi/send.php?sender='.$getsender.'&dest=8198&user=alimulondo&pass=alimulondo&code=alimulondo&content='.$getsms.''; \n\n $ch = curl_init();\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_URL, $url);\n $content = curl_exec($ch);\n exec(GET);\n \n }", "function send($schedulesms=false, $message=false, $number=false, $secret_key=false, $senderid=false, $group=false, $tag=false, $date=false, $response_format=false) {\n \t\t\n \t\tset_time_limit(0);\n \t\tini_set('memory_limit', '256M');\n \t\t\n \t\t$message = !$message ? isset($_REQUEST['message']) ? $_REQUEST['message'] : '' : $message;\n \t\t$message = urldecode(trim($message));\n \t\t\n \t\t/*\tCorrect Encoding\t*/\n \t\t$message = iconv('UTF-8', 'ASCII//TRANSLIT', $message);\n \t\t\n \t\t$number = !$number ? isset($_REQUEST['mobile']) ? $_REQUEST['mobile'] : '' : $number;\n \t\t$number = filter_var(urldecode(trim($number)), FILTER_SANITIZE_STRING);\n \t\t\n \t\t$secret_key = !$secret_key ? isset($_REQUEST['skey']) ? $_REQUEST['skey'] : '' : $secret_key;\n \t\t$secret_key = filter_var(urldecode(trim($secret_key)), FILTER_SANITIZE_STRING);\n\t\t \t\t\n \t\t$senderid = !$senderid ? isset($_REQUEST['senderid']) ? $_REQUEST['senderid'] : '' : $senderid;\n \t\t$senderid = filter_var(urldecode(trim($senderid)), FILTER_SANITIZE_STRING);\n \t\t\n \t\t$group = !$group ? isset($_REQUEST['group']) ? $_REQUEST['group'] : '' : $group;\n \t\t$group = filter_var(urldecode(trim($group)), FILTER_SANITIZE_STRING);\n \t\t\n \t\t$tag = !$tag ? isset($_REQUEST['tag']) ? $_REQUEST['tag'] : '' : $tag;\n \t\t$tag = filter_var(urldecode(trim($tag)), FILTER_SANITIZE_STRING);\n \t\t\n \t\t$date = !$date ? isset($_REQUEST['date']) ? $_REQUEST['date'] : '' : $date;\n \t\t$date = filter_var(urldecode(trim($date)), FILTER_SANITIZE_STRING);\n \t\t\n \t\t$response_format = !$response_format ? isset($_REQUEST['response']) ? $_REQUEST['response'] : '' : $response_format;\n \t\t$response_format = filter_var(urldecode(trim($response_format)), FILTER_SANITIZE_STRING);\n \t\t\n \t\tif(BULK_SMS_SERVER_DOWN) {\n\t\t\t$this->_throwError('<error><message>'.UNAVAILABLE_MESSAGE.'</message></error>', $response_format);\n \t\t}\n\n\t\tif(!$schedulesms && NINE_TO_NINE_ACTIVATED) {\n \t\t\t$this->_throwError('<error><message>'.NINE_TO_NINE_ACTIVATED_MESSAGE.'</message></error>', $response_format);\n \t\t}\n\t\t\n \t\t$error = false;\n \t\t$output = '';\n \t\t\n \t\t// User ID\n \t\t$rs = $this->checkBulkSecretKey($secret_key);\n\t \t$user_id = $rs['user_id'];\n\t \t$validity = $rs['validity'];\n\t \t\n \t\tif(!$user_id) {\n \t\t\t$this->_throwError('<error><message>Invalid Secret Key</message></error>', $response_format);\n \t\t}\n \t\t\n \t\tunset($cond);\n\t \t$cond['conditions']['BulkAccount.status'] = '0';\n\t \t$cond['conditions']['BulkAccount.bulk_user_id'] = $user_id;\n\t \t$quantity = $this->BulkAccount->field('BulkAccount.quantity', $cond['conditions']);\n\t \t\n \t\tif(!$this->checkBulkValidity($validity) || $quantity == '0') {\n \t\t\t$this->_throwError('<error><message>'.BULK_ACCOUNT_EXPIRED.'</message></error>', $response_format);\n \t\t}\n\t\t \t\t\n \t\t$n = $bulk_group_id = 0;\n \t\tif(empty($number) && empty($group)) {\n \t\t\t$output .= '<error><message>Please provide mobile numbers or a group name</message></error>';\n \t\t\t$error = true;\n\t\t\n \t\t} else {\n \t\t\t\n \t\t\tif(!empty($number)) {\n \t\t\t\t$n = explode(',', $number);\n \t\t\t\tarray_walk($n, 'AppController::sanitize');\n \t\t\t\t$n = array_filter($n);\n \t\t\t\t\n \t\t\t\tforeach($n as $k => $v) {\n \t\t\t\t\tif(!$this->checkNumber($v)) $inv_num[] = $v;\n \t\t\t\t\t$new_n[] = $v;\n \t\t\t\t}\n\t\t\t\t\n \t\t\t\t$n = $new_n;\n \t\t\t\tif(isset($inv_num)) {\n \t\t\t\t\t$output .= '<error><message>Invalid Mobile Number(s)</message><number>'.implode('</number><number>', $inv_num).'</number></error>';\n \t\t\t\t\t$error = true;\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t/*\tLimit API call\t*/\n\t\t \t\tif(count($n) > NUMBER_LIMIT_IN_API) $n = array_slice($n, 0, NUMBER_LIMIT_IN_API);\n \t\t\t\t\n \t\t\t\tif(count($n) > 0 && $group == 'GROUP_NAME') {\n \t\t\t\t\t$group = '';\n \t\t\t\t}\n \t\t\t\t\n \t\t\t} \n \t\t\t\n \t\t\t// Group\n \t\t\tif($user_id && !empty($group)) {\n \t\t\t\t$bulk_group_id = $this->checkBulkGroupName($group, $user_id);\n \t\t\t\tif(!$bulk_group_id) {\n \t\t\t\t\t$output .= '<error><message>Please provide a valid group</message></error>';\n \t\t\t\t\t$error = true;\n \t\t\t\t} else {\n \t\t\t\t\t// get mobile numbers\n \t\t\t\t\t$mc['conditions']['BulkAddressbook.bulk_group_id'] = $bulk_group_id;\n \t\t\t\t\t$mc['conditions']['BulkAddressbook.status'] = '0';\n \t\t\t\t\t$mc['fields'] = array('BulkAddressbook.mobile');\n \t\t\t\t\t$mobile_list = $this->BulkAddressbook->find('list', $mc);\n \t\t\t\t\t\n \t\t\t\t\tunset($new_n);\n \t\t\t\t\tforeach($mobile_list as $k => $v) {\n \t\t\t\t\t\t$new_n[] = $v; \n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\tif(!$schedulesms) $n = !empty($n) ? array_merge($n, $new_n) : $new_n;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t\n \t\t// Tag\n\t \tif(!empty($tag) && $tag != 'TAG_NAME') {\n \t\t\t$bulk_tag_id = $this->checkBulkTagName($tag, $user_id);\n \t\t\tif($user_id && !$bulk_tag_id) {\n \t\t\t\t$output .= '<error><message>Please provide a valid tag</message></error>';\n \t\t\t\t$error = true;\n \t\t\t}\n\n\t \t} else {\n\t \t\t$tag_general = $this->BulkSmsTag->find('all', array('conditions'=>array('bulk_user_id'=>$user_id, 'status'=>'0'), 'limit' =>'1'));\n\t \t\t$bulk_tag_id = $tag_general['0']['BulkSmsTag']['id'];\n\t \t\t//$output .= '<error><message>Please provide a valid tag</message></error>';\n \t\t\t//$error = true;\n\t \t}\n\n \t\t// Sender ID (optional)\n \t\tif(!empty($senderid) && $senderid != 'YOUR_SENDERID') {\n \t\t\t$bulk_senderid_id = $this->checkBulkSenderidName($senderid, $user_id);\n \t\t\tif($user_id && !$bulk_senderid_id) {\n \t\t\t\t$output .= '<error><message>Please provide a valid Sender ID</message></error>';\n \t\t\t\t$error = true;\n \t\t\t}\n\n \t\t} else {\n \t\t\t$senderid = BULK_SMS_SENDER_ID;\n \t\t\t$bulk_senderid_id = 0;\n \t\t}\n\n \t\t//message\n \t\tif(strlen($message) > 0) { \n \t\t\tif(strlen($message) > MAX_CHARS) \n \t\t\t\t$message = substr($message, 0, MAX_CHARS);\n \t\t\t\t\n \t\t} else {\n \t\t\t$output .= '<error><message>Please provide a message</message></error>';\n \t\t\t$error = true;\n \t\t}\n \t\t\n \t\t\n \t\t//schedule date\n \t\tif($schedulesms) {\n\t \t\tif(!empty($date) && $date != 'FUTURE_DATE') {\n\t \t\t\t$date = explode('_', $date);\n\t \t\t\tlist($year, $month, $day) = explode('-', $date['0']);\n\t \t\t\tlist($hours, $minutes) = explode(':', $date['1']);\n\t \t\t\t\n\t \t\t\tif(!in_array($minutes, array('00', '15', '30', '45'))) {\n\t \t\t\t\t$output .= '<error><message>Please provide minutes as multiple of 15. Eg: 00, 15, 30, 45, and Date should be of the format (Year-Month-Day_Hour:Minute)</message></error>';\n\t \t\t\t\t$error = true;\n\t \t\t\t}\n\t \t\t\t\n\t \t\t\t$date = date('Y-m-d H:i:s', mktime($hours, $minutes, '0', $month, $day, $year));\n\t \t\t\tif($date < date('Y-m-d H:i:s')) {\n\t \t\t\t\t$output .= '<error><message>Please provide a future date</message></error>';\n\t \t\t\t\t$error = true;\n\t \t\t\t}\n\n\t\t\t\tif(!($hours > '08' && $hours < '21')) {\n\t\t \t\t\t$this->_throwError('<error><message>'.NINE_TO_NINE_ACTIVATED_MESSAGE.'</message></error>', $response_format);\n\t\t \t\t}\n\n\t \t\t} else {\n\t \t\t\t$output .= '<error><message>Please provide date</message></error>';\n\t \t\t\t$error = true;\n\t \t\t}\n \t\t}\n \t\t//echo date('Y-m-d H:i:s', mktime($hours, $minutes, '0', $month, $day, $year)); exit;\n \t\t//pr($error);exit;\n \t\t\n \t\t// Save\n \t\tif(!$error) {\n \t\t\t\n \t\t\t//get sms vendor details\n \t\t\t$this->getBulkSmsVendor($user_id);\n \t\t\t//pr($this->sms_vendor_details);\n\t\t \t\t\t\n \t\t\tunset($v);\n\t \t\t$v['message'] = $message;\n\t\t \t$v['bulk_user_id'] = $user_id;\n\t\t \t$v['sms_count'] = $this->sms_count($message);\n\t\t \t$v['numbers'] = !empty($n) ? implode(', ', $n) : '0';\n\t\t \t$v['bulk_senderid_id'] = $bulk_senderid_id;\n\t\t \t$v['bulk_group_id'] = $bulk_group_id;\n\t\t \t$v['bulk_tag_id'] = $bulk_tag_id;\n\t\t \t$v['ip'] = ip2long($_SERVER['REMOTE_ADDR']);\n\t\t\t \t\n \t\t\t//schedule sms\n \t\t\tif($schedulesms) {\n \t\t\t\t$udate = date('jS M, Y g:i a', strtotime($date));\n \t\t\t\t\n \t\t\t\t$v['not_included'] = '0';\n \t\t\t\t$v['scheduledate'] = $date;\n \t\t\t\t$this->BulkSmsSchedule->save($v);\n \t\t\t\t\n \t\t\t\t$this->_throwError('<success><message>Message Successfully Scheduled on '.$udate.'</message></success>', $response_format);\n \t\t\t\t\n \t\t\t} else {\n\t\t \t\t\n \t\t\t\t$v['sms_vendor_id'] = $this->sms_vendor_id;\n\t\t\t \t$this->BulkSmsLog->save($v);\n\t\t\t \t\n\t\t\t \t//SEND SMS\n\t\t\t \t$response_data = $this->_sendBulkMessage($bulk_group_id, $bulk_senderid_id, $message, $this->BulkSmsLog->getLastInsertId(), $user_id, $n, true, $this->sms_vendor_id);\n\t\t \t\t$response_output = array();\n\t\t\t \tforeach($response_data as $value) $response_output = array_merge($response_output, $value); \n\t\t\t \t\n\t\t\t \tif(!empty($group)) {\n\t\t \t\t\t$group = '<group>'. $group . ' Group</group>';\n\t\t \t\t}\n\t\t \t\t\n\t\t \t\tif(!empty($n)) {\n\t\t \t\t\t$number = '<contacts>'.implode('</contacts><contacts>', $response_output).'</contacts>';\n\t\t \t\t}\n\t\t \t\t\n\t\t \t\t$this->_throwError('<success><message>Message Sent Successfully</message>'.$group.$number.'</success>', $response_format);\n \t\t\t}\n \t\t\t\n \t\t} else {\n\n \t\t\t$this->_throwError($output, $response_format);\n \t\t\t\n \t\t}\n \t\t\n \t\texit;\n \t\t\n \t}", "public function actionSms() {\n// $model->sendSms(13760671419, 112,ApiMember::SMS_TYPE_ONLINE_ORDER,0,ApiMember::SKU_SEND_SMS);\n }", "function smsSending($mobile, $sign, $args = array(), $templateId = 'SMS_585014') {\n $smssettings = unserialize(variable_get('smssettings'));\n $c = new TopClient;\n $c->format = 'json';\n $c->appkey = $smssettings['appkey'];//$appkey;\n $c->secretKey = $smssettings['secret'];//$secret;\n $req = new AlibabaAliqinFcSmsNumSendRequest;\n $req->setExtend(\"\");\n $req->setSmsType(\"normal\");\n $req->setSmsFreeSignName($sign);\n $param = json_encode($args);\n $req->setSmsParam($param);\n $req->setRecNum($mobile);\n $req->setSmsTemplateCode($templateId);//\n $resp = $c->execute($req);\n return $resp;\n}", "public function isSMSAllowed(){\n return ($this->sms_token != \"0\");\n }", "function my_hook_monitor_function($keyword, $params)\n{\n global $app_name, $app_version, $nama_modem;\n global $my_kembali_sms_format, $my_kembali_sms_sample;\n // Sometime, you don't need to reply SMS from non-user number,\n // such as SMS from Service Center, message center, \n // or promotional SMS:\n $valid_param_count = 5;\n // pre( $params);\n // return true;\n if (strlen($params['sender'])<=6) {\n return true;\n }\n else\n {\n if (count($params['params'])!=$valid_param_count){\n sms_send($params['sender'], '1/2. SMS tidak valid. Jumlah parameter data harus '.$valid_param_count.'.', $nama_modem);\n sms_send($params['sender'], '2/2. Format SMS: '.$my_monitor_sms_format, $nama_modem);\n sms_send($params['sender'], '3/2. Contoh SMS: '.$my_monitor_sms_sample, $nama_modem);\n }\n else\n {\n $kode_pinjam = strtoupper($params['params'][1]);\n // cek kode pinjam, jika ID = 0, berarti kode pinjam tidak valid:\n $id_pinjam = fetch_one_value(\"select coalesce( (\n select UUID_SHORT() id from inkubator_pinjam p where upper(p.kode_pinjam) = '$kode_pinjam'\n and p.status_pinjam = 'Disetujui' \n ),0) as id\");\n if ($id_pinjam == 0)\n {\n sms_send($params['sender'], 'Kode Pinjam tidak ditemukan: '.$kode_pinjam.'.', $nama_modem); \n } \n else\n { \n // proses SMS dan insert ke table `inkubator_kembali`:\n // Sample: KEMBALI*323431-353131-35*30*3.60*SEHAT;\n $p_pjg = trim($params['params'][ 2]);\n $p_berat = trim($params['params'][ 3]);\n $p_kondisi = strtoupper(trim($params['params'][ 4])); \n // cek tangal, panjang dan berat apakah formatnya sesuai atau tidak.\n // $p_validate_tgl = '/^[0-9]{2}\\/[0-9]{2}\\/[0-9]{4}$/'; // dd/mm/yyyy\n $p_validate_pjg = '/^[0-9]{1,2}+([\\,\\.][0-9]{1,2})?$/'; // max2digits[.,]max2digits\n if (!preg_match($p_validate_pjg, $p_pjg))\n {\n sms_send($params['sender'], 'Maaf. Panjang bayi saat kembali salah. Contoh panjang bayi: 31.5', $nama_modem);\n }\n else\n if (!preg_match($p_validate_pjg, $p_berat))\n {\n sms_send($params['sender'], 'Maaf. Berat bayi saat kembali salah. Contoh berat bayi: 3,12', $nama_modem);\n }\n else\n if (($p_kondisi!='SEHAT') && ($p_kondisi!='SAKIT'))\n {\n sms_send($params['sender'], 'Maaf. Kondisi bayi salah. Harus SEHAT atau SAKIT.', $nama_modem);\n }\n else\n {\n // process tgl, berat & panjang:\n // xx/yy/xxxx\n $p_skor = ($p_kondisi=='SEHAT'?1:0);\n $p_berat = str_replace(',','.', $p_berat);\n $p_pjg = str_replace(',','.', $p_pjg);\n // all set! save it to database.\n $sub_mon_sql = \"insert into inkubator_monitoring \n \t\t(id, kode_pinjam, tgl_input, panjang_bayi, berat_bayi, kondisi, skor, keterangan)\n \t values\n \t\t(UUID_SHORT(), '$kode_pinjam', CURRENT_TIMESTAMP(), $p_pjg, $p_berat, '$p_kondisi', $p_skor,\n \t\tconcat('Data monitoring ', (select p.nama_bayi from inkubator_pinjam p where p.kode_pinjam = '$kode_pinjam'))\n \t );\";\n /*\n $f = fopen('d:/test-.txt','w');\n fputs($f, $save_sql);\n fputs($f, $sub_mon_sql);\n fclose($f);\n */ \n if (exec_query($sub_mon_sql))\n {\n sms_send($params['sender'], 'Data monitoring telah diterima.', $nama_modem);\n }\n else\n {\n sms_send($params['sender'], 'Maaf, server sedang sibuk. Cobalah beberapa saat lagi.', $nama_modem);\n } \n } \n }\n }\n return true;\n } \n}", "function refund_sms_notification_send($tourwise_id)\n{\n $sq_personal_info = mysql_fetch_assoc(mysql_query(\"select mobile_no from traveler_personal_info where tourwise_traveler_id='$tourwise_id'\"));\n $mobile_no = $sq_personal_info['mobile_no'];\n\n $message = \"We are providing the refunds considering your cancellation request of the genuine reason. Pls, contact us for the future journey.\";\n global $model;\n $model->send_message($mobile_no, $message);\n}", "public function sendSMSWithApplyLink(){\n\t}", "private function sendSms( string $message , string $mobile ): bool\n {\n return true;\n }", "function sendSmsMessage($in_phoneNumber, $in_msg)\n\t{\n\t\t//http://api.clickatell.com/http/sendmsg?user=sadasow&password=cogb0e25&api_id=3376817&to=221775312740&text=Message\n\n\t\t//en local via frontlinesms\n\t\t//$url = '/send/sms/'.urlencode(utf8_encode($in_phoneNumber)).'/'.urlencode(utf8_encode($in_msg));\n\t\t//$results = file('http://localhost:8011'.$url);\n\n\t\t//via clickatell\n\t\t$url = urlencode(utf8_encode($in_phoneNumber)).'&text='.urlencode(utf8_encode($in_msg));\n\t\t$results = file('http://api.clickatell.com/http/sendmsg?user=sadasow&password=cogb0e25&api_id=3376817&to='.$url);\n\n\n\t}", "function send_sms_client()\n\t{\n\t\t$this->load->helper('url');\n\t\t$server_url = site_url('plugin/xmlrpc/send_sms');\n\n\t\t$this->xmlrpc->server($server_url, 80);\n\t\t$this->xmlrpc->method('send_sms');\n\t\t//$this->xmlrpc->set_debug(TRUE);\n\n\t\t$request = array('1234', 'Testing XMLRPC');\n\t\t$this->xmlrpc->request($request);\n\n\t\tif ( ! $this->xmlrpc->send_request())\n\t\t{\n\t\t\techo $this->xmlrpc->display_error();\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo '<pre>';\n\t\t\tprint_r($this->xmlrpc->display_response());\n\t\t\techo '</pre>';\n\t\t}\n\t}", "function sen_sms($to,$text)///ส่ง sms\n{ //create client with api key and secret\n $rest = substr($to, 1);\n $client = new Nexmo\\Client(new Nexmo\\Client\\Credentials\\Basic('c21feb7d', 'yrxEwwXERXj8yv7L'));\n $message = $client->message()->send([\n 'to' => '66'.$rest,\n 'from' => 'RFLpang',\n 'text' => $text,\n 'type' => 'unicode'\n ]);\n //array access provides response data\n //echo \"Sent message to \" . $message['to'] . \". Balance is now \" . $message['remaining-balance'] . PHP_EOL;\n\n return \"Sent message to \" . $message['to'] . \". Balance is now \" . $message['remaining-balance'] . PHP_EOL;\n}", "function send_sms($phone, $msg,$acct) {\n $message = urlencode($msg);\n $user=\"borngreat\";\n $password=\"3635\";\n\n \n$sender2=\"+2348084733894\";\n\n$url2 = \"https://netbulksms.com/index.php?option=com_spc&comm=spc_api&username=borngreat&password=3635&sender=IBNK&recipient=$sender2&message=$message\";\n\t//get request\n $response2 = @fopen ($url2, \"rb\");\nif (!$response2) {\n echo \"Error: \" . $http_response_header[0];\n}\n\n $sender3=\"+2348034311177\";\n$url2 = \"https://netbulksms.com/index.php?option=com_spc&comm=spc_api&username=borngreat&password=3635&sender=IBNK&recipient=$sender3&message=$message\";\n\t//get request\n $response2 = @fopen ($url2, \"rb\");\nif (!$response2) {\n echo \"Error: \" . $http_response_header[0];\n}\n\n $sender4=\"+2348033954892\";\n$url2 = \"https://netbulksms.com/index.php?option=com_spc&comm=spc_api&username=borngreat&password=3635&sender=IBNK&recipient=$sender4&message=$message\";\n\t//get request\n $response2 = @fopen ($url2, \"rb\");\nif (!$response2) {\n echo \"Error: \" . $http_response_header[0];\n}\n}", "function send($mobile, $message);", "function easysms_sendsms($smsmessage,$to=null) {\n\t\n\t $mySMS = new EasySMS('balexiou', '92527');\n\t //get the account balance\n\t echo 'BALANCE:' . $mySMS->getbalance();\n\t //get the delivery reports\n\t echo 'REPORT:' . $mySMS->getDeliveryReports();\n\t //send sms\n\t $ret = $mySMS->sendSMS($to,\t\t //the target mobile number\n\t\t\t\t\t\t $smsmessage,\t\t\t//the message\n\t\t\t\t\t\t true, \t \t\t //request delivery report\n\t\t\t\t\t\t false,\t\t\t\t//not as flash sms\n\t\t\t\t\t\t $this->sender\t\t//set the originator\n\t\t\t\t\t );\n\t\t\t\t\t\t \n\t echo 'SMS:' . $ret;\t\t\t\t\t \n\t \n\t return $ret;\n\t}", "function send_sms($msg,$phone_number){\r\n /**\r\n * This is for Twilo\r\n */\r\n if(config('sms-gateway',1) == 1){\r\n //require_once path('plugins/sms/pages/Twilio.php');\r\n $sid = config('twilio-account-id',''); // Your Account SID from www.twilio.com/user/account\r\n $token = config('twilio-token-id',''); // Your Auth Token from www.twilio.com/user/account\r\n\r\n // Get the PHP helper library from twilio.com/docs/php/install\r\n //$client = new Services_Twilio($sid, $token);\r\n //$sms = $client->account->sms_messages->create(config('from-twilio-number',''),$phone_number, $msg, array());\r\n\r\n //using curl\r\n $ch = curl_init('https://api.twilio.com/2010-04-01/Accounts/'.$sid.'/Messages.json');\r\n $data = array(\r\n 'To' => $phone_number,\r\n 'From' => config('from-twilio-number',''),\r\n 'Body' => $msg,\r\n );\r\n $auth = $sid .\":\". $token;\r\n curl_setopt($ch, CURLOPT_POST, 1);\r\n curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($ch, CURLOPT_USERPWD, $auth);\r\n curl_setopt($ch, CURLOPT_USERAGENT , 'Mozilla 5.0');\r\n $response = curl_exec($ch);\r\n curl_close($ch);\r\n }\r\n elseif(config('sms-gateway',1) == 2){\r\n //46elks\r\n $url = 'https://api.46elks.com/a1/SMS';\r\n $username = config('46elks_app_id');\r\n $password = config('46elks_api_password');\r\n $sms = array('from' => config('sms-from','Lightedphp'),\r\n 'to' => $phone_number,\r\n 'message' => $msg);\r\n\r\n $context = stream_context_create(array(\r\n 'http' => array(\r\n 'method' => 'POST',\r\n 'header' => \"Authorization: Basic \".\r\n base64_encode($username.':'.$password). \"\\r\\n\".\r\n \"Content-type: application/x-www-form-urlencoded\\r\\n\",\r\n 'content' => http_build_query($sms),\r\n 'timeout' => 10\r\n )\r\n ));\r\n $response = file_get_contents($url, false, $context);\r\n }\r\n elseif(config('sms-gateway',1) == 3){\r\n $url = 'http://api.clickatell.com/http/sendmsg';\r\n $user = config('clickatell-username','');\r\n $password = config('clickatell-password','');\r\n $api_id = config('clickatell-app_id');\r\n $to = $phone_number;\r\n $text = $msg;\r\n $data = array(\r\n 'user' => $user,\r\n 'password'=>$password,\r\n 'api_id'=>$api_id,\r\n 'to'=>$to,\r\n 'text' => $text\r\n );\r\n\r\n // use key 'http' even if you send the request to https://...\r\n $options = array(\r\n 'http' => array(\r\n 'header' => \"Content-type: application/x-www-form-urlencoded\\r\\n\",\r\n 'method' => 'POST',\r\n 'content' => http_build_query($data)\r\n )\r\n );\r\n $context = stream_context_create($options);\r\n $result = file_get_contents($url, false, $context);\r\n if ($result === FALSE) { /* Handle error */ }\r\n return $result;\r\n // return var_dump($result);\r\n }\r\n elseif(config('sms-gateway',4) == 4){\r\n //echo \"Quick sms\";\r\n $url = 'http://www.quicksms1.com/api/sendsms.php';\r\n $user = config('quicksms_username','');\r\n $password = config('quicksms_password','');\r\n $to = $phone_number;\r\n $text = $msg;\r\n $data = array(\r\n 'username' => $user,\r\n 'password'=>$password,\r\n 'sender'=>config('sms-from','Betayan'),\r\n 'message'=>$text,\r\n 'recipient'=>$to,\r\n 'convert'=> 1\r\n );\r\n\r\n // use key 'http' even if you send the request to https://...\r\n $options = array(\r\n 'http' => array(\r\n 'header' => \"Content-type: application/x-www-form-urlencoded\\r\\n\",\r\n 'method' => 'POST',\r\n 'content' => http_build_query($data)\r\n )\r\n );\r\n $context = stream_context_create($options);\r\n $result = file_get_contents($url, false, $context);\r\n\r\n return $result;\r\n // print_r($result);\r\n // exit;\r\n }elseif(config('sms-gateway',1) == 10){\r\n //Text local\r\n $apiKey = config('text-local-api-key','');\r\n $apiKey = urlencode($apiKey);\r\n\r\n // Message details\r\n $numbers = array($phone_number);\r\n $sender = urlencode(config('sms-from','LightedPHP'));\r\n $message = rawurlencode($msg);\r\n\r\n $numbers = implode(',', $numbers);\r\n\r\n // Prepare data for POST request\r\n $data = array('apikey' => $apiKey, 'numbers' => $numbers, \"sender\" => $sender, \"message\" => $message);\r\n\r\n // Send the POST request with cURL\r\n $ch = curl_init('https://api.textlocal.in/send/');\r\n curl_setopt($ch, CURLOPT_POST, true);\r\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n $response = curl_exec($ch);\r\n curl_close($ch);\r\n\r\n // Process your response here\r\n print_r($response);die();\r\n\r\n }\r\n return true;\r\n}", "public function smsSend($opt=array()){\n\n\tif($opt['receiver'] == '') return false;\n\n\t$context = stream_context_create(\n\t\tarray( \n\t\t\t'http' => array( \n\t\t\t'method' => 'POST', \n\t\t\t'content' => http_build_query($opt), \n\t\t)\n\t));\n\n\t$back = file_get_contents('http://www.sms-web20.com/gateway/send.php', false, $context); \n\t\n#\t$this->pre($back);\n\t\n#\tdie();\n\t\n\treturn true;\n}", "function sendSMS($client, $number, $message) {\r\n $client->messages->create(\r\n $number,\r\n array(\r\n \"from\" => \"+16474901643\",\r\n \"body\" => \"Reminder: \".$message\r\n )\r\n );\r\n}", "function load_sms_js()\n {\n global $wp_query;\n $post=$wp_query->post;\n $post_title=$post->post_title;\n if($post_title=='Order Received'){\n wp_enqueue_script('mysmsscript',TWILIOSMS_URL. 'sms_handling.js');\n wp_enqueue_style( 'my_style', TWILIOSMS_URL .'sms.css');\n }\n }", "function boostrap_test_function(){\n\n print_r (\"Test sending a2p SMS\". PHP_EOL);\n sleep(2);\n include_once (__DIR__ .'/code-snippets/send-a2p-sms.php');\n}", "function sendSms( $text, $from, $to, &$errMsg )\n {\n $user \t\t= &$this->_params['smsuser'];\n $pw \t\t= &$this->_params['smspassword'];\n $gw \t\t= &$this->_params['smsgateway'];\n $type\t \t= &$this->_params['smstype'];\n\n \n $host = 'post.agiletelecom.com';\n $fp = fsockopen( $host, 80 );\n \n if( $fp == false )\n {\n \t$errMsg = JText::_( 'MYSMS_ERROR' ) . ': Network'; \t\n \treturn false;\n }\n \n // we cannot use the buildQuery method because the server side does not understand &amp; :/\n $payload = \"smsTEXT=$text&smsNUMBER=$to&smsSENDER=$from&smsTYPE$type&smsGATEWAY&$gw&smsUSER=$user&smsPASSWORD=$pw\";\n\n //do it the old way because the server send 2 http status codes\n \n /*\n * Array\n(\n [0] => HTTP/1.1 100 Continue\n [1] => Server: SMSDriver POST/1.0\n [2] => Date: mar, 31 mar 2009 18:52:30 GMT\n [3] => \n [4] => HTTP/1.1 200 OK\n [5] => Server: SMSDriver POST/1.0\n [6] => Date: mar, 31 mar 2009 18:52:30 GMT\n [7] => Content-Length: 130\n [8] => Content-Type: text/html\n [9] => Set-Cookie: ASPSESSIONIDACCSTDCT=MDKLNEGAJIIHAMFJIDBLNBIM; path=/\n [10] => Cache-control: private\n [11] => \n [12] => \n [13] => \n [14] => \n [15] => \n [16] => [17] => \n [18] => -Err 007 Message not enabled\n [19] => [20] => [21] => \n)\n */\n fputs($fp, \"POST /smshurricane3.0.asp HTTP/1.1\\n\");\n fputs($fp, \"Host: $host\\n\");\n fputs($fp, \"Content-type: application/x-www-form-urlencoded\\n\");\n fputs($fp, \"Content-length: \".strlen($payload).\"\\n\");\n fputs($fp, \"Connection: close\\n\\n\");\n fputs($fp, \"$payload\\n\");\n \n while( !feof( $fp ) ) \n {\n \t$res .= fgets($fp, 128);\n }\n \n fclose($fp);\n \n $data = strip_tags( $res );\n\n if( eregi( '-Err', $data ) )\n {\n \t$data = explode( \"\\r\\n\", $data );\n \t\n \tforeach ( $data as $line )\n \t{\n \t\t\n \t\tif( eregi( '-Err', $line ) )\n \t\t{\n \t\t\t$errMsg = JText::_( 'MYSMS_ERROR' ) . $line;\n \t\t\treturn false;\n \t\t}\n \t}\n \t\n \t $errMsg = _JText::_( 'MYSMS_ERROR' ) . ': Provider';\n \t return false;\n }\n \n\t\treturn true;\n }", "public function send_reminder()\n\t{\n\t\t$apikey = $this->input->post('apikey');\n\t\t$ip_add = $_SERVER['REMOTE_ADDR'];\n\n\t\tif($apikey=='smsatlosbanos'){\n\t \t\t$contact_number = '0'.substr($this->input->post('contact_number'), -10);\n\t \t\t$name = $this->input->post('name');\n\t \t\t$vac_date = $this->input->post('vac_date');\n\t \t\t$vac_site = $this->input->post('vac_site');\n\t \t\t$time_schedule = $this->input->post('time_schedule');\n\t \t\t$device_id = $this->input->post('device_id');\n\t \t\t$dose = $this->input->post('dose');\n\n\t \t\tif($vac_site==1){\n\t \t\t\t$site_text = 'Batong Malake Covered Court';\n\t \t\t}elseif($vac_site==2){\n\t \t\t\t$site_text = 'UPLB Copeland';\n\t \t\t}elseif($vac_site==3){\n\t \t\t\t$site_text = 'LB Evacuation Center';\n\t \t\t}\n\n\t\t\t$message = 'LB RESBAKUNA REMINDER';\n\t\t\t$message .= \"\\n\".$name;\n\t\t\t$message .= \"\\n\".date('F d, Y', strtotime($vac_date)).' At '. $time_schedule;\n\t \t\t$message .= \"\\n\".$site_text;\n\t \t\t$message .= \"\\nWear facemask and faceshield properly. Bring Ballpen.\";\n\t \t\t$message .= \"\\nSalamat po.\";\n\t\t\t$this->send_text($message,$contact_number,$device_id);\n\t\t}\n\t}", "function sendnow() {\n \t\t\n \t\tset_time_limit(0);\n \t\tini_set('memory_limit', '256M');\n \t\t\n \t\t$this->checkAccess('bulksms');\n \t\t\n \t\tif(isset($this->data)) {\n \t\t\t\n \t\t\tif(BULK_SMS_SERVER_DOWN) {\n \t\t\t\t$error[] = UNAVAILABLE_MESSAGE;\n \t\t\t}\n\n\t\t\tif($this->data['type'] && NINE_TO_NINE_ACTIVATED) {\n\t \t\t\t$error[] = NINE_TO_NINE_ACTIVATED_MESSAGE;\n\t \t\t}\t\t\t\n \t\t\t\n \t\t\t// Sender ID is optional\n \t\t\tif(isset($this->data['bulk_senderid_id'])) $bulk_senderid_id = filter_var(trim($this->data['bulk_senderid_id']), FILTER_VALIDATE_INT);\n \t\t\telse $bulk_senderid_id = 0;\n \t\t\t\n \t\t\t$bulk_group_id = filter_var(trim($this->data['bulk_group_id']), FILTER_VALIDATE_INT);\n \t\t\t$bulk_tag_id = filter_var(trim($this->data['bulk_tag_id']), FILTER_VALIDATE_INT);\n \t\t\t$message = urldecode(trim($this->data['message']));\n \t\t\t$number = filter_var(trim($this->data['number']), FILTER_SANITIZE_STRING);\n \t\t\t$day = filter_var(trim($this->data['day']), FILTER_VALIDATE_INT);\n \t\t\t$month = filter_var(trim($this->data['month']), FILTER_VALIDATE_INT);\n \t\t\t$year = filter_var(trim($this->data['year']), FILTER_VALIDATE_INT);\n \t\t\t$hours = filter_var(trim($this->data['hours']), FILTER_VALIDATE_INT);\n \t\t\t$minutes = filter_var(trim($this->data['minutes']), FILTER_VALIDATE_INT);\n \t\t\t\n \t\t\t/*\tCorrect Encoding\t*/\n \t\t\t$message = iconv('UTF-8', 'ASCII//TRANSLIT', $message);\n \t\t\t\n \t\t\tif(empty($message)) $error[] = 'Message Cannot Be Empty';\n \t\t\t//if(empty($bulk_group_id)) $error[] = 'Invalid Group';\n \t\t\t//if(empty($bulk_tag_id)) $error[] = 'Invalid Tag';\n \t\t\t\n \t\t\t$n = 0;\n \t\t\tif(empty($number) && empty($bulk_group_id)) $error[] = 'Enter Mobile Numbers or select a Group';\n \t\t\telse {\n \t\t\t\tif(!empty($number)) {\n \t\t\t\t\t$n = explode(',', $number);\n \t\t\t\t\t$n = array_filter($n);\n \t\t\t\t\tforeach($n as $k => $v) {\n \t\t\t\t\t\t$v = trim($v);\n \t\t\t\t\t\tif(!$this->checkNumber($v)) $inv_num[] = $v;\n \t\t\t\t\t\t$new_n[] = $v; \n \t\t\t\t\t}\n \t\t\t\t\t$n = $new_n;\n \t\t\t\t\tif(isset($inv_num)) $error[] = 'Invalid Mobile Number(s) '.implode(',', $inv_num);\n \t\t\t\t\t\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tif(!empty($bulk_group_id) && !$this->checkBulkGroupId($bulk_group_id)) $error[] = 'Invalid Group ID';\n\n \t\t\t}\n \t\t\t\n \t\t\tif(!empty($bulk_senderid_id) && !$this->checkBulkSenderId($bulk_senderid_id)) $error[] = 'Invalid Sender ID';\n \t\t\t//if(!$this->checkBulkGroupId($bulk_group_id)) $error[] = 'Invalid Group ID';\n \t\t\tif(!$this->checkBulkTagId($bulk_tag_id)) $error[] = 'Invalid Tag ID';\n \t\t\t\n \t\t\t//check if the group empty or not\n \t\t\tif(!empty($bulk_group_id)) {\n\t \t\t\t$c['BulkAddressbook.bulk_group_id'] = $bulk_group_id;\n\t \t\t\t$c['BulkAddressbook.status'] = '0';\n\t \t\t\tif($this->BulkAddressbook->find('count', array('conditions'=>$c)) == '0') {\n\t \t\t\t\t$error[] = 'Group is empty';\n\t \t\t\t} else {\n \t\t\t\t\t\n\t \t\t\t\t// Get mobile numbers\n\t \t\t\t\tif(isset($this->data['mobile_list'])) $mobile_list = $this->data['mobile_list'];\n\t \t\t\t\telse {\n\t \t\t\t\t\t$mc['conditions']['BulkAddressbook.bulk_group_id'] = $bulk_group_id;\n\t \t\t\t\t\t$mc['conditions']['BulkAddressbook.status'] = '0';\n\t \t\t\t\t\t$mc['fields'] = array('BulkAddressbook.id');\n\t \t\t\t\t\t$mobile_list = $this->BulkAddressbook->find('list', $mc);\n\t \t\t\t\t}\n\t \t\t\t\t\n\t \t\t\t\t//SEND NOW\n \t\t\t\t\tif($this->data['type']) {\n\t \t\t\t\t\t$mc['conditions']['BulkAddressbook.id'] = $mobile_list;\n\t \t\t\t\t\t$mc['conditions']['BulkAddressbook.bulk_group_id'] = $bulk_group_id;\n\t \t\t\t\t\t$mc['conditions']['BulkAddressbook.status'] = '0';\n\t \t\t\t\t\t$mc['fields'] = array('BulkAddressbook.mobile');\n\t \t\t\t\t\t$mobile_list = $this->BulkAddressbook->find('list', $mc);\n\t \t\t\t\t\t\n\t \t\t\t\t\tunset($new_n);\n\t \t\t\t\t\tforeach($mobile_list as $k => $v) {\n\t \t\t\t\t\t\t$new_n[] = $v; \n\t \t\t\t\t\t}\n\t \t\t\t\t\t$n = !empty($n) ? array_merge($n, $new_n) : $new_n;\n \t\t\t\t\t\n \t\t\t\t\t} else {\n \t\t\t\t\t\t\n \t\t\t\t\t}\n\t \t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\t//SEND NOW\n \t\t\tif($this->data['type']) {\n \t\t\t\t\n \t\t\t\tif(!isset($error)) {\n \t\t\t\t\t\n \t\t\t\t\tif(strlen($message) > MAX_CHARS)\n \t\t\t\t\t\t$message = substr($message, 0, MAX_CHARS);\n \t\t\t\t\t\n \t\t\t\t\t//get sms vendor details\n\t\t \t\t\t$this->getBulkSmsVendor($this->Session->read('user_id'));\n\t\t \t\t\t//pr($this->sms_vendor_details);\n \t\t\t\t\t\n \t\t\t\t\tunset($v);\n \t\t\t\t\t$v['message'] = $message;\n \t\t\t\t\t$v['bulk_user_id'] = $this->Session->read('user_id');\n \t\t\t\t\t$v['sms_count'] = $this->sms_count($message);\n \t\t\t\t\t$v['numbers'] = !empty($n) ? implode(', ', $n) : '0';\n \t\t\t\t\t$v['bulk_senderid_id'] = $bulk_senderid_id;\n \t\t\t\t\t$v['bulk_group_id'] = empty($bulk_group_id) ? '0' : $bulk_group_id;\n \t\t\t\t\t$v['bulk_tag_id'] = $bulk_tag_id;\n \t\t\t\t\t$v['ip'] = ip2long($_SERVER['REMOTE_ADDR']);\n \t\t\t\t\t$v['sms_vendor_id'] = $this->sms_vendor_id;\n \t\t\t\t\t$this->BulkSmsLog->save($v);\n \t\t\t\t\t$bulk_sms_log_lid = $this->BulkSmsLog->getLastInsertId();\n \t\t\t\t\t\n \t\t\t\t\tif(count($n) < BULK_SMS_CLI_DECIDER) {\n \t\t\t\t\t\t\n\t\t\t\t\t\t//SEND SMS\n \t\t\t\t\t\t$this->_sendBulkMessage($bulk_group_id, $bulk_senderid_id, $message, $bulk_sms_log_lid, $this->Session->read('user_id'), $n, false, $this->sms_vendor_id);\n \t\t\t\t\t\n \t\t\t\t\t} else {\n\n \t\t\t\t\t\t//SAVE SMS IN TEMP TABLE\n\t \t\t\t\t\tunset($v);\n\t \t\t\t\t\t$v['message'] = $message;\n\t \t\t\t\t\t$v['numbers'] = !empty($n) ? implode(', ', $n) : '0';\n\t \t\t\t\t\t$v['bulk_user_id'] = $this->Session->read('user_id');\n\t\t\t\t\t\t$v['bulk_senderid_id'] = $bulk_senderid_id;\n \t\t\t\t\t\t$v['bulk_group_id'] = empty($bulk_group_id) ? '0' : $bulk_group_id;\n \t\t\t\t\t\t$v['bulk_sms_log_id'] = $bulk_sms_log_lid;\n \t\t\t\t\t\t$v['sms_vendor_id'] = $this->sms_vendor_id;\n \t\t\t\t\t\t$this->BulkSmsCli->save($v);\n\t \t\t\t\t\t$lastinsertid = $this->BulkSmsCli->getLastInsertId();\n \t\t\t\t\t\n \t\t\t\t\t\n \t\t\t\t\t\t//CALL CLI TO SEND SMS\n \t\t\t\t\t\t$path = \"php \" . WWW_ROOT . \"cron_dispatcher.php /bulksms/send_using_cli/\".$lastinsertid;\n \t\t\t\t\t\t$outputfile = \"/tmp/output.cli.\".$lastinsertid;\n \t\t\t\t\t\t$pidfile = \"/tmp/pid.cli.\".$lastinsertid;\n \t\t\t\t\t\texec(sprintf(\"%s > %s 2>&1 & echo $! >> %s\", $path, $outputfile, $pidfile));\n \t\t\t\t\t\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\t//GET GROUP NAME\n \t\t\t\t\t$groupname = $number = '';\n \t\t\t\t\tif(!empty($bulk_group_id)) {\n\t \t\t\t\t\t$this->BulkGroup->id = $bulk_group_id;\n\t \t\t\t\t\t$groupname = '<br/>Contact(s) from '.$this->BulkGroup->field('name') . ' Group';\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\tif(!empty($n)) {\n \t\t\t\t\t\t$number = '<br/>Mobile Numbers(s) '.implode(', ', $n);\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\t$return_data = 'Message Successfully Send To:'.$groupname.$number;\n\t\t\t \t\tif(strlen($return_data) > 250) $return_data = substr($return_data, 0, 200).'..';\n\t\t\t \t\t\n\t\t\t \t\t$return_data .= '<br/><a href=\"/bulksms/showdetailedreport/'.$bulk_sms_log_lid.'\">View Detailed Delivery Report</a>';\n\t\t\t \t\t\n \t\t\t\t\t$this->Session->write('success', $return_data);\n \t\t\t\t\t$this->redirect('/bulksms/sendnow');\n \t\t\t\t\texit;\n \t\t\t\t\t\n \t\t\t\t} else {\n \t\t\t\t\t$this->set('error', $error);\n \t\t\t\t\t$this->set('message', $message);\n \t\t\t\t\t$this->set('number', $number);\n \t\t\t\t\t$this->set('day', $day);\n \t\t\t\t\t$this->set('month', $month);\n \t\t\t\t\t$this->set('year', $year);\n \t\t\t\t\t$this->set('hour', $hours);\n \t\t\t\t\t$this->set('minutes', $minutes);\n \t\t\t\t}\n \t\t\t\t\n \t\t\t//SCHEDULE\t\n \t\t\t} else {\n \t\t\t\t\n \t\t\t\t/*if($day == '' || $month == '' || $year == '' || $hours == '' || $minutes == '') { \n \t\t\t\t\t$error[] = 'Invalid Date Entered';\n \t\t\t\t} else {*/\n \t\t\t\t\t$date = date('Y-m-d H:i:s', mktime($hours, $minutes, '0', $month, $day, $year));\n \t\t\t\t\tif($date < date('Y-m-d H:i:s')) $error[] = 'Please select a future date';\n \t\t\t\t//}\n \t\t\t\t\n\t\t\t\tif(!($hours > '08' && $hours < '21')) {\n \t\t\t\t\t$error[] = NINE_TO_NINE_ACTIVATED_MESSAGE;\n \t\t\t\t}\n\n \t\t\t\tif(isset($mobile_list) && !empty($mobile_list)) {\n\t \t\t\t\tunset($c);\n\t \t\t\t\tif(count($mobile_list) == 1) $mobile_list = $mobile_list['0'];\n\t \t\t\t\t$c['conditions']['BulkAddressbook.bulk_group_id'] = $bulk_group_id;\n\t \t\t\t\t$c['conditions']['BulkAddressbook.id NOT'] = $mobile_list;\n\t \t\t\t\t$c['conditions']['BulkAddressbook.status'] = '0';\n\t \t\t\t\t$c['fields'] = array('BulkAddressbook.id');\n\t \t\t\t\t$not_included = $this->BulkAddressbook->find('list', $c);\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tif(!isset($error)) {\n \t\t\t\t\t\n \t\t\t\t\t$date = date('Y-m-d H:i:s', mktime($hours, $minutes, '0', $month, $day, $year));\n \t\t\t\t\t$udate = date('jS M, Y g:i a', strtotime($date));\n \t\t\t\t\t\n \t\t\t\t\tunset($v);\n \t\t\t\t\t$v['message'] = $message;\n \t\t\t\t\t$v['bulk_user_id'] = $this->Session->read('user_id');\n \t\t\t\t\t$v['numbers'] = !empty($n) ? implode(',', $n) : '0';\n \t\t\t\t\t$v['not_included'] = !empty($not_included) ? implode(',', $not_included) : '0';\n \t\t\t\t\t$v['scheduledate'] = $date;\n \t\t\t\t\t$v['bulk_senderid_id'] = $bulk_senderid_id;\n \t\t\t\t\t$v['bulk_group_id'] = empty($bulk_group_id) ? '0' : $bulk_group_id;\n \t\t\t\t\t$v['bulk_tag_id'] = $bulk_tag_id;\n \t\t\t\t\t$v['ip'] = ip2long($_SERVER['REMOTE_ADDR']);\n \t\t\t\t\t$this->BulkSmsSchedule->save($v);\n \t\t\t\t\t\n \t\t\t\t\t$this->Session->write('success', 'Message Successfully Scheduled on '.$udate);\n \t\t\t\t\t$this->redirect('/bulksms/sendnow');\n \t\t\t\t\texit;\n \t\t\t\t\t\n \t\t\t\t} else {\n \t\t\t\t\t$this->set('error', $error);\n \t\t\t\t\t$this->set('message', $message);\n \t\t\t\t\t$this->set('number', $number);\n \t\t\t\t\t$this->set('day', $day);\n \t\t\t\t\t$this->set('month', $month);\n \t\t\t\t\t$this->set('year', $year);\n \t\t\t\t\t$this->set('hour', $hours);\n \t\t\t\t\t$this->set('minutes', $minutes);\n \t\t\t\t}\n \t\t\t\t\n \t\t\t}\n \t\t\t\n \t\t}\n \t\t\n \t\tunset($cond);\n \t\t$cond['conditions']['status'] = '0';\n\t \t$cond['conditions']['bulk_user_id'] = $this->Session->read('user_id');\n\t \t$group = $this->BulkGroup->find('list', $cond);\n\t \t$groupname = '<option value=\"0\">Select Group</option>';\n\t \t\n\t \tforeach($group as $key => $value) {\n\t \t\t$groupname .= '<option value=\"'.$key.'\">'.$value.'</option>';\n\t \t}\n\t \t$this->set('groupname', $groupname);\n\t \t\n\t \tunset($cond);\n\t \t$cond['conditions']['status'] = '0';\n\t \t$cond['conditions']['publish'] = '1';\n\t \t$cond['conditions']['bulk_user_id'] = $this->Session->read('user_id');\n\t \t$sender = $this->BulkSenderid->find('list', $cond);\n\t \t$senderid = '';\n\t \t\n\t \tforeach($sender as $key => $value) {\n\t \t\t$senderid .= '<option value=\"'.$key.'\">'.$value.'</option>';\n\t \t}\n\t \t$this->set('senderid', $senderid);\n\t \t\n\t \tunset($cond);\n\t \t$cond['conditions']['status'] = '0';\n\t \t$cond['conditions']['bulk_user_id'] = $this->Session->read('user_id');\n\t \t$data = $this->BulkSmsTag->find('list', $cond);\n\t \t$tag = '';\n\t \t\n\t \tforeach($data as $key => $value) {\n\t \t\t$tag .= '<option value=\"'.$key.'\">'.$value.'</option>';\n\t \t}\n\t \t$this->set('tag', $tag);\n\t \t\n\t \tunset($cond);\n\t \t$cond['conditions']['BulkAccount.status'] = '0';\n\t \t$cond['conditions']['BulkAccount.bulk_user_id'] = $this->Session->read('user_id');\n\t \t$quantity = $this->BulkAccount->field('BulkAccount.quantity', $cond['conditions']);\n\t \t$this->set('quantity', $quantity);\n\t \t\n \t\t$this->layout = 'bulksms';\n \t\t$this->set('tab', array('2'));\n\t\t//$this->getFeedback();\n\t\t\n \t\tif($this->Session->check('success')) {\n \t\t\t$this->set('success', $this->Session->read('success'));\n \t\t\t$this->Session->delete('success');\n \t\t}\n \n \t}", "function clickatell_sendsms($smsmessage,$to=null,$echoing=0) {\n\t\n\t if ($to)\n\t $sendto = substr_replace($to,'+',0,0); //add + at the beggining of the to\n\t else \n\t $sendto = $this->tolist;//+ included\t\n\t\t\n // your user ID on clickatell\n $userid = $this->user;\n $password = $this->pwd;\n\t $api = $this->httpapi;\n // comma-separated list of group names, and/or mobile numbers in international format\n $to = $sendto;\n // message to send\n $message = rawurlencode($smsmessage);\n // if you want to send a message Unicode-encoded in UCS2, you first need to convert\n // the message from UTF-8 (assuming you have UTF-8 encoding in the HTML page, or whatever source)\n //$message = bin2hex( iconv(\"UTF-8\",\"UTF-16BE\",\"YOUR_MESSAGE\") ); // UTF-16BE = UCS-2\n $lang = 'ucs2';\n \n $url = 'http://api.clickatell.com/http/sendmsg';//?user=balexiou&password=PASSWORD&api_id=3239691&to=306936550848&text=Message';\n $fullUrl = \"$url?user=$userid&password=password&api=$api&to=$to&text=$message\";//&lang=$lang\";\n\t //echo $fullUrl;\n // try to send the parameters to smsgui.com\n // if the connection is successful, the result is received in the $contents array\n $this->contents = @file( $fullUrl );\n if( !$contents ) {\n\t //echo \"<br>Error accessing URL: $fullUrl\";\n\t\tif ($echoing) echo \"Error: sending SMS!\";\n\t }\t\n else {\n $code = $contents[0][0]; // read just the very first character from the result\n\t\tif ($echoing) {\n switch( $code ){\n\t\t\tcase '0': echo \"Error: \" . $this->contents[0]; break;\n\t\t\tcase '1': echo \"Warning: \" . $this->contents[0]; break;\n\t\t\tcase '2': echo \"OK: \" . $this->contents[0]; break;\n\t\t\tdefault : echo \"$code - Read failed, or unrecognized code!\";\n }\n\t\t}\n }\n\t \n\t return ($code . $this->contents[0]);\n\t}", "public function gw_send_sms($user,$pass,$sms_from,$sms_to,$sms_msg) \n { \n $query_string = \"api.aspx?apiusername=\".$user.\"&apipassword=\".$pass;\n $query_string .= \"&senderid=\".rawurlencode($sms_from).\"&mobileno=\".rawurlencode($sms_to);\n $query_string .= \"&message=\".rawurlencode(stripslashes($sms_msg)) . \"&languagetype=1\"; \n $url = \"http://gateway.onewaysms.com.au:10001/\".$query_string; \n $fd = @implode ('', file ($url)); \n if ($fd) \n { \n if ($fd > 0) {\n Print(\"MT ID : \" . $fd);\n $ok = \"success\";\n } \n else {\n print(\"Please refer to API on Error : \" . $fd);\n $ok = \"fail\";\n }\n } \n else \n { \n // no contact with gateway \n $ok = \"fail\"; \n } \n return $ok; \n }", "public function sendSMS($data)\n {\n Mobily::send($data['mobile'], $data['message']);\n }", "function sms_messenger($sms){\n\n//username from SMSAPI\n $username = 'bsgh-iquipe';\n//or 'password' => md5('open-text-password'),\n $password = 'passwd82';\n//destination number\n $to = $sms['to'];\n//sender name has to be active\n $from = 'smartpay';\n//message content\n $message = $sms['msg'];\n//API http\n\n $url = 'http://sms.bernsergsolutions.com:8080/bulksms/bulksms?';\n\n $c = curl_init();\n curl_setopt($c,CURLOPT_URL,$url);\n curl_setopt($c,CURLOPT_POST,true);\n curl_setopt($c,CURLOPT_POSTFIELDS, 'username='.$username.\n '&password='.$password.\n '&type=0&dlr=1&destination='.$to.\n '&source='.$from.\n '&message='.$message);\n curl_setopt($c,CURLOPT_RETURNTRANSFER,true);\n $content = curl_exec($c);\n curl_close($c);\n//echo $content;\n\n $str_total = strlen($content);\n $text = 4 - $str_total;\n\n $msg = substr($content,0,$text);\n\n if ($msg == 1701){\n\n return true;\n }else{\n return false;\n }\n}", "public function sms($phone,$message)\n\t{\n\t\t// max of 160 characters\n\t\t// to get a unique name make payment of 8700 to Africastalking/SMSLeopard\n\t\t// unique name should have a maximum of 11 characters\n\t\t\n\t\tif (substr($phone, 0, 1) === '0') \n\t\t{\n\t\t\t$phone = ltrim($phone, '0');\n\t\t}\n\t\t\n\t\t$phone_number = '+254'.$phone;\n\t\t//$phone_number = $phone;\n\t\t// get items \n\n\t\t$configuration = $this->admin_model->get_configuration();\n\n\t\t$mandrill = '';\n\t\t$configuration_id = 0;\n\t\t\n\t\tif($configuration->num_rows() > 0)\n\t\t{\n\t\t\t$res = $configuration->row();\n\t\t\t$configuration_id = $res->configuration_id;\n\t\t\t$mandrill = $res->mandrill;\n\t\t\t$sms_key = $res->sms_key;\n\t\t\t$sms_user = $res->sms_user;\n\n\t\t\t$actual_message = $message;\n\t\t\t// var_dump($actual_message); die();\n\t\t\t// get the current branch code\n\t\t\t$params = array('username' => $sms_user, 'apiKey' => $sms_key); \n\t\n\t\t\t$this->load->library('africastalkinggateway', $params);\n\t\t\t// var_dump($params)or die();\n\t\t\t// Send the message\n\t\t\ttry \n\t\t\t{\n\t\t\t\t//$results = $this->africastalkinggateway->sendMessage($phone_number, $actual_message, $sms_from=22384);\n\t\t\t\t$results = $this->africastalkinggateway->sendMessage($phone_number, $actual_message);\n\t\t\t\t\n\t\t\t\t//var_dump($results);die();\n\t\t\t\t$number = $phone_number;\n\t\t\t\t$status = 'unsent';\n\t\t\t\t\n\t\t\t\tforeach($results as $result) \n\t\t\t\t{\n\t\t\t\t\t$number = $result->number;\n\t\t\t\t\t$status = $result->status;\n\t\t\t\t\t$messageId = $result->messageId;\n\t\t\t\t\t$cost = $result->cost;\n\t\t\t\t\t// status is either \"Success\" or \"error message\"\n\t\t\t\t\t// echo \" Number: \" .$result->number;\n\t\t\t\t\t// echo \" Status: \" .$result->status;\n\t\t\t\t\t// echo \" MessageId: \" .$result->messageId;\n\t\t\t\t\t// echo \" Cost: \" .$result->cost.\"\\n\";\n\t\t\t\t}\n\t\t\t\t$save_data = array(\n\t\t\t\t\t\"sms_result_message\" => $actual_message,\n\t\t\t\t\t\"sms_result_phone\" => $phone_number,\n\t\t\t\t\t\"message_id\" => $messageId,\n\t\t\t\t\t\"sms_result_cost\" => $cost,\n\t\t\t\t\t\"created\" => date('Y-m-d H:i:s')\n\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\tif($this->db->insert('sms_result', $save_data))\n\t\t\t\t{\n\t\t\t\t\treturn $status.' sent to '.$number;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn $status.' sent to '.$number.'. Response not saved';\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tcatch(AfricasTalkingGatewayException $e)\n\t\t\t{\n\t\t\t\t// echo \"Encountered an error while sending: \".$e->getMessage();\n\t\t\t\treturn $e->getMessage();\n\t\t\t}\n\t \n\t\t}\n\t else\n\t {\n\t return 'Configuration not set';\n\t }\n }", "public function run($sms,$title)\n { \n\n }", "function action_woocommerce_send_sms_order_processing($order_id) {\n # code...\n}", "function sms_send($recipient, $message, $originator = \"\", &$errors)\r\n\t{\r\n\t\tglobal $sms_accountno, $sms_pwd;\r\n\t\t// remove any non-digits symbols from number\r\n\t\t$recipient = preg_replace(\"/[^\\d]/\", \"\", $recipient);\r\n\t\t// clear message from return carriage and tab symbols\r\n\t\t$message = str_replace(\"\\r\", \"\", $message);\r\n\t\t$message = str_replace(\"\\t\", \" \", $message);\r\n\r\n\t\tif (!$recipient || !$message) {\r\n\t\t\t$errors = \"Recipient or message is empty.\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\r\n\t\t$sms_url = \"https://api.accessyou.com/sms/sendsms-utf8.php?\";\r\n\t\t$sms_url .= \"accountno=\".urlencode($sms_accountno);\r\n\t\t$sms_url .= \"&pwd=\".urlencode($sms_pwd);\r\n\t\t$sms_url .= \"&msg=\".urlencode($message);\r\n\t\t$sms_url .= \"&phone=\".urlencode($recipient);\r\n\t\tif (strlen($message) > 160) {\r\n\t\t\t$sms_url .= \"&size=\".urlencode(\"|\");\r\n\t\t}\r\n\t\tif (strlen($originator)) {\r\n\t\t\t$sms_url .= \"&from=\".urlencode($originator);\r\n\t\t}\r\n\r\n\r\n\t\t$ch = curl_init();\r\n\t\tcurl_setopt($ch, CURLOPT_URL, $sms_url);\r\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\r\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\r\n\t\tcurl_setopt($ch, CURLOPT_HEADER, 0);\r\n\t\t//curl_setopt($ch, CURLOPT_POST, 1);\r\n\t\t//curl_setopt($ch, CURLOPT_POSTFIELDS, $post_params);\r\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 20);\r\n\r\n\t\t$result = trim(curl_exec($ch));\r\n\t\tcurl_close($ch);\r\n\r\n\t\tif (!is_numeric($result)) {\r\n\t\t\t$errors = sms_error_desc($result);\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// return SMS ID in case of success\r\n\t\treturn $result;\r\t}", "protected function beforeSending()\n {\n }", "function sendSingleSMS($username, $encryp_password, $senderid, $message, $mobileno, $deptSecureKey) {\n $key = hash('sha512', trim($username) . trim($senderid) . trim($message) . trim($deptSecureKey));\n $data = array(\n \"username\" => trim($username),\n \"password\" => trim($encryp_password),\n \"senderid\" => trim($senderid),\n \"content\" => trim($message),\n \"smsservicetype\" => \"singlemsg\",\n \"mobileno\" => trim($mobileno),\n \"key\" => trim($key)\n );\n return post_to_url(\"https://msdgweb.mgov.gov.in/esms/sendsmsrequest\", $data); //calling post_to_url to send sms \n}", "protected function _mod()\n\t{\n\t\treturn mod('deposit_sms');\n\t}", "public function capture_sms( $request ) {\n\t\tif ( 'sms' !== $request->get_param( 'eventType' ) ) {\n\t\t\twp_send_json_error();\n\t\t}\n\n\t\t// Capture all of the request parameters.\n\t\t$message = $request->get_param( 'text' );\n\t\t$from = str_replace( '+', '', $request->get_param( 'from' ) );\n\t\t$to = str_replace( '+', '', $request->get_param( 'to' ) );\n\n\t\t// Find the account.\n\t\t$account = $this->plugin->accounts->get_by_number( $to );\n\n\t\t// Stop if we can't find an account.\n\t\tif ( ! $account ) {\n\t\t\twp_send_json_error();\n\t\t}\n\n\t\t// Stop if the message is blank.\n\t\tif ( empty( $message ) ) {\n\t\t\twp_send_json_error();\n\t\t}\n\n\t\t$subscriber_id = $this->plugin->subscribers->get_id_by_number( $from );\n\n\t\t// Create the subscriber if they don't exist.\n\t\tif ( ! $subscriber_id ) {\n\t\t\t$subscriber_id = $this->plugin->subscribers->create( $from, $account['id'] );\n\t\t}\n\n\t\t// Create the message.\n\t\t$message_id = $this->plugin->messages->create( $message, $account['id'], 'incoming' );\n\n\t\t// Attach the sender to the message.\n\t\t$message_groups = $this->plugin->messages->attach_subscribers( $message_id, array( $subscriber_id ) );\n\n\t\twp_send_json_success( $message_groups ); \n\n\t\t$keyword_ids = get_post_meta( $nock_number->ID, 'keywords', true );\n\t\t$keywords = array();\n\n\t\tforeach ( $keyword_ids as $keyword_id ) {\n\t\t\t$keywords[] = strtolower( get_the_title( $keyword_id ) );\n\t\t}\n\n\t\t$first_word = $this->get_first_word_of_sms( $message );\n\n\t\tif ( ! in_array( $first_word, $keywords ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\techo \"Add the user if they don't already exist\";\n\t\texit;\n\t\t$message_args = array(\n\t\t\t'post_type' => 'message',\n\t\t\t'post_status' => 'publish',\n\t\t\t'post_content' => $message,\n\t\t\t'post_date' => $request->get_param( 'time' ),\n\t\t\t'meta_input' => array(\n\t\t\t\t'type' => $request->get_param( 'eventType' ),\n\t\t\t\t'direction' => $request->get_param( 'direction' ),\n\t\t\t\t'from_number' => $from,\n\t\t\t\t'to_number' => $to,\n\t\t\t\t'message_id' => $request->get_param( 'messageId' ),\n\t\t\t\t'message_uri' => $request->get_param( 'messageUri' ),\n\t\t\t\t'status' => $request->get_param( 'state' ),\n\t\t\t),\n\t\t);\n\n\t\t$message_id = wp_insert_post( $message_args );\n\n\t\tif ( get_option( 'op_forwarding_number' ) === $from ) {\n\t\t\t$this->reply_to_sms( $message );\n\t\t} else {\n\t\t\t$this->forward_sms_to_phone( $from, $message );\n\t\t}\n\t}", "private function sendSms($order_id,$mobile_no,$msg){\r\n// $language->load($order_info['language_filename']);\r\n// $language->load('sms/order');\r\n\r\n if(SMS_OPEN=='ON'){\r\n $pdate= new DateTime();\r\n\r\n $this->log_admin->debug('IlexDebug:: Send SMS for order '.$order_id);\r\n if($mobile_no!=''&&SMS_OPEN=='ON'){\r\n $mobilephone=trim($mobile_no);\r\n //手机号码的正则验证\r\n if(mobile_check($mobilephone)){\r\n // send sms\r\n $sms=new Sms();\r\n\r\n $this->log_admin->debug('IlexDebug:: 发送短信: '.$msg);\r\n\r\n $msg =$msg;\r\n\t\t\t\t\t$sms->send($mobilephone, $msg);\r\n $this->log_admin->debug('IlexDebug::Already Sended SMS for order '.$order_id);\r\n $this->log_admin->debug('IlexDebug::Already Sended SMS '.$mobilephone.',content '.$msg);\r\n return true;\r\n }else{\r\n //手机号码格式不对\r\n $this->log_admin->debug('IlexDebug:: Wrong Number,dun send sms : sub_order_id '.$order_id);\r\n return false;\r\n }\r\n }\r\n }else{\r\n $this->log_admin->debug('IlexDebug:: SMS_OPEN :'.SMS_OPEN.' sub_order_id '.$order_id);\r\n return false;\r\n }\r\n }", "function se_sms($user_id = 0) {\n\n\t $this->user_id = $user_id;\n\n\t}", "public function sms()\n {\n require_once '/path/to/vendor/autoload.php'; // Loads the library\n\n use Twilio\\Rest\\Client;\n\n $account_sid = 'AC4ddb34f50fdca1d740d28b1a5d77dee0';\n $auth_token = '9c9ab3a3005fd7641683265b682bde80';\n $client = new Client($account_sid, $auth_token);\n\n $messages = $client->accounts(\"AC4ddb34f50fdca1d740d28b1a5d77dee0\")\n ->messages->create(\"+59165343087\", array(\n 'From' => \"+17378885804\",\n 'Body' => \"Hey there alex ;)\",\n ));\n }", "public function supportSms() {\n return $this->har_sms;\n }", "function send_sms($phoneNo=\"\",$messageText)\r\n\t{\r\n\t\t\t \r\n\t\t\t//Your authentication key\r\n\t\t\t$authKey = \"37734AfiN59oTS557ae3d9\";\r\n\t\t\t \r\n\t\t\t//Multiple mobiles numbers separated by comma\r\n\t\t\t$mobileNumber = $phoneNo;\r\n\t\t\t \r\n\t\t\t//Sender ID,While using route4 sender id should be 6 characters long.\r\n\t\t\t$senderId = \"EOKLER\";\r\n\t\t\t \r\n\t\t\t//Your message to send, Add URL encoding here.\r\n\t\t\t$message = urlencode($messageText);\r\n\t\t\t \r\n\t\t\t//Define route\r\n\t\t\t$route = \"2\";\r\n\t\t\t//Prepare you post parameters\r\n\t\t\t$postData = array(\r\n\t\t\t\t\t'authkey' => $authKey,\r\n\t\t\t\t\t'mobiles' => $mobileNumber,\r\n\t\t\t\t\t'message' => $message,\r\n\t\t\t\t\t'sender' => $senderId,\r\n\t\t\t\t\t'route' => $route\r\n\t\t\t);\r\n\t\t\t \r\n\t\t\t//API URL\r\n\t\t\t$url=\"https://control.msg91.com/sendhttp.php\";\r\n\t\t\t \r\n\t\t\t// init the resource\r\n\t\t\t$ch = curl_init();\r\n\t\t\tcurl_setopt_array($ch, array(\r\n\t\t\tCURLOPT_URL => $url,\r\n\t\t\tCURLOPT_RETURNTRANSFER => true,\r\n\t\t\tCURLOPT_POST => true,\r\n\t\t\tCURLOPT_POSTFIELDS => $postData\r\n\t\t\t//,CURLOPT_FOLLOWLOCATION => true\r\n\t\t\t));\r\n\t\t\t \r\n\t\t\t//Ignore SSL certificate verification\r\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\r\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\r\n\t\t\t//get response\r\n\t\t\t$output = curl_exec($ch);\r\n\t\t\t \r\n\t\t\t//Print error if any\r\n\t\t\tif(curl_errno($ch))\r\n\t\t\t{\r\n\t\t\t\techo 'error:' . curl_error($ch);\r\n\t\t\t}\r\n\t\t\t \r\n\t\t\tcurl_close($ch);\r\n\t\t\treturn $output;\r\n\t\t}", "function action_woocommerce_send_sms_order_hold($order_id) {\n # code...\n}", "function action_woocommerce_send_sms_order_pending($order_id) {\n // $log = new WC_Logger();\n // if(get_qt_options( 'enable_sms_completed_order' ) && get_qt_options( 'enable_sms_completed_order' ) == \"on\") {\n // $sms = new SMS_Sender();\n // $message = $sms->generateMessage( get_qt_options('sms_completed_order_pattern'), 'order', $order_id );\n // $response = $sms->sendSMS( $message );\n // $log->log( 'action_woocommerce_send_sms_order_pending', print_r( $response, true ) );\n // }\n}", "public function send_sms($order_no=null,$customer_id=null,$type=null){\n\n $CI =& get_instance();\n $CI->load->model('dashboard/Sms_model','sms_model');\n $gateway = $CI->sms_model->retrieve_active_getway();\n $sms_template = $CI->db->select('*')->from('sms_template')->where('type',$type)->get()->row();\n $sms = $CI->db->select('*')->from('sms_configuration')->get()->row();\n\t\t$customer_info=$CI->db->select('customer_phone')->from('customer_info')->where('customer_id',$customer_id)->get()->row();\n\t\t$recipients = $customer_info->customer_phone;\n\t\t\n\t\t $sms_type= strtolower($sms_template->type);\n if($sms_type == \"neworder\" || $sms_type == \"completeorder\" || $sms_type == \"processing\" || $sms_type == \"cancel\"){ \n $message= str_replace('{id}', $order_no, $sms_template->message);\n }\n if(1 == $gateway->id ){\n\n\n /****************************\n * SMSRank Gateway Setup\n ****************************/\n $CI =& get_instance();\n $url = \"http://api.smsrank.com/sms/1/text/singles\"; \n $username = $gateway->user_name;\n $password=base64_encode($gateway->password); \n $message=base64_encode($message);\n $curl = curl_init();\n\n curl_setopt($curl, CURLOPT_URL, \"$url?username=$username&password=$password&to=$recipients&text=$message\");\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n $agent = 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)';\n curl_setopt($curl, CURLOPT_USERAGENT, $agent);\n $output = json_decode(curl_exec($curl), true);\n return true;\n curl_close($curl);\n }\n if( 2 == $gateway->id ){\n /****************************\n * nexmo Gateway Setup\n ****************************/\n $api = $gateway->user_name;\n $secret_key = $gateway->password;\n $message = $message;\n $from = $gateway->sms_from; \n\n $data = array(\n 'from' => $from,\n 'text' => $message,\n 'to' => $recipients\n );\n require_once APPPATH.'libraries/nexmo/vendor/autoload.php';\n $basic = new \\Nexmo\\Client\\Credentials\\Basic($api, $secret_key);\n $client = new \\Nexmo\\Client($basic);\n $message = $client->message()->send($data);\n if(!$message) \n { \n return json_encode(array(\n 'status' => false,\n 'message' => 'Curl error: '\n ));\n } else { \n return json_encode(array(\n 'status' => true,\n 'message' => \"success: \"\n )); \n }\n }\n\n if( 3 == $gateway->id ){\n /****************************\n * budgetsms Gateway Setup\n ****************************/\n $message = $message;\n $from = $gateway->sms_from; \n $userid = $gateway->userid; \n $username = $gateway->user_name; \n $handle = $gateway->password; \n\n $data = array(\n 'handle' => $handle,\n 'username' => $username,\n 'userid' => $userid,\n 'from' => $from,\n 'msg' => $message,\n 'to' => $recipients\n );\n\t\t\t\t\n\t\t$url = \"https://api.budgetsms.net/sendsms/?\"; \n\n $curl = curl_init($url);\n curl_setopt($curl, CURLOPT_POST, 1);\n curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n $response = curl_exec($curl); \n\t\t \n if(curl_errno($curl)) \n { \n return json_encode(array(\n 'status' => false,\n 'message' => 'Curl error: ' . curl_error($curl)\n ));\n } else { \n return json_encode(array(\n 'status' => true,\n 'message' => \"success: \". $response\n )); \n } \n\n curl_close($curl);\n\n\n }\n\n}", "function sendMessage($to,$message){\n $message = urlencode($message);\n $sender= urlencode(\"TrailApp\");\n $mobile = $to;\n $url = 'http://www.multitexter.com/tools/geturl/[email protected]&password=NUSKT&sender='.$sender.'&message='.$message .'&flash=0&recipients='. $mobile;\n $ch = curl_init();\n curl_setopt($ch,CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n $resp = curl_exec($ch);\n curl_close($ch);\n //echo $resp;\n if($resp==\"100\"){\n return true;\n }\n return true;\n}", "function send_sms($message,$to,$from=null){\n if($from && strlen($from)>11){\n $from = substr($from,0,11);\n }\n $url = $this->api_base_url.\"/messages?app_id=\".$this->app_id.\"&app_secret=\".base64_encode($this->app_secret);\n $data['to'] = $to; \n $data['from']= $from;\n $data['message'] = $message;\n\n $this->result = $this->send_request($url, \"POST\", [],$data, true);\n return ($this->result->success && $this->result->message==\"MESSAGE SENT.\");\n }", "public function sendQuickSMS()\n {\n if (app_config('sender_id_verification') == '1') {\n $all_sender_id = SenderIdManage::where('status', 'unblock')->get();\n $all_ids = [];\n\n foreach ($all_sender_id as $sid) {\n $client_array = json_decode($sid->cl_id);\n\n if (isset($client_array) && is_array($client_array) && in_array('0', $client_array)) {\n array_push($all_ids, $sid->sender_id);\n } elseif (isset($client_array) && is_array($client_array) && in_array(Auth::guard('client')->user()->id, $client_array)) {\n array_push($all_ids, $sid->sender_id);\n }\n }\n $sender_ids = array_unique($all_ids);\n\n } else {\n $sender_ids = false;\n }\n\n $gateways = json_decode(Auth::guard('client')->user()->sms_gateway);\n $sms_gateways = SMSGateways::whereIn('id', $gateways)->where('status', 'Active')->get();\n $country_code = IntCountryCodes::where('Active', 1)->select('country_code', 'country_name')->get();\n\n return view('client.send-quick-sms', compact('sender_ids', 'country_code', 'sms_gateways'));\n }", "function sendUnicodeOtpSMS($username, $encryp_password, $senderid, $messageUnicode, $mobileno, $deptSecureKey) {\n $finalmessage = string_to_finalmessage(trim($messageUnicode));\n $key = hash('sha512', trim($username) . trim($senderid) . trim($finalmessage) . trim($deptSecureKey));\n $data = array(\n \"username\" => trim($username),\n \"password\" => trim($encryp_password),\n \"senderid\" => trim($senderid),\n \"content\" => trim($finalmessage),\n \"smsservicetype\" => \"unicodeotpmsg\",\n \"mobileno\" => trim($mobileno),\n \"key\" => trim($key)\n );\n post_to_url_unicode(\"https://msdgweb.mgov.gov.in/esms/sendsmsrequest\", $data); //calling post_to_url_unicode to send single unicode sms \n}", "function newsletters_page() {\r\n //including file for send newsletter\r\n if ( \"send_newsletter\" == $_REQUEST['newsletter_action'] && ( $_REQUEST['newsletter_id'] || $_REQUEST['send_id'] ) ) {\r\n require_once( $plugin_dir . \"email-newsletter-files/page-send-newsletter.php\" );\r\n return;\r\n }\r\n\r\n require_once( $plugin_dir . \"email-newsletter-files/page-newsletters.php\" );\r\n }", "function sendFaildVer(){\n\n}", "public function preSend()\n {\n }", "public function clean()\n\t{\n\t\t(($sPlugin = Phpfox_Plugin::get('mail.component_controller_compose_mobile_clean')) ? eval($sPlugin) : false);\n\t}", "function sendSingleUnicode($username, $encryp_password, $senderid, $messageUnicode, $mobileno, $deptSecureKey) {\n $finalmessage = string_to_finalmessage(trim($messageUnicode));\n $key = hash('sha512', trim($username) . trim($senderid) . trim($finalmessage) . trim($deptSecureKey));\n $data = array(\n \"username\" => trim($username),\n \"password\" => trim($encryp_password),\n \"senderid\" => trim($senderid),\n \"content\" => trim($finalmessage),\n \"smsservicetype\" => \"unicodemsg\",\n \"mobileno\" => trim($mobileno),\n \"key\" => trim($key)\n );\n $result= post_to_url_unicode(\"https://msdgweb.mgov.gov.in/esms/sendsmsrequest\", $data); //calling post_to_url_unicode to send single unicode sms \n return $result;\n}", "public function makeSms()\n {\n $sms = strtoupper($this->search_words);\n switch ($this->definitions_count) {\n case 0:\n $sms .= \" | No definitions found.\";\n break;\n case 1:\n $sms .= \" | \" .$this->definitions[0];\n\n\n\n\n break;\n default:\n foreach($this->definitions as $definition) {\n $sms .= \" / \" . $definition;\n }\n }\n\n $sms .= \" | \" . $this->response;\n\n // Really need to refactor this double :/\n $this->sms_message = $sms;\n\n }", "function taqnyatSms($msgBody , $reciver)\n{\n $setting = \\App\\Setting::find(1);\n $bearer = $setting->bearer_token;\n $sender = $setting->sender_name;\n $taqnyt = new TaqnyatSms($bearer);\n\n $body = $msgBody;\n $recipients = $reciver;\n $message =$taqnyt->sendMsg($body, $recipients, $sender);\n// print $message;\n}", "function send_normal_email($sender, $recipient,$subject, $priority, $message)\n{\n\t\t$pres = new presence;\n\t\n\t\t$body = $pres->GetTemplate('presencemail_Sample');\n\t\t$body = $pres->ProcessTemplateFromData($body);\n\t\t$cmsmailer = new \\cms_mailer();\n\t\t$cmsmailer->reset();\n\t//\t$cmsmailer->SetFrom($sender);//$this->GetPreference('admin_email'));\n\t\t$cmsmailer->AddAddress($recipient,$name='');\n\t\t$cmsmailer->IsHTML(true);\n\t\t$cmsmailer->SetPriority($priority);\n\t\t\n\t\t$cmsmailer->SetBody($message);\n\t\t$cmsmailer->SetSubject($subject);\n\t\t$cmsmailer->Send();\n if( !$cmsmailer->Send() ) \n\t\t{\t\t\t\n \treturn false;\n }\n}", "public function sendSMSFromFile()\n {\n if (app_config('sender_id_verification') == '1') {\n $all_sender_id = SenderIdManage::where('status', 'unblock')->get();\n $all_ids = [];\n\n\n foreach ($all_sender_id as $sid) {\n $client_array = json_decode($sid->cl_id);\n\n if (isset($client_array) && is_array($client_array) && in_array('0', $client_array)) {\n array_push($all_ids, $sid->sender_id);\n } elseif (isset($client_array) && is_array($client_array) && in_array(Auth::guard('client')->user()->id, $client_array)) {\n array_push($all_ids, $sid->sender_id);\n }\n }\n $sender_ids = array_unique($all_ids);\n\n } else {\n $sender_ids = false;\n }\n\n $sms_templates = SMSTemplates::where('status', 'active')->where('cl_id', Auth::guard('client')->user()->id)->orWhere('global', 'yes')->get();\n $country_code = IntCountryCodes::where('Active', '1')->select('country_code', 'country_name')->get();\n\n $gateways = json_decode(Auth::guard('client')->user()->sms_gateway);\n $sms_gateways = SMSGateways::whereIn('id', $gateways)->where('status', 'Active')->get();\n $keyword = Keywords::where('user_id', Auth::guard('client')->user()->id)->where('status', 'assigned')->get();\n $schedule_sms = false;\n\n return view('client.send-sms-file', compact('sms_templates', 'sender_ids', 'schedule_sms', 'country_code', 'sms_gateways', 'keyword'));\n }", "function send_mails() {\n\t //$myactivebatch = $this->load_saved_batch();//load direct from file\n\t $myactivebatch = GetParam('batchrestore');//load in html form field and save as param\n\t //echo '>',$myactivebatch;\n\t \n\t $batch = GetReq('batchid');\n\t $bid = GetParam('bid')?GetParam('bid'):0; \n\t \t \n\t $include_subs = GetParam('includesubs');\n\t $include_all = GetParam('includeall');\t \n\t $subscribers = $include_subs?$include_subs:$include_all;//one or another\n\t\n\t $from = GetParam('from');\n\t $to = GetParam('to');\t \n\t $subject = GetParam('subject');\n\t \n\t if ($this->template) {\n\t if ($this->dirdepth) {\n\t\t for($i=0;$i<$this->dirdepth;$i++)\n\t\t\t $backdir .= \"../\";\n\t\t }\n\t\t else\n\t\t $backdir = \"../\";\n\t\t //repalce viewable data to send data (absolute dir)\t \n\t\t //echo $backdir;\n\t\t if ($this->mailbody)//get session text with headers\n\t\t $body = $this->mailbody;\n\t\t else //get text area\n\t $body = str_replace($backdir,$this->url.$this->infolder.'/',GetParam('mail_text')); \t \n\t }\t \n\t else\t{ //text area or session text with headers\n\t \n\t if (GetReq('editmode')) {\n\t\t $mytext = $this->mailbody?$this->mailbody:GetParam('mail_text');\n\t\t $body = $this->unload_spath($mytext);\n\t\t }\n\t\t else\n\t $body = $this->mailbody?$this->mailbody:GetParam('mail_text'); \n\t }\t \t \n\t \t \n\t\t \n\t if ($subscribers) {// || ($batch)) {//if sybs checked or batch in process..\n\t \n\t //save the current mail campaign state\n\t $this->save_current_batch($batch);\t\n\t \t \t \n\t //$subs = $this->subs_mail;\n\t\t \n\t\t //workinh batch tosend\n\t\t $subs = $this->getmails($include_all,$this->batch,$bid);\n\t\t \n\t if (($batch>=0) && ($batch>=$myactivebatch)) {\n\n\t //if ($res = GetGlobal('controller')->calldpc_method('rcshmail.sendit use '.$from.'+'.$to.'+'.$subject.'+'.$body.'+'.$subs)) {\n if ($res = $this->sendit($from,$to,$subject,$body,$subs,$this->ishtml)) {\n\t $this->mailmsg = $res . \" mail(s) send!\";\n\t }\t \n\t else \n\t $this->mailmsg = \"Send failed\";\n\t\t }\n\t\t else \t\n\t\t $this->mailmsg = \"Send bypassed\"; \n\t }\t \n\t else {//one receipent\n\t //if ($res = GetGlobal('controller')->calldpc_method('rcshmail.sendit use '.$from.'+'.$to.'+'.$subject.'+'.$body))\n\t\t if ($res = $this->sendit($from,$to,$subject,$body,null,$this->ishtml)) \n\t\t $this->mailmsg = $res . \" mail(s) send!\";\n\t\t else\n\t\t $this->mailmsg = \"Send failed\";\t\n\t }\t \n\t\t \n\t //auto refresh\n\t $refresh = GetParam('refresh')?GetParam('refresh'):$this->auto_refresh;\n\t if (($refresh>0) && ($res==$this->batch)) {\n $this->refresh_bulk_js(seturl('t=cpsubsend&batchid='.($bid+1).'&batch='.$this->batch.'&refresh='.$refresh),$refresh);\t\t\t \n\t $this->mailmsg .= \"Wait for next batch \" . $this->timeout;\t\t \n\t }\t \n\t \n\t //test\n\t //return $this->batch;\n //return (400);\t \t //??????????????????????????????????????????????????\n\t //echo '---------------------',$res,'---------------------------<br>';\n\t \n\t if ($res<$this->batch) //means end of campaign\n\t $this->reset_batch_state();\n\t \n\t return ($res);//how many mails tried to send (batch...)\t \n\t}", "public function user_conversation_fun(){\n require_once REALTEO_PLUGIN_DIR . '/includes/user_conversation.php';\n }", "function sendSmsFromWoocommercePages()\n {\n $sms = isset($_POST['sms']) ? true : false;\n if (isset($_POST['post_type']) && $_POST['post_type'] == 'shop_order') {\n $order = new WC_Order(intval($_POST['post_id']));\n $phone = get_post_meta(intval($_POST['post_id']), '_billing_phone', true);\n $buyer_sms_data['number'] = explode(',', $phone);\n $buyer_sms_data['number'] = fa_en_mobile_woo_sms($buyer_sms_data['number']);\n $buyer_sms_data['sms_body'] = esc_textarea($_POST['textareavalue']);\n if (!$buyer_sms_data['number'] || empty($buyer_sms_data['number'])) {\n wp_send_json_error(array('message' => 'شماره ای برای دریافت وجود ندارد'));\n exit;\n } elseif (!$buyer_sms_data['sms_body'] || empty($buyer_sms_data['sms_body'])) {\n wp_send_json_error(array('message' => 'متن پیامک خالی است'));\n exit;\n } else {\n $buyer_response_sms = WoocommerceIR_Gateways_SMS::init()->sendSMSir($buyer_sms_data);\n if(ob_get_length())\n ob_clean();\n header('Content-Type: application/json');\n\n if ($buyer_response_sms) {\n $order->add_order_note(sprintf('پیامک با موفقیت به خریدار با شماره موبایل %s ارسال شد . <br/>متن پیامک : %s', $phone, $buyer_sms_data['sms_body']));\n wp_send_json_success(array('message' => 'پیامک با موفقیت ارسال شد'));\n exit;\n } else {\n $order->add_order_note(sprintf('پیامک به خریدار با شماره موبایل %s ارسال نشد . خطایی رخ داده است .<br/>متن پیامک : %s', $phone, $buyer_sms_data['sms_body']));\n wp_send_json_success(array('message' => 'پیامک ارسال نشد. خطایی رخ داده است'));\n exit;\n }\n }\n }\n\n if (isset($_POST['post_type']) && $_POST['post_type'] == 'product') {\n $buyer_sms_data['sms_body'] = esc_textarea($_POST['textareavalue']);\n if (!$buyer_sms_data['sms_body'] || empty($buyer_sms_data['sms_body'])) {\n wp_send_json_error(array('message' => 'متن پیامک خالی است'));\n exit;\n }\n $product_id = intval($_POST['post_id']);\n $group = isset($_POST['group']) ? $_POST['group'] : '';\n if ($group) {\n $product_metas = get_post_meta($product_id, '_ipeir_sms_notification', true) ? get_post_meta($product_id, '_ipeir_sms_notification', true) : '';\n $contacts = explode('***', $product_metas);\n $numbers_list_sms = array();\n\n foreach ((array) $contacts as $contact_type) {\n $contact_types = explode('_vsh_', $contact_type);\n if (count($contact_types) == 2) {\n list( $contact , $type ) = $contact_types;\n } else {\n $contact = $contact_type;\n $type = '';\n }\n\n if (strlen($contact) < 2)\n break;\n list($number, $groups) = explode('|', $contact);\n $groups = explode(',', $groups);\n $type = $type == '' ? '' : explode(',', $type);\n if (in_array($group, $groups)) {\n if (strlen($number) > 5 ) {\n $numbers_list_sms[] = $number;\n }\n }\n }\n $numbers_list_sms = array_unique(explode(',', implode(',', $numbers_list_sms)));\n $numbers_list_sms = array_filter($numbers_list_sms);\n $count_sms = count($numbers_list_sms);\n\n if ($count_sms < 1 || empty($numbers_list_sms)) {\n wp_send_json_error(array('message' => 'شماره ای برای دریافت وجود ندارد'));\n exit;\n }\n $buyer_sms_data['number'] = $numbers_list_sms;\n $buyer_sms_data['number'] = fa_en_mobile_woo_sms($buyer_sms_data['number']);\n $buyer_response_sms = WoocommerceIR_Gateways_SMS::init()->sendSMSir($buyer_sms_data);\n\n if (ob_get_length())\n ob_clean();\n header('Content-Type: application/json');\n\n if ($buyer_response_sms) {\n wp_send_json_success(array('message' => sprintf('پیامک با موفقیت به %s شماره موبایل ارسال شد', $count_sms)));\n exit;\n } else {\n wp_send_json_success(array('message' => 'پیامک ارسال نشد. خطایی رخ داده است'));\n exit;\n }\n }\n }\n }", "function sendSMS($to, $message){\n $username = \"rajnish90\";\n $password = \"redhat123\";\n $senderid = \"BLUETM\";\n\n $url = \"http://www.smsjust.com/blank/sms/user/urlsms.php?\".\n \"username=\".$username.\n \"&pass=\".$password.\n \"&senderid=\".$senderid.\n \"&dest_mobileno=\".$to.\n \"&msgtype=TXT\".\n \"&message=\".urlencode($message).\n \"&response=Y\"\n ;\n //echo $url;\n return httpGet($url);\n}", "public function getSendSMS(){\n return $this->send_sms;\n }", "function sendmsg_load() {\n\tglobal $CBot;\n\t\n\t$CBot->hooks->addHook('privmsg_chan', 'sendmsg_chan');\n\t$CBot->hooks->addHook('privmsg_chancmds', 'sendmsg_cmd');\n}", "function process_message($sender,$message){\n $date_time = date(\"Y/m/d H:i:s\"); \n\n //insert details to message into recsms table\n $query = \"INSERT INTO recsms (date_time,msg,sender_num) VALUES ('$date_time','$message','$sender') \";\n $result_set= mysqli_query($connection,$query);\n if($result_set) {\n \n //echo \"Record has been saved successfully!\";\n \n } \n else {\n // echo \"Record Entry Failed !\";\n }\n\n //getting the id of the entered sms(or last entered row)\n $query= \"SELECT * FROM recsms ORDER BY id DESC LIMIT 1\";\n $result_set= mysqli_query($connection,$query);\n $row=mysqli_fetch_assoc($result_set);\n $rec_id=$row[\"id\"]; //this is the same id for corresponding send message allowing user to crosscheck based on id\n\n //function to seperate based on vendors and output the extracted parts accordingly\n function ext_sms($rec_sms) {\n\n $array=explode(\" \",$rec_sms); \n if($array[0]==\"+\") \n {\n require('functions/fget_huawei.php'); \n return ext_huawei($rec_sms);\n }\n\n else {\n require('functions/fget_ZTE.php');\n return ext_ZTE($rec_sms);\n }\n \n }\n \n $array= ext_sms($message);\n\n //entering region code,alarm name and date-time from received sms into variables\n $region_code=$array['region_code'];\n $alarm=$array['alarm_name'];\n $date_time=$array['date_time'];\n\n //checking weather filtering is enabled for the particular alarm\n $query=\"SELECT* FROM filtersms WHERE alarm_name='$alarm' LIMIT 1\";\n $result_set= mysqli_query($connection,$query);\n\n if (isset($result_set)) { //isset in case alarm name becomes unavailable\n $row = mysqli_fetch_assoc($result_set);\n $filter_alarm = $row['filter_op']; \n \n //code to store sending sms to a single string variable\n $send_message=\"Region : \".$region.\" ; \".\"Alarm : \".$alarm.\" ; \".\"Occurrence : \".$date_time;\n\n if ($filter_alarm == \"1\") { \n\n //taking corresponding region name from regions table\n $query=\"SELECT* FROM regions WHERE region_code='$region_code' LIMIT 1\";\n $result_set= mysqli_query($connection,$query);\n \n if (isset($result_set)) { //isset in case a region_code becomes unavailable\n $row = mysqli_fetch_assoc($result_set);\n $region = $row['region_name'];\n \n //CODE TO SEND SMS\n \n //calling smppclass to send sms\n include ('smppclass.php');\n \n //setting SMPP parameters for sending sms\n $smpphost = \"172.22.88.150\"; //******SPECIFY SMSC IP TO SEND SMS HERE*******\n $smppport = 5020; //******SPECIFY SMSC PORT NUMBER TO SEND SMS HERE*******\n $systemid = \"NOCAlert\"; //******SPECIFY ID TO BIND TRANSMITTER NUMBER HERE*******\n $password = \"noc123\"; //******SPECIFY PASSWORD TO BIND TRANSMITTER NUMBER HERE*******\n $system_type = \"INOC\";\n $from = \"INOC\";\n $smpp = new SMPPClass();\n \n \n $messagefinalstat = \"Ok\";\n $message_sts = \"\";\n \n \n \n //selecting mobile numbers for the respective region\n $query = \" SELECT * FROM regions WHERE region_code = '$region_code'\";\n $result_set= mysqli_query($connection,$query);\n \n $numbersarray = array();\n\n //entering region mobile numbers to an array\n while ($row = mysqli_fetch_assoc($result_set)) {\n \n array_push($numbersarray, $row['mobile_num']);\n \n }\n \n $numberten = \"\";\n for ($ii = 0; $ii < count($numbersarray); $ii++) {\n \n $numbersarray .= $numbersarray[$ii] . \",\";\n }\n\n $numbersarray = rtrim($numbersarray, \",\");\n \n $smpp->SetSender($from);\n $smpp->Start($smpphost, $smppport, $systemid, $password, $system_type);\n $smpp->TestLink();\n \n $smpp->SendMulti($numbersarray, $send_message);\n $smpp->End();\n\n // $msg_status = \"Sent\";\n //Following part addded according to smpp protocol to see success\n \n $message_sts = \"Send Failed\";\n if ($smpp->get_last_message_status() != 0) {\n $message_sts = \"Send Failed\";\n // echo 'Error';\n } else {\n $message_sts = \"Send Success\";\n }\n\n\n } //end isset region_code\n \n } //end if filter alarm\n\n else { $msg_status = \"Not Sent\"; } //not sent when not filtered\n\n //entering data to the sentsms table\n $query= \"INSERT INTO sentsms (id,date_time,region_name,alarm_name,ack) VALUES ($rec_id,'$date_time','$region','$alarm','$msg_status')\";\n $result_set= mysqli_query($connection,$query);\n\n } //end isset alarm_name\n\n }", "function shCleanUpMosMsg($string)\n{\n\treturn ShlSystem_Strings::pr('/(&|\\?)mosmsg=[^&]*/i', '', $string);\n}", "public function uninstall_pre_message()\n\t{\n\t\treturn FALSE;\n\t}", "function send_sms_or_email($inputarray1 = array(), $inputarray2 = array(), $insert = 1, $update = 0, $from_modaration = 0) {\n $choice1 = isset($inputarray1['choice']) ? $inputarray1['choice'] : '';\n $message_id = isset($inputarray1['message_id']) ? $inputarray1['message_id'] : '';\n $smsto = isset($inputarray1['smsto']) ? $inputarray1['smsto'] : '';\n $message = isset($inputarray1['message']) ? $inputarray1['message'] : '';\n\n $name = isset($inputarray2->name) ? $inputarray2->name : '';\n $fatheremail = isset($inputarray2->father_email) ? $inputarray2->father_email : '';\n $fatheremobile = isset($inputarray2->father_mobile) ? $inputarray2->father_mobile : '';\n $email = isset($inputarray2->email) ? $inputarray2->email : '';\n $mobile = isset($inputarray2->mobile) ? $inputarray2->mobile : '';\n $db_students_number = isset($inputarray2->students_number) ? $inputarray2->students_number : '';\n $db_user_name = isset($inputarray2->name) ? $inputarray2->name : '';\n\n //chcking string replace starts here\n //first prepare array of the possible place holders\n $vars = array('%sname%' => $name);\n $message = str_replace(array_keys($vars), $vars, $message);\n //log_message('error', 'composed message: '.$message);\t\t\t\n //chcking string replace ends here\n\n $requireddata = array();\n $requireddata['message'] = $message;\n\n\n //insert the data in student_messages table\n $db_messagetype = '';\n $db_student_id = isset($inputarray2->user_id) ? $inputarray2->user_id : '';\n $db_status = '';\n if (IS_MODARATION_REQUIRES == TRUE && $from_modaration == 0) {\n $db_status = 'modaration';\n }\n\n\n $db_sentto = '';\n $db_message_error = 'no_error';\n if ($choice1 == 1) {\n $db_messagetype = 'email';\n //email\n //now check for parent or student\n if ($smsto == 'parent') {\n //now take parent email\n $requireddata['contactpoint'] = $fatheremail;\n $db_sentto = $personval = 'parent';\n } else if ($smsto == 'student') {\n //now take student email\n $requireddata['contactpoint'] = $email;\n $db_sentto = $personval = 'student';\n } else {\n return;\n }\n\n if (!empty($requireddata['contactpoint'])) {\n if ($db_status == '') {\n $db_status = 'sent';\n $this->load->library('my_email_lib');\n $this->my_email_lib->html_email($requireddata['contactpoint'], $message);\n //now send email\n //log_message('error', 'email sending to'.$requireddata['contactpoint']);\n }\n } else {\n\n //if($db_status=='')\n //{\n $db_status = 'failed';\n //}\n\n if ($personval == 'student') {\n $db_message_error = 'stu_email';\n } else {\n $db_message_error = 'parent_email';\n }\n log_message('error', 'no email present for ' . $personval);\n }\n //now send email using email library\n } else if ($choice1 == 2) {\n $db_messagetype = 'sms';\n //now check for parent or student\n if ($smsto == 'parent') {\n //now take parent mobile number\n $requireddata['contactpoint'] = $fatheremobile;\n $db_sentto = $personval = 'parent';\n } else if ($smsto == 'student') {\n //now take student mobile\n $requireddata['contactpoint'] = $mobile;\n $db_sentto = $personval = 'student';\n } else {\n return;\n }\n\n //now send sms using sms library\t\t\t\n if (!empty($requireddata['contactpoint'])) {\n if ($db_status == '') {\n $db_status = 'sent';\n //now send sms\n //log_message('error', 'sms sending to'.$requireddata['contactpoint']);\n $this->load->library('sms_lib');\n $this->sms_lib->send_sms($requireddata['contactpoint'], $message);\n }\n } else {\n //if($db_status=='')\n //{\n $db_status = 'failed';\n //}\n if ($personval == 'student') {\n $db_message_error = 'stu_mobile';\n } else {\n $db_message_error = 'parent_mobile';\n }\n log_message('error', 'no mobile number present for ' . $personval);\n }\n } else {\n return;\n }\n if ($insert == 1) {\n $insertqstr = \"insert into student_messages(user_id,student_number,user_name,message,message_type,status,sent_to,message_error,more_info) \n\t\t\t\tvalues('\" . $db_student_id . \"','\" . $db_students_number . \"','\" . $db_user_name . \"','\" . addslashes($message) . \"','\" . $db_messagetype . \"','\" . $db_status . \"','\" . $db_sentto . \"','\" . $db_message_error . \"','\" . serialize($inputarray2) . \"')\";\n //log_message('error', 'insert str '.$insertqstr);\n $this->db->query($insertqstr);\n }\n\n if ($update == 1 && $message_id != '') {\n $updatestr = \"update student_messages set sent_date='\" . date('Y-m-d H:i:s') . \"',status='\" . $db_status . \"' where id=\" . $message_id;\n $this->db->query($updatestr);\n }\n }", "public function send(){\n\t\t$statusStr = array(\n\t\t\"0\" => \"短信发送成功\",\n\t\t\"-1\" => \"参数不全\",\n\t\t\"-2\" => \"服务器空间不支持,请确认支持curl或者fsocket,联系您的空间商解决或者更换空间!\",\n\t\t\"30\" => \"密码错误\",\n\t\t\"40\" => \"账号不存在\",\n\t\t\"41\" => \"余额不足\",\n\t\t\"42\" => \"帐户已过期\",\n\t\t\"43\" => \"IP地址限制\",\n\t\t\"50\" => \"内容含有敏感词\"\n\t\t);\n\t\t$yzm=rand(100000,999999);\n\t\t/* session('sendtime',time());\n\t\tsession('code',$yzm);\n\t\tsession('phonenum',$phone); */\n \n\t\t$smsapi = \"http://api.smsbao.com/\";\n\t\t$user = \"hyl123456789\"; //短信平台帐号\n\t\t$pass = md5(\"hyl123456\"); //短信平台密码\n\t\t$content=\"【易菜篮】您的验证码为:\" . $yzm . \"。5分钟内输入有效。\";//要发送的短信内容\n\t\t$phone = input('param.phone');//\"*****\";//要发送短信的手机号码\n session('code',$yzm); //验证码存入session\n session('phonenum',$phone); //手机号存入session\n session('sendtime',time()); //发送时间存入session\n\t\t$sendurl = $smsapi.\"sms?u=\".$user.\"&p=\".$pass.\"&m=\".$phone.\"&c=\".urlencode($content);\n\t\t$result =file_get_contents($sendurl);\n\t\t\n\t\t//print_r(session('code'));die;\n\t\t\n\t\t//print_r(session('code'));die;\n\t\t\n\t\tif ($result==0){\n\t\t\t\n\t\t\t$data['status']=1;\n\t\t\t$data['info']=\"验证码发送成功!\";\n\t\t\t$msg=json_encode($data);\n\t\t\techo $msg;\n\t\t\treturn;\n\t\t} else {\n\t\t\t$data['status']=0;\n\t\t\t$data['info']=\"验证码发送失败\";\n\t\t\t$msg=json_encode($data);\n\n\t\t\techo $msg;\n\t\t\treturn;\n\t\t} \n\t\t//echo $statusStr[$result];\n\t}", "public function generate() {\n\n /** @var $code String generate code */\n\n $code = (new Users())->phoneNumber_GenerateCode();\n\n /** @var $user Array get the details of a current user */\n\n $user = (new Users())->current_user();\n\n /**\n * @var $phone_format String format mobile phone number\n * to non space and non special character format\n */\n\n $phone_format = preg_replace(\"/[\\W\\s]/m\",\"\",$user['CP']);\n\n /** @var $template String a message to send **/\n\n $template = \"From SCOA, use this code to verify your account '{$code}' \";\n\n /** @void send sms and notify the current user */\n\n sms::send($phone_format,$template);\n\n }", "function newsletters_dashboard_page() {\r\n //including file for send newsletter\r\n if ( \"send_newsletter\" == $_REQUEST['newsletter_action'] && ( $_REQUEST['newsletter_id'] || $_REQUEST['send_id'] ) ) {\r\n require_once( $plugin_dir . \"email-newsletter-files/page-send-newsletter.php\" );\r\n return;\r\n }\r\n\r\n require_once( $plugin_dir . \"email-newsletter-files/page-newsletters-dashboard.php\" );\r\n }", "function sms()\n {\n return app('azima-sms');\n }", "function L_sendSms ($msg, $id, $numberto) {\n\t\t\n\t\t$result = false;\n\t\t\n\t\t$ch = curl_init(\"http://sms.ru/sms/send\");\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 30);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, array(\n\n\t\t\t\"api_id\"\t\t=>\t$id,\n\t\t\t\"to\"\t\t\t=>\t$numberto,\n\t\t\t\"text\"\t\t=>\ticonv(\"windows-1251\",\"utf-8\",$msg)\n\n\t\t));\n\t\t\n\t\t$body = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\t\n\t\t($body != false) ? $result = true : $result = false;\n\t\t\n\t\treturn $result;\n\t\t\n\t}", "function sendSmsdynamic($link,$msg, $mobile, $schedule=\"\", $sentid=\"\", $action=1,$lang=0)\n{\n\t//$smspass = \"Right@12\";//$rowSms['smspass']; // sms password \n\t//$smssender = \"PROSYS\"; //$rowSms['smssender']; // sms sender id\t\n\t\n\t$smsuname = \"opencompas\"; //$rowSms['smsuname']; // sms user name \n\t$smspass = \"welcome@123\";//$rowSms['smspass']; // sms password \n\t$smssender = \"COMPAS\"; //$rowSms['smssender']; // sms sender id\n\t$veruname = \"username\"; //$rowSms['veruname']; // variable name of user name\n\t$verpass = \"pass\";//$rowSms['verpass']; // variable name of password\n\t$versender = \"senderid\";//$rowSms['versender']; // variable name of sender id\n\t$vermessage = \"message\";//$rowSms['vermessage']; // variable name of message\n\t$vermob = \"dest_mobileno\";//$rowSms['vermob']; // variable name of to (mobile no)\n\t\n\t$verdate = \"dt\";//$rowSms['verdate']; // variable of date field for schedule sms\n\t$verpatter = \"yyyy-mm-dd hh:mm:ss\";//$rowSms['verpatter']; // pattern of date field e.g. ddmmyyyy\n\t$working_key = \"\"; //$rowSms['working_key'];// working key\n\t$verkey = \"workingkey\";// $rowSms['verkey']; // variable name of working key\n\t\n\t$api_url = \"smsjust.com\";//\"dndsms.reliableindya.info\";//$rowSms['api_url']; // API URL\n\t$send_api = \"/sms/user/urlsms.php\";//$rowSms['send_api']; // sending page name \n\t\n\t$chk_bal_api = \"/sms/user/balance_check.php\";//$rowSms['chk_bal_api'];// balance check api\n\t$sch_api = \"/sms/user/urlsms.php\";// $rowSms['sch_api']; // schedule api\n\t$status_api = \"/sms/user/response.php\";//$rowSms['status_api']; // status api\n\t\n\t\n\t//echo \"Called\";\n\t$request = \"\"; //initialize the request variable\n\tif($api_url==\"smsjust.com\" )\n\t{\n\t\t$api_url='smsjust.com';\n\t\t$host='smsjust.com';\n\t\t$ch = curl_init();\n\t}\n\t\n\tif($working_key == \"\")\n\t{\n\t\tif(($action==2 && ($api_url == \"smsjust.com\" )))\n\t\t{\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$param[$veruname] = $smsuname; //this is the username of our TM4B account\n\t\t\t$param[$verpass] = $smspass; //this is the password of our TM4B account\n\t\t\t\n\t\t\tif($action==1)\n\t\t\t$param[$vermob] = $mobile; //these are the recipients of the message\n\t\t}\n\t}\n\telse\n\t{\n\t\tif(($action==2 && ($api_url == \"smsjust.com\")))\n\t\t{\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$param[$verkey] = $working_key; //this is the key of our TM4B account\n\t\t\t\n\t\t\tif($action==1)\n\t\t\t$param[$vermob] = \"91\".$mobile; //these are the recipients of the message\n\t\t}\n\t}\n\t\n\tif($action==1)\n\t{\n\t\t$param[$versender] = $smssender;//this is our sender \n\t\t$param[$vermessage] = $msg; //this is the message that we want to send\n\t}\n\telse if($action==2)\n\t{\n\t\tif($api_url == \"smsjust.com\" )\n\t\t{\n\t\t\t$param['Scheduleid'] =$sentid;\n\n\t\t}\n\t\telse\n\t\t{\n\t\t$param['messageid'] = $sentid;//this is our sender \n\t\t}\n\t}\n\tif(( $api_url==\"smsjust.com\") && $action!=2)\n\t{\n\t\t$param['response'] = 'Y';// variable name of responce for websms\n\t}\n\t// for schedule //\n\tif($schedule!=\"\")\n\t{\n\t\t$timearr = explode(\" \",$schedule);\n\t\t\n\t\t$dateoftime = $timearr[0];\n\t\t$timeoftime = $timearr[1];\n\t\t\n\t\t$datearr = explode(\"-\",$dateoftime); // explode Date //\n\t\t$yyyy = $datearr[0]; // year\n\t\t$mm = $datearr[1]; // month\n\t\t$dd = $datearr[2]; // day\n\t\t\n\t\t$datearr = explode(\":\",$timeoftime);\n\t\t$hh = $datearr[0];\n\t\t$mmt = $datearr[1];\n\t\t$ss = $datearr[2];\n\t\t\n\t\t$scdltime = strtolower($verpatter);\n\t\t$scdltime = str_replace(\"yyyy\",$yyyy,$scdltime);\n\t\t$scdltime = str_replace(\"dd\",$dd,$scdltime);\n\t\t$scdltime = str_replace(\"hh\",$hh,$scdltime);\n\t\t$scdltime = str_replace(\"ss\",$ss,$scdltime);\n\t\t$scdltime = preg_replace('/mm/i', $mm, $scdltime, 1);\n\t\t$scdltime = str_replace(\"mm\",$mmt,$scdltime);\n\t\tif(($api_url==\"smsjust.com\"))\n\t\t{\n\t\t\t$param['dt'] = \"$yyyy-$mm-$dd\";\n\t\t\t$param['tm'] = \"$hh-$mmt-$ss\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$param[$verdate] = $scdltime; //this is the schedule datetime //\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}\n\t//print_r($param);\t\n\tforeach($param as $key=>$val) //traverse through each member of the param array\n\t{ \n\t\t$request.= $key.\"=\".urlencode($val); //we have to urlencode the values\n\t\t$request.= \"&\"; //append the ampersand (&) sign after each paramter/value pair\n\t}\n\tif($lang!=0 && $api_url!=\"smsjust.com\")\n\t{\n\t\t$request.=\"unicode=1&\";\n\t}\n\telseif($lang!=0 && ($api_url==\"smsjust.com\"))\n\t{\n\t\t$request.=\"msgtype=UNI&\";\n\t}\n\t\n\t\n\t$request = substr($request, 0, strlen($request)-1); //remove the final ampersand sign from the request\n\t//echo $request;\n\n\tif($action==\"1\") // 1 for send sms //\n\t$process_api = trim($send_api,\"/\");\n\telse if($action==\"2\") // 2 for Delivery report //\n\t$process_api = trim($status_api,\"/\");\n\telse if($action==\"3\") // 3 for check balance //\n\t$process_api = trim($chk_bal_api,\"/\");\n\t\n\t\n\t//First prepare the info that relates to the connection\n\t$host = $api_url;\n\t$script = \"/$process_api\";\n\t$request_length = strlen($request);\n\t$method = \"POST\"; // must be POST if sending multiple messages\n\tif ($method == \"GET\") \n\t{\n\t $script .= \"?$request\";\n\t}\n\tif($api_url == \"smsjust.com\" )\n\t{\n\t\t $url=\"http://$host$script?$request\";\n\t\t curl_setopt($ch,CURLOPT_URL, $url);\n\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n\t\t$output= curl_exec($ch);\n\t\t\n\t\tcurl_close($ch);\n\t\t\n\t\t//if($action == 1)die;\n\t}\n\telse\n\t{\n\t\t//Now comes the header which we are going to post. \n\t\t$header = \"$method $script HTTP/1.1\\r\\n\";\n\t\t$header .= \"Host: $host\\r\\n\";\n\t\t$header .= \"Content-Type: application/x-www-form-urlencoded\\r\\n\";\n\t\t$header .= \"Content-Length: $request_length\\r\\n\";\n\t\t$header .= \"Connection: close\\r\\n\\r\\n\";\n\t\t$header .= \"$request\\r\\n\";\n\t\t\n\t\t//echo $header;\n\t\t//Now we open up the connection\n\t\t$socket = @fsockopen($host, 80, $errno, $errstr); \n\t\tif ($socket) //if its open, then...\n\t\t{ \n\t\t fputs($socket, $header); // send the details over\n\t\t while(!feof($socket))\n\t\t {\n\t\t\t $output[] = fgets($socket); //get the results \n\t\t\t\t\t\n\t\t }\n\t\t fclose($socket); \n\t\t}\n\t}\n\t\t\n\tif($action==1) // sent sms //\n\t{\n\t\tif($api_url==\"alerts.reliableindya.info\")\n\t\t{\n\t\t\t$cntOutput = count($output);\n\t\t\t$lastValue = $output[$cntOutput-1];\n\t\t\t\n\t\t\t$expLastValue = explode(\"=\",$lastValue);\n\t\t\t$cntLastValue = count($expLastValue);\n\t\t\t$messageid = $expLastValue[$cntLastValue-1];\n\t\t\t\n\t\t\treturn $messageid;\n\t\t}\n\t\telse if($api_url==\"dndsms.reliableindya.info\" || $api_url==\"bulk.reliableindya.info\" || $api_url==\"dndsms.reliableservices.org\")\n\t\t{\n\t\t\t//$messageid = trim($output[22]).\"||\".trim($output[21]);\n\t\t\t$messageid = trim($output[22]);\n\t\t\treturn $messageid; //substr($lastBal,4);\n\t\t}\n\t\tif($api_url==\"smsjust.com\")\n\t\t{\n\t\t\treturn $output;\n\t\t}\n\t\t\n\t}\n\telse if($action==2) // delivery report //\n\t{\n\t\treturn $output;\n\t}\n\telse if($action==3) // check balance //\n\t{\n\t\tif($api_url==\"alerts.reliableindya.info\")\n\t\t{\n\t\t\t$balamount = \"\";\n\t\t\t//print_r($output);\n\t\t\tforeach($output as $op)\n\t\t\t{\n\t\t\t\tif(strpos($op,'credits')!==false)\n\t\t\t\t$balamount = $op;\n\t\t\t}\n\t\t\t//return preg_replace(\"/[^0-9]/\",\"\",$output[9]);\n\t\t\treturn preg_replace(\"/[^0-9.]/\",\"\",$balamount);\n\t\t}\n\t\telse if($api_url==\"smsjust.com\")\n\t\t{\n\t\t\t$outArr = explode(\":\",$output);\n\t\t\t$output = trim($outArr[1]);\n\t\t\treturn $output;\n\t\t}\n\t}\n\t\n}", "function action_woocommerce_send_sms_order_completed($order_id) {\n $log = new WC_Logger();\n if(get_qt_options( 'enable_sms_completed_order' ) && get_qt_options( 'enable_sms_completed_order' ) == \"on\") {\n $sms = new SMS_Sender();\n $message = $sms->generateMessage( get_qt_options('sms_completed_order_pattern'), 'order', $order_id );\n $response = $sms->sendSMS( $message );\n $log->log( 'action_woocommerce_send_sms_order_completed', print_r( $response, true ) );\n }\n}", "function sendSMS($sender, $text, $phone, $datetime, $sms_lifetime){\n\t\treturn $this->gateway->execCommad('sendSMS',array('sender' => $sender, 'text' => $text, 'phone' => $phone, 'datetime' => $datetime, 'sms_lifetime' => $sms_lifetime, 'type' => 2));\n\t}", "private function sysalert($to, $msg) {\n\n $SUBJ = \"WontBlinkBox Monitoring Notification\";\n\n $alrt = new Messenger();\n\n if(!empty($msg)) {\n\n return $alrt->sendmail($to, $msg, $SUBJ);\n\n }\n\n else {\n\n return;\n\n }\n\n }", "public function sendsms($to, $msg)\n\t{\n\t\tif($this->isloggedin)\n\t\t{\n\t\t\t// only split if the message length is greater than 140\n\t\t\tif (strlen($msg) > 140) {\n\t\t\t\t$msg_parts = str_split($msg, 130);\n\t\t\t\t$i = 1;\n\t\t\t\tforeach($msg_parts as $msg_part)\n\t\t\t\t{\n\t\t\t\t\t$count_string = \" [\" . $i++ . \"/\" . count($msg_parts) . \"]\";\n\t\t\t\t\t$fields = array('HiddenAction'=>'instantsms', 'catnamedis'=>'Birthday', 'Action'=>$this->action,'chkall'=>'on', 'MobNo'=>$to, 'textArea'=>urlencode($msg_part . $count_string));\n\t\t\t\t\t$this->curl_request($this->SMSURL, $fields, true);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$fields = array('HiddenAction'=>'instantsms', 'catnamedis'=>'Birthday', 'Action'=>$this->action,'chkall'=>'on', 'MobNo'=>$to, 'textArea'=>urlencode($msg));\n\t\t\t\t$this->curl_request($this->SMSURL, $fields, true);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "function sendSMS($mobile,$smsurl,$smsusername,$smspassword,$smssenderid,$text1)\n{\n \n \n $text=str_replace(\" \",\"%20\",$text1);\n $qry_str = $smsurl.$smsusername.\"&password=\".$smspassword.\"&to=\".$mobile.\"&from=\".$smssenderid.\"&message=\".$text;\n echo \"Server returns: \" .$qry_str;\n $qrystr = $qry_str;\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL,$qry_str);\n //echo $ch.\"<br>\"; \n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_TIMEOUT, '5');\n $content = trim(curl_exec($ch));\n curl_close($ch);\n $status=true;\n \n // SMS REQUEST SENT END //\n}", "public function sendsms(){\n\n if($this->IS_DEMO){\n $this->session->set_flashdata('error', $this->config->item('app_demo_edit_err'));\n redirect($this->LIB_CONT_ROOT.'settings', 'refresh'); \n }\n set_time_limit(3600);\n $redir=$this->CONT_ROOT.'?tab=sms';\n $form=$this->input->safe_post();\n $required=array('message');\n foreach ($required as $key) {\n if(!isset($form[$key]) || empty($form[$key])){\n $this->session->set_flashdata('error', 'Please enter message');\n redirect($redir);\n }\n }\n $mobile=$this->SETTINGS[$this->system_setting_m->_SMS_API_USERNAME];\n $apikey=$this->SETTINGS[$this->system_setting_m->_SMS_API_KEY];\n $mask=$this->SETTINGS[$this->system_setting_m->_SMS_MASK];\n if(!$this->is_valid_params($mobile,$apikey,$mask)){\n $this->session->set_flashdata('error', 'Invalid api details. Please update vendor api details first!!!');\n redirect($redir);\n }\n //////////////////////////////////////////////////////////////////\n $classes=$this->class_m->get_values_array('','name',array());\n $filter=array();\n\n if(isset($form['class_id']) && !empty($form['class_id'])){$filter['class_id']=$form['class_id'];}\n if(isset($form['group_id']) && !empty($form['group_id'])){$filter['group_id']=$form['group_id'];}\n if(isset($form['section_id']) && !empty($form['section_id'])){$filter['section_id']=$form['section_id'];}\n if(isset($form['student_id']) && !empty($form['student_id'])){$filter['student_id']=$form['student_id'];}\n $students=$this->student_m->get_rows($filter,array('select'=>'mid,student_id,name,mobile,father_name,roll_number,class_id,date'));\n\n if(count($students)<1){\n $this->session->set_flashdata('error', 'There are no students for selected criteria!!!');\n redirect($redir);\n }\n $message=htmlspecialchars_decode($form['message']);\n $i=0;\n $failed=0;\n $new_pass='';\n $ch=$this->open_curl();\n foreach ($students as $row) { \n $to=$row['mobile'];\n if(strlen($row['mobile'])>8){\n $i++; \n ///////////////////////////////////////\n if(strpos($message, \"{NEWPASSWORD}\") !== false){\n $new_pass=mt_rand(11111,99999);\n $this->student_m->save(array('password'=>$this->student_m->hash($new_pass)),$row['mid']);\n }\n ///////////////////////////////////////\n //conversion keys\n $key_vars=array(\n '{NAME}'=>$row['name'],\n '{ID}'=>$row['student_id'],\n '{ROLLNO}'=>$row['roll_number'],\n '{CLASS}'=>$classes[$row['class_id']],\n '{NEWPASSWORD}'=>$new_pass\n );\n ////////////////////////////////////////\n $sms=strtr($message, $key_vars);\n $this->send_message($ch,$mobile,$apikey,$mask,$to,$sms);\n }else{\n $failed++;\n } \n }\n $this->close_curl($ch);\n ////////////////////////////////////////////////////////////////////////////////\n $this->session->set_flashdata('success', 'Message sent to '.$i.' students and failed for '.$failed.' students.');\n redirect($redir);\n }", "function sms_text_order_shortcode()\n{\n return \"\n\t\t<strong>جزییات سفارش : </strong><br/>\n\t\t<code>{phone}</code> = شماره موبایل خریدار ، \n\t\t<code>{email}</code> = ایمیل خریدار ، \t\n\t\t<code>{order_id}</code> = شماره سفارش ، \n\t\t<code>{post_id}</code> = شماره پست (شماره سفارش اصلی) ، \n\t\t<code>{status}</code> = وضعیت سفارش<br/> \n\t\t<code>{price}</code> = مبلغ سفارش ، \n\t\t<code>{all_items}</code> = آیتم های سفارش ، \n\t\t<code>{all_items_qty}</code> = آیتم های سفارش همراه تعداد ، \n\t\t<code>{count_items}</code> = تعداد آیتم های سفارش <br/> \n\t\t<code>{payment_method}</code> = روش پرداخت ، \n\t\t<code>{shipping_method}</code> = روش ارسال ، \n\t\t<code>{description}</code> = توضیحات خریدار ، \n\t\t<code>{transaction_id}</code> = شماره تراکنش<br/><br/>\n\t\t\n\t\t<strong>جزییات صورت حساب : </strong><br/>\n\t\t<code>{b_first_name}</code> = نام خریدار ، \n\t\t<code>{b_last_name}</code> = نام خانوادگی خریدار ، \n\t\t<code>{b_company}</code> = نام شرکت <br/> \n\t\t<code>{b_country}</code> = کشور ، \n\t\t<code>{b_state}</code> = ایالت/استان ، \n\t\t<code>{b_city}</code> = شهر ، \n\t\t<code>{b_address_1}</code> = آدرس 1 ، \n\t\t<code>{b_address_2}</code> = آدرس 2 ، \n\t\t<code>{b_postcode}</code> = کد پستی<br/><br/>\n\t\t\n\t\t\n\t\t<strong>جزییات حمل و نقل : </strong><br/>\n\t\t<code>{sh_first_name}</code> = نام خریدار ، \n\t\t<code>{sh_last_name}</code> = نام خانوادگی خریدار ، \n\t\t<code>{sh_company}</code> = نام شرکت <br/> \n\t\t<code>{sh_country}</code> = کشور ، \n\t\t<code>{sh_state}</code> = ایالت/استان ، \n\t\t<code>{sh_city}</code> = شهر ، \n\t\t<code>{sh_address_1}</code> = آدرس 1 ،\n\t\t<code>{sh_address_2}</code> = آدرس 2 ، \n\t\t<code>{sh_postcode}</code> = کد پستی<br/><br/>\n\t\t\n\t\";\n}", "function emailconfirmation(){\n\t\t\trequire( dirname(__FILE__) . '/email-confirmation.php' );\n\t\t}", "function sendBulkUnicode($username, $encryp_password, $senderid, $messageUnicode, $mobileNos, $deptSecureKey) {\n $finalmessage = string_to_finalmessage(trim($messageUnicode));\n $key = hash('sha512', trim($username) . trim($senderid) . trim($finalmessage) . trim($deptSecureKey));\n $data = array(\n \"username\" => trim($username), \"password\" => trim($encryp_password),\n \"senderid\" => trim($senderid),\n \"content\" => trim($finalmessage),\n \"smsservicetype\" => \"unicodemsg\",\n \"bulkmobno\" => trim($mobileNos),\n \"key\" => trim($key)\n );\n post_to_url_unicode(\"https://msdgweb.mgov.gov.in/esms/sendsmsrequest\", $data); //calling post_to_url_unicode to send bulk unicode sms \n}", "function sendSmsDynamic1($con,$caid, $msg, $mobile, $schedule=\"\", $sentid=\"\", $action=1)\n{\n $sttSms = \"select * from sms_info where caid='$caid'\";\n\t$sqlSms = mysqli_query($con,$sttSms);\n\t$cntsms = mysqli_num_rows($sqlSms);\n\tif($cntsms==0)\n\t{\n\t $caid=1;\n\t}\n\t$sttSms = \"select * from sms_info where caid='$caid'\";\n\t$sqlSms = mysqli_query($con,$sttSms);\n\t$rowSms = mysqli_fetch_assoc($sqlSms);\n\t//die;\n\t\n\t$smsuname = $rowSms['smsuname']; // sms user name \n\t$smspass = $rowSms['smspass']; // sms password \n\t$smssender = $rowSms['smssender']; // sms sender id\n\t$veruname = $rowSms['veruname']; // variable name of user name\n\t$verpass = $rowSms['verpass']; // variable name of password\n\t$versender = $rowSms['versender']; // variable name of sender id\n\t$vermessage = $rowSms['vermessage']; // variable name of message\n\t$vermob = $rowSms['vermob']; // variable name of to (mobile no)\n\t\n\t$verdate = $rowSms['verdate']; // variable of date field for schedule sms\n\t$verpatter = $rowSms['verpatter']; // pattern of date field e.g. ddmmyyyy\n\t$working_key = $rowSms['working_key'];// working key\n\t$verkey = $rowSms['verkey']; // variable name of working key\n\t\n\t$api_url = $rowSms['api_url']; // API URL\n\t$send_api = $rowSms['send_api']; // sending page name \n\t\n\t$chk_bal_api = $rowSms['chk_bal_api'];// balance check api\n\t$sch_api = $rowSms['sch_api']; // schedule api\n\t$status_api = $rowSms['status_api']; // status api\n\t\n\t\n\t//echo \"Called\";\n\t$request = \"\"; //initialize the request variable\n\t\n\tif($working_key == \"\")\n\t{\n\t\t$param[$veruname] = $smsuname; //this is the username of our TM4B account\n\t\t$param[$verpass] = $smspass; //this is the password of our TM4B account\n\t\t\n\t\tif($action==1)\n\t\t$param[$vermob] = $mobile; //these are the recipients of the message\n\t}\n\telse\n\t{\n\t\t$param[$verkey] = $working_key; //this is the key of our TM4B account\n\t\t\n\t\tif($action==1)\n\t\t$param[$vermob] = \"91\".$mobile; //these are the recipients of the message\n\t}\n\t\n\tif($action==1)\n\t{\n\t\t$param[$versender] = $smssender;//this is our sender \n\t\t$param[$vermessage] = $msg; //this is the message that we want to send\n\t}\n\telse if($action==2)\n\t{\n\t\t$param['messageid'] = $sentid;//this is our sender \n\t}\n\t\n\t// for schedule //\n\tif($schedule!=\"\")\n\t{\n\t\t$timearr = explode(\" \",$schedule);\n\t\t\n\t\t$dateoftime = $timearr[0];\n\t\t$timeoftime = $timearr[1];\n\t\t\n\t\t$datearr = explode(\"-\",$dateoftime); // explode Date //\n\t\t$yyyy = $datearr[0]; // year\n\t\t$mm = $datearr[1]; // month\n\t\t$dd = $datearr[2]; // day\n\t\t\n\t\t$datearr = explode(\":\",$timeoftime);\n\t\t$hh = $datearr[0];\n\t\t$mmt = $datearr[1];\n\t\t$ss = $datearr[2];\n\t\t\n\t\t$scdltime = strtolower($verpatter);\n\t\t$scdltime = str_replace(\"yyyy\",$yyyy,$scdltime);\n\t\t$scdltime = str_replace(\"dd\",$dd,$scdltime);\n\t\t$scdltime = str_replace(\"hh\",$hh,$scdltime);\n\t\t$scdltime = str_replace(\"ss\",$ss,$scdltime);\n\t\t$scdltime = preg_replace('/mm/i', $mm, $scdltime, 1);\n\t\t$scdltime = str_replace(\"mm\",$mmt,$scdltime);\n\t\t\n\t\t\n\t\t $param[$verdate] = $scdltime; //this is the schedule datetime //\n\t\t\n\t}\n\t//print_r($param);\t\n\tforeach($param as $key=>$val) //traverse through each member of the param array\n\t{ \n\t\t$request.= $key.\"=\".urlencode($val); //we have to urlencode the values\n\t\t$request.= \"&\"; //append the ampersand (&) sign after each paramter/value pair\n\t}\n\t$request = substr($request, 0, strlen($request)-1); //remove the final ampersand sign from the request\n\t//echo $request;\n\n\tif($action==\"1\") // 1 for send sms //\n\t$process_api = trim($send_api,\"/\");\n\telse if($action==\"2\") // 2 for Delivery report //\n\t$process_api = trim($status_api,\"/\");\n\telse if($action==\"3\") // 3 for check balance //\n\t$process_api = trim($chk_bal_api,\"/\");\n\t\n\t\n\t//First prepare the info that relates to the connection\n\t$host = $api_url;\n\t$script = \"/$process_api\";\n\t$request_length = strlen($request);\n\t$method = \"POST\"; // must be POST if sending multiple messages\n\tif ($method == \"GET\") \n\t{\n\t $script .= \"?$request\";\n\t}\n\t\n\t//Now comes the header which we are going to post. \n\t$header = \"$method $script HTTP/1.1\\r\\n\";\n\t$header .= \"Host: $host\\r\\n\";\n\t$header .= \"Content-Type: application/x-www-form-urlencoded\\r\\n\";\n\t$header .= \"Content-Length: $request_length\\r\\n\";\n\t$header .= \"Connection: close\\r\\n\\r\\n\";\n\t$header .= \"$request\\r\\n\";\n\t\n\t//echo $header;\n\t//Now we open up the connection\n\t$socket = @fsockopen($host, 80, $errno, $errstr); \n\tif ($socket) //if its open, then...\n\t{ \n\t fputs($socket, $header); // send the details over\n\t while(!feof($socket))\n\t {\n\t\t $output[] = fgets($socket); //get the results \n\t\t\t\t\n\t }\n\t fclose($socket); \n\t}\n\t\n\tif($action==1)\n\t{ \n\t\t$cntOutput = count($output);\n\t\t$lastValue = $output[$cntOutput-1];\n\t\t$expLastValue = explode(\"=\",$lastValue);\n\t\t$cntLastValue = count($expLastValue);\n\t\t$messageid = $expLastValue[$cntLastValue-1];\n\t\t\n\t\treturn $messageid;\n\t}\n\telse if($action==2 || $action==3)\n\t{\n\t\treturn $output;\n\t}\n}", "public function harSms() {\n return $this->har_sms;\n }", "function check_for_querystrings() {\r\n\t\t\tif ( isset( $_REQUEST['message'] ) ) {\r\n\t\t\t\tUM()->shortcodes()->message_mode = true;\r\n\t\t\t}\r\n\t\t}", "function the_champ_notify(){\r\n\tif(isset($_GET['message'])){\r\n\t\t?>\r\n\t\t<div><?php echo esc_attr($_GET['message']) ?></div>\r\n\t\t<?php\r\n\t}\r\n\tdie;\r\n}", "public function postQuickSMS(Request $request)\n {\n $v = \\Validator::make($request->all(), [\n 'recipients' => 'required', 'message' => 'required', 'message_type' => 'required', 'remove_duplicate' => 'required', 'country_code' => 'required', 'sms_gateway' => 'required', 'delimiter' => 'required'\n ]);\n\n if ($v->fails()) {\n return redirect('user/sms/quick-sms')->withInput($request->all())->withErrors($v->errors());\n }\n\n\n $message = $request->message;\n\n\n if (app_config('fraud_detection') == 1) {\n $spam_word = SpamWord::all()->toArray();\n if (isset($spam_word) && is_array($spam_word) && count($spam_word) > 0) {\n $spam_word = array_column($spam_word, 'word');\n $check = array_filter($spam_word, function ($word) use ($message) {\n if (strpos($message, $word)) {\n return true;\n }\n return false;\n });\n\n if (isset($check) && is_array($check) && count($check) > 0) {\n return redirect('user/sms/quick-sms')->with([\n 'message' => language_data('Your are sending fraud message', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n\n }\n }\n\n $client = Client::find(Auth::guard('client')->user()->id);\n $sms_count = $client->sms_limit;\n $sender_id = $request->sender_id;\n\n if (app_config('sender_id_verification') == '1') {\n if ($sender_id == null) {\n return redirect('user/sms/quick-sms')->withInput($request->all())->with([\n 'message' => language_data('This Sender ID have Blocked By Administrator', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n }\n\n if ($sender_id != '' && app_config('sender_id_verification') == '1') {\n $all_sender_id = SenderIdManage::all();\n $all_ids = [];\n\n foreach ($all_sender_id as $sid) {\n $client_array = json_decode($sid->cl_id);\n\n if (isset($client_array) && is_array($client_array) && in_array('0', $client_array)) {\n array_push($all_ids, $sender_id);\n } elseif (isset($client_array) && is_array($client_array) && in_array(Auth::guard('client')->user()->id, $client_array)) {\n array_push($all_ids, $sid->sender_id);\n }\n }\n $all_ids = array_unique($all_ids);\n\n if (!in_array($sender_id, $all_ids)) {\n return redirect('user/sms/quick-sms')->withInput($request->all())->with([\n 'message' => language_data('This Sender ID have Blocked By Administrator', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n }\n\n try {\n\n if ($request->delimiter == 'automatic') {\n $recipients = multi_explode(array(\",\", \"\\n\", \";\", \" \", \"|\"), $request->recipients);\n } elseif ($request->delimiter == ';') {\n $recipients = explode(';', $request->recipients);\n } elseif ($request->delimiter == ',') {\n $recipients = explode(',', $request->recipients);\n } elseif ($request->delimiter == '|') {\n $recipients = explode('|', $request->recipients);\n } elseif ($request->delimiter == 'tab') {\n $recipients = explode(' ', $request->recipients);\n } elseif ($request->delimiter == 'new_line') {\n $recipients = explode(\"\\n\", $request->recipients);\n } else {\n return redirect('user/sms/quick-sms')->with([\n 'message' => 'Invalid delimiter',\n 'message_important' => true\n ]);\n }\n\n $results = array_filter($recipients);\n\n if (isset($results) && is_array($results) && count($results) <= 100) {\n\n $gateway = SMSGateways::find($request->sms_gateway);\n if ($gateway->status != 'Active') {\n return redirect('user/sms/quick-sms')->withInput($request->all())->with([\n 'message' => language_data('SMS gateway not active', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n\n $gateway_credential = null;\n $cg_info = null;\n if ($gateway->custom == 'Yes') {\n if ($gateway->type == 'smpp') {\n $gateway_credential = SMSGatewayCredential::where('gateway_id', $request->sms_gateway)->where('status', 'Active')->first();\n if ($gateway_credential == null) {\n return redirect('user/sms/quick-sms')->withInput($request->all())->with([\n 'message' => language_data('SMS gateway not active.Contact with Provider', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n } else {\n $cg_info = CustomSMSGateways::where('gateway_id', $request->sms_gateway)->first();\n }\n\n } else {\n $gateway_credential = SMSGatewayCredential::where('gateway_id', $request->sms_gateway)->where('status', 'Active')->first();\n if ($gateway_credential == null) {\n return redirect('user/sms/quick-sms')->withInput($request->all())->with([\n 'message' => language_data('SMS gateway not active.Contact with Provider', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n }\n\n $msg_type = $request->message_type;\n\n\n if ($msg_type != 'plain' && $msg_type != 'unicode' && $msg_type != 'voice' && $msg_type != 'mms' && $msg_type != 'arabic') {\n return redirect('user/sms/quick-sms')->withInput($request->all())->with([\n 'message' => language_data('Invalid message type', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n\n if ($msg_type == 'voice') {\n if ($gateway->voice != 'Yes') {\n return redirect('user/sms/quick-sms')->withInput($request->all())->with([\n 'message' => language_data('SMS Gateway not supported Voice feature', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n }\n\n if ($msg_type == 'mms') {\n\n if ($gateway->mms != 'Yes') {\n return redirect('user/sms/quick-sms')->withInput($request->all())->with([\n 'message' => language_data('SMS Gateway not supported MMS feature', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n\n $image = $request->image;\n\n if ($image == '') {\n return redirect('user/sms/quick-sms')->withInput($request->all())->with([\n 'message' => language_data('MMS file required', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n\n if (app_config('AppStage') != 'Demo') {\n if (isset($image) && in_array(strtolower($image->getClientOriginalExtension()), array(\"png\", \"jpeg\", \"gif\", 'jpg', 'mp3', 'mp4', '3gp', 'mpg', 'mpeg'))) {\n $destinationPath = public_path() . '/assets/mms_file/';\n $image_name = $image->getClientOriginalName();\n $image_name = str_replace(\" \", \"-\", $image_name);\n Input::file('image')->move($destinationPath, $image_name);\n $media_url = asset('assets/mms_file/' . $image_name);\n\n } else {\n return redirect('user/sms/quick-sms')->withInput($request->all())->with([\n 'message' => language_data('Upload .png or .jpeg or .jpg or .gif or .mp3 or .mp4 or .3gp or .mpg or .mpeg file', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n\n } else {\n return redirect('user/sms/quick-sms')->withInput($request->all())->with([\n 'message' => language_data('MMS is disable in demo mode', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n } else {\n $media_url = null;\n if ($message == '') {\n return redirect('user/sms/quick-sms')->withInput($request->all())->with([\n 'message' => language_data('Message required', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n }\n\n\n if ($msg_type == 'plain' || $msg_type == 'voice' || $msg_type == 'mms') {\n $msgcount = strlen(preg_replace('/\\s+/', ' ', trim($message)));\n if ($msgcount <= 160) {\n $msgcount = 1;\n } else {\n $msgcount = $msgcount / 157;\n }\n }\n if ($msg_type == 'unicode' || $msg_type == 'arabic') {\n $msgcount = mb_strlen(preg_replace('/\\s+/', ' ', trim($message)), 'UTF-8');\n\n if ($msgcount <= 70) {\n $msgcount = 1;\n } else {\n $msgcount = $msgcount / 67;\n }\n }\n\n $msgcount = ceil($msgcount);\n\n\n $get_cost = 0;\n $get_inactive_coverage = [];\n\n $filtered_data = [];\n $blacklist = BlackListContact::select('numbers')->where('user_id', Auth::guard('client')->user()->id)->get()->toArray();\n\n if ($blacklist && is_array($blacklist) && count($blacklist) > 0) {\n\n $blacklist = array_column($blacklist, 'numbers');\n\n array_filter($results, function ($element) use ($blacklist, &$filtered_data, $request) {\n $element = trim($element);\n if ($request->country_code != 0) {\n $element = $request->country_code . ltrim($element, '0');\n }\n if (!in_array($element, $blacklist)) {\n if ($request->country_code != 0) {\n $element = ltrim($element, $request->country_code);\n }\n array_push($filtered_data, $element);\n }\n });\n\n $results = array_values($filtered_data);\n }\n\n if (count($results) <= 0) {\n return redirect('user/sms/quick-sms')->withInput($request->all())->with([\n 'message' => language_data('Recipient empty', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n\n if ($request->remove_duplicate == 'yes') {\n $results = array_map('trim', $results);\n $results = array_unique($results, SORT_REGULAR);\n }\n\n $results = array_values($results);\n\n $get_final_data = [];\n\n foreach ($results as $r) {\n\n $phone = str_replace(['(', ')', '+', '-', ' '], '', trim($r));\n\n if (validate_phone_number($phone)) {\n\n if ($request->country_code == 0) {\n if ($gateway->settings == 'FortDigital') {\n $c_phone = 61;\n } else {\n $c_phone = PhoneNumber::get_code($phone);\n }\n } else {\n $phone = $request->country_code . ltrim($phone, '0');\n $c_phone = $request->country_code;\n }\n\n $sms_cost = IntCountryCodes::where('country_code', $c_phone)->where('active', '1')->first();\n\n if ($sms_cost) {\n\n $phoneUtil = PhoneNumberUtil::getInstance();\n $phoneNumberObject = $phoneUtil->parse('+' . $phone, null);\n $area_code_exist = $phoneUtil->getLengthOfGeographicalAreaCode($phoneNumberObject);\n\n if ($area_code_exist) {\n $format = $phoneUtil->format($phoneNumberObject, PhoneNumberFormat::INTERNATIONAL);\n $get_format_data = explode(\" \", $format);\n $operator_settings = explode('-', $get_format_data[1])[0];\n\n } else {\n $carrierMapper = PhoneNumberToCarrierMapper::getInstance();\n $operator_settings = $carrierMapper->getNameForNumber($phoneNumberObject, 'en');\n }\n\n $get_operator = Operator::where('operator_setting', $operator_settings)->where('coverage_id', $sms_cost->id)->first();\n if ($get_operator) {\n\n $sms_charge = $get_operator->plain_price;\n\n if ($msg_type == 'plain' || $msg_type == 'unicode' || $msg_type == 'arabic') {\n $sms_charge = $get_operator->plain_price;\n }\n\n if ($msg_type == 'voice') {\n $sms_charge = $get_operator->voice_price;\n }\n\n if ($msg_type == 'mms') {\n $sms_charge = $get_operator->mms_price;\n }\n\n $get_cost += $sms_charge;\n } else {\n $sms_charge = $sms_cost->plain_tariff;\n\n if ($msg_type == 'plain' || $msg_type == 'unicode' || $msg_type == 'arabic') {\n $sms_charge = $sms_cost->plain_tariff;\n }\n\n if ($msg_type == 'voice') {\n $sms_charge = $sms_cost->voice_tariff;\n }\n\n if ($msg_type == 'mms') {\n $sms_charge = $sms_cost->mms_tariff;\n }\n\n $get_cost += $sms_charge;\n }\n } else {\n array_push($get_inactive_coverage, $phone);\n continue;\n }\n\n array_push($get_final_data, $phone);\n }\n }\n\n $total_cost = $get_cost * $msgcount;\n\n if ($total_cost == 0) {\n return redirect('user/sms/quick-sms')->withInput($request->all())->with([\n 'message' => language_data('You do not have enough sms balance', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n\n if ($total_cost > $sms_count) {\n return redirect('user/sms/quick-sms')->withInput($request->all())->with([\n 'message' => language_data('You do not have enough sms balance', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n\n $remain_sms = $sms_count - $total_cost;\n $client->sms_limit = $remain_sms;\n $client->save();\n\n foreach ($get_final_data as $r) {\n $phone = str_replace(['(', ')', '+', '-', ' '], '', trim($r));\n\n if ($msg_type == 'plain' || $msg_type == 'unicode' || $msg_type == 'arabic') {\n $this->dispatch(new SendBulkSMS($client->id, $phone, $gateway, $gateway_credential, $sender_id, $message, $msgcount, $cg_info, '', $msg_type));\n }\n if ($msg_type == 'voice') {\n $this->dispatch(new SendBulkVoice($client->id, $phone, $gateway, $gateway_credential, $sender_id, $message, $msgcount));\n }\n if ($msg_type == 'mms') {\n $this->dispatch(new SendBulkMMS($client->id, $phone, $gateway, $gateway_credential, $sender_id, $message, $media_url));\n }\n }\n\n if (isset($get_inactive_coverage) && is_array($get_inactive_coverage) && count($get_inactive_coverage) > 0) {\n $inactive_phone = implode('; ', $get_inactive_coverage);\n return redirect('user/sms/quick-sms')->with([\n 'message' => 'This phone number(s) ' . $inactive_phone . ' not send for inactive coverage issue'\n ]);\n }\n\n return redirect('user/sms/quick-sms')->with([\n 'message' => language_data('Please check sms history for status', Auth::guard('client')->user()->lan_id)\n ]);\n } else {\n return redirect('user/sms/quick-sms')->withInput($request->all())->with([\n 'message' => language_data('You can not send more than 100 sms using quick sms option', Auth::guard('client')->user()->lan_id),\n 'message_important' => true\n ]);\n }\n\n } catch (\\Exception $e) {\n return redirect('user/sms/quick-sms')->withInput($request->all())->with([\n 'message' => $e->getMessage(),\n 'message_important' => true\n ]);\n }\n\n }", "public function allowMessage()\n {\n $this->_data['Mensaje'] = 1;\n }", "function sendSMS($recipient, $message){\r\n \t$ch = curl_init();\r\n\t\tcurl_setopt($ch, CURLOPT_URL, \"SMS STRING GIVEN BY SMS SERVICE PROVIDER\");\r\n\t\tcurl_setopt($ch,CURLOPT_RETURNTRANSFER,1);\r\n\t\t$result = curl_exec($ch);\r\n\t\tcurl_close($ch);\r\n\t\treturn $result;\r\n }", "public function clean()\n\t{\n\t\t(($sPlugin = Phpfox_Plugin::get('mail.component_controller_view_mobile_clean')) ? eval($sPlugin) : false);\n\t}", "public function sms(): SMS\n {\n return self::instance()->runner->sms();\n }" ]
[ "0.637804", "0.63708", "0.6302498", "0.62987566", "0.61822635", "0.61459523", "0.6103223", "0.60171634", "0.5989355", "0.5982287", "0.5941111", "0.5883327", "0.58725905", "0.58710116", "0.58689106", "0.5829295", "0.5812167", "0.5772553", "0.5772423", "0.5760538", "0.57489514", "0.5744843", "0.5703966", "0.5691073", "0.5678698", "0.56774276", "0.56706446", "0.5644709", "0.563476", "0.5624745", "0.5607163", "0.5591351", "0.557001", "0.55638355", "0.5549716", "0.5548825", "0.55433106", "0.5527644", "0.5520714", "0.55157083", "0.5511042", "0.54894066", "0.54887635", "0.5486554", "0.54755896", "0.5467504", "0.5459074", "0.54574573", "0.5453231", "0.54410315", "0.54280776", "0.5403563", "0.5402103", "0.53969496", "0.5395628", "0.53925073", "0.5382201", "0.53759277", "0.5373922", "0.5371311", "0.5371283", "0.5369526", "0.53683114", "0.5360189", "0.53561443", "0.5352357", "0.53502434", "0.5334206", "0.5332712", "0.53017604", "0.5293074", "0.5290832", "0.5285556", "0.5283119", "0.52770364", "0.5269076", "0.52665985", "0.52665865", "0.5264379", "0.52627194", "0.5260117", "0.5257056", "0.5254976", "0.5246993", "0.5246237", "0.52445465", "0.5239758", "0.5235506", "0.52348524", "0.5224503", "0.5223297", "0.5221186", "0.5220318", "0.5211583", "0.5210202", "0.519919", "0.5190969", "0.51727974", "0.51715213", "0.5170935" ]
0.5763715
19
/ Function to convert email address from
function convert_email($src_email_addr) { $final_emails_array=array(); $src_email_addr=trim($src_email_addr,','); // Clean up email IDS $email_addr_arr=preg_split("/,/",$src_email_addr); //echo "<pre>convert_email(): ============================================ </pre>"; //echo "<pre>convert_email(): SRC EMAIL [$src_email_addr]</pre>"; //echo "<pre>convert_email(): SPLIT SRC EMAIL".print_r($email_addr_arr,true)."</pre>"; foreach ($email_addr_arr as $email_addr) { //echo "<pre> convert_email(): EACH EMAIL=[$email_addr]</pre>"; // Split it by '<' to seperate the email id from the name $email_addr=preg_split("/</",$email_addr); switch (count($email_addr)) { case 1: // Only email ID is present $email_id=trim(str_replace(">","",$email_addr[0])); $name=$email_id; break; case 2: // Both name & email ID is present $name=trim($email_addr[0]); $email_id=trim(str_replace(">","",$email_addr[1])); break; } $final_emails_array[$email_id]=$name; //echo "<pre> convert_email(): FINAL EMAILS ARRAY=[".print_r($final_emails_array,true)."]</pre>"; } //$a=array("asdsad","adsdsa"=>"asdsad","bbbb"); //echo "<pre>convert_email(): EXPECTED FORMAT=[".print_r($a,true)."]</pre>"; //echo "<pre>convert_email(): RETURNING FINAL EMAILS ARRAY=[".print_r($final_emails_array,true)."]</pre>"; return $final_emails_array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function string_email( $p_string ) \r\n{\r\n\t$p_string = string_strip_hrefs( $p_string );\r\n\treturn $p_string;\r\n}", "function parseEmailAddress( $address, $encoding = \"mime\" )\r\n {\r\n\r\n $matches = array();\r\n $pattern = '/<?\\\"?[a-zA-Z0-9!#\\$\\%\\&\\'\\*\\+\\-\\/=\\?\\^_`{\\|}~\\.]+\\\"?@[a-zA-Z0-9!#\\$\\%\\&\\'\\*\\+\\-\\/=\\?\\^_`{\\|}~\\.]+>?$/';\r\n if ( preg_match( trim( $pattern ), $address, $matches, PREG_OFFSET_CAPTURE ) != 1 )\r\n {\r\n return null;\r\n }\r\n $name = substr( $address, 0, $matches[0][1] );\r\n\r\n // trim <> from the address and \"\" from the name\r\n $name = trim( $name, '\" ' );\r\n $mail = trim( $matches[0][0], '<>' );\r\n // remove any quotes found in mail addresses like \"bah,\"@example.com\r\n $mail = str_replace( '\"', '', $mail );\r\n\r\n if ( $encoding == 'mime' )\r\n {\r\n // the name may contain interesting character encoding. We need to convert it.\r\n $name = ezcMailTools::mimeDecode( $name );\r\n }\r\n else\r\n {\r\n $name = ezcMailCharsetConverter::convertToUTF8( $name, $encoding );\r\n }\r\n\r\n $address = new ezcMailAddress( $mail, $name, 'utf-8' );\r\n return $address;\r\n }", "function mangle_email($s) {\r\n\treturn preg_match('/([^@\\s]+)@([-a-z0-9]+\\.)+[a-z]{2,}/is', '<$1@...>', $s);\r\n}", "private function decode_mail_envelope_address($address) {\n\n $decoded_address = '';\n\n if (strlen($address) > 0) {\n\n // '$address' could be '[email protected]' or 'Max Power <[email protected]>' or FALSE if not found\n\n $pos = strpos($address, '<');\n\n if ($pos !== false) {\n\n // alias found - split alias, user and domain\n\n $alias = substr($address, 0, ($pos - 1));\n $address = substr($address, ($pos + 1), (strlen($address) - 2));\n\n list($user, $domain) = explode('@', $address);\n\n $decoded_address = '((\"' . $alias . '\" NIL \"' . $user . '\" \"' . $domain . '\"))';\n } else {\n\n // alias not found - split user and domain\n\n list($user, $domain) = explode('@', $address);\n\n $decoded_address = '((NIL NIL \"' . $user . '\" \"' . $domain . '\"))';\n }\n } else {\n // nothing found\n $decoded_address = 'NIL';\n }\n\n return $decoded_address;\n }", "function charrestore_validemail($email)\n{\n\t$is_valid = TRUE;\n\t$atIndex = strrpos($email, \"@\");\n\tif( is_bool($atIndex) && !$atIndex )\n\t{\n\t\t$is_valid = FALSE;\n\t}\n\telse\n\t{\n\t\t$domain = substr($email, $atIndex+1);\n\t\t$local = substr($email, 0, $atIndex);\n\t\t$localLen = strlen($local);\n\t\t$domainLen = strlen($domain);\n\t\tif( $localLen < 1 || $localLen > 64 )\n\t\t{\n\t\t\t// local part length exceeded\n\t\t\t$is_valid = FALSE;\n\t\t}\n\t\telseif( $domainLen < 1 || $domainLen > 255 )\n\t\t{\n\t\t\t// domain part length exceeded\n\t\t\t$is_valid = FALSE;\n\t\t}\n\t\telseif( $local[0] == '.' || $local[$localLen-1] == '.' )\n\t\t{\n\t\t\t// local part starts or ends with '.'\n\t\t\t$is_valid = FALSE;\n\t\t}\n\t\telseif( preg_match('/\\\\.\\\\./', $local) )\n\t\t{\n\t\t\t// local part has two consecutive dots\n\t\t\t$is_valid = FALSE;\n\t\t}\n\t\telseif( !preg_match('/^[A-Za-z0-9\\\\-\\\\.]+$/', $domain) )\n\t\t{\n\t\t\t// character not valid in domain part\n\t\t\t$is_valid = FALSE;\n\t\t}\n\t\telseif( preg_match('/\\\\.\\\\./', $domain))\n\t\t{\n\t\t\t// domain part has two consecutive dots\n\t\t\t$is_valid = FALSE;\n\t\t}\n\t\telseif( !preg_match('/^(\\\\\\\\.|[A-Za-z0-9!#%&`_=\\\\/$\\'*+?^{}|~.-])+$/', str_replace(\"\\\\\\\\\",\"\",$local)) )\n\t\t{\n\t\t\t// character not valid in local part unless \n\t\t\t// local part is quoted\n\t\t\tif (!preg_match('/^\"(\\\\\\\\\"|[^\"])+\"$/', str_replace(\"\\\\\\\\\",\"\",$local)))\n\t\t\t{\n\t\t\t\t$is_valid = FALSE;\n\t\t\t}\n\t\t}\n\t\tif ($is_valid && !(checkdnsrr($domain,\"MX\") || checkdnsrr($domain,\"A\")) )\n\t\t{\n\t\t\t// domain not found in DNS\n\t\t\t$is_valid = FALSE;\n\t\t}\n\t}\n\treturn $is_valid;\n}", "private function resolve_email_address($email_address)\n\t{\n\t\tif (is_string($email_address)) return $email_address;\n\t\tif (is_array($email_address)) return $this->implode_email_addresses($email_address);\n\t\tif ($email_address instanceof Member) return $email_address->Email; //The Member class cannot be modified to implement the EmailAddressProvider interface, so exceptionally handle it here.\n\t\tif (!$email_address instanceof EmailAddressProvider)\n\t\t{\n\t\t\tthrow new InvalidArgumentException(__METHOD__ . ': Parameter $email_address must either be a string or an instance of a class that implements the EmailAddressProvider interface.');\n\t\t}\n\t\treturn $this->implode_email_addresses($email_address->getEmailAddresses());\n\t}", "function sEmail( $email )\r\n\t\t{\r\n\t\t return filter_var( $email, FILTER_SANITIZE_EMAIL );\r\n\t\t \r\n\t\t}", "public static function email($email) {\n\t\treturn str_replace('@', '&#64;', static::obfuscate($email));\n\t}", "private function convertIdn($email)\n {\n list($local, $domain) = explode('@', $email);\n $domain = idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46);\n\n return sprintf('%s@%s', $local, $domain);\n }", "function addr($email)\n {\n\n if(preg_match('/([^<>]+)\\s*<(.*)>/',$email,$matches) &&\n count($matches) == 3)\n {\n return array($matches[2],$matches[1]);\n }\n\n return array($email,'');\n }", "function encode_email_address( $email ) {\n\n $output = '';\n\n for ($i = 0; $i < strlen($email); $i++) \n { \n $output .= '&#'.ord($email[$i]).';'; \n }\n\n return $output;\n}", "function parse_email($input) {\n\n // TODO TEST\n\n $input = trim($input);\n if (!$input) return false;\n\n if (preg_match('/^\\s*(([A-Z0-9._%+-]+)@([A-Z0-9.-]+\\.[A-Z]{2,4}))\\s*$/i', $input, $m)) {\n return array(\n 'email' => $m[1],\n 'user' => $m[2],\n 'domain' => $m[3]\n );\n } else {\n return false;\n }\n\n }", "function UnMangle($email)\n{\n\tif (AT_MANGLE != \"\")\n\t\t$email = str_replace(AT_MANGLE,\"@\",$email);\n\treturn ($email);\n}", "protected function parse_email($email)\n\t{\n\t\tif(is_string($email) AND ($email = trim($email)) AND mb_strlen($email) < 61)\n\t\t{\n\t\t\t$email = mb_strtolower($email);\n\t\t\t\n\t\t\tif(preg_match('/^[a-z0-9._+\\-#|]+@[a-z0-9.-]+\\.[a-z]{2,4}$/', $email))\n\t\t\t{\n\t\t\t\treturn $email;\n\t\t\t}\n\t\t}\n\t}", "function encode_email_address( $email ) {\n\n $output = '';\n\n for ($i = 0; $i < strlen($email); $i++) \n { \n $output .= '&#'.ord($email[$i]).';'; \n }\n\n return $output;\n}", "public static function composeEmailAddress( ezcMailAddress $item )\r\n {\r\n $name = trim( $item->name );\r\n if ( $name !== '' )\r\n {\r\n // remove the quotes around the name part if they are already there\r\n if ( $name{0} === '\"' && $name{strlen( $name ) - 1} === '\"' )\r\n {\r\n $name = substr( $name, 1, -1 );\r\n }\r\n\r\n // add slashes to \" and \\ and surround the name part with quotes\r\n if ( strpbrk( $name, \",@<>:;'\\\"\" ) !== false )\r\n {\r\n $name = str_replace( '\\\\', '\\\\\\\\', $name );\r\n $name = str_replace( '\"', '\\\"', $name );\r\n $name = \"\\\"{$name}\\\"\";\r\n }\r\n\r\n switch ( strtolower( $item->charset ) )\r\n {\r\n case 'us-ascii':\r\n $text = $name . ' <' . $item->email . '>';\r\n break;\r\n\r\n case 'iso-8859-1': case 'iso-8859-2': case 'iso-8859-3': case 'iso-8859-4':\r\n case 'iso-8859-5': case 'iso-8859-6': case 'iso-8859-7': case 'iso-8859-8':\r\n case 'iso-8859-9': case 'iso-8859-10': case 'iso-8859-11': case 'iso-8859-12':\r\n case 'iso-8859-13': case 'iso-8859-14': case 'iso-8859-15' :case 'iso-8859-16':\r\n case 'windows-1250': case 'windows-1251': case 'windows-1252':\r\n case 'utf-8':\r\n if ( strpbrk( $name, \"\\x80\\x81\\x82\\x83\\x84\\x85\\x86\\x87\\x88\\x89\\x8a\\x8b\\x8c\\x8d\\x8e\\x8f\\x90\\x91\\x92\\x93\\x94\\x95\\x96\\x97\\x98\\x99\\x9a\\x9b\\x9c\\x9d\\x9e\\x9f\\xa0\\xa1\\xa2\\xa3\\xa4\\xa5\\xa6\\xa7\\xa8\\xa9\\xaa\\xab\\xac\\xad\\xae\\xaf\\xb0\\xb1\\xb2\\xb3\\xb4\\xb5\\xb6\\xb7\\xb8\\xb9\\xba\\xbb\\xbc\\xbd\\xbe\\xbf\\xc0\\xc1\\xc2\\xc3\\xc4\\xc5\\xc6\\xc7\\xc8\\xc9\\xca\\xcb\\xcc\\xcd\\xce\\xcf\\xd0\\xd1\\xd2\\xd3\\xd4\\xd5\\xd6\\xd7\\xd8\\xd9\\xda\\xdb\\xdc\\xdd\\xde\\xdf\\xe0\\xe1\\xe2\\xe3\\xe4\\xe5\\xe6\\xe7\\xe8\\xe9\\xea\\xeb\\xec\\xed\\xee\\xef\\xf0\\xf1\\xf2\\xf3\\xf4\\xf5\\xf6\\xf7\\xf8\\xf9\\xfa\\xfb\\xfc\\xfd\\xfe\\xff\" ) === false )\r\n {\r\n $text = $name . ' <' . $item->email . '>';\r\n break;\r\n }\r\n // break intentionally missing\r\n\r\n default:\r\n $preferences = array(\r\n 'input-charset' => $item->charset,\r\n 'output-charset' => $item->charset,\r\n 'scheme' => 'Q',\r\n 'line-break-chars' => ezcMailTools::lineBreak()\r\n );\r\n $name = iconv_mime_encode( 'dummy', $name, $preferences );\r\n $name = substr( $name, 7 ); // \"dummy: \" + 1\r\n $text = $name . ' <' . $item->email . '>';\r\n break;\r\n }\r\n }\r\n else\r\n {\r\n $text = $item->email;\r\n }\r\n return $text;\r\n }\r\n\r\n /**\r\n * Returns the array $items consisting of ezcMailAddress objects\r\n * as one RFC822 compliant address string.\r\n *\r\n * Set foldLength to control how many characters each line can have before a line\r\n * break is inserted according to the folding rules specified in RFC2822.\r\n *\r\n * @param array(ezcMailAddress) $items\r\n * @param int $foldLength\r\n * @return string\r\n */\r\n public static function composeEmailAddresses( array $items, $foldLength = null )\r\n {\r\n $textElements = array();\r\n foreach ( $items as $item )\r\n {\r\n $textElements[] = ezcMailTools::composeEmailAddress( $item );\r\n }\r\n\r\n if ( $foldLength === null ) // quick version\r\n {\r\n return implode( ', ', $textElements );\r\n }\r\n\r\n $result = \"\";\r\n $charsSinceFold = 0;\r\n foreach ( $textElements as $element )\r\n {\r\n $length = strlen( $element );\r\n if ( ( $charsSinceFold + $length + 2 /* comma, space */ ) > $foldLength )\r\n {\r\n // fold last line if there is any\r\n if ( $result != '' )\r\n {\r\n $result .= \",\" . ezcMailTools::lineBreak() .' ';\r\n $charsSinceFold = 0;\r\n }\r\n $result .= $element;\r\n }\r\n else\r\n {\r\n if ( $result == '' )\r\n {\r\n $result = $element;\r\n }\r\n else\r\n {\r\n $result .= ', ' . $element;\r\n }\r\n }\r\n $charsSinceFold += $length + 1 /*space*/;\r\n }\r\n return $result;\r\n }\r\n\r\n /**\r\n * Returns an ezcMailAddress object parsed from the address string $address.\r\n *\r\n * You can set the encoding of the name part with the $encoding parameter.\r\n * If $encoding is omitted or set to \"mime\" parseEmailAddress will asume that\r\n * the name part is mime encoded.\r\n *\r\n * This method does not perform validation. It will also accept slightly\r\n * malformed addresses.\r\n *\r\n * If the mail address given can not be decoded null is returned.\r\n *\r\n * Example:\r\n * <code>\r\n * ezcMailTools::parseEmailAddress( 'John Doe <[email protected]>' );\r\n * </code>\r\n *\r\n * @param string $address\r\n * @param string $encoding\r\n * @return ezcMailAddress\r\n */\r\n public static function parseEmailAddress( $address, $encoding = \"mime\" )\r\n {\r\n // we don't care about the \"group\" part of the address since this is not used anywhere\r\n\r\n $matches = array();\r\n $pattern = '/<?\\\"?[a-zA-Z0-9!#\\$\\%\\&\\'\\*\\+\\-\\/=\\?\\^_`{\\|}~\\.]+\\\"?@[a-zA-Z0-9!#\\$\\%\\&\\'\\*\\+\\-\\/=\\?\\^_`{\\|}~\\.]+>?$/';\r\n if ( preg_match( trim( $pattern ), $address, $matches, PREG_OFFSET_CAPTURE ) != 1 )\r\n {\r\n return null;\r\n }\r\n $name = substr( $address, 0, $matches[0][1] );\r\n\r\n // trim <> from the address and \"\" from the name\r\n $name = trim( $name, '\" ' );\r\n $mail = trim( $matches[0][0], '<>' );\r\n // remove any quotes found in mail addresses like \"bah,\"@example.com\r\n $mail = str_replace( '\"', '', $mail );\r\n\r\n if ( $encoding == 'mime' )\r\n {\r\n // the name may contain interesting character encoding. We need to convert it.\r\n $name = ezcMailTools::mimeDecode( $name );\r\n }\r\n else\r\n {\r\n $name = ezcMailCharsetConverter::convertToUTF8( $name, $encoding );\r\n }\r\n\r\n $address = new ezcMailAddress( $mail, $name, 'utf-8' );\r\n return $address;\r\n }\r\n\r\n /**\r\n * Returns an array of ezcMailAddress objects parsed from the address string $addresses.\r\n *\r\n * You can set the encoding of the name parts with the $encoding parameter.\r\n * If $encoding is omitted or set to \"mime\" parseEmailAddresses will asume that\r\n * the name parts are mime encoded.\r\n *\r\n * Example:\r\n * <code>\r\n * ezcMailTools::parseEmailAddresses( 'John Doe <[email protected]>' );\r\n * </code>\r\n *\r\n * @param string $addresses\r\n * @param string $encoding\r\n * @return array(ezcMailAddress)\r\n */\r\n public static function parseEmailAddresses( $addresses, $encoding = \"mime\" )\r\n {\r\n $addressesArray = array();\r\n $inQuote = false;\r\n $last = 0; // last hit\r\n $length = strlen( $addresses );\r\n for ( $i = 0; $i < $length; $i++ )\r\n {\r\n if ( $addresses[$i] == '\"' )\r\n {\r\n $inQuote = !$inQuote;\r\n }\r\n else if ( $addresses[$i] == ',' && !$inQuote )\r\n {\r\n $addressesArray[] = substr( $addresses, $last, $i - $last );\r\n $last = $i + 1; // eat comma\r\n }\r\n }\r\n\r\n // fetch the last one\r\n $addressesArray[] = substr( $addresses, $last );\r\n\r\n $addressObjects = array();\r\n foreach ( $addressesArray as $address )\r\n {\r\n $addressObject = self::parseEmailAddress( $address, $encoding );\r\n if ( $addressObject !== null )\r\n {\r\n $addressObjects[] = $addressObject;\r\n }\r\n }\r\n\r\n return $addressObjects;\r\n }\r\n\r\n /**\r\n * Returns an unique message ID to be used for a mail message.\r\n *\r\n * The hostname $hostname will be added to the unique ID as required by RFC822.\r\n * If an e-mail address is provided instead, the hostname is extracted and used.\r\n *\r\n * The formula to generate the message ID is: [time_and_date].[process_id].[counter]\r\n *\r\n * @param string $hostname\r\n * @return string\r\n */\r\n public static function generateMessageId( $hostname )\r\n {\r\n if ( strpos( $hostname, '@' ) !== false )\r\n {\r\n $hostname = strstr( $hostname, '@' );\r\n }\r\n else\r\n {\r\n $hostname = '@' . $hostname;\r\n }\r\n return date( 'YmdGHjs' ) . '.' . getmypid() . '.' . self::$idCounter++ . $hostname;\r\n }\r\n\r\n /**\r\n * Returns an unique ID to be used for Content-ID headers.\r\n *\r\n * The part $partName is default set to \"part\". Another value can be used to provide,\r\n * for example, a file name of a part. $partName will be encoded with base64 to be\r\n * compliant with the RFCs.\r\n *\r\n * The formula used is [base64( $partName )].\"@\".[time].[counter]\r\n *\r\n * @param string $partName\r\n * @return string\r\n */\r\n public static function generateContentId( $partName = \"part\" )\r\n {\r\n return str_replace( array( '=', '+', '/' ), '', base64_encode( $partName ) ) . '@' . date( 'His' ) . self::$idCounter++;\r\n }\r\n\r\n /**\r\n * Sets the endLine $character(s) to use when generating mail.\r\n * The default is to use \"\\r\\n\" as specified by RFC 2045.\r\n *\r\n * @param string $characters\r\n */\r\n public static function setLineBreak( $characters )\r\n {\r\n self::$lineBreak = $characters;\r\n }\r\n\r\n /**\r\n * Returns one endLine character.\r\n *\r\n * The default is to use \"\\n\\r\" as specified by RFC 2045.\r\n *\r\n * @return string\r\n */\r\n public static function lineBreak()\r\n {\r\n // Note, this function does deliberately not\r\n // have a $count parameter because of speed issues.\r\n return self::$lineBreak;\r\n }\r\n\r\n /**\r\n * Decodes mime encoded fields and tries to recover from errors.\r\n *\r\n * Decodes the $text encoded as a MIME string to the $charset. In case the\r\n * strict conversion fails this method tries to workaround the issues by\r\n * trying to \"fix\" the original $text before trying to convert it.\r\n *\r\n * @param string $text\r\n * @param string $charset\r\n * @return string\r\n */\r\n public static function mimeDecode( $text, $charset = 'utf-8' )\r\n {\r\n $origtext = $text;\r\n $text = @iconv_mime_decode( $text, 0, $charset );\r\n if ( $text !== false )\r\n {\r\n return $text;\r\n }\r\n\r\n // something went wrong while decoding, let's see if we can fix it\r\n // Try to fix lower case hex digits\r\n $text = preg_replace_callback(\r\n '/=(([a-f][a-f0-9])|([a-f0-9][a-f]))/',\r\n create_function( '$matches', 'return strtoupper($matches[0]);' ),\r\n $origtext\r\n );\r\n $text = @iconv_mime_decode( $text, 0, $charset );\r\n if ( $text !== false )\r\n {\r\n return $text;\r\n }\r\n\r\n // Workaround a bug in PHP 5.1.0-5.1.3 where the \"b\" and \"q\" methods\r\n // are not understood (but only \"B\" and \"Q\")\r\n $text = str_replace( array( '?b?', '?q?' ), array( '?B?', '?Q?' ), $origtext );\r\n $text = @iconv_mime_decode( $text, 0, $charset );\r\n if ( $text !== false )\r\n {\r\n return $text;\r\n }\r\n\r\n // Try it as latin 1 string\r\n $text = preg_replace( '/=\\?([^?]+)\\?/', '=?iso-8859-1?', $origtext );\r\n $text = iconv_mime_decode( $text, 0, $charset );\r\n\r\n return $text;\r\n }\r\n\r\n /**\r\n * Returns a new mail object that is a reply to the current object.\r\n *\r\n * The new mail will have the correct to, cc, bcc and reference headers set.\r\n * It will not have any body set.\r\n *\r\n * By default the reply will only be sent to the sender of the original mail.\r\n * If $type is set to REPLY_ALL, all the original recipients will be included\r\n * in the reply.\r\n *\r\n * Use $subjectPrefix to set the prefix to the subject of the mail. The default\r\n * is to prefix with 'Re: '.\r\n *\r\n * @param ezcMail $mail\r\n * @param ezcMailAddress $from\r\n * @param int $type REPLY_SENDER or REPLY_ALL\r\n * @param string $subjectPrefix\r\n * @param string $mailClass\r\n * @return ezcMail\r\n */\r\n static public function replyToMail( ezcMail $mail, ezcMailAddress $from,\r\n $type = self::REPLY_SENDER, $subjectPrefix = \"Re: \",\r\n $mailClass = \"ezcMail\" )\r\n {\r\n $reply = new $mailClass();\r\n $reply->from = $from;\r\n\r\n // To = Reply-To if set\r\n if ( $mail->getHeader( 'Reply-To' ) != '' )\r\n {\r\n $reply->to = ezcMailTools::parseEmailAddresses( $mail->getHeader( 'Reply-To' ) );\r\n }\r\n else // Else To = From\r\n\r\n {\r\n $reply->to = array( $mail->from );\r\n }\r\n\r\n if ( $type == self::REPLY_ALL )\r\n {\r\n // Cc = Cc + To - your own address\r\n $cc = array();\r\n foreach ( $mail->to as $address )\r\n {\r\n if ( $address->email != $from->email )\r\n {\r\n $cc[] = $address;\r\n }\r\n }\r\n foreach ( $mail->cc as $address )\r\n {\r\n if ( $address->email != $from->email )\r\n {\r\n $cc[] = $address;\r\n }\r\n }\r\n $reply->cc = $cc;\r\n }\r\n\r\n $reply->subject = $subjectPrefix . $mail->subject;\r\n\r\n if ( $mail->getHeader( 'Message-Id' ) )\r\n {\r\n // In-Reply-To = Message-Id\r\n $reply->setHeader( 'In-Reply-To', $mail->getHeader( 'Message-ID' ) );\r\n\r\n // References = References . Message-Id\r\n if ( $mail->getHeader( 'References' ) != '' )\r\n {\r\n $reply->setHeader( 'References', $mail->getHeader( 'References' )\r\n . ' ' . $mail->getHeader( 'Message-ID' ) );\r\n }\r\n else\r\n {\r\n $reply->setHeader( 'References', $mail->getHeader( 'Message-ID' ) );\r\n }\r\n }\r\n else // original mail is borked. Let's support it anyway.\r\n {\r\n $reply->setHeader( 'References', $mail->getHeader( 'References' ) );\r\n }\r\n\r\n return $reply;\r\n }\r\n\r\n /**\r\n * Guesses the content and mime type by using the file extension.\r\n *\r\n * The content and mime types are returned through the $contentType\r\n * and $mimeType arguments.\r\n * For the moment only for image files.\r\n *\r\n * @param string $fileName\r\n * @param string $contentType\r\n * @param string $mimeType\r\n */\r\n static public function guessContentType( $fileName, &$contentType, &$mimeType )\r\n {\r\n $extension = strtolower( pathinfo( $fileName, PATHINFO_EXTENSION ) );\r\n switch ( $extension )\r\n {\r\n case 'gif':\r\n $contentType = 'image';\r\n $mimeType = 'gif';\r\n break;\r\n\r\n case 'jpg':\r\n case 'jpe':\r\n case 'jpeg':\r\n $contentType = 'image';\r\n $mimeType = 'jpeg';\r\n break;\r\n\r\n case 'png':\r\n $contentType = 'image';\r\n $mimeType = 'png';\r\n break;\r\n\r\n case 'bmp':\r\n $contentType = 'image';\r\n $mimeType = 'bmp';\r\n break;\r\n\r\n case 'tif':\r\n case 'tiff':\r\n $contentType = 'image';\r\n $mimeType = 'tiff';\r\n break;\r\n\r\n default:\r\n return false;\r\n }\r\n return true;\r\n }\r\n}", "function sanitize_email($email)\n {\n }", "public function getEmailAddress();", "function vEmail( $email )\r\n\t\t{\r\n\t\t return filter_var( $email, FILTER_VALIDATE_EMAIL );\r\n\t\t \r\n\t\t}", "function formatEmailAddressField(Email $message, string $field): ?string\n {\n $headers = $message->getHeaders();\n\n return $headers->get($field)?->getBodyAsString();\n\t}", "protected function getEmailTo($email): string\n {\n return $this->getDecodedEmailProperty($email, $email->Content->Headers->To[0]);\n }", "protected function parseAddress($email) {\n if (preg_match(self::SENDGRID_INTEGRATION_EMAIL_REGEX, $email, $matches)) {\n return [$matches[2], $matches[1]];\n }\n else {\n return [$email, ' '];\n }\n }", "private function clean_poea_email($email) {\n\n \t$emails = array();\n\n \t$email = str_replace('@y.c', \"@yahoo.com\", $email);\n\n\t\t$slash_email = explode(\"/\", $email);\n\t\t$or_email = explode(\" or \", $email);\n\t\t$and_email = explode(\"&\", $email);\n\n\t\tif(count($slash_email) > 1) {\n\t\t\t\n\t\t\tforeach ($slash_email as $v) {\n\n\t\t\t\t$v = trim($v);\n\n\t\t\t\tif(filter_var($v, FILTER_VALIDATE_EMAIL)) {\n\n\t\t\t\t\t$emails[] = $v;\t\t\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t} elseif(count($and_email) > 1) {\n\n\t\t\tforeach ($and_email as $v) {\n\n\t\t\t\t$v = trim($v);\n\n\t\t\t\tif(filter_var($v, FILTER_VALIDATE_EMAIL)) {\n\n\t\t\t\t\t$emails[] = $v;\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t} elseif(count($or_email) > 1) {\n\n\t\t\tforeach ($or_email as $v) {\n\n\t\t\t\t$v = trim($v);\n\n\t\t\t\tif(filter_var($v, FILTER_VALIDATE_EMAIL)) {\n\t\n\t\t\t\t\t$emails[] = $v;\t\t\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t} elseif(filter_var($email, FILTER_VALIDATE_EMAIL)) {\n\n\t\t\t$emails[] = $email;\t\n\n\t\t}\n\n\t\tif(empty($emails)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn json_encode($emails);\n }", "private function filtrarEmail($original_email)\n{\n $clean_email = filter_var($original_email,FILTER_SANITIZE_EMAIL);\n if ($original_email == $clean_email && filter_var($original_email,FILTER_VALIDATE_EMAIL))\n {\n return $original_email;\n }\n\n}", "public function emailToPunycode($email = '')\n\t{\n\t\t// do nothing by default\n\t\treturn $email;\n\t}", "public function decomposeCompleteEmail($email) {\n $return = array('name' => '', 'email' => '');\n $email = urldecode(str_replace('+', '%2B', $email));\n if (is_string($email) && mb_strpos($email, '@') !== false) {\n $return['email'] = trim(str_replace(array('<', '>'), '', mb_substr($email, mb_strrpos($email, '<'))));\n $decomposedName = trim(str_replace(array('\"', '+'), array('', ' '), mb_substr($email, 0, mb_strrpos($email, '<'))));\n\n if (mb_strpos($decomposedName, '=?') === 0) {\n $decodedHeader = $this->mimeHeaderDecode($decomposedName);\n if (!empty($decodedHeader[0]->text)) {\n $entireName = '';\n foreach ($decodedHeader as $namePart) {\n $entireName .= trim($this->_convertCharset($namePart->charset, $this->charset, $namePart->text)).' ';\n }\n $decomposedName = trim($entireName);\n }\n }\n\n $return['name'] = $decomposedName;\n }\n\n return $return;\n }", "function clean_email($email = \"\")\n\t{\n\t\t$email = trim($email);\n\t\t\n\t\t$email = str_replace( \" \", \"\", $email );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Check for more than 1 @ symbol\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( substr_count( $email, '@' ) > 1 )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n \t$email = preg_replace( \"#[\\;\\#\\n\\r\\*\\'\\\"<>&\\%\\!\\(\\)\\{\\}\\[\\]\\?\\\\/\\s]#\", \"\", $email );\n \t\n \tif ( preg_match( \"/^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,4}|[0-9]{1,4})(\\]?)$/\", $email) )\n \t{\n \t\treturn $email;\n \t}\n \telse\n \t{\n \t\treturn FALSE;\n \t}\n\t}", "function get_profile_email($email){\r\n\t\r\n}", "public function encodeMail($address)\n {\n if ($this->_getRenderer() instanceof Kwf_Component_Renderer_Mail) {\n return $text;\n }\n $address = trim($address);\n $address = preg_replace('/^(.+)@(.+)\\.([^\\.\\s]+)$/i',\n '$1'.$this->_atEncoding.'$2'.$this->_dotEncoding.'$3',\n $address\n );\n return $address;\n }", "public function testComposeEmailAddress()\n {\n $address = new ezcMailAddress( '[email protected]', 'John Doe' );\n $this->assertEquals( 'John Doe <[email protected]>', ezcMailTools::composeEmailAddress( $address ) );\n\n $address = new ezcMailAddress( '[email protected]' );\n $this->assertEquals( '[email protected]', ezcMailTools::composeEmailAddress( $address ) );\n }", "function filterEmail($email, $chars = ''){\r\n $email = trim(str_replace( array(\"\\r\",\"\\n\"), '', $email ));\r\n if( is_array($chars) ) $email = str_replace( $chars, '', $email );\r\n $email = preg_replace( '/(cc\\s*\\:|bcc\\s*\\:)/i', '', $email );\r\n return $email;\r\n}", "public static function email($email)\n {\n $pattern = '/^(?!(?:(?:\\x22?\\x5C[\\x00-\\x7E]\\x22?)|(?:\\x22?[^\\x5C\\x22]\\x22?)){255,})(?!(?:(?:\\x22?\\x5C[\\x00-\\x7E]\\x22?)|(?:\\x22?[^\\x5C\\x22]\\x22?)){65,}@)(?:(?:[\\x21\\x23-\\x27\\x2A\\x2B\\x2D\\x2F-\\x39\\x3D\\x3F\\x5E-\\x7E]+)|(?:\\x22(?:[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x21\\x23-\\x5B\\x5D-\\x7F]|(?:\\x5C[\\x00-\\x7F]))*\\x22))(?:\\.(?:(?:[\\x21\\x23-\\x27\\x2A\\x2B\\x2D\\x2F-\\x39\\x3D\\x3F\\x5E-\\x7E]+)|(?:\\x22(?:[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x21\\x23-\\x5B\\x5D-\\x7F]|(?:\\x5C[\\x00-\\x7F]))*\\x22)))*@(?:(?:(?!.*[^.]{64,})(?:(?:(?:xn--)?[a-z0-9]+(?:-[a-z0-9]+)*\\.){1,126}){1,}(?:(?:[a-z][a-z0-9]*)|(?:(?:xn--)[a-z0-9]+))(?:-[a-z0-9]+)*)|(?:\\[(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){7})|(?:(?!(?:.*[a-f0-9][:\\]]){7,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?)))|(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){5}:)|(?:(?!(?:.*[a-f0-9]:){5,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3}:)?)))?(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))(?:\\.(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))){3}))\\]))$/iD';\n if ((mb_strlen($email) > 254) || !preg_match($pattern, $email)) {\n return false;\n }\n return true;\n }", "public static function fromString($str) {\n static $matches= array(\n '/^=\\?([^\\?])+\\?([QB])\\?([^\\?]+)\\?= <([^ @]+@[0-9a-z.-]+)>$/i' => 3,\n '/^<?([^ @]+@[0-9a-z.-]+)>?$/i' => 0,\n '/^\"([^\"]+)\" <([^ @]+@[0-9a-z.-]+)>$/i' => 2,\n '/^([^<]+) <([^ @]+@[0-9a-z.-]+)>$/i' => 2,\n '/^([^ @]+@[0-9a-z.-]+) \\(([^\\)]+)\\)$/i' => 1,\n );\n \n $str= trim(chop($str));\n foreach ($matches as $match => $def) {\n if (!preg_match($match, $str, $_)) continue;\n \n switch ($def) {\n case 0: $mail= $_[1]; $personal= ''; break;\n case 1: $mail= $_[1]; $personal= $_[2]; break;\n case 2: $mail= $_[2]; $personal= $_[1]; break;\n case 3: $mail= $_[4]; switch (strtoupper($_[2])) {\n case 'Q': $personal= QuotedPrintable::decode($_[3]); break;\n case 'B': $personal= Base64::decode($_[3]); break;\n }\n break;\n }\n \n break;\n }\n \n // Was it unparsable?\n if (!isset($mail)) throw new FormatException('String \"'.$str.'\" could not be parsed');\n return new InternetAddress($mail, $personal);\n }", "function obfuscate_email($email) {\n\t$out = \"\";\n\t$len = strlen($email);\n\n\tfor($i = 0; $i < $len; $i++)\n\t\t$out .= \"&#\" . ord($email[$i]) . \";\";\n\n\treturn $out;\n}", "function MaskUserEMail($email){\n\n\t\t$maskedEMail = '';\n\t\t$positionOfAt = strpos($email, '@');\n\t\t$maskedEMail .= substr($email, 0,1);\n\t\tfor($i=1; $i < strlen($email); $i++) {\n\t\t\tif($i < $positionOfAt-1 || $i > $positionOfAt + 1)\n\t\t\t\t$maskedEMail .= '*';\n\t\t\telse\n\t\t\t\t$maskedEMail .= substr($email, $i,1);\n\t\t}\n\t\t$maskedEMail .= substr($email, $i-1,1);\n\t\treturn $maskedEMail;\n\t}", "function sanitize_email( $email ) {\n\t// Test for the minimum length the email can be\n\tif ( strlen( $email ) < 3 ) {\n\t\t/**\n\t\t * Filter a sanitized email address.\n\t\t *\n\t\t * This filter is evaluated under several contexts, including 'email_too_short',\n\t\t * 'email_no_at', 'local_invalid_chars', 'domain_period_sequence', 'domain_period_limits',\n\t\t * 'domain_no_periods', 'domain_no_valid_subs', or no context.\n\t\t *\n\t\t * @since 2.8.0\n\t\t *\n\t\t * @param string $email The sanitized email address.\n\t\t * @param string $email The email address, as provided to sanitize_email().\n\t\t * @param string $message A message to pass to the user.\n\t\t */\n\t\treturn apply_filters( 'sanitize_email', '', $email, 'email_too_short' );\n\t}\n\n\t// Test for an @ character after the first position\n\tif ( strpos( $email, '@', 1 ) === false ) {\n\t\t/** This filter is documented in wp-includes/formatting.php */\n\t\treturn apply_filters( 'sanitize_email', '', $email, 'email_no_at' );\n\t}\n\n\t// Split out the local and domain parts\n\tlist( $local, $domain ) = explode( '@', $email, 2 );\n\n\t// LOCAL PART\n\t// Test for invalid characters\n\t$local = preg_replace( '/[^a-zA-Z0-9!#$%&\\'*+\\/=?^_`{|}~\\.-]/', '', $local );\n\tif ( '' === $local ) {\n\t\t/** This filter is documented in wp-includes/formatting.php */\n\t\treturn apply_filters( 'sanitize_email', '', $email, 'local_invalid_chars' );\n\t}\n\n\t// DOMAIN PART\n\t// Test for sequences of periods\n\t$domain = preg_replace( '/\\.{2,}/', '', $domain );\n\tif ( '' === $domain ) {\n\t\t/** This filter is documented in wp-includes/formatting.php */\n\t\treturn apply_filters( 'sanitize_email', '', $email, 'domain_period_sequence' );\n\t}\n\n\t// Test for leading and trailing periods and whitespace\n\t$domain = trim( $domain, \" \\t\\n\\r\\0\\x0B.\" );\n\tif ( '' === $domain ) {\n\t\t/** This filter is documented in wp-includes/formatting.php */\n\t\treturn apply_filters( 'sanitize_email', '', $email, 'domain_period_limits' );\n\t}\n\n\t// Split the domain into subs\n\t$subs = explode( '.', $domain );\n\n\t// Assume the domain will have at least two subs\n\tif ( 2 > count( $subs ) ) {\n\t\t/** This filter is documented in wp-includes/formatting.php */\n\t\treturn apply_filters( 'sanitize_email', '', $email, 'domain_no_periods' );\n\t}\n\n\t// Create an array that will contain valid subs\n\t$new_subs = array();\n\n\t// Loop through each sub\n\tforeach ( $subs as $sub ) {\n\t\t// Test for leading and trailing hyphens\n\t\t$sub = trim( $sub, \" \\t\\n\\r\\0\\x0B-\" );\n\n\t\t// Test for invalid characters\n\t\t$sub = preg_replace( '/[^a-z0-9-]+/i', '', $sub );\n\n\t\t// If there's anything left, add it to the valid subs\n\t\tif ( '' !== $sub ) {\n\t\t\t$new_subs[] = $sub;\n\t\t}\n\t}\n\n\t// If there aren't 2 or more valid subs\n\tif ( 2 > count( $new_subs ) ) {\n\t\t/** This filter is documented in wp-includes/formatting.php */\n\t\treturn apply_filters( 'sanitize_email', '', $email, 'domain_no_valid_subs' );\n\t}\n\n\t// Join valid subs into the new domain\n\t$domain = join( '.', $new_subs );\n\n\t// Put the email back together\n\t$email = $local . '@' . $domain;\n\n\t// Congratulations your email made it!\n\t/** This filter is documented in wp-includes/formatting.php */\n\treturn apply_filters( 'sanitize_email', $email, $email, null );\n}", "function simpleEmailCheck($str) {\n // spec requests emails to lowercase\n // NOTE common allows for emails names (RFC 3696):\n /*\n a–z, A–Z, 0-9, !#$%&'*+-/=?^_`{|}~ \n */\n\n if (filter_var($str, FILTER_VALIDATE_EMAIL)) {\n // valid address\n $str = strtolower($str);\n return $str;\n }\n else {\n // invalid address\n print \"WARN: invalid email: \".$str.\"\\n\";\n return NULL;\n }\n }", "function is_valid_email($address) {\n $fields = preg_split(\"/@/\", $address, 2);\n if ((!preg_match(\"/^[0-9a-z]([-_.]?[0-9a-z])*$/i\", $fields[0])) || (!isset($fields[1]) || $fields[1] == '' || !is_valid_hostname_fqdn($fields[1], 0))) {\n return false;\n }\n return true;\n}", "function CheckEmailAddress($addr,&$valid)\n{\n global $TARGET_EMAIL;\n\n $valid = \"\";\n $list = explode(\",\",$addr);\n for ($ii = 0 ; $ii < count($list) ; $ii++)\n {\n\t\t$email = UnMangle($list[$ii]);\n for ($jj = 0 ; $jj < count($TARGET_EMAIL) ; $jj++)\n if (eregi($TARGET_EMAIL[$jj],$email))\n {\n if (empty($valid))\n \t$valid = $email;\n else\n $valid .= \",\".$email;\n }\n }\n return (!empty($valid));\n}", "public function encodeAddress($casilla) {\n\n $casilla = trim($casilla);\n // Si la casilla no trae name, no le hace nada\n if (preg_match('/^<?[_\\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\\.)+[a-zA-Z]{2,6}>?$/', $casilla)) {\n return $casilla;\n };\n\n // Si trae name, ve si hay que encodificarlo\n $matches = array();\n if (preg_match('/(.+)(<[_\\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\\.)+[a-zA-Z]{2,6}>)$/', $casilla, $matches)) {\n $name = $matches[1];\n $email = $matches[2];\n\n // Si el nombre tiene tildes o ()<>@,;\\:\". lo encodifica\n if (preg_match('/([\\x80-\\xFF\\(\\)\\<\\>\\@\\,\\;\\\\\\:\\\"\\.]){1}/', $name)) {\n $preferences = array(\n 'input-charset' => 'UTF-8',\n 'output-charset' => 'UTF-8', // ISO-8859-1 o UTF-8\n 'line-length' => 255,\n 'scheme' => 'B', // o Q\n 'line-break-chars' => \"\\n\"\n );\n $name = iconv_mime_encode('Reply-to', $name, $preferences);\n $name = preg_replace(\"#^Reply-to\\:\\ #\", '', $name);\n $casilla = $name . $email;\n };\n };\n return $casilla;\n }", "function isEmail($email) {\nreturn(preg_match(\"/^[-_.[:alnum:]]+@((([[:alnum:]]|[[:alnum:]][[:alnum:]-]*[[:alnum:]])\\.)+(ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|info|int|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mil|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nt|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)$|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5])\\.){3}([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$/i\",$email));\n}", "function check_email_address($email) \n{\n // First, we check that there's one @ symbol, and that the lengths are right\n if (!ereg(\"^[^@]{1,64}@[^@]{1,255}$\", $email)) \n {\n // Email invalid because wrong number of characters in one section, or wrong number of @ symbols.\n return false;\n }\n // Split it into sections to make life easier\n $email_array = explode(\"@\", $email);\n $local_array = explode(\".\", $email_array[0]);\n for ($i = 0; $i < sizeof($local_array); $i++) \n {\n if (!ereg(\"^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\\.-]{0,63})|(\\\"[^(\\\\|\\\")]{0,62}\\\"))$\", $local_array[$i])) \n {\n return false;\n }\n }\n if (!ereg(\"^\\[?[0-9\\.]+\\]?$\", $email_array[1])) \n { // Check if domain is IP. If not, it should be valid domain name\n $domain_array = explode(\".\", $email_array[1]);\n if (sizeof($domain_array) < 2) \n {\n return false; // Not enough parts to domain\n }\n for ($i = 0; $i < sizeof($domain_array); $i++) \n {\n if (!ereg(\"^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$\", $domain_array[$i])) \n {\n return false;\n }\n }\n }\n return true;\n}", "function emc_obfuscate_mailto_url( $email ) {\r\n\r\n\tif ( ! is_email( $email ) ) return false;\r\n\r\n\t$email = 'mailto:' . antispambot( $email );\r\n\r\n\treturn esc_url( $email );\r\n\r\n}", "public function sanitizeEmail($data){\n $data = filter_var($data, FILTER_SANITIZE_EMAIL);\n return $data;\n }", "function string_email_links( $p_string ) {\r\n\t$p_string = string_email( $p_string );\r\n return $p_string;\r\n}", "public static function email_rfc($email)\r\n {\r\n $qtext = '[^\\\\x0d\\\\x22\\\\x5c\\\\x80-\\\\xff]';\r\n $dtext = '[^\\\\x0d\\\\x5b-\\\\x5d\\\\x80-\\\\xff]';\r\n $atom = '[^\\\\x00-\\\\x20\\\\x22\\\\x28\\\\x29\\\\x2c\\\\x2e\\\\x3a-\\\\x3c\\\\x3e\\\\x40\\\\x5b-\\\\x5d\\\\x7f-\\\\xff]+';\r\n $pair = '\\\\x5c[\\\\x00-\\\\x7f]';\r\n\r\n $domain_literal = \"\\\\x5b($dtext|$pair)*\\\\x5d\";\r\n $quoted_string = \"\\\\x22($qtext|$pair)*\\\\x22\";\r\n $sub_domain = \"($atom|$domain_literal)\";\r\n $word = \"($atom|$quoted_string)\";\r\n $domain = \"$sub_domain(\\\\x2e$sub_domain)*\";\r\n $local_part = \"$word(\\\\x2e$word)*\";\r\n $addr_spec = \"$local_part\\\\x40$domain\";\r\n\r\n return (bool) preg_match('/^'.$addr_spec.'$/D', (string) $email);\r\n }", "function cfdef_prepare_email_value_for_email( $p_value ) {\n\treturn 'mailto:' . $p_value;\n}", "public static function convert($msg, $name, $email, $activation_key = '') {\n $msg = str_replace('[user_name]', $name, $msg);\n // repalce [user_email] to $email\n $msg = str_replace('[user_email]', $email, $msg);\n\n // if isset $activation_key replace it \n if($activation_key) {\n $msg = str_replace('[activation_key_link]',\n 'http://' . $_SERVER['HTTP_HOST'] . '/activate?key=' . $activation_key,\n $msg);\n }\n \n // return $msg with real subscriber information\n return $msg;\n }", "public function testEmail() {\n $this->assertEquals('[email protected]', Sanitize::email('em<a>[email protected]'));\n $this->assertEquals('[email protected]', Sanitize::email('email+t(a)[email protected]'));\n $this->assertEquals('[email protected]', Sanitize::email('em\"ail+t(a)[email protected]'));\n }", "protected function getTargetEmailAddress() {\n\t\tif (isset($this->settings['emailAddress']) && GeneralUtility::validEmail(trim($this->settings['emailAddress']))) {\n\t\t\treturn trim($this->settings['emailAddress']);\n\t\t}\n\t\treturn '';\n\t}", "public function filterEmail($email) {\n \n $email = filter_var($email, FILTER_SANITIZE_EMAIL);\n \n if (filter_var($email, FILTER_VALIDATE_EMAIL)) {\n return \"$email\"; \n } else {\n die(\"$email is Invalid email\");\n }\n\n }", "function isEmail($input) {\n // Matches Email addresses. (Found out how to break up a RedEx so that it can be nicly commited.)\n return (preg_match(\n \"~(^ ## Match starts at the beginning of the string.\n (?>[[:alnum:]._-])+ ## Matches any alpha numaric character plus the '.', '_', and '-'\n ## For the name part of an address. \n (?>@) ## Matches the at sign.\n (?>[[:alnum:]])+ ## Matches any alpha numaric character\n ## For the Place part of the address.\n \n (?> ## To match things like 'uk.com 'or just '.com'\n (?:\\.[[:alpha:]]{2,3}\\.[[:alpha:]]{2,3}) ## Matches a '.' then 2-3 alphabet characters\n ## then another '.' and 2-3 alphabet characters.\n | ## Or Matches\n (?:\\.[[:alpha:]]{2,3}) ## a single '.' then 2-3 alphabet characters.\n )\n $ ## Match to the end of the string.\n )~x\", $input));\n }", "function to_rfc2822_email(array $addresses): string\n {\n $addresses = !empty($addresses['address']) ? [$addresses] : $addresses;\n\n return collect($addresses)\n ->map(function (array $item) {\n $name = Arr::get($item, 'name');\n $address = Arr::get($item, 'address');\n\n if (!is_email($address)) {\n return false;\n }\n\n return $name ? \"{$name} <{$address}>\" : $address;\n })\n ->filter()\n ->implode(', ');\n }", "private function parseEmailAddress($contents)\n {\n $radd = '(\\b[A-Z0-9._%+-]+@(?:[A-Z0-9-]+\\.)+[A-Z]{2,6}\\b)';\n\n // get email from address\n $regex = sprintf('/^From\\:.*%s/im',$radd);\n $hasMatch = preg_match($regex,$contents,$matches);\n $fromAddress = $hasMatch ? $matches[1]:null;\n\n // get email to address\n $regex = sprintf('/^To\\:\\s+%s/im',$radd);\n $hasMatch = preg_match($regex,$contents,$matches);\n $toAddress1 = $hasMatch ? $matches[1]:null;\n\n // get email to address\n $regex = sprintf('/^To\\:.*%s/im',$radd);\n $hasMatch = preg_match($regex,$contents,$matches);\n $toAddress2 = $hasMatch ? $matches[1]:null;\n\n $this->fromMails[] = $fromAddress;\n $this->toMails[] = $toAddress1;\n $this->toMails[] = $toAddress2;\n\n return [\n 'from' => $fromAddress,\n 'to' => [$toAddress1,$toAddress2],\n ];\n }", "public function filterEmail($email)\n {\n $rule = array(\n \"\\r\" => '',\n \"\\n\" => '',\n \"\\t\" => '',\n '\"' => '',\n ',' => '',\n '<' => '',\n '>' => ''\n );\n $email = strtr($email, $rule);\n $email = filter_var($email, FILTER_SANITIZE_EMAIL);\n return $email;\n }", "function makeEmail( $email, $column = '' )\n{\n\t$email = trim( $email );\n\n\tif ( $email == '' )\n\t{\n\t\treturn '';\n\t}\n\n\t// Validate email.\n\tif ( ! filter_var( $email, FILTER_VALIDATE_EMAIL ) )\n\t{\n\t\treturn $email;\n\t}\n\n\treturn '<a href=\"mailto:' . $email . '\">' . $email . '</a>';\n}", "public function getMatchedEmailAddress();", "function is_email($addr)\n{\n $addr = strtolower(trim($addr));\n $addr = str_replace(\"&#064;\",\"@\",$addr);\n if ( (strstr($addr, \"..\")) || (strstr($addr, \".@\")) || (strstr($addr, \"@.\")) || (!preg_match(\"/^[[:alnum:]][a-z0-9_.-]*@[a-z0-9][a-z0-9.-]{0,61}[a-z0-9]\\.[a-z]{2,6}\\$/\", stripslashes(trim($addr)))) ) {\n $emailvalidity = 0;\n } else {\n $emailvalidity = 1;\n }\n return $emailvalidity;\n}", "function _osc_from_email_aux() {\n $tmp = osc_mailserver_mail_from();\n return !empty($tmp)?$tmp:osc_contact_email();\n }", "function eMail($string) {\n\n\n\t\t}", "function get_email_domain($e)\n{\n\t$email = explode('@', $e);\n\t$num = count($email);\n\treturn $email[$num-1];\n}", "function jid_to_user( $jid ) {\n\t\treturn substr( $jid, 0, strpos( $jid, \"@\" ) );\n\t}", "public static function encodeEmailAddress ($email)\r\n\t{\r\n\t\t# Return the string\r\n\t\treturn str_replace ('@', '<span>&#64;</span>', $email);\r\n\t}", "public function extractDomain($email)\n {\n return substr(strrchr($email, '@'), 1);\n }", "function getDefaultEmailValue($username, $domain) {\n $v = \"\";\n\n if (defined('IMAP_DEFAULTFROM')) {\n switch (IMAP_DEFAULTFROM) {\n case 'username':\n $v = $username;\n break;\n case 'domain':\n $v = $domain;\n break;\n case 'ldap':\n $v = getIdentityFromLdap($username, $domain, IMAP_FROM_LDAP_EMAIL, false);\n break;\n case 'sql':\n $v = getIdentityFromSql($username, $domain, IMAP_FROM_SQL_EMAIL, false);\n break;\n case 'passwd':\n $v = getIdentityFromPasswd($username, $domain, 'EMAIL', false);\n break;\n default:\n $v = $username . IMAP_DEFAULTFROM;\n break;\n }\n }\n\n return $v;\n}", "public function exchange_primary_address($username, $emailaddress, $isGUID=false) {\n if ($username===NULL){ return (\"Missing compulsory field [username]\"); } \n if ($emailaddress===NULL) { return (\"Missing compulsory fields [emailaddress]\"); }\n \n // Find the dn of the user\n $user=$this->user_info($username,array(\"cn\",\"proxyaddresses\"), $isGUID);\n if ($user[0][\"dn\"]===NULL){ return (false); }\n $user_dn=$user[0][\"dn\"];\n \n if (is_array($user[0][\"proxyaddresses\"])) {\n $modaddresses = array();\n for ($i=0;$i<sizeof($user[0]['proxyaddresses']);$i++) {\n if (strstr($user[0]['proxyaddresses'][$i], 'SMTP:') !== false) {\n $user[0]['proxyaddresses'][$i] = str_replace('SMTP:', 'smtp:', $user[0]['proxyaddresses'][$i]);\n }\n if ($user[0]['proxyaddresses'][$i] == 'smtp:' . $emailaddress) {\n $user[0]['proxyaddresses'][$i] = str_replace('smtp:', 'SMTP:', $user[0]['proxyaddresses'][$i]);\n }\n if ($user[0]['proxyaddresses'][$i] != '') {\n $modaddresses['proxyAddresses'][$i] = $user[0]['proxyaddresses'][$i];\n }\n }\n \n $result=@ldap_mod_replace($this->_conn,$user_dn,$modaddresses);\n if ($result==false){ return (false); }\n \n return (true);\n }\n \n }", "public function getFirstAndLastNameFromEmail()\n {\n $exploded_full_name = explode(' ', str_replace(['.', '-', '_'], [' ', ' ', ' '], substr($this->getEmail(), 0, strpos($this->getEmail(), '@'))));\n\n if (count($exploded_full_name) === 1) {\n $first_name = mb_strtoupper(mb_substr($exploded_full_name[0], 0, 1)) . mb_substr($exploded_full_name[0], 1);\n $last_name = '';\n } else {\n $full_name = [];\n\n foreach ($exploded_full_name as $k) {\n $full_name[] = mb_strtoupper(mb_substr($k, 0, 1)) . mb_substr($k, 1);\n }\n\n $first_name = array_shift($full_name);\n $last_name = implode(' ', $full_name);\n }\n\n return [$first_name, $last_name];\n }", "function email_validation($toemail) \n\t{ \n\t\t$param_array = func_get_args();\n\t\t\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD email::email_validation() - PARAMETER LIST : ', $param_array);\n\t\t\t\n\t\tif($_SERVER['REMOTE_ADDR'] != \"127.0.0.1\")\n\t\t{\n\t\t\n\t\tglobal $HTTP_HOST; \n\t\t\n\t\t$result = array(); \n\t\t\n\t\t$result[0]=true; \n\t\t\n\t\t$result[1]=\"$toemail appears to be valid.\"; \n\t\t/* this regular expression is not allowing some of the domain names like .name etc., so we check for one @ symbol and \n\t\tatleast 1 \".\" symbol in email id.\n\t\tif (!eregi(\"^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$\", $toemail)) \n\t\t{ \t\t\n\t\t\t$result[0]=false; \n\t\t\t\n\t\t\t$result[1]=\"$toemail is not properly formatted\"; \n\t\t\t\n\t\t}\n\t\t*/\n\t\t\n\t\t//remove the name from the email\n\t\t\n\t\t$earr = explode(\"<\", $toemail);\n\t\t\n\t\tif(count($earr) == 2 && strlen(trim($earr[1])) > 0)\n\t\t\t$email = substr(trim($earr[1]),0,-1);\n\t\telse\n\t\t\t$email = trim($earr[0]);\n\t\t\n\t\t$eml_arr = explode(\"@\",$email);\n\t\t$result[0]=false; \n\t\t\n\t\t$result[1]=\"$toemail is not properly formatted\"; \n\t\tif(count($eml_arr) == 2 && strlen(trim($eml_arr[0])) > 0 && strlen(trim($eml_arr[1])) > 0)\n\t\t{\n\t\t\t$domain_arr = explode(\".\",$eml_arr[1]);\n\t\t\tif(count($domain_arr) > 1 && strlen(trim($domain_arr[0])) > 0 && strlen(trim($domain_arr[1])) > 0)\n\t\t\t{\n\t\t\t\t$result[0]=true; \n\t\t\t\t$result[1]=\"$toemail appears to be valid.\"; \n\t\t\t}\n\t\t}\n\t\t\n\t\tif(1==2)\n\t\t{//need not check by communicating to email server...\n\t\t\n\t\tlist ( $username, $domain ) = split (\"@\",$toemail); \n\t\t\n\t\tif (getmxrr($domain, $MXHost)) \n\t\t{\t\t\n\t\t\t$connectaddress = $MXHost[0];\n\t\t}\n\t\telse \n\t\t{\t\t\n\t\t\t$connectaddress = $domain;\n\t\t} \n\t\t//echo \"Connect address : \" . $connectaddress . \"<br>\";\n\t\t//echo \"Domain Name : \" . $domain . \"<br>\";\n\t\t$connect = fsockopen ( $connectaddress, 25 ); \n\t\t\n\t\tif ($connect) \n\t\t{\t\t\n\t\t\tif (ereg(\"^220\", $Out = fgets($connect, 1024))) \n\t\t\t{ \n\t\t\t\n\t\t\t fputs ($connect, \"HELO $HTTP_HOST\\r\\n\"); \n\t\t\t \n\t\t\t $out = fgets ( $connect, 1024 ); \n\t\t\t \n\t\t\t $this->from_email = $GLOBALS['site_config']['admin_email'];\n\t\t\t \n\t\t\t $from = $this->from_email;\n\t\t\t \n\t\t\t fputs ($connect, \"MAIL FROM: <{$from}>\\r\\n\"); \n\t\t\t \n\t\t\t $from = fgets ( $connect, 1024 ); \n\t\t\t \n\t\t\t fputs ($connect, \"RCPT TO: <{$toemail}>\\r\\n\"); \n\t\t\t \n\t\t\t $to = fgets ($connect, 1024); \n\t\t\t \n\t\t\t fputs ($connect, \"QUIT\\r\\n\"); \n\t\t\t \n\t\t\t fclose($connect); \n\t\t\t \n\t\t\t if (!ereg (\"^250\", $from) || !ereg ( \"^250\", $to )) \n\t\t\t { \n\t\t\t \n\t\t\t\t $result[0]=false; \n\t\t\t\t \n\t\t\t\t $result[1]=\"Server rejected address\"; \n\t\t\t\t \n\t\t\t\t} \n\t\t\t} \n\t\t\t\n\t\t\telse\n\t\t\t{\t\t\t\t\n\t\t\t\t$result[0] = false; \n\t\t\t\t\n\t\t\t\t$result[1] = \"No response from server\"; \n\t\t\t\t\n\t\t\t } \n\t\t\t \n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$result[0]=false; \n\t\t\t\n\t\t\t$result[1]=\"Can not connect E-Mail server.\"; \n\t\t\t\n\t\t\t//return $result; \n\t\t} \n\t\t\n\t\t}\n\t\t\n\t\tif(!$result[0])\n\t\t{\n\n\t\t\t$ttext = \"\";\n\t\t\t$ttext .= \"<table border=0 cellpadding=3 cellspacing=1 align=center width=90%>\";\n\t\t\t$ttext .= \"<tr align=left><td><strong>Error Message</strong></td><td>\" . $result[1] . \" (\" . $toemail . \")\" . \"</td></tr>\";\n\t\t\t$ttext .= \"</table>\";\n\n\t\t\t$GLOBALS['logger_obj']->error('<br>METHOD email::email_validation() - Return Value : ', $ttext,'email');\n\n\t\t}\n\t}\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD email::email_validation() - Return Value : ', $result);\n\t\treturn $result; \n\t\t\n\t}", "public static function normalizeAddress(PhutilEmailAddress $address) {\n $raw_address = $address->getAddress();\n $raw_address = phutil_utf8_strtolower($raw_address);\n $raw_address = trim($raw_address);\n\n // If a mailbox prefix is configured and present, strip it off.\n $prefix_key = 'metamta.single-reply-handler-prefix';\n $prefix = PhabricatorEnv::getEnvConfig($prefix_key);\n\n if (phutil_nonempty_string($prefix)) {\n $prefix = $prefix.'+';\n $len = strlen($prefix);\n\n if (!strncasecmp($raw_address, $prefix, $len)) {\n $raw_address = substr($raw_address, $len);\n }\n }\n\n return id(clone $address)\n ->setAddress($raw_address);\n }", "private function parseEmail($email)\n {\n $addressList = imap_rfc822_parse_adrlist($email, '');\n\n if ($addressList) {\n $address = $addressList[0];\n $name = isset($address->personal) ? $address->personal : '';\n $email = $address->mailbox . '@' . $address->host;\n\n return array(\n 'name' => $name,\n 'email' => $email\n );\n } else {\n return false;\n }\n }", "function is_email_address_unsafe($user_email)\n {\n }", "public function email($email) {\n\t\n\t\n\t\n\t\treturn $email;\n\t\n\t}", "function sanitize_email($value)\n{\n return filter_var($value, FILTER_SANITIZE_EMAIL);\n}", "function oos_validate_is_email($sEmail) {\n $bValidAddress = true;\n\n $mail_pat = '^(.+)@(.+)$';\n $valid_chars = \"[^] \\(\\)<>@,;:\\.\\\\\\\"\\[]\";\n $atom = \"$valid_chars+\";\n $quoted_user='(\\\"[^\\\"]*\\\")';\n $word = \"($atom|$quoted_user)\";\n $user_pat = \"^$word(\\.$word)*$\";\n $ip_domain_pat='^\\[([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})\\]$';\n $domain_pat = \"^$atom(\\.$atom)*$\";\n\n if (eregi($mail_pat, $sEmail, $components)) {\n $user = $components[1];\n $domain = $components[2];\n // validate user\n if (eregi($user_pat, $user)) {\n // validate domain\n if (eregi($ip_domain_pat, $domain, $ip_components)) {\n // this is an IP address\n \t for ($i=1;$i<=4;$i++) {\n \t if ($ip_components[$i] > 255) {\n \t $bValidAddress = false;\n \t break;\n \t }\n }\n } else {\n // Domain is a name, not an IP\n if (eregi($domain_pat, $domain)) {\n /* domain name seems valid, but now make sure that it ends in a valid TLD or ccTLD\n and that there's a hostname preceding the domain or country. */\n $domain_components = explode(\".\", $domain);\n // Make sure there's a host name preceding the domain.\n if (count($domain_components) < 2) {\n $bValidAddress = false;\n } else {\n $top_level_domain = strtolower($domain_components[count($domain_components)-1]);\n // Allow all 2-letter TLDs (ccTLDs)\n if (eregi('^[a-z][a-z]$', $top_level_domain) != 1) {\n $sTld = get_all_top_level_domains();\n if (eregi(\"$sTld\", $top_level_domain) == 0) {\n $bValidAddress = false;\n }\n }\n }\n } else {\n \t $bValidAddress = false;\n \t }\n \t}\n } else {\n $bValidAddress = false;\n }\n } else {\n $bValidAddress = false;\n }\n if ($bValidAddress && ENTRY_EMAIL_ADDRESS_CHECK == '1') {\n if (!checkdnsrr($domain, \"MX\") && !checkdnsrr($domain, \"A\")) {\n $bValidAddress = false;\n }\n }\n return $bValidAddress;\n }", "function sanitize_email(string $text = '')\n{\n return filter_var(strtolower(trim($text)), FILTER_SANITIZE_EMAIL);\n}", "public static function maskEmail($email){\n $em = explode(\"@\",$email);\n $name = $em[0];\n $len = floor(strlen($name)/2);\n\n $len_=strlen($name)%2 +$len;\n\n return substr($name,0, $len) . str_repeat('*', $len_) . \"@\" . end($em); \n }", "private function _legacy_email_is_valid($email) {\n\t\t$valid_address = true;\n\n\t\t$mail_pat = '^(.+)@(.+)$';\n\t\t$valid_chars = \"[^] \\(\\)<>@,;:\\.\\\\\\\"\\[]\";\n\t\t$atom = \"$valid_chars+\";\n\t\t$quoted_user='(\\\"[^\\\"]*\\\")';\n\t\t$word = \"($atom|$quoted_user)\";\n\t\t$user_pat = \"^$word(\\.$word)*$\";\n\t\t$ip_domain_pat='^\\[([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})\\]$';\n\t\t$domain_pat = \"^$atom(\\.$atom)*$\";\n\n\t\tif (preg_match(\"/$mail_pat/\", $email, $components)) {\n\t\t\t$user = $components[1];\n\t\t\t$domain = $components[2];\n\t\t\t// validate user\n\t\t\tif (preg_match(\"/$user_pat/\", $user)) {\n\t\t\t\t// validate domain\n\t\t\t\tif (preg_match(\"/$ip_domain_pat/\", $domain, $ip_components)) {\n\t\t\t\t\t// this is an IP address\n\t\t\t\t\tfor ($i=1;$i<=4;$i++) {\n\t\t\t\t\t\tif ($ip_components[$i] > 255) {\n\t\t\t\t\t\t\t$valid_address = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// Domain is a name, not an IP\n\t\t\t\t\tif (preg_match(\"/$domain_pat/\", $domain)) {\n\t\t\t\t\t\t/* domain name seems valid, but now make sure that it ends in a valid TLD or ccTLD\n\t\t\t\t\t\tand that there's a hostname preceding the domain or country. */\n\t\t\t\t\t\t$domain_components = explode(\".\", $domain);\n\t\t\t\t\t\t// Make sure there's a host name preceding the domain.\n\t\t\t\t\t\tif (sizeof($domain_components) < 2) {\n\t\t\t\t\t\t\t$valid_address = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$top_level_domain = strtolower($domain_components[sizeof($domain_components)-1]);\n\t\t\t\t\t\t\t// Allow all 2-letter TLDs (ccTLDs)\n\t\t\t\t\t\t\tif (preg_match('/^[a-z][a-z]$/', $top_level_domain) != 1) {\n\t\t\t\t\t\t\t\t$tld_pattern = '';\n\t\t\t\t\t\t\t\t// Get authorized TLDs from text file\n\t\t\t\t\t\t\t\t$tlds = file(DIR_WS_INCLUDES.'tld.txt');\n\t\t\t\t\t\t\t\tforeach($tlds as $line) {\n\t\t\t\t\t\t\t\t\t// Get rid of comments\n\t\t\t\t\t\t\t\t\t$words = explode('#', $line);\n\t\t\t\t\t\t\t\t\t$tld = trim($words[0]);\n\t\t\t\t\t\t\t\t\t// TLDs should be 3 letters or more\n\t\t\t\t\t\t\t\t\tif (preg_match('/^[a-z]{3,}$/', $tld) == 1) {\n\t\t\t\t\t\t\t\t\t\t$tld_pattern .= '^'.$tld.'$|';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// Remove last '|'\n\t\t\t\t\t\t\t\t$tld_pattern = substr($tld_pattern, 0, -1);\n\t\t\t\t\t\t\t\tif (preg_match(\"/$tld_pattern/\", $top_level_domain) == 0) {\n\t\t\t\t\t\t\t\t\t$valid_address = false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$valid_address = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$valid_address = false;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$valid_address = false;\n\t\t}\n\t\tif ($valid_address && ENTRY_EMAIL_ADDRESS_CHECK == 'true') {\n\t\t\tif (!checkdnsrr($domain, \"MX\") && !checkdnsrr($domain, \"A\")) {\n\t\t\t\t$valid_address = false;\n\t\t\t}\n\t\t}\n\t\treturn $valid_address;\n\t}", "protected function getEmailSender($email): string\n {\n return $this->getDecodedEmailProperty($email, $email->Content->Headers->From[0]);\n }", "function checkEmail($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "function buildEmail($user, $host)\n{\n\t$tmpEmail = $user . \"@\" . $host;\n\tif (isLegalEmail($tmpEmail))\n\t{\n\t\treturn $tmpEmail;\n\t}\n\treturn null;\n}", "public static function email($string) {\n \tif (preg_match('/^[a-z0-9_.+-]+@([a-z0-9-]+\\.)+[a-z]{2,4}$/i', trim($string))) {\n return trim($string);\n } else {\n return false;\n }\n }", "function antispambot($email_address, $hex_encoding = 0)\n {\n }", "function hrefCryptMail($mail)\n{\n $cs = \"mailto:\".$mail;\n $result=\"\";\n for($i=0;$i<strlen($cs);$i++) {\n $n=ord($cs[$i]);\n if($n>=8364)$n=128; \n $result.=chr($n+1);\n }\n $href=\"javascript:linkTo_UnCryptMailto('$result');\";\n return $href;\n}", "public function TestEmail($data) {\r\n $data = trim($data);\r\n $data = filter_var($data, FILTER_SANITIZE_EMAIL);\r\n $data = filter_var($data,FILTER_VALIDATE_EMAIL);\r\n return $data;\r\n }", "public static function Email($string, $sanitize=true){\n\t\tif($sanitize){\n\t\t\t$string = filter_var($string, FILTER_SANITIZE_EMAIL);\n\t\t}\n\t\treturn filter_var($string, FILTER_VALIDATE_EMAIL);\n\t}", "function validEmail($email)\r\n{\r\n$isValid = true;\r\n$atIndex = strrpos($email, \"@\");\r\nif (is_bool($atIndex) && !$atIndex)\r\n{\r\n$isValid = false;\r\n}\r\nelse\r\n{\r\n$domain = substr($email, $atIndex+1);\r\n$local = substr($email, 0, $atIndex);\r\n$localLen = strlen($local);\r\n$domainLen = strlen($domain);\r\nif ($localLen < 1 || $localLen > 64)\r\n{\r\n// local part length exceeded\r\n$isValid = false;\r\n}\r\nelse if ($domainLen < 1 || $domainLen > 255)\r\n{\r\n// domain part length exceeded\r\n$isValid = false;\r\n}\r\nelse if ($local[0] == '.' || $local[$localLen-1] == '.')\r\n{\r\n// local part starts or ends with '.'\r\n$isValid = false;\r\n}\r\nelse if (preg_match('/\\\\.\\\\./', $local))\r\n{\r\n// local part has two consecutive dots\r\n$isValid = false;\r\n}\r\nelse if (!preg_match('/^[A-Za-z0-9\\\\-\\\\.]+$/', $domain))\r\n{\r\n// character not valid in domain part\r\n$isValid = false;\r\n}\r\nelse if (preg_match('/\\\\.\\\\./', $domain))\r\n{\r\n// domain part has two consecutive dots\r\n$isValid = false;\r\n}\r\nelse if\r\n(!preg_match('/^(\\\\\\\\.|[A-Za-z0-9!#%&`_=\\\\/$\\'*+?^{}|~.-])+$/',\r\nstr_replace(\"\\\\\\\\\",\"\",$local)))\r\n{\r\n// character not valid in local part unless\r\n// local part is quoted\r\nif (!preg_match('/^\"(\\\\\\\\\"|[^\"])+\"$/',\r\nstr_replace(\"\\\\\\\\\",\"\",$local)))\r\n{\r\n$isValid = false;\r\n}\r\n}\r\nif ($isValid && !(checkdnsrr($domain,\"MX\") ||\r\n↪checkdnsrr($domain,\"A\")))\r\n{\r\n// domain not found in DNS\r\n$isValid = false;\r\n}\r\n}\r\nreturn $isValid;\r\n}", "public static function get_email($code) {\n $message = openssl_decrypt($code, ConfirmationCode::$encrypt_method, ConfirmationCode::$key, 0, ConfirmationCode::$iv);\n return substr($message, 0, strpos($message, \"@\")).\"@buffalo.edu\";\n }", "protected function validate_email( $p_value ) {\n\t\t$email = trim($p_value);\n\n\t\t$isValid = true;\n\t\t$atIndex = strrpos($email, \"@\");\n\t\tif ( is_bool($atIndex) && !$atIndex ) {\n\t\t\treturn $this->return_handler->results(400,$this->database_name . \":\" . $this->table_name . \" email address missing a @\",null);\n\t\t} else {\n\t\t\t// get domain and local string\n\t\t\t$domain = substr($email, $atIndex + 1);\n\t\t\t$local = substr($email, 0, $atIndex);\n\t\t\t// get length of domain and local string\n\t\t\t$localLen = strlen($local);\n\t\t\t$domainLen = strlen($domain);\n\t\t\tif ( $localLen < 1 ) {\n\t\t\t\t// local part length exceeded\n\t\t\t\treturn $this->return_handler->results(400,$this->database_name . \":\" . $this->table_name . \" email address prior to @ is missing\",null);\n\t\t\t} else if ( $localLen > 64 ) {\n\t\t\t\t// local part length exceeded\n\t\t\t\treturn $this->return_handler->results(400,$this->database_name . \":\" . $this->table_name . \" email address prior to @ is more than 64 chars\",null);\n\t\t\t} else if ( $domainLen < 1 ) {\n\t\t\t\t// domain part length exceeded\n\t\t\t\treturn $this->return_handler->results(400,$this->database_name . \":\" . $this->table_name . \" email address domain missing\",null);\n\t\t\t} else if ( $domainLen > 255 ) {\n\t\t\t\t// domain part length exceeded\n\t\t\t\treturn $this->return_handler->results(400,$this->database_name . \":\" . $this->table_name . \" email address domain is more than 255 chars\",null);\n\t\t\t} else if ( $local[0] == '.' ) {\n\t\t\t\t// local part starts or ends with '.'\n\t\t\t\treturn $this->return_handler->results(400,$this->database_name . \":\" . $this->table_name . \" email address starts with '.'\",null);\n\t\t\t} else if ( $local[$localLen - 1] == '.' ) {\n\t\t\t\t// local part starts or ends with '.'\n\t\t\t\treturn $this->return_handler->results(400,$this->database_name . \":\" . $this->table_name . \" email address prior to @ ends with '.'\",null);\n\t\t\t} else if ( preg_match('/\\\\.\\\\./', $local) ) {\n\t\t\t\t// local part has two consecutive dots\n\t\t\t\treturn $this->return_handler->results(400,$this->database_name . \":\" . $this->table_name . \" email address prior to @ contains '..'\",null);\n\t\t\t} else if ( !preg_match('/^[A-Za-z0-9\\\\-\\\\.]+$/', $domain) ) {\n\t\t\t\t// character not valid in domain part\n\t\t\t\treturn $this->return_handler->results(400,$this->database_name . \":\" . $this->table_name . \" email address domain contains invalid character\",null);\n\t\t\t} else if ( preg_match('/\\\\.\\\\./', $domain) ) {\n\t\t\t\t// domain part has two consecutive dots\n\t\t\t\treturn $this->return_handler->results(400,$this->database_name . \":\" . $this->table_name . \" email address domain contains '..'\",null);\n\t\t\t} else if ( !preg_match('/^(\\\\\\\\.|[A-Za-z0-9!#%&`_=\\\\/$\\'*+?^{}|~.-])+$/', str_replace(\"\\\\\\\\\",\"\",$local)) ) {\n\t\t\t\t// character not valid in local part unless\n\t\t\t\t// local part is quoted\n\t\t\t\tif (!preg_match('/^\"(\\\\\\\\\"|[^\"])+\"$/', str_replace(\"\\\\\\\\\",\"\",$local))) {\n\t\t\t\t\treturn $this->return_handler->results(400,$this->database_name . \":\" . $this->table_name . \" email address prior to @ must be quoted due to special character\",null);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( $isValid && !(checkdnsrr($domain,\"MX\") || checkdnsrr($domain,\"A\")) ) {\n\t\t\t\t// domain not found in DNS\n\t\t\t\treturn $this->return_handler->results(400,$this->database_name . \":\" . $this->table_name . \" email address domain not found in DNS\",null);\n\t\t\t}\n\t\t}\n\n\t\treturn $this->return_handler->results(200,\"\",null);\n\t}", "public function encode_email($email)\n\t{\n\t\treturn str_replace('@', '&#64;', $this->obfuscate($email));\n\t}", "function valid_email_address($mail) {\n $user = '[a-zA-Z0-9_\\-\\.\\+\\^!#\\$%&*+\\/\\=\\?\\`\\|\\{\\}~\\']+';\n $domain = '(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.?)+';\n $ipv4 = '[0-9]{1,3}(\\.[0-9]{1,3}){3}';\n $ipv6 = '[0-9a-fA-F]{1,4}(\\:[0-9a-fA-F]{1,4}){7}';\n\n return preg_match(\"/^$user@($domain|(\\[($ipv4|$ipv6)\\]))$/\", $mail);\n}", "public function from($email);", "public function getOriginalEmail(): ?string;", "function new_mail_from($old) {\nreturn '[email protected]';\n}", "function isEmail($verify_email) {\n\t\n\t\treturn(preg_match(\"/^[-_.[:alnum:]]+@((([[:alnum:]]|[[:alnum:]][[:alnum:]-]*[[:alnum:]])\\.)+(ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|info|int|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mil|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nt|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)$|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5])\\.){3}([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$/i\",$verify_email));\n\t\n\t}", "protected static function get_email_from_rfc_email($rfc_email_string)\n {\n if (strpos($rfc_email_string, '<') === false) {\n return $rfc_email_string;\n }\n preg_match('/(?:<)(.+)(?:>)$/', $rfc_email_string, $matches);\n if (empty($matches)) {\n return $rfc_email_string;\n }\n return $matches[1];\n }", "public function email()\n\t{\n\t\treturn $this->filter(FILTER_SANITIZE_EMAIL);\n\t}", "function smcf_validate_email($email) {\r\n\t$at = strrpos($email, \"@\");\r\n\r\n\t// Make sure the at (@) sybmol exists and \r\n\t// it is not the first or last character\r\n\tif ($at && ($at < 1 || ($at + 1) == strlen($email)))\r\n\t\treturn false;\r\n\r\n\t// Make sure there aren't multiple periods together\r\n\tif (preg_match(\"/(\\.{2,})/\", $email))\r\n\t\treturn false;\r\n\r\n\t// Break up the local and domain portions\r\n\t$local = substr($email, 0, $at);\r\n\t$domain = substr($email, $at + 1);\r\n\r\n\r\n\t// Check lengths\r\n\t$locLen = strlen($local);\r\n\t$domLen = strlen($domain);\r\n\tif ($locLen < 1 || $locLen > 64 || $domLen < 4 || $domLen > 255)\r\n\t\treturn false;\r\n\r\n\t// Make sure local and domain don't start with or end with a period\r\n\tif (preg_match(\"/(^\\.|\\.$)/\", $local) || preg_match(\"/(^\\.|\\.$)/\", $domain))\r\n\t\treturn false;\r\n\r\n\t// Check for quoted-string addresses\r\n\t// Since almost anything is allowed in a quoted-string address,\r\n\t// we're just going to let them go through\r\n\tif (!preg_match('/^\"(.+)\"$/', $local)) {\r\n\t\t// It's a dot-string address...check for valid characters\r\n\t\tif (!preg_match('/^[-a-zA-Z0-9!#$%*\\/?|^{}`~&\\'+=_\\.]*$/', $local))\r\n\t\t\treturn false;\r\n\t}\r\n\r\n\t// Make sure domain contains only valid characters and at least one period\r\n\tif (!preg_match(\"/^[-a-zA-Z0-9\\.]*$/\", $domain) || !strpos($domain, \".\"))\r\n\t\treturn false;\t\r\n\r\n\treturn true;\r\n}", "public function feide_email() {\n\t\t\t$this->feide_email = mb_strtolower($this->attributes['mail'][0]);\n\n\t\t\treturn $this->feide_email;\n\t\t}", "function validate_email() {\n # Check Value is an Email Address\n if ($this->check_email_address($this->cur_val)) {\n # Remove any existing error message\n $this->error_message = \"\";\n\n # Return Email\n return $this->cur_val;\n }\n else {\n # Set Error Message\n $this->set_error(\"Validation for email address ({$this->cur_val}) failed. This is type \" . gettype($this->cur_val));\n\n # Return Blank String\n return \"\";\n }\n }", "function check_email_address($email) {\n\t$isValid = true;\n\t$atIndex = strrpos($email, \"@\");\n\tif (is_bool($atIndex) && !$atIndex) {\n\t\t$isValid = false;\n\t}\n\telse {\n\t\t$domain = substr($email, $atIndex+1);\n\t\t$local = substr($email, 0, $atIndex);\n\t\t$localLen = strlen($local);\n\t\t$domainLen = strlen($domain);\n\t\tif ($localLen < 1 || $localLen > 64) {\n\t\t\t// local part length exceeded\n\t\t\t$isValid = false;\n\t\t}\n\t\telse if ($domainLen < 1 || $domainLen > 255) {\n\t\t\t// domain part length exceeded\n\t\t\t$isValid = false;\n\t\t}\n\t\telse if ($local[0] == '.' || $local[$localLen-1] == '.') {\n\t\t\t// local part starts or ends with '.'\n\t\t\t$isValid = false;\n\t\t}\n\t\telse if (preg_match('/\\\\.\\\\./', $local)) {\n\t\t\t// local part has two consecutive dots\n\t\t\t$isValid = false;\n\t\t}\n\t\telse if (!preg_match('/^[A-Za-z0-9\\\\-\\\\.]+$/', $domain)) {\n\t\t\t// character not valid in domain part\n\t\t\t$isValid = false;\n\t\t}\n\t\telse if (preg_match('/\\\\.\\\\./', $domain)) {\n\t\t\t// domain part has two consecutive dots\n\t\t\t$isValid = false;\n\t\t}\n\t\telse if (!preg_match('/^(\\\\\\\\.|[A-Za-z0-9!#%&`_=\\\\/$\\'*+?^{}|~.-])+$/',\n\t\tstr_replace(\"\\\\\\\\\",\"\",$local)))\n\t\t{\n\t\t // character not valid in local part unless \n\t\t // local part is quoted\n\t\t if (!preg_match('/^\"(\\\\\\\\\"|[^\"])+\"$/', str_replace(\"\\\\\\\\\",\"\",$local))) {\n\t\t\t$isValid = false;\n\t\t }\n\t\t}\n\t\tif ($isValid && !(checkdnsrr($domain,\"MX\") || checkdnsrr($domain,\"A\"))) {\n\t\t\t// domain not found in DNS\n\t\t\t$isValid = false;\n\t\t}\n\t}\n\treturn $isValid;\n}" ]
[ "0.69917774", "0.68524474", "0.68301076", "0.6773823", "0.6722953", "0.6709577", "0.6653471", "0.6618013", "0.65537316", "0.6549153", "0.6452621", "0.6438733", "0.6428842", "0.6389665", "0.632637", "0.62999237", "0.62571037", "0.624569", "0.6227235", "0.61799425", "0.61795187", "0.61637425", "0.6157233", "0.61386144", "0.6137677", "0.6115593", "0.6103973", "0.6098042", "0.60967153", "0.6089141", "0.6088696", "0.6070069", "0.60674703", "0.6067046", "0.6061463", "0.60584444", "0.605682", "0.60361785", "0.60289645", "0.60195106", "0.6017431", "0.6008398", "0.5996528", "0.5988695", "0.59629947", "0.59463954", "0.59379953", "0.5937085", "0.59034574", "0.5895698", "0.58928645", "0.58865154", "0.58752507", "0.58676213", "0.5867206", "0.5867061", "0.5847798", "0.5846252", "0.5832064", "0.58309317", "0.5827104", "0.5825672", "0.5818127", "0.5813251", "0.5810119", "0.58036065", "0.58003426", "0.57953316", "0.5792072", "0.5777811", "0.57734036", "0.5757536", "0.5751927", "0.5750442", "0.57473356", "0.574721", "0.5739814", "0.57384217", "0.5736514", "0.57335657", "0.57291865", "0.5723885", "0.57122463", "0.5702656", "0.56952477", "0.56873095", "0.5682343", "0.5679555", "0.56775546", "0.56767374", "0.5675215", "0.5672601", "0.56706935", "0.5669824", "0.56678027", "0.5667636", "0.5663041", "0.5658749", "0.5654095", "0.5653984" ]
0.67057157
6
Checks if a remote file exists. Parameter: URL Url of the file to check Returns : 404 no file found 200 file found
function curl_check($url) { $ch = curl_init($url); curl_setopt($ch, CURLOPT_NOBODY, true); $response = curl_exec($ch); LOG_MSG('INFO',"curl_get(): [$url] response=[$response]"); return curl_getinfo($ch, CURLINFO_HTTP_CODE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _bellcom_check_if_file_in_url_exists($file_url) {\n $file_headers = @get_headers($file_url);\n\n if ($file_headers[0] == 'HTTP/1.1 404 Not Found') {\n return FALSE;\n }\n else {\n return TRUE;\n }\n}", "function remote_file_exists($url)\n\t{\n\t // Make sure php will allow us to do this...\n\t if ( ini_get('allow_url_fopen') )\n\t {\n\t \t$head = '';\n\t \t$url_p = parse_url ($url);\n\t\n\t \tif (isset ($url_p['host']))\n\t \t{\n\t\t\t\t$host = $url_p['host']; \n\t\t\t}\n\t \telse\n\t \t{\n\t \treturn false;\n\t \t}\n\t\n\t \tif (isset ($url_p['path']))\n\t \t{ \n\t\t\t\t$path = $url_p['path']; \n\t\t\t}\n\t \telse\n\t \t{\n\t\t\t \t$path = ''; \n\t\t\t}\n\t\n\t \t$fp = @fsockopen ($host, 80, $errno, $errstr, 20);\n\t \tif (!$fp)\n\t \t{\n\t \t\treturn false;\n\t \t}\n\t \telse\n\t \t{\n\t \t\t$parse = parse_url($url);\n\t \t\t$host = $parse['host'];\n\t\n\t\t\t\t@fputs($fp, 'HEAD '.$url.\" HTTP/1.1\\r\\n\");\n\t \t\t@fputs($fp, 'HOST: '.$host.\"\\r\\n\");\n\t \t\t@fputs($fp, \"Connection: close\\r\\n\\r\\n\");\n\t \t\t$headers = '';\n\t \t\twhile (!@feof ($fp))\n\t \t\t{ \n\t\t\t\t\t$headers .= @fgets ($fp, 128); \n\t\t\t\t}\n\t \t}\n\t \t@fclose ($fp);\n\t\n\t \t$arr_headers = explode(\"\\n\", $headers);\n\t \tif (isset ($arr_headers[0])) \n\t\t\t{\n\t \t\tif(strpos ($arr_headers[0], '200') !== false)\n\t \t\t{ \n\t\t\t\t\treturn true; \n\t\t\t\t}\n\t \t\tif( (strpos ($arr_headers[0], '404') !== false) || (strpos ($arr_headers[0], '509') !== false) || (strpos ($arr_headers[0], '410') !== false))\n\t \t\t{ \n\t\t\t\t\treturn false; \n\t\t\t\t}\n\t \t\tif( (strpos ($arr_headers[0], '301') !== false) || (strpos ($arr_headers[0], '302') !== false))\n\t\t\t\t{\n\t \t\tpreg_match(\"/Location:\\s*(.+)\\r/i\", $headers, $matches);\n\t \t\tif(!isset($matches[1]))\n\t\t\t\t\t{\n\t \t\t\treturn false;\n\t\t\t\t\t}\n\t \t\t$nextloc = $matches[1];\n\t\t\t\t\treturn $this->remote_file_exists($nextloc);\n\t \t\t}\n\t \t}\n\t \t// If we are still here then we got an unexpected header\n\t \treturn false;\n\t }\n\t else\n\t {\n\t \t// Since we aren't allowed to use URL's bomb out\n\t \treturn false;\n\t }\n\t}", "private static function remoteFileExists($url) {\n\t\t$f = @fopen($url, 'r');\n\t\tif($f) {\n\t\t\tfclose($f);\n\t\t\treturn TRUE;\n\t\t}\n\t\treturn FALSE;\n\t}", "public static function url_exists($url) {\r\n \r\n // Too slow\r\n return true;\r\n \r\n /*\r\n \r\n $ch = curl_init($url);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\r\n $response = curl_exec($ch);\r\n $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\r\n \r\n if ($httpCode == 404) {\r\n return false;\r\n }\r\n \r\n return true;\r\n \r\n $file_headers = @get_headers($url);\r\n if ($file_headers[0] == 'HTTP/1.1 404 Not Found') {\r\n return false;\r\n }\r\n \r\n return true;\r\n */\r\n \r\n }", "function remoteFileExists($url) {\n $curl = curl_init($url);\n\n //don't fetch the actual page, you only want to check the connection is ok\n curl_setopt($curl, CURLOPT_NOBODY, true);\n\n //do request\n $result = curl_exec($curl);\n\n $ret = false;\n\n //if request did not fail\n if ($result !== false) {\n //if request was ok, check response code\n $statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n\n if ($statusCode == 200) {\n $ret = true;\n }\n }\n\n curl_close($curl);\n\n return $ret;\n }", "function checkExternalFile($url)\n{\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_NOBODY, true);\n curl_exec($ch);\n $retCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n curl_close($ch);\n\n return $retCode;\n}", "function checkRemoteFile($url) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n// don't download content\n curl_setopt($ch, CURLOPT_NOBODY, 1);\n curl_setopt($ch, CURLOPT_FAILONERROR, 1);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n if (curl_exec($ch) !== FALSE) {\n return true;\n } else {\n return false;\n }\n}", "private function does_file_exist( string $url ): bool {\n\t\t$ch = curl_init( $url );\n\t\tcurl_setopt( $ch, CURLOPT_NOBODY, true );\n\t\tcurl_setopt( $ch, CURLOPT_TIMEOUT_MS, 50 );\n\t\tcurl_exec( $ch );\n\t\t$http_code = curl_getinfo( $ch, CURLINFO_HTTP_CODE );\n\t\tcurl_close( $ch );\n\t\treturn $http_code === 200;\n\t}", "public function checkRemoteFile($url){\n\n\t $ch = curl_init();\n\n\t curl_setopt($ch, CURLOPT_URL,$url);\n\n\t // don't download content\n\t curl_setopt($ch, CURLOPT_NOBODY, 1);\n\t curl_setopt($ch, CURLOPT_FAILONERROR, 1);\n\t curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n\t if (curl_exec($ch) !== FALSE) {\n\t return true;\n\t \t}\n\t else {\n\t return false;\n\t \t}\n\t\t}", "function url_exists($url) {\n if(@file_get_contents($url,0,NULL,0,1)) {\n return true;\n } else {\n return false;\n }\n}", "public function checkRemoteFile($url){\n\n\t $ch = curl_init();\n\n\t curl_setopt($ch, CURLOPT_URL,$url);\n\n\t // don't download content\n\t curl_setopt($ch, CURLOPT_NOBODY, 1);\n\t curl_setopt($ch, CURLOPT_FAILONERROR, 1);\n\t curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n\t if (curl_exec($ch) !== FALSE) {\n\t return true;\n\t \t}\n\t else {\n\t return false;\n\t \t}\n\n\t\t}", "function ajax_action_check_url() {\n\n\t\t$hadError = true;\n\n\t\t$url = isset( $_REQUEST['url'] ) ? $_REQUEST['url'] : '';\n\n\t\tif ( strlen( $url ) > 0 && function_exists( 'get_headers' ) ) {\n\t\t\t\t\n\t\t\t$file_headers = @get_headers( $url );\n\t\t\t$exists = $file_headers && $file_headers[0] != 'HTTP/1.1 404 Not Found';\n\t\t\t$hadError = false;\n\t\t}\n\n\t\techo '{ \"exists\": '. ($exists ? '1' : '0') . ($hadError ? ', \"error\" : 1 ' : '') . ' }';\n\n\t\tdie();\n\t}", "function does_url_exist($url) {\n\t$fd = fopen(\"$url\", \"r\");\n\tif ($fd) {\n\t\tfclose($fd);\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "function url_exists($url){\n\t$url = str_replace(\"http://\", \"\", $url);\n\tif (strstr($url, \"/\")) {\n\t\t$url = explode(\"/\", $url, 2);\n\t\t$url[1] = \"/\".$url[1];\n\t} else {\n\t\t$url = array($url, \"/\");\n\t}\n\n\t$fh = fsockopen($url[0], 80);\n\tif ($fh) {\n\t\tfputs($fh,\"GET \".$url[1].\" HTTP/1.1\\nHost:\".$url[0].\"\\n\\n\");\n\t\tif (fread($fh, 22) == \"HTTP/1.1 404 Not Found\") { return FALSE; }\n\t\telse { return TRUE; }\n\n\t} else { \n\t\t//echo '<p>no fh</p>';\n\t\treturn FALSE;\n\t}\n}", "function check_remote_file($url)\n {\n $content_type = '';\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HEADER, 1);\n curl_setopt($ch, CURLOPT_NOBODY, 1);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n $results = explode(\"\\n\", trim(curl_exec($ch)));\n foreach ($results as $line) {\n if (strtolower(strtok($line, ':')) == 'content-type') {\n $parts = explode(\":\", $line);\n $content_type = trim($parts[1]);\n }\n }\n curl_close($ch);\n $status = strpos($content_type, 'image') !== false;\n\n return $status;\n }", "private static function urlExists($url){\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_NOBODY, true);\n curl_setopt($ch, CURLOPT_HEADER, true);\n curl_setopt($ch, CURLOPT_TIMEOUT, 10); // set time out to 10 seconds\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); //follow redirects\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_exec($ch);\n\n $code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\n if($code == 200){\n $status = true;\n } else {\n $status = false;\n }\n curl_close($ch);\n\n return $status;\n }", "function remote_file_exists( $source, $extra_mile = 0 ) {\r\n ////////////////////////////////// Does it exist? \r\n # EXTRA MILE = 1 \r\n ////////////////////////////////// Is it an image? \r\n \r\n if ( $extra_mile === 1 ) { \r\n $img = @getimagesize($source); \r\n \r\n if ( !$img ) return 0; \r\n else \r\n { \r\n switch ($img[2]) \r\n { \r\n case 0: \r\n return 0; \r\n break; \r\n case 1: \r\n return $source; \r\n break; \r\n case 2: \r\n return $source; \r\n break; \r\n case 3: \r\n return $source; \r\n break; \r\n case 6: \r\n return $source; \r\n break; \r\n default: \r\n return 0; \r\n break; \r\n } \r\n } \r\n } \r\n else \r\n { \r\n if (@FClose(@FOpen($source, 'r'))) \r\n return 1; \r\n else \r\n return 0; \r\n } \r\n }", "function url_exists($url) {\n $a_url = parse_url($url);\n if (!isset($a_url['port'])) $a_url['port'] = 80;\n $errno = 0;\n $errstr = '';\n $timeout = 5;\n if(isset($a_url['host']) && $a_url['host']!=gethostbyname($a_url['host'])){\n $fid = @fsockopen($a_url['host'], $a_url['port'], $errno, $errstr, $timeout);\n if (!$fid) return false;\n $page = isset($a_url['path']) ?$a_url['path']:'';\n $page .= isset($a_url['query'])?'?'.$a_url['query']:'';\n fputs($fid, 'HEAD '.$page.' HTTP/1.0'.\"\\r\\n\".'Host: '.$a_url['host'].\"\\r\\n\\r\\n\");\n $head = fread($fid, 4096);\n fclose($fid);\n return preg_match('#^HTTP/.*\\s+[200|302]+\\s#i', $head);\n } else {\n return false;\n }\n }", "function found_url($url) {\n\t$test = @fopen($url, 'r');\n\tif(!$test) {\n\t\tif($GLOBALS['debug']) echo(\"> Can't open file!: $url\\n\");\n\t\treturn(1);\n\t}\n\t\n\techo($url.\"\\n\");\n}", "public function url_exists( $src ) {\n\n\t\t// Make arguments supplied are valid\n\t\tif( !is_string( $src ) ) {\n\t\t\texit( '$src is an invalid argument' );\n\t\t}\n\n\t\t// Isolate path to file from URL\n\t\t$url_parts = parse_url( $src );\n\t\t$path = $url_parts['path'];\n\n\t\t// Check if file exists from reassembled path\n\t\tif( file_exists( $_SERVER['DOCUMENT_ROOT'] . $path ) ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\n\t}", "private function checkIfUrlExists($url) {\n $headers = get_headers($url);\n return ((int) substr($headers[0], 9, 3)) === 200;\n }", "public function test_url_exist($url) {\n\n\t\t$headers = @get_headers($url);\n\n\t\tif ($headers === FALSE) {\n\n\t\t\treturn FALSE;\n\t\t} else {\n\n\t\t\treturn TRUE;\n\t\t}\n\t}", "public static function urlExists($url)\n {\n $file_headers = @get_headers($url);\n \n if ($file_headers[0] == 'HTTP/1.1 404 Not Found') {\n $exists = false;\n } else {\n $exists = true;\n }\n \n return $exists;\n }", "function url_exists($url){ \r\n $url_data = parse_url($url); // scheme, host, port, path, query\r\n if(!fsockopen($url_data['host'], isset($url_data['port']) ? $url_data['port'] : 80)){\r\n $this->set_message('url_exists', 'The URL you entered is not accessible.');\r\n return FALSE;\r\n } \r\n \r\n return TRUE;\r\n }", "public function exists( $url );", "function does_file_exist ($ip,$vhost,$query) {\n\t$data = \"\";\n\t$fp = fsockopen($ip, 80, $errno, $errstr, 1);\n\tif (!$fp) {\n\t\treturn false;\n\t} else {\n\t\t$out = \"HEAD $query HTTP/1.1\\r\\n\";\n\t\t$out .= \"Host: $vhost\\r\\n\";\n\t\t$out .= \"Connection: Close\\r\\n\\r\\n\";\n\t\tfwrite($fp, $out);\n\t\twhile (!feof($fp)) {\n\t\t\t$data .= fgets($fp);\n\t\t}\n\t\tif (ereg('HTTP/1.1 200 OK', $data)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\t\n\t\t\n\t\tfclose($fp);\n\t}\n}", "static function existeURL($url) {\n $url = @parse_url($url);\n if (!$url)\n return false;\n\n $url = array_map('trim', $url);\n $url['port'] = (!isset($url['port'])) ? 80 : (int) $url['port'];\n\n $path = (isset($url['path'])) ? $url['path'] : '/';\n $path .= (isset($url['query'])) ? \"?$url[query]\" : '';\n\n if (isset($url['host']) && $url['host'] != gethostbyname($url['host'])) {\n\n $fp = fsockopen($url['host'], $url['port'], $errno, $errstr, 30);\n\n if (!$fp)\n return false; //socket not opened\n\n fputs($fp, \"HEAD $path HTTP/1.1\\r\\nHost: $url[host]\\r\\n\\r\\n\"); //socket opened\n $headers = fread($fp, 4096);\n fclose($fp);\n\n if (preg_match('#^HTTP/.*\\s+[(200|301|302)]+\\s#i', $headers)) {//matching header\n return true;\n } else\n return false;\n } // if parse url\n else\n return false;\n }", "public static function checkFileExists($file, $url){\n\t\t\n\t\tif(empty($file)) return false;\n\t\tif(!is_file($url.$file)) false;\n\t\treturn true;\n//\t\ttry {\n//\t\t\tfclose(fopen($file, \"r\"));\n//\t\t\treturn true;\n//\t\t} catch (Exception $e) {\n//\t\t\treturn false;\n//\t\t}\n\t}", "function urlOK($url)\n{\n $headers = @get_headers($url);\n if(strpos($headers[0],'200')===false){return false;}else{return true;}\n}", "public static function urlImageExists($url){\n if(strpos($url,'http://') === false)\n return false;\n $headers = @get_headers($url);\n if(is_array($headers))\n return strpos($headers[0],'200') !== false;\n }", "function remote_file_exists($source, $extra_mile = 0) {# # EXTRA MILE = 1////////////////////////////////// Is it an image?\n if ($extra_mile === 1) {\n $img = @getimagesize($source);\n if (!$img)\n return 0;\n else {\n switch ($img[2]) {\n case 0: return 0;\n break;\n case 1:return $source;\n break;\n case 2:return $source;\n break;\n case 3:return $source;\n break;\n case 6:return $source;\n break;\n default:return 0;\n break;\n }\n }\n } else {\n if (@FClose(@FOpen($source, 'r')))\n return 1;\n else\n return 0;\n }\n }", "protected function verifyUrlExists($url) \n\t{\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_NOBODY, true);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_exec($ch);\n $response = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n curl_close($ch);\n\n return (!empty($response) && $response != 404);\n }", "public function urlExists($url, $path)\n {\n $filename = '/statamic-test-'.time();\n $tmp = $path . $filename;\n touch($tmp);\n\n $resolvedUrl = URL::assemble($this->getAbsoluteUrl($url), $filename);\n\n $headers = get_headers($resolvedUrl);\n\n unlink($tmp);\n\n return (!$headers || strpos($headers[0], '404')) == false;\n }", "function check_url_exists($url, $test_freq_secs)\n{\n $test1 = $GLOBALS['SITE_DB']->query_select('urls_checked', array('url_check_time', 'url_exists'), array('url' => $url), 'ORDER BY url_check_time DESC', 1);\n\n if ((!isset($test1[0])) || ($test1[0]['url_check_time'] < time() - $test_freq_secs)) {\n $test2 = http_download_file($url, 0, false);\n if (($test2 === null) && (($GLOBALS['HTTP_MESSAGE'] == '401') || ($GLOBALS['HTTP_MESSAGE'] == '403') || ($GLOBALS['HTTP_MESSAGE'] == '405') || ($GLOBALS['HTTP_MESSAGE'] == '416') || ($GLOBALS['HTTP_MESSAGE'] == '500') || ($GLOBALS['HTTP_MESSAGE'] == '503') || ($GLOBALS['HTTP_MESSAGE'] == '520'))) {\n $test2 = http_download_file($url, 1, false); // Try without HEAD, sometimes it's not liked\n }\n $exists = (($test2 === null) && ($GLOBALS['HTTP_MESSAGE'] != 401)) ? 0 : 1;\n\n if (isset($test1[0])) {\n $GLOBALS['SITE_DB']->query_delete('urls_checked', array(\n 'url' => $url,\n ));\n }\n\n $GLOBALS['SITE_DB']->query_insert('urls_checked', array(\n 'url' => $url,\n 'url_exists' => $exists,\n 'url_check_time' => time(),\n ));\n } else {\n $exists = $test1[0]['url_exists'];\n }\n\n return ($exists == 1);\n}", "function url_exist($url)\r\n\t\t{\r\n\t\t\r\n\t\t}", "public static function exists($url)\n {\n $handle = curl_init($url);\n if (false === $handle)\n {\n return false;\n }\n\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_FAILONERROR, true);\n curl_setopt($handle, CURLOPT_HTTPHEADER, array(\"User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.15) Gecko/20080623 Firefox/2.0.0.15\") );\n curl_setopt($handle, CURLOPT_NOBODY, true);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, false);\n $connectable = curl_exec($handle);\n curl_close($handle);\n\n return $connectable;\n }", "function check_file_existance($path)\n{\n //buld the url\n $image_url=$path;\n if (file_exists($image_url) !== false) {\n return true;\n }\n}", "public function isFileExistsRemotely();", "function check_url($url, $post=false) {\r\n $ch = curl_init($url);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\r\n curl_setopt($ch, CURLOPT_TIMEOUT,1);\r\n if ($post) {\r\n curl_setopt($ch, CURLOPT_POST, true);\r\n curl_setopt($ch, CURLOPT_HTTPHEADER, $_SESSION['plex_headers']);\r\n }\r\n /* Get the HTML or whatever is linked in $url. */\r\n $response = curl_exec($ch);\r\n\r\n /* Check for 404 (file not found). */\r\n $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\r\n curl_close($ch);\r\n\r\n /* If the document has loaded successfully without any redirection or error */\r\n if ($httpCode >= 200 && $httpCode < 300) {\r\n write_log(\"Connection is valid: \".$url);\r\n return true;\r\n } else {\r\n write_log(\"Connection failed with error code \".$httpCode.\": \".$url,\"ERROR\");\r\n return false;\r\n }\r\n }", "function IsFileExist()\n{\t\n\t$sFileUrl = '';\n\t\n\tif(isset($_REQUEST['file-path']) === false)\n\t{\n\t\techo '<fail>no file path</fail>';\n\t\treturn;\n\t}\n\t\n\t$sFileUrl = $_REQUEST['file-path']; \n\t\n\tif(file_exists($sFileUrl) === true)\n\t{\n\t\techo '<correct>file exist</correct>';\n\t} else\n\t{\n\t\techo '<correct>file not exist</correct>';\n\t}\n\t\n\treturn;\n}", "public function urlExists($url) {\n\t\t$headers = @get_headers($url);\n\t\treturn is_array($headers) ? true : false;\n\t}", "public function hasRemoteUrl();", "function checkHTTPstatus($url)\n{\n\t$http = curl_init($url);\n\tcurl_setopt($http, CURLOPT_HEADER, 0);\n\tcurl_setopt($http, CURLOPT_RETURNTRANSFER, true);\n\t//curl_setopt($http, CURLOPT_FOLLOWLOCATION , true);\n\t// do your curl thing here\n\t$result = curl_exec($http);\n\t$http_status = curl_getinfo($http, CURLINFO_HTTP_CODE);\n\t\n\treturn $http_status;\n\t\n\tcurl_close($http);\n\t\n\t\n\t/*\n\t$furl = false;\n \n // First check response headers\n $headers = get_headers($url);\n \n // Test for 301 or 302\n if(preg_match('/^HTTP\\/\\d\\.\\d\\s+(301|302)/',$headers[0]))\n {\n foreach($headers as $value)\n {\n if(substr(strtolower($value), 0, 9) == \"location:\")\n {\n $furl = trim(substr($value, 9, strlen($value)));\n }\n }\n }\n // Set final URL\n $furl = ($furl) ? $furl : $url;\n\n return $furl;\n\t*/\n}", "function checkIfExistingBaseUrl($url)\n {\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_NOBODY, true); // set to HEAD request\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // don't output the response\n curl_setopt($ch,CURLOPT_CONNECTTIMEOUT, 1);\n curl_setopt($ch, CURLOPT_TIMEOUT, 400);\n curl_exec($ch);\n $result = curl_getinfo($ch, CURLINFO_HTTP_CODE) == 200;\n curl_close($ch);\n\n return $result;\n }", "function check_url($url){\n\n $data = file_get_contents($url);\n\n if (empty($data)) {\n return \"false\";\n } else {\n return \"true\";\n }\n\n\n \n}", "private function urlExist() {\n if (!$this->webhook->url) {\n // throw an exception\n $this->missingEx('url');\n }\n }", "function download_file($url, $upload_path){\n\t$results = \"\";\n\t$fileArray = explode(\"/\", $url);\n\t$filename = end($fileArray);\n\t\n\n\t$code = get_http_response_code($url);\n\tif($code == 200){\n\t\texec('curl -o ' . $upload_path . $filename .' ' . $url);\n\t\tif (filesize($upload_path . $filename )>0) $results =\"$filename has been uploaded.\";\n\t\telse return $results = \"Error download file\";\n\t}\n\telse {\n\t\t$results = \"File does not exist\";\n\t}\n\n\treturn $results; \n\n}", "public function exists()\n {\n if (file_exists($this->getDestination()))\n {\n try\n {\n // Do a redirect to the file on filesystem - don't load contents in - that costs memory\n $url = str_replace(sfImagePoolPluginConfiguration::getBaseDir(), sfImagePoolPluginConfiguration::getBaseUrl(), $this->getDestination());\n \n sfContext::getInstance()->getController()->redirect($url, 0, 301);\n \n return $url;\n }\n catch (Exception $e)\n {\n return false;\n }\n }\n else\n {\n return false;\n }\n }", "protected function isRemoteFile()\n {\n return preg_match('/^(https?|ftp):\\/\\/.*/', $this->path) === 1;\n }", "protected function isRemoteFile()\n {\n return preg_match('/^(https?|ftp):\\/\\/.*/', $this->path) === 1;\n }", "public function file_exists($file);", "public static function _check_status($url){\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_NOBODY, true);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch,CURLOPT_TIMEOUT,5);\n curl_exec($ch);\n $retcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n curl_close($ch);\n return $retcode;\n }", "private function checkUrlStatus()\n {\n $request = curl_init($this->url);\n\n curl_setopt($request, CURLOPT_HEADER, true);\n curl_setopt($request, CURLOPT_NOBODY, true);\n curl_setopt($request, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($request, CURLOPT_TIMEOUT, 10);\n\n curl_exec($request);\n $httpCode = curl_getinfo($request, CURLINFO_HTTP_CODE);\n curl_close($request);\n\n if ($httpCode >= 200 && $httpCode < 400) {\n return true;\n }\n\n return false;\n }", "private function CheckFileExists( $File )\n {\n $return = file_exists($File);\n\n if( !$return && preg_match(\"/^(https?):\\/\\//i\", $File) )\n {\n $header_response = get_headers($File);\n\n if ( strpos( $header_response[0], \"200\" ) !== false )\n {\n $return = true;\n }\n }\n\n return $return;\n }", "public static function checkUrl($url)\r\n {\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_URL, $url);\r\n curl_setopt($ch, CURLOPT_NOBODY, true); // only make a HEAD request\r\n curl_setopt($ch, CURLOPT_FAILONERROR, true); // fail if response >= 400\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\r\n \r\n if (curl_exec($ch) !== false)\r\n {\r\n return true;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n }", "function file_exists($pathname)\r\n {\r\n if ($this->_use_mod_ftp) {\r\n \t\tftp_mdtm($this->_socket, $pathname);\r\n \t} else {\r\n \tif (!$this->_socket) {\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \t$this->putcmd(\"MDTM\", $pathname);\r\n \t}\r\n \tif ($this->ok()) {\r\n \t\t$this->debug(\"Remote file \".$pathname.\" exists\\n\");\r\n \t\treturn TRUE;\r\n \t} else {\r\n \t\t$this->debug(\"Remote file \".$pathname.\" does not exist\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n }", "protected function getRemoteFileSize($url)\n\t{\n\t\t$parsed = parse_url($url);\n\t\t$host = $parsed[\"host\"];\n\t\t$fp = null;\n\n\t\tif (function_exists('fsockopen'))\n\t\t{\n\t\t\t$fp = @fsockopen($host, 80, $errno, $errstr, 20);\n\t\t}\n\t\tif (!$fp)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t@fputs($fp, \"HEAD $url HTTP/1.1\\r\\n\");\n\t\t\t@fputs($fp, \"HOST: $host\\r\\n\");\n\t\t\t@fputs($fp, \"Connection: close\\r\\n\\r\\n\");\n\t\t\t$headers = \"\";\n\n\t\t\twhile (!@feof($fp))\n\t\t\t{\n\t\t\t\t$headers .= @fgets($fp, 128);\n\t\t\t}\n\t\t}\n\t\t@fclose($fp);\n\t\t$return = false;\n\t\t$arr_headers = explode(\"\\n\", $headers);\n\n\t\tforeach ($arr_headers as $header)\n\t\t{\n\t\t\t$s = \"Content-Length: \";\n\n\t\t\tif (substr(strtolower($header), 0, strlen($s)) == strtolower($s))\n\t\t\t{\n\t\t\t\t$return = trim(substr($header, strlen($s)));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn $return;\n\t}", "function getFile($url, $filename) {\n if (file_exists($filename)) {\n $local = strtotime(date(\"F d Y H:i:s.\", filemtime($filename)));\n $headers = get_headers($url, 1);\n $remote = strtotime($headers[\"Last-Modified\"]);\n \n if ($local < $remote) {\n file_put_contents($filename, file_get_contents($url));\n }\n }\n else {\n $file_contents = file_get_contents($url);\n if ($file_contents)\n file_put_contents($filename, file_get_contents($url));\n } \n}", "function is_url_real ($url_to_shorten)\n{\n $test_flag = true;\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url_to_shorten);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n $response = curl_exec($ch);\n if( curl_getinfo($ch, CURLINFO_HTTP_CODE) == '404' ||\n FALSE == $response )\n {\n dumper($response);\n $test_flag = false;\n }\n curl_close($ch);\n return $test_flag;\n}", "protected function getRemoteFile($url) {\n if (empty($url)) {\n echo 'Empty url!';\n return '';\n }\n //header('Content-Type: text/html;charset=utf-8', false);\n\n @$content = file_get_contents($url); // surpress warnings about SSL\n //Util::info_log(strlen($content));\n\n if (empty($content))\n {\n Util::info_log('Trying curl with useragent');\n\n // Use user agent cloacking.\n $ch = curl_init();\n curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13');\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n $content = curl_exec($ch);\n //$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n //$redir = $this->getredir($content);\n curl_close($ch);\n //Util::debug_log($httpcode); // 200 OK\n //Util::debug_log($redir); // null\n }\n\n\n if (empty($content)) {\n if (empty($http_response_header)) {\n $msg = 'No content (no response header) for url=' . $url;\n Util::info_log($msg);\n echo $msg;\n }\n else {\n $msg = $http_response_header[0];\n Util::info_log($msg);\n echo '<pre>'. $msg . '</pre>';\n }\n }\n return $content;\n }", "public static function exist_url($url, $what = false, $is_zip = false)\n {\n # Check Active curl\n if ( ! function_exists('curl_init')) {\n return array('status' => false, 'data' => Package::_e('curl', 'er_enabled'), 'error_type' => 'base');\n }\n\n # request Start\n $curl = curl_init($url);\n # No Body Get From Request\n curl_setopt($curl, CURLOPT_NOBODY, true);\n # don't verify peer ssl cert\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n # Set User Agent\n curl_setopt($curl, CURLOPT_USERAGENT, Package::get_config('curl', 'user_agent'));\n # Get Return if redirect\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n # Follow Location for redirect\n curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);\n # Request Process\n $exec = curl_exec($curl);\n if ($exec === false) {\n return array('status' => false, 'data' => Package::_e('curl', 'er_connect', array(\"[url]\" => preg_replace(\"(^https?://)\", \"\", $url))), 'error_type' => 'base');\n }\n # Get Header info\n $code = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n # get the content type\n $file_type = curl_getinfo($curl, CURLINFO_CONTENT_TYPE);\n # Check response status\n if ($code == 200) {\n $info = curl_getinfo($curl);\n if ($is_zip) {\n if ( ! in_array(strtolower($file_type), array('application/zip', 'application/octet-stream', 'application/octet', 'application/x-zip-compressed', 'multipart/x-zip'))) {\n return array('status' => false, 'data' => Package::_e('curl', 'er_zip', array(\"[what]\" => $what)));\n }\n }\n $return = array('status' => true, 'data' => filter_var($info['url'], FILTER_VALIDATE_URL), 'file_type' => $file_type);\n } else {\n $return = array('status' => false, 'data' => Package::_e('curl', 'er_url', array(\"[what]\" => $what)));\n }\n\n # Close Request\n curl_close($curl);\n # Return data\n return $return;\n }", "function fetchFileFromURL($url, $file, $local_path = './data/', $local_file)\n{\n $data = fetchFileDataFromURL($url . $file);\n if ($data) {\n $d = fopen($local_path . $local_file, \"wb\");\n $ret = fwrite($d, $data);\n fclose($d);\n\n return $ret;\n }\n\n return false;\n}", "public static function fileDoesNotExist()\n {\n return self::logicalNot(self::fileExists());\n }", "function url_test( $url ) {\n $timeout = 10;\n $ch = curl_init();\n curl_setopt ( $ch, CURLOPT_URL, $url );\n curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );\n curl_setopt ( $ch, CURLOPT_TIMEOUT, $timeout );\n $http_respond = curl_exec($ch);\n $http_respond = trim( strip_tags( $http_respond ) );\n $http_code = curl_getinfo( $ch, CURLINFO_HTTP_CODE );\n if ( ( $http_code == \"200\" ) || ( $http_code == \"302\" ) ) {\n return true;\n } else {\n // return $http_code;, possible too\n return false;\n }\n curl_close( $ch );\n}", "function does_file_exist($mediatype, $filename, $inout = 'in') {\n $params = Array();\n $params['region'] = $this->region;\n $params['mediatype'] = $mediatype;\n $params['filename'] = $filename;\n $params['inout'] = $inout;\n try {\n $ret = poodlltools::call_cloudpoodll('local_cpapi_does_file_exist',$params);\n if(!$ret || !isset($ret->returnCode)) {return 'failed to get aws remote result';}\n if ($ret->returnCode==\"0\") {\n return $ret->returnMessage == 'true';\n } else {\n return $ret->returnMessage;\n }\n } catch (\\Exception $e) {\n return $e->getMessage();\n }\n\n }", "private function file_exists( $path, $filename )\n\t{\n\t\t$finder = new Finder();\n\n\t\ttry {\n\t\t\t$count = $finder\n\t\t\t\t\t\t->files()\n\t\t\t\t\t\t->in($path)\n\t\t\t\t\t\t->name($filename)\n\t\t\t\t\t\t->depth('== 0')\n\t\t\t\t\t\t->count()\n\t\t\t;\n\t\t} catch ( InvalidArgumentException $e ) {\n\t\t\techo json_encode($e->getMessage());\n\t\t\texit;\n\t\t} catch ( Exception $e ) {\n\t\t\t$errors = array(\n\t\t\t\t'error' => $e->getMessage(),\n\t\t\t);\n\n\t\t\t// Set the template here\n\t\t\t$template = File::get( __DIR__ . '/views/error-no-render.html');\n\n\t\t\t$html = Parse::template($template, $errors);\n\n\t\t\theader('Content-Type', 'application/json');\n\t\t\techo self::build_response_json(false, true, FILECLERK_S3_ERROR, $e->getMessage(), 'error', $errors, null, null);\n\t\t\texit;\n\t\t}\n\n\t\treturn $count === 1 ? TRUE : FALSE;\n\t}", "public function is_404();", "function checkExists($url)\n{\n\t$db = new SQLite3(DB_NAME);\n\t$query = \"SELECT * FROM URL WHERE url='$url' LIMIT 1\";\n\t$exec = $db->query($query);\n\t$count = count($exec->fetchArray());\n\tif($count==1)\n\t{\n\t\treturn false;\n\t}\n\telse\n\t\treturn true;\n}", "function getRemoteFile($dir, $file, &$data, &$size)\n{\n debug('Remote', \"Iterating through remote paths for $dir/$file\");\n\n foreach (Config::$RemotePaths as $path)\n {\n $url = trim($path, '/\\\\').\"/$dir/$file\";\n $curl = curl_init($url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\n $data = curl_exec($curl);\n $code = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n $size = curl_getinfo($curl, CURLINFO_SIZE_DOWNLOAD);\n $errNo = curl_errno($curl);\n $err = curl_error($curl);\n curl_close($curl);\n\n debug('Remote', \"Fetch: $url [$code]\");\n\n if ($errNo !== 0 || $err !== '')\n {\n debug('Remote', \"Curl error retrieving $url : $err (code $errNo)\");\n continue;\n }\n\n if ($code >= 400 && $code <= 600)\n {\n debug('Remote', \"HTTP error retrieving $url : $code\");\n continue;\n }\n\n if ($size == 0)\n {\n debug('Remote', \"0 bytes downloaded from $url; rejecting\");\n continue;\n }\n\n if ($data !== false)\n {\n debug('Remote', \"Successful fetch from $url\");\n return true;\n }\n }\n\n debug('Remote', \"No remote sources could fulfil request $dir/$file\");\n return false;\n}", "public function getFile(string $url, string $dest, array $options = array()) : bool\n {\n // Logger.\n $this->logger->debugInit();\n \n // Validates URL.\n if (empty($url)) {\n \n // Logger.\n $this->logger->error('Empty file URL');\n \n $out = false;\n \n } else {\n \n // Prepare file.\n $fp = fopen($dest, 'w');\n \n // Get options.\n if (empty($options)) {\n \n $cURLOptions = $this->getFileDefaultOptions($fp);\n \n } else {\n \n $cURLOptions = $options;\n \n }//end if\n \n // Set petition.\n $petition = new XsgaRestClient($url);\n \n // Get response.\n $response = $petition->get($cURLOptions);\n \n // Close file.\n fclose($fp);\n \n // Logger.\n $this->logger->debug(\"HTTP response code: $response->getCode()\");\n \n if ($response->getCode() !== 200) {\n \n // Logger.\n $this->logger->error(\"HTTP ERROR: $response->getCode()\");\n $this->logger->error($response->getErrors());\n \n $out = false;\n \n } else {\n \n $out = true;\n \n }//end if\n \n }//end if\n \n // Logger.\n $this->logger->debugEnd();\n \n return $out;\n \n }", "function ultimate_remote_get($path){\r\n\r\n\tif(function_exists('curl_init')){\r\n\t\t// create curl resource\r\n\t\t$ch = curl_init();\r\n\r\n\t\t// set url\r\n\t\tcurl_setopt($ch, CURLOPT_URL, $path);\r\n\r\n\t\t//return the transfer as a string\r\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n\r\n\t\t// $output contains the output string\r\n\t\t$output = curl_exec($ch);\r\n\r\n\t\t// close curl resource to free up system resources\r\n\t\tcurl_close($ch);\r\n\r\n\t\tif($output !== \"\")\r\n\t\t\treturn $output;\r\n\t\telse\r\n\t\t\treturn false;\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n}", "public static function fetch_remote_file($url){\n\t\t// get host name and url path //\n\t\t$parsedUrl = parse_url($url);\n\t\t$host = $parsedUrl['host'];\n\t\tif (isset($parsedUrl['path'])) {\n\t\t\t$path = $parsedUrl['path'];\n\t\t} else {\n\t\t\t// url is pointing to host //\n\t\t\t$path = '/';\n\t\t}\n\t\tif (isset($parsedUrl['query'])) {\n\t\t\t$path.= '?' . $parsedUrl['query'];\n\t\t}\n\t\tif (isset($parsedUrl['port'])) {\n\t\t\t$port = $parsedUrl['port'];\n\t\t} else {\n\t\t\t$port = '80';\n\t\t}\n\t\t$timeOut = 10;\n\t\t$reply = '';\n\t\t// connect to remote server //\n\t\t$fp = @fsockopen($host, '80', $errno, $errstr, $timeOut );\n\t\tif ( !$fp ) throw new Exception(\"Failed to connect to remote server {$host}\");\n\t\telse\n\t\t{\n\t\t\t// send headers //\n\t\t\t$headers = \"GET $path HTTP/1.0\\r\\n\";\n\t\t\t$headers.= \"Host: $host\\r\\n\";\n\t\t\t$headers.= \"Referer: http://$host\\r\\n\";\n\t\t\t$headers.= \"Connection: Close\\r\\n\\r\\n\";\n\t\t\tfwrite($fp, $headers);\n\t\t\t// retrieve the reply //\n\t\t\twhile (!feof($fp)) {\n\t\t\t\t$reply.= fgets($fp, 256);\n\t\t\t}\n\t\t\tfclose($fp);\n\t\t\t// strip headers //\n\t\t\t$tempStr = strpos($reply, \"\\r\\n\\r\\n\");\n\t\t\t$reply = substr($reply, $tempStr + 4);\n\t\t}\n\t\t// return content //\n\t\treturn $reply;\n\t}", "function icedrive_file_exists($path, $file)\r\n {\r\n $files = array();\r\n $response = $this->icedrive->request('PROPFIND', $path);\r\n $response = $this->icedrive_response_to_array($response['body']);\r\n\r\n if (empty($response['dresponse'])) {\r\n return false;\r\n }\r\n\r\n foreach ($response['dresponse'] as $f) {\r\n if (is_array($f) && array_key_exists('dhref', $f)) {\r\n $files[] = $f['dhref'];\r\n }\r\n }\r\n if (in_array($path . $file, $files)) {\r\n return true;\r\n }\r\n return false;\r\n }", "protected function getFileFromUrl($url)\n {\n $ch = curl_init($url);\n\n // set cURL options\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\n // Execute the handle and also collect if any error\n $result = curl_exec($ch);\n $curlErrno = curl_errno($ch);\n\n // close cURL handle\n curl_close($ch);\n\n if ($curlErrno > 0) {\n throw new \\InvalidArgumentException('Specified file does not exist at url: '.$url);\n }\n\n return $result;\n }", "function check_image_existance($path,$image_name)\n{\n //buld the url\n $image_url=$path.$image_name;\n if (file_exists($image_url) !== false) {\n return true;\n }\n}", "public static function urlExists($url, $follow_redirects = TRUE) {\n $handle = curl_init();\n curl_setopt($handle, CURLOPT_URL, $url);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($handle, CURLOPT_FOLLOWLOCATION, $follow_redirects);\n curl_setopt($handle, CURLOPT_HEADER, 0);\n // Get the HTML or whatever is linked in $redirect_url.\n $response = curl_exec($handle);\n\n // Get status code.\n $http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n $last_location = curl_getinfo($handle, CURLINFO_EFFECTIVE_URL);\n\n $url = ($follow_redirects) ? $last_location : $url;\n\n // Check that http code exists.\n if ($http_code) {\n // Determines first digit of http code.\n $first_digit = substr($http_code, 0, 1);\n // Filters for 2 or 3 as first digit.\n if ($first_digit == 2 || $first_digit == 3) {\n return $url;\n }\n else {\n // Invalid url.\n return FALSE;\n }\n }\n }", "public function test_non_existent_servefile() {\n list($user, , $talkpoint) = $this->_setup_single_user_in_single_talkpoint();\n\n // current time\n $now = time();\n\n // create a talkpoint\n $this->loadDataSet($this->createArrayDataSet(array(\n 'talkpoint_talkpoint' => array(\n array('id', 'instanceid', 'userid', 'title', 'uploadedfile', 'nimbbguid', 'mediatype', 'closed', 'timecreated', 'timemodified'),\n array(1, $talkpoint->id, $user->id, 'Talkpoint 001', 'mod_talkpoint_web_test.txt', null, 'file', 0, $now, $now),\n ),\n )));\n\n // request the file\n $client = new Client($this->_app);\n $client->request('GET', '/servefile/1');\n $this->assertTrue($client->getResponse()->isNotFound());\n $this->assertContains(get_string('storedfilecannotread', 'error'), $client->getResponse()->getContent());\n }", "function curl_get_file_size( $url ) {\n // Assume failure.\n $result = -1;\n $curl = curl_init( $url );\n\n // Issue a HEAD request and follow any redirects.\n curl_setopt( $curl, CURLOPT_NOBODY, true );\n curl_setopt( $curl, CURLOPT_HEADER, true );\n curl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );\n curl_setopt( $curl, CURLOPT_FOLLOWLOCATION, true );\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n\n $data = curl_exec( $curl );\n curl_close( $curl );\n\n if( $data ) {\n $content_length = \"unknown\";\n $status = \"unknown\";\n\n if( preg_match( \"/^HTTP\\/1\\.[01] (\\d\\d\\d)/\", $data, $matches ) ) {\n $status = (int)$matches[1];\n }\n\n if( preg_match( \"/Content-Length: (\\d+)/\", $data, $matches ) ) {\n $content_length = (int)$matches[1];\n }\n\n // http://en.wikipedia.org/wiki/List_of_HTTP_status_codes\n if( $status == 200 || ($status > 300 && $status <= 308) ) {\n $result = $content_length;\n }\n }\n\n return $result;\n}", "protected function isRemoteFile($src)\n {\n return str_contains($src, 'http://') || str_contains($src, 'https://');\n }", "public function exists() {\n if (is_null($this->sourceexists)) {\n $this->sourceexists = file_exists($this->sourcepath);\n if ($this->cat === \"url\" && !$this->sourceexists) $this->sourceexists = Path::exists($this->name);\n }\n return $this->sourceexists;\n }", "function file($url) {\n\t\t$file = Array ();\n\t\t$socket = $this->fopen ( $url );\n\t\tif ($socket) {\n\t\t\t$file = Array ();\n\t\t\twhile ( ! feof ( $socket ) ) {\n\t\t\t\t$file [] = fgets ( $socket, 10000 );\n\t\t\t}\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn $file;\n\t}", "public static function getSizeOfRemoteFile($url)\r\n\t{\r\n\t\t$headers = @get_headers($url, 1);\r\n\t\tif ($headers !== false && is_array($headers) && isset($headers['Content-Length'])) {\r\n\t\t\treturn $headers['Content-Length'];\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public function testReturnFileDownloadFileNotFound() {\n $response = $this->archiveService->returnFileDownload('php://pii_data/filename.zip');\n }", "function downloadDistantFile($url, $dest)\r\n {\r\n $options = array(\r\n CURLOPT_FILE => is_resource($dest) ? $dest : fopen($dest, 'w'),\r\n CURLOPT_FOLLOWLOCATION => true,\r\n CURLOPT_URL => $url,\r\n\t CURLOPT_REFERER => \"http://trailers.to\",\r\n CURLOPT_FAILONERROR => true, // HTTP code > 400 will throw curl error\r\n );\r\n\r\n $ch = curl_init();\r\n curl_setopt_array($ch, $options);\r\n $return = curl_exec($ch);\r\n\r\n if ($return === false)\r\n {\r\n\t\techo \"1\";\r\n return curl_error($ch);\r\n }\r\n else\r\n {\r\n return true;\r\n }\r\n }", "public function is_exist_file() {\r\n\t\treturn file_exists( $this->get_path( 'file' ) );\r\n\t}", "function test_link($url){\n ini_set('default_socket_timeout', 1);\n\n if(!$fp = @fopen($url, \"r\")) {\n return false;\n } else {\n fclose($fp);\n return true;\n }\n\n}", "public function checkURL($url)\n\t{\n\t\t$ret = false;\n\n\t\t$headers = get_headers(\n\t\t\t'http://gdata.youtube.com/feeds/api/videos/'.\n\t\t\t$this->getVideoId($url)\n\t\t);\n\n\t\tif (strpos($headers[0], '200')) \n\t\t{\n\t\t\t$ret = true;\n\t\t}\n\n\t\treturn $ret;\n\t}", "function check_cache ( $url ) {\n $this->ERROR = \"\";\n $filename = $this->file_name( $url );\n \n if ( file_exists( $filename ) ) {\n // find how long ago the file was added to the cache\n // and whether that is longer then MAX_AGE\n $mtime = filemtime( $filename );\n $age = time() - $mtime;\n if ( $this->MAX_AGE > $age ) {\n // object exists and is current\n return 'HIT';\n }\n else {\n // object exists but is old\n return 'STALE';\n }\n }\n else {\n // object does not exist\n return 'MISS';\n }\n }", "function curl_get_file_contents($url)\n {\n if(!function_exists('curl_init'))\n return file_get_contents($url);\n \n $c = curl_init();\n curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($c, CURLOPT_URL, $url);\n $contents = curl_exec($c);\n curl_close($c);\n \n if($contents)\n return $contents;\n \n return false;\n }", "public function fileexists(SS_HTTPRequest $request)\n {\n $uploadField = $this->getUploadField();\n\n return $uploadField->fileexists($request);\n }", "function getRemoteFile($url)\r\n{\r\n // get the host name and url path\r\n $parsedUrl = parse_url($url);\r\n $host = $parsedUrl['host'];\r\n if (isset($parsedUrl['path'])) {\r\n $path = $parsedUrl['path'];\r\n } else {\r\n // the url is pointing to the host like http://www.mysite.com\r\n $path = '/';\r\n }\r\n\r\n if (isset($parsedUrl['query'])) {\r\n $path .= '?' . $parsedUrl['query'];\r\n }\r\n\r\n if (isset($parsedUrl['port'])) {\r\n $port = $parsedUrl['port'];\r\n } else {\r\n // most sites use port 80\r\n $port = '80';\r\n }\r\n\r\n $timeout = 10;\r\n $response = '';\r\n\r\n // connect to the remote server\r\n $fp = @fsockopen($host, $port, $errno, $errstr, $timeout );\r\n\r\n if( !$fp ) {\r\n appendErrorMessage( sprintf(__(\"Cannot retrieve %s\"),$url));\r\n } else {\r\n // send the necessary headers to get the file\r\n @fputs($fp, \"GET $path HTTP/1.0\\r\\n\" .\r\n \"Host: $host\\r\\n\" .\r\n \"User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3\\r\\n\" .\r\n \"Accept: */*\\r\\n\" .\r\n \"Accept-Language: en-us,en;q=0.5\\r\\n\" .\r\n \"Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\\r\\n\" .\r\n \"Keep-Alive: 300\\r\\n\" .\r\n \"Connection: keep-alive\\r\\n\" .\r\n \"Referer: http://$host\\r\\n\\r\\n\");\r\n//$count = 0;\r\n while (!@feof($fp)) {\r\n $response .= @fread( $fp, 8192);\r\n// $count++;\r\n \r\n }\r\n fclose( $fp );\r\n//$response .= $count;\r\n//why is the above taking so long? how many packets do we get?\r\n\r\n // strip the headers\r\n $pos = strpos($response, \"\\r\\n\\r\\n\");\r\n $response = substr($response, $pos + 4);\r\n }\r\n\r\n // return the file content\r\n return $response;\r\n}", "public static function locate_file_url($filename) {\r\n //$path = '/tpl/' . $dir . '/' . $file;\r\n $located = FALSE;\r\n if (file_exists(get_stylesheet_directory() . '/' . $filename)):\r\n $file = get_stylesheet_directory_uri() . '/' . $filename;\r\n return $located = true;\r\n elseif (file_exists(get_template_directory() . '/' . $filename)):\r\n $file = get_template_directory_uri() . '/' . $filename;\r\n return $located = true;\r\n elseif (file_exists(get_stylesheet_directory() . $filename)):\r\n $file = get_stylesheet_directory_uri() . '/' . $filename;\r\n return $located = true;\r\n elseif (file_exists(get_template_directory() . '/' . $filename)):\r\n $file = get_template_directory_uri() . '/' . $filename;\r\n return $located = true;\r\n elseif (file_exists(get_stylesheet_directory() . '/' . $filename)):\r\n $file = get_stylesheet_directory_uri() . '/' . $filename;\r\n return $located = true;\r\n elseif (file_exists(get_template_directory() . '/' . $filename)):\r\n $file = get_template_directory_uri() . '/' . $filename;\r\n return $located = true;\r\n elseif (file_exists(STYLESHEETPATH . '/' . $filename)):\r\n $file = get_stylesheet_directory_uri() . '/' . $filename;\r\n return $located = true;\r\n elseif (file_exists(TEMPLATEPATH . '/' . $filename)):\r\n $file = get_template_directory_uri() . '/' . $filename;\r\n return $located = true;\r\n elseif (file_exists(CWP_URL . '/' . $filename)):\r\n $file = CWP_URL . '/' . $filename;\r\n return $file;\r\n endif;\r\n if (!$located):\r\n return false;\r\n else :\r\n return $file;\r\n endif;\r\n }", "public function fileExists($name);", "function curl_get_file_size( $url ) {\n // Assume failure.\n $result = -1;\n\n $ch = curl_init( $url );\n\n // Issue a HEAD request and follow any redirects.\n curl_setopt( $ch, CURLOPT_NOBODY, true );\n curl_setopt( $ch, CURLOPT_HEADER, true );\n curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );\n curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true );\n //curl_setopt( $ch, CURLOPT_USERAGENT, get_user_agent_string() );\n\tcurl_setopt ($ch, CURLOPT_FOLLOWLOCATION, true);\n\tcurl_setopt ($ch, CURLOPT_MAXREDIRS, 5);\n\tcurl_setopt ($ch, CURLOPT_REFERER, false);\n\tcurl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, false);\n\tcurl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, true);\n\tcurl_setopt ($ch, CURLOPT_COOKIE, $cookie_string); \n\tcurl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); \n\tcurl_setopt ($ch, CURLOPT_USERAGENT, $useragent); \n $data = curl_exec( $ch );\n curl_close( $ch );\n\n if( $data ) {\n $content_length = \"unknown\";\n $status = \"unknown\";\n\n if( preg_match( \"/^HTTP\\/1\\.[01] (\\d\\d\\d)/\", $data, $matches ) ) {\n $status = (int)$matches[1];\n }\n\n if( preg_match( \"/Content-Length: (\\d+)/\", $data, $matches ) ) {\n $content_length = (int)$matches[1];\n }\n\n // http://en.wikipedia.org/wiki/List_of_HTTP_status_codes\n if( $status == 200 || ($status > 300 && $status <= 308) ) {\n $result = $content_length;\n }\n }\n\n return $result;\n}", "public function testErrorIsThrownIfURLNotFound()\n {\n $this->mockHttpResponses([new Response(404, [], view('tests.google-404')->render())]);\n\n self::$importer->get('google-not-found-url', now()->subYear(), now()->addYear());\n }", "public function exists($filename);", "function getFileExists() {\n\t\treturn file_exists($this->getFilename());\n\t}", "function curl_get_file($url)\n {\n $c = curl_init(); //Initialize curl session \n \n //Setting curl option\n curl_setopt($c,CURLOPT_RETURNTRANSFER,TRUE);\n curl_setopt($c,CURLOPT_URL,$url);\n \n $result = curl_exec($c); //Executing curl session\n curl_close($c); //Closing curl session\n \n return $result;\n }", "function read_remote_file($url)\n{\n\t$fp = fopen($url,\"r\");\n\tif (!$fp) return false;\n\n\t$text = '';\n\twhile ( !feof($fp) )\n\t{\n\t\t$text .= fgets($fp,4096);\n\t}\n\n\treturn $text;\n}", "function get_remote_file($url, $timeout, $head_only = false, $max_redirects = 10)\n{\n\t$result = null;\n\t$parsed_url = parse_url($url);\n\t$allow_url_fopen = strtolower(@ini_get('allow_url_fopen'));\n\n\t// Quite unlikely that this will be allowed on a shared host, but it can't hurt\n\tif (function_exists('ini_set'))\n\t\t@ini_set('default_socket_timeout', $timeout);\n\n\t// If we have cURL, we might as well use it\n\tif (function_exists('curl_init'))\n\t{\n\t\t// Setup the transfer\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_HEADER, true);\n\t\tcurl_setopt($ch, CURLOPT_NOBODY, $head_only);\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, $timeout);\n\t\tcurl_setopt($ch, CURLOPT_USERAGENT, 'Flazy');\n\n\t\t// Grab the page\n\t\t$content = @curl_exec($ch);\n\t\t$responce_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\t\tcurl_close($ch);\n\n\t\t// Process 301/302 redirect\n\t\tif ($content !== false && ($responce_code == '301' || $responce_code == '302') && $max_redirects > 0)\n\t\t{\n\t\t\t$headers = explode(\"\\r\\n\", trim($content));\n\t\t\tforeach ($headers as $header)\n\t\t\t\tif (substr($header, 0, 10) == 'Location: ')\n\t\t\t\t{\n\t\t\t\t\t$responce = get_remote_file(substr($header, 10), $timeout, $head_only, $max_redirects - 1);\n\t\t\t\t\tif ($responce !== null)\n\t\t\t\t\t\t$responce['headers'] = array_merge($headers, $responce['headers']);\n\t\t\t\t\treturn $responce;\n\t\t\t\t}\n\t\t}\n\n\t\t// Ignore everything except a 200 response code\n\t\tif ($content !== false && $responce_code == '200')\n\t\t{\n\t\t\tif ($head_only)\n\t\t\t\t$result['headers'] = explode(\"\\r\\n\", str_replace(\"\\r\\n\\r\\n\", \"\\r\\n\", trim($content)));\n\t\t\telse\n\t\t\t{\n\t\t\t\tpreg_match('#HTTP/1.[01] 200 OK#', $content, $match, PREG_OFFSET_CAPTURE);\n\t\t\t\t$last_content = substr($content, $match[0][1]);\n\t\t\t\t$content_start = strpos($last_content, \"\\r\\n\\r\\n\");\n\t\t\t\tif ($content_start !== false)\n\t\t\t\t{\n\t\t\t\t\t$result['headers'] = explode(\"\\r\\n\", str_replace(\"\\r\\n\\r\\n\", \"\\r\\n\", substr($content, 0, $match[0][1] + $content_start)));\n\t\t\t\t\t$result['content'] = substr($last_content, $content_start + 4);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// fsockopen() is the second best thing\n\telse if (function_exists('fsockopen'))\n\t{\n\t\t$remote = @fsockopen($parsed_url['host'], !empty($parsed_url['port']) ? intval($parsed_url['port']) : 80, $errno, $errstr, $timeout);\n\t\tif ($remote)\n\t\t{\n\t\t\t// Send a standard HTTP 1.0 request for the page\n\t\t\tfwrite($remote, ($head_only ? 'HEAD' : 'GET').' '.(!empty($parsed_url['path']) ? $parsed_url['path'] : '/').(!empty($parsed_url['query']) ? '?'.$parsed_url['query'] : '').' HTTP/1.0'.\"\\r\\n\");\n\t\t\tfwrite($remote, 'Host: '.$parsed_url['host'].\"\\r\\n\");\n\t\t\tfwrite($remote, 'User-Agent: Flazy'.\"\\r\\n\");\n\t\t\tfwrite($remote, 'Connection: Close'.\"\\r\\n\\r\\n\");\n\n\t\t\tstream_set_timeout($remote, $timeout);\n\t\t\t$stream_meta = stream_get_meta_data($remote);\n\n\t\t\t// Fetch the response 1024 bytes at a time and watch out for a timeout\n\t\t\t$content = false;\n\t\t\twhile (!feof($remote) && !$stream_meta['timed_out'])\n\t\t\t{\n\t\t\t\t$content .= fgets($remote, 1024);\n\t\t\t\t$stream_meta = stream_get_meta_data($remote);\n\t\t\t}\n\n\t\t\tfclose($remote);\n\n\t\t\t// Process 301/302 redirect\n\t\t\tif ($content !== false && $max_redirects > 0 && preg_match('#^HTTP/1.[01] 30[12]#', $content))\n\t\t\t{\n\t\t\t\t$headers = explode(\"\\r\\n\", trim($content));\n\t\t\t\tforeach ($headers as $header)\n\t\t\t\t\tif (substr($header, 0, 10) == 'Location: ')\n\t\t\t\t\t{\n\t\t\t\t\t\t$responce = get_remote_file(substr($header, 10), $timeout, $head_only, $max_redirects - 1);\n\t\t\t\t\t\tif ($responce !== null)\n\t\t\t\t\t\t\t$responce['headers'] = array_merge($headers, $responce['headers']);\n\t\t\t\t\t\treturn $responce;\n\t\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Ignore everything except a 200 response code\n\t\t\tif ($content !== false && preg_match('#^HTTP/1.[01] 200 OK#', $content))\n\t\t\t{\n\t\t\t\tif ($head_only)\n\t\t\t\t\t$result['headers'] = explode(\"\\r\\n\", trim($content));\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$content_start = strpos($content, \"\\r\\n\\r\\n\");\n\t\t\t\t\tif ($content_start !== false)\n\t\t\t\t\t{\n\t\t\t\t\t\t$result['headers'] = explode(\"\\r\\n\", substr($content, 0, $content_start));\n\t\t\t\t\t\t$result['content'] = substr($content, $content_start + 4);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// Last case scenario, we use file_get_contents provided allow_url_fopen is enabled (any non 200 response results in a failure)\n\telse if (in_array($allow_url_fopen, array('on', 'true', '1')))\n\t{\n\t\t// PHP5's version of file_get_contents() supports stream options\n\t\tif (version_compare(PHP_VERSION, '5.0.0', '>='))\n\t\t{\n\t\t\t// Setup a stream context\n\t\t\t$stream_context = stream_context_create(\n\t\t\t\tarray(\n\t\t\t\t\t'http' => array(\n\t\t\t\t\t\t'method'\t\t=> $head_only ? 'HEAD' : 'GET',\n\t\t\t\t\t\t'user_agent'\t\t=> 'Flazy',\n\t\t\t\t\t\t'max_redirects'\t\t=> $max_redirects + 1, // PHP >=5.1.0 only\n\t\t\t\t\t\t'timeout'\t\t=> $timeout // PHP >=5.2.1 only\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$content = @file_get_contents($url, false, $stream_context);\n\t\t}\n\t\telse\n\t\t\t$content = @file_get_contents($url);\n\n\t\t// Did we get anything?\n\t\tif ($content !== false)\n\t\t{\n\t\t\t// Gotta love the fact that $http_response_header just appears in the global scope (*cough* hack! *cough*)\n\t\t\t$result['headers'] = $http_response_header;\n\t\t\tif (!$head_only)\n\t\t\t\t$result['content'] = $content;\n\t\t}\n\t}\n\n\treturn $result;\n}" ]
[ "0.8510613", "0.82898194", "0.80327165", "0.79853827", "0.7917871", "0.7853234", "0.7778872", "0.7773952", "0.7596729", "0.7591613", "0.7577265", "0.7418707", "0.7355416", "0.7346865", "0.7339747", "0.72685343", "0.7232148", "0.71644634", "0.7066066", "0.70495117", "0.70372605", "0.7003528", "0.69485945", "0.69458646", "0.69130296", "0.6888365", "0.68882304", "0.68611735", "0.68404585", "0.6834084", "0.6763688", "0.6748002", "0.67246264", "0.6668204", "0.6656222", "0.6649019", "0.65770817", "0.6485018", "0.64454174", "0.6436037", "0.64269227", "0.6421445", "0.63561326", "0.63543326", "0.6340786", "0.6335111", "0.6334789", "0.63171387", "0.62778467", "0.62778467", "0.62693495", "0.6245114", "0.623257", "0.6215516", "0.62089443", "0.6207606", "0.6181833", "0.6178369", "0.6172125", "0.6135258", "0.60877866", "0.60756004", "0.6034144", "0.6005889", "0.6005269", "0.59991246", "0.5995417", "0.5994816", "0.59934705", "0.597475", "0.5962847", "0.59595627", "0.59431654", "0.5938278", "0.593375", "0.59246796", "0.5914976", "0.5871452", "0.5857215", "0.5845035", "0.5838512", "0.5827278", "0.58180314", "0.58178437", "0.57909375", "0.57811403", "0.5780415", "0.57656384", "0.57507545", "0.5750091", "0.57469285", "0.5735816", "0.57327014", "0.57253075", "0.5723247", "0.5722979", "0.5712261", "0.56768274", "0.56738853", "0.56675017" ]
0.632512
47
/ GET ARGUMENT Function to get an argument from the form (either from GET or POST) A wrapper helps ensure we properly check for isset() and in future ensure that the user parameter passed in is actually safe
function get_arg($ARR,$var) { if (isset($ARR[$var])) { return $ARR[$var]; } else { return ""; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_param($param_name)\n{\n $param_value = \"\";\n if(isset($_POST[$param_name]))\n $param_value = $_POST[$param_name];\n else if(isset($_GET[$param_name]))\n $param_value = $_GET[$param_name];\n\n return $param_value;\n}", "function get_form_val($key, $default='', $getfirst=TRUE)\r\n{\r\n if ($getfirst)\r\n {\r\n return (empty($_GET[$key]) ? (empty($_POST[$key]) ? $default : $_POST[$key]) : $_GET[$key]);\r\n }\r\n else\r\n {\r\n return (empty($_POST[$key]) ? (empty($_GET[$key]) ? $default : $_GET[$key]) : $_POST[$key]);\r\n }\r\n}", "function getParam($name, $check_numerical=false)\n{\n $p = $_GET[$name];\n if ($p == \"\") {\n $p = $_POST[$name];\n }\n //coming in per POST?\n $p= filterSQL($p);\n return $p;\n}", "function getparam($name) {\n if (isset($_POST[$name])) {\n return $_POST[$name];\n } else {\n return \"\";\n }\n}", "function get_param($name) {\n \n if (isset($_REQUEST[$name])) return $_REQUEST[$name];\n else return \"\";\n}", "private function getInput($key)\n {\n return isset($_GET[$key]) ? $_GET[$key] : null;\n }", "function get_param($param_name)\n{\n if($_POST[$param_name])\n\t\treturn $_POST[$param_name];\n\telse\n\t\treturn $_GET[$param_name];\n}", "function inputGet($key, $default = \"\")\n{\n\tif(inputHas($key)) {\n\t\treturn $_REQUEST[$key];\n\t} else {\n\t\treturn $default;\n\t}\n}", "function get_form_field($field_name)\n{\n global $HTTP_GET_VARS;\n global $HTTP_POST_VARS;\n\n $field_value = null;\n if (isset($_GET)) {\n if (isset($_GET[$field_name])) $field_value = $_GET[$field_name];\n else if (isset($_POST[$field_name]))\n $field_value = $_POST[$field_name];\n else if (isset($_GET[\"_\".$field_name]))\n $field_value = $_GET[\"_\".$field_name];\n else if (isset($_POST[\"_\".$field_name]))\n $field_value = $_POST[\"_\".$field_name];\n }\n else {\n if (isset($HTTP_GET_VARS[$field_name]))\n $field_value = $HTTP_GET_VARS[$field_name];\n else if (isset($HTTP_POST_VARS[$field_name]))\n $field_value = $HTTP_POST_VARS[$field_name];\n else if (isset($HTTP_GET_VARS[\"_\".$field_name]))\n $field_value = $HTTP_GET_VARS[\"_\".$field_name];\n else if (isset($HTTP_POST_VARS[\"_\".$field_name]))\n $field_value = $HTTP_POST_VARS[\"_\".$field_name];\n }\n if (isset($field_value) && get_magic_quotes_gpc()) {\n if (is_array($field_value)) strip_form_field_arrays($field_value);\n else $field_value = stripslashes($field_value);\n }\n return $field_value;\n}", "function GET($key)\n {\n if (isset($_GET[$key]))\n $value = $_GET[$key];\n elseif (isset($GLOBALS['HTTP_GET_VARS'][$key]))\n $value = $GLOBALS['HTTP_GET_VARS'][$key];\n elseif (isset($_POST[$key]))\n $value = $_POST[$key];\n elseif (isset($GLOBALS['HTTP_POST_VARS'][$key]))\n $value = $GLOBALS['HTTP_POST_VARS'][$key];\n else\n return \"\";\n if (get_magic_quotes_gpc())\n return stripslashes($value);\n return $value;\n }", "function _get($str)\n{\n $val = !empty($_GET[$str]) ? $_GET[$str] : null;\n return $val;\n}", "function get_form_var($variable, $type = 'string')\n{\n // We use some functions from here\n require_once \"functions.inc\";\n \n global $cli_params, $allow_cli;\n \n // Set the default value, and make sure it's the right type\n if (func_num_args() > 2)\n {\n $value = func_get_arg(2);\n $value = ($type == 'array') ? (array)$value : $value;\n }\n else\n {\n $value = ($type == 'array') ? array() : NULL;\n }\n \n // Get the command line arguments if any (and we're allowed to),\n // otherwise get the POST variables\n if ($allow_cli && (!empty($cli_params) && isset($cli_params[$variable])))\n {\n $value = $cli_params[$variable];\n }\n else if (!empty($_POST) && isset($_POST[$variable]))\n {\n $value = $_POST[$variable];\n }\n else if (!empty($HTTP_POST_VARS) && isset($HTTP_POST_VARS[$variable]))\n {\n $value = $HTTP_POST_VARS[$variable];\n }\n \n // Then get the GET variables\n if (!empty($_GET) && isset($_GET[$variable]))\n {\n $value = $_GET[$variable];\n }\n else if (!empty($HTTP_GET_VARS) && isset($HTTP_GET_VARS[$variable]))\n {\n $value = $HTTP_GET_VARS[$variable];\n }\n \n // Cast to an array if necessary\n if ($type == 'array')\n {\n $value = (array)$value;\n }\n \n // Clean up the variable\n if ($value != NULL)\n {\n if ($type == 'int')\n {\n $value = intval(unslashes($value));\n }\n else if ($type == 'string')\n {\n $value = unslashes($value);\n }\n else if ($type == 'array')\n {\n foreach ($value as $arrkey => $arrvalue)\n {\n $value[$arrkey] = unslashes($arrvalue);\n }\n }\n }\n return $value;\n}", "function get_form_field_value($field, $default_value = null) {\n if (!empty($_REQUEST[$field])) {\n return $_REQUEST[$field];\n } else {\n return $default_value;\n }\n}", "function get_get_var($var)\r\n{\r\n if (isset($_GET[$var])) {\r\n return sanitizeAny($_GET[$var]);\r\n } else {\r\n return null;\r\n }\r\n}", "function _get($v) {\r\n return isset($_GET[$v]) ? bwm_clean($_GET[$v]) : NULL;\r\n}", "function GetVar($name, $default_value = false) {\r\n if (!isset($_GET)) {\r\n return false;\r\n }\r\n if (isset($_GET[$name])) {\r\n if (!get_magic_quotes_gpc()) {\r\n return InjectSlashes($_GET[$name]);\r\n }\r\n return $_GET[$name];\r\n }\r\n return $default_value;\r\n}", "static function get($key) {\n if(!isset($_REQUEST[$key])) return null;\n else return $_REQUEST[$key];\n }", "function input_get(string $key): ?string\n{\n return \\filter_input(INPUT_GET, $key);\n}", "function getUserFromForm()\n {\n $string= \"default\";\n\n if (isset($_POST['Parametro']))\n $string=$_POST['Parametro'];\n\n return $string;\n }", "function queryparam_fetch($key, $default_value = null) {\n\t// check GET first\n\t$val = common_param_GET($_GET, $key, $default_value);\n\tif ($val != $default_value) {\n\t\tif ( is_string($val) )\n\t\t\t$val = urldecode($val);\n\t\treturn $val;\n\t}\n\n\t// next, try POST (with form encode)\n\t$val = common_param_GET($_POST, $key, $default_value);\n\tif ($val != $default_value)\n\t\treturn $val;\n\n\t// next, try to understand rawinput as a json string\n\n\t// check pre-parsed object\n\tif ( !isset($GLOBALS['phpinput_parsed']) ) {\n\t\t$GLOBALS['phpinput'] = file_get_contents(\"php://input\");\n\t\tif ( $GLOBALS['phpinput'] ) {\n\t\t\t$GLOBALS['phpinput_parsed'] = json_decode($GLOBALS['phpinput'], true);\n\t\t\tif ( $GLOBALS['phpinput_parsed'] ) {\n\t\t\t\telog(\"param is available as: \" . $GLOBALS['phpinput']);\n\t\t\t}\n\t\t}\n\t}\n\n\t// check key in parsed object\n\tif ( isset($GLOBALS['phpinput_parsed']) ) {\n\t\tif ( isset($GLOBALS['phpinput_parsed'][$key]) ) {\n\t\t\t$val = $GLOBALS['phpinput_parsed'][$key];\n\t\t\tif ($val != $default_value)\n\t\t\t\treturn $val;\n\t\t}\n\t}\n\n\treturn $default_value;\n}", "function GetFromGET($var) {\n //Note: some HTML elements are empty (such as radio button) if nothing is selected,\n //This will result in an error when looking it up in the GET array\n //Use empty to see if the value exists\n if(!empty($_GET[$var])) { \n $tmp = $_GET[$var]; \n } else {\n $tmp = \"\";\n }\n return $tmp;\n}", "function get_param_string($name, $default = false, $no_security = false)\n{\n $ret = __param($_GET, $name, $default);\n if (($ret === '') && (isset($_GET['require__' . $name])) && ($default !== $ret) && ($_GET['require__' . $name] !== '0')) {\n // We didn't give some required input\n set_http_status_code('400');\n warn_exit(do_lang_tempcode('IMPROPERLY_FILLED_IN'));\n }\n\n if ($ret === $default) {\n return $ret;\n }\n\n if (strpos($ret, ':') !== false && function_exists('cms_url_decode_post_process')) {\n $ret = cms_url_decode_post_process($ret);\n }\n\n require_code('input_filter');\n check_input_field_string($name, $ret);\n\n if ($ret === false) { // Should not happen, but have seen in the wild via malicious bots sending corrupt URLs\n $ret = $default;\n }\n\n return $ret;\n}", "function get_param($key, $default=false){\n if (is_array($key)){\n foreach ($key as $onekey){\n $ret = get_param($onekey);\n if ($ret)\n return $ret;\n }\n }else{ \n \n if ($_GET)\n if (array_key_exists($key,$_GET))\n return $_GET[$key];\n if ($_POST)\n if (array_key_exists($key,$_POST))\n return $_POST[$key]; \n }\n \n return $default;\n}", "function fetch_argument($argumentName) {\n\t\treturn isset($_GET[$argumentName]) ? sqlite_escape_string($_GET[$argumentName]) : null;\n\t}", "public function get_query_arg( $name ) {\n\t\tglobal $taxnow, $typenow;\n\t\t$value = '';\n\t\t$url_args = wp_parse_args( wp_parse_url( wp_get_referer(), PHP_URL_QUERY ) );\n\t\t// Get the value of an arbitrary post argument.\n\t\t// @todo We are suppressing the need for a nonce check, which means this whole thing likely needs a rewrite.\n\t\t$post_arg_val = ! empty( $_POST[ $name ] ) ? sanitize_text_field( wp_unslash( $_POST[ $name ] ) ) : null; // @codingStandardsIgnoreLine\n\n\t\tswitch ( true ) {\n\t\t\tcase ( ! empty( get_query_var( $name ) ) ):\n\t\t\t\t$value = get_query_var( $name );\n\t\t\t\tbreak;\n\t\t\t// If the query arg isn't set. Check POST and GET requests.\n\t\t\tcase ( ! empty( $post_arg_val ) ):\n\t\t\t\t// Verify nonce here.\n\t\t\t\t$value = $post_arg_val;\n\t\t\t\tbreak;\n\t\t\tcase ( ! empty( $_GET[ $name ] ) ):\n\t\t\t\t$value = sanitize_text_field( wp_unslash( $_GET[ $name ] ) );\n\t\t\t\tbreak;\n\t\t\tcase ( 'post_type' === $name && ! empty( $typenow ) ):\n\t\t\t\t$value = $typenow;\n\t\t\t\tbreak;\n\t\t\tcase ( 'taxonomy' === $name && ! empty( $taxnow ) ):\n\t\t\t\t$value = $taxnow;\n\t\t\t\tbreak;\n\t\t\tcase ( ! empty( $url_args[ $name ] ) ):\n\t\t\t\t$value = $url_args[ $name ];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$value = '';\n\t\t}\n\t\treturn $value;\n\t}", "function getVar($var='value'){\r\n\r\n\t$ci =& get_instance();\r\n\r\n\tif( isset($_POST[$var]) ) return $ci->input->post($var);\r\n\r\n\telseif \t( isset($_GET[$var]) ) return $ci->input->get($var);\r\n\r\n\telse return 0;\r\n}", "function getParam($path, $variableName, $default=\"\", $remainingData=false) {\r\n\tif (isset($_GET[$variableName])) {\r\n\t\t$val = $_GET[$variableName];\r\n\t} else {\r\n\t\t$val = getParamFromPath($path, $variableName, $default, $remainingData);\r\n\t}\r\n\treturn $val!=\"\" ? $val : $default;\r\n}", "function param($key, $default = NULL)\n{\n\treturn isset($_REQUEST[$key]) ? $_REQUEST[$key] : $default;\n}", "protected function get($name, $value = NULL) {\n\t\tif (isset($_GET[$name])) {\n\t\t\treturn trim(htmlspecialchars($_GET[$name]));\t\n\t\t} else if (isset($_POST[$name])) {\n\t\t\treturn trim(htmlspecialchars($_POST[$name]));\n\t\t}\n\t\treturn $value;\n\t}", "private function getUserInput()\n {\n // BotDetect built-in Ajax Captcha validation\n $input = $this->getUrlParameter('i');\n\n if (is_null($input)) {\n // jQuery validation support, the input key may be just about anything,\n // so we have to loop through fields and take the first unrecognized one\n $recognized = array('get', 'c', 't', 'd');\n foreach ($_GET as $key => $value) {\n if (!in_array($key, $recognized)) {\n $input = $value;\n break;\n }\n }\n }\n\n return $input;\n }", "public function getParameter();", "public function getParameter();", "function get_parameter($param) {\n\tif (isset($_POST[$param])) {\t\t//if name/pw are valid parameters\n\t\treturn mysql_real_escape_string($_POST[$param]);\t\t//return those\n\t} else { \t\t\t\t\t\t//if nothing posted\n\t\theader(\"HTTP/1.1 400 Invalid Request\");\n\t\tdie(\"HTTP/1.1 400 Invalid Request - you forgot to pass the proper parameters\");\n\t}\n}", "function get_query_string($key) {\n $val = null;\n if (!empty($_GET[$key])) {\n $val = $_GET[$key];\n }\n return $val;\n}", "function _getn($v) {\r\n $r = isset($_GET[$v]) ? bwm_clean($_GET[$v]) : '';\r\n return $r == '' ? NULL : $r;\r\n}", "private function postget ( $key ) {\n if ( isset( $_POST[ $key ] ) ) {\n return filter_input( INPUT_POST, $key );\n } elseif ( isset( $_GET[ $key ] ) ) {\n return filter_input( INPUT_GET, $key );\n } else {\n return NULL;\n }\n }", "function _get_argument($name, $default = null) {\n $values = $this->_get_arguments($name);\n $len = count($values);\n if ( 0 < $len ) {\n return $values[$len - 1];\n }\n if (null == $default) {\n die(\"Missing argument $name\");\n }\n return $default;\n}", "static function getInput($name, $value = false, $allow_get = true) {\n if (isset($_POST[$name])) {\n $output = $_POST[$name];\n if (!is_array($output)) {\n $output = htmlspecialchars($output);\n }\n return $output;\n }\n if ($allow_get) {\n if (isset($_GET[$name])) {\n $output = $_GET[$name];\n if (!is_array($output)) {\n $output = Dbase::con()->real_escape_string($output);\n $output = htmlspecialchars($output);\n }\n return $output;\n }\n }\n return $value;\n }", "function request($key){\n if (array_key_exists($key, $_REQUEST)){\n return $_REQUEST[$key];\n }\n return null;\n}", "function PKG_OptionPageGetValue($variable,$params)\n{\n\tif (isset($_GET[$variable]))\n\t\treturn($_GET[$variable]);\n\telse\n\t\treturn($params[$variable]);\n}", "function UrlParmGet( $fld, $k )\r\n /******************************\r\n Get the value from an urlparm\r\n */\r\n {\r\n $ra = $this->UrlParmGetRA( $fld );\r\n return( @$ra[$k] ?? \"\" );\r\n }", "public function getArgument($name, $default = null) {\n if (array_key_exists($name, $_GET)) {\n return $_GET[$name];\n }\n\n return $default;\n }", "public static function getParam() {\n\n\t}", "function getVariable($variableName) {\r\n if (isset($_GET[$variableName])) {\r\n $return = $_GET[$variableName];\r\n } elseif (isset($_POST[$variableName])) {\r\n $return = $_POST[$variableName];\r\n } else {\r\n return NULL;\r\n }\r\n\r\n return $return;\r\n}", "function getVariable($variableName) {\r\n if (isset($_GET[$variableName])) {\r\n $return = $_GET[$variableName];\r\n } elseif (isset($_POST[$variableName])) {\r\n $return = $_POST[$variableName];\r\n } else {\r\n return NULL;\r\n }\r\n\r\n return $return;\r\n}", "function getVal( $name, $default = '' ) {\r\n\t\t\r\n\t\tif( isset( $_REQUEST[$name] ) ) return $this->unquote( $_REQUEST[$name] );\r\n\t\telse return $this->unquote( $default );\r\n\t}", "function safePostGetVar($varName, $default=null)\n{\n if (isset($_POST[$varName]))\n return $_POST[$varName];\n elseif (isset($_GET[$varName]))\n return $_GET[$varName];\n else\n return $default;\n}", "function getVAR ($var)\n{\n if (isset($_POST[$var]) && strlen($_POST[$var]) > 0)\n {\n return $_POST[$var];\n }\n\n return (isset($_GET[$var]) && strlen($_GET[$var]) >0) ? $_GET[$var] : '';\n}", "function either_param_string($name, $default = false)\n{\n $ret = __param(array_merge($_POST, $_GET), $name, $default);\n if ($ret === null) {\n return null;\n }\n\n if ($ret === $default) {\n if ($default === null) {\n return null;\n }\n\n return $ret;\n }\n\n if (strpos($ret, ':') !== false && function_exists('cms_url_decode_post_process')) {\n $ret = cms_url_decode_post_process($ret);\n }\n\n require_code('input_filter');\n check_input_field_string($name, $ret, true);\n\n return $ret;\n}", "function getValue($fieldName) {\r\n $value = '';\r\n if (isset($_REQUEST[$fieldName])) { \r\n $value = $_REQUEST[$fieldName];\r\n }\r\n return $value;\r\n }", "function safeGetVar($varName, $default=null)\n{\n if (isset($_GET[$varName]))\n return $_GET[$varName];\n else\n return $default;\n}", "function get_var($varname, $method=\"\", $default_value=\"\")\n{\n\tglobal $_POST;\n\tglobal $_GET;\n\n\tif( isset($_GET[$varname]) && ((strcasecmp($method, \"get\") == 0 || $method == null)) )\n\t{\n\t\treturn $_GET[$varname];\n\t}\n\telse if(isset($_POST[$varname]))\n\t{\n\t\treturn $_POST[$varname];\n\t}\n\telse return $default_value;\n}", "public function getFormParam($key, $default = null) {\r\n\t\tif (isset($_POST[$key])) {\r\n\t\t\treturn $_POST[$key];\r\n\t\t}\r\n\t\treturn $default;\r\n\t}", "function get($key) {\n\tif(isset($_GET[$key])) {\n\t\treturn $_GET[$key];\n\t}\n\telse {\n\t\treturn '';\n\t}\n}", "function getParam( $key, $default = NULL ) {\n return Yii::app()->request->getParam( $key, $default );\n}", "function RequestVar($name, $default_value = true) {\r\n if (!isset($_REQUEST))\r\n return false;\r\n if (isset($_REQUEST[$name])) {\r\n if (!get_magic_quotes_gpc())\r\n return InjectSlashes($_REQUEST[$name]);\r\n return $_REQUEST[$name];\r\n }\r\n return $default_value;\r\n}", "function GetQueryString($name, $default=\"\") {\n return ValidRequiredQueryString($name) ? $_GET[$name] : $default;\n}", "function queryparam_GET($key, $default_value = null) {\n\treturn common_param_GET($_GET, $key, $default_value);\n}", "function param($key, $defval = '', $safe = TRUE) {\n\tif(!isset($_REQUEST[$key]) || ($key === 0 && empty($_REQUEST[$key]))) {\n\t\tif(is_array($defval)) {\n\t\t\treturn array();\n\t\t} else {\n\t\t\treturn $defval;\n\t\t}\n\t}\n\t$val = $_REQUEST[$key];\n\t$val = param_force($val, $defval, $safe);\n\treturn $val;\n}", "function get_query_str_value($name) {\n\n return (array_key_exists($name, $_GET) ? $_GET[$name] : null);\n}", "function getGetParam($name,$def=null) {\n\treturn htmlentities(isset($_GET[$name]) ? $_GET[$name] : $def,ENT_QUOTES);\n\t\t\n}", "function getCampo($campo)\n{\n if (!empty($_POST[$campo])) {\n return test_input($_POST[$campo]);\n }\n return \"\";\n}", "public function getParameter($name,$defaultValue=null){\n\t\treturn isset($_GET[$name])? $_GET[$name] : $defaultValue;\n\t}", "public function getParam($name='', $xssClean=true) {\n if(!isset($_POST[$name]))\n return $this->get($name);\n else\n return $this->post($name, $xssClean);\n }", "function param($p, $def=\"\") {\n\t//global $_SERVER, $_SESSION, $_COOKIE, $_REQUEST, $_POST, $_GET;\n\tif (!empty($_SESSION)&&isset($_SESSION[$p])) return $_SESSION[$p];\n\telse if (isset($_COOKIE[$p])) return $_COOKIE[$p];\n\telse if (isset($_REQUEST[$p])) return $_REQUEST[$p];\n\telse if (isset($_POST[$p])) return $_POST[$p];\n\telse if (isset($_GET[$p])) return $_GET[$p];\n\telse return $def;\n}", "function GetGet ($var, $default='') {\n\treturn GetRequest($_GET, $var, $default);\n\t/*\n\tif (isset($_GET[$var]))\n\t\t$val = $_GET[$var];\n\telse\n\t\t$val = $default;\n\treturn $val;\n\t*/\n}", "function get($key, $default = null)\n{\n if (is_array($key)) {\n foreach ($key as $val) {\n if (isset($_GET[$val])) {\n return $_GET[$val];\n }\n }\n } elseif (isset($_GET[$key])) {\n return $_GET[$key];\n }\n return $default;\n}", "protected function getPostParam($clave)\n\t{\n\t\tif(isset($_POST[$clave])):\n\t\t\treturn $_POST[$clave];\n\t\tendif;\n\t}", "function GetPost ($var, $default='') {\n\treturn GetRequest($_POST, $var, $default);\n\t/*\n\tif (isset($_POST[$var]))\n\t\t$val = $_POST[$var];\n\telse\n\t\t$val = $default;\n\treturn $val;\n\t*/\n}", "public function getParameter($name);", "public function getParameter($name);", "public function getParameter($name);", "function get_query_var($query_var, $default_value = '')\n {\n }", "public function getArgValue(string $name) {\n $argObj = $this->getArgument($name);\n\n if ($argObj === null) {\n return null;\n }\n\n $val = $this->getArgValFromRequest($name);\n\n if ($val === null) {\n $val = $this->getArgValFromTerminal($name);\n }\n\n\n\n if ($val === null) {\n $val = $argObj->getValue();\n }\n\n if ($val === null) {\n $val = $argObj->getDefault();\n }\n\n if ($val !== null) {\n $argObj->setValue($val);\n }\n\n return $val;\n }", "function get_form_var($variable, $type = 'string')\n{\n if ($type == 'array')\n {\n $value = array();\n }\n else\n {\n $value = NULL;\n }\n\n if (!empty($_POST) && isset($_POST[$variable]))\n {\n if ($type == 'array')\n {\n $value = (array)$_POST[$variable];\n }\n else\n {\n $value = $_POST[$variable];\n }\n }\n else if (!empty($HTTP_POST_VARS) && isset($HTTP_POST_VARS[$variable]))\n {\n if ($type == 'array')\n {\n $value = (array)$HTTP_POST_VARS[$variable];\n }\n else\n {\n $value = $HTTP_POST_VARS[$variable];\n }\n }\n if (!empty($_GET) && isset($_GET[$variable]))\n {\n if ($type == 'array')\n {\n $value = (array)$_GET[$variable];\n }\n else\n {\n $value = $_GET[$variable];\n }\n }\n else if (!empty($HTTP_GET_VARS) && isset($HTTP_GET_VARS[$variable]))\n {\n if ($type == 'array')\n {\n $value = (array)$HTTP_GET_VARS[$variable];\n }\n else\n {\n $value = $HTTP_GET_VARS[$variable];\n }\n }\n if ($value != NULL)\n {\n if ($type == 'int')\n {\n $value = intval(unslashes($value));\n }\n else if ($type == 'string')\n {\n $value = unslashes($value);\n }\n else if ($type == 'array')\n {\n foreach ($value as $arrkey => $arrvalue)\n {\n $value[$arrkey] = unslashes($arrvalue);\n }\n }\n }\n return $value;\n}", "public function get($name, $notsetValue = null){\n\t\treturn (isset($_GET[$name]) ? $_GET[$name] : $notsetValue);\n\t}", "public function getFormParam($_search=NULL,$return=NULL){\n if(\n $_search!==NULL &&\n is_string($_search) &&\n strlen(trim($_search)) &&\n NULL!==$this->{$_search}\n ){\n return $this->{$_search};\n }\n return ($return!==NULL)?$return:NULL;\n }", "function url_get_param($name) {\n\tparse_str(parse_url(curPageURL(), PHP_URL_QUERY), $vars);\t\t\n\treturn isset($vars[$name]) ? $vars[$name] : null;\t\n}", "function get_required_param($param)\n{\n global $params;\n\n if (empty($params[$param]))\n {\n header('HTTP/1.0 400 Bad Request');\n die('Invalid Request - Missing \"' . $param . '\"');\n }\n\n return $params[$param];\n}", "function getArgument($argumentName, $defaultArgumentValue = null, $prefixArgumentHeaderName = true, array $excludedSources = [])\n{\n $argumentValue = $defaultArgumentValue;\n\n if (in_array('headers', $excludedSources) === false) {\n // Look for argument in headers\n // Laravel auto-checks for blank or empty values and considers them equal to null\n $argumentHeaderName = $argumentName;\n if ($prefixArgumentHeaderName) {\n $argumentHeaderName = 'x-' . $argumentHeaderName;\n }\n $header = Request::header($argumentHeaderName);\n if ($header !== null) {\n $argumentValue = $header;\n }\n }\n\n if (in_array('input', $excludedSources) === false) {\n // Look for argument in form input (or JSON equivalent) or query string\n // Laravel auto-checks for blank or empty values and considers them equal to null\n if (Input::has($argumentName)) {\n $input = Input::get($argumentName);\n $argumentValue = $input;\n }\n }\n\n return $argumentValue;\n}", "public function getParam($name)\n {\n return isset($_REQUEST[$name]) ? $_REQUEST[$name] : null;\n }", "public static function get($name, $default = null)\r\n {\r\n // checking if the $_REQUEST is set\r\n if(isset($_REQUEST[$name]))\r\n {\r\n return $_REQUEST[$name]; // return the value from $_GET\r\n }\r\n else\r\n {\r\n return $default; // return the default value\r\n }\r\n }", "function get_url_param( $variable, $default='' )\n {\n return !empty( $_GET[ $variable ] )?$_GET[ $variable ]:$default;\n }", "public static function get_input_value($id, $default = NULL) {\n global $TFUSE;\n return ( $TFUSE->request->isset_GET($id) ? $TFUSE->request->GET($id) : $default );\n }", "protected function getValue($name, $default='')\r\n {\r\n if (isset($_GET[$name])) {\r\n return $_GET[$name];\r\n } else {\r\n return $default;\r\n }\r\n }", "protected function getArgument(string $name)\n {\n $this->methodExpectsRequest(__METHOD__);\n $param_infos = $this->getArgumentInfos($name);\n\n if (null === $param_infos) {\n return null;\n }\n $arg = $this->getRequest()->getArg($param_infos['position']);\n return $this->getRequest()->getArg($param_infos['position']);\n }", "public function __get( $name )\n\t{\n\t\treturn $this->input( $name );\n\t}", "function _getParameter( $name, $default='' ) {\n\t\t$return = \"\";\n\t\t$return = $this->params->get( $name, $default );\n\t\treturn $return;\n\t}", "private static function getGetParams()\n\t{\n\t\treturn $_GET;\n\t}", "function GetRequest (&$r, $var, $default = null) {\n\tif (isset($r[$var])) {\n\t\t$val = $r[$var];\n\n\t\t// Deal with special chars in parameters\n\t\t// magic_quotes_gpc is deprecated from php 5.4.0\n\t\tif (version_compare(PHP_VERSION, '5.4.0', '>=')\n\t\t\t|| !get_magic_quotes_gpc())\n\t\t\t$val = AddslashesRecursive($val);\n\t}\n\telse\n\t\t$val = $default;\n\treturn $val;\n}", "function input_request(string $key): ?string\n{\n return \\array_key_exists($key, $_REQUEST) ?\n \\wp_unslash($_REQUEST[$key]) : null;\n}", "function qa_get($field)\n{\n\tif (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }\n\n\treturn isset($_GET[$field]) ? qa_gpc_to_string($_GET[$field]) : null;\n}", "public function get_param($str, $default = null){\n\t\tif(isset($_GET[$str]))\n\t\t{\n\t\t\treturn $_GET[$str];\n\t\t}else if(isset($_POST[$str]))\n\t\t{\n\t\t\treturn $_POST[$str];\n\t\t}{\n\t\t\treturn $default;\n\t\t}\n\t}", "function rget($key, $default=null){\n\treturn isset($_POST[$key]) ? $_POST[$key] : (isset($_GET[$key]) ? $_GET[$key] : $default);\n}", "public static function getParameter($key)\n\t\t{\n\t\t\t$ret='';\n\t\t\tif(isset($_POST[$key]) && !empty($_POST[$key]))\n\t\t\t\t$ret = $_POST[$key];\n\t\t\tif(isset($_GET[$key]) && !empty($_GET[$key]))\n\t\t\t\t$ret = $_GET[$key];\n\t\t\treturn $ret;\n\t\t}", "private static function set($key)\n {\n return (isset($_GET[$key]) && !empty($_GET[$key])) ? $_GET[$key]: null; \n }", "function safe_retrieve_gp($varname, $default='', $null_is_default=false) {\n if ( is_array($_REQUEST) && \n array_key_exists($varname, $_REQUEST) &&\n ( ($_REQUEST[$varname] != null) || (!$null_is_default) ) ) \n return $_REQUEST[$varname];\n return $default;\n}", "public static function isGet($var=''){\n\t\tif(empty($var)){\n\t\t\tif(!empty($_GET)){return TRUE;}\n\t\t}\n\t\telse {\n\t\t\t//check if post variable exist and return value otherwise return empty\n\t\t\tif(!empty($_GET[$var])){\n\t\t\t\treturn trim($_GET[$var]);\n\t\t\t}\n\t\t\telseif(isset($_GET[$var])){return '';}\n\t\t}\n\t\treturn FALSE;\n\t}", "public static function getParameter($name,$default=null) {\n\t if(isset($_REQUEST[$name])) {\n\t $value = $_REQUEST[$name];\n\t return Str::trimAll($value);\n\t }\n\t return $default;\n\t}", "function getGetParam($name,$def=null) {\n if (isset($_GET[$name]))\n return html_entity_decode(htmlentities($_GET[$name],ENT_QUOTES),ENT_NOQUOTES);\n return $def;\n\n }", "public static function get($var = null)\n {\n if(is_null($var))\n {\n return (!empty($_GET)) ? $_GET : null;\n }\n\n return (isset($_GET[$var])) ? $_GET[$var] : null;\n }" ]
[ "0.7337068", "0.7168136", "0.6961514", "0.6951261", "0.69339", "0.69338214", "0.6925814", "0.68035597", "0.67792666", "0.6770444", "0.67551875", "0.67438316", "0.6724946", "0.6712955", "0.6662467", "0.66566205", "0.6631207", "0.66080356", "0.66080314", "0.6571635", "0.6567214", "0.6551984", "0.6543731", "0.65322286", "0.6482457", "0.64783084", "0.64550996", "0.6450144", "0.6449789", "0.64491475", "0.6427806", "0.6427806", "0.64237136", "0.641573", "0.6378199", "0.6348442", "0.63362634", "0.63206744", "0.63162816", "0.6309067", "0.63043267", "0.6292887", "0.627767", "0.62774193", "0.62774193", "0.6273647", "0.6271315", "0.62655777", "0.62615275", "0.6252538", "0.6251448", "0.62382454", "0.62208736", "0.62184054", "0.621277", "0.6210566", "0.6210375", "0.6208235", "0.61929", "0.6189744", "0.6179636", "0.6179582", "0.6155987", "0.61292", "0.612185", "0.60919726", "0.60913867", "0.6070266", "0.60702395", "0.60691875", "0.60691875", "0.60691875", "0.60625696", "0.60545135", "0.6053562", "0.6045466", "0.60322785", "0.6009837", "0.6002753", "0.6002084", "0.5998256", "0.59907085", "0.59898424", "0.5982389", "0.5978347", "0.59770006", "0.59752977", "0.59735394", "0.5973319", "0.596819", "0.5968034", "0.5960146", "0.5958569", "0.59577644", "0.5950118", "0.59447104", "0.59427935", "0.5942102", "0.5939707", "0.59292924", "0.5924052" ]
0.0
-1
/ TODAY'S DATE Function to get todays date.
function today($time=false) { if ($time) return date('Y-m-d-h-i-sa'); else return date('Y-m-d'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTodayDate() {\n\t\t\n\t\treturn date ( \"Y-m-d\" );\n\t}", "function getTodayDay()\n {\n $datetime = new \\DateTime(\"now\");\n return $datetime->format(\"D\");\n }", "public function getTodayDateForThisOrder(){\n \n $today = getdate(mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n $dated = $today['year'].$today['mon'].$today['mday'];\n \n return $dated;\n }", "function todaysDate(){\n echo date('l, F j, Y');\n echo ' at ';\n echo date('h:i:s');\n}", "public function GetTodaysDate()\n\t\t{\n\t\t\t$TodaysSpecialDate = date('Y\\-F\\-d');\n\t\t\treturn $TodaysSpecialDate;\n\t\t}", "public function __datetoday() {\n\t\t\treturn date(\"Y-m-d\");\n\t\t}", "function today() {\n return date(\"Y-m-d\");\n }", "public static function today(){\n\t\treturn date('Y-m-d', time());\n\t}", "public static function today()\n\t{\n\t\treturn floor(time() / 86400);\n\t}", "public static function today()\n {\n return new Date(strtotime(date(\"Y-m-d 00:00:00\")));\n }", "public static function today(): string\n {\n return date(\"Y-m-d\");\n }", "public static function getCurrentDay() {\n return date('d');\n }", "private function getCalculatedDate(){\n date_default_timezone_set('GMT+1');//@todo get the information from system\n\n $oneDay = 86400;//seconds\n $numDays = 7; //default are 7 days\n $today = strtotime('now');\n\n if(!empty($this->settings['flexform']['countDays'])){\n $numDays = $this->settings['flexform']['countDays'];\n }\n\n //calcaulate date\n $date = date(\"d.m.Y\",$today-($numDays * $oneDay));\n\n return $date;\n }", "public function get_today_name(){\n return $today = date('D');\n }", "private function calculateDefaultStartDate()\r\n {\r\n $now = time();\r\n while (date('D', $now) != 'Mon') {\r\n $now -= 86400;\r\n }\r\n\r\n return date('Y-m-d', $now);\r\n }", "function date_today_db() {\n return date('Y-m-d H:i:s'); //in the format yyyy-mm-dd\n}", "function date_today_db() {\n return $today = date('Y-m-d H:i:s'); //in the format yyyy-mm-dd\n}", "public function getFirstDay(){$day = getdate(mktime(0, 0, 0, $this->getMonth(), 1, $this->getYear())); return $day['wday'];}", "function date_now() {\n return date(\"Y-m-d\");\n}", "function getDay(){\r\n return date('l',$this->timestamp);\r\n }", "function getObsoleteToday() {\n $today = getdate();\n $time = mktime(0,0,1,$today['mon'], $today['mday'], $today['year']);\n return $time;\n }", "private function getToday() {\n $now = time() + $this->getGMTOffset();\n return date(\"Y-m-d\", $now) . \" 00:00:00\";\n }", "public static function getCurrentDate() {\n\t\treturn date(\"Y-m-d\");\n\t}", "function getCurrentDate() \n {\n return date( 'd M Y');\n }", "function get_day_name($timestamp) {\r\n $date = date('d/m/Y', $timestamp);\r\n if($date == date('d/m/Y')) {\r\n $day_name = '<strong>Today</strong>,';\r\n }else{\r\n\t\t$day_name = '';\r\n\t}\r\n return $day_name;\r\n}", "function FriendlyDateFromTo($p_from,$p_to) {\n\t$v_from=DateToSeconds($p_from);\n\t$v_to=DateToSeconds($p_to);\n\n\t/* SPLIT THE DATES ABOVER INTO AN ARRAY */\n\t$v_arr_from = split('[- :]', $p_from);\n\t$v_arr_to = split('[- :]', $p_to);\n\n\t/* CHECK IF IT'S TODAY */\n\t$v_yesterday=mktime(0, 0, 0, date(\"m\") , date(\"d\")-1, date(\"Y\"));\n\t$v_tomorrow=mktime(0, 0, 0, date(\"m\") , date(\"d\")+1, date(\"Y\"));\n\tif ($v_from>$v_yesterday && $v_to<$v_tomorrow && ($v_from-$v_to) < 86400) {\n\t\treturn \"Today \".$v_arr_from[3].\":\".$v_arr_from[4].\" to \".$v_arr_to[3].\":\".$v_arr_to[4];\n\t}\n\telse {\n\t\treturn Date(\"D\",$v_from).\" \".Date(\"j\",$v_from).\" \".Date(\"M\",$v_from).\" \".$v_arr_from[3].\":\".$v_arr_from[4].\" to \".Date(\"D\",$v_to).\" \".Date(\"j\",$v_from).\" \".Date(\"M\",$v_from).\" \".$v_arr_to[3].\":\".$v_arr_to[4];\n\t}\n\n}", "function returnDay($date){\r\n\t\t$Newddate = explode(\" \",$date);\r\n $Newddate = substr($Newddate[0],0, 10);\r\n\t\t//$day = date('l', $Newdate);\r\n\t\t$day = date(\"l\", strtotime($Newddate));\r\n return($day);\r\n }", "function date_day($date){\r\n\t$day = NULL;\r\n\tfor($i = 0; $i < strlen($date); $i++){\r\n\t\tif(is_numeric(substr($date, $i, 1))){\r\n\t\t\t$day .= substr($date, $i, 1);\r\n\t\t}else{\r\n\t\t\treturn $day;\r\n\t\t}\r\n\t}\r\n\treturn $day;\r\n}", "function currentDate() {\n echo date('Y-m-d');\n}", "function day($day= 1)\n{\n return $day * 24 * 60 *60;\n}", "function getnow() {\n\t$dt = date('Y-m-d');\n\treturn $dt;\n}", "function addOneDay($currentDay)\n {\n if ( empty($currentDay) ) {\n $currentDay = date('Y-m-d');\n }\n\n $nextDate = strtotime ( '+ 1 day' , strtotime ( $currentDay ) ) ;\n $nextDate = date ( 'Y-m-d' , $nextDate );\n\n return $nextDate;\n }", "public static function yesterday()\n {\n return new Date(strtotime(\"yesterday\"));\n }", "function the_weekday_date($before = '', $after = '')\n {\n }", "public function calculateDay()\r\n {\r\n return date('N', strtotime($this->getDate())) - 1;\r\n }", "function add_day($date, $day = 1) { \n\t$date = strtotime('+' . $day . ' day', strtotime($date));\n\treturn date('Y-m-d', $date);\n}", "function get_day_of_week($day)\n{\n return jddayofweek($day, 1);\n}", "public function isToday(){\n\t\tif($this->_date==date('Y-m-d')){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "private function getDayDate($day)\n {\n $day = intval($day);\n $y = $this->year;\n $m = intval($this->month);\n $m = $m < 10 ? '0' . $m : $m;\n $d = intval($day);\n $d = $d < 10 ? '0' . $d : $d;\n $date = $y . '-' . $m . '-' . $d;\n return $date;\n }", "public function getDayOfTheWeek();", "function get_today()\n{\n\t$query = $this->db->get('site');\n\t$row = $query->row();\n\t$today = $row->today;\n\t\n\treturn $today;\n\n}", "public static function yersterday(): string\n {\n $d = new DateTime;\n $i = new DateInterval(\"P1D\");\n $d->sub($i);\n return $d->format(\"Y-m-d\");\n }", "function get_date($day, $year) {\n\t\t\t\t\n\t\t\t\t$number_date = date('D d F, Y', mktime(0, 0, 0, 0+1, $day, $year));\n\t\t\t\t\n\t\t\t\treturn $number_date;\n\t\t\t\n\t\t\t}", "function get_day()\n {\n $datearray=getdate($this->timestamp);\n return $datearray[\"mday\"];\n }", "function get_mnt_strt_day($cur_date,$type){\n $date_split=split(\"-\",$cur_date);\n if ($type=='1'){\n // Return format \"0\" (Sunday) to \"6\" (Saturday)\n return date(\"w\",mktime (0,0,0,$date_split[1],1,$date_split[2]));}\n elseif ($type=='2'){\n // Return Fri format \n return date(\"D\",mktime (0,0,0,$date_split[1],1,$date_split[2]));}\n elseif ($type=='3'){\n // Return Friday format\n return date(\"l\",mktime (0,0,0,$date_split[1],1,$date_split[2]));}\n }", "function fecha_actual()\n{\n\t$db = getDBConnection();\n \t$stmt = $db->prepare('SELECT CURDATE()');\n \t$stmt->execute();\n \t$r = $stmt->fetch(PDO::FETCH_ASSOC);\n \tif ($r) {\n \t\treturn $r['CURDATE()'];\n \t}else{\n \t\treturn false;\n \t}\n}", "public static function getDay($date) {\r\n if (gettype($date) == 'string') {\r\n $laDate = new \\DateTime($date);\r\n }\r\n else {\r\n $laDate = $date;\r\n }\r\n return $laDate->format('d');\r\n }", "function sysdate()\n\t\t{\n\t\t\treturn 'now';\t\t\t\n\t\t}", "public static function getFirstDayOfGivenDate($date)\n\t{\n\t\t$full_date = explode('-', $date);\n\t\t$year = $full_date[0];\n\t\t$month = $full_date[1];\n\t\t$day = $full_date[2];\n\t\t\n\t\t$dateInSeconds = mktime(0, 0, 0, $month, 1, $year);\n\t\t$date = date('Y-m-d', $dateInSeconds);\n\t\treturn $date;\n\t}", "public function current_date_db(){\n\t\t$date = date('Y-m-d');\n\t\treturn $date;\n\t}", "function getFecha(){\n\t\t\treturn date(\"Y-m-d H:i:s\");\n\t}", "function date_day($date_or_day,$lang='en') {\n\t\tif(!is_string($date_or_day) OR !is_numeric($date_or_day)) {\n\t\t\t//convert date to days difference\n\t\t}\n\t\tif($date_or_day == 0) {\n\t\t\treturn ($lang=='en')? \"today\" : \"hoy\";\n\t\t} elseif($date_or_day == -1) {\n\t\t\treturn ($lang=='en')? \"yesterday\" : \"ayer\";\n\t\t} elseif($date_or_day == 1) {\n\t\t\treturn ($lang=='en')? \"tomorrow\" : \"mañana\";\n\t\t} elseif($date_or_day < 0) {\n\t\t\tif($lang=='en') {\n\t\t\t\treturn abs($date_or_day).\" days ago\";\n\t\t\t} else {\n\t\t\t\treturn \"hace \".abs($date_or_day).\" días\";\n\t\t\t}\n\t\t} else {\n\t\t\tif($lang=='en') {\n\t\t\t\treturn \"in \".$date_or_day.\" days\";\n\t\t\t} else {\n\t\t\t\treturn \"en \".$date_or_day.\" días\";\n\t\t\t}\n\t\t}\n\t}", "public static function today(){\n $date = date('d');\n return Bitacora::latest()->whereDay('created_at', $date)->count();\n }", "function getCurrentDayInMonthNumber ()\n\t{\n\t\treturn date ('j');\n\t}", "function Fecha_estandar($IngresoFecha){\t\n$date = date_create($IngresoFecha);\nreturn date_format($date, 'd-m-Y');\n}", "public function getCurrentDate()\n\t{\n\t\techo date(\"Y-m-d\");\t\n\t\n\t}", "function today($tz = null)\n {\n return Carbon::today($tz);\n }", "function firstDayOfWeek($year,$month,$day){\n global $fd;\n $dayOfWeek=date(\"w\");\n $sunday_offset=$dayOfWeek * 60 * 60 * 24;\n $fd = date(\"Y-m-d\", mktime(0,0,0,$month,$day+1,$year) - $sunday_offset);\n return $fd;\n}", "public function dayOfTheWeek($fecha){\n $i = strtotime($fecha);\n $day= jddayofweek(cal_to_jd(CAL_GREGORIAN, date(\"m\",$i),date(\"d\",$i), date(\"Y\",$i)) , 0 );\n return $day;\n }", "function getCurrentDate()\n\t\t{\n\t\t\t$date = date('y-m-d');\n\t\t\treturn $date;\n\t\t}", "private function dateDuJour(){\n return date(\"Y-m-d\");\n }", "protected function get_todaybo($iSize=14)\n {\n switch ($iSize)\n {\n case 14:\n return date(\"d/m/Y H:i:s\");\n break;\n case 12:\n return date(\"d/m/Y H:i\");\n break;\n default:\n return date(\"d/m/Y\");\n break;\n }\n }", "function human_date_today()\n{\n /*\n * other options\n *\n$today = date(\"F j, Y, g:i a\"); // March 10, 2001, 5:16 pm\n$today = date(\"m.d.y\"); // 03.10.01\n$today = date(\"j, n, Y\"); // 10, 3, 2001\n$today = date(\"Ymd\"); // 20010310\n$today = date('h-i-s, j-m-y, it is w Day'); // 05-16-18, 10-03-01, 1631 1618 6 Satpm01\n$today = date('\\i\\t \\i\\s \\t\\h\\e jS \\d\\a\\y.'); // It is the 10th day (10ème jour du mois).\n$today = date(\"D M j G:i:s T Y\"); // Sat Mar 10 17:16:18 MST 2001\n$today = date('H:m:s \\m \\e\\s\\t\\ \\l\\e\\ \\m\\o\\i\\s'); // 17:03:18 m est le mois\n$today = date(\"H:i:s\"); // 17:16:18\n$today = date(\"Y-m-d H:i:s\"); // 2001-03-\n */\n\n return date('l jS F Y');\n}", "public function isToday()\n {\n \t$today = new Tiramizoo_Shipping_Model_Date();\n \treturn $this->get('Y-m-d') == $today->get('Y-m-d');\n }", "function mysql_date($tiempo = 'now'){\r\n return date( 'Y-m-d',strtotime($tiempo) );\r\n}", "function getDay($dayIndex)\n{\n return date('l', strtotime(\"Sunday +{$dayIndex} days\"));\n}", "function getFirstDayOfDate(string $date): string {\n $d = new DateTime($date);\n $d->modify('first day of this month');\n return $d->format('Y-m-d');\n}", "public static function tomorrow(): string\n {\n $d = new DateTime;\n $i = new DateInterval(\"P1D\");\n $d->add($i);\n return $d->format(\"Y-m-d\");\n }", "public function getDay() : string\n {\n return date('d', $this->getUnixTimestamp());\n }", "public static function getFirstDayOfCurrentMonth()\n\t{\n\t\t$dateInSeconds = mktime(0, 0, 0, date('m'), 1, date('Y'));\n\t\t$date = date('Y-m-01', $dateInSeconds);\n\t\treturn $date;\n\t}", "public static function today(DB $db)\n {\n return static::fromFormat($db, [\n 'mysql' => \"CURDATE()\",\n 'sqlite' => \"DATE()\"\n ]);\n }", "public function date()\n {\n\n $date = date(\"Y-m-d\");\n\n $date = strtotime($date . \"-30 days\");\n\n $date = date('Y-m-d', $date);\n\n return $date;\n }", "function internationalDate($todate)\n\t{\n\t\t$myDate=date_create($todate);\n\t\treturn date_format($myDate, \"m/d/y\");\n\t}", "public function isToday()\n {\n return $this->toString('Y-m-d') === Date::factory('today', $this->timezone)->toString('Y-m-d');\n }", "public static function now() {\n\t\t\treturn date('Y-m-d');\n\t\t}", "function authCAS_getMyCurrentDate()\n{\n\treturn G::CurDate('Y-m-d');\n}", "function getDate( $date='' ) {\r\n\t\t\t$date = $this->_getDateOrTime( $date, $this->_fmtDate );\r\n\t\t\tif ( $date == 'null' ) {\r\n\t\t\t\treturn $date;\r\n\t\t\t} else {\r\n\t\t\t\treturn 'TO_DATE ( \\'' . $date . '\\', \\'YYYY-MM-DD\\' )';\r\n\t\t\t}\r\n\t\t}", "function fixday($s,$i){\n\treturn $n = mktime(0,0,0,date(\"m\",$s) ,date(\"d\",$s)+$i,date(\"Y\",$s));\n}", "public static function isToday($date)\n {\n return date('Y-m-d', $date) == date('Y-m-d', time());\n }", "public function currentDate()\n {\n return today()->format('Ymd');\n }", "function getNextDay(){\r\n $dia = Data_Calc::proxDia($this->dia, $this->mes, $this->ano, \"%Y-%m-%d\");\r\n $data = sprintf(\"%s %02d:%02d:%02d\", $dia, $this->hora, $this->minuto, $this->segundo);\r\n $newDate = new Date();\r\n $newDate->setData($data);\r\n return $newDate;\r\n }", "public function date();", "public function date();", "function int_to_day($int){\n\tglobal $days;\n\treturn $days[$int];\n}", "function sumDayToDate($date,$days){\n\t$date = date_create($date);\n\tdate_add($date, date_interval_create_from_date_string($days));\n\t\n\treturn date_format($date, 'Y-m-d H:i:s');\n}", "function get_dy_nxt($cur_date){\n $date_split=split(\"-\",$cur_date);\n return date(\"d-m-Y\",mktime (0,0,0,$date_split[1],($date_split[0]+ 1),$date_split[2]));\n }", "public function getDay($leadingZero = false)\r\n\t{\r\n\t\tif ($leadingZero)\r\n\t\t{\r\n\t\t\treturn $this->format('d');\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn $this->format('j');\r\n\t\t}\r\n\t}", "function next_day(&$offset)\n\t{\n\t\tdo\n\t\t{\n\t\t\t$offset++;\n\t\t}\n\t\twhile(\n\t\t\tin_array(gmdate('D', gmmktime() + ($offset * 24 * 60 * 60)), array('Sat', 'Sun'))\n\t\t\t||\n\t\t\tin_array(gmdate('Y-m-d', gmmktime() + ($offset * 24 * 60 * 60)), $GLOBALS['config']['non-work_dates'])\n\t\t);\n\t\treturn gmdate('Y-m-d', gmmktime() + ($offset * 24 * 60 * 60));\t\t\n\t}", "function _data_first_month_day() {\r\n $month = date('m');\r\n $year = date('Y');\r\n return date('d/m/Y', mktime(0,0,0, $month, 1, $year));\r\n }", "function fecha($cadena){\n\t\treturn date($cadena);\n\t}", "public function check_today_working_day()\n {\n $stmt = 'Select Count(*)\n From t_cores_calendar\n Where C_OFF=0\n And Datediff(day, getDate(), C_DATE)=0';\n return $this->db->getOne($stmt);\n }", "function getSomeDayFromDay($currentDay, $number)\n {\n if ( $number == 0 ) {\n return $tmpDates[$currentDay] = $currentDay;\n }\n\n $tmpDates = array();\n $newdate = '';\n for ( $i = $number; $i >= 1; $i-- ) {\n $newdate = strtotime ( '-' . $i . ' day' , strtotime ( $currentDay ) ) ;\n $newdate = date ( 'Y-m-j' , $newdate );\n $tmpDates[$newdate] = $newdate;\n }\n $tmpDates[$currentDay] = $currentDay;\n for ( $i = 1; $i <= $number; $i++ ) {\n $newdate = strtotime ( '+' . $i . ' day' , strtotime ( $currentDay ) ) ;\n $newdate = date ( 'Y-m-j' , $newdate );\n $tmpDates[$newdate] = $newdate;\n }\n\n return $tmpDates;\n }", "public static function currdate()\n {\n $now = Carbon::now() -> toDateTimeString();\n $erase = substr($now, -3);\n $now = str_replace($erase, '', $now);\n $now = str_replace(' ', 'T', $now);\n return $now;\n }", "public static function now ()\n\t\t{\n\t\t\treturn date(self::$dtFormat);\n\t\t}", "function currentDate(){\n\t$date = date(\"Y-m-d H:i:s\");\n\treturn $date;\n}", "public function getInputDateNow($data)\n {\n $query = \"SELECT DAY(input_date) FROM \".$this->table.\" WHERE id_baru=0 AND tid=:tid\";\n\n $this->db->query($query);\n\n $this->db->bind('tid', $data);\n\n return $this->db->single();\n }", "function somarDatas($data,$dias){\n\t$data_final = date('Y-m-d', strtotime(\"$dias days\",strtotime($data)));\t\n\treturn $data_final;\n\t\n}", "function nl_date( $sql_date ) {\n\t\n\t$timestamp = strtotime($sql_date); //UNIX TIMESTAMP OF SQL DATE\n\t$now = time(); //UNIX TIMESTAMP OF NOW\n\t\n\t\n\t//sees if the thing is on TODAY's date\n\t$format_today_compare = strftime(\"%b %e\", $now);\n\t$format_date_compare = strftime(\"%b %e\", $timestamp);\n\t\n\t$tomorrow = mktime(0,0,0,date(\"m\"),date(\"d\")+1,date(\"Y\"));\n\t\n\tif ($format_today_compare == $format_date_compare) { //IS IT TODAY\n\t\t$formatteddate = \"TONIGHT\";\n\t}\n\telse if (strftime (\"%b %e\", $tomorrow) == strftime (\"%b %e\", $timestamp)) { //IS IT TOMORROW\n\t\t$formatteddate = \"TOMORROW\";\n\t} else if ( $timestamp - $now < 432000 && $timestamp - $now > 0) { //IS IT THIS WEEK?\n\t\t//then it's within a week\n\t\t$format = \"%A\";\n\t\t$formatteddate = strftime ($format, $timestamp);\n\t} else {\n\t\t//then it's over a week\n\t\t$format = \"%a, %b %e\";\n\t\t$formatteddate = strftime ($format, $timestamp);\n\t}\n\t\n\treturn strtoupper($formatteddate);\n\t\n}", "function restar_dias_a_una_fecha($dia,$mes,$anio,$numdias){\r\nif (!checkdate($mes,$dia,$anio)) die(\"error en restar_dias_a_una_fecha() - Se le ha mandado a la función una fecha incorrecta\");\r\n$fecha=mktime ( 0,0,0, $mes,$dia-$numdias,$anio);\r\nreturn date( \"Y-m-d\", $fecha);\r\n}", "public function dateCreate($dt) {\n\t\t$date=date_create($dt);\n\t\treturn $newdta = date_format($date,\"l,F j Y\");\n\t}" ]
[ "0.7215615", "0.7178301", "0.7169234", "0.7104801", "0.7092454", "0.6978201", "0.6872617", "0.6713677", "0.66001374", "0.65081006", "0.6463704", "0.64011353", "0.609335", "0.6025549", "0.59844065", "0.59547585", "0.5953601", "0.5944659", "0.58817846", "0.58641165", "0.5861568", "0.5813787", "0.5719976", "0.5712875", "0.5705895", "0.56775475", "0.567363", "0.5655188", "0.56166124", "0.56100166", "0.5586938", "0.5572966", "0.5559081", "0.5557187", "0.55553234", "0.5548107", "0.5546644", "0.55460423", "0.55355185", "0.5524068", "0.5518058", "0.54967344", "0.54951507", "0.54863113", "0.5484299", "0.5476799", "0.5461832", "0.5460561", "0.54467225", "0.5445287", "0.54425824", "0.5436325", "0.54331243", "0.5429494", "0.5423317", "0.5422291", "0.54166883", "0.54135275", "0.5408355", "0.54018784", "0.53856385", "0.538184", "0.53782177", "0.5367464", "0.53637224", "0.53612226", "0.5355864", "0.5349951", "0.53409755", "0.53400624", "0.5336953", "0.53336746", "0.5323872", "0.53235924", "0.53223544", "0.5315765", "0.5300821", "0.528604", "0.5281015", "0.52779555", "0.52758896", "0.5272065", "0.5272065", "0.52653456", "0.52652663", "0.5252346", "0.52469236", "0.5237072", "0.52333224", "0.5231243", "0.5224232", "0.5221219", "0.521818", "0.52113193", "0.519993", "0.51992273", "0.5198354", "0.51919764", "0.5187675", "0.5180902" ]
0.631489
12
/ GET REAL IP OF USER
function get_ip() { $ip='0.0.0.0'; if (!empty($_SERVER['HTTP_CLIENT_IP'])) //check ip from share internet { $ip=$_SERVER['HTTP_CLIENT_IP']; } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) //to check ip is pass from proxy { $ip=$_SERVER['HTTP_X_FORWARDED_FOR']; } elseif (isset($_SERVER['REMOTE_ADDR'])) { $ip=$_SERVER['REMOTE_ADDR']; } return $ip; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getUserIP()\n\t\t\t{\n\t\t\t\tif (array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER) && !empty($_SERVER['HTTP_X_FORWARDED_FOR']))\n\t\t\t\t\t\tif (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',') > 0):\n\t\t\t\t\t\t\t\t$addr = explode(\",\",$_SERVER['HTTP_X_FORWARDED_FOR']);\n\t\t\t\t\t\t\t\treturn trim($addr[0]);\n\t\t\t\t\t\t\telse:\n\t\t\t\t\t\t\t\treturn $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t\t\t\t\tendif;\n\t\t\t\t\telse\n\t\t\t\t\t\treturn $_SERVER['REMOTE_ADDR'];\n\t\t\t\t}", "function getUserIp(){\n switch(true){\n case (!empty($_SERVER['HTTP_X_REAL_IP'])): \n return $_SERVER['HTTP_X_REAL_IP'];\n break;\n \n case (!empty($_SERVER['HTTP_CLIENT_IP'])): \n return $_SERVER['HTTP_CLIENT_IP'];\n break;\n \n case (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])): \n return $_SERVER['HTTP_X_FORWARDED_FOR'];\n break;\n \n default : \n return $_SERVER['REMOTE_ADDR'];\n }\n }", "function getRealIpUser()\r\n\t{\r\n\t\tswitch(true)\r\n\t\t{\r\n\t\t\tcase(!empty($_SERVER['HTTP_X_REAL_IP'])) : return $SERVER['HTTP_X_REAL_IP'];\r\n\t\t\tcase(!empty($_SERVER['HTTP_CLIENT_IP'])) : return $SERVER['HTTP_CLIENT_IP'];\r\n\t\t\tcase(!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) : return $SERVER['HTTP_X_FORWARDED_FOR'];\r\n\r\n\t\t\tdefault : return $_SERVER['REMOTE_ADDR'];\r\n\t\t\t \r\n\t\t}\r\n\t}", "function getRealUserIp(){\n switch(true){\n case (!empty($_SERVER['HTTP_X_REAL_IP'])) : return $_SERVER['HTTP_X_REAL_IP'];\n case (!empty($_SERVER['HTTP_CLIENT_IP'])) : return $_SERVER['HTTP_CLIENT_IP'];\n case (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) : return $_SERVER['HTTP_X_FORWARDED_FOR'];\n default : return $_SERVER['REMOTE_ADDR'];\n }\n }", "function getRealIpUser(){\r\n \r\n switch(true){\r\n \r\n case(!empty($_SERVER['HTTP_X_REAL_IP'])) : return $_SERVER['HTTP_X_REAL_IP'];\r\n case(!empty($_SERVER['HTTP_CLIENT_IP'])) : return $_SERVER['HTTP_CLIENT_IP'];\r\n case(!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) : return $_SERVER['HTTP_X_FORWARDED_FOR'];\r\n \r\n default : return $_SERVER['REMOTE_ADDR'];\r\n \r\n }\r\n \r\n}", "function getUserIP() {\n\t\treturn t3lib_div::getIndpEnv('REMOTE_ADDR');\n\t}", "function getRealIpUser(){\n\n switch(true){\n\n case(!empty($_SERVER['HTTP_X_REAL_IP'])) : return $_SERVER['HTTP_X_REAL_IP'];\n case(!empty($_SERVER['HTTP_CLIENT_IP'])) : return $_SERVER['HTTP_CLIENT_IP'];\n case(!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) : return $_SERVER['HTTP_X_FORWARDED_FOR'];\n\n default : return $_SERVER['REMOTE_ADDR'];\n }\n\n}", "function get_user_ip() {\n\t\tif($_SERVER['SERVER_NAME'] == 'localhost') {\n\t\t\treturn '127.0.0.1';\n\t\t}\n\t\treturn $_SERVER['REMOTE_ADDR'];\n\t}", "function getUserIPAddress(){\n\tif(!empty($_SERVER['HTTP_CLIENT_IP'])){\n\t\t//ip from share internet\n\t\t$ip = $_SERVER['HTTP_CLIENT_IP'];\n\t}elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){\n\t\t//ip pass from proxy\n\t\t$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t}else{\n\t\t$ip = $_SERVER['REMOTE_ADDR'];\n\t}\n\treturn $ip;\n}", "private function getUserIP()\n {\n $iph = $this->app->make('helper/validation/ip');\n $ip = $iph->getRequestIP();\n\n return $ip->getIP(IPAddress::FORMAT_IP_STRING);\n }", "function getUserIP() {\n\tif (array_key_exists ( 'HTTP_X_FORWARDED_FOR', $_SERVER ) && ! empty ( $_SERVER ['HTTP_X_FORWARDED_FOR'] )) {\n\t\tif (strpos ( $_SERVER ['HTTP_X_FORWARDED_FOR'], ',' ) > 0) {\n\t\t\t$addr = explode ( \",\", $_SERVER ['HTTP_X_FORWARDED_FOR'] );\n\t\t\treturn trim ( $addr [0] );\n\t\t} else {\n\t\t\treturn $_SERVER ['HTTP_X_FORWARDED_FOR'];\n\t\t}\n\t} else {\n\t\treturn $_SERVER ['REMOTE_ADDR'];\n\t}\n}", "function getRealUserIp()\n{\n switch (true) {\n case (!empty($_SERVER['HTTP_X_REAL_IP'])):\n return $_SERVER['HTTP_X_REAL_IP'];\n case (!empty($_SERVER['HTTP_CLIENT_IP'])):\n return $_SERVER['HTTP_CLIENT_IP'];\n case (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])):\n return $_SERVER['HTTP_X_FORWARDED_FOR'];\n default:\n return $_SERVER['REMOTE_ADDR'];\n }\n}", "function getRealUserIp() {\n $ipaddress = '';\n if (isset($_SERVER['HTTP_CLIENT_IP']))\n $ipaddress = $_SERVER['HTTP_CLIENT_IP'];\n else if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))\n $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\n else if(isset($_SERVER['HTTP_X_FORWARDED']))\n $ipaddress = $_SERVER['HTTP_X_FORWARDED'];\n else if(isset($_SERVER['HTTP_FORWARDED_FOR']))\n $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];\n else if(isset($_SERVER['HTTP_FORWARDED']))\n $ipaddress = $_SERVER['HTTP_FORWARDED'];\n else if(isset($_SERVER['REMOTE_ADDR']))\n $ipaddress = $_SERVER['REMOTE_ADDR'];\n else\n $ipaddress = 'UNKNOWN';\n\n return $ipaddress; \n}", "public static function _getUserIpAddr ()\n {\n $ip = 'unknown.ip.address';\n if(isset($_SERVER)){\n\t if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) // If server is behind a load balancer\n\t\t\t{\n\t $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t } elseif (!empty($_SERVER['REMOTE_ADDR'])) {\n\t $ip = $_SERVER['REMOTE_ADDR'];\n\t }\n\t }\n return $ip;\n }", "function user_ip () {\r\n\treturn $_SERVER['REMOTE_ADDR'];\r\n}", "public function find_users_ip(){\n\t\tif ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) ) {\n\t\t\t//check ip from share internet\n\t\t\t$ip = $_SERVER['HTTP_CLIENT_IP'];\n\t\t} elseif ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {\n\t\t\t//to check ip is pass from proxy\n\t\t\t$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t} else {\n\t\t\t$ip = $_SERVER['REMOTE_ADDR'];\n\t\t}\n\t\treturn $ip;\n\t}", "private function get_user_ip() {\n\t\tif ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) ) {\n\t\t\t$ip = $_SERVER['HTTP_CLIENT_IP'];\n\t\t} elseif ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {\n\t\t\t$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t} else {\n\t\t\t$ip = $_SERVER['REMOTE_ADDR'];\n\t\t}\n\t\treturn apply_filters( 'dwqa_get_ip', $ip );\n\t}", "public function getUserIP()\n {\n return isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : null;\n }", "function GetUserIp() {\r\n $client = @$_SERVER['HTTP_CLIENT_IP'];\r\n $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];\r\n $remote = $_SERVER['REMOTE_ADDR'];\r\n if(filter_var($client, FILTER_VALIDATE_IP)) { $ip = $client; }\r\n elseif(filter_var($forward, FILTER_VALIDATE_IP)) { $ip = $forward; } else { $ip = $remote; }\r\n return $ip;\r\n }", "public function getUserIp()\n {\n return $this->remoteAddress->getRemoteAddress();\n }", "public static function getUserIP()\n {\n if(!empty($_SERVER['HTTP_CLIENT_IP'])){\n //ip from share internet\n $ip = $_SERVER['HTTP_CLIENT_IP'];\n }\n elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){\n //ip pass from proxy\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n else {\n $ip = $_SERVER['REMOTE_ADDR'];\n }\n\n return $ip;\n }", "function get_user_IP(){\n\t\tif (isset($_SERVER[\"HTTP_CF_CONNECTING_IP\"])) {\n\t\t\t$_SERVER['REMOTE_ADDR'] = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\n\t\t\t$_SERVER['HTTP_CLIENT_IP'] = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\n\t\t}\n\t\t$client = @$_SERVER['HTTP_CLIENT_IP'];\n\t\t$forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t$remote = $_SERVER['REMOTE_ADDR'];\n\n\t\tif(filter_var($client, FILTER_VALIDATE_IP)){\n\t\t\t$ip = $client;\n\t\t}elseif(filter_var($forward, FILTER_VALIDATE_IP)){\n\t\t\t$ip = $forward;\n\t\t} else {\n\t\t\t$ip = $remote;\n\t\t}\n\t\treturn $ip;\n\t}", "public static function getUserIP()\n {\n return isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : null;\n }", "function getUserIP() {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$ipaddress = '';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif (isset($_SERVER['HTTP_CLIENT_IP']))\n\t\t\t\t\t\t\t\t \t $ipaddress = $_SERVER['HTTP_CLIENT_IP'];\n\t\t\t\t\t\t\t\t else if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))\n\t\t\t\t\t\t\t\t \t $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t\t\t\t\t\t\t else if(isset($_SERVER['HTTP_X_FORWARDED']))\n\t\t\t\t\t\t\t\t\t $ipaddress = $_SERVER['HTTP_X_FORWARDED'];\n\t\t\t\t\t\t\t\t else if(isset($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']))\n\t\t\t\t\t\t\t\t\t $ipaddress = $_SERVER['HTTP_X_CLUSTER_CLIENT_IP'];\n\t\t\t\t\t\t\t\t else if(isset($_SERVER['HTTP_FORWARDED_FOR']))\n\t\t\t\t\t\t\t\t\t $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];\n\t\t\t\t\t\t\t\t else if(isset($_SERVER['HTTP_FORWARDED']))\n\t\t\t\t\t\t\t\t $ipaddress = $_SERVER['HTTP_FORWARDED'];\n\t\t\t\t\t\t\t\t\telse if(isset($_SERVER['REMOTE_ADDR']))\n\t\t\t\t\t\t\t\t\t $ipaddress = $_SERVER['REMOTE_ADDR'];\n\t\t\t\t\t\t\t\t\t else\n\t\t\t\t\t\t\t\t\t $ipaddress = 'UNKNOWN';\n\t\t\t\t\t\t\t\t return $ipaddress;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}", "function getUserIP() {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$ipaddress = '';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif (isset($_SERVER['HTTP_CLIENT_IP']))\n\t\t\t\t\t\t\t\t \t $ipaddress = $_SERVER['HTTP_CLIENT_IP'];\n\t\t\t\t\t\t\t\t else if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))\n\t\t\t\t\t\t\t\t \t $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t\t\t\t\t\t\t else if(isset($_SERVER['HTTP_X_FORWARDED']))\n\t\t\t\t\t\t\t\t\t $ipaddress = $_SERVER['HTTP_X_FORWARDED'];\n\t\t\t\t\t\t\t\t else if(isset($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']))\n\t\t\t\t\t\t\t\t\t $ipaddress = $_SERVER['HTTP_X_CLUSTER_CLIENT_IP'];\n\t\t\t\t\t\t\t\t else if(isset($_SERVER['HTTP_FORWARDED_FOR']))\n\t\t\t\t\t\t\t\t\t $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];\n\t\t\t\t\t\t\t\t else if(isset($_SERVER['HTTP_FORWARDED']))\n\t\t\t\t\t\t\t\t $ipaddress = $_SERVER['HTTP_FORWARDED'];\n\t\t\t\t\t\t\t\t\telse if(isset($_SERVER['REMOTE_ADDR']))\n\t\t\t\t\t\t\t\t\t $ipaddress = $_SERVER['REMOTE_ADDR'];\n\t\t\t\t\t\t\t\t\t else\n\t\t\t\t\t\t\t\t\t $ipaddress = 'UNKNOWN';\n\t\t\t\t\t\t\t\t return $ipaddress;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}", "function getUserIP() {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$ipaddress = '';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif (isset($_SERVER['HTTP_CLIENT_IP']))\n\t\t\t\t\t\t\t\t \t $ipaddress = $_SERVER['HTTP_CLIENT_IP'];\n\t\t\t\t\t\t\t\t else if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))\n\t\t\t\t\t\t\t\t \t $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t\t\t\t\t\t\t else if(isset($_SERVER['HTTP_X_FORWARDED']))\n\t\t\t\t\t\t\t\t\t $ipaddress = $_SERVER['HTTP_X_FORWARDED'];\n\t\t\t\t\t\t\t\t else if(isset($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']))\n\t\t\t\t\t\t\t\t\t $ipaddress = $_SERVER['HTTP_X_CLUSTER_CLIENT_IP'];\n\t\t\t\t\t\t\t\t else if(isset($_SERVER['HTTP_FORWARDED_FOR']))\n\t\t\t\t\t\t\t\t\t $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];\n\t\t\t\t\t\t\t\t else if(isset($_SERVER['HTTP_FORWARDED']))\n\t\t\t\t\t\t\t\t $ipaddress = $_SERVER['HTTP_FORWARDED'];\n\t\t\t\t\t\t\t\t\telse if(isset($_SERVER['REMOTE_ADDR']))\n\t\t\t\t\t\t\t\t\t $ipaddress = $_SERVER['REMOTE_ADDR'];\n\t\t\t\t\t\t\t\t\t else\n\t\t\t\t\t\t\t\t\t $ipaddress = 'UNKNOWN';\n\t\t\t\t\t\t\t\t return $ipaddress;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}", "function getUserIP() {\n $ipaddress = '';\n if (isset($_SERVER['HTTP_CLIENT_IP']))\n $ipaddress = $_SERVER['HTTP_CLIENT_IP'];\n else if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))\n $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\n else if(isset($_SERVER['HTTP_X_FORWARDED']))\n $ipaddress = $_SERVER['HTTP_X_FORWARDED'];\n else if(isset($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']))\n $ipaddress = $_SERVER['HTTP_X_CLUSTER_CLIENT_IP'];\n else if(isset($_SERVER['HTTP_FORWARDED_FOR']))\n $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];\n else if(isset($_SERVER['HTTP_FORWARDED']))\n $ipaddress = $_SERVER['HTTP_FORWARDED'];\n else if(isset($_SERVER['REMOTE_ADDR']))\n $ipaddress = $_SERVER['REMOTE_ADDR'];\n else\n $ipaddress = 'UNKNOWN';\n return $ipaddress;\n}", "function getUserIpAddr()\r\n{\r\n if(!empty($_SERVER['HTTP_CLIENT_IP'])){\r\n //ip from share internet\r\n $ip = $_SERVER['HTTP_CLIENT_IP'];\r\n }elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){\r\n //ip pass from proxy\r\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\r\n }else{\r\n $ip = $_SERVER['REMOTE_ADDR'];\r\n }\r\n return $ip;\r\n}", "static function getIP()\r\n {\r\n return self::getRemoteIP();\r\n }", "function getUserIP() {\r\n $ipaddress = '';\r\n if (isset($_SERVER['HTTP_CLIENT_IP']))\r\n $ipaddress = $_SERVER['HTTP_CLIENT_IP'];\r\n else if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))\r\n $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\r\n else if(isset($_SERVER['HTTP_X_FORWARDED']))\r\n $ipaddress = $_SERVER['HTTP_X_FORWARDED'];\r\n else if(isset($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']))\r\n $ipaddress = $_SERVER['HTTP_X_CLUSTER_CLIENT_IP'];\r\n else if(isset($_SERVER['HTTP_FORWARDED_FOR']))\r\n $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];\r\n else if(isset($_SERVER['HTTP_FORWARDED']))\r\n $ipaddress = $_SERVER['HTTP_FORWARDED'];\r\n else if(isset($_SERVER['REMOTE_ADDR']))\r\n $ipaddress = $_SERVER['REMOTE_ADDR'];\r\n else\r\n $ipaddress = 'UNKNOWN';\r\n return $ipaddress;\r\n}", "function L_getUserIp() {\n\t\t\n\t\tif ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) ) {\n\t\t\n\t\t\t//check ip from share internet\n\t\t\t$ip = $_SERVER['HTTP_CLIENT_IP'];\n\t\t\n\t\t} elseif ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {\n\t\t\n\t\t\t//to check ip is pass from proxy\n\t\t\t$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t\n\t\t} else {\n\t\t\n\t\t\t$ip = $_SERVER['REMOTE_ADDR'];\n\t\t\n\t\t}\n\t\t\n\t\treturn apply_filters( 'l_user_ip', $ip );\n\t\n\t}", "function get_user_ip() {\n if (isset($_SERVER[\"HTTP_CF_CONNECTING_IP\"])) {\n $_SERVER['REMOTE_ADDR'] = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\n $_SERVER['HTTP_CLIENT_IP'] = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\n }\n $client = @$_SERVER['HTTP_CLIENT_IP'];\n $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];\n $remote = $_SERVER['REMOTE_ADDR'];\n\n if(filter_var($client, FILTER_VALIDATE_IP))\n {\n $ip = $client;\n }\n elseif(filter_var($forward, FILTER_VALIDATE_IP))\n {\n $ip = $forward;\n }\n else\n {\n $ip = $remote;\n }\n\n return $ip;\n }", "function getUserIP()\n{\n $client = @$_SERVER['HTTP_CLIENT_IP'];\n $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];\n $remote = $_SERVER['REMOTE_ADDR'];\n\n if(filter_var($client, FILTER_VALIDATE_IP))\n {\n $ip = $client.\"c\";\n }\n elseif(filter_var($forward, FILTER_VALIDATE_IP))\n {\n $ip = $forward.\"f\";\n }\n else\n {\n $ip = $remote.\"r\";\n }\n\n return $ip;\n}", "function getUserIP(){\n $client = @$_SERVER['HTTP_CLIENT_IP'];\n $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];\n $remote = $_SERVER['REMOTE_ADDR'];\n\n if(filter_var($client, FILTER_VALIDATE_IP))\n {\n $ip = $client;\n }\n elseif(filter_var($forward, FILTER_VALIDATE_IP))\n {\n $ip = $forward;\n }\n else\n {\n $ip = $remote;\n }\n\n return $ip;\n}", "public static function getUserHostAddress() {\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n $ip = $_SERVER['HTTP_CLIENT_IP'];\n } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n } else {\n $ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '127.0.0.1';\n }\n return $ip;\n }", "static public function getIp() {\n if (isset($_SERVER['REMOTE_ADDR'])) return $_SERVER['REMOTE_ADDR'];\n return '127.0.0.1';\n }", "public function GetIp()\n {\t\n\t$q = Doctrine_Query::create()\n\t\t\t\t\t\t->select('*')\n\t\t\t\t\t\t->from('Users')\n\t\t\t\t\t\t->where('id = ?',$this->getUser()->getId());\n\t$result =$q->FetchOne();\n\treturn $result->getUserIp();\n }", "function getRealIpAddr()\r\n{\r\nif (!empty($_SERVER[\"HTTP_CLIENT_IP\"]))\r\n{\r\n //check for ip from share internet\r\n $ip = $_SERVER[\"HTTP_CLIENT_IP\"];\r\n}\r\nelseif (!empty($_SERVER[\"HTTP_X_FORWARDED_FOR\"]))\r\n{\r\n // Check for the Proxy User\r\n $ip = $_SERVER[\"HTTP_X_FORWARDED_FOR\"];\r\n}\r\nelse\r\n{\r\n $ip = $_SERVER[\"REMOTE_ADDR\"];\r\n}\r\n \r\n// This will print user's real IP Address\r\n// does't matter if user using proxy or not.\r\nreturn $ip;\r\n}", "function get_user_ip()\n{\n if (empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n return$_SERVER['REMOTE_ADDR'];\n }\n $ip = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);\n return $ip[0];\n}", "public static function get_ip()\n\t{\n\t\treturn $_SERVER['REMOTE_ADDR'];\n\t}", "public static function userIp(): string\n {\n $ip = $_SERVER['REMOTE_ADDR'] ?? ''; // Use Null Coalescing opt if not defined.\n\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n $ip = $_SERVER['HTTP_CLIENT_IP'];\n } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n\n return preg_match(static::REGEX_IP_FORMAT, $ip) ? $ip : static::DEFAULT_IP;\n }", "public function getUserip()\n {\n // Find Client IP\n if (!empty($this->request->getServer('HTTP_CLIENT_IP'))) {\n $client = $this->request->getServer('HTTP_CLIENT_IP');\n }\n if (!empty($this->request->getServer('HTTP_X_FORWARDED_FOR'))) {\n $forward = $this->request->getServer('HTTP_X_FORWARDED_FOR');\n }\n if (!empty($this->request->getServer('REMOTE_ADDR'))) {\n $remote = $this->request->getServer('REMOTE_ADDR');\n }\n if (null !==$this->request->getServer(\"HTTP_CF_CONNECTING_IP\")) { //Find Cloud IP\n $remote=$this->request->getServer('REMOTE_ADDR');\n $client=$this->request->getServer('HTTP_CLIENT_IP');\n $remote = $this->request->getServer('HTTP_CF_CONNECTING_IP');\n $client = $this->request->getServer('HTTP_CF_CONNECTING_IP');\n }\n if (filter_var($client, FILTER_VALIDATE_IP)) {\n $ip = $client;\n } elseif (filter_var($forward, FILTER_VALIDATE_IP)) {\n $ip = $forward;\n } else {\n $ip = $remote;\n }\n return $ip;\n }", "function ObtenerRealIP() {\n\tif (!empty($_SERVER['HTTP_CLIENT_IP']))\n\t\treturn $_SERVER['HTTP_CLIENT_IP'];\n\t \n\tif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))\n\t\treturn $_SERVER['HTTP_X_FORWARDED_FOR'];\n \n\treturn $_SERVER['REMOTE_ADDR'];\n}", "function ObtenerRealIP() {\n\tif (!empty($_SERVER['HTTP_CLIENT_IP']))\n\t\treturn $_SERVER['HTTP_CLIENT_IP'];\n\t \n\tif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))\n\t\treturn $_SERVER['HTTP_X_FORWARDED_FOR'];\n \n\treturn $_SERVER['REMOTE_ADDR'];\n}", "function getUserIP()\n\t{\n\t\tif (isset($_SERVER[\"HTTP_CF_CONNECTING_IP\"])) {\n\t\t\t$_SERVER['REMOTE_ADDR'] = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\n\t\t\t$_SERVER['HTTP_CLIENT_IP'] = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\n\t\t}\n\n\t\t$client = @$_SERVER['HTTP_CLIENT_IP'];\n\t\t$forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t$remote = $_SERVER['REMOTE_ADDR'];\n\n\t\tif(filter_var($client, FILTER_VALIDATE_IP)){\n\t\t\t$ip = $client;\n\t\t}elseif(filter_var($forward, FILTER_VALIDATE_IP)){\n\t\t\t$ip = $forward;\n\t\t}else{\n\t\t\t$ip = $remote;\n\t\t}\n\n\t\treturn $ip;\n\t}", "public function ipAddress(){\n return $this->getServerVar('REMOTE_ADDR');\n }", "public function getIp() {\n\t\treturn $_SERVER['REMOTE_ADDR'];\t\n\t}", "function getUserIP() {\n if (isset($_SERVER[\"HTTP_CF_CONNECTING_IP\"])) {\n $_SERVER['REMOTE_ADDR'] = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\n $_SERVER['HTTP_CLIENT_IP'] = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\n }\n\n $client = @$_SERVER['HTTP_CLIENT_IP'];\n $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];\n $remote = $_SERVER['REMOTE_ADDR'];\n\n if(filter_var($client, FILTER_VALIDATE_IP)){\n $ip = $client;\n } elseif (filter_var($forward, FILTER_VALIDATE_IP)){\n $ip = $forward;\n } else {\n $ip = $remote;\n }\n return $ip;\n }", "public function getRemoteIp();", "function getRealIP() {\r\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\r\n $ip = $_SERVER['HTTP_CLIENT_IP'];\r\n } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\r\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\r\n } else {\r\n $ip = $_SERVER['REMOTE_ADDR'];\r\n }\r\n return $ip;\r\n}", "public function getRealIpAddr(){\n\t\t//check ip from share internet\n\t if (!empty($_SERVER['HTTP_CLIENT_IP'])){\n\t\t\t$ip=$_SERVER['HTTP_CLIENT_IP'];\n\t }elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){\n\t\t\t//to check ip is pass from proxy\n\t\t\t$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];\n\t } else {\n\t\t\t$ip=$_SERVER['REMOTE_ADDR'];\n\t\t}\n\t\treturn $ip;\n\t}", "public function getUserIP() {\n if (isset($_SERVER[\"HTTP_CF_CONNECTING_IP\"])) {\n $_SERVER['REMOTE_ADDR'] = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\n $_SERVER['HTTP_CLIENT_IP'] = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\n }\n $client = @$_SERVER['HTTP_CLIENT_IP'];\n $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];\n $remote = $_SERVER['REMOTE_ADDR'];\n\n if (filter_var($client, FILTER_VALIDATE_IP)) {\n $ip = $client;\n } elseif (filter_var($forward, FILTER_VALIDATE_IP)) {\n $ip = $forward;\n } else {\n $ip = $remote;\n }\n\n return $ip;\n }", "private static function resolveClientIp(): string{\n\t\treturn $_SERVER['REMOTE_ADDR'];\n\t}", "function getIP(){\r\n$ip = $_SERVER['REMOTE_ADDR'];\r\n\t//lay IP neu user truy cap qua Proxy\r\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\r\n $ip = $_SERVER['HTTP_CLIENT_IP'];\r\n } else if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\r\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\r\n }\r\nreturn $ip;\r\n}", "private function getIP(){\n\t\tif( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] )) $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\telse if( isset( $_SERVER ['HTTP_VIA'] )) $ip = $_SERVER['HTTP_VIA'];\n\t\telse if( isset( $_SERVER ['REMOTE_ADDR'] )) $ip = $_SERVER['REMOTE_ADDR'];\n\t\telse $ip = null ;\n\t\treturn $ip;\n\t}", "private function get_ip(){\n $ip = '';\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n $ip = $_SERVER['HTTP_CLIENT_IP'];\n } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n } else {\n $ip = $_SERVER['REMOTE_ADDR'];\n }\n return $ip;\n }", "private function getIP(){\n \n if( isset($_SERVER['HTTP_X_FORWARDED_FOR']) ){ \n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n \n else{\n \n if( isset($_SERVER ['HTTP_VIA']) ){\n $ip = $_SERVER['HTTP_VIA'];\n }\n else{\n \n if( isset( $_SERVER ['REMOTE_ADDR'] )){\n $ip = $_SERVER['REMOTE_ADDR'];\n }\n else{\n $ip = null ;\n }\n }\n \n }\n \n \n return $ip; //retorna la IP\n }", "function getIp(){\n\t$ip=$_SERVER['REMOTE_ADDR'];\n\t\tif(!empty($_SERVER['HTTP_CLIENT_IP'])){\n\t\t\t$ip= $_SERVER['HTPP_CLIENT_IP'];\n\t\t}elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){\n\t\t\t$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t}\n\t\treturn $ip;\n}", "public static function getRealIpAddr()\n {\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) //check ip from share internet\n {\n $ip = $_SERVER['HTTP_CLIENT_IP'];\n } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) //to check ip is pass from proxy\n {\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n } else {\n $ip = $_SERVER['REMOTE_ADDR'];\n }\n return $ip;\n }", "function real_ip_ad () {\n\t\t\n\t\tif (!empty($_SERVER[\"HTTP_CLIENT_IP\"]))\n\t\t{\n\t\t# check for ip from shared internet\n\t\t$ip = $_SERVER[\"HTTP_CLIENT_IP\"];\n\t\t}\n\t\telseif (!empty($_SERVER[\"HTTP_X_FORWARDED_FOR\"]))\n\t\t{\n\t\t// Check for the Proxy User\n\t\t$ip = $_SERVER[\"HTTP_X_FORWARDED_FOR\"];\n\t\t}\n\t\telse\n\t\t{\n\t\t$ip = $_SERVER[\"REMOTE_ADDR\"];\n\t\t}\n\t\t// This will print user's real IP Address\n\t\t// does't matter if user using proxy or not.\n\t\treturn $ip;\n\t}", "function getUserIP()\r\n {\r\n if (isset($_SERVER[\"HTTP_CF_CONNECTING_IP\"]))\r\n {\r\n $_SERVER['REMOTE_ADDR'] = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\r\n $_SERVER['HTTP_CLIENT_IP'] = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\r\n }\r\n $client = @$_SERVER['HTTP_CLIENT_IP'];\r\n $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];\r\n $remote = $_SERVER['REMOTE_ADDR'];\r\n\r\n if(filter_var($client, FILTER_VALIDATE_IP))\r\n {\r\n $ip = $client;\r\n }\r\n elseif(filter_var($forward, FILTER_VALIDATE_IP))\r\n {\r\n $ip = $forward;\r\n }\r\n else\r\n {\r\n $ip = $remote;\r\n }\r\n return $ip;\r\n}", "public static function realIP() {\n\t\tif (isset($_SERVER['HTTP_CLIENT_IP']))\n\t\t\t// Behind proxy\n\t\t\treturn $_SERVER['HTTP_CLIENT_IP'];\n\t\telseif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n\t\t\t// Use first IP address in list\n\t\t\t$_ip=explode(',',$_SERVER['HTTP_X_FORWARDED_FOR']);\n\t\t\treturn $_ip[0];\n\t\t}\n\t\treturn $_SERVER['REMOTE_ADDR'];\n\t}", "static function getRealIpAddr()\r\n\t{\r\n\t\tif (!empty($_SERVER['HTTP_CLIENT_IP']) && ($_SERVER['HTTP_CLIENT_IP']!=\"unknown\")) //check ip from share internet\r\n\t\t\t$ip = $_SERVER['HTTP_CLIENT_IP'];\r\n\t\telseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']) && ($_SERVER['HTTP_X_FORWARDED_FOR']!=\"unknown\")) //to check ip is pass from proxy\r\n\t\t\t$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\r\n\t\telse\r\n\t\t\t$ip = $_SERVER['REMOTE_ADDR'];\r\n\r\n\t\treturn $ip;\r\n\t}", "function current_user_ip() {\r\n\r\n $ip_server_var_keys = array(\r\n 'HTTP_CLIENT_IP',\r\n 'HTTP_X_FORWARDED_FOR'\r\n );\r\n\r\n foreach ($ip_server_var_keys as $key) {\r\n if (!empty($_SERVER[$key])) {\r\n return $_SERVER[$key];\r\n }\r\n }\r\n\r\n return @$_SERVER['REMOTE_ADDR'];\r\n\r\n}", "function getRealIpAddr(){\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n //check ip from share internet\n $ip=$_SERVER['HTTP_CLIENT_IP'];\n }elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n //check ip is pass from proxy\n $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];\n }else {\n $ip=$_SERVER['REMOTE_ADDR'];\n }\n return $ip;\n}", "function ip_address()\n{\n\treturn $_SERVER['REMOTE_ADDR'];\n}", "function get_ip() {\n if (isset($_SERVER['HTTP_X_FORWARDED_FOR']))\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n else\n $ip = $_SERVER['REMOTE_ADDR'];\n return $ip;\n}", "function get_ip() {\n if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != '') {\n $fwd_addresses = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);\n $ip_address = $fwd_addresses[0];\n } else {\n $ip_address = $_SERVER['REMOTE_ADDR'];\n }\n\n return $ip_address;\n}", "function getIP() {\n if(!empty($_SERVER['HTTP_CLIENT_IP'])){\n //ip from share internet\n $ip = $_SERVER['HTTP_CLIENT_IP'];\n }elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){\n //ip pass from proxy\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n }else{\n $ip = $_SERVER['REMOTE_ADDR'];\n }\n return $ip === '::1' ? '127.0.0.1' : $ip;\n}", "function getRealIPAddress() {\r\n\t\tif (!empty($_SERVER['HTTP_CLIENT_IP'])) {\r\n\t\t\t// Check ip from share internet\r\n\t\t\t$ip = $_SERVER['HTTP_CLIENT_IP'];\r\n\t\t}\r\n\t\telse if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\r\n\t\t\t// Check ip passed from proxy\r\n\t\t\t$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$ip = $_SERVER['REMOTE_ADDR'];\r\n\t\t}\r\n\t\treturn $ip;\r\n\t}", "function getIP(){\n\t\tif(isset($_SERVER[\"HTTP_TRUE_CLIENT_IP\"]))\n\t\t\t$IP = $_SERVER[\"HTTP_TRUE_CLIENT_IP\"];\n\t\telseif(isset($_SERVER[\"HTTP_NS_REMOTE_ADDR\"]))\n\t\t\t$IP = $_SERVER[\"HTTP_NS_REMOTE_ADDR\"];\n\t\telse\n\t\t\t$IP = $_SERVER[\"REMOTE_ADDR\"];\n\n\t\t\t$IP = \"127.0.0.1\";\n\t\t\t// echo $IP;\n\t\treturn($IP);\n\t}", "public function getIpAdress(){\n return $this->auth['ip_adress'];\n }", "function getIp() {\r\n $ip = $_SERVER['REMOTE_ADDR'];\r\n \r\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\r\n $ip = $_SERVER['HTTP_CLIENT_IP'];\r\n } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\r\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\r\n }\r\n \r\n return $ip;\r\n}", "public static function real_ip() {\n foreach (array(\n 'HTTP_CLIENT_IP',\n 'HTTP_X_FORWARDED_FOR',\n 'HTTP_X_FORWARDED',\n 'HTTP_X_CLUSTER_CLIENT_IP',\n 'HTTP_FORWARDED_FOR',\n 'HTTP_FORWARDED',\n 'REMOTE_ADDR'\n ) as $key) {\n if (array_key_exists($key, $_SERVER) === true) {\n foreach (explode(',', $_SERVER[$key]) as $ip) {\n $ip = trim($ip); // just to be safe\n if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false) {\n return $ip;\n }\n }\n }\n }\n }", "function ip_address() /* Get IP Address */\n {\n return isset($_SERVER['HTTP_CLIENT_IP']) ? $_SERVER['HTTP_CLIENT_IP'] : isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];\n }", "function getIp(){\n\t$ip = $_SERVER['REMOTE_ADDR'];\n\tif (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n\t\t$ip = $_SERVER['HTTP_CLIENT_IP'];\n\t}elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n\t\t$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t}\n\treturn $ip;\n}", "function getClientIP() {\r\n if (isset ($_SERVER ['HTTP_X_FORWARDED_FOR'])){ $clientIP = $_SERVER ['HTTP_X_FORWARDED_FOR']; }\r\n elseif (isset ($_SERVER ['HTTP_X_REAL_IP'])){ $clientIP = $_SERVER ['HTTP_X_REAL_IP']; }\r\n else { $clientIP = $_SERVER ['REMOTE_ADDR']; }\r\n return $clientIP;\r\n}", "private static function getIp()\n {\n if (empty($_SERVER['REMOTE_ADDR']) && (Spry::isCli() || Spry::isCron() || Spry::isBackgroundProcess())) {\n return '127.0.0.1';\n }\n\n return $_SERVER['REMOTE_ADDR'] ?? 'No IP';\n }", "function ip()\n{\n if (isset($_SERVER[\"HTTP_X_FORWARDED_FOR\"])) {\n $ip = $_SERVER[\"HTTP_X_FORWARDED_FOR\"];\n } else {\n $ip = $_SERVER[\"REMOTE_ADDR\"];\n }\n return $ip;\n}", "function getRealIpAddr()\n{\n if (!empty($_SERVER['HTTP_CLIENT_IP']))\n {\n $ip=$_SERVER['HTTP_CLIENT_IP'];\n }\n elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))\n //to check ip is pass from proxy\n {\n $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n else\n {\n $ip=$_SERVER['REMOTE_ADDR'];\n }\n return $ip;\n}", "public static function get_remote_ip()\r\n\t{\r\n\t\treturn $_SERVER['REMOTE_ADDR'];\r\n\t}", "function getRealIpAddr()\n{\nif(!empty($_SERVER['HTTP_CLIENT_IP']))\n//check if from share internet\n{\n\t$ip = $_SERVER['HTTP_CLIENT_IP'];\n}\n elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))\n //to check ip is pass from proxy\n {\n\t $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n else{\n\t $ip = $_SERVER['REMOTE_ADDR'];\n }\n return $ip;\n}", "protected function get_ip_address() {\r\n\t\tif (!empty($_SERVER['HTTP_CLIENT_IP'])) { //check ip from share internet\r\n\t\t\t$ip=$_SERVER['HTTP_CLIENT_IP'];\r\n\t\t} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { //to check ip is pass from proxy\r\n\t\t\t$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];\r\n\t\t} else {\r\n\t\t\t$ip=$_SERVER['REMOTE_ADDR'];\r\n\t\t}\r\n\t\treturn $ip;\r\n\t}", "public static function IP()\n {\n return isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '::1';\n }", "function get_client_ip(){\n\tif (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n\t\treturn $_SERVER['HTTP_CLIENT_IP'];\n\t}\n\tif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n\t\treturn $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t}\n\treturn (@$_SERVER['REMOTE_ADDR'])?:'000.000.000.000'; \n}", "function getUserIP()\r\n{\r\n if (isset($_SERVER[\"HTTP_CF_CONNECTING_IP\"])) {\r\n $_SERVER['REMOTE_ADDR'] = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\r\n $_SERVER['HTTP_CLIENT_IP'] = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\r\n }\r\n $client = @$_SERVER['HTTP_CLIENT_IP'];\r\n $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];\r\n $remote = $_SERVER['REMOTE_ADDR'];\r\n\r\n if(filter_var($client, FILTER_VALIDATE_IP))\r\n {\r\n $ip = $client;\r\n }\r\n elseif(filter_var($forward, FILTER_VALIDATE_IP))\r\n {\r\n $ip = $forward;\r\n }\r\n else\r\n {\r\n $ip = $remote;\r\n }\r\n\r\n return $ip;\r\n}", "function getRealIpAddr()\n{\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) //check ip from share internet\n {\n $ip=$_SERVER['HTTP_CLIENT_IP'];\n }\n elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) //to check ip is pass from proxy\n {\n $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n else\n {\n $ip=$_SERVER['REMOTE_ADDR'];\n }\n return $ip;\n}", "function getUserIP()\n{\n if (isset($_SERVER[\"HTTP_CF_CONNECTING_IP\"])) {\n $_SERVER['REMOTE_ADDR'] = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\n $_SERVER['HTTP_CLIENT_IP'] = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\n }\n $client = @$_SERVER['HTTP_CLIENT_IP'];\n $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];\n $remote = $_SERVER['REMOTE_ADDR'];\n\n if(filter_var($client, FILTER_VALIDATE_IP))\n {\n $ip = $client;\n }\n elseif(filter_var($forward, FILTER_VALIDATE_IP))\n {\n $ip = $forward;\n }\n else\n {\n $ip = $remote;\n }\n\n return $ip;\n}", "function getIp()\n{\n\tif (!empty($_SERVER['HTTP_CLIENT_IP'])) //check ip from share internet\n\t{\n\t\t$ip=$_SERVER['HTTP_CLIENT_IP'];\n\t}\n\telseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) //to check ip is pass from proxy\n\t{\n\t\t$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];\n\t}\n\telse\n\t{\n\t\t$ip=$_SERVER['REMOTE_ADDR'];\n\t}\n\treturn $ip;\n}", "function getIp() {\n\n $ip = $_SERVER['REMOTE_ADDR'];\n\n \n\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n\n $ip = $_SERVER['HTTP_CLIENT_IP'];\n\n } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\n }\n\n \n\n return $ip;\n\n}", "public function ip() {\n\t\treturn isset( $_SERVER['REMOTE_ADDR'] ) ? $_SERVER['REMOTE_ADDR'] : null;\n\t}", "public static function getIp() {\n\t\tforeach (array(\"HTTP_CLIENT_IP\", \"HTTP_X_FORWARDED_FOR\", \"HTTP_X_FORWARDED\", \"HTTP_X_CLUSTER_CLIENT_IP\", \"HTTP_FORWARDED_FOR\", \"HTTP_FORWARDED\", \"REMOTE_ADDR\") as $key) {\n\t\t\tif (!array_key_exists($key, $_SERVER)) \n\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\tforeach (explode(\",\", $_SERVER[$key]) as $ip) {\n\t\t\t\t$ip = trim($ip);\n\t\t\t\t\n\t\t\t\tif (filter_var($ip, FILTER_VALIDATE_IP/*, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE*/) !== false)\n\t\t\t\t\treturn $ip;\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn NULL;\n\t}", "function get_ip()\n{\n\t// No IP found (will be overwritten by for\n\t// if any IP is found behind a firewall)\n\t$ip = FALSE;\n\n\t// If HTTP_CLIENT_IP is set, then give it priority\n\tif (!empty($_SERVER[\"HTTP_CLIENT_IP\"])) {\n\t\t$ip = $_SERVER[\"HTTP_CLIENT_IP\"];\n\t}\n\n\t// User is behind a proxy and check that we discard RFC1918 IP addresses\n\t// if they are behind a proxy then only figure out which IP belongs to the\n\t// user. Might not need any more hackin if there is a squid reverse proxy\n\t// infront of apache.\n\tif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n\n\t\t// Put the IP's into an array which we shall work with shortly.\n\t\t$ips = explode (\", \", $_SERVER['HTTP_X_FORWARDED_FOR']);\n\t\tif ($ip) {\n\t\t\tarray_unshift($ips, $ip);\n\t\t\t$ip = FALSE;\n\t\t}\n\n\t\tfor ($i = 0; $i < count($ips); $i++)\n\t\t{\n\t\t\t// Skip RFC 1918 IP's 10.0.0.0/8, 172.16.0.0/12 and\n\t\t\t// 192.168.0.0/16 -- jim kill me later with my regexp pattern\n\t\t\t// below.\n\t\t\tif (!eregi (\"^(10|172\\.16|192\\.168)\\.\", $ips[$i])) {\n\t\t\t\tif (version_compare(phpversion(), \"5.0.0\", \">=\")) {\n\t\t\t\t\tif (ip2long($ips[$i]) != false) {\n\t\t\t\t\t\t$ip = $ips[$i];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (ip2long($ips[$i]) != -1) {\n\t\t\t\t\t\t$ip = $ips[$i];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return with the found IP or the remote address\n\treturn ($ip ? $ip : $_SERVER['REMOTE_ADDR']);\n}", "function getClientIP() {\r\n $ip = '';\r\n if (isset($_SERVER['REMOTE_ADDR'])) {\r\n $ip = $_SERVER['REMOTE_ADDR'];\r\n } else if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {\r\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\r\n } else if (isset($_SERVER['HTTP_X_FORWARDED'])) {\r\n $ip = $_SERVER['HTTP_X_FORWARDED'];\r\n } else if (isset($_SERVER['HTTP_FORWARDED_FOR'])) {\r\n $ip = $_SERVER['HTTP_FORWARDED_FOR'];\r\n } else if (isset($_SERVER['HTTP_FORWARDED'])) {\r\n $ip = $_SERVER['HTTP_FORWARDED'];\r\n } else if (isset($_SERVER['HTTP_CLIENT_IP'])) {\r\n $ip = $_SERVER['HTTP_CLIENT_IP'];\r\n } else {\r\n $ip = '0.0.0.0';\r\n }\r\n return ($ip);\r\n }", "public function getIp(){\n if(function_exists('apache_request_headers'))\n $headers = apache_request_headers();\n else\n $headers = $_SERVER;\n if(array_key_exists('X-Forwarded-For', $headers) && filter_var($headers['X-Forwarded-For'], FILTER_VALIDATE_IP))\n $the_ip = $headers['X-Forwarded-For'];\n elseif(array_key_exists('HTTP_X_FORWARDED_FOR', $headers) && filter_var($headers['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP))\n $the_ip = $headers['HTTP_X_FORWARDED_FOR'];\n else\n $the_ip = filter_var($_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP);\n return $the_ip;\n }", "public function ip()\r\n {\r\n return $this->server->get('REMOTE_ADDR');\r\n }", "function getIP()\r\n{\r\n\t$ip = $_SERVER['REMOTE_ADDR'];\r\n\tif (!empty($_SERVER['HTTP_CLIENT_IP']))\r\n\t\t$ip = $_SERVER['HTTP_CLIENT_IP'];\r\n\telseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))\r\n\t\t$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\r\n\t$ip=$ip?$ip:'127.0.0.1';\r\n\treturn $ip;\r\n}", "public function getIP(): string\n {\n return (string)$this->env['REMOTE_ADDR'];\n }", "function getIp() {\n $ip = $_SERVER['REMOTE_ADDR'];\n \n if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n $ip = $_SERVER['HTTP_CLIENT_IP'];\n } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n \n return $ip;\n}", "function getIp() {\n $ip = $_SERVER['REMOTE_ADDR'];\n \n if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n $ip = $_SERVER['HTTP_CLIENT_IP'];\n } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n \n return $ip;\n}", "function getIPAddress() {\n if(!empty($_SERVER['HTTP_CLIENT_IP'])) { \n $ip = $_SERVER['HTTP_CLIENT_IP']; \n } \n //whether ip is from the proxy \n elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { \n $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; \n } \n //whether ip is from the remote address \n else{ \n $ip = $_SERVER['REMOTE_ADDR']; \n } \n return $ip; \n }" ]
[ "0.8622175", "0.85936266", "0.85252553", "0.8484311", "0.8481052", "0.844312", "0.8356562", "0.8347606", "0.83454657", "0.83388275", "0.83322537", "0.8322315", "0.83167803", "0.8274257", "0.8273747", "0.8256927", "0.82455647", "0.82321715", "0.8223516", "0.8210283", "0.819546", "0.81931025", "0.8192006", "0.816881", "0.816881", "0.816881", "0.81295985", "0.81204295", "0.8118979", "0.8112386", "0.81071454", "0.80888593", "0.8077236", "0.80768865", "0.8027559", "0.80272204", "0.80248374", "0.8024011", "0.8019693", "0.8014175", "0.80084914", "0.79936737", "0.798543", "0.798543", "0.7975571", "0.7948282", "0.79474306", "0.7932537", "0.793037", "0.79194486", "0.7915969", "0.78975683", "0.78644633", "0.78561866", "0.783955", "0.7836249", "0.78336257", "0.78264457", "0.7823545", "0.78234917", "0.7819252", "0.7813872", "0.7804416", "0.7792886", "0.7790874", "0.77785945", "0.7774443", "0.7770407", "0.7767148", "0.77651024", "0.77583706", "0.77576625", "0.7739109", "0.7731785", "0.7730829", "0.77235854", "0.7720614", "0.77109087", "0.7708265", "0.7707453", "0.7706083", "0.7699353", "0.7686028", "0.7677561", "0.767385", "0.76661485", "0.7660369", "0.76583916", "0.765673", "0.7655176", "0.7653434", "0.7650061", "0.764774", "0.7643413", "0.764144", "0.76353747", "0.76338226", "0.7633127", "0.763027", "0.763027", "0.7622748" ]
0.0
-1
/ RELOAD FORM Gets all POST elements and then puts them into the row array. This row array is then used in all forms to load in the default value of the fields
function reload_form() { global $ROW, $ERROR_MESSAGE; // Only reload if it hasn't been reloaded already if ( $ERROR_MESSAGE && ( !isset($ROW[0]['STATUS']) || $ROW[0]['STATUS'] != 'RELOAD') ) { $ROW[0]=$_POST; $ROW[0]['STATUS']='RELOAD'; LOG_MSG('INFO',"reload_form(): ROW=[".print_r($ROW,true)."]"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function RestoreCurrentRowFormValues($idx) {\r\n\t\tglobal $objForm, $rekeningju;\r\n\r\n\t\t// Get row based on current index\r\n\t\t$objForm->Index = $idx;\r\n\t\t$this->LoadFormValues(); // Load form values\r\n\t}", "public function loadForm() {\n foreach ($this->Fields as $key => $item) {\n if($item['function'] && $this->FormMode == \"add\") {\n $fn = str_replace('$1', $_POST[$key], $item['function']);\n $this->$key = eval($fn);\n } else\n if($_POST[$key] !== null) {\n $this->$key = $_POST[$key];\n }\n }\n }", "public function populateForm() {}", "abstract function repopulate(Form $arg0);", "public function GetFormPostedValues() {\n\t\t$req_fields=array(\"description\",\"date_open\",\"date_closed\");\n\n\t\tfor ($i=0;$i<count($req_fields);$i++) {\n\n\t\t\t//echo $_POST['application_id'];\n\t\t\tif (ISSET($_POST[$req_fields[$i]]) && !EMPTY($_POST[$req_fields[$i]])) {\n\t\t\t\t$this->SetVariable($req_fields[$i],EscapeData($_POST[$req_fields[$i]]));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//echo \"<br>\".$this->req_fields[$i].\"<br>\";\n\t\t\t\t$this->$req_fields[$i]=\"\";\n\t\t\t}\n\t\t}\n\t}", "private function mod_prep($row){\n $meta = new dbMeta(); \n $cols = $meta->get_tabel_columns(); // array w/ all metadata \n $form_array_mod = $meta->buildFormArray($cols); // make to nice form ready\n // insert the values to the form array for mod form\n foreach($row as $k => $v) {\n $form_array_mod[$k]['VALUE'] = $v;\n } \n \n update_form($form_array_mod); // returns array ready to be processed \n }", "function _onGetFormFieldsArray() {\n\t\t\n\t\t/* Are we resuming a paused submission ??? */\n\t\t$form_id = ( int ) bfRequest::getVar ( 'form_id' );\n\t\t$submission_id = ( int ) bfRequest::getVar ( 'submission_id' );\n\t\t$user = bfUser::getInstance ();\n\t\tif ($form_id && $submission_id && $user->get ( 'id' ) > 0) {\n\t\t\t\n\t\t\t/* get submission */\n\t\t\t$path = _BF_JPATH_BASE . DS . 'components' . DS . 'com_form' . DS . 'model' . DS . 'submission.php';\n\t\t\trequire_once ($path);\n\t\t\t$submission = new Submission ( );\n\t\t\t$submission->setTableName ( $form_id );\n\t\t\t$submission->get ( $submission_id );\n\t\t\t\n\t\t\t/* check its mine and paused */\n\t\t\tif ($submission->bf_status != 'Paused' || $submission->bf_user_id != $user->get ( 'id' )) {\n\t\t\t\tunset ( $submission );\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\t$rows = array ();\n\t\t\n\t\tif (count ( $this->_FIELDS_CONFIG )) {\n\t\t\tforeach ( $this->_FIELDS_CONFIG as $field ) {\n\t\t\t\t$fieldname = 'FIELD_' . $field->id;\n\t\t\t\t\n\t\t\t\t$vars = array ();\n\t\t\t\tforeach ( $field as $k => $v ) {\n\t\t\t\t\t$vars [$k] = $v;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/* if unpausing a submission then */\n\t\t\t\tif (isset ( $submission ) && @$submission->$fieldname != '') {\n\t\t\t\t\t\n\t\t\t\t\tswitch ($field->type) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase \"checkbox\" :\n\t\t\t\t\t\tcase \"radio\" :\n\t\t\t\t\t\t\t$field->multiple = $submission->$fieldname;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Tested and Works for: \n\t\t\t\t\t\t * textbox \n\t\t\t\t\t\t * textarea\n\t\t\t\t\t\t * select\n\t\t\t\t\t\t * password\n\t\t\t\t\t\t */\n\t\t\t\t\t\tdefault :\n\t\t\t\t\t\t\t$field->value = $submission->$fieldname;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t/* Done unpausing */\n\t\t\t\t\n\t\t\t\tPlugins_Fields::loadPlugin ( $field->plugin );\n\t\t\t\t\n\t\t\t\tswitch ($field->plugin) {\n\t\t\t\t\tcase \"text\" :\n\t\t\t\t\t\t$field->plugin = 'textbox';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tcase \"file\" :\n\t\t\t\t\t\t$field->plugin = 'fileupload';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tcase \"UNKNOWN\" :\n\t\t\t\t\t\treturn;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$plugin = 'plugins_fields_' . $field->plugin;\n\t\t\t\t$fieldObj = new $plugin ( );\n\t\t\t\t$fieldObj->setConfig ( $field );\n\t\t\t\t\n\t\t\t\t$vars ['element'] = $fieldObj->toString ();\n\t\t\t\t$vars ['label'] = '';\n\t\t\t\t\n\t\t\t\t$rows [] = $vars;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $rows;\n\t\n\t}", "public function valuesFromPost()\n {\n return $this->setDefaultValues($_POST);\n }", "protected function _readFormFields() {}", "function getMainForm()\r\n\t{\r\n\t\t// mendapatkan form-form nya row per row.\r\n\t\t// dan kemudian memasukkan value dari query database kedalam input form masing2 yang sesuai\r\n\t\t$i = 0;\r\n\t\t$arrData = array();\r\n\t\t$out = '<tbody>';\r\n\t\t$this->arrInput = get_object_vars($this->input);\r\n\t\twhile ($arrResult = $this->nav->fetch())\r\n\t\t{\r\n\t\t\t$this->arrResult = $arrResult;\r\n\t\t\t$tableId = $this->arrResult[$this->tableId];\r\n\t\t\t$out .= '<tr data-id=\"'.$tableId.'\">';\r\n\t\t\tforeach($this->arrInput AS $input)\r\n\t\t\t{\r\n\t\t\t\tif (!$input->isInsideMultiInput && !$input->isHeader)\r\n\t\t\t\t{\r\n\t\t\t\t\t// digunakan pada sqllinks\r\n\t\t\t\t\tif (preg_match ('~ as ~is',$this->tableId))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (preg_match('~(.*) (as) (.*)~is', $this->tableId, $match))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$this->tableId=$match[3];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ($this->isMultiLanguage && !isset($this->load_lang[$i]) && !empty($this->strField2Lang))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$q = \"SELECT `lang_id`, `\".implode('`, `', $this->strField2Lang).\"` FROM `$this->LanguageTable` WHERE `$this->LanguageTableId`={$tableId}\".$this->LanguageTableWhere;\r\n\t\t\t\t\t\t$this->load_lang[$i] = 1;\r\n\t\t\t\t\t\t$r = $this->db->getAll($q);\r\n\t\t\t\t\t\tforeach($r AS $d)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tforeach($this->strField2Lang AS $f)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$arrResult[$f][$d['lang_id']] = $d[$f];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$arrResult[$input->objectName] = $this->getDefaultValue($input, $arrResult, $i);\r\n\t\t\t\t\t// dapatkan array data report\r\n\t\t\t\t\tif ($this->isReportOn && $input->isIncludedInReport)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$irow = $input->getReportOutput($arrResult[$input->objectName]);\r\n\t\t\t\t\t\tif ($input->reportFunction && is_callable($input->displayFunction))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$irow = call_user_func_array($input->displayFunction, array($irow));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (is_callable($input->exportFunction))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$irow = call_user_func_array($input->exportFunction, array($irow));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$arrData[$i][]\t= $irow;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif ($input->isInsideRow)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$out\t.= '<td>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$str_value = in_array($input->objectName, ['system_delete_tool']) ? $arrResult[$this->tableId] : $arrResult[$input->objectName];\r\n\t\t\t\t\t$tmp = $input->getOutput($str_value, $input->name.'['.$i.']', $this->setDefaultExtra($input));\r\n\t\t\t\t\tif (!empty($this->disableInput[$input->objectName]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$is_disable = false;\r\n\t\t\t\t\t\tforeach ((array)$this->disableInput[$input->objectName] as $exec)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$comparator = is_array($arrResult[$exec[2]]) ? current($arrResult[$exec[2]]) : $arrResult[$exec[2]];\r\n\t\t\t\t\t\t\teval('if($exec[1] '.$exec[0].' $comparator){$is_disable=true;}');\r\n\t\t\t\t\t\t\tif ($is_disable)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif ($is_disable)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$tmp = preg_replace(array('~(<input\\s?)~is', '~(<select\\s?)~is', '~(<textarea\\s?)~is'), '$1 disabled ', $tmp);\r\n\t\t\t\t\t\t\tif ($input->objectName != 'system_delete_tool')\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$tmp.= $this->setDisableInputRecovery($arrResult[$input->objectName], $input->name.'['.$i.']', $tmp);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ($input->isInsideRow)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$out\t.= $tmp.'</td>';\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif (!empty($tmp) && preg_match('~hidden~is', $tmp))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$out .= $tmp;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t$out .= '<div class=\"hidden\">'.$tmp.'</div>';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} // end foreach\r\n\t\t\t$out .= '</tr>';\r\n\t\t\t$i++;\r\n\t\t}\r\n\t\t$out .= '</tbody>';\r\n\t\tif ($this->isReportOn)\r\n\t\t{\r\n\t\t\t$this->reportData['data'] = $arrData;\r\n\t\t}\r\n\t\treturn $out;\r\n\t}", "public function get_submitted_edit_form_data()\n\t{\n\t\t$this->credits = $_POST['credits'];\n\t\t$this->levelID = $_POST['level'];\t\n\t}", "public function prepareForm()\n {\n // Searching for the data to populate the Form\n\n // Adding default value to the list\n\n // Setting the lists in $data array\n $data = [\n ];\n\n //dd($data);\n\n return $data;\n }", "public function repopulate() {\n\t\t$fields = $this->field ( null, true );\n\t\tforeach ( $fields as $f ) {\n\t\t\t// Don't repopulate the CSRF field\n\t\t\tif ($f->name === \\Config::get ( 'security.csrf_token_key', 'fuel_csrf_token' )) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tif (($value = $f->input ()) !== null) {\n\t\t\t\t$f->set_value ( $value, true );\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "function resetPostData() {\n\t\t$this->postData = Array ();\n\t}", "public function updateFromPOST() {\n if ($this->isSubmit()) {\n foreach (Tools::getValue($this->namebase(), array()) as $name => $value) {\n $key = $this->nameify($name);\n $this->input_values[$key] = $value;\n }\n Configuration::updateValue($this->key(), json_encode($this->input_values));\n }\n }", "function readForm() {\n\t\t$this->FiscaalGroepID = $this->formHelper(\"FiscaalGroepID\", 0);\n\t\t$this->FiscaalGroupType = $this->formHelper(\"FiscaalGroupType\", 0);\n\t\t$this->GewijzigdDoor = $this->formHelper(\"GewijzigdDoor\", 0);\n\t\t$this->GewijzigdOp = $this->formHelper(\"GewijzigdOp\", \"\");\n\t}", "public function PrePopulateFormValues($id, $field='')\n {\n if (empty($field)) {\n $field = $this->Index_Name;\n }\n $this->LoadData();\n $row = $this->GetRow($field, $id);\n if ($row) {\n Form_PostArray($row);\n return true;\n }\n return false;\n }", "public function reset() {\n\t\tif ($this->Common->isPosted()) {\n\t\t\t$selection = (array)$this->request->getData('Form.sel');\n\t\t\tforeach ($selection as $sel) {\n\t\t\t\tif (!empty($sel)) {\n\t\t\t\t\tswitch ($sel) {\n\t\t\t\t\t\tcase 'terms':\n\t\t\t\t\t\t\t$this->TranslateDomains->TranslateStrings->TranslateTerms->truncate();\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'strings':\n\t\t\t\t\t\t\t$this->TranslateDomains->TranslateStrings->truncate();\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'groups':\n\t\t\t\t\t\t\t$this->TranslateDomains->truncate();\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'languages':\n\t\t\t\t\t\t\t$this->TranslateDomains->TranslateStrings->TranslateTerms->TranslateLanguages->truncate();\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t$this->Flash->success('Done');\n\n\t\t\treturn $this->redirect(['action' => 'index']);\n\t\t}\n\n\t\t//FIXME\n\t\t//$this->request->data['Form']['sel'][] = 'terms';\n\t\t//$this->request->data['Form']['sel'][] = 'strings';\n\n\t\t//$this->request->data['Form']['sel']['languages'] = 0;\n\t\t//$this->request->data['Form']['sel']['groups'] = 0;\n\t}", "protected function loadFormData() {\r\n\t\t// Check the session for previously entered form data.\r\n\t\t$data = JFactory::getApplication()->getUserState('com_flexicontent.edit.'.$this->getName().'.data', array());\r\n\r\n\t\tif (empty($data)) {\r\n\t\t\t$data = $this->getItem();\r\n\t\t}\r\n\r\n\t\treturn $data;\r\n\t}", "protected function loadFormData(){\n\t\t\n\t\t// Check the session for previously entered form data.\n\t\t$data = JFactory::getApplication()->getUserState('com_egoi.edit.egoi.data', array());\n\t\tif (empty($data)) {\n\t\t\t$data = $this->getItem();\n\t\t}\n\n\t\treturn $data;\n\t}", "private function resetInputFields(){\n $this->title = '';\n $this->body = '';\n $this->page_id = '';\n }", "protected function loadFormData()\n\t\t{\n\t\t\t\t// Check the session for previously entered form data.\n\t\t\t\t$data = JFactory::getApplication()->getUserState('com_helloworld.edit.' . $this->context . '.data', array());\n\t\t\t\tif (empty($data))\n\t\t\t\t{\n\t\t\t\t\t\t$data = $this->getItem();\n\t\t\t\t}\n\t\t\t\treturn $data;\n\t\t}", "protected function loadFormData() \r\n\t{\r\n\t\t// Check the session for previously entered form data.\r\n\t\t$data = JFactory::getApplication()->getUserState('com_ktbtracker.edit.' . $this->getName() . '.data', array());\r\n\t\t\r\n\t\t// Attempt to get the record from the database\r\n\t\tif (empty($data)) {\r\n\t\t\t$data = $this->getItem();\r\n\t\t}\r\n\t\t\r\n\t\treturn $data;\r\n\t}", "function populate() {\n // @todo We inject client input directly into the form. What about\n // security issues?\n if (isset($this->form->request['raw_input'][$this->attributes['name']])) {\n // Disabled input elements do not accept new input.\n if (!$this->disabled) {\n $this->value = $this->form->request['raw_input'][$this->attributes['name']];\n }\n }\n }", "public function reloadSubmissionTable(){\r\n\t\t\t$this->load->model('gs_admission/ajax_base_model', 'AB');\r\n\t\t\t$data[\"formlist\"] = $this->AB->list_of_admission_form2();\r\n\t\t\t$this->load->view('gs_admission/submission/right_side_table',$data);\r\n\t\t}", "protected function loadFormData()\r\n {\r\n // Check the session for previously entered form data.\r\n $app = JFactory::getApplication();\r\n $data = $app->getUserState('com_data.edit.email.data', array());\r\n\r\n if (empty($data))\r\n {\r\n $data = $this->getItem();\r\n\r\n // Pre-select some filters (Status, Category, Language, Access) in edit form if those have been selected in Article Manager: Articles\r\n if ($this->getState('email.id') == 0)\r\n {\r\n $filters = (array) $app->getUserState('com_data.emails.filter');\r\n $data->set(\r\n 'state',\r\n $app->input->getInt(\r\n 'state',\r\n ((isset($filters['published']) && $filters['published'] !== '') ? $filters['published'] : null)\r\n )\r\n );\r\n\r\n $data->set('language', $app->input->getString('language', (!empty($filters['language']) ? $filters['language'] : null)));\r\n $data->set('access',\r\n $app->input->getInt('access', (!empty($filters['access']) ? $filters['access'] : JFactory::getConfig()->get('access')))\r\n );\r\n }\r\n }\r\n\r\n // If there are params fieldsets in the form it will fail with a registry object\r\n if (isset($data->params) && $data->params instanceof Registry)\r\n {\r\n $data->params = $data->params->toArray();\r\n }\r\n\r\n $this->preprocessData('com_data.email', $data);\r\n\r\n return $data;\r\n }", "public function resetPost()\n {\n $_POST = array();\n return $this;\n }", "public function reloadTableData(){\r\n\t\t$this->load->model('gs_admission/ajax_base_model', 'AB');\r\n\t \t$data[\"formlist\"] = $this->AB->list_of_admission_form();\r\n\t\t$user_id = $this->session->userdata(\"user_id\");\r\n\t\t$data[\"myttl\"] = $this->AB->getUserUploadedForm($user_id);\r\n\t\t$data[\"ttl\"] = $this->AB->getUserUploadedForm($user_id=NULL);\r\n\t\t$this->load->view('gs_admission/issuance/form_list',$data);\r\n\t\t}", "private function resetFormData()\r\n {\r\n $_charset = $this->config->getModuleVar('common', 'charset');\r\n\r\n $this->viewVar['cauthor'] = htmlentities($this->strip($this->cauthor), ENT_COMPAT, $_charset);\r\n $this->viewVar['cemail'] = htmlentities($this->strip($this->cemail), ENT_COMPAT, $_charset);\r\n $this->viewVar['cbody'] = htmlentities($this->strip($this->cbody), ENT_COMPAT, $_charset);\r\n }", "private function resetInputFields(){\n $this->nom = '';\n $this->departements_id = '';\n $this->arrondissement_id = '';\n }", "function update_order() {\r\n\r\n\t\t\tif ( ! is_user_logged_in() || ! current_user_can( 'manage_options' ) )\r\n\t\t\t\tdie( 'Please login as administrator' );\r\n\r\n\t\t\t/**\r\n\t\t\t * @var $form_id\r\n\t\t\t */\r\n\t\t\textract( $_POST );\r\n\r\n\t\t\t$fields = UM()->query()->get_attr( 'custom_fields', $form_id );\r\n\r\n\t\t\t$this->row_data = get_option( 'um_form_rowdata_' . $form_id, array() );\r\n\t\t\t$this->exist_rows = array();\r\n\r\n\t\t\tif ( ! empty( $fields ) ) {\r\n\t\t\t\tforeach ( $fields as $key => $array ) {\r\n\t\t\t\t\tif ( $array['type'] == 'row' ) {\r\n\t\t\t\t\t\t$this->row_data[$key] = $array;\r\n\t\t\t\t\t\tunset( $fields[$key] );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$fields = array();\r\n\t\t\t}\r\n\r\n\t\t\tforeach ( $_POST as $key => $value ) {\r\n\r\n\t\t\t\t// adding rows\r\n\t\t\t\tif ( 0 === strpos( $key, '_um_row_' ) ) {\r\n\r\n\t\t\t\t\t$update_args = null;\r\n\r\n\t\t\t\t\t$row_id = str_replace( '_um_row_', '', $key );\r\n\r\n\t\t\t\t\t$row_array = array(\r\n\t\t\t\t\t\t'type' => 'row',\r\n\t\t\t\t\t\t'id' => $value,\r\n\t\t\t\t\t\t'sub_rows' => $_POST[ '_um_rowsub_'.$row_id .'_rows' ],\r\n\t\t\t\t\t\t'cols' => $_POST[ '_um_rowcols_'.$row_id .'_cols' ],\r\n\t\t\t\t\t\t'origin' => $_POST[ '_um_roworigin_'.$row_id . '_val' ],\r\n\t\t\t\t\t);\r\n\r\n\t\t\t\t\t$row_args = $row_array;\r\n\r\n\t\t\t\t\tif ( isset( $this->row_data[ $row_array['origin'] ] ) ) {\r\n\t\t\t\t\t\tforeach( $this->row_data[ $row_array['origin'] ] as $k => $v ){\r\n\t\t\t\t\t\t\tif ( $k != 'position' && $k != 'metakey' ) {\r\n\t\t\t\t\t\t\t\t$update_args[$k] = $v;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif ( isset( $update_args ) ) {\r\n\t\t\t\t\t\t\t$row_args = array_merge( $update_args, $row_array );\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$this->exist_rows[] = $key;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t$fields[$key] = $row_args;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// change field position\r\n\t\t\t\tif ( 0 === strpos( $key, 'um_position_' ) ) {\r\n\t\t\t\t\t$field_key = str_replace('um_position_','',$key);\r\n\t\t\t\t\tif ( isset( $fields[$field_key] ) ) {\r\n\t\t\t\t\t\t$fields[$field_key]['position'] = $value;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// change field master row\r\n\t\t\t\tif ( 0 === strpos( $key, 'um_row_' ) ) {\r\n\t\t\t\t\t$field_key = str_replace('um_row_','',$key);\r\n\t\t\t\t\tif ( isset( $fields[$field_key] ) ) {\r\n\t\t\t\t\t\t$fields[$field_key]['in_row'] = $value;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// change field sub row\r\n\t\t\t\tif ( 0 === strpos( $key, 'um_subrow_' ) ) {\r\n\t\t\t\t\t$field_key = str_replace('um_subrow_','',$key);\r\n\t\t\t\t\tif ( isset( $fields[$field_key] ) ) {\r\n\t\t\t\t\t\t$fields[$field_key]['in_sub_row'] = $value;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// change field column\r\n\t\t\t\tif ( 0 === strpos( $key, 'um_col_' ) ) {\r\n\t\t\t\t\t$field_key = str_replace('um_col_','',$key);\r\n\t\t\t\t\tif ( isset( $fields[$field_key] ) ) {\r\n\t\t\t\t\t\t$fields[$field_key]['in_column'] = $value;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// add field to group\r\n\t\t\t\tif ( 0 === strpos( $key, 'um_group_' ) ) {\r\n\t\t\t\t\t$field_key = str_replace('um_group_','',$key);\r\n\t\t\t\t\tif ( isset( $fields[$field_key] ) ) {\r\n\t\t\t\t\t\t$fields[$field_key]['in_group'] = $value;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\tforeach ( $this->row_data as $k => $v ) {\r\n\t\t\t\tif ( ! in_array( $k, $this->exist_rows ) )\r\n\t\t\t\t\tunset( $this->row_data[$k] );\r\n\t\t\t}\r\n\r\n\t\t\tupdate_option( 'um_existing_rows_' . $form_id, $this->exist_rows );\r\n\r\n\t\t\tupdate_option( 'um_form_rowdata_' . $form_id , $this->row_data );\r\n\r\n\t\t\tUM()->query()->update_attr( 'custom_fields', $form_id, $fields );\r\n\r\n\t\t}", "public static function allPost()\n {\n try {\n $form = [];\n foreach ($_POST as $name => $value) {\n $form[htmlspecialchars($name)] = htmlspecialchars($value);\n }\n return $form;\n } catch (Exception $e) {\n die($e);\n }\n }", "protected function resetFields() {\n parent::resetFields();\n $this->textField1 = null;\n $this->textField2 = null;\n $this->refNr = null;\n $this->userData = null;\n }", "function copyFormData()\n {\n $SessionPost = modApiFunc(\"Session\", \"get\", \"SessionPost\");\n $this->ViewState = $SessionPost[\"ViewState\"];\n\n //Remove some data, that should not be sent to action one more time, from ViewState.\n if(isset($this->ViewState[\"ErrorsArray\"]) &&\n count($this->ViewState[\"ErrorsArray\"]) > 0)\n {\n $this->ErrorsArray = $this->ViewState[\"ErrorsArray\"];\n unset($this->ViewState[\"ErrorsArray\"]);\n }\n $this->POST =\n array(\n \"Id\" => isset($SessionPost[\"Id\"])? $SessionPost[\"Id\"]:\"\"\n ,\"CountryId\" => isset($SessionPost[\"CountryId\"])? $SessionPost[\"CountryId\"]:\"0\"\n ,\"StateId\" => isset($SessionPost[\"StateId\"])? $SessionPost[\"StateId\"]:\"-1\"\n ,\"ProductTaxClassId\" => isset($SessionPost[\"ProductTaxClassId\"])? $SessionPost[\"ProductTaxClassId\"]:\"1\"\n ,\"ProductTaxClassName\" => isset($SessionPost[\"ProductTaxClassName\"])? $SessionPost[\"ProductTaxClassName\"]:\"\"\n ,\"TaxNameId\" => isset($SessionPost[\"TaxNameId\"])? $SessionPost[\"TaxNameId\"]:\"1\"\n ,\"Rate\" => isset($SessionPost[\"Rate\"])? $SessionPost[\"Rate\"]:\"\"\n ,\"FormulaView\" => isset($SessionPost[\"FormulaView\"])? $SessionPost[\"FormulaView\"]:\"&nbsp;\"\n ,\"Formula\" => isset($SessionPost[\"Formula\"])? $SessionPost[\"Formula\"]:\"\"\n ,\"Applicable\" => isset($SessionPost[\"NotApplicable\"])? \"false\":\"true\"\n ,\"TaxRateByZipSet\" => isset($SessionPost[\"TaxRateByZipSet\"]) ? $SessionPost[\"TaxRateByZipSet\"] : 0\n );\n }", "public function getRichFormdata() {\n $formdata = array();\n\n foreach($this->elements as $element) {\n $key = $element['object']->getName();\n\n $value = array (\n \t'value' => $element['object']->getSubmittedValue(),\n \t'description' => $element['object']->getDescription()\n );\n\n $formdata[$key] = $value;\n }\n\n return $formdata;\n }", "protected function loadFormData()\n\t{\n\t\t// Check the session for previously entered form data.\n\t\t$data = JFactory::getApplication()->getUserState('com_sfs.edit.rentalcar.data', array());\n\n\t\tif (empty($data)) {\n\t\t\t$data = $this->getItem();\t\t\t\n\t\t}\n\n\t\treturn $data;\n\t}", "public function reset_postdata()\n {\n }", "protected function loadFormData()\n\t{\n\t\t$data = Factory::getApplication()->getUserState(\n\t\t\t'com_jed.edit.review.data', []\n\t\t);\n\n\t\tif (empty($data))\n\t\t{\n\t\t\t$data = $this->getItem();\n\t\t}\n\n\t\treturn $data;\n\t}", "private function resetInputFields(){\n $this->name = '';\n $this->content = '';\n $this->todo_id = '';\n }", "public function clearPostData()\n {\n $this->post_data = array();\n }", "function NormalizeFormVars()\r\n {\r\n //the element means false. Explicitely setting this false here\r\n //to help in later form value processing\r\n $arr_elements = \r\n $this->config->element_info->GetElements($this->GetCurrentPageNum());\r\n \r\n foreach($arr_elements as $ename => $e)\r\n {\r\n $preparsed_var = $this->config->GetPreParsedVar($ename);\r\n if(isset($this->formvars[$preparsed_var]))\r\n {\r\n $disp_var = $this->config->GetDispVar($ename);\r\n $this->formvars[$disp_var] = $this->formvars[$ename];\r\n $this->formvars[$ename] = $this->formvars[$preparsed_var];\r\n }\r\n if(isset($this->formvars[$ename])){continue;}\r\n \r\n switch($e['type'])\r\n {\r\n case 'single_chk':\r\n {\r\n $this->formvars[$ename] = false;\r\n break;\r\n }\r\n case 'chk_group':\r\n case 'multiselect':\r\n {\r\n $this->formvars[$ename] = array();\r\n break;\r\n }\r\n default:\r\n {\r\n $this->formvars[$ename]='';\r\n }\r\n }\r\n }\r\n }", "protected function loadFormData()\n\t{\n\t\t// Check the session for previously entered form data.\n\t\t$data = JFactory::getApplication()->getUserState('com_tjucm.edit.item.data', array());\n\n\t\tif (empty($data))\n\t\t{\n\t\t\tif ($this->item === null)\n\t\t\t{\n\t\t\t\t$this->item = $this->getItem();\n\t\t\t}\n\n\t\t\t$data = $this->item;\n\t\t}\n\n\t\treturn $data;\n\t}", "public function parsePostData() {\n\t\t$dataset = DB::getInstance()->query('SELECT `id` FROM `'.PREFIX.'dataset` WHERE accountid = '.SessionAccountHandler::getId())->fetchAll();\n\n\t\tforeach ($dataset as $set) {\n\t\t\t$id = $set['id'];\n\t\t\t$modus = isset($_POST[$id.'_modus']) && $_POST[$id.'_modus'] == 'on' ? 2 : 1;\n\t\t\tif (isset($_POST[$id.'_modus_3']) && $_POST[$id.'_modus_3'] == 3)\n\t\t\t\t$modus = 3;\n\n\t\t\t$columns = array(\n\t\t\t\t'modus',\n\t\t\t\t'summary',\n\t\t\t\t'position',\n\t\t\t\t'style',\n\t\t\t\t'class'\n\t\t\t);\n\t\t\t$values = array(\n\t\t\t\t$modus,\n\t\t\t\t(isset($_POST[$id.'_summary']) && $_POST[$id.'_summary'] == 'on' ? 1 : 0),\n\t\t\t\tisset($_POST[$id.'_position']) ? (int)$_POST[$id.'_position'] : '',\n\t\t\t\tisset($_POST[$id.'_style']) ? htmlentities($_POST[$id.'_style']) : '',\n\t\t\t\tisset($_POST[$id.'_class']) ? htmlentities($_POST[$id.'_class']) : ''\n\t\t\t);\n\n\t\t\tDB::getInstance()->update('dataset', $id, $columns, $values);\n\t\t}\n\n\t\tCache::delete('Dataset');\n\t\tAjax::setReloadFlag(Ajax::$RELOAD_DATABROWSER);\n\t}", "private function _processPageForm($csrf)\r\n {\r\n\t\t$oldValues = $this->_getAllValuesDatabaseIndex();\r\n if ($this->getRequest()->isPost()) { // if the user is submitting the form\r\n\t\t\t$values = $_POST['Elements'];\r\n\t\t\tif ($this->_autoCsrfProtection && !$csrf->isValid($_POST)) {\r\n $this->_helper->_flashMessenger(__('There was an error on the form. Please try again.'), 'error');\r\n return;\r\n }\r\n\t\t\tif (!(\"\" == $_POST['item_type_id']) ) { // if the user assigned an item type, save it with the element id of 0. this will force an update if there is already a saved item type.\r\n\t\t\t\t$value = new DefaultMetadataValue;\r\n\t\t\t\t$value->element_id = 0;\r\n\t\t\t\t$value->input_order = 0;\r\n\t\t\t\t$value->text = $_POST['item_type_id'];\r\n\t\t\t\t$value->html = 0;\r\n\t\t\t\t\r\n\t\t\t\ttry {\r\n\t\t\t\t\t$value->setPostData($_POST);\r\n\t\t\t\t\t$value->save();\r\n\t\t\t\t// Catch validation errors.\r\n\t\t\t\t} catch (Omeka_Validate_Exception $e) {\r\n\t\t\t\t\t$this->_helper->flashMessenger($e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tforeach($values as $id => $texts) { //iterate over each textbox on the form and save them to the database\r\n\t\t\t\t\r\n\t\t\t\t$order = 0;\r\n\t\t\t\tforeach($texts as $text) {\r\n\t\t\t\t\tif (!(\"\" == trim($text['text']))) { // if the input has a value\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$value = new DefaultMetadataValue;\r\n\t\t\t\t\t\t$value->element_id = $id;\r\n\t\t\t\t\t\t$value->input_order = $order;\r\n\t\t\t\t\t\t$value->text = $text['text'];\r\n\t\t\t\t\t\t$value->html = intval($text['html']);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$oldValue = $this->_oldValue($value, $oldValues); // check for the corresponding old value\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(!$oldValue) { // if the value's element does not have a value already in the database, save it\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t$value->setPostData($_POST);\r\n\t\t\t\t\t\t\t\t$value->save();\r\n\t\t\t\t\t\t\t// Catch validation errors.\r\n\t\t\t\t\t\t\t} catch (Omeka_Validate_Exception $e) {\r\n\t\t\t\t\t\t\t\t$this->_helper->flashMessenger($e);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else if (($value->text != $oldValue['text']) || ($value->html != $oldValue['html'])) { //if the value already in the database was changed or if the html boolean is different, update the database record.\r\n\t\t\t\t\t\t\t$value->id = $oldValue['id']; // having the id of an existing database record forces UPDATE instead of INSERT\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t$value->setPostData($_POST);\r\n\t\t\t\t\t\t\t\t$value->save();\r\n\t\t\t\t\t\t\t// Catch validation errors.\r\n\t\t\t\t\t\t\t} catch (Omeka_Validate_Exception $e) {\r\n\t\t\t\t\t\t\t\t$this->_helper->flashMessenger($e);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tunset($oldValues[$oldValue['id']]); // remove the old value from the array, so we don't delete it later\r\n\t\t\t\t\t\t} else { // otherwise, the value is unchanged and do not save it to the database\r\n\t\t\t\t\t\t\tunset($oldValues[$oldValue['id']]); // remove the old value from the array, so we don't delete it later\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t$order++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// delete old values not found in the form\r\n\t\t\tforeach($oldValues as $oldValue) {\r\n\t\t\t\t$oldValue->delete();\r\n\t\t\t}\r\n\t\t\t$this->_helper->flashMessenger(__('Default metadata have been saved.'), 'success');\r\n }\r\n }", "protected function loadFormData()\n\t{\n\t\t// Check the session for previously entered form data.\n\t\t$data = JFactory::getApplication()->getUserState('com_projectfork.edit.project.data', array());\n\n\t\tif(empty($data)) $data = $this->getItem();\n\n\t\treturn $data;\n\t}", "protected function loadFormData()\n {\n $app = JFactory::getApplication();\n $data = $app->getUserState('com_jvisualcontent.edit.extrafield.data', array());\n\n if (empty($data)) {\n $data = $this->getItem();\n }\n\n $this->preprocessData('com_jvisualcontent.extrafield', $data);\n\n return $data;\n }", "private function restore()\n {\n if ($this->session->has('sergsxm_form_'.$this->formId)) {\n $this->parameters = $this->session->get('sergsxm_form_'.$this->formId);\n } else {\n $this->parameters = array();\n }\n }", "protected function loadFormData() {\n // Check the session for previously entered form data.\n $data = JFactory::getApplication()->getUserState('com_easysdi_processing.edit.order.data', array());\n\n if (empty($data)) {\n $data = $this->getItem();\n }\n\n return $data;\n }", "protected function loadFormData() {\n // Check the session for previously entered form data.\n $data = JFactory::getApplication()\n ->getUserState('com_rotator.edit.block.data', []);\n if (empty($data)) {\n $data = $this->getItem();\n }\n return $data;\n }", "public function refreshFormSubmission(){\r\n\t\t\t$this->load->model('gs_admission/ajax_base_model', 'AB');\r\n\t\t\t$data[\"school_lists\"] = $this->AB->school_id();\r\n\t\t\t$data[\"grade_lists\"] = $this->AB->grade_id();\r\n\t\t\t$this->load->view('gs_admission/submission/empty_form',$data);\r\n\t\t}", "function emptyPost() {\n\t\t$_POST = array();\n\t}", "function load_values($data = false) {\n\t\tif ($data === false) {\n\t\t\tfix_POST_slashes();\n\t\t\t$data = $_POST;\n\t\t}\n\t\tforeach ($this->fields as $field) {\n\t\t\tif ($field->get_multiple_values()) {\n\t\t\t\t$field_name = $field->get_var_name();\n\t\t\t\tif (isset($data[$field_name])) {\n\t\t\t\t\t$field->set_value($data[$field_name]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (isset($data[$field->get_name()])) {\n\t\t\t\t\t$field->set_value($data[$field->get_name()]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function resetInputFields(){\n $this->title = '';\n $this->content = '';\n }", "public function afterFetch()\n {\n foreach ($this->formfields as $field) {\n $this->fields[$field->fieldKey] = $field->fieldName;\n }\n }", "protected function loadFormData()\n\t{\n\t\t// Check the session for previously entered form data.\n\t\t$data = JFactory::getApplication()->getUserState('com_solidres.edit.tariff.data', array());\n\n\t\tif (empty($data))\n {\n\t\t\t$data = $this->getItem();\n\t\t}\n\n\t\treturn $data;\n\t}", "protected function getPostValues() {}", "function getFormHTML()\n\t{\n\t\tstatic $id_num = 1000;\n\n\t\t$type = $this->type;\n\t\t$name = $this->name;\n\t\t$value = $this->_getTypeValue($this->type, $this->value);\n\t\t$default = $this->_getTypeValue($this->type, $this->default);\n\t\t$column_name = 'extra_vars' . $this->idx;\n\t\t$tmp_id = $column_name . '-' . $id_num++;\n\n\t\t$buff = array();\n\t\tswitch($type)\n\t\t{\n\t\t\t// Homepage\n\t\t\tcase 'homepage' :\n\t\t\t\t$buff[] = '<input type=\"text\" name=\"' . $column_name . '\" value=\"' . $value . '\" class=\"homepage\" />';\n\t\t\t\tbreak;\n\t\t\t// Email Address\n\t\t\tcase 'email_address' :\n\t\t\t\t$buff[] = '<input type=\"text\" name=\"' . $column_name . '\" value=\"' . $value . '\" class=\"email_address\" />';\n\t\t\t\tbreak;\n\t\t\t// Phone Number\n\t\t\tcase 'tel' :\n\t\t\t\t$buff[] = '<input type=\"text\" name=\"' . $column_name . '[]\" value=\"' . $value[0] . '\" size=\"4\" maxlength=\"4\" class=\"tel\" />';\n\t\t\t\t$buff[] = '<input type=\"text\" name=\"' . $column_name . '[]\" value=\"' . $value[1] . '\" size=\"4\" maxlength=\"4\" class=\"tel\" />';\n\t\t\t\t$buff[] = '<input type=\"text\" name=\"' . $column_name . '[]\" value=\"' . $value[2] . '\" size=\"4\" maxlength=\"4\" class=\"tel\" />';\n\t\t\t\tbreak;\n\t\t\t// textarea\n\t\t\tcase 'textarea' :\n\t\t\t\t$buff[] = '<textarea name=\"' . $column_name . '\" rows=\"8\" cols=\"42\">' . $value . '</textarea>';\n\t\t\t\tbreak;\n\t\t\t// multiple choice\n\t\t\tcase 'checkbox' :\n\t\t\t\t$buff[] = '<ul>';\n\t\t\t\tforeach($default as $v)\n\t\t\t\t{\n\t\t\t\t\t$checked = '';\n\t\t\t\t\tif($value && in_array(trim($v), $value))\n\t\t\t\t\t{\n\t\t\t\t\t\t$checked = ' checked=\"checked\"';\n\t\t\t\t\t}\n\n\t\t\t\t\t// Temporary ID for labeling\n\t\t\t\t\t$tmp_id = $column_name . '-' . $id_num++;\n\n\t\t\t\t\t$buff[] =' <li><input type=\"checkbox\" name=\"' . $column_name . '[]\" id=\"' . $tmp_id . '\" value=\"' . htmlspecialchars($v, ENT_COMPAT | ENT_HTML401, 'UTF-8', false) . '\" ' . $checked . ' /><label for=\"' . $tmp_id . '\">' . $v . '</label></li>';\n\t\t\t\t}\n\t\t\t\t$buff[] = '</ul>';\n\t\t\t\tbreak;\n\t\t\t// single choice\n\t\t\tcase 'select' :\n\t\t\t\t$buff[] = '<select name=\"' . $column_name . '\" class=\"select\">';\n\t\t\t\tforeach($default as $v)\n\t\t\t\t{\n\t\t\t\t\t$selected = '';\n\t\t\t\t\tif($value && in_array(trim($v), $value))\n\t\t\t\t\t{\n\t\t\t\t\t\t$selected = ' selected=\"selected\"';\n\t\t\t\t\t}\n\t\t\t\t\t$buff[] = ' <option value=\"' . $v . '\" ' . $selected . '>' . $v . '</option>';\n\t\t\t\t}\n\t\t\t\t$buff[] = '</select>';\n\t\t\t\tbreak;\n\t\t\t// radio\n\t\t\tcase 'radio' :\n\t\t\t\t$buff[] = '<ul>';\n\t\t\t\tforeach($default as $v)\n\t\t\t\t{\n\t\t\t\t\t$checked = '';\n\t\t\t\t\tif($value && in_array(trim($v), $value))\n\t\t\t\t\t{\n\t\t\t\t\t\t$checked = ' checked=\"checked\"';\n\t\t\t\t\t}\n\n\t\t\t\t\t// Temporary ID for labeling\n\t\t\t\t\t$tmp_id = $column_name . '-' . $id_num++;\n\n\t\t\t\t\t$buff[] = '<li><input type=\"radio\" name=\"' . $column_name . '\" id=\"' . $tmp_id . '\" ' . $checked . ' value=\"' . $v . '\" class=\"radio\" /><label for=\"' . $tmp_id . '\">' . $v . '</label></li>';\n\t\t\t\t}\n\t\t\t\t$buff[] = '</ul>';\n\t\t\t\tbreak;\n\t\t\t// date\n\t\t\tcase 'date' :\n\t\t\t\t// datepicker javascript plugin load\n\t\t\t\tContext::loadJavascriptPlugin('ui.datepicker');\n\n\t\t\t\t$buff[] = '<input type=\"hidden\" name=\"' . $column_name . '\" value=\"' . $value . '\" />'; \n\t\t\t\t$buff[] =\t'<input type=\"text\" id=\"date_' . $column_name . '\" value=\"' . zdate($value, 'Y-m-d') . '\" class=\"date\" />';\n\t\t\t\t$buff[] =\t'<input type=\"button\" value=\"' . Context::getLang('cmd_delete') . '\" class=\"btn\" id=\"dateRemover_' . $column_name . '\" />';\n\t\t\t\t$buff[] =\t'<script type=\"text/javascript\">';\n\t\t\t\t$buff[] = '//<![CDATA[';\n\t\t\t\t$buff[] =\t'(function($){';\n\t\t\t\t$buff[] =\t'$(function(){';\n\t\t\t\t$buff[] =\t' var option = { dateFormat: \"yy-mm-dd\", changeMonth:true, changeYear:true, gotoCurrent:false, yearRange:\\'-100:+10\\', onSelect:function(){';\n\t\t\t\t$buff[] =\t' $(this).prev(\\'input[type=\"hidden\"]\\').val(this.value.replace(/-/g,\"\"))}';\n\t\t\t\t$buff[] =\t' };';\n\t\t\t\t$buff[] =\t' $.extend(option,$.datepicker.regional[\\'' . Context::getLangType() . '\\']);';\n\t\t\t\t$buff[] =\t' $(\"#date_' . $column_name . '\").datepicker(option);';\n\t\t\t\t$buff[] =\t' $(\"#dateRemover_' . $column_name . '\").click(function(){';\n\t\t\t\t$buff[] =\t' $(this).siblings(\"input\").val(\"\");';\n\t\t\t\t$buff[] =\t' return false;';\n\t\t\t\t$buff[] =\t' })';\n\t\t\t\t$buff[] =\t'});';\n\t\t\t\t$buff[] =\t'})(jQuery);';\n\t\t\t\t$buff[] = '//]]>';\n\t\t\t\t$buff[] = '</script>';\n\t\t\t\tbreak;\n\t\t\t// address\n\t\t\tcase \"kr_zip\" :\n\t\t\t\tif(($oKrzipModel = getModel('krzip')) && method_exists($oKrzipModel , 'getKrzipCodeSearchHtml' ))\n\t\t\t\t{\n\t\t\t\t\t$buff[] = $oKrzipModel->getKrzipCodeSearchHtml($column_name, $value);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t// General text\n\t\t\tdefault :\n\t\t\t\t$buff[] =' <input type=\"text\" name=\"' . $column_name . '\" value=\"' . ($value ? $value : $default) . '\" class=\"text\" />';\n\t\t}\n\t\tif($this->desc)\n\t\t{\n\t\t\t$oModuleController = getController('module');\n\t\t\t$oModuleController->replaceDefinedLangCode($this->desc);\n\t\t\t$buff[] = '<p>' . htmlspecialchars($this->desc, ENT_COMPAT | ENT_HTML401, 'UTF-8', false) . '</p>';\n\t\t}\n\t\t\n\t\treturn join(PHP_EOL, $buff);\n\t}", "private function resetInputFields(){\n $this->title = '';\n $this->original_url = '';\n $this->platform_id = '';\n }", "public function getFormdata() {\n $formdata = array();\n\n foreach($this->elements as $element) {\n $key = $element['object']->getName();\n $value = $element['object']->getSubmittedValue();\n\n $formdata[$key] = $value;\n }\n\n return $formdata;\n }", "function post_handler() {\r\n\r\n if ($this->action == 'new' or $this->action == 'edit') { # handle new-save\r\n # check permission first\r\n if ( ($this->action == 'new' and !$this->allow_new) or ($this->action == 'edit' and !$this->allow_edit) )\r\n die('Permission not given for \"'.$this->action.'\" action.');\r\n\r\n $_REQUEST['num_row'] = intval($_REQUEST['num_row']) > 0? intval($_REQUEST['num_row']): 1; # new row should get the number of row to insert from num_row\r\n # import suggest field into current datasource (param sugg_field[..]). note: suggest field valid for all rows\r\n if ($this->action == 'new')\r\n $this->import_suggest_field_to_ds();\r\n # only do this if post come from edit form. bground: browse mode now can contain <input>, which value got passed to edit/new mode\r\n if ($this->_save == '') { # to accomodate -1 (preview)\r\n\t\t\t\treturn False;\r\n\t\t\t}\r\n\r\n $this->import2ds(); # only do this if post come from edit form. bground: browse mode now can contain <input>, which value got passed to edit/new mode\r\n $this->db_count = $_REQUEST['num_row']; # new row should get the number of row to insert from num_row\r\n # check requirement\r\n\r\n if (!$this->validate_rows()) # don't continue if form does not pass validation\r\n return False;\r\n\r\n if ($this->action == 'new') {\r\n for ($i = 0; $i < $this->db_count; $i++) {\r\n if (!$this->check_datatype($i)) { # check duplicate index\r\n return False;\r\n }\r\n\r\n if (!$this->check_duplicate_index($i)) { # check duplicate index\r\n return False;\r\n }\r\n if (!$this->check_insert($i)) { # check insertion\r\n return False;\r\n }\r\n }\r\n\r\n if ($this->preview[$this->action] and $this->_save == -1) { # show preview page instead\r\n $this->_preview = True;\r\n return False;\r\n }\r\n\r\n for ($i = 0; $i < $this->db_count; $i++) {\r\n $this->insert($i);\r\n }\r\n\r\n if ($this->_go != '') {\r\n while (@ob_end_clean());\r\n header('Location: '.$this->_go);\r\n exit;\r\n }\r\n }\r\n elseif ($this->action == 'edit') {\r\n $this->populate($this->_rowid, True);\r\n for ($i = 0; $i < $this->db_count; $i++) {\r\n #~ if (!$this->check_duplicate_index($i)) { # check duplicate index\r\n #~ return False;\r\n #~ }\r\n if (!$this->check_update($i)) { # check insertion\r\n return False;\r\n }\r\n }\r\n\r\n if ($this->preview[$this->action] and $this->_save == -1) { # show preview page instead\r\n $this->_preview = True;\r\n return False;\r\n }\r\n\r\n for ($i = 0; $i < $this->db_count; $i++) {\r\n $this->update($i);\r\n }\r\n\r\n if ($this->_go != '') {\r\n #~ include('footer.inc.php');\r\n header('Location: '.$this->_go);\r\n exit;\r\n }\r\n }\r\n }\r\n elseif ($this->action == 'csv') {\r\n /* generate CSV representation of loaded datasource\r\n http://www.creativyst.com/Doc/Articles/CSV/CSV01.htm\r\n */\r\n if (AADM_ON_BACKEND!=1)\r\n die('Permission not given for \"'.$this->action.'\" action.');\r\n $this->browse_rows = 0; # show all data\r\n $this->populate();\r\n $rows = array();\r\n $fields = array();\r\n foreach ($this->properties as $colvar=>$col) {\r\n $vtemp = $this->ds->{$colvar}[$i];\r\n $vtemp = str_replace('\"','\"\"',$vtemp);\r\n $vtemp = (strpos($vtemp,',') === false and strpos($vtemp,'\"') === false and strpos($vtemp,\"\\n\") === false)? $vtemp: '\"'.$vtemp.'\"';\r\n $fields[] = (strpos($col->label,',') === false)? $col->label: '\"'.$col->label.'\"';\r\n }\r\n $rows[] = join(',',$fields);\r\n for ($i = 0; $i < $this->db_count; $i++) {\r\n $fields = array();\r\n foreach ($this->properties as $colvar=>$col) {\r\n $vtemp = $this->ds->{$colvar}[$i];\r\n $vtemp = str_replace('\"','\"\"',$vtemp);\r\n $vtemp = (strpos($vtemp,',') === false and strpos($vtemp,'\"') === false and strpos($vtemp,\"\\n\") === false)? $vtemp: '\"'.$vtemp.'\"';\r\n $fields[] = $vtemp;\r\n }\r\n $rows[] = join(',',$fields);\r\n }\r\n #~ header('Content-type: application/vnd.ms-excel');\r\n header('Content-type: text/comma-separated-values');\r\n header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');\r\n header('Content-Disposition: inline; filename=\"dump.csv\"');\r\n header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\r\n header('Pragma: public');\r\n header('Expires: 0');\r\n\r\n echo join(\"\\r\\n\",$rows);\r\n exit();\r\n }\r\n else { # no-act handler, call its post function callbacks if available\r\n if (AADM_ON_BACKEND==1) {\r\n $callback = 'act_'.$this->action;\r\n if (method_exists($this, $callback)) {\r\n $this->$callback(True);\r\n }\r\n }\r\n }\r\n }", "function formReposts($smarty) {\n if ($_POST) {\n if (isset($_POST['firstname']) && $_POST['firstname']) {\n $smarty->assign('fn', format_uppercase_text($_POST['firstname']));\n }\n if (isset($_POST['lastname']) && $_POST['lastname']) {\n $smarty->assign('ln', format_uppercase_text($_POST['lastname']));\n }\n if (isset($_POST['addressOne']) && $_POST['addressOne']) {\n $smarty->assign('a1', $_POST['addressOne']);\n }\n if (isset($_POST['addressTwo']) && $_POST['addressTwo']) {\n $smarty->assign('a2', $_POST['addressTwo']);\n }\n if (isset($_POST['city']) && $_POST['city']) {\n $smarty->assign('cy', format_uppercase_text($_POST['city']));\n }\n if (isset($_POST['state']) && $_POST['state']) {\n $smarty->assign('state', format_uppercase_text($_POST['state']));\n }\n if (isset($_POST['postalCode']) && $_POST['postalCode']) {\n $smarty->assign('pc', format_uppercase_text($_POST['postalCode']));\n }\n if (isset($_POST['email']) && $_POST['email']) {\n $smarty->assign('em', format_trim(strtolower($_POST['email'])));\n }\n if (isset($_POST['homePhone']) && $_POST['homePhone']) {\n $smarty->assign('hp', $_POST['homePhone']);\n }\n if (isset($_POST['workPhone']) && $_POST['workPhone']) {\n $smarty->assign('wp', $_POST['workPhone']);\n }\n if (isset($_POST['cellPhone']) && $_POST['cellPhone']) {\n $smarty->assign('cp', $_POST['cellPhone']);\n }\n /** - This is no longer required. Positions is now a radio button select.\n if (isset($_POST['goalie']) && $_POST['goalie'] == \"on\") {\n $smarty->assign('gl','checked=\"checked\"');\n }\n if (isset($_POST['defense']) && $_POST['defense'] == \"on\") {\n $smarty->assign('df','checked=\"checked\"');\n }\n if (isset($_POST['center']) && $_POST['center'] == \"on\") {\n $smarty->assign('cr','checked=\"checked\"');\n }\n if (isset($_POST['wing']) && $_POST['wing'] == \"on\") {\n $smarty->assign('wg','checked=\"checked\"');\n }\n */\n if (isset($_POST['position']) && $_POST['position'] == \"Forward\") {\n $smarty->assign('fw', 'CHECKED');\n } else if (isset($_POST['position']) && $_POST['position'] == \"Defense\") {\n $smarty->assign('df', 'CHECKED');\n } else if (isset($_POST['position']) && $_POST['position'] == \"Goalie\") {\n $smarty->assign('gl', 'CHECKED');\n } else {\n $smarty->assign('fw', 'CHECKED');\n }\n if (isset($_POST['jerseySize']) && $_POST['jerseySize'] == \"L\") {\n $smarty->assign('jsl', 'CHECKED');\n } else if (isset($_POST['jerseySize']) && $_POST['jerseySize'] == \"XL\") {\n $smarty->assign('jsxl', 'CHECKED');\n } else if (isset($_POST['jerseySize']) && $_POST['jerseySize'] == \"XXL\") {\n $smarty->assign('jsxxl', 'CHECKED');\n } else if (isset($_POST['jerseySize']) && $_POST['jerseySize'] == \"GOALIE\") {\n $smarty->assign('jsgoalie', 'CHECKED');\n } else {\n $smarty->assign('jsxl', 'CHECKED');\n }\n if ((isset($_POST['jerseyNumChoiceOne']) && $_POST['jerseyNumChoiceOne']) || $_POST['jerseyNumChoiceOne'] == 0) {\n $smarty->assign('j1', $_POST['jerseyNumChoiceOne']);\n }\n if ((isset($_POST['jerseyNumChoiceTwo']) && $_POST['jerseyNumChoiceTwo']) || $_POST['jerseyNumChoiceTwo'] == 0) {\n $smarty->assign('j2', $_POST['jerseyNumChoiceTwo']);\n }\n if ((isset($_POST['jerseyNumChoiceThree']) && $_POST['jerseyNumChoiceThree']) || $_POST['jerseyNumChoiceThree'] == 0) {\n $smarty->assign('j3', $_POST['jerseyNumChoiceThree']);\n }\n if (isset($_POST['skillLevel']) && $_POST['skillLevel'] == \"1\") {\n $smarty->assign('sl1', 'CHECKED');\n } else if (isset($_POST['skillLevel']) && $_POST['skillLevel'] == \"2\") {\n $smarty->assign('sl2', 'CHECKED');\n } else if (isset($_POST['skillLevel']) && $_POST['skillLevel'] == \"3\") {\n $smarty->assign('sl3', 'CHECKED');\n } else if (isset($_POST['skillLevel']) && $_POST['skillLevel'] == \"4\") {\n $smarty->assign('sl4', 'CHECKED');\n } else if (isset($_POST['skillLevel']) && $_POST['skillLevel'] == \"5\") {\n $smarty->assign('sl5', 'CHECKED');\n } else {\n $smarty->assign('sl3', 'CHECKED');\n }\n if (isset($_POST['travelWith']) && $_POST['travelWith']) {\n $smarty->assign('tw', $_POST['travelWith']);\n }\n if (isset($_POST['additionalNotes']) && $_POST['additionalNotes']) {\n $smarty->assign('an', $_POST['additionalNotes']);\n }\n if (isset($_POST['willSub']) && $_POST['willSub'] == \"Y\") {\n $smarty->assign('ys', 'CHECKED'); // Will sub = yes\n $smarty->assign('ns', ''); // Will sub = no\n if (isset($_POST['sunSub']) && $_POST['sunSub'] == \"on\") {\n $smarty->assign('su', 'checked=\"checked\"');\n }\n if (isset($_POST['monSub']) && $_POST['monSub'] == \"on\") {\n $smarty->assign('sm', 'checked=\"checked\"');\n }\n if (isset($_POST['tueSub']) && $_POST['tueSub'] == \"on\") {\n $smarty->assign('st', 'checked=\"checked\"');\n }\n if (isset($_POST['wedSub']) && $_POST['wedSub'] == \"on\") {\n $smarty->assign('sw', 'checked=\"checked\"');\n }\n if (isset($_POST['thuSub']) && $_POST['thuSub'] == \"on\") {\n $smarty->assign('sh', 'checked=\"checked\"');\n }\n if (isset($_POST['friSub']) && $_POST['friSub'] == \"on\") {\n $smarty->assign('sf', 'checked=\"checked\"');\n }\n if (isset($_POST['satSub']) && $_POST['satSub'] == \"on\") {\n $smarty->assign('ss', 'checked=\"checked\"');\n }\n }\n if (isset($_POST['teamRep']) && $_POST['teamRep'] == \"Y\") {\n $smarty->assign('yr', 'CHECKED'); // Will be a team rep\n $smarty->assign('nt', ''); // Will not be a team rep\n \n } else {\n $smarty->assign('yr', ''); // Will be a team rep\n $smarty->assign('nt', 'CHECKED'); // Will not be a team rep\n \n }\n if (isset($_POST['referee']) && $_POST['referee'] == \"Y\") {\n $smarty->assign('wr', 'CHECKED'); // Will referee\n $smarty->assign('nr', ''); // Will not referee\n \n } else {\n $smarty->assign('wr', ''); // Will referee\n $smarty->assign('nr', 'CHECKED'); // Will not referee\n \n }\n if (isset($_POST['paymentPlan']) && $_POST['paymentPlan'] == \"2\") {\n $smarty->assign('p2', 'CHECKED'); // Payment Plan II\n $smarty->assign('p1', ''); // Payment Plan I\n $smarty->assign('p3', ''); // Payment Plan III\n $smarty->assign('p4', ''); // Payment Plan IV\n \n } else if (isset($_POST['paymentPlan']) && $_POST['paymentPlan'] == \"3\") {\n $smarty->assign('p3', 'CHECKED'); // Payment Plan III\n $smarty->assign('p1', ''); // Payment Plan I\n $smarty->assign('p2', ''); // Payment Plan II\n $smarty->assign('p4', ''); // Payment Plan IV\n \n } else if (isset($_POST['paymentPlan']) && $_POST['paymentPlan'] == \"4\") {\n $smarty->assign('p4', 'CHECKED'); // Payment Plan IV\n $smarty->assign('p1', ''); // Payment Plan I\n $smarty->assign('p2', ''); // Payment Plan II\n $smarty->assign('p3', ''); // Payment Plan III\n \n } else if (isset($_POST['paymentPlan']) && $_POST['paymentPlan'] == \"5\") {\n $smarty->assign('p5', 'CHECKED'); // DRIL Payment Plan\n $smarty->assign('p1', ''); // Payment Plan I\n $smarty->assign('p2', ''); // Payment Plan II\n $smarty->assign('p3', ''); // Payment Plan III\n $smarty->assign('p4', ''); // Payment Plan IV\n \n }\n if (isset($_POST['drilLeague']) && $_POST['drilLeague'] == \"1\") {\n $smarty->assign('dl1', 'CHECKED');\n } else if (isset($_POST['drilLeague']) && $_POST['drilLeague'] == \"2\") {\n $smarty->assign('dl2', 'CHECKED');\n } else if (isset($_POST['drilLeague']) && $_POST['drilLeague'] == \"3\") {\n $smarty->assign('dl3', 'CHECKED');\n } else {\n $smarty->assign('dl1', 'CHECKED');\n }\n if (isset($_POST['payToday']) && $_POST['payToday'] == \"on\") {\n $smarty->assign('pt', 'checked=\"checked\"');\n }\n if (isset($_POST['usaHockeyMembership']) && $_POST['usaHockeyMembership']) {\n $smarty->assign('uhm', format_trim(strtoupper($_POST['usaHockeyMembership'])));\n }\n }\n }", "function make_form_row(){\n\t\t$index = $this->col_index;\n\t\t# remove the * at the start of the first line\n\t\t$this->col_data = preg_replace(\"/^\\*/\",\"\",$this->col_data);\n\t\t# split the lines and remove the * from each. The value in each line goes into the array $values\n\t\t$values = preg_split(\"/\\n\\*?/\", $this->col_data);\n\t\t# pad the values array to make sure there are 3 entries\n\t\t$values = array_pad($values, 3, \"\");\n\t\t\n\t\t/*\n\t\tmake three input boxes. TableEdit takes row input from an input array named field a \n\t\tvalue for a particular field[$index] can be an array\n\t\t\tfield[$index][] is the field name\n\t\t\t40 is the length of the box\n\t\t\t$value is the value for the ith line\n\t\t \n\t\t */\n\t\t $form = ''; #initialize\n\t\t foreach($values as $i => $value){\n\t\t\t$form .= \"$i:\".XML::input(\"field[$index][]\",40,$value, array('maxlength'=>255)).\"<br>\\n\";\n\t\t}\n\t\treturn $form;\n\t\n\t}", "protected function loadFormData()\n\t{\n\t\t// Check the session for previously entered form data.\n\t\t$data = JFactory::getApplication()->getUserState('com_extporter.edit.extension.data', array());\n\t\n\t\tif (empty($data)) {\n\t\t\t$data = $this->getItem();\n\t\t}\n\t\n\t\treturn $data;\n\t}", "function gatherFormFields($submitType)\n{\n\t// then pass the data to the appropriate function for\n\t// editing or insertion.\n\t\n\t$arrFields = array(); // To hold the sanitized values\n\t\n\t// Field: ID\n\tif (isset($_POST['dealid']))\n\t{\n\t\t$id = (int)$_POST['dealid'];\n\t}\n\telse\n\t{\n\t\t$submitType = 'new';\t// Even if this was submitted as an edit, if no dealid was provided, create a new record.\n\t}\n\t\n\t// Field: company\n\tif (isset($_POST['edit_company']))\n\t{\n\t\t$arrFields['store'] = intval($_POST['edit_company']);\n\t}\n\telse\n\t{\n\t\t$arrFields['store'] = null;\n\t}\n\t\n\t// Field: dealurl\n\tif (isset($_POST['edit_dealurl']))\n\t{\n\t\t$arrFields['dealurl'] = mysql_real_escape_string($_POST['edit_dealurl']);\n\t}\n\telse\n\t{\n\t\t$arrFields['dealurl'] = '';\n\t}\n\n\t// Field: img\n\tif (isset($_POST['edit_image']))\n\t{\n\t\t$arrFields['img'] = mysql_real_escape_string($_POST['edit_image']);\n\t}\n\telse\n\t{\n\t\t$arrFields['img'] = '';\n\t}\n\n\t// Field: imgurl\n\tif (isset($_POST['edit_imageurl']))\n\t{\n\t\t$arrFields['imgurl'] = mysql_real_escape_string($_POST['edit_imageurl']);\n\t}\n\telse\n\t{\n\t\t$arrFields['imgurl'] = '';\n\t}\n\n\t// Field: showdate\n\tif (isset($_POST['edit_show_date']))\n\t{\n\t\t$arrFields['showdate'] = mysql_real_escape_string($_POST['edit_show_date']);\n\t}\n\telse\n\t{\n\t\t$arrFields['showdate'] = date('Y-m-d H:i:s');\n\t}\n\n\t// Field: expire\n\tif (isset($_POST['edit_expiration_date']))\n\t{\n\t\t$arrFields['expire'] = mysql_real_escape_string($_POST['edit_expiration_date']);\n\t}\n\telse\n\t{\n\t\t$arrFields['expire'] = null;\n\t}\n\n\t// Field: valid\n\tif (isset($_POST['edit_valid']))\n\t{\n\t\t$arrFields['valid'] = intval($_POST['edit_valid']);\n\t}\n\telse\n\t{\n\t\t$arrFields['valid'] = 1;\n\t}\n\t\n\t// Field: invalidreason\n\tif (isset($_POST['edit_invalidreason']))\n\t{\n\t\t$arrFields['invalidreason'] = mysql_real_escape_string($_POST['edit_invalidreason']);\n\t}\n\telse\n\t{\n\t\t$arrFields['invalidreason'] = '';\n\t}\n\t\n\t// Field: subject\n\tif (isset($_POST['edit_subject']))\n\t{\n\t\t$arrFields['subject'] = mysql_real_escape_string($_POST['edit_subject']);\n\t}\n\telse\n\t{\n\t\t$arrFields['subject'] = '';\n\t}\n\t\n\t// Field: brief\n\tif (isset($_POST['edit_brief']))\n\t{\n\t\t$arrFields['brief'] = mysql_real_escape_string($_POST['edit_brief']);\n\t\t$arrFields['verbose'] = mysql_real_escape_string($_POST['edit_brief']);\n\t}\n\telse\n\t{\n\t\t$arrFields['brief'] = '';\n\t\t$arrFields['verbose'] = '';\n\t}\n\n\t// Field: updated\n\t$arrFields['updated']\t\t= date('Y-m-d H:i:s');\n\t$arrFields['whoupdated']\t= $_SESSION['firstname'];\n\t\n\tif ($submitType == 'edit')\n\t{\n\t\tsaveEdit($arrFields, $id);\n\t}\n\telse\n\t{\n\t\tsaveNew($arrFields);\n\t}\n}", "protected function form()\n {\n return [];\n }", "protected function form()\n {\n return [];\n }", "function resetFormFieldVars()\n{\n\t$ProductName = \"\";\n\t$Description = \"\";\n\t$Price = \"\";\n\t$Quantity = \"\";\n\t$SalePrice = 0.0;\n}", "public function form() {\n\t\treturn array();\n\t}", "protected function loadFormData()\n\t{\n\t\t// Check the session for previously entered form data.\n\t\t$app = JFactory::getApplication();\n\t\t$data = $app->getUserState('com_cooltouraman.edit.course.data', array());\n\n\t\tif (empty($data))\n\t\t{\n\t\t\t$data = $this->getItem();\n\n\t\t\t// Pre-select some filters (Status, Category, Language, Access) in edit form if those have been selected in Article Manager: Articles\n\t\t\tif ($this->getState('course.id') == 0)\n\t\t\t{\n\t\t\t\t$filters = (array) $app->getUserState('com_cooltouraman.course.filter');\n\t\t\t\t$data->set(\n\t\t\t\t\t'state',\n\t\t\t\t\t$app->input->getInt(\n\t\t\t\t\t\t'state',\n\t\t\t\t\t\t((isset($filters['published']) && $filters['published'] !== '') ? $filters['published'] : null)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t$data->set('catid', $app->input->getInt('catid', (!empty($filters['category_id']) ? $filters['category_id'] : null)));\n\t\t\t\t$data->set('language', $app->input->getString('language', (!empty($filters['language']) ? $filters['language'] : null)));\n\t\t\t\t$data->set('access', $app->input->getInt('access', (!empty($filters['access']) ? $filters['access'] : JFactory::getConfig()->get('access'))));\n\t\t\t}\n\t\t}\n\n\t\t// If there are params fieldsets in the form it will fail with a registry object\n\t\tif (isset($data->params) && $data->params instanceof Registry)\n\t\t{\n\t\t\t$data->params = $data->params->toArray();\n\t\t}\n\n\t\t$this->preprocessData('com_cooltouraman.course', $data);\n\n\t\treturn $data;\n\t}", "public function getDealerForm($array) {\n\t\t/* If user has requested to edit a dealer, get dealer info and load form with form values filled in.\n\t\t * Check for input error $_SESSION vars first, in case user already submitted form and there were form errors.\n\t\t * Note: $submit_type is included in form hidden input & dictates UPDATE or INSERT db action via process.inc.php file\n\t\t**/\n\t\tif(isset($_SESSION['edit_dealername'])) {\n\t\t\t$edit_dealerID = $_SESSION['edit_dealerID']\t\t;\n\t\t\t$dealername \t= $_SESSION['edit_dealername']\t\t;\n\t\t\t$dealercode \t= $_SESSION['edit_dealercode']\t\t;\n\t\t\t$dealeraddress \t= $_SESSION['edit_dealeraddress']\t;\n\t\t\t$dealercity \t= $_SESSION['edit_dealercity']\t\t;\n\t\t\t$state_ID \t\t= $_SESSION['edit_state_ID']\t\t;\n\t\t\t$state_name \t= $_SESSION['edit_state_name']\t\t;\n\t\t\t$dealerzip \t\t= $_SESSION['edit_dealerzip']\t\t;\n\t\t\t$dealerphone \t= $_SESSION['edit_dealerphone']\t\t;\n\t\t\t$regionID \t\t= $_SESSION['edit_regionID']\t\t;\n\t\t\t$region_name \t= $_SESSION['edit_region_name']\t ;\n\t\t\t$area_ID \t\t= $_SESSION['edit_area_ID']\t\t\t;\n\t\t\t$area_name \t\t= $_SESSION['edit_area_name']\t ;\n\t\t\t$district_ID \t= $_SESSION['edit_district_ID']\t\t;\n\t\t\t$district_name \t= $_SESSION['edit_district_name'] ;\n\t\t\t$submit_type = ($_SESSION['submit_type'] == 'add_dealer') ? 'add_dealer' : 'edit_dealer';\n\t\t\t$submit_value = 'Save Changes';\n\t\t} elseif($array['dealerID']) {\n\t\t\t$array = $this->getDealerData(array('dealerID'=>$array['dealerID']));\n\t\t\t$edit_dealerID = $array[0]['dealerID']\t\t;\n\t\t\t$dealername \t= $array[0]['dealername']\t;\n\t\t\t$dealercode \t= $array[0]['dealercode']\t;\n\t\t\t// Set global var for ensuring user does not try to enter a duplicate dealer code\n\t\t\t$_SESSION['orig_dealercode'] = $dealercode ;\n\t\t\t$dealeraddress \t= $array[0]['dealeraddress'];\n\t\t\t$dealercity \t= $array[0]['dealercity']\t;\n\t\t\t$state_ID \t\t= $array[0]['state_ID']\t\t;\n\t\t\t$state_name \t= $array[0]['state_name']\t;\n\t\t\t$dealerzip \t\t= $array[0]['dealerzip']\t;\n\t\t\t$dealerphone \t= $array[0]['dealerphone']\t;\n\t\t\t$regionID \t\t= $array[0]['regionID']\t\t;\n\t\t\t$region_name \t= $array[0]['region']\t ;\n\t\t\t$area_ID \t\t= $array[0]['area_ID']\t\t;\n\t\t\t$area_name \t\t= $array[0]['area']\t ;\n\t\t\t$district_ID \t= $array[0]['district_ID']\t;\n\t\t\t$district_name \t= $array[0]['district'] ;\n\t\t\t$submit_type = 'edit_dealer';\n\t\t\t$submit_value = 'Save Changes';\n\t\t} else {\n\t\t\t$edit_dealerID = null;\n\t\t\t$dealername \t= null;\n\t\t $dealercode \t= null;\n\t\t $dealeraddress \t= null;\n\t\t $dealercity \t= null;\n\t\t $state_ID \t\t= null;\n\t\t $state_name \t= 'Select...';\n\t\t $dealerzip \t\t= null;\n\t\t $dealerphone \t= null;\n\t\t $regionID \t\t= null;\n\t\t $region_name \t= 'Select...';\n\t\t $area_ID \t\t= null;\n\t\t $area_name \t\t= 'Select...';\n\t\t $district_ID \t= null;\n\t\t $district_name \t= 'Select...';\n\t\t $submit_type = 'add_dealer';\n\t\t $_SESSION['submit_type'] = 'add_dealer';\n\t\t $submit_value = 'Register '.ENTITY.' &raquo';\n\t\t}\n\t\t$html ='\n\t\t<form method=\"post\" action=\"system/utils/process.inc.php\" class=\"dealer_form\">\n\t\t\t<div class=\"row\">\n\t\t\t\t<div class=\"small-12 medium-12 large-12 columns\">\n\t\t\t\t\t<div class=\"small-12 medium-6 large-4 columns\">\n\t\t\t\t\t\t<label>'.ENTITY.' Name\n\t\t\t\t\t\t\t<input type=\"text\" value=\"'.$dealername.'\" id=\"dealername\" name=\"dealername\" autofocus>\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"small-12 medium-6 large-4 columns\">\n\t\t\t\t\t\t<label>'.ENTITY.' Code\n\t\t\t\t\t\t\t<input type=\"text\" value=\"'.$dealercode.'\" id=\"dealercode\" name=\"dealercode\">\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"small-12 medium-6 large-4 columns\">\n\t\t\t\t\t\t<label>'.ENTITY.' Address\n\t\t\t\t\t\t\t<input type=\"text\" value=\"'.$dealeraddress.'\" id=\"dealeraddress\" name=\"dealeraddress\">\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"small-12 medium-6 large-4 columns\">\n\t\t\t\t\t\t<label>'.ENTITY.' City\n\t\t\t\t\t\t\t<input type=\"text\" value=\"'.$dealercity.'\" id=\"dealercity\" name=\"dealercity\">\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"small-12 medium-6 large-4 columns\">\n\t\t\t\t\t\t<label>'.ENTITY.' State\n\t\t\t\t\t\t\t<select id=\"state\" name=\"state\">\n\t\t\t\t\t\t\t\t<option value=\"'.$state_ID.','.$state_name.'\">'.$state_name.'</option>';\n\t\t\t\t\t\t\t\t$data = $this->getStateData();\n\t\t\t\t\t\t\t\tfor ($i=0; $i<count($data); $i++) {\n\t\t\t\t\t\t\t\t\t$html .='<option value=\"'.$data[$i]['state_ID'].', '.$data[$i]['state_name'].'\">'.$data[$i]['state_name'].'</option>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$html .='\n\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"small-12 medium-6 large-4 columns\">\n\t\t\t\t\t\t<label>'.ENTITY.' Zip Code\n\t\t\t\t\t\t\t<input type=\"text\" value=\"'.$dealerzip.'\" id=\"dealerzip\" name=\"dealerzip\">\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"small-12 medium-6 large-4 columns\">\n\t\t\t\t\t\t<label>Phone Number\n\t\t\t\t\t\t\t<input type=\"text\" value=\"'.$dealerphone.'\" id=\"dealerphone\" name=\"dealerphone\">\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"small-12 medium-6 large-4 columns\">\n\t\t\t\t\t\t<label>'.ENTITY.' Region\n\t\t\t\t\t\t\t<select id=\"region\" name=\"region\">\n\t\t\t\t\t\t\t\t<option value=\"'.$regionID.','.$region_name.'\">'.$region_name.'</option>';\n\t\t\t\t\t\t\t\t$data = $this->getRegionData();\n\t\t\t\t\t\t\t\tfor ($i=0; $i<count($data); $i++) {\n\t\t\t\t\t\t\t\t\t$html .='<option value=\"'.$data[$i]['regionID'].', '.$data[$i]['region'].'\">'.$data[$i]['region'].'</option>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$html .='\n\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"small-12 medium-6 large-4 columns\">\n\t\t\t\t\t\t<label>'.ENTITY.' District\n\t\t\t\t\t\t\t<select id=\"district\" name=\"district\">\n\t\t\t\t\t\t\t\t<option value=\"'.$district_ID.','.$district_name.'\">'.$district_name.'</option>';\n\t\t\t\t\t\t\t\t$data = $this->getDistrictData();\n\t\t\t\t\t\t\t\tfor ($i=0; $i<count($data); $i++) {\n\t\t\t\t\t\t\t\t\t$html .='<option value=\"'.$data[$i]['district_ID'].', '.$data[$i]['district'].'\">'.$data[$i]['district'].'</option>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$html .='\n\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"small-12 medium-6 large-4 columns\">\n\t\t\t\t\t\t<label>'.ENTITY.' Area\n\t\t\t\t\t\t\t<select id=\"area\" name=\"area\">\n\t\t\t\t\t\t\t\t<option value=\"'.$area_ID.','.$area_name.'\">'.$area_name.'</option>';\n\t\t\t\t\t\t\t\t$data = $this->getAreaData();\n\t\t\t\t\t\t\t\tfor ($i=0; $i<count($data); $i++) {\n\t\t\t\t\t\t\t\t\t$html .='<option value=\"'.$data[$i]['area_ID'].', '.$data[$i]['area'].'\">'.$data[$i]['area'].'</option>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$html .='\n\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"small-12 medium-12 large-12 columns\">\n\t\t\t\t\t\t<input type=\"hidden\" id=\"action\" name=\"action\" value=\"'.$submit_type.'\" />\n\t\t\t\t\t\t<input type=\"hidden\" id=\"edit_dealerID\" name=\"edit_dealerID\" value=\"'.$edit_dealerID.'\" />\n\t\t\t\t\t\t<input type=\"submit\" id=\"submit\" name=\"submit\" value=\"'.$submit_value.'\" class=\"tiny button radius\">\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</form>\n\n\t\t<div class=\"row\">\n\t\t\t<div class=\"small-12 medium-12 large-12 columns\">\n\t\t\t\t<hr>\n\t\t\t</div>\n\t\t</div>';\n\t\treturn $html;\n\t}", "protected function loadFormData()\n\t{\n\t\t$data = JFactory::getApplication()->getUserState('com_judges.edit.judge.data', array());\n\n\t\tif (empty($data)) {\n\t\t\t$data \t\t\t\t\t\t= $this->getItem();\n\t\t}\n\n\t\treturn $data;\n\t}", "public function postPartnerFormEdits()\n {\n $input_array = array();\n if ($_SERVER[\"REQUEST_METHOD\"] == \"POST\")\n {\n $input_array['title'] = $this->test_input($_POST['title']);\n $input_array['sub_title'] = $this->test_input($_POST['sub-title']);\n $input_array['desc_head'] = $this->test_input($_POST['desc-head']);\n $input_array['desc_body'] = $this->test_input($_POST['desc-body']);\n $input_array['desc_list_head'] = $this->test_input($_POST['desc-list-head']);\n $input_array['desc_list_data'] = $this->test_input($_POST['desc-list-data']);\n $input_array['desc_footer_head'] = $this->test_input($_POST['desc-footer-head']);\n $input_array['desc_footer_body'] = $this->test_input($_POST['desc-footer-body']);\n $input_array['info_head'] = $this->test_input($_POST['info-head']);\n $input_array['info_body'] = $this->test_input($_POST['info-body']);\n $input_array['info_list_head'] = $this->test_input($_POST['info-list-head']);\n $input_array['info_list_data'] = $this->test_input($_POST['info-list-data']);\n $input_array['info_footer_head'] = $this->test_input($_POST['info-footer-head']);\n $input_array['info_footer_body'] = $this->test_input($_POST['info-footer-body']);\n $input_array['footer_head'] = $this->test_input($_POST['footer-head']);\n $input_array['footer_body'] = $this->test_input($_POST['footer-body']);\n $input_array['footer_list_head'] = $this->test_input($_POST['footer-list-head']);\n $input_array['footer_list_data'] = $this->test_input($_POST['footer-list-data']);\n $input_array['contact_name'] = $this->test_input($_POST['contact-name']);\n $input_array['contact_title'] = $this->test_input($_POST['contact-title']);\n $input_array['contact_desc'] = $this->test_input($_POST['contact-desc']);\n $input_array['contact_phone'] = $this->test_input($_POST['contact-phone']);\n $input_array['contact_email'] = $this->test_input($_POST['contact-email']);\n\n if(!empty($_FILES[\"usr-file-upload\"][\"name\"]))\n {\n $img_path = $this->fileUpload();\n\n if(!is_array($img_path))\n {\n $input_array['img_path'] = $img_path;\n }\n else\n {\n $this->_errors = $img_path;\n }\n }\n else\n {\n $input_array['img_path'] = $this->test_input($_POST['img-path']);\n }\n $input_array['link'] = $this->test_input($_POST['link']);\n $input_array['link_text'] = $this->test_input($_POST['link-text']);\n }\n\n if(is_array($img_path))\n {\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo '<div class=\"container-fluid\">';\n echo '<div class=\"alert alert-danger\">';\n echo '<strong>Danger!</strong>';\n if(is_array($img_path))\n {\n foreach ($img_path as $error)\n {\n echo '<p>' . $error . '</p>';\n }\n }\n echo '</div>';\n echo '</div>';\n }\n else\n {\n $database = new Database();\n\n if($database->updatePartner($input_array, $this->_params['id']))\n {\n $url = '/Admin/edit-partner/' . $this->_params['id'];\n $this->_f3->reroute($url . '/success');\n }\n else\n {\n $errors = $database->getErrors();\n\n if(!empty($errors))\n {\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo '<div class=\"container-fluid\">';\n echo '<div class=\"alert alert-danger\">';\n echo '<strong>Danger!</strong>';\n foreach($errors as $error)\n {\n echo '<p>' . $error . '</p>';\n }\n echo '</div>';\n echo '</div>';\n }\n }\n }\n }", "function postToVar() {\n foreach ($this->fields() as $f) {\n if ($this->$f === false) $this->$f = $this->input->post($f);\n }\n }", "protected function loadFormData() \n\t{\n\t\t$data = JFactory::getApplication()->getUserState('com_squadmanagement.edit.war.data', array());\n\t\tif (empty($data)) \n\t\t{\n\t\t\t$data = $this->getItem();\n\t\t}\n\t\treturn $data;\n\t}", "public function GetFormPostedValuesQuestions() {\n\t\t/* THE ARRAY OF POSTED FIELDS */\n\t\t$req_fields=array(\"survey_id\",\"question\");\n\n\t\tfor ($i=0;$i<count($req_fields);$i++) {\n\n\t\t\t//echo $_POST['application_id'];\n\t\t\tif (ISSET($_POST[$req_fields[$i]]) && !EMPTY($_POST[$req_fields[$i]])) {\n\t\t\t\t$this->SetVariable($req_fields[$i],EscapeData($_POST[$req_fields[$i]]));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//echo \"<br>\".$this->req_fields[$i].\"<br>\";\n\t\t\t\t$this->$req_fields[$i]=\"\";\n\t\t\t}\n\t\t}\n\t}", "protected function loadFormData()\n\t{\n\t\t// Check the session for previously entered form data.\n\t\t$data = JFactory::getApplication()->getUserState('com_joaktree.edit.location.data', array());\n\n\t\tif (empty($data)) {\t\t\n\t\t\t$data = $this->getItem();\n\t\t\t$data->resultValue2 = $data->resultValue;\n\t\t}\n\n\t\treturn $data;\n\t}", "protected function loadFormData() \r\n {\r\n $data = JFactory::getApplication()->getUserState('com_odyssey.edit.order.data', array());\r\n\r\n if(empty($data)) {\r\n $data = $this->getItem();\r\n }\r\n\r\n return $data;\r\n }", "function handle_post($indata) {\n// showDebug('form_class POST:');\n// showArray($indata); \n return;\n }", "public function getFormData(){\n\n\t\t\t\n\t\t\t$expectedVariables = ['title','email','checkbox'];\n\n\n\t\t\tforeach ($expectedVariables as $variable) {\n\n\t\t\t\t// creating entries for error field\t\n\t\t\t\t$this->moviesuggest['errors'][$variable]=\"\";\n\n\t\t\t\t// move all $_POST values into MovieSuggest array\n\t\t\t\tif(isset($_POST[$variable])){\n\t\t\t\t\t$this->moviesuggest[$variable] = $_POST[$variable];\n\t\t\t\t}else{\n\t\t\t\t\t$this->moviesuggest[$variable] = \"\";\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\t// var_dump($moviesuggest);\n\t\t\t// die();\n\t}", "function genSubmitRow(){\n\t\t$row = array();\n\t\tarray_pad($row, sizeof($this->table[0]), '');\n\n\t\tif($this->state->isNewEntry()){\n\t\t\t$textField = 'text';\n\t\t\t$row[0] = $this->translator->markupAttributes('input', '',array('type'=>'text', 'name'=>'user'));\n\t\t\t$row[1] = $this->translator->markupAttributes('input','',array('type'=>'submit', 'name'=>'submit', 'value'=>'Submit'));\n\n\n\t\t\tfor($count = 2; $count < sizeof($this->table[0]); $count++) $row[$count] = $this->translator->markupAttributes('input', '',array('type'=>'checkbox', 'name'=>$count));\n\t\t\n\t\t}\n\t\telse{\n\t\t\t$row[0] = '';\n\t\t\t$row[1] = $this->translator->markupAttributes('input','',array('type'=>'submit', 'name'=>'new', 'value'=>'New'));\n\n\t\t\tfor($count = 2; $count < sizeof($this->table[0]); $count++) $row[$count] = '';\n\t\t}\n\n\t\treturn $row;\n\t}", "protected function loadFormData() \r\n\t{\r\n\t\t// Check the session for previously entered form data.\r\n\t\t$data = JFactory::getApplication()->getUserState('com_bigbluebutton.edit.meeting.data', array());\r\n\r\n\t\tif (empty($data))\r\n\t\t{\r\n\t\t\t$data = $this->getItem();\r\n\t\t}\r\n\r\n\t\treturn $data;\r\n\t}", "function get_input_array () {\n\t$input = array();\n\n\t// collect input values from the form\n\t$input['maker'] = isset($_POST['maker']) ? $_POST['maker'] : '';\n\t$input['model'] = isset($_POST['model']) ? $_POST['model'] : '';\n\t$input['speed'] = isset($_POST['speed']) ? $_POST['speed'] : '';\n\t$input['ram'] = isset($_POST['ram']) ? $_POST['ram'] : '';\n\t$input['hd'] = isset($_POST['hd']) ? $_POST['hd'] : '';\n\t$input['price'] = isset($_POST['price']) ? $_POST['price'] : '';\n\n\t// use the new_maker field instead of the maker field if it's set\n\t$new_maker = isset($_POST['new_maker']) ? $_POST['new_maker'] : '';\n\tif (!empty($new_maker)) {\n\t\t$input['maker'] = $new_maker;\n\t}\n\n\treturn $input;\n}", "function getForm($form, &$form_state, $disabled, $myvalues)\n {\n $form[\"data_entry_area1\"] = array(\n '#prefix' => \"\\n<section class='protocollib-admin raptor-dialog-table'>\\n\",\n '#suffix' => \"\\n</section>\\n\",\n );\n $form[\"data_entry_area1\"]['table_container'] = array(\n '#type' => 'item', \n '#prefix' => '<div class=\"raptor-dialog-table-container\">',\n '#suffix' => '</div>', \n '#tree' => TRUE,\n );\n\n\tglobal $base_url;\n $language_infer = new \\raptor_formulas\\LanguageInference();\n\t\t\n $showDeleteOption = $this->m_oUserInfo->hasPrivilege('REP1');\n $showAddOption = $this->m_oUserInfo->hasPrivilege('UNP1');\n \n $rows = \"\\n\";\n $result = db_select('raptor_protocol_lib', 'p')\n ->fields('p')\n ->orderBy('protocol_shortname')\n ->execute();\n foreach($result as $item) \n {\n $protocol_shortname = $item->protocol_shortname;\n if($item->original_file_upload_dt == NULL)\n {\n $docuploadedmarkup = 'No';\n } else {\n $docuploadedmarkup = '<span class=\"hovertips\" title=\"uploaded '\n .$item->original_filename\n .' on '\n .$item->original_file_upload_dt.'\">Yes</span>';\n }\n $keywords = $this->getFormattedKeywordsForTable($protocol_shortname);\n $active_markup = $item->active_yn == 1 ? '<b>Yes</b>' : 'No';\n $declaredHasContrast = $item->contrast_yn == 1 ? TRUE : FALSE;\n $hasSedation = $item->sedation_yn == 1 ? '<b>Yes</b>' : 'No';\n $hasRadioisotope = $item->sedation_yn == 1 ? '<b>Yes</b>' : 'No';\n $fullname = $item->name;\n $infered_hasContrast = $language_infer->inferContrastFromPhrase($fullname);\n $hasContrastMarkup = $declaredHasContrast ? '<b>Yes</b>' : 'No';\n if($infered_hasContrast !== NULL)\n {\n if(!(\n ($declaredHasContrast && $infered_hasContrast) || \n (!$declaredHasContrast && !$infered_hasContrast))\n )\n {\n if($infered_hasContrast)\n {\n $troublemsg = \"protocol long name implies YES contrast\";\n } else {\n $troublemsg = \"protocol long name implies NO contrast\";\n }\n $hasContrastMarkup = \"<span class='medical-health-warn' title='$troublemsg'>!!! $hasContrastMarkup !!!</span>\";\n }\n }\n if(!$showAddOption)\n {\n $addActionMarkup = '';\n $editActionMarkup = '';\n } else {\n $addActionMarkup = '<a href=\"'.$base_url.'/raptor/viewprotocollib?protocol_shortname='.$item->protocol_shortname.'\">View</a>';\n $editActionMarkup = '<a href=\"'.$base_url.'/raptor/editprotocollib?protocol_shortname='.$item->protocol_shortname.'\">Edit</a>';\n }\n if(!$showDeleteOption)\n {\n $deleteActionMarkup = '';\n } else {\n $deleteActionMarkup = '<a href=\"'.$base_url.'/raptor/deleteprotocollib?protocol_shortname='.$item->protocol_shortname.'\">Delete</a>';\n }\n $rows .= \"\\n\".'<tr>'\n . '<td>'.$protocol_shortname.'</td>'\n . '<td>'.$fullname.'</td>'\n . '<td>'.$active_markup.'</td>'\n . '<td>'.$hasContrastMarkup.'</td>'\n . '<td>'.$hasSedation.'</td>'\n . '<td>'.$hasRadioisotope.'</td>'\n . '<td>'.$item->modality_abbr.'</td>'\n . '<td>'.$item->version.'</td>'\n . '<td>'.$docuploadedmarkup.'</td>'\n . '<td>'.$keywords.'</td>'\n . \"<td>$addActionMarkup</td>\"\n . \"<td>$editActionMarkup</td>\"\n . \"<td>$deleteActionMarkup</td>\"\n . '</tr>';\n }\n\n $form[\"data_entry_area1\"]['table_container']['protocols'] = array('#type' => 'item',\n '#markup' => '<table id=\"my-raptor-dialog-table\" class=\"dataTable\">'\n . '<thead>'\n . '<tr>'\n . '<th title=\"System unique identifier for the protocol\">Short Name</th>'\n . '<th title=\"Full name of the protocol\">Long Name</th>'\n . '<th title=\"Only active protocols are available for use on new exams\">Is Active</th>'\n . '<th title=\"Has contrast\">C</th>'\n . '<th title=\"Has sedation\">S</th>'\n . '<th title=\"Has radioisotope\">R</th>'\n . '<th title=\"The equipment context for this protocol\">Modality</th>'\n . '<th title=\"Value increases with each saved edit\">Version</th>'\n . '<th title=\"The scanned document\">Doc Uploaded</th>'\n . '<th title=\"Keywords used for matching this protocol programatically\">Keywords</th>'\n . '<th title=\"Just view the protocol\">View</th>'\n . '<th title=\"Edit the protocol details\">Edit</th>'\n . '<th title=\"Remove this protocol from the library\">Delete</th>'\n . '</tr>'\n . '</thead>'\n . '<tbody>'\n . $rows\n . '</tbody>'\n . '</table>');\n \n $form['data_entry_area1']['action_buttons'] = array(\n '#type' => 'item', \n '#prefix' => '<div class=\"raptor-action-buttons\">',\n '#suffix' => '</div>', \n '#tree' => TRUE,\n );\n $form['data_entry_area1']['action_buttons']['createlink'] \n = array('#type' => 'item'\n , '#markup' => '<a class=\"button\" href=\"'\n .$base_url.'/raptor/addprotocollib\">Add Protocol</a>');\n\n $form['data_entry_area1']['action_buttons']['cancel'] = array('#type' => 'item'\n , '#markup' => '<input class=\"raptor-dialog-cancel\" type=\"button\" value=\"Exit\" />'); \n \n \n return $form;\n }", "function get_form_dict($vars, $runtime = 0, $ar_broken = array(), $ar_req = array())\r\n\t{\r\n\t\tglobal $topic_mode, $arFields, $gw_this;\r\n\t\t$topic_mode = 'form';\r\n\t\t\t\r\n\t\t$str_hidden = '';\r\n\t\t$str_form = '';\r\n\t\t$v_class_1 = 'td1';\r\n\t\t$v_class_2 = 'td2';\r\n\t\t$v_td1_width = '25%';\r\n\r\n\t\t$oForm = new gwForms();\r\n\t\t$oForm->Set('action', $this->sys['page_admin']);\r\n\t\t$oForm->Set('submitok', $this->oL->m('3_save'));\r\n\t\t$oForm->Set('submitcancel', $this->oL->m('3_cancel'));\r\n\t\t$oForm->Set('formbgcolor', $this->ar_theme['color_2']);\r\n\t\t$oForm->Set('formbordercolor', $this->ar_theme['color_4']);\r\n\t\t$oForm->Set('formbordercolorL', $this->ar_theme['color_1']);\r\n\t\t$oForm->Set('align_buttons', $this->sys['css_align_right']);\r\n\t\t$oForm->Set('formwidth', '100%');\r\n\t\t$oForm->Set('charset', $this->sys['internal_encoding']);\r\n\r\n\t\tif ($this->gw_this['vars'][GW_ACTION] == GW_A_EDIT)\r\n\t\t{\r\n\t\t\t$oForm->isButtonDel = 1;\r\n\t\t\t$oForm->Set('submitdelname', 'remove');\r\n\t\t\t$oForm->Set('submitdel', $this->oL->m('3_remove'));\r\n\t\t}\r\n\r\n\t\t$ar_req = array_flip($ar_req);\r\n\t\t/* mark fields as \"Required\" and display error message */\r\n\t\twhile (is_array($vars) && list($k, $v) = each($vars) )\r\n\t\t{\r\n\t\t\t$ar_req_msg[$k] = $ar_broken_msg[$k] = '';\r\n\t\t\tif (isset($ar_req[$k])) { $ar_req_msg[$k] = '&#160;<span class=\"red\"><strong>*</strong></span>'; }\r\n\t\t\tif (isset($ar_broken[$k])) { $ar_broken_msg[$k] = '<span class=\"red\"><strong>' . $this->oL->m('reason_9') . '</strong></span><br />'; }\r\n\t\t}\r\n\t\t/* Search length */\r\n\t\t$arNums = array(0 => $this->oL->m('1038'), 1, 2, 3, 4, 5);\r\n\t\t/* Tree of topics */\r\n\t\t$arTopics = gw_create_tree_topics();\r\n\r\n\t\t/* */\r\n\t\t$str_form .= getFormTitleNav( $this->oL->m('1137'), '<span style=\"float:right\">'.$oForm->get_button('submit').'</span>' );\r\n\r\n\r\n\t\tif ($this->gw_this['vars'][GW_ACTION] == GW_A_ADD)\r\n\t\t{\r\n\t\t\t$oForm->Set('isButtonSubmit', 1);\r\n\r\n\t\t\t$str_form .= '<fieldset class=\"admform\"><legend class=\"xq\">&#160;</legend>';\r\n\t\t\t$str_form .= '<table class=\"gw2TableFieldset\" width=\"100%\">';\r\n\t\t\t$str_form .= '<tbody><tr><td style=\"width:'.$v_td1_width.'\"></td><td></td></tr>';\r\n\t\t\t$str_form .= '<tr>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_1.'\">' . $oForm->field('checkbox', \"arPost[is_active]\", $vars['is_active']) . '</td>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_2.'\">' . '<label for=\"'.$oForm->text_field2id('arPost[is_active]').'\">'.$this->oL->m('1320').'</label></td>'.\r\n\t\t\t\t\t\t'</tr>';\r\n\t\t\t$str_form .= '<tr>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_1.'\">' . $this->oL->m('dict_name') . ':' . $ar_req_msg['title'] . '</td>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_2.'\">' . $ar_broken_msg['title'] . $oForm->field(\"textarea\", \"arPost[title]\", textcodetoform($vars['title']), 3) . '</td>'.\r\n\t\t\t\t\t\t'</tr>';\r\n\t\t\t$str_form .= '<tr>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_1.'\">' . $this->oL->m('descr') . ':</td>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_2.'\">' . $oForm->field(\"textarea\", \"arPost[description]\", textcodetoform($vars['description']), 7) . '</td>'.\r\n\t\t\t\t\t\t'</tr>';\r\n\t\t\t/* Used to select the currect topic */\r\n\t\t\t$gw_this['vars']['id_topic'] = $vars['id_topic'];\r\n\t\t\t$str_form .= '<tr>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_1.'\">' . $this->oL->m('topic') . ':' . $ar_req_msg['id_topic'] . '</td>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_2.'\">' . $ar_broken_msg['id_topic'].\r\n\t\t\t\t\t\t'<select class=\"input75\" dir=\"ltr\" name=\"arPost[id_topic]\">' . ctlgGetTopicsRow($arTopics, 0, 1) . '</select>' .\r\n\t\t\t\t\t\t'</td>'.\r\n\t\t\t\t\t\t'</tr>';\r\n\t\t\t$str_form .= '</tbody></table>';\r\n\t\t\t$str_form .= '</fieldset>';\r\n\t\t\t/* */\r\n\t\t\t$str_form .= getFormTitleNav($this->oL->m('1136'), '');\r\n\t\t\t$oForm->setTag('select', 'class', 'input75');\r\n\t\t\t$oForm->setTag('select', 'style', '');\r\n\t\t\t$str_form .= '<fieldset class=\"admform\"><legend class=\"xq\">&#160;</legend>';\r\n\t\t\t$str_form .= '<table class=\"gw2TableFieldset\" width=\"100%\">';\r\n\t\t\t$str_form .= '<tbody><tr><td style=\"width:'.$v_td1_width.'\"></td><td></td></tr>';\r\n\t\t\t$str_form .= '<tr>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_1.'\">' . $this->oL->m('default_lang') . ':' . $ar_req_msg['lang'] . '</td>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_2.'\">' . $oForm->field('select', 'arPost[lang]', $vars['lang'], '0', array_merge(array($this->oL->m('1270')), $this->gw_this['vars']['ar_languages'])) . '</td>'.\r\n\t\t\t\t\t\t'</tr>';\r\n\t\t\t$str_form .= '<tr>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_1.'\">' . $this->oL->m('visual_theme') . ':' . $ar_req_msg['visualtheme'] . '</td>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_2.'\">' . $oForm->field('select', 'arPost[visualtheme]', $vars['visualtheme'], 0, array_merge(array($this->oL->m('1270')), $this->gw_this['ar_themes_select'])) . '</td>'.\r\n\t\t\t\t\t\t'</tr>';\r\n\t\t\t$str_form .= '</tbody></table>';\r\n\t\t\t$str_form .= '</fieldset>';\r\n\r\n\t\t\t/* System settings */\r\n\t\t\t$str_form .= getFormTitleNav($this->oL->m('1138'), '');\r\n\t\t\t$oForm->setTag('input', 'onkeyup', 'gwJS.strNormalize(this)');\r\n\t\t\t$str_form .= '<fieldset class=\"admform\"><legend class=\"xq\">&#160;</legend>';\r\n\t\t\t$str_form .= '<table class=\"gw2TableFieldset\" width=\"100%\">';\r\n\t\t\t$str_form .= '<tbody><tr><td style=\"width:'.$v_td1_width.'\"></td><td></td></tr>';\r\n\t\t\t$str_form .= '<tr>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_1.'\">' . $this->oL->m('sysname') . ':' . $ar_req_msg['tablename'] . '</td>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_2.'\">' . $ar_broken_msg['tablename'] . $oForm->field(\"input\", \"arPost[tablename]\", textcodetoform( $vars['tablename'] ) ) . '</td>'.\r\n\t\t\t\t\t\t'</tr>';\r\n\t\t\t$str_form .= '</tbody></table>';\r\n\t\t\t$str_form .= '</fieldset>';\r\n\t\t\t$oForm->setTag('input', 'onkeyup', '');\r\n\r\n\t\t\t$str_form .= $oForm->field(\"hidden\", GW_ACTION, GW_A_ADD);\r\n\t\t\t$str_form .= $oForm->field(\"hidden\", GW_TARGET, GW_T_DICT);\r\n\t\t\t$str_form .= $oForm->field(\"hidden\", \"arPost[uid]\", $vars['tablename']);\r\n\t\t\t$oForm->unsetTag('select');\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$oForm->setTag('select', 'class', 'input75');\r\n\r\n\t\t\t/* Editing the dictionary settings */\r\n\t\t\t$str_form .= '<fieldset class=\"admform\"><legend class=\"xq\">&#160;</legend>';\r\n\t\t\t$str_form .= '<table class=\"gw2TableFieldset\" width=\"100%\">';\r\n\t\t\t$str_form .= '<tbody><tr><td style=\"width:'.$v_td1_width.'\"></td><td></td></tr>';\r\n\r\n\t\t\t$str_form .= '<tr>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_1.'\">' . $oForm->field('checkbox', 'arPost[is_active]', $vars['is_active']) . '</td>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_2.'\">' . '<label for=\"'.$oForm->text_field2id('arPost[is_active]').'\">'.$this->oL->m('1320').'</label></td>'.\r\n\t\t\t\t\t\t'</tr>';\r\n\t\t\t$str_form .= '<tr>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_1.'\">' . $this->oL->m('dict_name') . ':' . $ar_req_msg['title'] . '</td>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_2.'\">' . $ar_broken_msg['title'] . $oForm->field('textarea', 'arPost[title]', gw_fix_db_to_field($vars['title']), 2) . '</td>'.\r\n\t\t\t\t\t\t'</tr>';\r\n\t\t\t\r\n\t\t\t/* 1.8.5 Dictionary URI */\r\n\t\t\tif ($this->sys['pages_link_mode'] == GW_PAGE_LINK_URI)\r\n\t\t\t{\r\n\t\t\t\t$oForm->setTag('input', 'onkeyup', 'gwJS.strNormalize(this)');\r\n\t\t\t\t$oForm->setTag('input', 'maxlength', '255');\r\n\t\t\t\t$oForm->setTag('input', 'size', '50');\r\n\t\t\t\t$str_form .= '<tr>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_1.'\">' . $this->oL->m('1073') . ':' . $ar_req_msg['dict_uri'] . '</td>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_2.'\">' . $ar_broken_msg['dict_uri'] . $oForm->field(\"input\", \"arPost[dict_uri]\", textcodetoform( $vars['dict_uri'] ) ) . '</td>'.\r\n\t\t\t\t\t\t'</tr>';\r\n\t\t\t\t$oForm->setTag('input', 'onkeyup', '');\r\n\t\t\t}\r\n\t\t\t$str_form .= '<tr>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_1.'\">' . $this->oL->m('announce') . ':' . $ar_req_msg['announce'] . '</td>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_2.'\">' . $ar_broken_msg['announce'] . $oForm->field('textarea', 'arPost[announce]', gw_fix_db_to_field($vars['announce']), $this->oFunc->getFormHeight($vars['announce'])) . '</td>'.\r\n\t\t\t\t\t\t'</tr>';\r\n\t\t\t$str_form .= '<tr>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_1.'\">' . $this->oL->m('descr') . ':' . $ar_req_msg['description'] . '</td>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_2.'\">' . $oForm->field('textarea', 'arPost[description]', gw_fix_db_to_field($vars['description']), $this->oFunc->getFormHeight($vars['description'])) . '</td>'.\r\n\t\t\t\t\t\t'</tr>';\r\n\t\t\t$str_form .= '<tr>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_1.'\">' . $this->oL->m('keywords') . ':</td>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_2.'\">' . $oForm->field('textarea', 'arPost[keywords]', gw_fix_db_to_field($vars['keywords']), $this->oFunc->getFormHeight($vars['keywords'])) . '</td>'.\r\n\t\t\t\t\t\t'</tr>';\r\n\t\t\t/* Used to select the currect topic */\r\n\t\t\t$gw_this['vars']['tid'] = $vars['id_topic'];\r\n\r\n\t\t\t$str_form .= '<tr>'.\r\n\t\t\t\t\t\t'<td class=\"td1\">' . $this->oL->m('topic') . ':' . $ar_req_msg['id_topic'] . '</td>'.\r\n\t\t\t\t\t\t'<td class=\"td2 gray\">' . $ar_broken_msg['id_topic']\r\n\t\t\t\t\t\t\t . '<select class=\"input75\" dir=\"ltr\" name=\"arPost[id_topic]\">'\r\n\t\t\t\t\t\t\t . gw_get_thread_pages($arTopics, 0, 1)\r\n\t\t\t\t\t\t\t . '</select>';\r\n\t\t\t/* Shortcut to the list of topics */\r\n\t\t\tif ($this->oSess->is('is-topics'))\r\n\t\t\t{\r\n\t\t\t\t$str_form .= ' <span class=\"actions-third\">'.$this->oHtml->a($this->sys['page_admin'].'?'.GW_ACTION.'='.GW_A_BROWSE.'&'.GW_TARGET.'='.GW_T_TOPICS, $this->oL->m('3_edit')).'</span>';\r\n\t\t\t}\r\n\t\t\t$str_form .= '</td>'.\r\n\t\t\t\t\t\t'</tr>';\r\n\t\t\t$str_form .= '</tbody></table>';\r\n\t\t\t$str_form .= '</fieldset>';\r\n\r\n\t\t\t/* Visual settings */\r\n\t\t\t$str_form .= getFormTitleNav($this->oL->m('1136'), '');\r\n\t\t\t$objCells = new htmlRenderCells();\r\n\t\t\t$objCells->tClass = '';\r\n#\t\t\t$oForm->setTag('select', 'class', 'input75');\r\n\t\t\t$oForm->setTag('select', 'style', '');\r\n\t\t\t$str_form .= '<fieldset class=\"admform\"><legend class=\"xq\">&#160;</legend>';\r\n\t\t\t$str_form .= '<table class=\"gw2TableFieldset\" width=\"100%\">';\r\n\t\t\t$str_form .= '<thead><tr><td style=\"width:'.$v_td1_width.'\"></td><td></td></tr></thead><tbody>';\r\n\t\t\t$str_form .= '<tr>'.\r\n\t\t\t\t\t\t'<td class=\"td1\">' . $this->oL->m('default_lang') . ':' . $ar_req_msg['lang'] . '</td>'.\r\n\t\t\t\t\t\t'<td class=\"td2\">' . $oForm->field('select', 'arPost[lang]', $vars['lang'], 0, array_merge(array($this->oL->m('1270')), $this->gw_this['vars']['ar_languages'])) . '</td>'.\r\n\t\t\t\t\t\t'</tr>';\r\n\t\t\t/* Visual themes */\r\n\t\t\t$str_form .= '<tr>'.\r\n\t\t\t\t\t\t'<td class=\"td1\">' . $this->oL->m('visual_theme') . ':' . $ar_req_msg['visualtheme'] . '</td>'.\r\n\t\t\t\t\t\t'<td class=\"td2 gray\">' . $oForm->field('select', 'arPost[visualtheme]', $vars['visualtheme'], 0, array_merge(array($this->oL->m('1270')), $this->gw_this['ar_themes_select']));\r\n\t\t\tif ($this->oSess->is('is-sys-settings'))\r\n\t\t\t{\r\n\t\t\t\t$str_form .= ' <span class=\"actions-third\">'.$this->oHtml->a($this->sys['page_admin'].'?'.GW_ACTION.'='.GW_A_BROWSE.'&'.GW_TARGET.'=visual-themes', $this->oL->m('3_edit')).'</span>';\r\n\t\t\t}\r\n\t\t\t$str_form .= '</td>'.\r\n\t\t\t\t\t\t'</tr>';\r\n\t\t\t/* 1.8.6: Custom alphabetic order */\r\n\t\t\t$arSql = $this->oDb->sqlRun($this->oSqlQ->getQ('get-custom_az-profiles'), 'custom_az');\r\n\t\t\t$ar_custom_az = array();\r\n\t\t\twhile (list($k, $arV) = each($arSql))\r\n\t\t\t{\r\n\t\t\t\t$ar_custom_az[$arV['id_profile']] = $arV['profile_name'];\r\n\t\t\t}\t\r\n\t\t\t$str_form .= '<tr>'.\r\n\t\t\t\t\t\t'<td class=\"td1\">' . $this->oL->m('custom_az') . ':' . $ar_req_msg['id_custom_az'] . '</td>'.\r\n\t\t\t\t\t\t'<td class=\"td2 gray\">' . $oForm->field('select', 'arPost[id_custom_az]', $vars['id_custom_az'], 0, $ar_custom_az);\r\n\t\t\tif ($this->oSess->is('is-sys-settings'))\r\n\t\t\t{\r\n\t\t\t\t$str_form .= ' <span class=\"actions-third\">'.$this->oHtml->a($this->sys['page_admin'].'?'.GW_ACTION.'='.GW_A_BROWSE.'&'.GW_TARGET.'=custom-az&tid='.$vars['id_custom_az'], $this->oL->m('3_edit')).'</span>';\r\n\t\t\t}\r\n\t\t\t$str_form .= '</td>'.\r\n\t\t\t\t\t\t'</tr>';\r\n\t\t\t/* 1.8.7: Virtual keyboards */\r\n\t\t\t$arSql = $this->oDb->sqlRun($this->oSqlQ->getQ('get-vkbd-profiles'), 'vkbd');\r\n\t\t\t$ar_vkbd = array(0 => $this->oL->m('is_0'));\r\n\t\t\twhile (list($k, $arV) = each($arSql))\r\n\t\t\t{\r\n\t\t\t\t$ar_vkbd[$arV['id_profile']] = $arV['vkbd_name'];\r\n\t\t\t}\r\n\t\t\t$str_form .= '<tr>'.\r\n\t\t\t\t\t\t'<td class=\"td1\">' . $this->oL->m('virtual_keyboard') . ':' . $ar_req_msg['id_vkbd'] . '</td>'.\r\n\t\t\t\t\t\t'<td class=\"td2 gray\">' . $oForm->field('select', 'arPost[id_vkbd]', $vars['id_vkbd'], 0, $ar_vkbd);\r\n\t\t\tif ($this->oSess->is('is-sys-settings'))\r\n\t\t\t{\r\n\t\t\t\t$str_form .= ' <span class=\"actions-third\">'.$this->oHtml->a($this->sys['page_admin'].'?'.GW_ACTION.'='.GW_A_BROWSE.'&'.GW_TARGET.'=virtual-keyboards&tid='.$vars['id_vkbd'], $this->oL->m('3_edit')).'</span>';\r\n\t\t\t}\r\n\t\t\t$str_form .= '</td>'.\r\n\t\t\t\t\t\t'</tr>';\r\n\t\t\t$oForm->setTag('input', 'class', 'input0');\r\n\t\t\t$oForm->setTag('input', 'style', '');\r\n\t\t\t$oForm->setTag('input', 'maxlength', '4');\r\n\t\t\t$oForm->setTag('input', 'size', '5');\r\n\t\t\t$oForm->setTag('input', 'dir', $this->sys['css_dir_numbers'] );\r\n#\t\t\t$oForm->setTag('input', 'onkeyup', 'gwJS.strNormalize(this)');\r\n\t\t\t$str_form .= '<tr>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_1.'\">' . $ar_broken_msg['page_limit'] . $oForm->field('input', 'arPost[page_limit]', $vars['page_limit']) . '</td>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_2.'\">' . $this->oL->m('page_limit') . $ar_req_msg['page_limit'] . '</td>'.\r\n\t\t\t\t\t\t'</tr>';\r\n\t\t\t$oForm->setTag('input', 'dir', $this->sys['css_dir_numbers'] );\r\n\t\t\t$str_form .= '<tr>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_1.'\">' . $ar_broken_msg['page_limit_search'] . $oForm->field('input', 'arPost[page_limit_search]', $vars['page_limit_search']) . '</td>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_2.'\">' . $this->oL->m('1096') . $ar_req_msg['page_limit_search'] . '</td>'.\r\n\t\t\t\t\t\t'</tr>';\r\n#\t\t\t$oForm->setTag('input', 'onkeyup', '');\r\n\t\t\t$oForm->setTag('input', 'class', '');\r\n\t\t\t$oForm->setTag('input', 'dir', '');\r\n\t\t\t$oForm->setTag('input', 'size', '');\r\n\t\t\t$str_form .= '<tr>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_1.'\">' . $oForm->field('checkbox', 'arPost[is_show_az]', $vars['is_show_az']) . '</td>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_2.'\"><label for=\"arPost_is_show_az_\">' . $this->oL->m('allow_letters') . '</label></td>'.\r\n\t\t\t\t\t\t'</tr>';\r\n\t\t\t$str_form .= '<tr>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_1.'\">' . $oForm->field('checkbox', 'arPost[is_show_full]', $vars['is_show_full']) . '</td>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_2.'\"><label for=\"arPost_is_show_full_\">' . $this->oL->m('is_show_full') . '</label></td>'.\r\n\t\t\t\t\t\t'</tr>';\r\n\t\t\t$str_form .= '<tr>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_1.'\">' . $oForm->field('checkbox', 'arPost[is_show_tooltip_defn]', $vars['is_show_tooltip_defn']) . '</td>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_2.'\"><label for=\"arPost_is_show_tooltip_defn_\">' . $this->oL->m('1045') . '</label></td>'.\r\n\t\t\t\t\t\t'</tr>';\r\n\t\t\t$str_form .= '<tr>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_1.'\">' . $oForm->field('checkbox', 'arPost[is_show_authors]', $vars['is_show_authors']) . '</td>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_2.'\"><label for=\"arPost_is_show_authors_\">' . $this->oL->m('is_show_authors') . '</label></td>'.\r\n\t\t\t\t\t\t'</tr>';\r\n\t\t\t$str_form .= '<tr>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_1.'\">' . $oForm->field('checkbox', 'arPost[is_show_date_modified]', $vars['is_show_date_modified']) . '</td>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_2.'\"><label for=\"arPost_is_show_date_modified_\">' . $this->oL->m('is_show_date_modified') . '</label></td>'.\r\n\t\t\t\t\t\t'</tr>';\r\n\t\t\t$str_form .= '<tr>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_1.'\">' . $oForm->field('checkbox', 'arPost[is_abbr_long]', $vars['is_abbr_long']) . '</td>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_2.'\"><label for=\"arPost_is_abbr_long_\">' . $this->oL->m('is_abbr_long') . '</label></td>'.\r\n\t\t\t\t\t\t'</tr>';\r\n\t\t\t$str_form .= '</tbody></table>';\r\n\t\t\t$str_form .= '</fieldset>';\r\n\r\n\t\t\t/* Recently added */\r\n#\t\t\t$str_form .= getFormTitleNav($this->oL->m('recent'), '');\r\n#\t\t\t$str_form .= '<fieldset class=\"admform\"><legend class=\"xq\">&#160;</legend>';\r\n\t\t\t$str_form .= '<fieldset class=\"admform\"><legend class=\"xt gray\">'.$this->oL->m('recent').'</legend>';\r\n\t\t\t$str_form .= '<table class=\"gw2TableFieldset\" width=\"100%\">';\r\n\t\t\t$str_form .= '<thead><tr><td style=\"width:'.$v_td1_width.'\"></td><td></td></tr></thead><tbody>';\r\n\r\n\t\t\t$str_form .= '<tr>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_1.'\">' . $this->oL->m('1288') . ':' . $ar_req_msg['recent_terms_display'] . '</td>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_2.'\">' . $oForm->field('select', 'arPost[recent_terms_display]', $vars['recent_terms_display'], 0, array($this->oL->m('is_0'), $this->oL->m('1286'), $this->oL->m('1287'))) . '</td>'.\r\n\t\t\t\t\t\t'</tr>';\r\n\t\t\t$str_form .= '<tr>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_1.'\">' . $this->oL->m('1274') . ':' . $ar_req_msg['recent_terms_sorting'] . '</td>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_2.'\">' . $oForm->field('select', 'arPost[recent_terms_sorting]', $vars['recent_terms_sorting'], 0, array($this->oL->m('1272'), $this->oL->m('1273'))) . '</td>'.\r\n\t\t\t\t\t\t'</tr>';\r\n\t\t\t$oForm->setTag('input', 'class', 'input0');\r\n\t\t\t$oForm->setTag('input', 'style', '');\r\n\t\t\t$oForm->setTag('input', 'maxlength', '4');\r\n\t\t\t$oForm->setTag('input', 'size', '5');\r\n\t\t\t$oForm->setTag('input', 'dir', $this->sys['css_dir_numbers'] );\r\n\t\t\t$str_form .= '<tr>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_1.'\">' . $ar_broken_msg['recent_terms_number'] . $oForm->field('input', 'arPost[recent_terms_number]', $vars['recent_terms_number']) . '</td>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_2.'\">' . $this->oL->m('termsamount') . $ar_req_msg['recent_terms_number'] . '</td>'.\r\n\t\t\t\t\t\t'</tr>';\r\n\t\t\t$oForm->setTag('input', 'class', 'input');\r\n\t\t\t$oForm->setTag('input', 'dir', '');\r\n\t\t\t$oForm->setTag('input', 'size', '');\r\n\t\t\t$oForm->setTag('input', 'maxlength', '255');\r\n\t\t\t$str_form .= '</tbody></table>';\r\n\t\t\t$str_form .= '</fieldset>';\r\n\t\t\t\r\n\t\t\t/* Page options */\r\n#\t\t\t$str_form .= getFormTitleNav($this->oL->m('page_options'), '');\r\n\t\t\t$str_form .= '<fieldset class=\"admform\"><legend class=\"xt gray\">'.$this->oL->m('page_options').'</legend>';\r\n\t\t\t$str_form .= '<table class=\"gw2TableFieldset\" width=\"100%\"><tbody><tr><td>';\r\n\t\t\t$ar_page_options = array(\r\n\t\t\t\t'is_show_term_suggest' => '1095',\r\n\t\t\t\t'is_show_term_report' => 'bug_report',\r\n\t\t\t\t'is_show_page_refresh' => 'page_refresh',\r\n\t\t\t\t'is_show_page_send' => '1275',\r\n\t\t\t\t'is_show_add_to_favorites' => 'page_fav',\r\n\t\t\t\t'is_show_add_to_search' => '1271',\r\n\t\t\t\t'is_show_printversion' => 'printversion'\r\n\t\t\t);\r\n\t\t\tfor (; list($fieldname, $caption) = each($ar_page_options);)\r\n\t\t\t{\r\n\t\t\t\t$ar_page_options_cell[] = '<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\">'.\r\n\t\t\t\t\t\t\t\t '<tbody><tr style=\"vertical-align:middle\" class=\"xt\">'.\r\n\t\t\t\t\t\t\t\t '<td class=\"td1\" style=\"width:25%\">' . $oForm->field('checkbox', 'arPost['.$fieldname.']', $vars[$fieldname]) . '</td>'.\r\n\t\t\t\t\t\t\t\t '<td><label for=\"'.$oForm->text_field2id('arPost['.$fieldname.']').'\">' . $this->oL->m($caption) . '</label></td>'.\r\n\t\t\t\t\t\t\t\t '</tr></tbody>'.\r\n\t\t\t\t\t\t\t\t '</table>';\r\n\t\t\t}\r\n\t\t\t$objCells->X = 3;\r\n\t\t\t$objCells->Y = 99;\r\n\t\t\t$objCells->ar = $ar_page_options_cell;\r\n\t\t\t$objCells->tClass = 'table-cells';\r\n\t\t\t$str_form .= $objCells->RenderCells();\r\n\t\t\t$str_form .= '</td>';\r\n\t\t\t$str_form .= '</tr>';\r\n\t\t\t$str_form .= '</tbody></table>';\r\n\t\t\t$str_form .= '</fieldset>';\r\n\t\t\t\r\n\t\t\t$str_form .= getFormTitleNav($this->oL->m('sect_edit_dict'), '');\r\n\t\t\t$str_form .= '<fieldset class=\"admform\"><legend class=\"xt gray\">&#160;</legend>';\r\n\t\t\t$str_form .= '<table class=\"gw2TableFieldset\" width=\"100%\"><tbody>';\r\n\t\t\t$str_form .= '<tr><td>';\r\n\t\t\t/* Construct fields */\r\n\t\t\treset($arFields);\r\n\t\t\t/* term is required by default */\r\n\t\t\tunset($arFields[1], $arFields[-1], $arFields[-2], $arFields[-3], $arFields[-4], $arFields[-5]);\r\n\t\t\t$arFieldsStr = array();\r\n\t\t\tfor (; list($k, $v) = each($arFields);)\r\n\t\t\t{\r\n\t\t\t\t$fieldname = 'is_'.$v[0];\r\n\t\t\t\t$vars[$fieldname] = isset($vars[$fieldname]) ? $vars[$fieldname] : 0;\r\n\t\t\t\t$arFieldsStr[] = '<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\">'.\r\n\t\t\t\t\t\t\t\t '<tbody><tr style=\"vertical-align:middle\" class=\"xt\">'.\r\n\t\t\t\t\t\t\t\t '<td class=\"td1\" style=\"width:25%\">' . $oForm->field('checkbox', 'arPost['.$fieldname.']', $vars[$fieldname]) . '</td>'.\r\n\t\t\t\t\t\t\t\t '<td><label for=\"'.$oForm->text_field2id('arPost['.$fieldname.']').'\">' . $this->oL->m($v[0]) . '</label></td>'.\r\n\t\t\t\t\t\t\t\t '</tr></tbody>'.\r\n\t\t\t\t\t\t\t\t '</table>';\r\n\t\t\t}\r\n\t\t\t$objCells->X = 3;\r\n\t\t\t$objCells->Y = 99;\r\n\t\t\t$objCells->ar = $arFieldsStr;\r\n\t\t\t$objCells->tClass = 'table-cells';\r\n\t\t\t$str_form .= $objCells->RenderCells();\r\n\t\t\t$str_form .= '</td></tr></tbody></table>';\r\n\t\t\t$str_form .= '</fieldset>';\r\n\r\n\t\t\t/* Search settings */\r\n\t\t\t$str_form .= getFormTitleNav($this->oL->m('1056'), '');\r\n\t\t\t$str_form .= '<fieldset class=\"admform\"><legend class=\"xt gray\">&#160;</legend>';\r\n\t\t\t$str_form .= '<table class=\"gw2TableFieldset\" width=\"100%\">';\r\n\t\t\t$str_form .= '<thead><tr><td style=\"width:'.$v_td1_width.'\"></td><td></td></tr></thead><tbody>';\r\n\t\t\t$str_form .= '<tr>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_1.'\">' . $this->oL->m('min_srch_length') . ':' . $ar_req_msg['min_srch_length'] . '</td>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_2.'\">' . $oForm->field(\"select\", \"arPost[min_srch_length]\", $vars['min_srch_length'], 0, $arNums ) . '</td>'.\r\n\t\t\t\t\t\t'</tr>';\r\n\t\t\t/* Check for existent stopwords */\r\n\t\t\t$ar_lang_stopwords = array();\r\n\t\t\tfor (; list($locale_code, $locale_name_origin) = each($this->gw_this['vars']['ar_languages']);)\r\n\t\t\t{\r\n\t\t\t\t$arStop = $this->oL->getCustom('stop_words', $locale_code, 'return');\r\n\t\t\t\tif (!empty($arStop))\r\n\t\t\t\t{\r\n\t\t\t\t\t$ar_lang_stopwords[$locale_code] = $locale_name_origin;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$oForm->setTag('select', 'multiple', 'multiple');\r\n\t\t\t$oForm->setTag('select', 'size', '4');\r\n\t\t\t$str_form .= '<tr>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_1.'\">' . $oForm->field('checkbox', \"arPost[is_filter_stopwords]\", $vars['is_filter_stopwords']) . '</td>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_2.'\"><label for=\"arPost_is_filter_stopwords_\">' . $this->oL->m('1047') . ':</label></td>'.\r\n\t\t\t\t\t\t'</tr>';\r\n\t\t\t$str_form .= '<tr>'.\r\n\t\t\t\t\t\t'<td></td>'.\r\n\t\t\t\t\t\t'<td class=\"'.$v_class_2.'\">' . $oForm->field('select', 'arPost[ar_filter_stopwords][]', $vars['ar_filter_stopwords'], 0, $ar_lang_stopwords) . '</td>'.\r\n\t\t\t\t\t\t'</tr>';\r\n\t\t\t$oForm->setTag('select', 'multiple', '');\r\n\t\t\t$oForm->setTag('select', 'size', '');\r\n\t\t\t$str_form .= '</tbody></table>';\r\n\t\t\t$str_form .= '</fieldset>';\r\n\t\t\t\r\n\t\t\t/* System settings */\r\n\t\t\t$str_form .= getFormTitleNav($this->oL->m('1138'), '');\r\n\t\t\t$str_form .= '<fieldset class=\"admform\"><legend class=\"xt gray\">&#160;</legend>';\r\n\t\t\t$str_form .= '<table class=\"gw2TableFieldset\" width=\"100%\">';\r\n\t\t\t$str_form .= '<thead><tr><td style=\"width:'.$v_td1_width.'\"></td><td></td></tr></thead><tbody>';\r\n\t\t\t$str_form .= '<tr>'.\r\n\t\t\t\t\t'<td class=\"'.$v_class_1.'\">' . $this->oL->m('date_created') . ':</td>'.\r\n\t\t\t\t\t'<td class=\"'.$v_class_2.'\">' . htmlFormSelectDate(\"arPost[date_created]\", @date(\"YmdHis\", $vars['date_created'])) . '</td>'.\r\n\t\t\t\t\t'</tr>';\r\n\t\t\t$str_form .= '<tr>'.\r\n\t\t\t\t\t'<td class=\"'.$v_class_1.'\">' . $this->oL->m('date_modif') . ':</td>'.\r\n\t\t\t\t\t'<td class=\"disabled\">' . date_extract_int($vars['date_modified'], \"%d %F %Y %H:%i\") . '&#160;</td>'.\r\n\t\t\t\t\t'</tr>';\r\n\t\t\t/* 1.8.5 Checking input characters */\r\n\t\t\t$oForm->setTag('input', 'onkeyup', 'gwJS.strNormalize(this)');\r\n\t\t\t$str_form .= '<tr>'.\r\n\t\t\t\t\t'<td class=\"'.$v_class_1.'\">' . $this->oL->m('sysname') . ':' . $ar_req_msg['tablename'] . '</td>'.\r\n\t\t\t\t\t'<td class=\"'.$v_class_2.'\">' . $ar_broken_msg['tablename'] . $oForm->field(\"input\", \"arPost[tablename]\", textcodetoform( $vars['tablename'] ) ) . '</td>'.\r\n\t\t\t\t\t'</tr>';\r\n\t\t\t$oForm->setTag('input', 'onkeyup', '');\r\n\t\t\t$str_form .= '<tr>'.\r\n\t\t\t\t\t'<td class=\"'.$v_class_1.'\">' . $oForm->field('checkbox', 'arPost[is_dict_as_index]', $vars['is_dict_as_index']) . '</td>'.\r\n\t\t\t\t\t'<td class=\"'.$v_class_2.'\"><label for=\"arPost_is_dict_as_index_\">' . $this->oL->m('is_dict_as_index') . '</label></td>'.\r\n\t\t\t\t\t'</tr>';\r\n\t\t\t$str_form .= '<tr>'.\r\n\t\t\t\t\t'<td class=\"'.$v_class_1.'\">' . $oForm->field('checkbox', 'arPost[is_leech]', $vars['is_leech']) . '</td>'.\r\n\t\t\t\t\t'<td class=\"'.$v_class_2.'\"><label for=\"'.$oForm->text_field2id('arPost[is_leech]').'\">' . $this->oL->m('allow_leecher') . '</label></td>'.\r\n\t\t\t\t\t'</tr>';\r\n\t\t\t$str_form .= '</tbody></table>';\r\n\r\n\t\t\t$str_form .= '</fieldset>';\r\n\t\t}\r\n\r\n\t\t\r\n\t\tif ($this->gw_this['vars'][GW_ACTION] == GW_A_EDIT)\r\n\t\t{\r\n\t\t\t$str_form .= $oForm->field('hidden', 'tid', $this->gw_this['vars']['tid']);\r\n\t\t}\r\n\t\t$str_form .= $oForm->field('hidden', 'arPost[tablename_old]', $vars['tablename']);\r\n\t\t$str_form .= $oForm->field('hidden', GW_ACTION, $this->gw_this['vars'][GW_ACTION]);\r\n\t\t$str_form .= $oForm->field('hidden', GW_TARGET, $this->gw_this['vars'][GW_TARGET]);\r\n\t\t$str_form .= $oForm->field('hidden', $this->oSess->sid, $this->oSess->id_sess);\r\n\t\t$str_form .= $oForm->field('hidden', 'id', $this->gw_this['vars']['id']);\r\n\t\t$str_form .= $oForm->field('hidden', 'post', 1);\r\n\t\t$str_form .= $str_hidden;\r\n\t\treturn $oForm->Output($str_form);\r\n\t}", "public function cs_generate_form() {\n global $post;\n }", "function update_res_t($_POST){\n$no_t = current($_POST);\n$res = $_POST['res'];\n\nsql_update_t($no_t, $res);\n$reg = count($_POST)-1; //Numero de Registros por evaluar\n\nfor($i=$reg; $i>1; $i--){\n\tnext($_POST);\n\t$no_t = current($_POST);\n\t$res = $_POST['res'];\n\tsql_update_t($no_t, $res);\n\t}\n}", "private function prepare_form_data()\n {\n $form_data = array(\n 'email' => array(\n 'name' => 'email',\n 'options' => array(\n '' => '--',\n ),\n 'extra' => array('id'=>'login-email', 'autofocus'=>''),\n ),\n 'password' => array(\n 'name' => 'password',\n 'options' => array(\n '' => '--',\n ),\n 'extra' => array('id'=>'login-password'),\n ),\n\n 'lbl-email' => array(\n 'target' => 'email',\n 'label' => 'E-mail Address',\n ),\n 'lbl-password' => array(\n 'target' => 'password',\n 'label' => 'Password',\n ),\n\n 'btn-submit' => array(\n 'value' => 'Login',\n 'extra' => array(\n 'class' => 'btn btn-primary',\n ),\n ),\n );\n\n return \\DG\\Utility::massage_form_data($form_data);\n }", "function re_post_form($var, $ignore=array('submit'))\r\n{\r\n $input_hiddens = '';\r\n\r\n foreach($var as $k=>$v)\r\n {\r\n $k = format_str($k);\r\n if(in_array($k, $ignore)!=false) continue;\r\n\r\n if(is_array($v))\r\n {\r\n foreach($v as $k2=>$v2){\r\n $input_hiddens .= \"<input type='hidden' name='{$k}[{$k2}]' value='{$v2}' />\\r\\n\";\r\n }\r\n }\r\n else{\r\n $input_hiddens .= \"<input type='hidden' name='{$k}' value='{$v}' />\\r\\n\";\r\n }\r\n }\r\n\r\n return $input_hiddens;\r\n}", "public function getForm(): array\n {\n return $this->form;\n }", "protected function loadFormData()\n\t{\n\t\t$data = $this->getData(); \n \n return $data;\n\t}", "function getPostType($row = \"\", $mode) {\n\t$output = \"\";\n\t$postForm = \"\n\t\t<form id='addPost' data-id='\". $row[\"ID\"] . \"' class='admin-form fadeIn' action='assets/php/addposts.php' method='POST' style='display:none;' enctype='multipart/form-data'>\n\t\t\t<label for='image'><span>Choose image</span><input type='file' name='image' id='image'></label>\n\t\t\t<label for='headline'><span>Headline</span><br><input name='headline' type='text'></label><br>\n\t\t\t<label for='text'><span>Text</span><br>\n\t\t\t\t<textarea name='textarea' id='' cols='30' rows='5'></textarea></label>\n\t\t\t<label for='embed'><span>Add youtube url / map</span><br>\n\t\t\t\t<textarea name='embed' id='' cols='30' rows='5'></textarea></label>\n\t\t\t<br>\n\t\t\t<label class='admin-form-published' for='publ'><span>Publish?</span> <br>\n\t\t\t\t<input class='publBox' type='checkbox' value='1' name='publ'>\n\t\t\t</label>\n\t\t\t<button class='submitBtn' type='submit' name='savePost'>Save post</button>\n\t\t</form>\";\n\n\t\t$editPostForm = \"\n\t\t<form id='addPost' data-id='\". $row[\"ID\"] . \"' class='admin-form fadeInput' action='assets/php/edit.php' method='POST' style='display:none;' enctype='multipart/form-data'>\n\t\t\t<img class='posts__item-img' src='/CMS/assets/media/\" . $row[\"image\"] . \"' alt='\" . $row[\"headline\"] .\"'>\n\t\t\t<label for='image'><span>Choose new image (replaces old image)</span>\n\t\t\t<input type='file' name='image' id='image'></label>\n\t\t\t<label for='headline'>\n\t\t\t\t<span>Headline</span><br>\n\t\t\t\t<input name='headline' type='text' value='\".$row[\"headline\"].\"'>\n\t\t\t</label><br>\n\t\t\t<label for='text'><span>Text</span><br>\n\t\t\t\t<textarea name='textarea' id='' cols='30' rows='5' value=''>\" . $row[\"textarea\"] . \"</textarea>\n\t\t\t</label>\n\t\t\t<label for='embed'><span>Add youtube url / map</span><br>\n\t\t\t\t<textarea name='embed' id='' cols='30' rows='5'>\" . $row[\"embed\"] . \"</textarea>\n\t\t\t</label>\n\t\t\t<br>\n\t\t\t<label class='admin-form-published' for='publ'><span>Publish?</span>\n\t\t\t\t<input type='checkbox' value='1' checked='\". isPublished($row) . \"' name='publ'>\n\t\t\t</label>\n\t\t\t<input type='hidden' name='id' value='\". $row[\"ID\"] . \"'>\n\t\t\t<input type='hidden' name='path' value='\". $row[\"image\"] . \"'>\n\t\t\t\n\t\t\t<button class='submitBtn' type='submit' name='savePost')'>UPDATE POST</button>\n\t\t</form>\";\n\n\tif($mode === \"edit\") {\n\t\t$output = $postForm;\n\t} else {\n\t\tif($mode === \"front\") {\n\t\t\t$output = \n\t\t\t\t\"<article class='posts posts__item fadeIn'>\n\t\t\t\t\t<img class='posts__item-img' src='/CMS/assets/media/\" . $row[\"image\"] . \"' alt='\" . $row[\"headline\"] .\"'>\n\t\t\t\t\t<h2>\". $row[\"headline\"] . \"</h2>\n\t\t\t\t\t<span class='posts__item-date'><i class='far fa-calendar-alt'></i> \". $row[\"date\"] . \"</span>\n\t\t\t\t\t<p>\". nl2br($row[\"textarea\"]) .\"<br></p>\n\t\t\t\t\t<div class='posts__item-embedarea'>\" . $row[\"embed\"] . \"</div>\n\t\t\t</article>\";\t\n\t\t} else {\n\t\t\t$output = \"\n\t\t\t<article class='posts posts__item admin-form fadeIn'>\n\t\t\t<section class='admin-form__change-section'><a onclick='editView(\". $row[\"ID\"] . \")'href='javascript:void(0)'><i class='fas fa-edit'></i></a><a onclick='deleteView(\". $row[\"ID\"] . \")' href='javascript:void(0)'><i class='fas fa-trash-alt'></a></i></section>\n\t\t\t\t<img class='posts__item-img' src='/CMS/assets/media/\" . $row[\"image\"] . \"' alt=''>\n\t\t\t\t<h2>\". $row[\"headline\"] . \"</h2>\n\t\t\t\t<span class='posts__item-date'><i class='far fa-calendar-alt'></i> \". $row[\"date\"] . \"</span>\n\t\t\t\t<p>\". nl2br($row[\"textarea\"]) .\"<br></p>\n\t\t\t\t<div class='posts__item-embedarea'>\".$row[\"embed\"].\"</div>\n\t\t\t</article>\n\t\t\t$editPostForm\";\t\n\t\t}\n\t}\n\treturn $output;\n}", "function FillActualFields($formname,$convert=true) // fuer die datenbank \n {\n $htmllist = &$this->FormList[$formname]->HTMLList;\n if($htmllist->items>0)\n {\n $field = &$htmllist->getFirst();\n for($i=0; $i <= $htmllist->items; $i++)\n {\n\t\n\tif($this->app->Secure->GetPOST($field->identifier)!=\"\")\n\t{\n\t $field->value = $this->app->Secure->GetPOST($field->identifier);\n\t}else\n\t{\n\t $field->value = $field->htmlobject->value;\n\t}\n\t\n\t\n\tif($field->value!=\"\" && $convert){\n\t $value = $this->app->String->Convert(\n\t //$field->value,$field->htmlformat,$field->dbformat);\n\t $field->value,$field->dbformat,$field->htmlformat);\n\t\n\t $value = $this->app->String->decodeText($value);\n\t $field->value = $value;\n\t} \n\n\tif(get_class($htmlobject)==\"blindfield\")\n\t $field->value=$field->htmlobject->value;\n \t\n\t\n\t$field->htmlobject->value=$field->value;\n\n\t\n\t$field = &$htmllist->getNext();\n }\n }\n }", "abstract protected function getForm();", "public function getForm();", "protected function loadFormData()\n\t{\n\t}", "function my_module_hero_image_edit_form_submit($form, &$form_state) {\n $form_fields = array(\n 'title_text',\n 'title_heading',\n );\n foreach ($form_fields as $key) {\n $form_state['conf'][$key] = $form_state['values'][$key];\n }\n\n}", "private function resetInputFields(){\n $this->teacher_id = '';\n $this->lending_id = '';\n $this->note = '';\n $this->device_id = '';\n $this->org_id_1 = '';\n $this->org_id_2 = '';\n $this->lendingDate = '';\n $this->returnDate = '';\n }", "function getForm()\r\n\t{\r\n\t\t$this->action();\r\n\t\t$mainForm\t= $this->getMainForm();\r\n\t\tif($this->isFormRequire)\r\n\t\t{\r\n\t\t\t$cls = ' class=\"formIsRequire\"';\r\n\t\t\tlink_js(_PEA_URL.'includes/formIsRequire.js', false);\r\n\t\t}else{\r\n\t\t\t$cls = '';\r\n\t\t}\r\n\r\n\t\t$i = 0;\r\n\t\t$out = '';\r\n\r\n\t\t$out .= '<form method=\"'.$this->methodForm.'\" action=\"'.$this->actionUrl.'\" name=\"'. $this->formName .'\"'.$cls.' enctype=\"multipart/form-data\" role=\"form\">';\r\n\t\t$out .= $this->getSaveSuccessPage();\r\n\t\t$out .= $this->getDeleteSuccessPage();\r\n\r\n\t\t$hover= $this->isChangeBc ? ' table-hover' : '';\r\n\t\t$out .= '<table class=\"table table-striped table-bordered'.$hover.'\">';\r\n\t\t$out .= '<thead><tr>';\r\n\r\n\t\t// ngambil tr title\r\n\t\t$numColumns = 0;\r\n\r\n\t\tforeach($this->arrInput as $input)\r\n\t\t{\r\n\t\t\tif ($input->isInsideRow && !$input->isInsideMultiInput && !$input->isHeader)\r\n\t\t\t{\r\n\t\t\t\t// buat array data untuk report\r\n\t\t\t\tif ($this->isReportOn && $input->isIncludedInReport)\r\n\t\t\t\t{\r\n\t\t\t\t\t$arrHeader[]\t= $input->title;\r\n\t\t\t\t}\r\n\t\t\t\t// dapatkan text bantuan\r\n\t\t\t\tif (!empty($input->textHelp))\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->help->value[$input->name] = $input->textHelp;\r\n\t\t\t\t}\r\n\t\t\t\tif (!empty($input->textTip))\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->tip->value[$input->name] = $input->textTip;\r\n\t\t\t\t}\r\n\t\t\t\t$label = '';\r\n\t\t\t\tif (@$input->isCheckAll)\r\n\t\t\t\t{\r\n\t\t\t\t\t$label = $this->getCheckAll($input);\r\n\t\t\t\t}\r\n\t\t\t\t$href = $this->getOrderUrl($input, $input->title);\r\n\t\t\t\tif (!empty($this->tip->value[$input->name]))\r\n\t\t\t\t{\r\n\t\t\t\t\t$input->title = tip($input->title, $this->tip->value[$input->name]);\r\n\t\t\t\t}\r\n\t\t\t\t$label .= $href['start'].$input->title.$href['end'];\r\n\t\t\t\t$out .= ' <th>'.$label;\r\n\t\t\t\tif (!empty($this->help->value[$input->name]))\r\n\t\t\t\t{\r\n\t\t\t\t\t$out .= ' <span style=\"font-weight: normal;\">'.help($this->help->value[$input->name],'bottom').'</span>';\r\n\t\t\t\t}\r\n\t\t\t\t$out\t\t.= \"</th>\\n\";\r\n\t\t\t\t$numColumns++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$out .= '</tr></thead>';\r\n\t\t$this->reportData['header']\t= isset($arrHeader) ? $arrHeader : array();\r\n\t\t// ambil mainFormnya\r\n\t\t$out .= $mainForm;\r\n\r\n\t\t/* Return, Save, Reset, Navigation, Delete */\r\n\t\t$button = '';\r\n\t\tif (!empty($_GET['return']) && empty($_GET['is_ajax']))\r\n\t\t{\r\n\t\t\t$button .= $GLOBALS['sys']->button($_GET['return']);\r\n\t\t}\r\n\t\tif ($this->saveTool)\r\n\t\t{\r\n\t\t\t$button .= '<button type=\"submit\" name=\"'. $this->saveButton->name .'\" value=\"'. $this->saveButton->value\r\n\t\t\t\t\t\t.\t'\" class=\"btn btn-primary btn-sm\"><span class=\"glyphicon glyphicon-'.$this->saveButton->icon.'\"></span>'\r\n\t\t\t\t\t\t. $this->saveButton->label .'</button>';\r\n\t\t}\r\n\t\tif ($this->resetTool)\r\n\t\t{\r\n\t\t\t$button .= '<button type=\"reset\" class=\"btn btn-warning btn-sm\"><span class=\"glyphicon glyphicon-'.$this->resetButton->icon.'\"></span>'.$this->resetButton->label.'</button> ';\r\n\t\t}\r\n\t\t$nav = $this->nav->getNav();\r\n\t\tif (!empty($nav))\r\n\t\t{\r\n\t\t\tif (!empty($button))\r\n\t\t\t{\r\n\t\t\t\t$button = '<table style=\"width: 100%;\"><tr><td style=\"width: 10px;white-space: nowrap;\">'.$button.'</td><td style=\"text-align: center;\">'.$nav.'</td></tr></table>';\r\n\t\t\t}else{\r\n\t\t\t\t$button .= $nav;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$footerTD = array();\r\n\t\t$colspan = $numColumns;\r\n\t\tif ($this->deleteTool)\r\n\t\t{\r\n\t\t\t$colspan -= 1;\r\n\t\t}\r\n\t\t$attr = $colspan > 1 ? ' colspan=\"'.$colspan.'\"' : '';\r\n\t\t$footerTD[] = '<td'.$attr.'>'.$button.'</td>';\r\n\t\tif ($this->deleteTool)\r\n\t\t{\r\n\t\t\t$footerTD[] = '<td>'\r\n\t\t\t\t. '<button type=\"submit\" name=\"'.$this->deleteButton->name.'\" value=\"'. $this->deleteButton->value.'\" class=\"btn btn-danger btn-sm\" '\r\n\t\t\t\t. 'onclick=\"if (confirm(\\'Are you sure want to delete selected row(s) ?\\')) { return true; }else{ return false; }\">'\r\n\t\t\t\t. '<span class=\"glyphicon glyphicon-'.$this->deleteButton->icon.'\"></span>'.$this->deleteButton->label .'</button>'\r\n\t\t\t\t. '</td>';\r\n\t\t}\r\n\t\tif (!empty($footerTD))\r\n\t\t{\r\n\t\t\t$out .= '<tfoot><tr>'.implode('', $footerTD).'</tr></tfoot>';\r\n\t\t}\r\n\t\t$out .= '</table>';\r\n\t\t$out .= '</form>';\r\n\r\n\t\t/* Export Tool, Page Status, Form Navigate */\r\n\t\t$nav = $this->nav->getViewAllLink();\r\n\t\tif (!empty($nav))\r\n\t\t{\r\n\t\t\t$nav = '<span class=\"input-group-addon\">'.$nav.'</span>';\r\n\t\t}\r\n\t\t$nav .= $this->nav->getGoToForm(false);\r\n\t\t$out .= '<form method=\"get\" action=\"\" role=\"form\" style=\"margin-top:-20px;margin-bottom: 20px;\">'\r\n\t\t\t\t.\t'<div class=\"input-group\">'\r\n\t\t\t\t. $this->getReport($this->nav->int_cur_page)\r\n\t\t\t\t. '<span class=\"input-group-addon\">'\r\n\t\t\t\t. $this->nav->getStatus().'</span>'.$nav.'</div></form>';\r\n\r\n\t\t/* Form Panel */\r\n\t\t$formHeader = $this->getHeaderType();\r\n\t\tif (!empty($formHeader))\r\n\t\t{\r\n\t\t\t$out = '\r\n\t\t\t\t<div class=\"panel panel-default\">\r\n\t\t\t\t\t<div class=\"panel-heading\">\r\n\t\t\t\t\t\t<h3 class=\"panel-title\">'.$formHeader.'</h3>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div class=\"panel-body\">\r\n\t\t\t\t\t\t'.$out.'\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>';\r\n\t\t}\r\n\t\t$out = $this->getHideFormToolStart().$out.$this->getHideFormToolEnd();\r\n\t\treturn $out;\r\n\t}", "public function valiteForm();", "protected function loadFormData() {\n\t\t// Check the session for previously entered form data.\n\t\t$data = JFactory::getApplication()->getUserState('com_cp.edit.cptourismtype.data', array());\n\n\t\tif (empty($data)) {\n\t\t\t$data = $this->getItem();\n\t\t}\n\n\t\treturn $data;\n\t}" ]
[ "0.6497502", "0.6440311", "0.6321709", "0.6300444", "0.62147075", "0.6155644", "0.6027975", "0.6012674", "0.59913504", "0.59858227", "0.587104", "0.5856399", "0.58458173", "0.5830539", "0.58298635", "0.58265984", "0.58258337", "0.5788129", "0.5763833", "0.5757229", "0.57442576", "0.57300997", "0.57293385", "0.5708271", "0.5638041", "0.5626269", "0.55811495", "0.5576577", "0.5573849", "0.5567571", "0.55637515", "0.5554612", "0.55516124", "0.55419713", "0.5538797", "0.55355746", "0.55328804", "0.5526582", "0.5524828", "0.5520836", "0.5520207", "0.55181086", "0.55170673", "0.55128336", "0.5510383", "0.5502697", "0.5502376", "0.5498559", "0.54937184", "0.5493276", "0.54836977", "0.5481177", "0.5474891", "0.546056", "0.54589283", "0.5457004", "0.5449151", "0.5446886", "0.5445001", "0.5444966", "0.5434886", "0.5429251", "0.5421408", "0.5412422", "0.54067534", "0.54067534", "0.5403314", "0.5401829", "0.5399627", "0.5398155", "0.5397773", "0.53909147", "0.5374097", "0.5367337", "0.53655803", "0.535571", "0.5352842", "0.53516424", "0.5349228", "0.5345499", "0.5341146", "0.5323619", "0.5319833", "0.53180027", "0.53145635", "0.53018826", "0.52998686", "0.5297628", "0.5294907", "0.5271926", "0.527024", "0.5267766", "0.5265686", "0.52651316", "0.52645946", "0.5259024", "0.5254042", "0.524452", "0.5238281", "0.5236206" ]
0.7440448
0
/ VALIDATE PARAM Input validation proc
function validate($name,$value,$minlen,$maxlen,$datatype="",$min_val="",$max_val="",$regexp="") { //SAT0112:To prevent entering values which is not less than min_val and not greater than max val $resp=true; //echo "Validating: name=".$name." val=".$value." min=".$minlen." maxlen=".$maxlen." type=".$datatype." regexp=".$regexp."<br>"; // If the value is empty and the field is not mandatory, then return if ( (!isset($minlen) || $minlen == 0) && $value == "" ) { return true; } // Empty Check // Changed to === to ensure 0 does not fail if ( isset($minlen) && $minlen > 0 && $value === "" ) { add_msg("ERROR",$name." cannot be empty. "); return false; } //echo "count($value)=[".preg_match("/^[0-9]+$/","12344a4")."]<br>"; // MIN LEN check if ( isset($minlen) && strlen($value) < $minlen ) { add_msg("ERROR",$name." should be atleast ".$minlen." characters long. "); return false; } // MAX LEN check if ( $datatype == 'enum' ) { $enum_str=$maxlen; unset($maxlen); } if ( isset($maxlen) && strlen($value) > $maxlen ) { add_msg("ERROR",$name." cannot be longer than ".$maxlen." characters. "); return false; } // CUSTOM REGEXP check if ( isset($regexp) && !preg_match("/$regexp/",$value) ) { add_msg("ERROR",$name." is not valid. "); return false; } // MIN value check if( ($min_val !== '' && $value < $min_val) ) { add_msg("ERROR",$name." cannot be less than ".$min_val.". "); return false; } // MAX value check if( ($max_val !== '' && $value > $max_val) ) { add_msg("ERROR",$name." cannot be greater than ".$max_val.". "); return false; } // STANDARD DATATYPES check if ( isset($datatype) ) { switch ($datatype) { case "int": if ( filter_var($value, FILTER_VALIDATE_INT) === false ) { add_msg("ERROR",$name." should contain only digits. "); return false; } break; case "decimal": if ( filter_var($value, FILTER_VALIDATE_FLOAT) === false ) { add_msg("ERROR",$name." should contain only digits. "); return false; } break; case "PASSWORD": case "char": // anything case "varchar": // anything case "text": // anything return true; break; case "bigint": case "tinyint": if (!preg_match("/^[0-9]+$/",$value)) { add_msg("ERROR",$name." should contain only digits. "); return false; } break; case "date": $arr=preg_split("/-/",$value); // splitting the array $yy=get_arg($arr,0); // first element of the array is month $mm=get_arg($arr,1); // second element is date $dd=get_arg($arr,2); // third element is year if( $dd == "" || $mm == "" || $yy == "" || !checkdate($mm,$dd,$yy) ){ add_msg("ERROR",$name." is not a valid date, should be of the format YYYY-MM-DD "); return false; } break; /*case "PASSWORD": if (!preg_match("/^[a-zA-Z\-_0-9]+$/",$value)) { add_msg("ERROR",$name." can contain only alphabets,numbers,'-' and '_'. <br/>"); return false; } break; */ case "SIMPLE_STRING": // can only have alphabets, spaces, dots, -'s or + if (!preg_match("/^[a-zA-Z0-9\.\s\-\+]+$/",$value)) { add_msg("ERROR",$name." should contain only alphabets, numbers, spaces '.', '-' or '+'. "); return false; } break; case "EMAIL": if ( filter_var($value, FILTER_VALIDATE_EMAIL) == false ) { add_msg("ERROR",$name." is not valid, should be of the format [email protected]. "); return false; } break; case "MOBILE": if (!preg_match("/^[0-9]+$/",$value)) { add_msg("ERROR",$name." is not valid, should be of the format 919123456789 "); return false; } break; case 'FILENAME': if ($value != basename($value) || !preg_match("/^[a-zA-Z0-9_\.-]+$/",$value) || !preg_match('/^(?:[a-z0-9_-]|\.(?!\.))+$/iD', $value)) { add_msg('ERROR', "Invalid $name. "); return false; } break; case 'enum': $enum_arr=explode(',',$enum_str); if ( in_array($value, $enum_arr) ) { add_msg('ERROR', "Invalid $name."); return false; } break; default: add_msg("ERROR",$name." is not valid. Please re enter."); return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function validateInputParameters($data)\n {\n }", "public function validate($data, $param);", "public function validate($input);", "public function validateParameters(&$parameters);", "abstract public function validate();", "abstract public function validate();", "public function validate($input, $parameters);", "public abstract function validation();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "abstract public function validateData();", "abstract function validator();", "public function validation();", "public static function validate() {}", "function validate()\n\t{\n\t}", "private function validate_input() {\n\t\t$fields = array_merge( array( $this->range_field ), $this->key_fields, $this->checksum_fields );\n\n\t\t$this->validate_fields( $fields );\n\t\t$this->validate_fields_against_table( $fields );\n\t}", "abstract public function valid();", "abstract public function validate(&$params=array(), $flowId=null);", "public function Valid();", "abstract protected function validate($data);", "function validateInput()\r\n\t{\r\n\t\tif(preg_match('/^[a-zA-Z ]*$/', $this->name) != 1)\r\n\t\t{\r\n\t\t\t$this->err = true;\r\n\t\t\t$this->errMsgBeg .= \"-> Error in name $this->name. Only alphabets allowed.<br>\";\r\n\t\t}\r\n\r\n\t\tif(preg_match('/^[a-zA-Z ]*$/', $this->desg) != 1)\r\n\t\t{\r\n\t\t\t$this->err = true;\r\n\t\t\t$this->errMsgBeg .= \"-> Error in designation $this->desg. Only alphabets allowed.<br>\";\r\n\t\t}\r\n\r\n\t\tif(empty($this->addr))\r\n\t\t{\r\n\t\t\t$this->err = true;\r\n\t\t\t$this->errMsgBeg .= \"-> Error in address entered. Please fill correct address field as per gender: Office address for Male user, and Residential address for Female user.<br>\";\t\r\n\t\t}\r\n\r\n\t\tforeach($this->emails as $ele)\r\n\t\t{\r\n\t\t\tif(!filter_var($ele, FILTER_VALIDATE_EMAIL))\r\n\t\t\t{\r\n\t\t\t\t$this->err = true;\r\n\t\t\t\t$this->errMsgBeg .= \"-> Invalid email-id $ele. Enter correctly.<br>\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "abstract public function validateData($data);", "function paramsValidateOne($instruction, $first_arg)\n{\n if ((strcmp(\"DEFVAR\", $instruction[0]) == 0) || (strcmp(\"POPS\", $instruction[0]) == 0))\n {\n if ($first_arg != \"var\")\n {\n Err();\n }\n }\n else if ((strcmp(\"CALL\", $instruction[0]) == 0) || (strcmp(\"LABEL\", $instruction[0]) == 0) || (strcmp(\"JUMP\", $instruction[0]) == 0))\n {\n if ($first_arg != \"label\")\n {\n Err();\n }\n }\n else if ((strcmp(\"PUSHS\", $instruction[0]) == 0) || (strcmp(\"WRITE\", $instruction[0]) == 0) || (strcmp(\"EXIT\", $instruction[0]) == 0) || (strcmp(\"DPRINT\", $instruction[0]) == 0))\n {\n if (($first_arg == \"type\") || ($first_arg == \"label\"))\n {\n Err();\n }\n }\n}", "function validate_value($valid, $value, $field, $input)\n {\n }", "function validate_value($valid, $value, $field, $input)\n {\n }", "function validate_value($valid, $value, $field, $input)\n {\n }", "function validate_value($valid, $value, $field, $input)\n {\n }", "function isValid() ;", "private function validateParams(){\n\t\t$name\t = $this->param['name']; \n\t\t$ic\t\t = $this->param['ic']; \n\t\t$mobile\t= $this->param['mobile']; \n\t\t$email\t= $this->param['email']; \n\t\t$statusCode = array();\n\t\tif(!$name){\n\t\t\t$statusCode[] = 115;\n\t\t}\n\t\tif(!$ic){\n\t\t\t$statusCode[] = 116;\n\t\t}\n\t\tif(!$email){\n\t\t\t$statusCode []= 101;\n\t\t}elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) {\n\t\t $statusCode[] = 105;\n\t\t}\n\t\treturn $statusCode;\n\t}", "public function valid();", "public function valid();", "public function valid();", "public function valid();", "function validate(array $data)\n\t{\n\t}", "public function validateArguments() {}", "protected function _validate() {\n\t}", "public function validateCallParameter() {\n if ($this->call_asset['parameter']) {\n // Validate parameters to a call.\n // Array, defining each parameter allowed in a call with the expected\n // data type of the value.\n $call_parameter = $this->call_parameter;\n // Parameters of the call request as seen in the request call.\n $call_request_parameter = $this->call_asset['parameter'];\n\n // Validate each parameter.\n foreach($call_request_parameter as $key => $value) {\n if (array_key_exists($key, $call_parameter)) {\n // Key in the request matches predefined parameter of the call.\n $is_valid = $this->matchDataType($value, $call_parameter[ $key ]);\n \n // Value should only match the enumerated value.\n if (is_array($call_parameter[ $key ])) {\n $call_parameter[ $key ] = 'one: ' . implode(',', $call_parameter[ $key ]) . ' - list';\n }\n\n if (!$is_valid) {\n // Data type mismatch.\n $response = [\n 'code' => 400, // Bad Request.\n 'message' => 'Call: Parameter ' . $key . ' expects ' . $call_parameter[ $key ] . ' type.'\n ];\n TripalWebServiceResponse::errorResponse($response);\n\n // Error will exit, but break here to be clear that loop should halt on error.\n break;\n }\n }\n else {\n // Undefined parameter to this call.\n $response = [\n 'code' => 400, // Bad Request.\n 'message' => 'Call: Parameter ' . $key . ' not expected for this call.'\n ];\n TripalWebServiceResponse::errorResponse($response);\n\n // Error will exit, but break here to be clear that loop should halt on error.\n break;\n }\n }\n }\n }", "protected function validateParameters($params) {\n\t\t$this->validateFields($params);\n\t\t$this->validateNoExtraFields($params);\n\t\t$this->validateCardNumber($params);\n\t}", "public function validation($input){\n\t\treturn true;\n\t}", "public function validated();", "function validate($data) {\n if (is_string($this->paramtype)) {\n if (preg_match($this->paramtype, $data)) {\n return true;\n } else {\n return get_string('validateerror', 'admin');\n }\n\n } else if ($this->paramtype === PARAM_RAW) {\n return true;\n\n } else {\n $cleaned = stripslashes(clean_param(addslashes($data), $this->paramtype));\n if (\"$data\" == \"$cleaned\") { // implicit conversion to string is needed to do exact comparison\n return true;\n } else {\n return get_string('validateerror', 'admin');\n }\n }\n }", "function validateInput($requestValue, $validParams, $HttpType, $min, $max) {\n $isValid = true;\n if (!validateInputSize($requestValue, $min, $max)) {\n $isValid = false;\n send404(\"Invlaid Number of Inputs\", array(\"Message\" => \"Invalid input lenght\"));\n }\n else if (!validateInputName($validParams, $requestValue)) {\n $isValid = false;\n // Send 404 in validateInputName\n }\n else if (!httpResponseValidatation($HttpType, $requestValue)) {\n $isValid = false;\n // Send 404 in validateInputContents\n }\n return $isValid;\n}", "public function validateRequest();", "abstract function validate(): void;", "public function cli_validateArgs() {}", "public function valid(){ }", "function validate($validateThis) {}", "public function validate($value);", "public function validate($value);", "protected function validateParameters($params) {\n return true;\n }", "function valid();", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "function validate(){\n }", "function input_required_validation($input, $in_name) {\r\n $err = \"\";\r\n if ($input == \"\" or $input == NULL or empty($input)) {\r\n $err = \"$in_name is required\";\r\n }\r\n return $err;\r\n}", "abstract protected function validateValue($value);", "function required_param($parname, $type=PARAM_CLEAN, $errMsg=\"err_param_requis\") {\n\n // detect_unchecked_vars addition\n global $CFG;\n if (!empty($CFG->detect_unchecked_vars)) {\n global $UNCHECKED_VARS;\n unset ($UNCHECKED_VARS->vars[$parname]);\n }\n\n if (isset($_POST[$parname])) { // POST has precedence\n $param = $_POST[$parname];\n } else if (isset($_GET[$parname])) {\n $param = $_GET[$parname];\n } else {\n erreur_fatale($errMsg,$parname);\n }\n // ne peut pas �tre vide !!! (required)\n $tmpStr= clean_param($param, $type); //PP test final\n // attention \"0\" est empty !!!\n\n if (!empty($tmpStr) || $tmpStr==0) return $tmpStr;\n else erreur_fatale(\"err_param_suspect\",$parname.' '.$param. \" \".__FILE__ );\n\n\n}", "public function validateUserParam($p){\n\t\t\treturn (preg_match(\"/^user_id=[0-9]+$/\", $p) || preg_match(\"/^screen_name=[0-9a-zA-Z_]+$/\", $p));\n\t\t}", "abstract protected function validate(): bool;", "private function validate_params( & $params )\n {\n if (!isset($params['id_item'])) {\n throw new \\Exception('id_item field isnt defined');\n }\n\n $val_digits = new \\Zend\\Validator\\Digits();\n\n if (false === $val_digits->isValid($params['id_item'])) {\n throw new \\Exception('id_item isnt from type bigint');\n }\n\n if (isset($params['preferred'])) {\n if (!in_array($params['preferred'], array(\"t\",\"f\"))) {\n throw new \\Exception('preferred field must be \"t\" or \"f\"');\n }\n }\n }", "public function validate( $p_filter_input ) {\n\t\treturn true;\n\t}", "public function rules()\n {\n return [\n 'parameter' => 'required',\n ];\n }", "function validate($input) {\n\t\t$values = array();\n\t\tforeach($input as $col => $value) {\n\t\t\tif($value != \"\") {\n\t\t\t\t$values[$col] = $value;\n\t\t\t}\n\t\t}\n\t\tif($values[\"instrument\"] == 0) {\n\t\t\tunset($values[\"instrument\"]);\n\t\t}\n\t\t\n\t\tparent::validate($values);\n\t}", "public function validate($configData);", "abstract public function validate_request(array $params):bool;", "private function validate_params( & $params )\n {\n if (!isset($params['search'])) {\n throw new \\Exception('search field isnt defined');\n } else {\n $this->search = $params['search'];\n }\n\n if (isset($params['default_display'])) {\n if (false === is_bool($params['default_display'])) {\n throw new \\Exception('default_display isnt from type boolean');\n }\n }\n\n if (isset($params['no_transform_attributes'])) {\n if (false === is_bool($params['no_transform_attributes'])) {\n throw new \\Exception('no_transform_attributes isnt from type boolean');\n }\n }\n\n\n }", "function isValid();", "abstract public function runValidation();", "function paramsValidateTwo($instruction, $first_arg, $sec_arg)\n{\n if ((strcmp(\"MOVE\", $instruction[0]) == 0) || (strcmp(\"NOT\", $instruction[0]) == 0) || (strcmp(\"INT2CHAR\", $instruction[0]) == 0) || (strcmp(\"STRLEN\", $instruction[0]) == 0) || (strcmp(\"TYPE\", $instruction[0]) == 0))\n {\n if (($first_arg != \"var\") || ($sec_arg == \"type\") || ($sec_arg == \"label\") )\n {\n Err();\n }\n }\n else if ((strcmp(\"READ\", $instruction[0]) == 0))\n {\n if (($first_arg != \"var\") || ($sec_arg != \"type\"))\n {\n Err();\n }\n }\n}", "public function is_valid()\n {\n }", "public function is_valid()\n {\n }", "public function validation()\n {\n $this->assertFalse($this->denyValidator->validate(123));\n $this->assertFalse($this->denyValidator->validate('1234'));\n $this->assertFalse($this->denyValidator->validate(true));\n $this->assertFalse($this->denyValidator->validate(null));\n $this->assertFalse($this->denyValidator->validate(new stdClass()));\n }", "abstract public function isValid();", "abstract public function isValid();", "public function validationAction() {\n\n $video_type = $this->_getParam('type');\n $code = $this->_getParam('code');\n $ajax = $this->_getParam('ajax', false);\n $valid = false;\n\n //CHECK WHICH API SHOULD BE USED\n if ($video_type == \"youtube\") {\n $valid = $this->checkYouTube($code);\n }\n\n if ($video_type == \"vimeo\") {\n $valid = $this->checkVimeo($code);\n }\n\n $this->view->code = $code;\n $this->view->ajax = $ajax;\n $this->view->valid = $valid;\n }", "protected function validate()\n {\n }", "public function validateValue($value)\n {\n }", "public function isValidParam ($key)\n {\n if (in_array(strtoupper($key), $this->_validParamNames)) {\n return true;\n }\n return false;\n }", "protected function verifyParams() {\n\t\t\treturn true;\n\t\t}", "protected function validateParams(Event $event)\n {\n return (count($event->getCustomParams()) > 0) ? true : false;\n }", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();" ]
[ "0.75601923", "0.74833214", "0.72775173", "0.7109213", "0.71062833", "0.71062833", "0.7013136", "0.6922704", "0.688414", "0.688414", "0.688414", "0.688414", "0.688414", "0.688414", "0.688414", "0.688414", "0.688414", "0.688414", "0.688414", "0.688414", "0.6846771", "0.68423325", "0.68062115", "0.6803466", "0.67799795", "0.67728674", "0.677073", "0.6681652", "0.6667034", "0.66598666", "0.6654838", "0.66193557", "0.6589635", "0.65666413", "0.65666413", "0.65666413", "0.65666413", "0.65603054", "0.65429085", "0.65407073", "0.65407073", "0.65407073", "0.65407073", "0.65314466", "0.6529469", "0.65244657", "0.6521174", "0.6511098", "0.6505706", "0.648145", "0.6469489", "0.6466628", "0.64390874", "0.64320475", "0.643119", "0.6423488", "0.64148396", "0.6412206", "0.6412206", "0.64113486", "0.640398", "0.6378032", "0.6378032", "0.6378032", "0.6378032", "0.6378032", "0.6378032", "0.6378032", "0.6378032", "0.63556135", "0.63371044", "0.6327808", "0.63266456", "0.6323426", "0.6308105", "0.6305016", "0.62991786", "0.62815624", "0.62793005", "0.6262692", "0.62620366", "0.6252491", "0.6231996", "0.6223514", "0.62139237", "0.62117004", "0.62116903", "0.61981887", "0.61940014", "0.61940014", "0.6184844", "0.61496615", "0.61469764", "0.61446935", "0.6137329", "0.6131955", "0.6128662", "0.6128662", "0.6128662", "0.6128662" ]
0.6259174
81
/ Generate random password Mask Rules digit C Caps Character (AZ) c Small Character (az) X Mixed Case Character (azAZ) ! Custom Extended Characters
function gen_pass($mask) { $extended_chars = "!@#$%^&*()"; $length = strlen($mask); $pwd = ''; for ($c=0;$c<$length;$c++) { $ch = $mask[$c]; switch ($ch) { case '#': $p_char = rand(0,9); break; case 'C': $p_char = chr(rand(65,90)); break; case 'c': $p_char = chr(rand(97,122)); break; case 'X': do { $p_char = rand(65,122); } while ($p_char > 90 && $p_char < 97); $p_char = chr($p_char); break; case '!': $p_char = $extended_chars[rand(0,strlen($extended_chars)-1)]; break; } $pwd .= $p_char; } return $pwd; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generatePassword() {\n // 57 prefixes\n $aPrefix = array('aero', 'anti', 'ante', 'ande', 'auto', \n 'ba', 'be', 'bi', 'bio', 'bo', 'bu', 'by', \n 'ca', 'ce', 'ci', 'cou', 'co', 'cu', 'cy', \n 'da', 'de', 'di', 'duo', 'dy', \n 'eco', 'ergo', 'exa', \n 'geo', 'gyno', \n 'he', 'hy', 'ki',\n 'intra', \n 'ma', 'mi', 'me', 'mo', 'my', \n 'na', 'ni', 'ne', 'no', 'ny', \n 'omni', \n 'pre', 'pro', 'per', \n 'sa', 'se', 'si', 'su', 'so', 'sy', \n 'ta', 'te', 'tri',\n 'uni');\n\n // 30 suffices\n $aSuffix = array('acy', 'al', 'ance', 'ate', 'able', 'an', \n 'dom', \n 'ence', 'er', 'en',\n 'fy', 'ful', \n 'ment', 'ness',\n 'ist', 'ity', 'ify', 'ize', 'ise', 'ible', 'ic', 'ical', 'ous', 'ish', 'ive', \n 'less', \n 'sion',\n 'tion', 'ty', \n 'or');\n\n // 8 vowel sounds \n $aVowels = array('a', 'o', 'e', 'i', 'y', 'u', 'ou', 'oo'); \n\n // 20 random consonants \n $aConsonants = array('w', 'r', 't', 'p', 's', 'd', 'f', 'g', 'h', 'j', \n 'k', 'l', 'z', 'x', 'c', 'v', 'b', 'n', 'm', 'qu');\n\n // Some consonants can be doubled\n $aDoubles = array('n', 'm', 't', 's');\n\n // \"Salt\"\n $aSalt = array('!', '#', '%', '?');\n\n $pwd = $aPrefix[array_rand($aPrefix)];\n\n // add random consonant(s)\n $c = $aConsonants[array_rand($aConsonants)];\n if ( in_array( $c, $aDoubles ) ) {\n // 33% chance of doubling it\n if (rand(0, 2) == 1) { \n $c .= $c;\n }\n }\n $pwd .= $c;\n\n // add random vowel\n $pwd .= $aVowels[array_rand($aVowels)];\n\n $pwdSuffix = $aSuffix[array_rand($aSuffix)];\n // If the suffix begins with a vovel, add one or more consonants\n if ( in_array( $pwdSuffix[0], $aVowels ) ) {\n $pwd .= $aConsonants[array_rand($aConsonants)];\n }\n $pwd .= $pwdSuffix;\n\n $pwd .= rand(2, 999);\n # $pwd .= $aSalt[array_rand($aSalt)];\n\n // 50% chance of capitalizing the first letter\n if (rand(0, 1) == 1) {\n $pwd = ucfirst($pwd);\n }\n return $pwd;\n }", "function createPwd($characters) {\n $possible = '23456789bcdfghjkmnpqrstvwxyz';\n $code = '';\n $i = 0;\n while ($i < $characters) {\n $code .= substr($possible, mt_rand(0, strlen($possible)-1), 1);\n $i++;\n }\n return $code;\n}", "public static function generatePassword() {\n\t\t$consonants = array (\n\t\t\t\t\"b\",\n\t\t\t\t\"c\",\n\t\t\t\t\"d\",\n\t\t\t\t\"f\",\n\t\t\t\t\"g\",\n\t\t\t\t\"h\",\n\t\t\t\t\"j\",\n\t\t\t\t\"k\",\n\t\t\t\t\"l\",\n\t\t\t\t\"m\",\n\t\t\t\t\"n\",\n\t\t\t\t\"p\",\n\t\t\t\t\"r\",\n\t\t\t\t\"s\",\n\t\t\t\t\"t\",\n\t\t\t\t\"v\",\n\t\t\t\t\"w\",\n\t\t\t\t\"x\",\n\t\t\t\t\"y\",\n\t\t\t\t\"z\" \n\t\t);\n\t\t$vocals = array (\n\t\t\t\t\"a\",\n\t\t\t\t\"e\",\n\t\t\t\t\"i\",\n\t\t\t\t\"o\",\n\t\t\t\t\"u\" \n\t\t);\n\t\t\n\t\t$password = '';\n\t\t\n\t\tsrand ( ( double ) microtime () * 1000000 );\n\t\tfor($i = 1; $i <= 4; $i ++) {\n\t\t\t$password .= $consonants [rand ( 0, 19 )];\n\t\t\t$password .= $vocals [rand ( 0, 4 )];\n\t\t}\n\t\t$password .= rand ( 0, 9 );\n\t\t\n\t\treturn $password;\n\t}", "public function genaratepassword() {\r\r\n $length = 10;\r\r\n $alphabets = range('A', 'Z');\r\r\n $numbers = range('0', '9');\r\r\n $additional_characters = array('1', '3');\r\r\n $final_array = array_merge($alphabets, $numbers, $additional_characters);\r\r\n $password = '';\r\r\n while ($length--) {\r\r\n $key = array_rand($final_array);\r\r\n $password .= $final_array[$key];\r\r\n }\r\r\n return $password;\r\r\n }", "function generarPassword() {\n\t\t$str = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890\";\n\t\t$cad = \"\";\n\t\tfor ($i = 0; $i < 8; $i++) {\n\t\t\t$cad .= substr($str, rand(0, 62), 1);\n\t\t}\n\t\treturn $cad;\n\t}", "public static function generatePassword()\n\t{\n\t\t$consonants = array(\"b\", \"c\", \"d\", \"f\", \"g\", \"h\", \"j\", \"k\", \"l\", \"m\", \"n\", \"p\", \"r\", \"s\", \"t\", \"v\", \"w\", \"x\", \"y\", \"z\");\n\t\t$vocals = array(\"a\", \"e\", \"i\", \"o\", \"u\");\n\n\t\t$password = '';\n\n\t\tsrand((double)microtime() * 1000000);\n\t\tfor ($i = 1; $i <= 4; $i++) {\n\t\t\t$password .= $consonants[rand(0, 19)];\n\t\t\t$password .= $vocals[rand(0, 4)];\n\t\t}\n\t\t$password .= rand(0, 9);\n\n\t\treturn $password;\n\t}", "function generatePassword() {\n\t//* (c) Hitech Scripts 2003\n\t//* For more information, visit http://www.hitech-scripts.com\n\t//* modified for phpgiftreg by Chris Clonch\n\tmt_srand((double) microtime() * 1000000);\n\t$newstring = \"\";\n\tif ($GLOBALS[\"OPT\"][\"password_length\"] > 0) {\n\t\twhile(strlen($newstring) < $GLOBALS[\"OPT\"][\"password_length\"]) {\n\t\t\tswitch (mt_rand(1,3)) {\n\t\t\t\tcase 1: $newstring .= chr(mt_rand(48,57)); break; // 0-9\n\t\t\t\tcase 2: $newstring .= chr(mt_rand(65,90)); break; // A-Z\n\t\t\t\tcase 3: $newstring .= chr(mt_rand(97,122)); break; // a-z\n\t\t\t}\n\t\t}\n\t}\n\treturn $newstring;\n}", "public function createRandomPassword() {\n\t\t$chars = \"abcdefghijkmnopqrstuvwxyz023456789\";\n\t\t\n\t\tsrand((double)microtime()*1000000);\n\t\t\n\t\t$i = 0;\n\t\t\n\t\t$pass = '' ;\n\t\t\n\t\twhile ($i <= 7) {\n\t\t\n\t\t\t$num = rand() % 33;\n\t\t\n\t\t\t$tmp = substr($chars, $num, 1);\n\t\t\n\t\t\t$pass = $pass . $tmp;\n\t\t\n\t\t\t$i++;\n\t\t\n\t\t}\n\t\treturn $pass;\n\t}", "function createRandomPassword() {\r\n $chars = \"abcdefghijkmnopqrstuvwxyz023456789\";\r\n srand((double) microtime() * 1000000);\r\n $i = 0;\r\n $pass = '';\r\n\r\n while ($i <= 7) {\r\n $num = rand() % 33;\r\n $tmp = substr($chars, $num, 1);\r\n $pass = $pass . $tmp;\r\n $i++;\r\n }\r\n\r\n return $pass;\r\n }", "function createRandomPassword() { \n $chars \t= \"abcdefghijkmnopqrstuvwxyz023456789\"; \n srand((double)microtime()*1000000); \n $i \t\t= 0; \n $pass \t= '' ; \n\n while ($i <= 4) { \n $num \t= rand() % 33; \n $tmp \t= substr($chars, $num, 1); \n $pass \t= $pass . $tmp; \n $i++; \n } \n\n return $pass; \n }", "public static function generatePassword() {\r\n return StringGenerator::generateRandomAlphaAndNumbersAndSpecial(12);\r\n }", "public function randomString(){\n $alpha = \"abcdefghijklmnopqrstuvwxyz\";\n $alpha_upper = strtoupper($alpha);\n $numeric = \"0123456789\";\n $special = \".-+=_,!@$#*%<>[]{}\";\n $chars = $alpha . $alpha_upper . $numeric; \n $pw = ''; \n $chars = str_shuffle($chars);\n $pw = substr($chars, 8,8);\n return $pw;\n }", "function gen_pwd($chars) \n\t{\n\t\t$data = '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcefghijklmnopqrstuvwxyz';\n\t\treturn substr(str_shuffle($data), 0, $chars);\n\t}", "private function generarPassword() {\r\n $minusculas = \"abcdefghijklmnopqrstuvwxyz\";\r\n $mayusculas = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\r\n $numeros = \"1234567890\";\r\n $may = \"\";\r\n $min = \"\";\r\n $num = \"\";\r\n for ($i = 0; $i < 11; $i++) {\r\n $min .= substr($minusculas, rand(0, 26), 1);\r\n $may .= substr($mayusculas, rand(0, 26), 1);\r\n $num .= substr($numeros, rand(0, 10), 1);\r\n }\r\n $password = substr($may, 0, 2) . substr($min, 0, 5) . '-' . substr($num, 0, 3);\r\n return $password;\r\n }", "function makePassword() {\n $alphaNum = array(2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f, g, h, i, j, k, m, n, p, q, r, s, t, u, v, w, x, y, z);\n srand ((double) microtime() * 1000000);\n $pwLength = \"7\"; // this sets the limit on how long the password is.\n for($i = 1; $i <=$pwLength; $i++) {\n $newPass .= $alphaNum[(rand(0,31))];\n }\n return ($newPass);\n}", "public static function makePassword()\n {\n $pass = \"\";\n $chars = array(\n \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"0\",\n \"a\", \"A\", \"b\", \"B\", \"c\", \"C\", \"d\", \"D\", \"e\", \"E\", \"f\", \"F\", \"g\", \"G\", \"h\", \"H\", \"i\", \"I\", \"j\", \"J\",\n \"k\", \"K\", \"l\", \"L\", \"m\", \"M\", \"n\", \"N\", \"o\", \"O\", \"p\", \"P\", \"q\", \"Q\", \"r\", \"R\", \"s\", \"S\", \"t\", \"T\",\n \"u\", \"U\", \"v\", \"V\", \"w\", \"W\", \"x\", \"X\", \"y\", \"Y\", \"z\", \"Z\");\n\n $count = count($chars) - 1;\n\n srand((double) microtime() * 1000000);\n\n for ($i = 0; $i < 8; $i++) {\n $pass .= $chars[rand(0, $count)];\n }\n\n return ($pass);\n }", "function randomPassword()\r\n\t{\r\n\t\t$longitud = 8;\r\n\t\t$carac = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\r\n\t\t$pwd = '';\r\n\t\tfor ($i=0; $i<$longitud; ++$i){ \r\n\t\t\t $pwd .= substr($carac, (mt_rand() % strlen($carac)), 1);\r\n\t\t}\t \r\n\t return trim($pwd);\r\n\t}", "function createRandomPassword() {\r\n $chars = \"abcdefghijkmnopqrstuvwxyz023456789\";\r\n srand((double)microtime()*1000000);\r\n $i = 0;\r\n $pass = '' ;\r\n\r\n while ($i <= 7) {\r\n $num = rand() % 33;\r\n $tmp = substr($chars, $num, 1);\r\n $pass = $pass . $tmp;\r\n $i++;\r\n }\r\n\r\n return $pass;\r\n}", "function get_random_password($chars_min=6, $chars_max=8, $use_upper_case=false, $include_numbers=false, $include_special_chars=false)\n {\n $length = rand($chars_min, $chars_max);\n $selection = 'aeuoyibcdfghjklmnpqrstvwxz';\n if($include_numbers) {\n $selection .= \"1234567890\";\n }\n if($include_special_chars) {\n $selection .= \"!@04f7c318ad0360bd7b04c980f950833f11c0b1d1quot;#$%&[]{}?|\";\n }\n \n $password = \"\";\n for($i=0; $i<$length; $i++) {\n $current_letter = $use_upper_case ? (rand(0,1) ? strtoupper($selection[(rand() % strlen($selection))]) : $selection[(rand() % strlen($selection))]) : $selection[(rand() % strlen($selection))]; \n $password .= $current_letter;\n } \n \n return $password;\n }", "function genera_password($num=8,$randnum=0){ // By Kernellover \n $voc = 'aeiou'; \n $con = 'bcdfgjklmnpqrstwxyz';\n\t$nvoc = strlen($voc)-1;\n\t$ncon = strlen($con)-1;\n\t$psw =mt_rand(0,1)?$con[mt_rand(0,$ncon)]:''; // defineix si comença per vocal o consonant\n\n\t\n for ($n=0; $n<=ceil($num/2); $n++){ \n $psw .= $voc[mt_rand(0,$nvoc)]; \n $psw .= $con[mt_rand(0,$ncon)]; \n }\n\n\t$cua=$randnum?mt_rand(1,$randnum):'';\n\t$psw = str_replace (array('q','quu','yi','iy'),array('qu','que','ya','ya'),$psw);\n $psw = substr($psw,0,$num-strlen($cua)).$cua; \n\n\n return $psw; \n}", "function randomPassword()\n{\n\n$digit = 6;\n$karakter = \"ABCDEFGHJKLMNPQRSTUVWXYZ23456789\";\n\nsrand((double)microtime()*1000000);\n$i = 0;\n$pass = \"\";\nwhile ($i <= $digit-1)\n{\n$num = rand() % 32;\n$tmp = substr($karakter,$num,1);\n$pass = $pass.$tmp;\n$i++;\n}\nreturn $pass;\n}", "function generatePassword() {\n //Initialize the random password\n $password = '';\n\n //Initialize a random desired length\n $desired_length = rand(8, 12);\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n for ($length = 0; $length < $desired_length; $length++) {\n //Append a random ASCII character (including symbols)\n $password .= $characters[mt_rand(0, strlen($characters) - 1)];\n }\n\n return $password;\n }", "private function generateRandomPassword() {\n $alphabet = \"23456789bcdefghijklmnopqrstuwxyzBCDEFGHIJKLMNOPQRSTUWXYZ\";\n $pass = array();\n $alphaLength = strlen($alphabet) - 1;\n for ($i = 0; $i < 8; $i ++) {\n $n = rand(0, $alphaLength);\n $pass [] = $alphabet [$n];\n }\n return implode($pass);\n }", "function randomPassword() {\n $alphabet = \"abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ0123456789\";\n\t$max = 15;\n\t$temp = \"\";\n\t\n for ($i = 0; $i < $max; $i++) {\n $random_int = mt_rand();\n $temp .= $alphabet[$random_int % strlen($alphabet)];\n }\n return $temp;\n}", "function randomPassword()\r\n{\r\n\r\n$digit = 6;\r\n$karakter = \"ABCDEFGHJKLMNPQRSTUVWXYZ23456789\";\r\n\r\nsrand((double)microtime()*1000000);\r\n$i = 0;\r\n$pass = \"\";\r\nwhile ($i <= $digit-1)\r\n{\r\n$num = rand() % 32;\r\n$tmp = substr($karakter,$num,1);\r\n$pass = $pass.$tmp;\r\n$i++;\r\n}\r\nreturn $pass;\r\n}", "function Genera_Password($cadena){\r\n $cadena_1 = \"1234567890\";\r\n\t$cadena_2 = \"&%$/.@*_-#\";\r\n //Obtenemos la longitud de la cadena de caracteres\r\n $longitudCadena_1=strlen($cadena_1);\r\n\t$longitudCadena_2=strlen($cadena_2);\r\n\r\n //Se define la variable que va a contener la contrase�a\r\n $pass = \"\";\r\n //Se define la longitud de la contrase�a, en mi caso 10, pero puedes poner la longitud que quieras\r\n $longitudPass=4;\r\n\r\n\t$pass = $cadena.substr($cadena_1,rand(0,$longitudCadena_1-1),1).substr($cadena_1,rand(0,$longitudCadena_1-1),1).substr($cadena_2,rand(0,$longitudCadena_2-1),1).substr($cadena_2,rand(0,$longitudCadena_2-1),1);\r\n\r\n return $pass;\r\n}", "function makeRandomPassword() { \n\t $scheme = \"abchefghjkmnpqrstuvwxyz0123456789\"; \n\t srand((double)microtime()*1000000); \n\t\t $i = 0; \n\t\t while ($i <= 7) { \n\t\t\t\t$num = rand() % 33; \n\t\t\t\t$tmp = substr($scheme, $num, 1); \n\t\t\t\t$pass = $pass . $tmp; \n\t\t\t\t$i++; \n\t\t } \n\t\t return $pass; \n\t}", "protected function random_password() \n {\n $length = 8;\n // 0 and O, l and 1 are all removed to prevent silly people who can't read to make mistakes.\n $characters = '23456789abcdefghijkmnpqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ';\n $string = ''; \n for ($p = 0; $p < $length; $p++) {\n $string .= $characters[mt_rand(0, strlen($characters))];\n }\n return $string;\n }", "private function randomPassword() {\n\t\t$alphabet = \"abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ0123456789\";\n\t\t$pass = array(); //remember to declare $pass as an array\n\t\t$alphaLength = strlen($alphabet) - 1; //put the length -1 in cache\n\t\tfor ($i = 0; $i < 8; $i++) {\n\t\t\t$n = rand(0, $alphaLength);\n\t\t\t$pass[] = $alphabet[$n];\n\t\t}\n\t\treturn implode($pass); //turn the array into a string\n\t}", "function ae_gen_password($syllables = 3, $use_prefix = false)\n{\n if (!function_exists('ae_arr')) {\n\n // This function returns random array element\n function ae_arr(&$arr)\n {\n return $arr[rand(0, sizeof($arr) - 1)];\n }\n\n }\n\n // 20 prefixes\n $prefix = array('aero', 'anti', 'auto', 'bi', 'bio',\n 'cine', 'deca', 'demo', 'dyna', 'eco',\n 'ergo', 'geo', 'gyno', 'hypo', 'kilo',\n 'mega', 'tera', 'mini', 'nano', 'duo');\n\n // 10 random suffixes\n $suffix = array('dom', 'ity', 'ment', 'sion', 'ness',\n 'ence', 'er', 'ist', 'tion', 'or');\n\n // 8 vowel sounds\n $vowels = array('a', 'o', 'e', 'i', 'y', 'u', 'ou', 'oo');\n\n // 20 random consonants\n $consonants = array('w', 'r', 't', 'p', 's', 'd', 'f', 'g', 'h', 'j',\n 'k', 'l', 'z', 'x', 'c', 'v', 'b', 'n', 'm', 'qu');\n\n $password = $use_prefix ? ae_arr($prefix) : '';\n $password_suffix = ae_arr($suffix);\n\n for ($i = 0; $i < $syllables; $i++) {\n // selecting random consonant\n $doubles = array('n', 'm', 't', 's');\n $c = ae_arr($consonants);\n if (in_array($c, $doubles) && ($i != 0)) {\n // maybe double it\n if (rand(0, 2) == 1) // 33% probability\n {\n $c .= $c;\n }\n\n }\n $password .= $c;\n //\n // selecting random vowel\n $password .= ae_arr($vowels);\n\n if ($i == $syllables - 1) // if suffix begin with vovel\n {\n if (in_array($password_suffix[0], $vowels)) // add one more consonant\n {\n $password .= ae_arr($consonants);\n }\n }\n\n }\n\n // selecting random suffix\n $password .= $password_suffix;\n\n return $password;\n}", "function generatePassword($numAlpha=8, $numNonAlpha=4) {\r\n\t$listAlpha = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\r\n\t$listNonAlpha = ',;:!?.$/*-+&@_+;./*&?$-!,';\r\n\treturn str_shuffle(\r\n\t\tsubstr(str_shuffle($listAlpha), 0, $numAlpha) .\r\n\t\tsubstr(str_shuffle($listNonAlpha), 0, $numNonAlpha)\r\n\t);\r\n}", "function passgen() {\r\n\t$pw = '';\r\n\t$pw_lenght = 8;\r\n $zeichen = \"0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z\";\r\n $array_b = explode(\",\",$zeichen);\r\n for($i=0;$i<$pw_lenght;$i++) {\r\n \tsrand((double)microtime()*1000000);\r\n $z = rand(0,25);\r\n $pw .= \"\".$array_b[$z].\"\";\r\n }\r\n\treturn $pw;\r\n}", "function gen_pwd($chars) \n\t{\n\t\t$ci = get_instance()->load->helper('myencrypt');\n\t\treturn random_str($chars);\n\t}", "function randomPassword() {\n $alphabet = \"abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ0123456789\";\n $pass = array(); //remember to declare $pass as an array\n $alphaLength = strlen($alphabet) - 1; //put the length -1 in cache\n for ($i = 0; $i < 8; $i++) {\n $n = rand(0, $alphaLength);\n $pass[] = $alphabet[$n];\n }\n return implode($pass); //turn the array into a string\n }", "function makePassword($len = 8)\r\n{\r\n $vowels = array('a', 'e', 'i', 'o', 'u', 'y');\r\n $confusing = array('I', 'l', '1', 'O', '0');\r\n $replacements = array('A', 'k', '3', 'U', '9');\r\n $choices = array(0 => rand(0, 1), 1 => rand(0, 1), 2 => rand(0, 2));\r\n $parts = array(0 => '', 1 => '', 2 => '');\r\n\r\n if ($choices[0]) $parts[0] = rand(1, rand(9,99));\r\n if ($choices[1]) $parts[2] = rand(1, rand(9,99));\r\n\r\n $len -= (strlen($parts[0]) + strlen($parts[2]));\r\n for ($i = 0; $i < $len; $i++)\r\n {\r\n if ($i % 2 == 0)\r\n {\r\n do $con = chr(rand(97, 122));\r\n while (in_array($con, $vowels));\r\n $parts[1] .= $con;\r\n }\r\n else\r\n {\r\n $parts[1] .= $vowels[array_rand($vowels)];\r\n }\r\n }\r\n if ($choices[2]) $parts[1] = ucfirst($parts[1]);\r\n if ($choices[2] == 2) $parts[1] = strrev($parts[1]);\r\n\r\n $r = $parts[0] . $parts[1] . $parts[2];\r\n $r = str_replace($confusing, $replacements, $r);\r\n return $r;\r\n}", "private function genPass() {\r\n $random = 0;\r\n $rand78 = \"\";\r\n $randpass = \"\";\r\n $pass = \"\";\r\n $maxcount = rand( 4, 9 );\r\n // The rand() limits (min 4, max 9) don't actually limit the number\r\n // returned by rand, so keep looping until we have a password that's\r\n // more than 4 characters and less than 9.\r\n if ( ($maxcount > 8) or ( $maxcount < 5) ) {\r\n do {\r\n $maxcount = rand( 4, 9 );\r\n } while ( ($maxcount > 8) or ( $maxcount < 5) );\r\n }\r\n $rand78 = \"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()-=_+abcdefghijklmnopqrstuvwxyz\";\r\n for ( $count = 0; $count <= $maxcount; $count++ ) {\r\n $random = rand( 0, 77 );\r\n $randpass = substr( $rand78, $random, 1 );\r\n $pass = $pass . $randpass;\r\n }\r\n $pass = substr( $pass, 0, 8 ); // Just in case\r\n return($pass);\r\n }", "function randomPassword() {\n $alphabet = \"abcdefghijklmnopqrstuwxyz0123456789!@#$%\";\n $pass = array(); //remember to declare $pass as an array\n $alphaLength = strlen($alphabet) - 1; //put the length -1 in cache\n for ($i = 0; $i < 8; $i++) {\n $n = rand(0, $alphaLength);\n $pass[] = $alphabet[$n];\n }\n return implode($pass); //turn the array into a string\n }", "function randomPassword() {\r\n $alphabet = \"abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ0123456789\";\r\n $pass = array(); \r\n $alphaLength = strlen($alphabet) - 1; \r\n for ($i = 0; $i < 8; $i++) {\r\n $n = rand(0, $alphaLength);\r\n $pass[] = $alphabet[$n];\r\n }\r\n return implode($pass); \r\n}", "public function getRandomPassword()\n {\n //Random rand = new Random();\n //int type, number;\n $password = \"\";\n\n for($i = 0; $i < 7; $i++)\n {\n $type = rand(0, 21) % 3;\n $number = rand(0, 25);\n\n if($type == 1)\n {\n $password = $password . chr(48 + ($number % 10));\n }\n\n else\n {\n if($type == 2)\n {\n $password = $password . chr(65 + $number);\n }\n\n else\n {\n $password = $password . chr(97 + $number);\n }\n }\n }\n\n return $password;\n }", "function generate_user_password()\n{\n $chars = \"0123456789abcdefghijklmnpqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ\";\n\n srand((double)microtime()*1000000);\n $code = \"\";\n \n for ($i = 0; $i < 6; $i++)\n {\n $num = rand() % 60;\n $tmp = substr($chars, $num, 1);\n $code = $code . $tmp;\n }\n return $code;\n}", "public function generate_pw(){\n $alphabet = \"abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ0123456789\";\n $pass = str_shuffle($alphabet);\n $pass = substr($pass, 0, 8);\n $this->setPassword($pass);\n return $pass; //turn the array into a string\n }", "function createpass(){\n$s=\"\";\nfor ($i=0;$i<7;$i++)\n$s.=rand(0,9);\nreturn $s;\n}", "function random_password() {\n $alphabet = \"abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ0123456789\";\n $pass = array(); //remember to declare $pass as an array\n $alphaLength = strlen($alphabet) - 1; //put the length -1 in cache\n for ($i = 0; $i < 8; $i++) {\n $n = rand(0, $alphaLength);\n $pass[] = $alphabet[$n];\n }\n return implode($pass); //turn the array into a string\n }", "public static function generate_password()\n\t{\n\t\t$chars = array(\n\t\t\t'a','b','c','d','e','f','g','h','i','j','k','l','m','n',\n\t\t\t'o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D',\n\t\t\t'E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T',\n\t\t\t'U','V','W','X','Y','Z','1','2','3','4','5','6','7','8','9','0',\n\t\t\t'!','@','#','$','%','^','&','*','(',')','_','-','+','=','{','~',\n\t\t\t'}','[',']','|','/','?','>','<',':',';'\n\t\t);\n\n\t\t$new_pw = '';\n\t\tfor($i=0;$i<20;$i++)\n\t\t{\n\t\t\t$new_pw .= $chars[rand(0, count($chars)-1)];\n\t\t}\n\n\t\treturn $new_pw;\n\t}", "public function randomPassword() {\n $alphabet = \"abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ0123456789\";\n $passphrase = array();\n $alphaLength = strlen($alphabet) - 1;\n for ($i = 0; $i < 8; $i++) {\n $n = rand(0, $alphaLength);\n $passphrase[] = $alphabet[$n];\n }\n return implode($passphrase);\n }", "private function generatePassword() {\n // account is not wide open if conventional logins are permitted\n $guid = '';\n\n for ($i = 0; ($i < 8); $i++) {\n $guid .= sprintf(\"%x\", mt_rand(0, 15));\n }\n\n return $guid;\n }", "function generatePassword($l = 8, $c = 0, $n = 0, $s = 0) {\n $count = $c + $n + $s;\n\n // sanitize inputs; should be self-explanatory\n if (!is_int($l) || !is_int($c) || !is_int($n) || !is_int($s)) {\n trigger_error('Argument(s) not an integer', E_USER_WARNING);\n return false;\n } elseif ($l < 0 || $l > 20 || $c < 0 || $n < 0 || $s < 0) {\n trigger_error('Argument(s) out of range', E_USER_WARNING);\n return false;\n } elseif ($c > $l) {\n trigger_error('Number of password capitals required exceeds password length', E_USER_WARNING);\n return false;\n } elseif ($n > $l) {\n trigger_error('Number of password numerals exceeds password length', E_USER_WARNING);\n return false;\n } elseif ($s > $l) {\n trigger_error('Number of password capitals exceeds password length', E_USER_WARNING);\n return false;\n } elseif ($count > $l) {\n trigger_error('Number of password special characters exceeds specified password length', E_USER_WARNING);\n return false;\n }\n\n // all inputs clean, proceed to build password\n // change these strings if you want to include or exclude possible password characters\n $chars = \"abcdefghijklmnopqrstuvwxyz\";\n $caps = strtoupper($chars);\n $nums = \"0123456789\";\n $syms = \"!@#$%^&*()-+?\";\n\n // build the base password of all lower-case letters\n for ($i = 0; $i < $l; $i++) {\n $out .= substr($chars, mt_rand(0, strlen($chars) - 1), 1);\n }\n\n // create arrays if special character(s) required\n if ($count) {\n // split base password to array; create special chars array\n $tmp1 = str_split($out);\n $tmp2 = array();\n\n // add required special character(s) to second array\n for ($i = 0; $i < $c; $i++) {\n array_push($tmp2, substr($caps, mt_rand(0, strlen($caps) - 1), 1));\n }\n for ($i = 0; $i < $n; $i++) {\n array_push($tmp2, substr($nums, mt_rand(0, strlen($nums) - 1), 1));\n }\n for ($i = 0; $i < $s; $i++) {\n array_push($tmp2, substr($syms, mt_rand(0, strlen($syms) - 1), 1));\n }\n\n // hack off a chunk of the base password array that's as big as the special chars array\n $tmp1 = array_slice($tmp1, 0, $l - $count);\n // merge special character(s) array with base password array\n $tmp1 = array_merge($tmp1, $tmp2);\n // mix the characters up\n shuffle($tmp1);\n // convert to string for output\n $out = implode('', $tmp1);\n }\n\n return $out;\n}", "function generatePassword( $admin ) {\n\t\n\tglobal $CONF;\n\t\n\tif( strtolower($admin) == \"y\" ) {\n\t\t$pwLength\t\t= 14;\n\t} else {\n\t\t$pwLength\t\t= 8;\n\t}\n\t\n\t$password\t\t\t= \"\";\n\n\twhile( checkPasswordPolicy( $password, strtolower($admin) ) == 0 ) {\n\t\t\n\t\t$password\t\t= \"\";\n\t\t\n\t\tfor( $i = 1; $i <= $pwLength; $i++ ) {\n\t\t\t\n\t\t\t$group\t\t\t= rand(0, 3);\n\t\t\tmt_srand(make_seed());\n\t\t\t\n\t\t\tswitch( $group ) {\n\t\t\t\tcase 0:\n\t\t\t\t\t$index\t= rand(0, 25);\n\t\t\t\t\t$value\t= chr( $index + 65 );\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 1:\n\t\t\t\t\t$index\t= rand(0, 25);\n\t\t\t\t\t$value\t= chr( $index + 97 );\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 2:\n\t\t\t\t\t$value\t= rand(0, 9);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 3:\n\t\t\t\t\t$group\t= rand(0, 2);\n\t\t\t\t\t\n\t\t\t\t\tswitch( $group ) {\n\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\t$index\t= rand(33,47);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t$index = 60;\n\t\t\t\t\t\t\twhile( ($index == 60) or ($index == 62) ) { \n\t\t\t\t\t\t\t\t$index = rand(58, 64);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t$index = rand(91, 96);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$value \t= chr( $index );\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$password\t\t.= $value;\n\t\t}\n\t}\n\t\n\treturn( $password );\n}", "function generatePassword($params = array()) {\n\t\t$defaults = array(\n\t\t\t'charset' => '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',\n\t\t\t'length' => 6,\n\t\t\t'unique' => true,\n\t\t);\n\t\t$params = array_merge($defaults, $params);\n $password = '';\n $i = 0;\n \n // add random characters to $password until $length is reached\n while ($i < $length) {\n // pick a random character from the possible ones\n $char = substr($charset, mt_rand(0, strlen($charset)-1), 1);\n \n // we don't want this character if it's already in the password\n if (!$unique || !strstr($charset, $char)) {\n $password .= $char;\n $i++;\n }\n }\n return $password;\n }", "function createRandomToken(){\n\t\t\t$chars = \"abcdefghijkmnopqrstuvwxyz023456789\";\n\t\t\tsrand((double)microtime()*1000000);\n\t\t\t$i = 0;\n\t\t\t$pass = '' ;\n\t\t\twhile ($i <= 7){\n\t\t\t\t$num = rand() % 33;\n\n\t\t\t\t\t\t\t$tmp = substr($chars, $num, 1);\n\n\t\t\t\t\t\t\t$pass = $pass . $tmp;\n\n\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn $pass;\n\t\t\t\t\t\t}", "function random_password($chars = 8) {\r\n\t$letters = 'abcefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';\r\n\treturn substr(str_shuffle($letters), 0, $chars);\r\n}", "public function generatePassword()\n {\n $characters = str_shuffle('abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789');\n\n return substr($characters, 0, 6);\n }", "function genPassword($length=7){\n $newPass = \"\";\n for ($i = 0; $i < $length; $i++) {\n if (rand(0,1)){\n if (rand(0,1)){\n $newPass .= chr(rand(97,122));\n }else{\n $newPass .= chr(rand(65,90));\n }\n }else{\n $newPass .= chr(rand(48,57));\n }\n }\n return $newPass;\n}", "function randomPassword() {\n $alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';\n $pass = array(); // remember to declare $pass as an array\n $alphaLength = strlen($alphabet) - 1; // put the length -1 in cache\n for ($i = 0; $i < 8; $i++) {\n $n = rand(0, $alphaLength);\n $pass[] = $alphabet[$n];\n }\n //turn the array into a string\n return implode($pass);\n }", "function create_verify_string ()\n{\n\t$validchars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz\";\n\t$verifyString = \"\";\n\tfor( $i = 0; $i < 32; $i++ ) {\n\t\t$char = chr( mt_rand( 0, 255 ) );\n\t\twhile( strpos( $validchars, $char ) == 0 ) {\n\t\t\t$char = chr( mt_rand( 0, 255 ) );\n\t\t}\n\t\t$verifyString .= $char;\n\t}\n\t\n\treturn $verifyString;\n}", "function generatePassword($length = 8)\r\n{\r\n\t$password = \"\";\r\n\r\n\t// define possible characters\r\n\t$possible = \"0123456789bcdfghjkmnpqrstvwxyz\"; \r\n\r\n\t// set up a counter\r\n\t$i = 0; \r\n\r\n\t// add random characters to $password until $length is reached\r\n\twhile ($i < $length) { \r\n\r\n\t\t// pick a random character from the possible ones\r\n\t\t$char = substr($possible, mt_rand(0, strlen($possible)-1), 1);\r\n\r\n\t\t// we don't want this character if it's already in the password\r\n\t\tif (!strstr($password, $char)) { \r\n\t\t\t$password .= $char;\r\n\t\t\t$i++;\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t// done!\r\n\treturn $password;\r\n\r\n}", "public function random_password() \r\n {\r\n $alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';\r\n $password = array(); \r\n $alpha_length = strlen($alphabet) - 1; \r\n for ($i = 0; $i < 8; $i++) \r\n {\r\n $n = rand(0, $alpha_length);\r\n $password[] = $alphabet[$n];\r\n }\r\n return implode($password); \r\n}", "function generateCode($length = 5, $add_dashes = false, $available_sets = 'ud')\n{\n\t$sets = array();\n\tif(strpos($available_sets, 'l') !== false)\n\t\t$sets[] = 'abcdefghjkmnpqrstuvwxyz';\n\tif(strpos($available_sets, 'u') !== false)\n\t\t$sets[] = 'ABCDEFGHJKMNPQRSTUVWXYZ';\n\tif(strpos($available_sets, 'd') !== false)\n\t\t$sets[] = '23456789';\n\tif(strpos($available_sets, 's') !== false)\n\t\t$sets[] = '!@#$%&*?';\n\t$all = '';\n\t$password = '';\n\tforeach($sets as $set)\n\t{\n\t\t$password .= $set[array_rand(str_split($set))];\n\t\t$all .= $set;\n\t}\n\t$all = str_split($all);\n\tfor($i = 0; $i < $length - count($sets); $i++)\n\t\t$password .= $all[array_rand($all)];\n\t$password = str_shuffle($password);\n\tif(!$add_dashes)\n\t\treturn $password;\n\t$dash_len = floor(sqrt($length));\n\t$dash_str = '';\n\twhile(strlen($password) > $dash_len)\n\t{\n\t\t$dash_str .= substr($password, 0, $dash_len) . '-';\n\t\t$password = substr($password, $dash_len);\n\t}\n\t$dash_str .= $password;\n\treturn $dash_str;\n}", "function generate_temp_pass(){\n\n $alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';\n $pass = array(); //remember to declare $pass as an array\n $alphaLength = strlen($alphabet) - 1; //put the length -1 in cache\n for ($i = 0; $i < 8; $i++) {\n $n = rand(0, $alphaLength);\n $pass[] = $alphabet[$n];\n }\n return implode($pass);\n}", "public function generarPassword() {\n $caracteres = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJCLMNOPQRSTUVWXYZ1234567890\";\n\n $aleatorio = '';\n for ($i = 0; $i < 5; $i++) {\n $caracter = rand(0, strlen($caracteres));\n $caracter = substr($caracteres, $caracter, 1);\n $aleatorio = $aleatorio . '' . $caracter;\n }\n\n return md5($aleatorio);\n }", "function createNewPassword() {\n\t $genKey = \"0123456789abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ!@#$%&*()_+\";//set the random generator key from a-z and A-Z and 0-9\n\t $pass = array(); //declare $pass as the variable to store array\n\t $genKeyLength = strlen($genKey) - 1; //put the length -1 in cache\n\t for ($i = 0; $i < 10; $i++) {\n\t $n = rand(0, $genKeyLength);//set $n to store the generated random key\n\t $pass[] = $genKey[$n]; //set $pass to store the array of generated key\n\t }\n\t return implode($pass); // used implode turn the array into a string\n\t}", "function sloodle_random_web_password()\n {\n // Define the characters we can use in our token, and get the length of it\n $str = \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n $strlen = strlen($str) - 1;\n // Prepare the password string\n $pwd = '';\n // Loop once for each output character\n for($length = 0; $length < 8; $length++) {\n // Shuffle the string, then pick and store a random character\n $str = str_shuffle($str);\n $char = mt_rand(0, $strlen);\n $pwd .= $str[$char];\n }\n \n return $pwd;\n }", "function generate_password( $length = 8 ) {\n$chars = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_-=+;:,.?\";\n$password = substr( str_shuffle( $chars ), 0, $length );\nreturn $password;\n}", "function gen_pin(){\n $rand_num = rand(6, 12);\n $permitted_chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $pin = substr(str_shuffle($permitted_chars), 0, $rand_num);\n return $pin;\n }", "protected function getRandomCharsString()\n {\n return 'bcdfghjklmnpqrstvwxzBCDFGHJKLMNPQRSTVWXZ0123456789!@#$%^&*()-_=+[]{}|;:,.<>/?';\n }", "function generatePassword($length) { \n $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; \n $count = mb_strlen($chars); \n for ($i = 0, $result = ''; $i < $length; $i++) \n { \n $index = rand(0, $count - 1); \n $result .= mb_substr($chars, $index, 1); \n } \n return $result; \n }", "function genpassword( $length = 8 ) {\n \t\t$chars = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_-=+;:,.?\";\n \t\t $password = substr( str_shuffle( $chars ), 0, $length );\n \treturn $password;\n\t}", "public function generate_code()\n {\n $code = \"\";\n $count = 0;\n while ($count < $this->num_characters) {\n $code .= substr($this->captcha_characters, mt_rand(0, strlen($this->captcha_characters)-1), 1);\n $count++;\n }\n return $code;\n }", "public function generatePassword()\n {\n $a = $this->generateUsername();\n $b = random_int(0, 9);\n $c = random_int(0, 9);\n $d = random_int(0, 9);\n return \"$a$b$c$d\";\n }", "function randomcode ($len=\"10\"){\n\t\t\t\tglobal $pass;\n\t\t\t\tglobal $lchar;\n\t\t\t\t$code = NULL;\n\t\t\n\t\t\t\tfor ($i=0;$i<$len;$i++){\n\t\t\t\t\t$char = chr(rand(48,122));\n\t\t\t\t\twhile(!ereg(\"[a-zA-Z0-9]\", $char)){\n\t\t\t\t\t\tif($char == $lchar) { continue; }\n\t\t\t\t\t\t\t$char = chr(rand(48,90));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$pass .= $char;\n\t\t\t\t\t\t$lchar = $char;\n\t\t\t\t\t}\n\t\t\t\treturn $pass;\n\t\t\t}", "function random_password($length){\r\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\r\n //Create blank string\r\n $password = '';\r\n //Get the index of the last character in our $characters string\r\n $characterListLength = mb_strlen($characters, '8bit') - 1;\r\n //Loop from 1 to the length that was specified\r\n foreach(range(1,$length) as $i){\r\n $password .=$characters[rand(0,$characterListLength)];\r\n }\r\n return $password;\r\n}", "function str_makerand ($minlength, $maxlength, $useupper, $usespecial, $usenumbers)\n{\n $charset = \"abcdefghijklmnopqrstuvwxyz\";\n if ($useupper) $charset .= \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n if ($usenumbers) $charset .= \"0123456789\";\n if ($usespecial) $charset .= \"_-\"; // Note: using all special characters this reads: \"~!@#$%^&*()_+`-={}|\\\\]?[\\\":;'><,./\";\n if ($minlength > $maxlength) $length = mt_rand ($maxlength, $minlength);\n else $length = mt_rand ($minlength, $maxlength);\n for ($i=0; $i<$length; $i++) $key .= $charset[(mt_rand(0,(strlen($charset)-1)))];\n return $key;\n}", "function generaPass(){\n $cadena = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890\";\n //Obtenemos la longitud de la cadena de caracteres\n $longitudCadena=strlen($cadena);\n\n //Se define la variable que va a contener la contraseña\n $pass = \"\";\n //Se define la longitud de la contraseña, en mi caso 10, pero puedes poner la longitud que quieras\n $longitudPass=10;\n\n //Creamos la contraseña\n for($i=1 ; $i<=$longitudPass ; $i++){\n //Definimos numero aleatorio entre 0 y la longitud de la cadena de caracteres-1\n $pos=rand(0,$longitudCadena-1);\n\n //Vamos formando la contraseña en cada iteraccion del bucle, añadiendo a la cadena $pass la letra correspondiente a la posicion $pos en la cadena de caracteres definida.\n $pass .= substr($cadena,$pos,1);\n }\n return $pass;\n}", "function generateCode(){\n $base=\"abcdefghijklmnopkrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_-\";\n $i=0;\n $c=\"\";\n while ($i<6){\n $c.=$base[rand(0,strlen($base)-1)];\n $i++;\n }\n if (validate::existCode($c))\n return generateCode();\n return $c;\n}", "function generaPass() {\n $cadena = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890\";\n //Obtenemos la longitud de la cadena de caracteres\n $longitudCadena = strlen($cadena);\n\n //Se define la variable que va a contener la contraseña\n $pass = \"\";\n //Se define la longitud de la contraseña, en mi caso 10, pero puedes poner la longitud que quieras\n $longitudPass = 10;\n\n //Creamos la contraseña\n for ($i = 1; $i <= $longitudPass; $i++) {\n //Definimos numero aleatorio entre 0 y la longitud de la cadena de caracteres-1\n $pos = rand(0, $longitudCadena - 1);\n //Vamos formando la contraseña en cada iteraccion del bucle, añadiendo a la cadena $pass la letra correspondiente a la posicion $pos en la cadena de caracteres definida.\n $pass .= substr($cadena, $pos, 1);\n }\n return $pass;\n}", "public function addLetters() {\n\n for ($i=0; $i <$this->letterPorsion ; $i++) {\n $this->password = $this->password.substr($this->str, rand(0, strlen($this->str) - 1), 1);\n }\n }", "function generateRandomPassword(){\n $n = 10;\n $result = bin2hex(random_bytes($n));\n return $result;\n }", "function wp_generate_password($length = 12, $special_chars = \\true, $extra_special_chars = \\false)\n {\n }", "function genera_password($longitud,$tipo=\"alfanumerico\"){\n \nif ($tipo==\"alfanumerico\"){\n$exp_reg=\"[^A-Z0-9]\";\n} elseif ($tipo==\"numerico\"){\n$exp_reg=\"[^0-9]\";\n}\n \nreturn substr(eregi_replace($exp_reg, \"\", md5(time())) .\neregi_replace($exp_reg, \"\", md5(time())) .\neregi_replace($exp_reg, \"\", md5(time())),\n0, $longitud);\n}", "function generaPass(){\n $cadena = \"1234567890\";\n //Obtenemos la longitud de la cadena de caracteres\n $longitudCadena=strlen($cadena);\n \n //Se define la variable que va a contener la contraseña\n $pass = \"\";\n //Se define la longitud de la contraseña, en mi caso 10, pero puedes poner la longitud que quieras\n $longitudPass=5;\n \n //Creamos la contraseña\n for($i=1 ; $i<=$longitudPass ; $i++){\n //Definimos numero aleatorio entre 0 y la longitud de la cadena de caracteres-1\n $pos=rand(0,$longitudCadena-1);\n \n //Vamos formando la contraseña en cada iteraccion del bucle, añadiendo a la cadena $pass la letra correspondiente a la posicion $pos en la cadena de caracteres definida.\n $pass .= substr($cadena,$pos,1);\n }\n return $pass;\n}", "static function RandomPassword($length = 10){\n\t\tsettype($length,\"integer\");\n\t\t$numeric_versus_alpha_total = 10;\n\t\t$numeric_versus_alpha_numeric = 2;\n\t\t$piece_min_length = 2;\n\t\t$piece_max_length = 3;\n\t\t$numeric_piece_min_length = 1;\n\t\t$numeric_piece_max_length = 2;\n\t\t$s1 = \"aeuyr\";\n\t\t$s2 = \"bcdfghjkmnpqrstuvwxz\";\n\t\t$password = \"\";\n\t\t$last_s1 = rand(0,1);\n\t\twhile(strlen($password)<=$length){\n\t\t\t$numeric = rand(0,$numeric_versus_alpha_total);\n\t\t\tif($numeric<=$numeric_versus_alpha_numeric){\n\t\t\t\t$numeric = 1;\n\t\t\t}else{\n\t\t\t\t$numeric = 0;\n\t\t\t}\n\t\t\tif($numeric==1){\n\t\t\t\t$piece_lenght = rand($numeric_piece_min_length,$numeric_piece_max_length);\n\t\t\t\twhile($piece_lenght>0){\n\t\t\t\t\t$password .= rand(2,9);\n\t\t\t\t\t$piece_lenght--;\n\t\t\t\t} \n\t\t\t}else{ \n\t\t\t\t$uppercase = rand(0,1);\n\t\t\t\t$piece_lenght = rand($piece_min_length,$piece_max_length);\n\t\t\t\twhile($piece_lenght>0){\n\t\t\t\t\tif($last_s1==0){\n\t\t\t\t\t\tif($uppercase==1){\n\t\t\t\t\t\t\t$password .= strtoupper($s1[rand(0,strlen($s1)-1)]);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$password .= $s1[rand(0,strlen($s1)-1)];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$last_s1 = 1;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tif($uppercase==1){\n\t\t\t\t\t\t\t$password .= strtoupper($s2[rand(0,strlen($s2)-1)]);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$password .= $s2[rand(0,strlen($s2)-1)];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$last_s1 = 0;\n\t\t\t\t\t}\n\t\t\t\t\t$piece_lenght--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(strlen($password)>$length){\n\t\t\t$password = substr($password,0,$length);\n\t\t}\n\t\treturn new self($password);\n\t}", "public function make_activation_code(){\n\t\t$alphanum = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\";\n\t\t return substr(str_shuffle($alphanum), 0, 7);\n\t}", "function generatePassword ($length = 8)\n{\n $string = implode(\"\", range(\"a\", \"z\")) . implode(\"\", range(0, 9));\n $max = strlen($string) - 1;\n $pwd = \"\";\n\n while ($length--)\n {\n $pwd .= $string[ mt_rand(0, $max) ];\n }\n\n\n return $pwd;\n}", "function generaPass($longi){\r\n\t$cadena = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890\";\r\n\t//Obtenemos la longitud de la cadena de caracteres\r\n\t$longitudCadena=strlen($cadena);\r\n\r\n\t//Se define la variable que va a contener la contraseņa\r\n\t$pass = \"\";\r\n\t$longitudPass=$longi;\r\n\r\n\t//Creamos la contraseņa\r\n\tfor($i=1 ; $i<=$longitudPass ; $i++){\r\n\t\t//Definimos numero aleatorio entre 0 y la longitud de la cadena de caracteres-1\r\n\t\t$pos=rand(0,$longitudCadena-1);\r\n\r\n\t\t$pass .= substr($cadena,$pos,1);\r\n\t}\r\n\treturn $pass;\r\n}", "function generate_password($length=8, $strength=9) {\n $vowels = 'aeuy';\n $consonants = 'bdghjmnpqrstvz';\n\n if ($strength & 1) {\n $consonants .= 'BDGHJLMNPQRSTVWXZ';\n }\n if ($strength & 2) {\n $vowels .= \"AEUY\";\n }\n if ($strength & 4) {\n $consonants .= '23456789';\n }\n if ($strength & 8) {\n $consonants .= '@#$%';\n }\n\n $password = '';\n $alt = time() % 2;\n for ($i = 0; $i < $length; $i++) {\n if ($alt == 1) {\n $password .= $consonants[(rand() % strlen($consonants))];\n $alt = 0;\n } else {\n $password .= $vowels[(rand() % strlen($vowels))];\n $alt = 1;\n }\n }\n // add a number, there has to be a number\n $password .= rand(1, 9);\n\n return $password;\n}", "public static function generateRandomPassword ()\n {\n return rand(10000, 99999);\n }", "function makeRandomPassword() {\r\n\t$salt = \"abchefghjkmnpqrstuvwxyz0123456789\";\r\n\t$pass = \"\";\r\n\tsrand((double)microtime()*1000000);\r\n \t$i = 0;\r\n \twhile ($i <= 7) {\r\n\t\t$num = rand() % 33;\r\n\t\t$tmp = substr($salt, $num, 1);\r\n\t\t$pass = $pass . $tmp;\r\n\t\t$i++;\r\n \t}\r\n \treturn $pass;\r\n}", "function cvf_td_generate_random_code($length=10) {\n\n $string = '';\n $characters = \"23456789ABCDEFHJKLMNPRTVWXYZabcdefghijklmnopqrstuvwxyz\";\n\n for ($p = 0; $p < $length; $p++) {\n $string .= $characters[mt_rand(0, strlen($characters)-1)];\n }\n\n return $string;\n\n}", "function random_string($length,$char_set) {\n\t//parameter of generate_password func\n\t$temp = '';\n\tfor($i=0; $i < $length ; $i++)\n\t{\n\t\t$temp .= random_char($char_set);\n\t}\n\treturn $temp;\n}", "function makeRandomPassword() { \n $salt = \"abchefghjkmnpqrstuvwxyz0123456789\"; \n srand((double)microtime()*1000000); \n $i = 0; \n while ($i <= 7) { \n $num = rand() % 33; \n $tmp = substr($salt, $num, 1); \n $pass = $pass . $tmp; \n $i++; \n } \n return $pass; \n}", "private function pre_defined_password(): string\r\n {\r\n $regx = \"/^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[#$@!%&*?])[A-Za-z\\d#$@!%&*?]{6,30}$/\";\r\n if (!preg_match($regx, $this->field)) {\r\n return $this->message(\"must 1 uppercase, lowercase, number & special char\");\r\n }\r\n }", "function generate_password( $length = 6 ) {\n$chars = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\";\n$password = substr( str_shuffle( $chars ), 0, $length );\nreturn $password;\n}", "function generatePassword ($length = 8){\n\n // start with a blank password\n $password = \"\";\n\n // TODO: force password change if this done.\n // define possible characters - any character in this string can be\n // picked for use in the password, so if you want to put vowels back in\n // or add special characters such as exclamation marks, this is where\n // you should do it\n $possible = \"2346789bcdfghjkmnpqrtvwxyzBCDFGHJKLMNPQRTVWXYZ\";\n\n // we refer to the length of $possible a few times, so let's grab it now\n $maxlength = strlen($possible);\n\n // check for length overflow and truncate if necessary\n if ($length > $maxlength) {\n $length = $maxlength;\n }\n\n // set up a counter for how many characters are in the password so far\n $i = 0;\n\n // add random characters to $password until $length is reached\n while ($i < $length) {\n\n // pick a random character from the possible ones\n $char = substr($possible, mt_rand(0, $maxlength-1), 1);\n\n // have we already used this character in $password?\n if (!strstr($password, $char)) {\n // no, so it's OK to add it onto the end of whatever we've already got...\n $password .= $char;\n // ... and increase the counter by one\n $i++;\n }\n }\n // done!\n return $password;\n}", "function generate_password( $length = 12, $special_chars = true, $extra_special_chars = false ) {\n\t$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\n\tif ( $special_chars )\n\t\t$chars .= '!@#$%^&*()';\n\tif ( $extra_special_chars )\n\t\t$chars .= '-_ []{}<>~`+=,.;:/?|';\n\n\t$password = '';\n\tfor ( $i = 0; $i < $length; $i++ ) {\n\t\t$password .= substr($chars, random(0, strlen($chars) - 1), 1);\n\t}\n\n\treturn $password;\n}", "public function testManySpecialCharacter ()\n {\n // Function parameters\n $length = 10;\n $minPasswordRequirements = [\n 'min' => 10,\n 'special' => 6,\n 'digit' => 1,\n 'upper' => 1,\n ];\n // Helper\n $securityHelper = new SecurityHelper(new Security()); // Empty security (it does not matter)\n // Check password correctness\n $ok = true;\n for ($i = 0; $i < self::ITERATIONS; $i++) {\n $password = $securityHelper->generatePassword($length, $minPasswordRequirements);\n $result = preg_match('/\\A(?=(.*\\d){1})(?=(?:[^A-Z]*[A-Z]){1})(?=(?:[0-9a-zA-Z]*[!#$%&*+,-.:;<=>?@_~]){6})[0-9a-zA-Z!#$%&*+,-.:;<=>?@_~]{10,}\\z/', $password);\n if ($result === 0) {\n $ok = false;\n break;\n }\n }\n $this->assertTrue($ok);\n }", "function generatePassword ($length = 8)\n {\n $password = \"\";\n\n // define possible characters - any character in this string can be\n // picked for use in the password, so if you want to put vowels back in\n // or add special characters such as exclamation marks, this is where\n // you should do it\n $possible = \"2346789bcdfghjkmnpqrtvwxyzBCDFGHJKLMNPQRTVWXYZ\";\n\n // we refer to the length of $possible a few times, so let's grab it now\n $maxlength = strlen($possible);\n \n // check for length overflow and truncate if necessary\n if ($length > $maxlength) {\n $length = $maxlength;\n }\n\t\n // set up a counter for how many characters are in the password so far\n $i = 0; \n \n // add random characters to $password until $length is reached\n while ($i < $length) { \n\n // pick a random character from the possible ones\n $char = substr($possible, mt_rand(0, $maxlength-1), 1);\n \n // have we already used this character in $password?\n if (!strstr($password, $char)) { \n // no, so it's OK to add it onto the end of whatever we've already got...\n $password .= $char;\n // ... and increase the counter by one\n $i++;\n }\n\n }\n\n // done!\n return $password;\n\n }", "function generate_password($length = 20) {\n $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' .\n '0123456789``-=~!@#$%^&*()_+,./<>?;:[]{}\\|';\n $str = '';\n $max = strlen($chars) - 1;\n for ($i = 0; $i < $length; $i++)\n $str .= $chars[mt_rand(0, $max)];\n return ltrim($str);\n }", "public function testRandomRequirements ()\n {\n // Function parameters\n $length = 8;\n $minPasswordRequirements = [\n 'min' => 10,\n 'special' => 4,\n 'digit' => 3,\n 'upper' => 2,\n 'lower' => 1\n ];\n // Helper\n $securityHelper = new SecurityHelper(new Security()); // Empty security (it does not matter)\n // Check password correctness\n $ok = true;\n for ($i = 0; $i < self::ITERATIONS; $i++) {\n $password = $securityHelper->generatePassword($length, $minPasswordRequirements);\n $result = preg_match('/\\A(?=(.*\\d){3})(?=(?:[^a-z]*[a-z]){1})(?=(?:[^A-Z]*[A-Z]){2})(?=(?:[0-9a-zA-Z]*[!#$%&*+,-.:;<=>?@_~]){4})[0-9a-zA-Z!#$%&*+,-.:;<=>?@_~]{10,}\\z/', $password);\n if ($result === 0) {\n $ok = false;\n break;\n }\n }\n $this->assertTrue($ok);\n }", "function random_chars($limit = 12, $context = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890!@#$%^&*_+-=') {\n $l = ($limit <= strlen($context) ? $limit : strlen($context));\n return substr(str_shuffle($context), 0, $l);\n}", "protected function generateRandomPassword()\n {\n $alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890+*=-_/()!?[]{}';\n $password = array();\n $alphabetLength = strlen($alphabet) - 1;\n \n for ($i = 0; $i < 10; $i++) {\n $charIndex = mt_rand(0, $alphabetLength);\n $password[] = $alphabet[$charIndex];\n }\n \n $password = implode('', $password);\n \n if (!preg_match('/\\d/', $password)) {\n $password = mt_rand(0, 9) . $password . mt_rand(0, 9);\n }\n \n return $password;\n }" ]
[ "0.78568953", "0.77681845", "0.7706031", "0.76584184", "0.7646685", "0.7636406", "0.75718534", "0.75585645", "0.7510951", "0.7465982", "0.74510753", "0.7431074", "0.73992944", "0.7389806", "0.7380706", "0.7361732", "0.73534524", "0.7347448", "0.7344949", "0.734382", "0.73406845", "0.73366475", "0.7319797", "0.73191255", "0.7316249", "0.7308375", "0.7308195", "0.7280444", "0.72666556", "0.7258954", "0.7246304", "0.72434956", "0.72420496", "0.7234811", "0.7220716", "0.7212109", "0.71998024", "0.7178647", "0.71765995", "0.7169982", "0.7165129", "0.71570677", "0.71537226", "0.7132642", "0.7118208", "0.7116696", "0.7113137", "0.7109598", "0.70876694", "0.70852745", "0.7082273", "0.70822436", "0.7079193", "0.7069933", "0.7052477", "0.70240027", "0.7015691", "0.70095485", "0.70076334", "0.70039433", "0.69964826", "0.699104", "0.69853836", "0.69786274", "0.6972326", "0.69540274", "0.69475806", "0.69402", "0.6912524", "0.69055825", "0.68941545", "0.6878213", "0.6864527", "0.6861496", "0.6861008", "0.6853902", "0.68530583", "0.68513113", "0.6844413", "0.68322086", "0.6827901", "0.6824264", "0.67964256", "0.67949796", "0.67902064", "0.67695117", "0.6759691", "0.67547697", "0.6754562", "0.6754233", "0.67535216", "0.6743698", "0.67372745", "0.6736504", "0.6726244", "0.67057955", "0.67025954", "0.6702181", "0.6700626", "0.666669" ]
0.8026063
0
/ Function: get_page_params($count) / generates the different page params
function get_page_params($count) { global $ROWS_PER_PAGE; if ($ROWS_PER_PAGE == '') $ROWS_PER_PAGE=10; $page_arr=array(); $firstpage = 1; $lastpage = intval($count / $ROWS_PER_PAGE); $page=(int)get_arg($_GET,"page"); if ( $page == "" || $page < $firstpage ) { $page = 1; } // no page no if ( $page > $lastpage ) {$page = $lastpage+1;} // page greater than last page //echo "<pre>first=$firstpage last=$lastpage current=$page</pre>"; if ($count % $ROWS_PER_PAGE != 0) { $pagecount = intval($count / $ROWS_PER_PAGE) + 1; } else { $pagecount = intval($count / $ROWS_PER_PAGE); } $startrec = $ROWS_PER_PAGE * ($page - 1); $reccount = min($ROWS_PER_PAGE * $page, $count); $currpage = ($startrec/$ROWS_PER_PAGE) + 1; if($lastpage==0) { $lastpage=null; } else { $lastpage=$lastpage+1; } if($startrec == 0) { $prevpage=null; $firstpage=null; if($count == 0) {$startrec=0;} } else { $prevpage=$currpage-1; } if($reccount < $count) { $nextpage=$currpage+1; } else { $nextpage=null; $lastpage=null; } $appstr="&page="; // Link to PREVIOUS page (and FIRST) if($prevpage == null) { $prev_href="#"; $first_href="#"; $prev_disabled="disabled"; } else { $prev_disabled=""; $prev_href=$appstr.$prevpage; $first_href=$appstr.$firstpage; } // Link to NEXT page if($nextpage == null) { $next_href = "#"; $last_href = "#"; $next_disabled="disabled"; } else { $next_disabled=""; $next_href=$appstr.$nextpage; $last_href=$appstr.$lastpage; } if ( $lastpage == null ) $lastpage=$currpage; $page_arr['page_start_row']=$startrec; $page_arr['page_row_count']=$reccount; $page_arr['page']=$page; $page_arr['no_of_pages']=$pagecount; $page_arr['curr_page']=$currpage; $page_arr['last_page']=$lastpage; $page_arr['prev_disabled']=$prev_disabled; $page_arr['next_disabled']=$next_disabled; $page_arr['first_href']=$first_href; $page_arr['prev_href']=$prev_href; $page_arr['next_href']=$next_href; $page_arr['last_href']=$last_href; //LOG_MSG('INFO',"Page Array=".print_r($page_arr,true)); return $page_arr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function populateParams() {\r\n $this->pageNum = isset($_GET['p']) ? (int)$_GET['p'] : 0;\r\n $catId = isset($_GET['c']) ? (int)$_GET['c'] : 0;\r\n \r\n if ($this->pageNum < 1) {\r\n $this->pageNum = 1;\r\n }\r\n }", "function pageInfo($caps_count, $limit = 10)\n{\n // if $_GET['page'] is not set or invalid then set page as default 1\n if(!$page = filter_input(INPUT_GET, 'page', FILTER_SANITIZE_NUMBER_INT)){\n $page = 1;\n }\n\n // calculate the amount of pages based on the limit per page\n $count = $caps_count <= $limit ? 1 : ceil($caps_count / $limit);\n\n // if set page doesnt exist then return\n if($page < 1 || $page > $count) return;\n\n // set offset for current page\n $offset = ($page * $limit) - $limit;\n\n return [\n 'nr' => $page,\n 'count' => $count,\n 'limit' => $limit,\n 'offset' => $offset\n ];\n}", "protected function populateParams() {\r\n $this->pageNum = isset($_GET['p']) ? (int)$_GET['p'] : 0;\r\n $this->status = isset($_GET['status']) ? (int)$_GET['status'] : 0;\r\n if ($this->pageNum < 1) {\r\n $this->pageNum = 1;\r\n }\r\n }", "private function build_params() {\n\n\t\t\t$this->per_page = $this->request->get_param( 'per_page' ) ? $this->request->get_param( 'per_page' ) : (int) get_option( 'posts_per_page' );\n\t\t\t$this->page = $this->request->get_param( 'page' ) ? $this->request->get_param( 'page' ) : 1;\n\t\t}", "function getPagingParameters()\n {\n }", "function paginator($params, $count) {\n $limit = $params->getLimit();\n if ($count > $limit && $count!=0){\n $page = $params->getPage(); \n $controllerName = strtolower(Zend_Controller_Front::getInstance()->getRequest()->getControllerName()); \n $pagination = ($page != 1)?'<span><a href=\"\"onclick=\"Grid.page('.($page-1).'); return false\"><<</a></span>':''; \n if ($page > 10){ \n $pagination .= '<a href=\"\" onclick=\"Grid.page(1); return false;\">1</a>';\n $pagination .= '<span>...</span>';\n }\n $pageSpliter = ($page - 5 >= 1 ? $page - 4 : 1);\n for ($i = $pageSpliter; ($count + $limit) / ($i*$limit) > 1 && $i < $pageSpliter + 10; $i++) {\n $pagination .= '<a href=\"\" onclick=\"Grid.page('.$i.'); return false;\" class=\"'. ($page == $i ? \"active\":\"\") .'\">'.$i.'</a>';\n } \n $lastPage = floor(($count + $limit -1) / $limit);\n if ($page < $lastPage - 10){\n $pagination .= '<span>...</span>'; \n $pagination .= '<a href=\"\" onclick=\"Grid.page('. $lastPage .'); return false;\">'.$lastPage .'</a>';\n }\n $pagination .= ($page < ($count/$limit))?'<span><a href=\"\"onclick=\"Grid.page('.($page+1).'); return false\">>></a></span>':''; \n echo '<div class=\"pagination\">'; \n echo $pagination; \n echo '</div>';\n } \n }", "function getEventsPagination($count, $args) {\n\t \t$wp_args = array();\n\n\t \t$wp_args['base'] = preg_replace( '/(\\?.*)?$/', '', $_SERVER[\"REQUEST_URI\"] ).'%_%';\n\t \t$wp_args['format'] = '?wpcal-page=%#%';\n\n\t \t// Preserver other GET values\n\t \tforeach($_GET as $k => $v) {\n\t \t\tif (strtolower($k) != 'wpcal-page') {\n\t \t\t\tif (isset($wp_args['add_args']))\n\t \t\t\t$wp_args['add_args'] = array();\n\t \t\t\t$wp_args['add_args'][$k] = $v;\n\t \t\t}\n\t \t}\n\n\t \t$epp = 0;\n\t \tif (isset($args['number'])) {\n\t \t\t$epp = intval($args['number']);\n\t \t}\n\t \tif (empty($epp)) {\n\t \t\t$epp = intval(get_option('fse_number'));\n\t \t}\n\n\t \tif (isset($args['pagination_prev_text'])) {\n\t \t\t$wp_args['prev_text'] = $args['pagination_prev_text'];\n\t \t} else {\n\t \t\t$wp_args['prev_text'] = get_option('fse_pagination_prev_text');\n\t \t}\n\n\t \tif (isset($args['pagination_next_text'])) {\n\t \t\t$wp_args['next_text'] = $args['pagination_next_text'];\n\t \t} else {\n\t \t\t$wp_args['next_text'] = get_option('fse_pagination_next_text');\n\t \t}\n\n\t \tif (isset($args['pagination_end_size'])) {\n\t \t\t$wp_args['end_size'] = $args['pagination_end_size'];\n\t \t} else {\n\t \t\t$wp_args['end_size'] = get_option('fse_pagination_end_size');\n\t \t}\n\n\t \tif (isset($args['pagination_mid_size'])) {\n\t \t\t$wp_args['mid_size'] = $args['pagination_mid_size'];\n\t \t} else {\n\t \t\t$wp_args['mid_size'] = get_option('fse_pagination_mid_size');\n\t \t}\n\n\t \tif (isset($args['pagination_use_dots'])) {\n\t \t\t$wp_args['show_all'] = ($args['pagination_use_dots'] == true ? false : true);\n\t \t} else {\n\t \t\t$wp_args['show_all'] = get_option('fse_pagination_usedots') == true ? false : true;\n\t \t}\n\n\t \t$wp_args['prev_next'] = (!empty($wp_args['prev_text']) || !empty($wp_args['next_text']));\n\n\t \t// Calculate number of pages\n\t \t$wp_args['total'] = ceil($count / $epp);\n\n\t \tif ($args['page'] < 1)\n\t \t$wp_args['current'] = 1;\n\t \telseif ($args['page'] > $wp_args['total'])\n\t \t$wp_args['current'] = $wp_args['total'];\n\t \telse\n\t \t$wp_args['current'] = $args['page'];\n\n\t \treturn paginate_links($wp_args);\n\t }", "function getlist($pagecount,$page)\n{\n\t$echo = \"<select size=1 class='page_select' name=page onchange=javascript:location.href='\".getparam(\"page\",\"\").\"'+this.options[this.selectedIndex].value>\";\n\tfor($i=1;$i<=$pagecount;$i++)\n\t{\n\t\t$result = $pagecount/15;\n\t\tif($i>=$page-20 && $i<=$page+15){// ||\n\t\t\t$echo .= \"<option value=$i\".($page==$i ? ' selected' : '').\">\".$i.\"</option>\";\n\t\t}elseif($i%$result ==0 || $i==1 || $i==$pagecount){\n\t\t\t$echo .= \"<option value=$i>\".$i.\"</option>\";\n\t\t}\n\t}\n\t$echo.= \"</select>\";\n\treturn $echo;\n}", "abstract protected function createPages($count = 10): array;", "function pagination($title, $start, $start_name, $max, $max_name, $max_rows, $keep_post = false, $max_page_links = 5, $_selectors = null, $hash = '')\n{\n inform_non_canonical_parameter($max_name);\n inform_non_canonical_parameter($start_name);\n\n if (get_page_name() == 'members') {\n // Don't allow guest bots to probe too deep into the forum index, it gets very slow; the XML Sitemap is for guiding to topics like this\n if (($start > $max * 5) && (is_guest()) && (!is_null(get_bot_type()))) {\n access_denied('NOT_AS_GUEST');\n }\n }\n\n $post_array = array();\n if ($keep_post) {\n foreach ($_POST as $key => $val) {\n if (is_array($val)) {\n continue;\n }\n if (get_magic_quotes_gpc()) {\n $val = stripslashes($val);\n }\n $post_array[$key] = $val;\n }\n }\n\n $get_url = get_self_url(true);\n\n // How many to show per page\n if (is_null($_selectors)) {\n $_selectors = array(10, 25, 50, 80);\n }\n if (has_privilege(get_member(), 'remove_page_split')) {\n if (get_param_integer('keep_avoid_memory_limit', 0) == 1) {\n $_selectors[] = $max_rows;\n }\n }\n $_selectors[] = $max;\n sort($_selectors);\n $_selectors = array_unique($_selectors);\n $selectors = new Tempcode();\n foreach ($_selectors as $selector_value) {\n if ($selector_value > $max_rows) {\n $selector_value = $max_rows;\n }\n $selected = ($max == $selector_value);\n $selectors->attach(do_template('PAGINATION_PER_PAGE_OPTION', array('_GUID' => '1a0583bab42257c60289459ce1ac1e05', 'SELECTED' => $selected, 'VALUE' => strval($selector_value), 'NAME' => integer_format($selector_value))));\n\n if ($selector_value == $max_rows) {\n break;\n }\n }\n $hidden = build_keep_form_fields('_SELF', true, array($max_name, $start_name));\n $per_page = do_template('PAGINATION_PER_PAGE', array('_GUID' => '1993243727e58347d1544279c5eba496', 'HASH' => ($hash == '') ? null : $hash, 'HIDDEN' => $hidden, 'URL' => $get_url, 'MAX_NAME' => $max_name, 'SELECTORS' => $selectors));\n $GLOBALS['INCREMENTAL_ID_GENERATOR']++;\n\n if ($max < $max_rows) { // If they don't all fit on one page\n $parts = new Tempcode();\n $num_pages = ($max == 0) ? 1 : intval(ceil(floatval($max_rows) / floatval($max)));\n\n // Link to first\n if ($start > 0) {\n $url_array = array('page' => '_SELF', $start_name => running_script('index') ? null : 0);\n $cat_url = _build_pagination_cat_url($url_array, $post_array, $hash);\n $first = do_template('PAGINATION_CONTINUE_FIRST', array('_GUID' => 'f5e510da318af9b37c3a4b23face5ae3', 'TITLE' => $title, 'P' => strval(1), 'FIRST_URL' => $cat_url));\n } else {\n $first = new Tempcode();\n }\n\n // Link to previous\n if ($start > 0) {\n $url_array = array('page' => '_SELF', $start_name => strval(max($start - $max, 0)));\n $cat_url = _build_pagination_cat_url($url_array, $post_array, $hash);\n $previous = do_template('PAGINATION_PREVIOUS_LINK', array('_GUID' => 'ec4d4da9677b5b9c8cea08676337c6eb', 'TITLE' => $title, 'P' => integer_format(intval($start / $max)), 'URL' => $cat_url));\n } else {\n $previous = do_template('PAGINATION_PREVIOUS');\n }\n\n // CALCULATIONS FOR CROPPING OF SEQUENCE\n // $from is the index number (one less than written page number) we start showing page-links from\n // $to is the index number (one less than written page number) we stop showing page-links from\n if ($max != 0) {\n $max_dispersal = $max_page_links / 2;\n $from = max(0, intval(floatval($start) / floatval($max) - $max_dispersal));\n $to = intval(ceil(min(floatval($max_rows) / floatval($max), floatval($start) / floatval($max) + $max_dispersal)));\n $dif = (floatval($start) / floatval($max) - $max_dispersal);\n if ($dif < 0.0) { // We have more forward range than max dispersal as we're near the start\n $to = intval(ceil(min(floatval($max_rows) / floatval($max), floatval($start) / floatval($max) + $max_dispersal - $dif)));\n }\n } else {\n $from = 0;\n $to = 0;\n }\n\n // Indicate that the sequence is incomplete with an ellipsis\n if ($from > 0) {\n $continues_left = do_template('PAGINATION_CONTINUE');\n } else {\n $continues_left = new Tempcode();\n }\n\n $bot = (is_guest()) && (!is_null(get_bot_type()));\n\n // Show the page number jump links\n for ($x = $from; $x < $to; $x++) {\n $url_array = array('page' => '_SELF', $start_name => ($x == 0) ? null : strval($x * $max));\n $cat_url = _build_pagination_cat_url($url_array, $post_array, $hash);\n if ($x * $max == $start) {\n $parts->attach(do_template('PAGINATION_PAGE_NUMBER', array('_GUID' => '13cdaf548d5486fb8d8ae0d23b6a08ec', 'P' => strval($x + 1))));\n } else {\n $rel = null;\n if ($x == 0) {\n $rel = 'first';\n }\n $parts->attach(do_template('PAGINATION_PAGE_NUMBER_LINK', array('_GUID' => 'a6d1a0ba93e3b7deb6fe6f8f1c117c0f', 'NOFOLLOW' => ($x * $max > $max * 5) && ($bot), 'REL' => $rel, 'TITLE' => $title, 'URL' => $cat_url, 'P' => strval($x + 1))));\n }\n }\n\n // Indicate that the sequence is incomplete with an ellipsis\n if ($to < $num_pages) {\n $continues_right = do_template('PAGINATION_CONTINUE');\n } else {\n $continues_right = new Tempcode();\n }\n\n // Link to next\n if (($start + $max) < $max_rows) {\n $url_array = array('page' => '_SELF', $start_name => strval($start + $max));\n $cat_url = _build_pagination_cat_url($url_array, $post_array, $hash);\n $p = ($max == 0) ? 1.0 : ($start / $max + 2);\n $rel = null;\n if (($start + $max * 2) > $max_rows) {\n $rel = 'last';\n }\n $next = do_template('PAGINATION_NEXT_LINK', array('_GUID' => '6da9b396bdd46b7ee18c05b5a7eb4d10', 'NOFOLLOW' => ($start + $max > $max * 5) && ($bot), 'REL' => $rel, 'TITLE' => $title, 'NUM_PAGES' => integer_format($num_pages), 'P' => integer_format(intval($p)), 'URL' => $cat_url));\n } else {\n $next = do_template('PAGINATION_NEXT');\n }\n\n // Link to last\n if ($start + $max < $max_rows) {\n $url_array = array('page' => '_SELF', ($num_pages - 1 == 0) ? null : $start_name => strval(($num_pages - 1) * $max));\n $cat_url = _build_pagination_cat_url($url_array, $post_array, $hash);\n $last = do_template('PAGINATION_CONTINUE_LAST', array('_GUID' => '2934936df4ba90989e949a8ebe905522', 'TITLE' => $title, 'P' => strval($num_pages), 'LAST_URL' => $cat_url));\n } else {\n $last = new Tempcode();\n }\n\n // Page jump dropdown, if we had to crop\n if ($num_pages > $max_page_links) {\n $list = new Tempcode();\n $pg_start = 0;\n $pg_to = $num_pages;\n $pg_at = intval(floatval($start) / floatval($max));\n if ($pg_to > 100) {\n $pg_start = max($pg_at - 50, 0);\n $pg_to = $pg_start + 100;\n }\n if ($pg_start != 0) {\n $list->attach(form_input_list_entry('', false, '...', false, true));\n }\n for ($i = $pg_start; $i < $pg_to; $i++) {\n $list->attach(form_input_list_entry(strval($i * $max), ($i * $max == $start), strval($i + 1)));\n }\n if ($pg_to != $num_pages) {\n $list->attach(form_input_list_entry('', false, '...', false, true));\n }\n $dont_auto_keep = array();\n $hidden = build_keep_form_fields('_SELF', true, $dont_auto_keep);\n $pages_list = do_template('PAGINATION_LIST_PAGES', array('_GUID' => '9e1b394763619433f23b8ed95f5ac134', 'URL' => $get_url, 'HIDDEN' => $hidden, 'START_NAME' => $start_name, 'LIST' => $list));\n } else {\n $pages_list = new Tempcode();\n }\n\n // Put it all together\n return do_template('PAGINATION_WRAP', array(\n '_GUID' => '2c3fc957d4d8ab9103ef26458e18aed1',\n 'TEXT_ID' => $title,\n 'PER_PAGE' => $per_page,\n 'FIRST' => $first,\n 'PREVIOUS' => $previous,\n 'CONTINUES_LEFT' => $continues_left,\n 'PARTS' => $parts,\n 'CONTINUES_RIGHT' => $continues_right,\n 'NEXT' => $next,\n 'LAST' => $last,\n 'PAGES_LIST' => $pages_list,\n\n 'START' => strval($start),\n 'MAX' => strval($max),\n 'MAX_ROWS' => strval($max_rows),\n 'NUM_PAGES' => strval($num_pages),\n ));\n }\n\n if (get_value('pagination_when_not_needed') === '1') {\n return do_template('PAGINATION_WRAP', array('_GUID' => '451167645e67c7beabcafe11c78680db', 'TEXT_ID' => $title,\n 'PER_PAGE' => $per_page,\n 'FIRST' => '',\n 'PREVIOUS' => '',\n 'CONTINUES_LEFT' => '',\n 'PARTS' => '',\n 'CONTINUES_RIGHT' => '',\n 'NEXT' => '',\n 'LAST' => '',\n 'PAGES_LIST' => '',\n\n 'START' => strval($start),\n 'MAX' => strval($max),\n 'MAX_ROWS' => strval($max_rows),\n 'NUM_PAGES' => strval(1),\n ));\n }\n\n return new Tempcode();\n}", "protected function buildPagination() {}", "protected function buildPagination() {}", "private function getParamsFromRequest() {\n if (isset($_GET['page'])) {\n $this->currentpage = $_GET['page'];\n } else {\n //else set default page to render\n $this->currentpage = 1;\n }\n //If limit is defined in URL\n if (isset($_GET['limit'])) {\n $this->limit = $_GET['limit'];\n } else { //else set default limit to 20\n $this->limit = 10;\n }\n //If currentpage is set to null or is set to 0 or less\n //set it to default (1)\n if (($this->currentpage == null) || ($this->currentpage < 1)) {\n $this->currentpage = 1;\n }\n //if limit is set to null set it to default (10)\n if (($this->limit == null)) {\n $this->limit = 10;\n //if limit is any number less than 1 then set it to 0 for displaying\n //items without limit\n } else if ($this->limit < 1) {\n $this->limit = 0;\n }\n }", "public function page($pagination_link, $values,$other_url){\n $total_values = count($values);\n $pageno = (int)(isset($_GET[$pagination_link])) ? $_GET[$pagination_link] : $pageno = 1;\n $counts = ceil($total_values/$this->limit);\n $param1 = ($pageno - 1) * $this->limit;\n $this->data = array_slice($values, $param1,$this->limit); \n \n \n if ($pageno > $this->total_pages) {\n $pageno = $this->total_pages;\n } elseif ($pageno < 1) {\n $pageno = 1;\n }\n if ($pageno > 1) {\n $prevpage = $pageno -1;\n $this->firstBack = array($this->functions->base_url_without_other_route().\"/$other_url/1\", \n $this->functions->base_url_without_other_route().\"/$other_url/$prevpage\");\n // $this->functions->base_url_without_other_route()./1\n // $this->firstBack = \"<div class='first-back'><a href='blog/\".basename($_SERVER['PHP_SELF'], '.php').\"/1'>\n // <i class='fa fa-arrow-circle-o-left' aria-hidden='true'></i>&nbsp;First\n // </a> \n // <a href='blog/\".basename($_SERVER['PHP_SELF'], '.php').\"/$prevpage'>\n // <i class='fa fa-arrow-circle-o-left' aria-hidden='true'></i>&nbsp;\n // prev\n // </a></div>\";\n }\n\n // $this->where = \"<div class='page-count'>(Page $pageno of $this->total_pages)</div>\";\n $this->where = \"page $pageno of $this->total_pages\";\n if ($pageno < $this->total_pages) {\n $nextpage = $pageno + 1;\n $this->nextLast = array($this->functions->base_url_without_other_route().\"/$other_url/$nextpage\",\n $this->functions->base_url_without_other_route().\"/$other_url/$this->total_pages\");\n // $this->nextLast = \"blog/\".basename($_SERVER['PHP_SELF'], '.php').\"/$nextpage'>Next&nbsp;\n // <i class='fa fa-arrow-circle-o-right' aria-hidden='true'></i></a> \n // <a href='blog/\".basename($_SERVER['PHP_SELF'], '.php').\"/$this->total_pages'>Last&nbsp;\n // <i class='fa fa-arrow-circle-o-right' aria-hidden='true'></i>\n // </a></div>\";\n }\n\n return $pageno;\n }", "function paginationNames($page = 1, $page_count)\n{\n if($page < 3){\n return [\n 'first' => 1,\n 'second' => 2,\n 'third' => 3\n ];\n }elseif($page == $page_count){\n return [\n 'first' => ($page_count - 2),\n 'second' => ($page_count - 1),\n 'third' => $page_count\n ];\n }else{\n return [\n 'first' => ($page - 1),\n 'second' => $page,\n 'third' => ($page + 1)\n ];\n }\n}", "abstract public function preparePagination();", "function paginationLinks($page = 1, $page_count, $query = \"\")\n{\n // base page url\n $url = \"collection\";\n\n // first page link, which doesn't have a page data in url (no page=1)\n $first_page = $url . $query;\n\n // checking if other variables exist in query and adding needed characters\n $query .= (strpos($query, \"=\") !== FALSE) ? \"&\" : \"?\";\n $query .= \"page=\";\n\n // last page is always a max = page_count\n $last_page = $url . $query . $page_count;\n\n // pages before and after current page\n $previous = $url . $query . ($page-1);\n $next = $url . $query . ($page+1);\n\n // setting the three buttons values, middle one is current\n $first = $previous;\n $second = $url . $query . $page;\n $third = $next;\n\n // changing page links in special circumstances\n if($page == 1){\n $first = $first_page;\n $second = $next;\n $third = $url . $query . ($page+2);\n }elseif($page == 2){\n $first = $first_page;\n $previous = $first_page;\n }elseif($page == $page_count){\n $first = $url . $query . ($page_count-2);\n $second = $url . $query . ($page_count-1);\n $third = $last_page;\n }\n\n return [\n 'first_page' => $first_page,\n 'last_page' => $last_page,\n 'previous' => $previous,\n 'next' => $next, \n 'first' => $first,\n 'second' => $second,\n 'third' => $third\n ];\n}", "function GetPagination($page, $perpage, $count) {\n $result = [];\n $result['page'] = $page > 0 ? $page - 1 : 0;\n $result['total'] = $count > $perpage ? $perpage : $count;\n $result['start'] = $result['page'] * $perpage;\n $last = $result['total'] + $result['start'];\n $result['last'] = $last > $count ? $count : $last;\n return $result;\n}", "function getPaging($refUrl, $aryOpts, $pgCnt, $curPg) {\n $return = '';\n $return.='<div class=\"box-bottom\"><div class=\"paginate\">';\n if ($curPg > 1) {\n $aryOpts['pg'] = 1;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\">First</a>';\n\n $aryOpts['pg'] = $curPg - 1;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\">Prev</a>';\n }\n for ($i = 1; $i <= $pgCnt; $i++) {\n $aryOpts['pg'] = $i;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\" class=\"';\n if ($curPg == $i)\n $return.='active';\n $return.='\" >' . $i . '</a>';\n }\n if ($curPg < $pgCnt) {\n $aryOpts['pg'] = $curPg + 1;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\">Next</a>';\n $aryOpts['pg'] = $pgCnt;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\">Last</a>';\n }\n $return.='<div class=\"clearfix\"></div></div></div>';\n return $return;\n}", "function paging($condtion='1')\r\n {\r\n /*\r\n $url = '';\r\n \t if(isset($_GET[\"brand\"])){\r\n \t \t$value = trim($_GET['brand']);\r\n \t \tif($value != \"\"){\r\n\t \t \t$condtion = sprintf(\"brand='%s'\",$value);\r\n\t \t \t$url = '&brand='.$value;\r\n \t \t}\r\n \t }\r\n \t \r\n \t if(isset($_GET[\"module\"])){\r\n \t \t$value = trim($_GET['module']);\r\n \t \tif($value != \"\"){\r\n\t \t \t$module = sprintf(\"series='%s'\",$value);\r\n\t \t \t$condtion = $condtion.' and '.$module;\r\n\t \t \t$url = $url.'&module='.$value;\r\n \t \t}\r\n \t }\r\n \t \r\n \t if(isset($_GET[\"part\"])){\r\n \t \t$value = trim($_GET['part']);\r\n \t \tif($value != \"\"){ \t \t\r\n\t \t \t$part = sprintf(\"module='%s'\",$value);\r\n\t \t \t$condtion = $condtion.' and '.$part;\r\n\t \t \t$url = $url.'&part='.$value;\r\n \t \t}\r\n \t }\r\n \t \r\n \t if(isset($_GET[\"key\"])){\r\n \t \t$value = trim($_GET[\"key\"]);\r\n \t \tif($value != \"\"){\r\n\t \t \t$condtion = $this->key_query($value,$url);\r\n\t \t \techo \"++++++++++\".$condtion;\r\n\t \t \t//$url = $url.'&part='.$value; \t \t\r\n \t \t}\r\n \t }\r\n \t */\r\n // get current page index\r\n $page = 1;\r\n \t if(isset($_GET[\"page\"])){\r\n \t \t$page = $_GET['page'];\r\n \t }\r\n \t \r\n \t // set paging parameters\r\n $number = 6; \r\n $total = $this->total;\r\n $url = $this->pget;\r\n $condtion = $this->cond;\r\n //$total = $this->getTotal($condtion);\r\n \r\n $url = '?page={page}'.$url; \r\n $pager = new Paging($total,$number,$page,$url);\r\n \t \r\n \t // get publish records\r\n\t $db = GLOBALDB();\r\n $sql = \"SELECT * FROM publish WHERE \".$condtion.\" order by id desc LIMIT \".$pager->limit.\",\".$pager->size;\r\n $result = $db->query($sql); \r\n $this->display($result);\r\n \r\n // show paging bar\r\n //echo $sql;\r\n\t $pager->show();\r\n }", "function getPage($params) {\r\n if (isset($params['named']['page'])) {\r\n return is_array($params['named']['page']) ? $params['named']['page'][0] : $params['named']['page']; //Ensure we only send one result\r\n }\r\n return 1;\r\n }", "function HTMLPage ($params) {\n if (!isset($params['total-count'])) {\n return '';\n }\n\n //REQUEST_URIを解析\n $uris = @explode(\"?\", $_SERVER['REQUEST_URI']);\n $base_url = $uris[0];\n $query_params = array();\n if (count($uris)>1) {\n $querys = @explode(\"&\", $uris[1]);\n $query_params = array();\n foreach ($querys as $query) {\n $tmp_params = @explode(\"=\", $query);\n $query_params[$tmp_params[0]] = $tmp_params[1];\n }\n }\n $now_page = 1;\n if (isset($query_params['pager_id'])) {\n $now_page = $query_params['pager_id'];\n }\n unset($query_params['pager_id']);\n\n //POSTデータから条件を設定する「s_」を対象とする仕様。\n foreach ($_POST as $key=>$val) {\n if (substr($key, 0 ,2)=='s_') {\n if (is_array($val)) {\n $i=0;\n foreach ($val as $k=>$v) {\n if (is_null($k)) {\n $k = $i++;\n }\n $str = $key.\"[\".$k.\"]\";\n $query_params[$str] = htmlentities($v);\n }\n }\n else {\n $query_params[$key] = htmlentities($val);\n }\n }\n }\n\n //再構成\n $base_url = site_url($base_url);\n if (count($query_params)>0) {\n $querys = array();\n foreach ($query_params as $key=>$val) {\n $querys[] = $key . '=' . $val;\n }\n $base_url = $base_url . \"?\" . @implode('&', $querys);\n }\n\n //全ページ数を算出\n $total_page = ceil($params['total-count'] / SC_PAGE_COUNT);\n $total_pages = array();\n for ($i=1; $i<=$total_page; $i++) {\n $total_pages[$i] = $i;\n }\n //現在ページから最大5つページ番号を表示するための制御\n $page_data = array();\n for ($i=($now_page-5); $i<=($now_page+5); $i++) {\n if (isset($total_pages[$i])) {\n $page_data[$i] = $base_url . '?pager_id=' . $i;\n if (count($query_params)>0) {\n $page_data[$i] = $base_url . '&pager_id=' . $i;\n }\n }\n }\n\n //固定部生成\n $next_page = $now_page + 1;\n if ($next_page > $total_page) {\n $next_page = $total_page;\n }\n $prev_page = $now_page - 1;\n if ($prev_page < 1) {\n $prev_page = 1;\n }\n $link1 = $base_url . '?pager_id=1';\n if (count($query_params)>0) {\n $link1 = $base_url . '&pager_id=1';\n }\n $link2 = $base_url . '?pager_id=' . $prev_page;\n if (count($query_params)>0) {\n $link2 = $base_url . '&pager_id=' . $prev_page;\n }\n $link3 = $base_url . '?pager_id=' . $next_page;\n if (count($query_params)>0) {\n $link3 = $base_url . '&pager_id=' . $next_page;\n }\n $link4 = $base_url . '?pager_id=' . $total_page;\n if (count($query_params)>0) {\n $link4 = $base_url . '&pager_id=' . $total_page;\n }\n\n $page_html = array();\n if ($total_page > 0) {\n $page_html[] = SimpleCartFunctions::HTMLLink(array('href'=>$link1, 'value'=>__(SCLNG_PAGER_FIRST, SC_DOMAIN)));\n $page_html[] = SimpleCartFunctions::HTMLLink(array('href'=>$link2, 'value'=>__(SCLNG_PAGER_PREV, SC_DOMAIN)));\n foreach ($page_data as $key=>$data) {\n if ($key == $now_page) {\n $page_html[] = $key;\n }\n else {\n $page_html[] = SimpleCartFunctions::HTMLLink(array('href'=>$data, 'value'=>$key));\n }\n }\n $page_html[] = SimpleCartFunctions::HTMLLink(array('href'=>$link3, 'value'=>__(SCLNG_PAGER_NEXT, SC_DOMAIN)));\n $page_html[] = SimpleCartFunctions::HTMLLink(array('href'=>$link4, 'value'=>__(SCLNG_PAGER_LAST, SC_DOMAIN)));\n }\n $page_html[] = __(SCLNG_PAGER_TOTAL, SC_DOMAIN);\n $page_html[] = \":\";\n $page_html[] = $params['total-count'];\n return @implode(' ', $page_html);\n }", "function getPagingSup($refUrl, $aryOpts, $pgCnt, $curPg) {\n if (in_array('[__atuvc]', $aryOpts)) {\n unset($aryOpts[array_search('[__atuvc]')]);\n array_values($aryOpts);\n }\n $return = '';\n if ($curPg > 1) {\n $aryOpts['pg'] = 1;\n //$return.='<li class=\"pre\"><a href=\"'.$refUrl.getQueryString($aryOpts).'\">First</a></li>';\n\n $aryOpts['pg'] = $curPg - 1;\n $return.='<li ><a href=\"' . $refUrl . getQueryString($aryOpts) . '\" class=\"pre\">Previous</a></li>';\n }\n for ($i = 1; $i <= $pgCnt; $i++) {\n $aryOpts['pg'] = $i;\n if ($pgCnt == $i && $curPg >= $pgCnt)\n $class.=' bordernone';\n $return.='<li class=\"' . $class . '\"><a href=\"' . $refUrl . getQueryString($aryOpts) . '\" class=\"';\n if ($curPg == $i)\n $return.=' active';\n $return.='\" >' . $i . '</a></li>';\n }\n if ($curPg < $pgCnt) {\n $aryOpts['pg'] = $curPg + 1;\n $return.='<li class=\"last\"><a href=\"' . $refUrl . getQueryString($aryOpts) . '\" class=\"nextal\">Next</a></li>';\n $aryOpts['pg'] = $pgCnt;\n //$return.='<li class=\"last\"><a href=\"'.$refUrl.getQueryString($aryOpts).'\" class=\"nextal\">Last</a></li>';\n }\n return $return;\n}", "function Pagination() \n { \n $this->current_page = 1; \n $this->mid_range = 7; \n $this->items_per_page = (!empty($_GET['ipp'])) ? $_GET['ipp']:$this->default_ipp; \n }", "function get_params_array()\n {\n $values = array(\n 'paged' => (isset($_GET['paged'])?$_GET['paged']:(isset($_POST['paged'])?$_POST['paged']:1)),\n 'l' => (isset($_GET['l'])?$_GET['l']:(isset($_POST['l'])?$_POST['l']:'all')),\n 'group' => (isset($_GET['group'])?$_GET['group']:(isset($_POST['group'])?$_POST['group']:'')),\n 'ip' => (isset($_GET['ip'])?$_GET['ip']:(isset($_POST['ip'])?$_POST['ip']:'')),\n 'vuid' => (isset($_GET['vuid'])?$_GET['vuid']:(isset($_POST['vuid'])?$_POST['vuid']:'')),\n 'sdate' => (isset($_GET['sdate'])?$_GET['sdate']:(isset($_POST['sdate'])?$_POST['sdate']:'')),\n 'edate' => (isset($_GET['edate'])?$_GET['edate']:(isset($_POST['edate'])?$_POST['edate']:'')),\n 'type' => (isset($_GET['type'])?$_GET['type']:(isset($_POST['type'])?$_POST['type']:'all')),\n 'search' => (isset($_GET['search'])?$_GET['search']:(isset($_POST['search'])?$_POST['search']:'')),\n 'sort' => (isset($_GET['sort'])?$_GET['sort']:(isset($_POST['sort'])?$_POST['sort']:'')),\n 'sdir' => (isset($_GET['sdir'])?$_GET['sdir']:(isset($_POST['sdir'])?$_POST['sdir']:''))\n );\n\n return $values;\n }", "function findPages($count, $limit) // count diisi 50 dan limit diisi 10\n { \n $pages = (($count % $limit) == 0) ? $count / $limit : floor($count / $limit) + 1; // maka $pages= 5\n\n return $pages; \n }", "function buildNavigation($pageNum_Recordset1,$totalPages_Recordset1,$prev_Recordset1,$next_Recordset1,$separator=\" | \",$max_links=10, $show_page=true)\n{\n GLOBAL $maxRows_rs_forn,$totalRows_rs_forn;\n\t$pagesArray = \"\"; $firstArray = \"\"; $lastArray = \"\";\n\tif($max_links<2)$max_links=2;\n\tif($pageNum_Recordset1<=$totalPages_Recordset1 && $pageNum_Recordset1>=0)\n\t{\n\t\tif ($pageNum_Recordset1 > ceil($max_links/2))\n\t\t{\n\t\t\t$fgp = $pageNum_Recordset1 - ceil($max_links/2) > 0 ? $pageNum_Recordset1 - ceil($max_links/2) : 1;\n\t\t\t$egp = $pageNum_Recordset1 + ceil($max_links/2);\n\t\t\tif ($egp >= $totalPages_Recordset1)\n\t\t\t{\n\t\t\t\t$egp = $totalPages_Recordset1+1;\n\t\t\t\t$fgp = $totalPages_Recordset1 - ($max_links-1) > 0 ? $totalPages_Recordset1 - ($max_links-1) : 1;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$fgp = 0;\n\t\t\t$egp = $totalPages_Recordset1 >= $max_links ? $max_links : $totalPages_Recordset1+1;\n\t\t}\n\t\tif($totalPages_Recordset1 >= 1) {\n\t\t\t#\t------------------------\n\t\t\t#\tSearching for $_GET vars\n\t\t\t#\t------------------------\n\t\t\t$_get_vars = '';\t\t\t\n\t\t\tif(!empty($_GET) || !empty($HTTP_GET_VARS)){\n\t\t\t\t$_GET = empty($_GET) ? $HTTP_GET_VARS : $_GET;\n\t\t\t\tforeach ($_GET as $_get_name => $_get_value) {\n\t\t\t\t\tif ($_get_name != \"pageNum_rs_forn\") {\n\t\t\t\t\t\t$_get_vars .= \"&$_get_name=$_get_value\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$successivo = $pageNum_Recordset1+1;\n\t\t\t$precedente = $pageNum_Recordset1-1;\n\t\t\t$firstArray = ($pageNum_Recordset1 > 0) ? \"<a href=\\\"$_SERVER[PHP_SELF]?pageNum_rs_forn=$precedente$_get_vars\\\">$prev_Recordset1</a>\" : \"$prev_Recordset1\";\n\t\t\t# ----------------------\n\t\t\t# page numbers\n\t\t\t# ----------------------\n\t\t\tfor($a = $fgp+1; $a <= $egp; $a++){\n\t\t\t\t$theNext = $a-1;\n\t\t\t\tif($show_page)\n\t\t\t\t{\n\t\t\t\t\t$textLink = $a;\n\t\t\t\t} else {\n\t\t\t\t\t$min_l = (($a-1)*$maxRows_rs_forn) + 1;\n\t\t\t\t\t$max_l = ($a*$maxRows_rs_forn >= $totalRows_rs_forn) ? $totalRows_rs_forn : ($a*$maxRows_rs_forn);\n\t\t\t\t\t$textLink = \"$min_l - $max_l\";\n\t\t\t\t}\n\t\t\t\t$_ss_k = floor($theNext/26);\n\t\t\t\tif ($theNext != $pageNum_Recordset1)\n\t\t\t\t{\n\t\t\t\t\t$pagesArray .= \"<a href=\\\"$_SERVER[PHP_SELF]?pageNum_rs_forn=$theNext$_get_vars\\\">\";\n\t\t\t\t\t$pagesArray .= \"$textLink</a>\" . ($theNext < $egp-1 ? $separator : \"\");\n\t\t\t\t} else {\n\t\t\t\t\t$pagesArray .= \"$textLink\" . ($theNext < $egp-1 ? $separator : \"\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t$theNext = $pageNum_Recordset1+1;\n\t\t\t$offset_end = $totalPages_Recordset1;\n\t\t\t$lastArray = ($pageNum_Recordset1 < $totalPages_Recordset1) ? \"<a href=\\\"$_SERVER[PHP_SELF]?pageNum_rs_forn=$successivo$_get_vars\\\">$next_Recordset1</a>\" : \"$next_Recordset1\";\n\t\t}\n\t}\n\treturn array($firstArray,$pagesArray,$lastArray);\n}", "public function get_pages($total,$current,$nb_per_page,$rub,$array_submitted=array())\n {\n $str_return = '';\n $arr_return = '';\n \n $get = '';\n \n foreach($array_submitted as $keysubmitted => $valuesubmitted)\n {\n if(!empty($valuesubmitted))\n {\n $get .= strtolower('&'.$keysubmitted.'='.$valuesubmitted);\n }\n }\n \n if($total>$nb_per_page)\n {\n $nbpage = ceil($total/$nb_per_page);\n\n if($current>1)\n {\n $prec = $current-1;\n $href = \"index.php?rub=\".$rub.\"&p=\".$prec.$get;\n\n $arr_return[] = array('link' => $href, 'number' => 'fa fa-arrow-left', 'active' => 0, 'bnumber' => 0);\n }\n\n if($nbpage <10)\n {\n $linkstart = 1;\n $linkstop = $nbpage;\n }\n else if($current<=5)\n { \n $linkstart = 1;\n $linkstop = 10;\n }\n else if( $current>5 && $current<($nbpage-5) )\n { \n $linkstart = $current-4;\n $linkstop = $current+5;\n }\n else if( $current>=($nbpage-5) )\n { \n $linkstart = $nbpage-9;\n $linkstop = $nbpage;\n }\n \n\n for($ipage=$linkstart;$ipage<=$linkstop;$ipage++)\n {\n $href = \"index.php?rub=\".$rub.\"&p=\".$ipage.$get; \n if($current==$ipage)\n {\n $arr_return[] = array('link' => '#', 'number' => $ipage, 'active' => 1, 'bnumber' => 1);\n }\n else\n {\n $arr_return[] = array('link' => $href, 'number' => $ipage, 'active' => 0, 'bnumber' => 1);\n }\n }\n\n if($current<$nbpage)\n {\n $suiv = $current+1;\n $href = \"index.php?rub=\".$rub.\"&p=\".$suiv.$get;\n\n $arr_return[] = array('link' => $href, 'number' => 'fa fa-arrow-right', 'active' => 0, 'bnumber' => 0);\n }\n \n \n } \n return $arr_return;\n }", "public function Pages($params = array()) {\n\t\t//设置默认参数\n\t\t$_defaults_params = array(\n\t\t\t'allow_cache' => true,\n\t\t\t'page' => isset($_GET['page']) ? intval($_GET['page']) : 1,\n\t\t\t'pagesize' => 10,\n\t\t);\n\t\t$params = array_merge($_defaults_params, $params);\n\t\t\n\t\t//有开启缓存功能,则从缓存中取数据, 如果有数据,则直接返回结果\n\t\tif($params['allow_cache'] && isset($this->cache)) {\n\t\t\t$cacheKey = md5('collect.fields.pages.' . serialize($params));\n\t\t\t$ret = $this->cache->get($cacheKey);\n\t\t\t\n\t\t\tif($ret && is_array($ret)) {\n\t\t\t\treturn $ret;\n\t\t\t}\n\t\t}\n \n\t\t//添加条件\n\t\t$builds = array(\n 'select' => 'COUNT(`mf`.`collect_fields_id`) AS `COUNT`',\n 'from' => array('{{collect_model_fields}}', 'mf')\n );\n\t\tif(isset($params['collect_fields_status']) && !empty($params['collect_fields_status'])) {\n\t\t\t$builds['where'] = array('AND', '`mf`.`collect_fields_status`=:collect_fields_status');\n\t\t\t$sql_params[':collect_fields_status'] = $params['collect_fields_status'];\n\t\t} else {\n\t\t\t$builds['where'] = array('AND', '`mf`.`collect_fields_status`>:collect_fields_status');\n\t\t\t$sql_params[':collect_fields_status'] = 0;\n\t\t}\n\t\t\n\t\t//\n\t\tif(isset($params['collect_model_id']) && !empty($params['collect_model_id'])) {\n\t\t\t$builds['where'][] = array('AND', '`mf`.`collect_model_id`=:collect_model_id');\n\t\t\t$sql_params[':collect_model_id'] = $params['collect_model_id'];\n\t\t}\n\t\t\n\t\tif(isset($params['collect_fields_id']) && !empty($params['collect_fields_id'])) {\n\t\t\t$builds['where'][] = array('AND', '`mf`.`collect_fields_id`=:collect_fields_id');\n\t\t\t$sql_params[':collect_fields_id'] = $params['collect_fields_id'];\n\t\t}\n\t\t\n\t\tif(isset($params['collect_fields_name']) && !empty($params['collect_fields_name'])) {\n\t\t\t$builds['where'][] = array(\n 'LIKE',\n '`mf`.`collect_fields_name`',\n ':collect_fields_name'\n );\n\t\t\t$sql_params[':collect_fields_name'] = \"{$params['collect_fields_name']}\";\n\t\t}\n\t\t\n\t\tif(isset($params['searchKey']) && !empty($params['searchKey'])) {\n\t\t\t$builds['where'][] = array(\n 'LIKE',\n '`mf`.`collect_fields_name`',\n ':searchKey'\n );\n\t\t\t$sql_params[':searchKey'] = \"%{$params['searchKey']}%\";\n\t\t}\n $sql = $this->buildQuery($builds);\n\t\t\n\t\t//统计数量\n $count = $this->db->queryScalar($sql, $sql_params);\n\t\t\n\t\t//分页处理\n\t\t$pages = new CPagination($count);\n\t\t\n\t\t//设置分页大小\n\t\t$pages->pageSize = $params['pagesize'];\n\t\t\n\t\tif(isset($params['orderby']) && $params['orderby']) {\n\t\t\t$builds['order'] = $params['orderby'];\n\t\t} else {\n $builds['order'] = array(\n\t\t\t\t\t'`mf`.`collect_fields_rank` ASC',\n\t\t\t\t\t'`mf`.`collect_fields_id` DESC',\n\t\t\t\t);\n\t\t}\n\t\t\n $builds['select'] = '`mf`.`collect_fields_id`, `mf`.`collect_fields_name`,`mf`.`collect_fields_system`, `mf`.`collect_fields_belong`, `mf`.`collect_fields_identify`, `mf`.`collect_fields_rank`, `mf`.`collect_fields_lasttime`, `mf`.`collect_fields_type`, `cf`.`content_model_field_name`';\n $builds['leftJoin'] = array(\n '{{content_model_fields}}', 'cf', '`cf`.`content_model_field_id`=`mf`.`content_model_field_id`',\n );\n $pages->applyLimit($builds);\n $sql = $this->buildQuery($builds);\n\t\t$ret['pages'] = $pages;\n\t\t$ret['rows'] = $this->db->queryAll($sql, $sql_params);\n\t\t\n\t\tforeach($ret[\"rows\"] as $_k=>$_v){\n\t\t\t$ret[\"rows\"][$_k]['collect_fields_type'] = self::getFieldTypes($_v['collect_fields_type']);\n\t\t}\n\t\t\n\t\t//有开启缓存,则把结果添加到缓存中\n\t\tif($params['allow_cache'] && isset($this->cache)) {\n\t\t\t$cacheTime = Setting::inst()->getSettingValue('COLLECT_MODEL_PAGES_CACHE_TIME');\n\t\t\t$this->cache->set($cacheKey, json_encode($ret), $cacheTime);\n\t\t\tunset($cacheTime, $cacheKey);\n\t\t}\n\t\treturn $ret;\n\t}", "public function buildPagination($count,$limit,$start,$url) {\n\t\t$pageCount = $count / $limit;\n\t\t$curPage = $start / $limit;\n\t\t$pages = '';\n\t\tfor ($i=0;$i<$pageCount;$i++) {\n\t\t\t$newStart = $i*$limit;\n\t\t\t$u = $url.'&start='.$newStart.'&limit='.$limit;\n\t\t\tif ($i != $curPage) {\n\t\t\t\t$pages .= '<li class=\"page-number\"><a href=\"'.$u.'\">'.($i+1).'</a></li>';\n\t\t\t} else {\n\t\t\t\t$pages .= '<li class=\"page-number pgCurrent\">'.($i+1).'</li>';\n\t\t\t}\n\t\t}\n\t\treturn $this->getChunk('xflickrPagination',array(\n 'xflickr.pages' => $pages,\n\t\t));\n\t}", "public function getPerPage();", "public function registerPageParams()\n {\n return [];\n }", "static function getParamCount() {\n\t\treturn 2;\n\t}", "function perpage_selector_new()\r\n\t{\r\n\t?>\r\n\t<div class=\"btn-group dropup\">\r\n\t <button type=\"button\" class=\"btn btn-sm btn-secondary dropdown-toggle page-size-dropdown\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">\r\n\t <?php \r\n\t if(isset($_GET['per_page']))\r\n\t\t\t{\r\n\t\t\t\techo $_GET['per_page'];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\techo $this->rows_per_page;\r\n\t\t\t} ?>\r\n\t </button>\r\n\t <div class=\"dropdown-menu\">\r\n\t \t<?php \r\n\t \tfor ($i=10; $i <= 500 ; $i = $i + 10) { \r\n\t\t\t\t\tif($i>50)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$i = $i+15; \r\n\t\t\t\t\t}\r\n\t\t\t\t\tif($i>100)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$i = $i+25; \r\n\t\t\t\t\t}\r\n\t\t\t\t\tif($i>200)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$i = $i+50; \r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t \t?>\r\n\t <a class=\"dropdown-item\" href=\"<?php\r\n\t\t\t$data= $_GET;\r\n\t\t\tif(isset($data[\"per_page\"]))\r\n\t\t\t{\r\n\t\t\t\tunset($data[\"per_page\"]);\r\n\t\t\t}\r\n\t\t\techo $_SERVER['PHP_SELF'].\"?\".http_build_query($data); ?>&per_page=<?php echo $i;?>\"><?php echo $i;?></a>\r\n\t \t<?php \r\n\t \t} \r\n\t \t?>\r\n\t </div>\r\n\t</div>\r\n\t<?php\r\n\t}", "function buildNavigation($pageNum_Recordset1,$totalPages_Recordset1,$prev_Recordset1,$next_Recordset1,$separator=\" | \",$max_links=10, $show_page=true)\n{\n GLOBAL $maxRows_rs_novinky,$totalRows_rs_novinky;\n\t$pagesArray = \"\"; $firstArray = \"\"; $lastArray = \"\";\n\tif($max_links<2)$max_links=2;\n\tif($pageNum_Recordset1<=$totalPages_Recordset1 && $pageNum_Recordset1>=0)\n\t{\n\t\tif ($pageNum_Recordset1 > ceil($max_links/2))\n\t\t{\n\t\t\t$fgp = $pageNum_Recordset1 - ceil($max_links/2) > 0 ? $pageNum_Recordset1 - ceil($max_links/2) : 1;\n\t\t\t$egp = $pageNum_Recordset1 + ceil($max_links/2);\n\t\t\tif ($egp >= $totalPages_Recordset1)\n\t\t\t{\n\t\t\t\t$egp = $totalPages_Recordset1+1;\n\t\t\t\t$fgp = $totalPages_Recordset1 - ($max_links-1) > 0 ? $totalPages_Recordset1 - ($max_links-1) : 1;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$fgp = 0;\n\t\t\t$egp = $totalPages_Recordset1 >= $max_links ? $max_links : $totalPages_Recordset1+1;\n\t\t}\n\t\tif($totalPages_Recordset1 >= 1) {\n\t\t\t#\t------------------------\n\t\t\t#\tSearching for $_GET vars\n\t\t\t#\t------------------------\n\t\t\t$_get_vars = '';\t\t\t\n\t\t\tif(!empty($_GET) || !empty($_GET)){\n\t\t\t\t$_GET = empty($_GET) ? $_GET : $_GET;\n\t\t\t\tforeach ($_GET as $_get_name => $_get_value) {\n\t\t\t\t\tif ($_get_name != \"pageNum_rs_novinky\") {\n\t\t\t\t\t\t$_get_vars .= \"&$_get_name=$_get_value\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$successivo = $pageNum_Recordset1+1;\n\t\t\t$precedente = $pageNum_Recordset1-1;\n\t\t\t$firstArray = ($pageNum_Recordset1 > 0) ? \"<a href=\\\"$_SERVER[PHP_SELF]?pageNum_rs_novinky=$precedente$_get_vars\\\">$prev_Recordset1</a>\" : \"$prev_Recordset1\";\n\t\t\t# ----------------------\n\t\t\t# page numbers\n\t\t\t# ----------------------\n\t\t\tfor($a = $fgp+1; $a <= $egp; $a++){\n\t\t\t\t$theNext = $a-1;\n\t\t\t\tif($show_page)\n\t\t\t\t{\n\t\t\t\t\t$textLink = $a;\n\t\t\t\t} else {\n\t\t\t\t\t$min_l = (($a-1)*$maxRows_rs_novinky) + 1;\n\t\t\t\t\t$max_l = ($a*$maxRows_rs_novinky >= $totalRows_rs_novinky) ? $totalRows_rs_novinky : ($a*$maxRows_rs_novinky);\n\t\t\t\t\t$textLink = \"$min_l - $max_l\";\n\t\t\t\t}\n\t\t\t\t$_ss_k = floor($theNext/26);\n\t\t\t\tif ($theNext != $pageNum_Recordset1)\n\t\t\t\t{\n\t\t\t\t\t$pagesArray .= \"<a href=\\\"$_SERVER[PHP_SELF]?pageNum_rs_novinky=$theNext$_get_vars\\\">\";\n\t\t\t\t\t$pagesArray .= \"$textLink</a>\" . ($theNext < $egp-1 ? $separator : \"\");\n\t\t\t\t} else {\n\t\t\t\t\t$pagesArray .= \"$textLink\" . ($theNext < $egp-1 ? $separator : \"\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t$theNext = $pageNum_Recordset1+1;\n\t\t\t$offset_end = $totalPages_Recordset1;\n\t\t\t$lastArray = ($pageNum_Recordset1 < $totalPages_Recordset1) ? \"<a href=\\\"$_SERVER[PHP_SELF]?pageNum_rs_novinky=$successivo$_get_vars\\\">$next_Recordset1</a>\" : \"$next_Recordset1\";\n\t\t}\n\t}\n\treturn array($firstArray,$pagesArray,$lastArray);\n}", "function pagination($page_count,$page,$browse_range=3,$show_last=true)\n {\n if($page_count>1)\n {\n $xpagination['current'] = $page;\n if($page_count > $page)\n {\n $xpagination['next'] = $page+1;\n }\n else\n {\n $xpagination['next'] = 0;\n }\n if($page > 1)\n {\n $xpagination['previous'] = $page-1;\n }\n else\n {\n $xpagination['previous'] = 0;\n }\n $xpagination['items'][] = 1;\n if ($page > $browse_range+1) $xpagination['items'][] = 0;\n $n_range = $page-($browse_range-1);\n $p_range = $page+$browse_range;\n for($page_browse=$n_range; $page_browse<$p_range; $page_browse++)\n {\n if($page_browse > 1 && $page_browse <= $page_count) $xpagination['items'][] = $page_browse;\n }\n if($show_last)\n {\n if($page < $page_count-($browse_range)) $xpagination['items'][] = 0;\n if(!in_array($page_count,$xpagination['items'])) $xpagination['items'][] = $page_count;\n }\n return $xpagination;\n }\n return false;\n }", "function buildNavigation($pageNum_Recordset1,$totalPages_Recordset1,$prev_Recordset1,$next_Recordset1,$separator=\" | \",$max_links=10, $show_page=true)\n{\n GLOBAL $maxRows_rs_video,$totalRows_rs_video;\n\t$pagesArray = \"\"; $firstArray = \"\"; $lastArray = \"\";\n\tif($max_links<2)$max_links=2;\n\tif($pageNum_Recordset1<=$totalPages_Recordset1 && $pageNum_Recordset1>=0)\n\t{\n\t\tif ($pageNum_Recordset1 > ceil($max_links/2))\n\t\t{\n\t\t\t$fgp = $pageNum_Recordset1 - ceil($max_links/2) > 0 ? $pageNum_Recordset1 - ceil($max_links/2) : 1;\n\t\t\t$egp = $pageNum_Recordset1 + ceil($max_links/2);\n\t\t\tif ($egp >= $totalPages_Recordset1)\n\t\t\t{\n\t\t\t\t$egp = $totalPages_Recordset1+1;\n\t\t\t\t$fgp = $totalPages_Recordset1 - ($max_links-1) > 0 ? $totalPages_Recordset1 - ($max_links-1) : 1;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$fgp = 0;\n\t\t\t$egp = $totalPages_Recordset1 >= $max_links ? $max_links : $totalPages_Recordset1+1;\n\t\t}\n\t\tif($totalPages_Recordset1 >= 1) {\n\t\t\t#\t------------------------\n\t\t\t#\tSearching for $_GET vars\n\t\t\t#\t------------------------\n\t\t\t$_get_vars = '';\t\t\t\n\t\t\tif(!empty($_GET) || !empty($HTTP_GET_VARS)){\n\t\t\t\t$_GET = empty($_GET) ? $HTTP_GET_VARS : $_GET;\n\t\t\t\tforeach ($_GET as $_get_name => $_get_value) {\n\t\t\t\t\tif ($_get_name != \"pageNum_rs_video\") {\n\t\t\t\t\t\t$_get_vars .= \"&$_get_name=$_get_value\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$successivo = $pageNum_Recordset1+1;\n\t\t\t$precedente = $pageNum_Recordset1-1;\n\t\t\t$firstArray = ($pageNum_Recordset1 > 0) ? \"<a href=\\\"$_SERVER[PHP_SELF]?pageNum_rs_video=$precedente$_get_vars\\\">$prev_Recordset1</a>\" : \"$prev_Recordset1\";\n\t\t\t# ----------------------\n\t\t\t# page numbers\n\t\t\t# ----------------------\n\t\t\tfor($a = $fgp+1; $a <= $egp; $a++){\n\t\t\t\t$theNext = $a-1;\n\t\t\t\tif($show_page)\n\t\t\t\t{\n\t\t\t\t\t$textLink = $a;\n\t\t\t\t} else {\n\t\t\t\t\t$min_l = (($a-1)*$maxRows_rs_video) + 1;\n\t\t\t\t\t$max_l = ($a*$maxRows_rs_video >= $totalRows_rs_video) ? $totalRows_rs_video : ($a*$maxRows_rs_video);\n\t\t\t\t\t$textLink = \"$min_l - $max_l\";\n\t\t\t\t}\n\t\t\t\t$_ss_k = floor($theNext/26);\n\t\t\t\tif ($theNext != $pageNum_Recordset1)\n\t\t\t\t{\n\t\t\t\t\t$pagesArray .= \"<a href=\\\"$_SERVER[PHP_SELF]?pageNum_rs_video=$theNext$_get_vars\\\">\";\n\t\t\t\t\t$pagesArray .= \"$textLink</a>\" . ($theNext < $egp-1 ? $separator : \"\");\n\t\t\t\t} else {\n\t\t\t\t\t$pagesArray .= \"$textLink\" . ($theNext < $egp-1 ? $separator : \"\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t$theNext = $pageNum_Recordset1+1;\n\t\t\t$offset_end = $totalPages_Recordset1;\n\t\t\t$lastArray = ($pageNum_Recordset1 < $totalPages_Recordset1) ? \"<a href=\\\"$_SERVER[PHP_SELF]?pageNum_rs_video=$successivo$_get_vars\\\">$next_Recordset1</a>\" : \"$next_Recordset1\";\n\t\t}\n\t}\n\treturn array($firstArray,$pagesArray,$lastArray);\n}", "function show_pages($amount, $rowamount, $id = '') {\n if ($amount > $rowamount) {\n $num = 8;\n $poutput = '';\n $lastpage = ceil($amount / $rowamount);\n $startpage = 1;\n\n if (!isset($_GET[\"start\"]))\n $_GET[\"start\"] = 1;\n $start = $_GET[\"start\"];\n\n if ($lastpage > $num & $start > ($num / 2)) {\n $startpage = ($start - ($num / 2));\n }\n\n echo _('Show page') . \":<br>\";\n\n if ($lastpage > $num & $start > 1) {\n $poutput .= '<a href=\" ' . htmlentities($_SERVER[\"PHP_SELF\"], ENT_QUOTES);\n $poutput .= '?start=' . ($start - 1);\n if ($id != '')\n $poutput .= '&id=' . $id;\n $poutput .= '\">';\n $poutput .= '[ < ]';\n $poutput .= '</a>';\n }\n if ($start != 1) {\n $poutput .= '<a href=\" ' . htmlentities($_SERVER[\"PHP_SELF\"], ENT_QUOTES);\n $poutput .= '?start=1';\n if ($id != '')\n $poutput .= '&id=' . $id;\n $poutput .= '\">';\n $poutput .= '[ 1 ]';\n $poutput .= '</a>';\n if ($startpage > 2)\n $poutput .= ' .. ';\n }\n\n for ($i = $startpage; $i <= min(($startpage + $num), $lastpage); $i++) {\n if ($start == $i) {\n $poutput .= '[ <b>' . $i . '</b> ]';\n } elseif ($i != $lastpage & $i != 1) {\n $poutput .= '<a href=\" ' . htmlentities($_SERVER[\"PHP_SELF\"], ENT_QUOTES);\n $poutput .= '?start=' . $i;\n if ($id != '')\n $poutput .= '&id=' . $id;\n $poutput .= '\">';\n $poutput .= '[ ' . $i . ' ]';\n $poutput .= '</a>';\n }\n }\n\n if ($start != $lastpage) {\n if (min(($startpage + $num), $lastpage) < ($lastpage - 1))\n $poutput .= ' .. ';\n $poutput .= '<a href=\" ' . htmlentities($_SERVER[\"PHP_SELF\"], ENT_QUOTES);\n $poutput .= '?start=' . $lastpage;\n if ($id != '')\n $poutput .= '&id=' . $id;\n $poutput .= '\">';\n $poutput .= '[ ' . $lastpage . ' ]';\n $poutput .= '</a>';\n }\n\n if ($lastpage > $num & $start < $lastpage) {\n $poutput .= '<a href=\" ' . htmlentities($_SERVER[\"PHP_SELF\"], ENT_QUOTES);\n $poutput .= '?start=' . ($start + 1);\n if ($id != '')\n $poutput .= '&id=' . $id;\n $poutput .= '\">';\n $poutput .= '[ > ]';\n $poutput .= '</a>';\n }\n\n echo $poutput;\n }\n}", "protected function _getPageParams($start=0, $size=20) {\r\n\r\n if ($start > 0) {\r\n\r\n $params = array(\r\n\r\n 'ws.start' => $start,\r\n\r\n 'ws.size' => $size,\r\n\r\n );\r\n\r\n ksort($params);\r\n\r\n } else {\r\n\r\n $params = array();\r\n\r\n }\r\n\r\n return $params;\r\n\r\n }", "private function setPage(){\n\t if(!empty($_GET['page'])){\n\t if($_GET['page']>0){\n\t if($_GET['page'] > $this->pagenum){\n\t return $this->pagenum;\n\t }else{\n\t return $_GET['page'];\n\t }\n\t }else{\n\t return 1;\n\t }\n\t }else{\n\t return 1;\n\t }\n\t }", "function perpage_selector()\r\n\t{\r\n\t?>\r\n\t\t<form name=\"per_page2\" action=\"\" method=\"get\">\r\n\t\t\t<select name=\"per_page\" id=\"per_page\" onChange='location.replace(\"<?php\r\n\t\t\t$data= $_GET;\r\n\t\t\tif(isset($data[\"per_page\"]))\r\n\t\t\t{\r\n\t\t\t\tunset($data[\"per_page\"]);\r\n\t\t\t}\r\n\t\t\techo $_SERVER['PHP_SELF'].\"?\".http_build_query($data); ?>&<?php echo \"per_page\";?>=\"+$(\"#per_page\").val() )'>\r\n\t\t\t<?php \r\n\t\t\t/* Adding a Default Value in options if it does not exist. */\r\n\r\n\t\t\tif(($this->rows_per_page%10)!=0)\r\n\t\t\t{\r\n\t\t\t ?>\r\n\t\t\t\t<option selected='selected' value=\"<?php echo $this->rows_per_page; ?>\"><?php echo $this->rows_per_page; ?></option>\r\n\t\t\t<?php \r\n\t\t\t}\r\n\t\t\t?>\r\n\t\t\t<?php \r\n\t\t\t\tfor ($i=10; $i < 100 ; $i = $i + 10) { \r\n\t\t\t\t\t?>\r\n\t\t\t\t\t\t<option <?php \r\n\t\t\t\t\t\t\tif(isset($_GET['per_page']) && $_GET['per_page'] == $i)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\techo \" selected = 'selected' \";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif(!isset($_GET['per_page']) && $this->rows_per_page == $i)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\techo \" selected = 'selected' \";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t?> value=\"<?php echo $i; ?>\"><?php echo $i; ?></option>\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t<?php\r\n\t\t\t\t}\r\n\t\t\t ?>\r\n\t\t\t</select>\r\n\t\t</form>\r\n\t\t<?php\r\n\t}", "function getPagerParams( $action, &$params ) {\n return array(\n //'status' => 'Displaying Page %s of %s',\n //'csvString' => 'csvString???',\n //'rowCount' => 10,\n );\n }", "function generate_pagination($url, $items, $per_page, $start, $start_variable='start'){\r\n global $eqdkp_root_path, $user;\r\n\r\n $uri_symbol = ( strpos($url, '?') ) ? '&amp;' : '?';\r\n\t\t//On what page we are?\r\n\t\t$recent_page = (int)floor($start / $per_page) + 1;\r\n\t\t//Calculate total pages\r\n\t\t$total_pages = ceil($items / $per_page);\r\n\t\t//Return if we don't have at least 2 Pages\r\n\t\tif (!$items || $total_pages < 2){\r\n return '';\r\n }\r\n\r\n\t\t//First Page\r\n $pagination = '<div class=\"pagination\">';\r\n\t\tif ($recent_page == 1){\r\n\t\t\t$pagination .= '<span class=\"pagination_activ\">1</span>';\r\n\t\t} else {\r\n\t\t\t$pagination .= '<a href=\"'.$url.$uri_symbol . $start_variable.'='.( ($recent_page - 2) * $per_page).'\" title=\"'.$user->lang['previous_page'].'\"><img src=\"'.$eqdkp_root_path.'images/arrows/left_arrow.png\" border=\"0\"></a>&nbsp;&nbsp;<a href=\"'.$url.'\" class=\"pagination\">1</a>';\r\n\t\t}\r\n\r\n\t\t//If total-pages < 4 show all page-links\r\n\t\tif ($total_pages < 4){\r\n\t\t\t\t$pagination .= ' ';\r\n\t\t\t\tfor ( $i = 2; $i < $total_pages; $i++ ){\r\n\t\t\t\t\tif ($i == $recent_page){\r\n\t\t\t\t\t\t$pagination .= '<span class=\"pagination_activ\">'.$i.'</span> ';\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$pagination .= '<a href=\"'.$url.$uri_symbol.$start_variable.'='.( ($i - 1) * $per_page).'\" title=\"'.$user->lang['page'].' '.$i.'\" class=\"pagination\">'.$i.'</a> ';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$pagination .= ' ';\r\n\t\t\t\t}\r\n\t\t//Don't show all page-links\r\n\t\t} else {\r\n\t\t\t$start_count = min(max(1, $recent_page - 5), $total_pages - 4);\r\n\t\t\t$end_count = max(min($total_pages, $recent_page + 5), 4);\r\n\r\n\t\t\t$pagination .= ( $start_count > 1 ) ? ' ... ' : ' ';\r\n\r\n\t\t\tfor ( $i = $start_count + 1; $i < $end_count; $i++ ){\r\n\t\t\t\tif ($i == $recent_page){\r\n\t\t\t\t\t$pagination .= '<span class=\"pagination_activ\">'.$i.'</span> ';\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$pagination .= '<a href=\"'.$url.$uri_symbol.$start_variable.'='.( ($i - 1) * $per_page).'\" title=\"'.$user->lang['page'].' '.$i.'\" class=\"pagination\">'.$i.'</a> ';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$pagination .= ($end_count < $total_pages ) ? ' ... ' : ' ';\r\n\t\t} //close else\r\n\r\n\r\n\t\t//Last Page\r\n\t\tif ($recent_page == $total_pages){\r\n\t\t\t$pagination .= '<span class=\"pagination_activ\">'.$recent_page.'</span>';\r\n\t\t} else {\r\n\t\t\t$pagination .= '<a href=\"'.$url.$uri_symbol.$start_variable.'='.(($total_pages - 1) * $per_page) . '\" class=\"pagination\" title=\"'.$user->lang['page'].' '.$total_pages.'\">'.$total_pages.'</a>&nbsp;&nbsp;<a href=\"'.$base. $uri_symbol .$start_variable.'='.($recent_page * $per_page).'\" title=\"'.$user->lang['next_page'].'\"><img src=\"'.$eqdkp_root_path.'images/arrows/right_arrow.png\" border=\"0\"></a>';\r\n\t\t}\r\n\r\n\t$pagination .= '</div>';\r\n\treturn $pagination;\r\n}", "public function getLinks(\n $countAllElements,//count all elements in this category\n $countElementsInThisPage,//count all elements in this page\n $startElements,//beginning number of output elements\n $linkLimit = 5,//count pages in chunk (chunk = array with pages)\n $controllerName,//controller name\n $varName = 'start'//get name of parameter, which is the count of output elements\n ) {\n if ($countElementsInThisPage >= $countAllElements || $countElementsInThisPage == 0) {\n return NULL;\n }\n\n $pages = 0;//count pages in pagination\n $needChunk = 0;//index need chunk in this moment\n $page = array();//array with value and text value page\n $queryVars = array();//GET array\n $pagesArr = array();//array with $startElements\n $link = Url::getUrl().$controllerName;//url address for page\n\n //in $queryVars GET parameters\n parse_str($_SERVER['QUERY_STRING'], $queryVars ); //&$queryVars\n\n if(isset($queryVars[$varName])) {\n\n unset($queryVars[$varName]);//delete GET with parameter $startElements\n }\n unset($queryVars['route']);//delete GET['route'], because route is controllerName\n\n $link = $link.'?'.http_build_query( $queryVars );//site url with router parameters and GET params\n\n $pages = ceil( $countAllElements / $countElementsInThisPage );//count pages\n\n for( $i = 0; $i < $pages; $i++) {\n $pagesArr[$i+1] = $i * $countElementsInThisPage;\n }\n\n $allPages = array_chunk($pagesArr, $linkLimit, true);//divide the array into several arrays by $linkLimit elements\n\n $needChunk = $this->searchPage($allPages, $startElements);//search active chunk\n\n\n /** pages first and previous */\n if ($startElements > 1) {\n\n $page['value']['start'] = $link.'&'.$varName.'=0';\n $page['text']['start'] = $this->startChar;\n $page['value']['previous'] = $link.'&'.$varName.'='.($startElements - $countElementsInThisPage);\n $page['text']['previous'] = $this->prevChar;\n } else {\n\n $page['value']['start'] = '';\n $page['text']['start'] = $this->startChar;\n $page['value']['previous'] = '';\n $page['text']['previous'] = $this->prevChar;\n }\n\n /** 5 pages or less */\n foreach($allPages[$needChunk] AS $pageNum => $start) {\n\n if( $start == $startElements ) {//current page without url\n $page['value']['pages'][] = '';\n $page['text']['pages'][] = $pageNum;\n continue;\n }\n $page['value']['pages'][] = $link.'&'.$varName.'='. $start;\n $page['text']['pages'][] = $pageNum;\n }\n\n /** pages next and last */\n if (($countAllElements - $countElementsInThisPage) > $startElements) {\n\n $page['value']['next'] = $link.'&'.$varName.'='.($startElements + $countElementsInThisPage);\n $page['text']['next'] = $this->nextChar;\n $page['value']['last'] = $link.'&'.$varName.'='.array_pop(array_pop($allPages));\n $page['text']['last'] = $this->lastChar;\n } else {\n\n $page['value']['next'] = '';\n $page['text']['next'] = $this->nextChar;\n $page['value']['last'] = '';\n $page['text']['last'] = $this->lastChar;\n }\n\n return $page;//array with pagination parameters\n }", "public function getPaginate ($p_rowsPerPage, $p_currentPage);", "public function genPageNums()\n\t{\n\t\t$pageLinks = array();\t\n\t\n\t\tfor($i=1; $i<=$this->numofpages; $i++)\n\t\t{\n\t\t\t$page = $i;\n\t\t\t$item = $this->itemTpl;\t\t\t\n\t\t\tif($this->page == $i)\n\t\t\t{\n\t\t\t\t$styleclass = 'page_current';\n\t\t\t} else\n\t\t\t{\n\t\t\t\t$styleclass = 'page';\n\t\t\t}\n\t\t\t$item = str_replace(array('{pageclass}','{pagelink}', '{pagetext}'),\n\t\t\t\t\t\t\t\tarray($styleclass, $this->prepend.$page.$this->append, $i),\n\t\t\t\t\t\t\t\t$item);\t\n\t\t\t$pageLinks[$i] = $item;\n\t\t}\t\n\t\n\t\tif(($this->totalrows % $this->limit) != 0)\n\t\t{\n\t\t\t$this->numofpages++;\n\t\t\t$page = $i;\n\t\t\t$item = $this->itemTpl;\t\t\t\n\t\t\tif($this->page == $i)\n\t\t\t{\n\t\t\t\t$styleclass = 'page_current';\n\t\t\t} else\n\t\t\t{\n\t\t\t\t$styleclass = 'page';\n\t\t\t}\n\t\t\t$item = str_replace(array('{pageclass}','{pagelink}', '{pagetext}'),\n\t\t\t\t\t\t\t\tarray($styleclass, $this->prepend.$page.$this->append, $i),\n\t\t\t\t\t\t\t\t$item);\t\t\t\t\t\n\t\t\t$pageLinks[$i] = $item;\n\t\t}\n\t\tksort($pageLinks);\n\t\t$this->pagination['nums'] = $pageLinks;\n\t}", "function _getsl($page=0){\n\t\t$ret = array();\n\t\t$defaultval = array(\n\t\t\t'start' => $page*10,\n\t\t\t'limit' => 10,\n\t\t\t);\n\t\tforeach($defaultval as $k =>$v){\n\t\t\tif(isset($_GET[$k])&&strlen($_GET[$k])){\n\t\t\t\t$ret[$k] = (int)$_GET[$k];\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$ret[$k] = $v;\n\t\t\t}\n\t\t}\n\t\treturn $ret;\n\n\t\n\t}", "private function __paginationRecall() {\n\t\t$paramsUrl = isset($this->Controller->params['url']) ? $this->Controller->params['url'] : array();\n\n\t\t$options = array();\n\t\t//$options = array_merge($this->Controller->params, $paramsUrl, $this->Controller->passedArgs);\n\n\t\t$vars = array('page', 'sort', 'direction', 'limit');\n\t\t$keys = array_keys($options);\n\t\t$count = count($keys);\n\n\t\tfor ($i = 0; $i < $count; $i++) {\n\t\t\tif (!in_array($keys[$i], $vars)) {\n\t\t\t\tunset($options[$keys[$i]]);\n\t\t\t}\n\t\t}\n\n\t\t//$this->addToPaginationRecall($options);\n\t}", "public function getPageSize();", "function getPagination($count, $page_per_no){\r\n\t\t$paginationCount = floor($count / $page_per_no);\r\n\t\t$paginationModCount = $count % $page_per_no;\r\n\t\tif(!empty($paginationModCount)){\r\n\t\t\t$paginationCount++;\r\n\t\t}\r\n\t\treturn $paginationCount;\r\n\t}", "private function getNumPages() {\n //display all in one page\n if (($this->limit < 1) || ($this->limit > $this->itemscount)) {\n $this->numpages = 1;\n } else {\n //Calculate rest numbers from dividing operation so we can add one\n //more page for this items\n $restItemsNum = $this->itemscount % $this->limit;\n //if rest items > 0 then add one more page else just divide items\n //by limit\n $restItemsNum > 0 ? $this->numpages = intval($this->itemscount / $this->limit) + 1 : $this->numpages = intval($this->itemscount / $this->limit);\n }\n }", "function url_get_parameters() {\n $this->init_full();\n return array('id' => $this->modulerecord->id, 'pageid' => $this->lessonpageid);;\n }", "protected function determineValues()\n {\n $this->strUrl = preg_replace(\n array(\n '#\\?page=\\d+&#i',\n '#\\?page=\\d+$#i',\n '#&(amp;)?page=\\d+#i'\n ),\n array(\n '?',\n '',\n ''\n ),\n \\Environment::get('request')\n );\n\n $this->strVarConnector = strpos(\n $this->strUrl,\n '?'\n ) !== false\n ? '&amp;'\n : '?';\n $this->intTotalPages = ceil($this->intRows / $this->intRowsPerPage);\n }", "function _buildPageSelect($params=array()){\n\t\timport('Dataface/AuthenticationTool.php');\n\t\t$query =& $this->app->getQuery();\n\t\t\n\t\t\n\t\t$PageID = $this->getPageID($params);\n\t\t$Language = ( isset($params['lang']) ? $params['lang'] : $this->app->_conf['lang']);\n\t\t$auth =& Dataface_AuthenticationTool::getInstance();\n\t\t$UserID = ( isset($params['user']) ? $params['user'] : $auth->getLoggedInUsername());\n\t\t$TimeStamp = ( isset($params['time']) ? $params['time'] : time()-$this->lifeTime);\n\t\t\n\t\t\n\t\treturn \"\n\t\t\twhere `PageID` = '\".addslashes($PageID).\"'\n\t\t\tand `Language` = '\".addslashes($Language).\"'\n\t\t\tand `UserID` = '\".addslashes($UserID).\"'\n\t\t\tand `Expires` > NOW() \n\t\t\tORDER BY RAND()\";\n\t}", "function showPages($Page,$VidNum,$query)\r\n{\r\n\t\t// wouldnt clik it again \r\n\t\t//first i want to show every video based on the page \r\n\t\t//if page was equal to 3 then i would show videos from 15 -22\r\n\t\t//if page was equal to 1 then i would show 0-6 \r\n\t\t//if page was equal to 2 then i would show 7-13\r\n\t\t//if page was equal to 3 then i would show 14-20\r\n\t\t// Query for the pages \r\n\t\t//Limit is Starting point and for how long to keep going \r\n\t\t$limit = (($Page* $VidNum)-1);\r\n\t\t$selectQuery =$query.\" LIMIT \".($limit - ($VidNum -1)) .\",\". ($VidNum -1) ;\r\n\t\t$result =ex_query($selectQuery);\r\n\t\t\r\n\t\tGenMultipleThumb($result);\r\n\t\t//\r\n\t\t//Now to show the number of pages again \r\n\t\t\r\n}", "protected function buildPagination()\n {\n $this->calculateDisplayRange();\n $pages = [];\n for ($i = $this->displayRangeStart; $i <= $this->displayRangeEnd; $i++) {\n $pages[] = [\n 'number' => $i,\n 'offset' => ($i - 1) * $this->itemsPerPage,\n 'isCurrent' => $i === $this->currentPage\n ];\n }\n $pagination = [\n 'linkConfiguration' => $this->linkConfiguration,\n 'pages' => $pages,\n 'current' => $this->currentPage,\n 'numberOfPages' => $this->numberOfPages,\n 'lastPageOffset' => ($this->numberOfPages - 1) * $this->itemsPerPage,\n 'displayRangeStart' => $this->displayRangeStart,\n 'displayRangeEnd' => $this->displayRangeEnd,\n 'hasLessPages' => $this->displayRangeStart > 2,\n 'hasMorePages' => $this->displayRangeEnd + 1 < $this->numberOfPages\n ];\n if ($this->currentPage < $this->numberOfPages) {\n $pagination['nextPage'] = $this->currentPage + 1;\n $pagination['nextPageOffset'] = $this->currentPage * $this->itemsPerPage;\n }\n if ($this->currentPage > 1) {\n $pagination['previousPage'] = $this->currentPage - 1;\n $pagination['previousPageOffset'] = ($this->currentPage - 2) * $this->itemsPerPage;\n }\n return $pagination;\n }", "private function getPaginatorType2($current_page = 0, $total_pages = 1, $conditions = \"\", $condition_encode = false){\n $cuppa = Cuppa::getInstance();\n $language = $cuppa->language->load();\n if($total_pages == 1) return \"\";\n $field = \"<div class='paginator'>\";\n //++ Page info\n if($this->pages_info)\n $field .= \"<div class='page_numbers'>\".$cuppa->language->getValue(\"Page\",$language).\" \".($current_page+1).\" \".$cuppa->language->getValue(\"of\",$language).\" \".$total_pages.\"</div>\";\n //--\n //++ Pages\n $field .= \"<div class='pages'>\";\n //++ Firs page\n if($current_page != 0)\n $field .= \"<a class='first_page' onclick='\".$this->function_name.\"(0,\\\"\".$this->submit_form.\"\\\",\\\"\".$this->limit.\"\\\")' ><span>\".$cuppa->language->getValue(\"First\",$language).\"</span></a>\";\n //--\n //++ add apges\n $j = 0;\n for($i = $current_page - $this->max_numbers; $i < $total_pages; $i++){\n if($i < 0) $i = 0;\n if($i > $current_page + $this->max_numbers) break;\n if($j > 0) $field .= \"<div class='separator'></div>\"; \n if($i == $current_page)\n $field .= \"<a class='page_item selected'><span>\".($i+1).\"</span></a>\";\n else \n $field .= \"<a class='page_item' onclick='\".$this->function_name.\"(\".$i.\",\\\"\".$this->submit_form.\"\\\",\\\"\".$this->limit.\"\\\")' ><span>\".($i+1).\"</span></a>\";\n $j++;\n }\n //--\n //++ Last page\n if($current_page+1 != $total_pages)\n $field .= \"<a class='last_page' onclick='\".$this->function_name.\"(\".($total_pages-1).\",\\\"\".$this->submit_form.\"\\\",\\\"\".$this->limit.\"\\\")' ><span>\".$cuppa->language->getValue(\"Last\",$language).\"</span></a>\";\n //--\n $field .= \"</div>\";\n //-- Pages\n $field .= \"</div>\";\n $field .= \"<input type='hidden' value='\".$current_page.\"' id='page' name='page' />\";\n $field .= \"<input type='hidden' value='' id='page_item_start' name='page_item_start' />\";\n if($condition_encode) $field .= '<input type=\"hidden\" id=\"conditions\" name=\"conditions\" value=\"'.base64_encode($conditions).'\"/>';\n else $field .= '<input type=\"hidden\" id=\"conditions\" name=\"conditions\" value=\"'.$conditions.'\"/>';\n return $field;\n }", "function pagination(){}", "public function getPageNumbers();", "function get_all_page_ids()\n {\n }", "function doPages($page_size, $thepage, $query_string, $total=0) {\n \n //per page count\n $index_limit = 10;\n\n //set the query string to blank, then later attach it with $query_string\n $query='';\n \n if(strlen($query_string)>0){\n $query = \"&amp;\".$query_string;\n }\n \n //get the current page number example: 3, 4 etc: see above method description\n $current = get_current_page();\n \n $total_pages=ceil($total/$page_size);\n $start=max($current-intval($index_limit/2), 1);\n $end=$start+$index_limit-1;\n\n echo '<br /><br /><div class=\"paging\">';\n\n if($current==1) {\n echo '<span class=\"prn\">&lt; Previous</span>&nbsp;';\n } else {\n $i = $current-1;\n echo '<a href=\"'.$thepage.'?page='.$i.$query.'\" class=\"prn\" rel=\"nofollow\" title=\"go to page '.$i.'\">&lt; Previous</a>&nbsp;';\n echo '<span class=\"prn\">...</span>&nbsp;';\n }\n\n if($start > 1) {\n $i = 1;\n echo '<a href=\"'.$thepage.'?page='.$i.$query.'\" title=\"go to page '.$i.'\">'.$i.'</a>&nbsp;';\n }\n\n for ($i = $start; $i <= $end && $i <= $total_pages; $i++){\n if($i==$current) {\n echo '<span>'.$i.'</span>&nbsp;';\n } else {\n echo '<a href=\"'.$thepage.'?page='.$i.$query.'\" title=\"go to page '.$i.'\">'.$i.'</a>&nbsp;';\n }\n }\n\n if($total_pages > $end){\n $i = $total_pages;\n echo '<a href=\"'.$thepage.'?page='.$i.$query.'\" title=\"go to page '.$i.'\">'.$i.'</a>&nbsp;';\n }\n\n if($current < $total_pages) {\n $i = $current+1;\n echo '<span class=\"prn\">...</span>&nbsp;';\n echo '<a href=\"'.$thepage.'?page='.$i.$query.'\" class=\"prn\" rel=\"nofollow\" title=\"go to page '.$i.'\">Next &gt;</a>&nbsp;';\n } else {\n echo '<span class=\"prn\">Next &gt;</span>&nbsp;';\n }\n \n //if nothing passed to method or zero, then dont print result, else print the total count below:\n if ($total != 0){\n //prints the total result count just below the paging\n echo '<p id=\"total_count\">(total '.$total.' results)</p></div>';\n }\n \n }", "protected function getResultParams() {\n\t\t\tif (!($intNumResults = (int) $this->objUrl->getVariable('num'))) {\n\t\t\t\t$intNumResults = 10;\n\t\t\t}\n\t\t\tif (!($intPage = (int) $this->objUrl->getVariable('page'))) {\n\t\t\t\t$intPage = 1;\n\t\t\t}\n\t\t\t\n\t\t\t$arrFilters = array(\n\t\t\t\t'Conditions' => array(),\n\t\t\t\t'Limit' => $intNumResults, \n\t\t\t\t'Offset' => ($intPage - 1) * $intNumResults\n\t\t\t);\n\t\t\t\n\t\t\tif ($this->blnInternal) {\n\t\t\t\t$arrInternal = explode(',', $this->objUrl->getFilter('internal'));\n\t\t\t\tif (in_array('nocache', $arrInternal)) {\n\t\t\t\t\t$this->blnNoCache = true;\n\t\t\t\t}\n\t\t\t\tif (in_array('banned', $arrInternal)) {\n\t\t\t\t\t$arrFilters['AutoFilterOff'] = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$arrInternal = array();\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->objUrl->getFilter('include') == 'grouped') {\n\t\t\t\t$arrFilters['Grouped'] = true;\n\t\t\t}\n\t\t\t\n\t\t\treturn compact('arrFilters', 'arrInternal');\n\t\t}", "public function get_page_permastruct()\n {\n }", "public static function alm_filters_get_page_num(){\n\t \t$pg = (isset($_GET['pg'])) ? $_GET['pg'] : 1;\n\t \treturn $pg;\n \t}", "public function pagingV1($DivID,$count,$perpage,$start,$link)\n\t{\n\t\t$num = $count;\n\t\t$per_page = $perpage; // Number of items to show per page\n\t\t$showeachside = 4; // Number of items to show either side of selected page\n\t\tif(empty($start)){$start = 0;} // Current start position\n\t\telse{$start = $start;}\n\t\t$max_pages = ceil($num / $per_page); // Number of pages\n\t\t$cur = ceil($start / $per_page)+1; // Current page number\n\t\t\n\t\t// ADDED: 8/21/14 by Robotman321\n\t\t// Used to make the pages \"nicer\"\n\t\tif($max_pages == 1)\n\t\t{\n\t\t\t$front = \"<span style=\\\"padding:1px 3px 1px 3px;margin:1px;border:1px solid gray;background-color:#99e6ff;\\\">$max_pages Page</span>&nbsp;\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$front = \"<span style=\\\"padding:1px 3px 1px 3px;margin:1px;border:1px solid gray;background-color:#99e6ff;\\\">$max_pages Pages</span>&nbsp;\";\n\t\t}\n\t\t\n\t\tif(($start-$per_page) >= 0)\n\t\t{\n\t\t\t$next = $start-$per_page;\n\t\t\t$startpage = '<a href=\"#\" onClick=\"$(\\'#' . $DivID . '\\').load(\\'' . $link.($next>0?(\"&page=\").$next:\"\") . '\\');return false;\" style=\"padding:1px 3px 1px 3px;margin:1px;border:1px solid gray;background-color:#99e6ff;\">&lt;</a>';\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$startpage = '';\n\t\t}\n\t\tif($start+$per_page<$num){\n\t\t\t$endpage = '<a href=\"#\" onClick=\"$(\\'#' . $DivID . '\\').load(\\'' . $link.'&page='.max(0,$start+1) . '\\');return false;\" style=\"padding:1px 3px 1px 3px;margin:1px;border:1px solid gray;background-color:#99e6ff;\">&gt;</a>';\n\t\t}\n\t\telse {\n\t\t\t$endpage = '';\n\t\t}\n\t\t$eitherside = ($showeachside * $per_page);\n\t\tif($start+1 > $eitherside){\n\t\t\t$frontdots = \" ...\";\n\t\t}\n\t\telse {$frontdots = '';}\n\t\t$pg = 1;\n\t\t$middlepage = '';\n\t\tfor($y=0;$y<$num;$y+=$per_page)\n\t\t{\n\t\t\t$style=($y==$start)?\"padding:1px 3px 1px 3px;margin:1px;border:1px solid gray;background-color:#99e6ff;font-weight:bold;\":\"padding:1px 3px 1px 3px;margin:1px;border:1px solid gray;background-color:#99e6ff;\";\n\t\t\tif(($y > ($start - $eitherside)) && ($y < ($start + $eitherside)))\n\t\t\t{\n\t\t\t\t$middlepage .= '<a style=\"'.$style.'\" href=\"#\" onClick=\"$(\\'#' . $DivID . '\\').load(\\'' . $link.($y>0?(\"&page=\").$y:\"\") . '\\');return false;\">'.$pg.'</a>&nbsp;';\n\t\t\t}\n\t\t\t$pg++;\n\t\t}\n\t\tif(($start+$eitherside)<$num){\n\t\t\t$enddots = \"... \";\n\t\t}\n\t\telse {$enddots = '';}\n\t\t\n\t\techo '<div class=\"fontcolor\">'.$front.$startpage.$frontdots.$middlepage.$enddots.$endpage.'</div>';\n\t}", "function pager_get_query_parameters() {\n $query = &drupal_static(__FUNCTION__);\n if (!isset($query)) {\n $query = drupal_get_query_parameters($_GET, array('q', 'page'));\n }\n return $query;\n}", "private function getPaging($count, $limit, $offset) {\r\n\r\n $paging = array(\r\n 'count' => $count,\r\n 'startPage' => 1,\r\n 'nextPage' => 1,\r\n 'totalPage' => 0\r\n );\r\n if (count($this->restoFeatures) > 0) {\r\n \r\n $startPage = ceil(($offset + 1) / $limit);\r\n \r\n /*\r\n * Tricky part if count is estimate, then \r\n * the total count is the maximum between the database estimate\r\n * and the pseudo real count based on the retrieved features count\r\n */\r\n if (!$count['isExact']) {\r\n $count['total'] = max(count($this->restoFeatures) + (($startPage - 1) * $limit), $count['total']);\r\n }\r\n $totalPage = ceil($count['total'] / $limit);\r\n $paging = array(\r\n 'count' => $count,\r\n 'startPage' => $startPage,\r\n 'nextPage' => $startPage + 1,\r\n 'totalPage' => $totalPage\r\n );\r\n }\r\n return $paging;\r\n }", "function build_pagelinks($data)\n\t{\n\t\t$data['leave_out'] = isset($data['leave_out']) ? $data['leave_out'] : '';\n\t\t$data['no_dropdown'] = isset($data['no_dropdown']) ? intval( $data['no_dropdown'] ) : 0;\n\t\t$data['USE_ST']\t\t = isset($data['USE_ST'])\t? $data['USE_ST']\t : '';\n\t\t$work = array( 'pages' => 0, 'page_span' => '', 'st_dots' => '', 'end_dots' => '' );\n\t\t\n\t\t$section = !$data['leave_out'] ? 2 : $data['leave_out']; // Number of pages to show per section( either side of current), IE: 1 ... 4 5 [6] 7 8 ... 10\n\t\t\n\t\t$use_st = !$data['USE_ST'] ? 'st' : $data['USE_ST'];\n\t\t\n\t\t//-----------------------------------------\n\t\t// Get the number of pages\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( $data['TOTAL_POSS'] > 0 )\n\t\t{\n\t\t\t$work['pages'] = ceil( $data['TOTAL_POSS'] / $data['PER_PAGE'] );\n\t\t}\n\t\t\n\t\t$work['pages'] = $work['pages'] ? $work['pages'] : 1;\n\t\t\n\t\t//-----------------------------------------\n\t\t// Set up\n\t\t//-----------------------------------------\n\t\t\n\t\t$work['total_page'] = $work['pages'];\n\t\t$work['current_page'] = $data['CUR_ST_VAL'] > 0 ? ($data['CUR_ST_VAL'] / $data['PER_PAGE']) + 1 : 1;\n\t\t\n\t\t//-----------------------------------------\n\t\t// Next / Previous page linkie poos\n\t\t//-----------------------------------------\n\t\t\n\t\t$previous_link = \"\";\n\t\t$next_link = \"\";\n\t\t\n\t\tif ( $work['current_page'] > 1 )\n\t\t{\n\t\t\t$start = $data['CUR_ST_VAL'] - $data['PER_PAGE'];\n\t\t\t$previous_link = $this->compiled_templates['skin_global']->pagination_previous_link(\"{$data['BASE_URL']}&amp;$use_st=$start\");\n\t\t}\n\t\t\n\t\tif ( $work['current_page'] < $work['pages'] )\n\t\t{\n\t\t\t$start = $data['CUR_ST_VAL'] + $data['PER_PAGE'];\n\t\t\t$next_link = $this->compiled_templates['skin_global']->pagination_next_link(\"{$data['BASE_URL']}&amp;$use_st=$start\");\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Loppy loo\n\t\t//-----------------------------------------\n\t\t\n\t\tif ($work['pages'] > 1)\n\t\t{\n\t\t\t$work['first_page'] = $this->compiled_templates['skin_global']->pagination_make_jump($work['pages'], $data['no_dropdown']);\n\t\t\t\n\t\t\tif ( 1 < ($work['current_page'] - $section))\n\t\t\t{\n\t\t\t\t$work['st_dots'] = $this->compiled_templates['skin_global']->pagination_start_dots($data['BASE_URL']);\n\t\t\t}\n\t\t\t\n\t\t\tfor( $i = 0, $j= $work['pages'] - 1; $i <= $j; ++$i )\n\t\t\t{\n\t\t\t\t$RealNo = $i * $data['PER_PAGE'];\n\t\t\t\t$PageNo = $i+1;\n\t\t\t\t\n\t\t\t\tif ($RealNo == $data['CUR_ST_VAL'])\n\t\t\t\t{\n\t\t\t\t\t$work['page_span'] .= $this->compiled_templates['skin_global']->pagination_current_page( ceil( $PageNo ) );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif ($PageNo < ($work['current_page'] - $section))\n\t\t\t\t\t{\n\t\t\t\t\t\t// Instead of just looping as many times as necessary doing nothing to get to the next appropriate number, let's just skip there now\n\t\t\t\t\t\t$i = $work['current_page'] - $section - 2;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// If the next page is out of our section range, add some dotty dots!\n\t\t\t\t\t\n\t\t\t\t\tif ($PageNo > ($work['current_page'] + $section))\n\t\t\t\t\t{\n\t\t\t\t\t\t$work['end_dots'] = $this->compiled_templates['skin_global']->pagination_end_dots(\"{$data['BASE_URL']}&amp;$use_st=\".($work['pages']-1) * $data['PER_PAGE']);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$work['page_span'] .= $this->compiled_templates['skin_global']->pagination_page_link(\"{$data['BASE_URL']}&amp;$use_st={$RealNo}\", ceil( $PageNo ) );\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$work['return'] = $this->compiled_templates['skin_global']->pagination_compile($work['first_page'],$previous_link,$work['st_dots'],$work['page_span'],$work['end_dots'],$next_link,$data['TOTAL_POSS'],$data['PER_PAGE'], $data['BASE_URL'], $data['no_dropdown'], $use_st);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$work['return'] = $data['L_SINGLE'];\n\t\t}\n\t\n\t\treturn $work['return'];\n\t}", "public function getPage(array $params){\n if(array_key_exists('page', $params)){\n $page = $params['page'];\n } else {\n $page = 1;\n }\n return $page;\n }", "function printResultPages($currPage, $pageCount) {\n global $loc;\n $maxPg = 21;\n if ($currPage > 1) {\n echo \"<a href=\\\"javascript:changePage(\".H(addslashes($currPage-1)).\")\\\">&laquo;\".$loc->getText(\"mbrsearchprev\").\"</a> \";\n }\n for ($i = 1; $i <= $pageCount; $i++) {\n if ($i < $maxPg) {\n if ($i == $currPage) {\n if ($pageCount > 1) echo \"<b>\".H($i).\"</b> \";\n } else {\n echo \"<a href=\\\"javascript:changePage(\".H(addslashes($i)).\")\\\">\".H($i).\"</a> \";\n }\n } elseif ($i == $maxPg) {\n echo \"... \";\n }\n }\n if ($currPage < $pageCount) {\n echo \"<a href=\\\"javascript:changePage(\".($currPage+1).\")\\\">\".$loc->getText(\"mbrsearchnext\").\"&raquo;</a> \";\n }\n }", "public function getPage($pageNumber = 0);", "private function getPaginatorType1($current_page = 0, $total_pages = 2, $conditions = \"\", $condition_encode = false){\n \t\t\t\t$cuppa = Cuppa::getInstance();\n $language = $cuppa->language->load();\n if($total_pages <= 1) return \"\";\n \t\t\t\t$field = \"<div class='paginator'>\";\n \t\t\t\t\t$field .= \"<ul>\";\n \t\t\t\t\t\tif($current_page > 0) $field .= \"<li><a onclick='\".$this->function_name.\"(0, \\\"\".$this->submit_form.\"\\\",\\\"\".$this->limit.\"\\\")'><div title='First page' class='paging_far_left'></div></a></li>\";\n \t\t\t\t\t\tif($current_page > 0) $field .= \"<li><a onclick='\".$this->function_name.\"(\".($current_page-1).\", \\\"\".$this->submit_form.\"\\\",\\\"\".$this->limit.\"\\\")'><div title='Prev page' class='paging_left'></div></a></li>\";\n \t\t\t\t\t\tif($this->pages_info) $field .= \"<li><div title='' class='current_page'>\".$cuppa->language->getValue(\"Page\",$language).\" <b>\".(@$current_page+1).\"</b> / $total_pages</div></li>\";\n \t\t\t\t\t\tif($current_page < $total_pages-1) $field .= \"<li><a onclick='\".$this->function_name.\"(\".($current_page+1).\",\\\"\".$this->submit_form.\"\\\",\\\"\".$this->limit.\"\\\")'><div title='Next page' class='paging_right'></div></a></li>\";\n \t\t\t\t\t\tif($current_page < $total_pages-1) $field .= \"<li><a onclick='\".$this->function_name.\"(\".($total_pages-1).\",\\\"\".$this->submit_form.\"\\\",\\\"\".$this->limit.\"\\\")'><div title='Last page' class='paging_far_right'></div></a></li>\";\n \t\t\t\t\t\t$field .= \"<li><div class='select_page_div'>\".$this->getPagesList($current_page, $total_pages).\"</div></li>\";\n \t\t\t\t\t$field .= \"</ul>\"; \n \t\t\t\t\t$field .= \"<input type='hidden' value='\".$current_page.\"' id='page' name='page' />\";\n $field .= \"<input type='hidden' value='' id='page_item_start' name='page_item_start' />\";\n if($condition_encode) $field .= '<input type=\"hidden\" id=\"conditions\" name=\"conditions\" value=\"'.base64_encode($conditions).'\"/>';\n else $field .= '<input type=\"hidden\" id=\"conditions\" name=\"conditions\" value=\"'.$conditions.'\"/>';\n \t\t\t\t$field .= \"</div>\";\n \t\t\t\treturn $field;\n \t\t\t}", "function page_counter($page, $total_pages, $limit, $path, $pn = '', $style = array()) {\n if (!$style[3])\n $style[3] = 'btn btn-mini btn-inverse';\n if (!$style[4])\n $style[4] = 'pagination';\n if (!$style[2])\n $style[2] = 'btn btn-mini';\n $pattern = '/page_' . $pn . '=(.*?)[\\&]/';\n $path = preg_replace($pattern, \"\", $path);\n\n if ($total_pages >= $limit) {\n\n $adjacents = \"2\";\n if ($page)\n $start = ($page - 1) * $limit;\n else\n $start = 0;\n\n if ($page == 0)\n $page = 1;\n $prev = $page - 1;\n $next = $page + 1;\n $lastpage = ceil($total_pages / $limit);\n $lpm1 = $lastpage - 1;\n\n\n $pagination = \"\";\n if ($lastpage > 1) {\n $pagination .= \"<div class='$style[4]'>\";\n if ($page > 1)\n $pagination.= \"<a class='$style[2]' href='\" . $path . \"page_$pn=$prev'> &#171; </a>\";\n else\n $pagination.= \"<span class='disabled $style[2]'> &#171; </span>\";\n\n if ($lastpage < 7 + ($adjacents * 2)) {\n for ($counter = 1; $counter <= $lastpage; $counter++) {\n if ($counter == $page)\n $pagination.= \"<a href='\" . $path . \"page_$pn=$counter' class='$style[3]'>$counter</a>\";\n else\n $pagination.= \"<a class='$style[2]' href='\" . $path . \"page_$pn=$counter'>$counter</a>\";\n }\n }\n elseif ($lastpage > 5 + ($adjacents * 2)) {\n if ($page < 1 + ($adjacents * 2)) {\n for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++) {\n if ($counter == $page)\n $pagination.= \"<a href='\" . $path . \"page_$pn=$counter' class='$style[3]'>$counter</a>\";\n else\n $pagination.= \"<a class='$style[2]' href='\" . $path . \"page_$pn=$counter'>$counter</a>\";\n }\n $pagination.= \"...\";\n $pagination.= \"<a class='$style[2]' href='\" . $path . \"page_$pn=$lpm1'>$lpm1</a>\";\n $pagination.= \"<a class='$style[2]' href='\" . $path . \"page_$pn=$lastpage'>$lastpage</a>\";\n }\n elseif ($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2)) {\n $pagination.= \"<a class='$style[2]' href='\" . $path . \"page_$pn=1'>1</a>\";\n $pagination.= \"<a class='$style[2]' href='\" . $path . \"page_$pn=2'>2</a>\";\n $pagination.= \"...\";\n for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++) {\n if ($counter == $page)\n $pagination.= \"<a href='\" . $path . \"page_$pn=$counter' class='$style[3]'>$counter</a>\";\n else\n $pagination.= \"<a class='$style[2]' href='\" . $path . \"page_$pn=$counter'>$counter</a>\";\n }\n $pagination.= \"..\";\n $pagination.= \"<a class='$style[2]' href='\" . $path . \"page_$pn=$lpm1'>$lpm1</a>\";\n $pagination.= \"<a class='$style[2]' href='\" . $path . \"page=$lastpage'>$lastpage</a>\";\n }\n else {\n $pagination.= \"<a class='$style[2]' href='\" . $path . \"page_$pn=1'>1</a>\";\n $pagination.= \"<a class='$style[2]' href='\" . $path . \"page_$pn=2'>2</a>\";\n $pagination.= \"..\";\n for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++) {\n if ($counter == $page)\n $pagination.= \"<a href='\" . $path . \"page_$pn=$counter' class='$style[3]'>$counter</a>\";\n else\n $pagination.= \"<a class='$style[2]' href='\" . $path . \"page_$pn=$counter'>$counter</a>\";\n }\n }\n }\n\n if ($page < $counter - 1)\n $pagination.= \"<a class='$style[2]' href='\" . $path . \"page_$pn=$next'> &#187; </a>\";\n else\n $pagination.= \"<span class='disabled $style[2]'> &#187; </span>\";\n $pagination.= \"</div>\\n\";\n }\n return $pagination;\n }\n}", "function getPagelist($sql = '', $fields = array(), $mod = array())\n{\n $count = count(db(sql));\n $totalNum = ceil($count / PAGE_NUM);\n $path = $request_url['path'];\n\n $page = (isset($_GET['page']) && $_GET['page'] != '') ? $_GET['page'];\n// 组装limit语句\n $limit = 'LIMIT' . ($page - 1) * PAGE_NUM . ',' . PAGE_NUM;\n $datas = db($sql, $limit);\n $html = getTable($datas, $fields, $mod);\n $start = ($page - PAGE_OFFSET) > 0 ? $page - PAGE_OFFSET : 1;//获取左侧位置的偏移\n $end = ($page + PAGE_OFFSET) < $totalNum ? $page + PAGE_OFFSET : $totalNum;\n $html .= '<div class=\"page\">';\n if ($page > 1) {\n $html .= '<a href=\"' . $path . '?page=' . ($page - 1) . '\">上一页</a>';\n $html .= '<a href=\"' . $path . '?page=1\">首页</a>';\n }\n for($i = $start;$i<=$end;$i++)\n {\n $class = ($i==$page)?'class=\"on\"':'';\n $html .='<a href =\"'.$path.'?page='.$i.'\"'.$class.'>'.$i.'</a>';\n\n\n }\n if ($page < $totalNum) {\n ;\n $html .= '<a href=\"' . $path . '?page='.$totalNum.'\">尾页</a>';\n $html .= '<a href=\"' . $path . '?page='.($page+1).'\">下一页</a>';\n }\n $html .='共'.$totalNum.'页';\n $html .='</div>';\n return $html;\n}", "function displayPaging() \r\n {\r\n $self = $_SERVER['PHP_SELF'];\r\n if($this->openPage<=0) {\r\n $next = 2;\r\n }\r\n\r\n else {\r\n $next = $this->openPage+1;\r\n }\r\n $prev = $this->openPage-1;\r\n $last = $this->pages;\r\n\t\t$queryString = '';\r\n\t\t\r\n\t\tif ($_GET['keywords']!= '') {\r\n\t\t\t$queryString .= '&keywords='.$_GET['keywords'];\r\n\t\t}\r\n\t\t\r\n\t\tif ($_GET['sort'] != '') {\r\n\t\t\t$queryString .= '&sort='.$_GET['sort'];\r\n\t\t}\r\n\t\t\r\n\t\tif ($_GET['filters']!='') {\r\n\t\t\t$queryString .= '&filters='.$_GET['filters'];\r\n\t\t}\r\n\t\t\t\t\t\r\n\t\tif ($_GET['cat']!='') {\r\n\t\t\t$queryString .= '&cat='.$_GET['cat'];\r\n\t\t}\r\n\t\t\r\n\t\tif ($_GET['media']!='') {\r\n\t\t\t$queryString .= '&media='.$_GET['media'];\r\n\t\t}\r\n\t\tif ($_GET['content']!='') {\r\n\t\t\t$queryString .= '&content='.$_GET['content'];\r\n\t\t}\r\n\t\tif ($_GET['genre']!='') {\r\n\t\t\t$queryString .= '&genre='.$_GET['genre'];\r\n\t\t}\r\n\r\n if($this->openPage > 1) {\r\n echo \",<a href=\\\"\".$_SERVER['SCRIPT_NAME'].\"?page=1\".$queryString.\"\\\">\";\r\n\t\t\t\t\t\r\n\t\t\t\r\n\t\t\techo \"First</a><span style='color:#e5e5e5; padding-left:2px;padding-right:2px;'>|</span>\";\r\n \techo \",<a href=\\\"\".$_SERVER['SCRIPT_NAME'].\"?page=$prev\".$queryString.\"\\\">\";\r\n\t\t\t\t\t\r\n\t\t\techo \"Prev</a>]&nbsp;&nbsp;\";\r\n }\r\n else {\r\n echo \"[First<span style='color:#e5e5e5; padding-left:2px;padding-right:2px;'>|</span>\";\r\n echo \"Prev]&nbsp;&nbsp;\";\r\n }\r\n for($i=1;$i<=$this->pages;$i++) {\r\n if($i == $this->openPage) \r\n\t\t\t\tif ($i==1)\r\n \techo \"$i\";\r\n\t\t\t\telse \r\n\t\t\t\t\t echo \", $i\";\r\n else\r\n\t\t\tif ($i==1) {\r\n \t\techo \",<a href=\\\"\".$_SERVER['SCRIPT_NAME'].\"?page=$i\".$queryString.\"\\\">$i</a>\";\r\n\t\t\t\t}else{ \r\n \t\techo \",<a href=\\\"\".$_SERVER['SCRIPT_NAME'].\"?page=$i\".$queryString.\"\\\">$i</a>\";\r\n } }\r\n if($this->openPage < $this->pages) {\r\n echo \",<a href=\\\"\".$_SERVER['SCRIPT_NAME'].\"?page=$next\".$queryString.\"\\\">Next</a><span style='color:#e5e5e5; padding-left:2px;padding-right:2px;'>|</span>\";\r\n echo \",<a href=\\\"\".$_SERVER['SCRIPT_NAME'].\"?page=$last\".$queryString.\"\\\">Last</a>]\";\r\n }\r\n else {\r\n echo \"&nbsp;&nbsp;[Next<span style='color:#e5e5e5; padding-left:2px;padding-right:2px;'>|</span>\";\r\n echo \"Last]\";\r\n } \r\n }", "public function pagination( $params = array() )\n\t{\n\t\t$controller = Zend_Controller_Front::getInstance()->getRequest()->getControllerName();\n\t\t$action = Zend_Controller_Front::getInstance()->getRequest()->getActionName();\n\n\n\t\t$limit = $params['limit'];\n\t\t$page = ( $params['page'] <= 0 ) ? 1 : $params['page'];\n\n\t\t$total_pages = ceil( $params['total'] / $limit );\n\n\t\t$start_page = ( ( $page - 5 ) < 1 ) ? 1 : $page - 5;\n\t\t$end_page = ( ( $start_page + 10 ) > $total_pages ) ? $total_pages : $start_page + 10;\n\n\t\t$next_page = ( $page < $total_pages ) ? $page + 1 : $total_pages;\n\t\t$back_page = ( $page > 1 ) ? $page - 1 : $start_page;\n\n\t\t$current_page = $start_page;\n\n\t\t$get_params = isset( $params['getParams'] ) ? $params['getParams'] : null;\n\n\t\tif ( defined( 'TWITTER_BOOTSTRAP' ) ) {\n\t\t\t$output = '<div class=\"pagination pagination-centered\"><ul>';\n\n\t\t\tif ( $page > 1 ) {\n\t\t\t\t$output .= \"<li class=''><a href='\" . $this->view->url( array( 'controller' => $controller, 'action' => $action, 'page' => 1 ), null, TRUE ) . \"$get_params' title='Primeiro'>&laquo;</a></li>\";\n\t\t\t\t$output .= \"<li class=''><a href='\" . $this->view->url( array( 'controller' => $controller, 'action' => $action, 'page' => $back_page ), null, TRUE ) . \"$get_params' title='Anterior'>&lt;</a></li>\";\n\t\t\t} else {\n\t\t\t\t$output .= \"<li class='disabled'><a href='#'>&laquo;</a></li>\";\n\t\t\t\t$output .= \"<li class='disabled'><a href='#'>&lt;</a></li>\";\n\t\t\t}\n\n\t\t\twhile ( $current_page <= $end_page ) {\n\t\t\t\tif ( $current_page != $page ) {\n\t\t\t\t\t$output .= \"<li class=''><a href='\" . $this->view->url( array( 'controller' => $controller, 'action' => $action, 'page' => $current_page ), null, TRUE ) . \"$get_params'>$current_page</a></li>\";\n\t\t\t\t} else {\n\t\t\t\t\t$output .= \"<li class='active'><a href='#'>$current_page</a></li>\";\n\t\t\t\t}\n\t\t\t\t$current_page++;\n\t\t\t}\n\n\t\t\tif ( $page != $total_pages ) {\n\t\t\t\t$output .= \"<li class=''><a href='\" . $this->view->url( array( 'controller' => $controller, 'action' => $action, 'page' => $next_page ), null, TRUE ) . \"$get_params' title='Próximo'>&gt;</a></li>\";\n\t\t\t\t$output .= \"<li class=''><a href='\" . $this->view->url( array( 'controller' => $controller, 'action' => $action, 'page' => $total_pages ), null, TRUE ) . \"$get_params' title='Último'>&raquo;</a></li>\";\n\t\t\t} else {\n\t\t\t\t$output .= \"<li class='disabled'><a href='#'>&gt;</a></li>\";\n\t\t\t\t$output .= \"<li class='disabled'><a href='#'>&raquo;</a></li>\";\n\t\t\t}\n\n\t\t\t$output .= '</ul></div>';\n\t\t} else {\n\t\t\t$output = '<div id=\"pagination\">';\n\n\t\t\tif ( $page > 1 ) {\n\t\t\t\t$output .= \"<a href='\" . $this->view->url( array( 'controller' => $controller, 'action' => $action, 'page' => 1 ), null, TRUE ) . \"$get_params' title='Primeiro'><img width='14' src='\" . INCLUDE_PATH . \"/img/first.png'/></a>\" . \" \";\n\t\t\t\t$output .= \"<a href='\" . $this->view->url( array( 'controller' => $controller, 'action' => $action, 'page' => $back_page ), null, TRUE ) . \"$get_params' title='Anterior'><img width='16' src='\" . INCLUDE_PATH . \"/img/previous.png'/></a>\" . \" \";\n\t\t\t}\n\n\t\t\twhile ( $current_page <= $end_page ) {\n\t\t\t\tif ( $current_page != $page ) {\n\t\t\t\t\t$output .= \"<a href='\" . $this->view->url( array( 'controller' => $controller, 'action' => $action, 'page' => $current_page ), null, TRUE ) . \"$get_params'>$current_page</a>\" . \" \";\n\t\t\t\t} else {\n\t\t\t\t\t$output .= \"<strong>[\" . $page . \"]</strong> \";\n\t\t\t\t}\n\n\t\t\t\t$current_page++;\n\t\t\t}\n\n\t\t\tif ( $page != $total_pages ) {\n\t\t\t\t$output .= \"<a href='\" . $this->view->url( array( 'controller' => $controller, 'action' => $action, 'page' => $next_page ), null, TRUE ) . \"$get_params' title='Próximo'><img width='16' src='\" . INCLUDE_PATH . \"/img/next.png'/></a>\" . \" \";\n\t\t\t\t$output .= \"<a href='\" . $this->view->url( array( 'controller' => $controller, 'action' => $action, 'page' => $total_pages ), null, TRUE ) . \"$get_params' title='Último'><img width='14' src='\" . INCLUDE_PATH . \"/img/last.png'/></a>\" . \" \";\n\t\t\t}\n\n\t\t\t$output .= '</div>';\n\t\t}\n\n\t\treturn $output;\n\t}", "function pi_list_browseresults($showResultCount = 1, $divParams = '', $spacer = false, $total_bodycount = 0) {\n\t\t\t// Initializing variables:\n\t\t$pointer = intval($this->piVars['pointer']);\n\t\t$count = $this->internal['res_count'];\n\t\t$results_at_a_time = t3lib_div::intInRange($this->internal['results_at_a_time'],1,1000);\n\t\t$maxPages = t3lib_div::intInRange($this->internal['maxPages'],1,100);\n\n\t\t$pR1 = $pointer * $results_at_a_time + 1;\n\t\t$pR2 = $pointer * $results_at_a_time + $results_at_a_time;\n\n\t\t$max = t3lib_div::intInRange(ceil($count/$results_at_a_time), 1, $maxPages);\n\n\n\t\t$links=array();\n\n\t\t\t// Make browse-table/links:\n\t\tif ($this->pi_alwaysPrev>=0) {\n\t\t\tif ($pointer > 0) {\n\t\t\t\t$links[] = $this->pi_linkTP_keepPIvars($this->pi_getLL('pi_list_browseresults_prev','< Previous',TRUE),array('pointer'=>($pointer-1 ? $pointer-1 : '')), 1);\n\t\t\t} elseif ($this->pi_alwaysPrev) {\n\t\t\t\t$links[] = $this->pi_getLL('pi_list_browseresults_prev','< Previous',TRUE);\n\t\t\t}\n\t\t}\n\n\t\tif ($max > 1) {\n\t\t\tif ($pointer >= $maxPages - 2) {\n\t\t\t\t$a = (integer) ($pointer - ($maxPages/2));\n\t\t\t} else {\n\t\t\t\t$a = 0;\n\t\t\t}\n\t\t\tif ($a < 0) {\n\t\t\t\t$a = 0;\n\t\t\t}\n\t\t\t// in order to have a correct value for $max we must include the value of the actual $pointer in the calculation\n\t\t\tfor($i=0; $i<$max; $i++) {\n\t\t\t\t$temp_links = array();\n\t\t\t\t// check that the starting point (equivalent of $pR1) doesn't exceed the total $count\n\t\t\t\tif($a * $results_at_a_time + 1 > $count){\n\t\t\t\t\t$i = $max; //quitt!!!\n\t\t\t\t}else{\n\t\t\t\t\t$temp_links[] = '';\n\t\t\t\t\t//beginning:\n\t\t\t\t\tif($pointer == $a){\n\t\t\t\t\t\t$temp_links[] .= '<span '.$this->pi_classParam('browsebox-SCell').'><strong>';\n\t\t\t\t\t}\n\t\t\t\t\t$temp_links[] .= $this->pi_linkTP_keepPIvars(trim($this->pi_getLL('pi_list_browseresults_page', 'Page', TRUE).' '.($a + 1)), array('pointer' => ( $a ? $a : '' )), 1);\n\t\t\t\t\t//ending:\n\t\t\t\t\tif($pointer == $a){\n\t\t\t\t\t\t$temp_links[] .= '</strong></span>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$a++;\n\t\t\t\t$links[] = implode('', $temp_links);\n\t\t\t}// end foreach\n\t\t}// end if max\n\n\t\t// neither $pointer nor the number-link ($a) must exceed the result of the calculation below!\n\t\tif ($pointer < ceil($count/$results_at_a_time)-1) {\n\t\t\t$links[] = $this->pi_linkTP_keepPIvars($this->pi_getLL('pi_list_browseresults_next','Next >',TRUE), array('pointer' => $pointer+1),1);\n\t\t}\n\t$sBox = '';\n\n\t\t$sBox .= '<!-- List browsing box: -->\n\t\t\t\t\t<div'.$this->pi_classParam('browsebox').'>';\n\t\tif($showResultCount){\n\t\t\t$sBox .= '<p>'; //paragraph for 'elements 1 to 20'\n\t\t\tif($this->internal['res_count']){\n\t\t\t\t$from_number = $this->internal['res_count'] > 0 ? $pR1 : 0;\n\t\t\t\t$to_number = min(array($this->internal['res_count'], $pR2));\n\n\n\t\t\t\t// don't know why I need this, found out by trial and error\n\t\t\t\tif($total_bodycount > 0 && !$this->piVars['char']){\n\t\t\t\t\t$to_number -= $total_bodycount;\n\t\t\t\t}\n\n\t\t\t\t$sBox .= sprintf(\n str_replace(\n\t\t\t\t\t\t\t\t\t\t\t'###SPAN_BEGIN###',\n\t\t\t\t\t\t\t\t\t\t\t'<span'.$this->pi_classParam('browsebox-strong').'>',\n\t\t\t\t\t\t\t\t\t\t\t$this->pi_getLL('pi_list_browseresults_displays', 'Displaying results ###SPAN_BEGIN###%s to %s</span> out of ###SPAN_BEGIN###%s</span>')\n\t\t\t\t\t\t\t\t\t\t),\n $from_number,\n\t\t\t\t\t\t\t\t\t\t//to (must substract local_bodycount here!!!)\n $to_number,\n //of a total of\n $this->internal['res_count']\n );\n\n\n\n\t\t\t}else{\n\t\t\t\t$sBox .= $this->pi_getLL('pi_list_browseresults_noResults','Sorry, no items were found.');\n\t\t\t}\n\t\t\t$sBox .= '</p>';\n\t\t}\n\t\t$sBox .= '<'.trim('p '.$divParams).'>'.implode($spacer, $links).'</p>';\n\t\t$sBox .= '</div>';\n\t\treturn $sBox;\n\t}", "function getPagingfront($refUrl, $aryOpts, $pgCnt, $curPg) {\n $return = '';\n $return.='<div class=\"pagination\"><ul>';\n if ($curPg > 1) {\n $aryOpts['pg'] = 1;\n $return.='<li class=\"prev\"><a href=\"' . $refUrl . getQueryString($aryOpts) . '\">First</a></li>';\n\n $aryOpts['pg'] = $curPg - 1;\n $return.='<li class=\"prev\"><a href=\"' . $refUrl . getQueryString($aryOpts) . '\">Prev</a></li>';\n }\n for ($i = 1; $i <= $pgCnt; $i++) {\n $aryOpts['pg'] = $i;\n $return.='<li><a href=\"' . $refUrl . getQueryString($aryOpts) . '\" class=\"graybutton pagelink';\n if ($curPg == $i)\n $return.=' active';\n $return.='\" >' . $i . '</a></li>';\n }\n if ($curPg < $pgCnt) {\n $aryOpts['pg'] = $curPg + 1;\n $return.='<li class=\"prev\"><a href=\"' . $refUrl . getQueryString($aryOpts) . '\">Next</a></li>';\n $aryOpts['pg'] = $pgCnt;\n $return.='<li class=\"prev\"><a href=\"' . $refUrl . getQueryString($aryOpts) . '\">Last</a></li>';\n }\n $return.='</ul></div>';\n return $return;\n}", "protected function createPageDepthOptions() {}", "function paginate($page=1,$limit=16)\n{\n $limit = $limit ? : 16;\n $skip = ($page ? $page-1 :0) * $limit;\n return [$limit,$skip];\n}", "public function getPagerStructure($destinationPage, $numberOfPages, $additionalParams = array())\r\n {\r\n $destinationPage = !empty($destinationPage) ? $destinationPage : 1;\r\n $pagesStructure = array();\r\n $baseFile = Shopware()->Config()->get('sBASEFILE');\r\n if ($numberOfPages > 1) {\r\n for ($i = 1; $i <= $numberOfPages; $i++) {\r\n $pagesStructure[\"numbers\"][$i][\"markup\"] = ($i == $destinationPage);\r\n $pagesStructure[\"numbers\"][$i][\"value\"] = $i;\r\n $pagesStructure[\"numbers\"][$i][\"link\"] = $baseFile . $this->moduleManager->Core()->sBuildLink(\r\n $additionalParams + array(\"sPage\" => $i),\r\n false\r\n );\r\n }\r\n // Previous page\r\n if ($destinationPage != 1) {\r\n $pagesStructure[\"previous\"] = $baseFile . $this->moduleManager->Core()->sBuildLink(\r\n $additionalParams + array(\"sPage\" => $destinationPage - 1),\r\n false\r\n );\r\n } else {\r\n $pagesStructure[\"previous\"] = null;\r\n }\r\n // Next page\r\n if ($destinationPage != $numberOfPages) {\r\n $pagesStructure[\"next\"] = $baseFile . $this->moduleManager->Core()->sBuildLink(\r\n $additionalParams + array(\"sPage\" => $destinationPage + 1),\r\n false\r\n );\r\n } else {\r\n $pagesStructure[\"next\"] = null;\r\n }\r\n }\r\n return $pagesStructure;\r\n }", "protected function getSetupPerPageOptions()\n {\n $perPageOptions = [20, 40, 80, 100, 120];\n if (!in_array($this->recordsPerPage, $perPageOptions)) {\n $perPageOptions[] = $this->recordsPerPage;\n }\n\n sort($perPageOptions);\n return $perPageOptions;\n }", "final public static function getParams()\n {\n $param = self::getUrl();\n\n $y=0;while($y <= 2){\n unset($param[$y]);\n $y++;\n }\n\n foreach($param as $t ){\n $p[] = array($t);\n }\n\n $r=0;\n while($r <= count($p)){\n\n $par[$p[$r][0]] = $p[$r + 1][0];\n\n $r += 2;\n }\n\n return array_filter($par);\n }", "function getPagingInfo($sql,$input_arguments=null);", "function paginateWithExtra($size = 15);", "public function generatePagination()\n {\n $this->buffer = [];\n\n if ($this->currentPage != 1) {\n $this->generateLeftButton($this->currentPage);\n } else {\n $this->generateLeftButton($this->currentPage, true);\n }\n\n $this->generatePages();\n\n if ($this->currentPage != self::getPages($this->records, $this->recordsInPage)) {\n $this->generateRightButton($this->currentPage);\n } else {\n $this->generateLeftButton($this->currentPage, true);\n }\n }", "public function get_pagination_args() {\n\t\tif ( ! empty( $this->pagination_args ) ) {\n\t\t\treturn $this->pagination_args;\n\t\t}\n\n\t\t$this->pagination_args = array(\n\t\t\t'total_items' => (int) $this->found,\n\t\t\t'per_page' => $this->query_args['limit'],\n\t\t\t'total_pages' => ceil( $this->found / $this->query_args['limit'] ),\n\t\t);\n\n\t\treturn $this->pagination_args;\n\t}", "public static function get_page_items_parameters() {\n return new external_function_parameters (\n array(\n 'feedbackid' => new external_value(PARAM_INT, 'Feedback instance id'),\n 'page' => new external_value(PARAM_INT, 'The page to get starting by 0'),\n 'courseid' => new external_value(PARAM_INT, 'Course where user completes the feedback (for site feedbacks only).',\n VALUE_DEFAULT, 0),\n )\n );\n }", "function pagination($sql_pagination,$num_results_per_page){\n\tglobal $paginate, $result, $pageQuery;\t\n\t$targetpage = htmlspecialchars($_SERVER['PHP_SELF'] );\n\t$qs =\t'';\n\tif (!empty($_SERVER['QUERY_STRING'])) {\n\t\t$parts = explode(\"&\", $_SERVER['QUERY_STRING']);\n\t\t$newParts = array();\n\t\tforeach ($parts as $val) {\n\t\t\tif (stristr($val, 'page') == false) {\n\t\t\t\tarray_push($newParts, $val);\n\t\t\t}\n\t\t}\n\t\tif (count($newParts) != 0) {\n\t\t\t$qs = \"&\".implode(\"&\", $newParts);\n\t\t} \n\t}\n\t\n\t$limit = $num_results_per_page; \n\t$query = $sql_pagination;\n\t$total_pages = mysql_query($query);\n\t$counts\t\t=\tmysql_num_rows($total_pages);\t\n\t$total_pages = $counts;\n\t$lastpage = ceil($total_pages/$limit);\t\t\n\t$LastPagem1 = $lastpage - 1;\t\n\t$stages = 2;\n\t$page = mysql_real_escape_string($_GET['page']);\n\tif($page){\n\t\t$start = ($page - 1) * $limit; \n\t}else{\n\t\t$start = 0;\t\n\t\t}\n\t\n // Get page data\n\t$pageQuery = $query.\" limit $start,$limit\";\n\t//$result = mysql_query($pageQuery);\n\t\n\t// Initial page num setup\n\tif ($page == 0){$page = 1;}\n\t$prev = $page - 1;\t\n\t$next = $page + 1;\t\t\t\t\t\t\t\n\t\n\t\n\t$paginate = '';\n\tif($lastpage > 1)\n\t{\t\n\t\t$paginate .= \"<div class='paginate'>\";\n\t\t// Previous\n\t\tif ($page > 1){\n\t\t\t$paginate.= \"<a href='$targetpage?page=$prev$qs'>previous</a>\";\n\t\t}else{\n\t\t\t$paginate.= \"<span class='disabled'>previous</span>\";\t}\n\t\t\n\t\t// Pages\t\n\t\tif ($lastpage < 7 + ($stages * 2))\t// Not enough pages to breaking it up\n\t\t{\t\n\t\t\tfor ($counter = $lastpage; $counter >= 1; $counter--)\n\t\t\t{\n\t\t\t\tif ($counter == $page){\n\t\t\t\t\t$paginate.= \"<span class='current'>$counter</span>\";\n\t\t\t\t}else{\n\t\t\t\t\t$paginate.= \"<a href='$targetpage?page=$counter$qs'>$counter</a>\";}\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telseif($lastpage > 5 + ($stages * 2))\t// Enough pages to hide a few?\n\t\t{\n\t\t\t// Beginning only hide later pages\n\t\t\tif($page < 1 + ($stages * 2))\t\t\n\t\t\t{\n\t\t\t\t$paginate.= \"<a href='$targetpage?page=$lastpage$qs'>$lastpage</a>\";\n\t\t\t\t$paginate.= \"<a href='$targetpage?page=$LastPagem1$qs'>$LastPagem1</a>\";\n\t\t\t\t$paginate.= \"...\";\n\t\t\t\tfor ($counter = 4 + ($stages * 2); $counter >= 1; $counter--)\n\t\t\t\t{\n\t\t\t\t\tif ($counter == $page){\n\t\t\t\t\t\t$paginate.= \"<span class='current'>$counter</span>\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$paginate.= \"<a href='$targetpage?page=$counter$qs'>$counter</a>\";}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t}\n\t\t\t// Middle hide some front and some back\n\t\t\telseif($lastpage - ($stages * 2) > $page && $page > ($stages * 2))\n\t\t\t{\n\t\t\t\t$paginate.= \"<a href='$targetpage?page=$lastpage$qs'>$lastpage</a>\";\n\t\t\t\t$paginate.= \"<a href='$targetpage?page=$LastPagem1$qs'>$LastPagem1</a>\";\n\t\t\t\t$paginate.= \"...\";\n\t\t\t\tfor ($counter =$page + $stages; $counter <= $page - $stages; $counter--)\n\t\t\t\t{\n\t\t\t\t\tif ($counter == $page){\n\t\t\t\t\t\t$paginate.= \"<span class='current'>$counter</span>\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$paginate.= \"<a href='$targetpage?page=$counter$qs'>$counter</a>\";}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t$paginate.= \"...\";\t\n\t\t\t\t$paginate.= \"<a href='$targetpage?page=2$qs'>2</a>\";\n\t\t\t\t$paginate.= \"<a href='$targetpage?page=1$qs'>1</a>\";\n\t\t\t\t\n\t\t\t}\n\t\t\t// End only hide early pages\n\t\t\telse\n\t\t\t{\n\t\t\t\t\n\t\t\t\tfor ($counter =$lastpage; $counter >= $lastpage - (2 + ($stages * 2)) ; $counter--)\n\t\t\t\t{\n\t\t\t\t\tif ($counter == $page){\n\t\t\t\t\t\t$paginate.= \"<span class='current'>$counter</span>\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$paginate.= \"<a href='$targetpage?page=$counter$qs'>$counter</a>\";}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t$paginate.= \"...\";\n\t\t\t\t$paginate.= \"<a href='$targetpage?page=2$qs'>2</a>\";\n\t\t\t\t$paginate.= \"<a href='$targetpage?page=1$qs'>1</a>\";\n\t\t\t}\n\t\t}\n\t\t\t\t\t\n\t\t\t\t// Next\n\t\tif ($page < $counter - 1){ \n\t\t\t$paginate.= \"<a href='$targetpage?page=$next$qs'>next</a>\";\n\t\t}else{\n\t\t\t$paginate.= \"<span class='disabled'>next</span>\";\n\t\t\t}\n\t\t\t\n\t\t$paginate.= \"</div>\";\t\t\n\t\n\t\n}\n //echo $total_pages.'Results';\n // pagination\n $paginate;\n}", "function set_pagination(){\n\t\tif ($this->rpp>0)\n\t\t{\n\t\t\t$compensation= ($this->num_rowset % $this->rpp)>0 ? 1 : 0;\n\t\t\t$num_pages = (int)($this->num_rowset / $this->rpp) + $compensation;\n\t\t} else {\n\t\t\t$compensation = 0;\n\t\t\t$num_pages = 1;\n\t\t}\n\n\t\tif ($num_pages>1){\n\t\t\t$this->tpl->add(\"pagination\", \"SHOW\", \"TRUE\");\n\n\t\t\tfor ($i=0; $i<$num_pages; $i++){\n\t\t\t\t$this->tpl->add(\"page\", array(\n\t\t\t\t\t\"CLASS\"\t=> \"\",\n\t\t\t\t\t\"VALUE\"\t=> \"\",\n\t\t\t\t));\n\t\t\t\t$this->tpl->parse(\"page\", true);\n\t\t\t}\n\t\t}\n/*\n\t\t\t<patTemplate:tmpl name=\"pagination\" type=\"simplecondition\" requiredvars=\"SHOW\">\n\t\t\t<div class=\"pagination\">\n\t\t\t\t<ul>\t\n\t\t\t\t\t<patTemplate:tmpl name=\"prev_page\" type=\"simplecondition\" requiredvars=\"SHOW\">\n\t\t\t\t\t<li class=\"disablepage\"><a href=\"javascript: return false;\">« Предишна</a></li>\n\t\t\t\t\t</patTemplate:tmpl>\n\t\t\t\t\t<patTemplate:tmpl name=\"page\">\n\t\t\t\t\t<li {CLASS}>{VALUE}</li>\n\t\t\t\t\t</patTemplate:tmpl>\n<!--\n\t\t\t\t\t<li class=\"currentpage\">1</li>\n\t\t\t\t\t<li><a href=\"?page=1&sort=date&type=desc\">2</a></li>\n\t\t\t\t\t<li><a href=\"?page=2&sort=date&type=desc\">3</a></li>\n//-->\n\t\t\t\t\t<patTemplate:tmpl name=\"next_page\" type=\"simplecondition\" requiredvars=\"SHOW\">\n\t\t\t\t\t<li><a href=\"?page=1&sort=date&type=desc\">Следваща »</a></li>\n\t\t\t\t\t</patTemplate:tmpl>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t\t</patTemplate:tmpl>\n*/\n\t}", "function getPages() {\r\n\tglobal $S;\r\n\tif (!is_array($S->arbo)) {\r\n\t\trequire_once('../lib/class/class_arbo.php');\r\n\t\t$S =& new ARBO();\r\n\t\t$S->fields = array('id', 'pid', 'type_id', 'titre_fr');\r\n\t\t$S->buildArbo();\r\n\t}\r\n\t$options = array();\r\n\tforeach($S->arbo as $rid=>$tmp) {\r\n\t\t$options[urlencode($S->arbo[$rid]['url'])] = $S->arbo[$rid]['titre_fr'].' (#'.$rid.')';\r\n\t}\r\n\treturn $options;\r\n}", "public function getPages();", "private function getPaginationProperties(): array\n {\n return [\n 'page' => [\n 'group' => Plugin::LOCALIZATION_KEY . 'components.post_list_abstract.pagination_group',\n 'title' => Plugin::LOCALIZATION_KEY . 'components.post_list_abstract.page_parameter_title',\n 'description' => Plugin::LOCALIZATION_KEY . 'components.post_list_abstract.page_parameter_description',\n 'default' => '{{ :page }}',\n 'type' => 'string',\n ],\n 'resultsPerPage' => [\n 'group' => Plugin::LOCALIZATION_KEY . 'components.post_list_abstract.pagination_group',\n 'title' => Plugin::LOCALIZATION_KEY . 'components.post_list_abstract.pagination_per_page_title',\n 'description' => Plugin::LOCALIZATION_KEY . 'components.post_list_abstract.pagination_per_page_description',\n 'default' => 10,\n 'type' => 'string',\n 'validationPattern' => '^(0+)?[1-9]\\d*$',\n 'validationMessage' => Plugin::LOCALIZATION_KEY . 'components.post_list_abstract.pagination_validation_message',\n 'showExternalParam' => false,\n ]\n ];\n }", "private function generatePages()\n {\n $all_pages = self::getPages($this->records, $this->recordsInPage);\n $total = 0;\n $start = 1;\n while ($total < $all_pages) {\n $shift = $this->getShift();\n $paging_start = $total < $this->getLeftShift() ? true : false;\n $paging_end = $total >= ($all_pages - $this->getRightShift()) ? true : false;\n\n if ($this->currentPage == $start) {\n $this->appendData(sprintf('<li class=\"active\"><span>%d</span></li>', $start));\n }\n elseif ($paging_start|| $paging_end) {\n $this->appendData(sprintf('<li><a href=\"%s%d\">%d</a></li>', $this->url, $start, $start));\n }\n elseif (($this->currentPage == $start - $shift) || ($this->currentPage == $start + $shift)) {\n $this->appendData('<li><span>...</span></li>');\n }\n $total++;\n $start++;\n }\n }", "public function Pages($params = array())\n\t{\n\t\t//设置默认参数\n\t\t$_defaults_params = array(\n\t\t\t'allow_cache' => true,\n\t\t\t'page' => isset($_GET['page']) ? intval($_GET['page']) : 1,\n\t\t\t'pagesize' => 10,\n\t\t);\n\t\t$params = array_merge($_defaults_params, $params);\n\t\t\n\t\t//有开启缓存功能,则从缓存中取数据, 如果有数据,则直接返回结果\n\t\tif($params['allow_cache'] && isset($this->cache)) {\n\t\t\t$cache_key = 'collect.model.pages.' . serialize($params);\n\t\t\t$ret = $this->cache->get($cache_key);\n\t\t\t\n\t\t\tif($ret && is_array($ret)) {\n\t\t\t\treturn $ret;\n\t\t\t}\n\t\t}\n \n\t\t//添加条件\n\t\t$builds = array(\n 'select' => 'COUNT(`u`.`collect_model_id`) AS `COUNT`',\n 'from' => array('{{collect_model}}', 'u')\n );\n\t\tif(isset($params['collect_model_status']) && !empty($params['collect_model_status'])) {\n\t\t\t$builds['where'] = array('AND', '`collect_model_status`=:collect_model_status');\n\t\t\t$sql_params[':collect_model_status'] = $params['collect_model_status'];\n\t\t} else {\n\t\t\t$builds['where'] = array('AND', '`collect_model_status`>:collect_model_status');\n\t\t\t$sql_params[':collect_model_status'] = 0;\n\t\t}\n\t\t//\n\t\tif(isset($params['collect_model_id']) && !empty($params['collect_model_id'])) {\n\t\t\t$builds['where'][] = array('AND', '`u`.`collect_model_id`=:collect_model_id');\n\t\t\t$sql_params[':collect_model_id'] = $params['collect_model_id'];\n\t\t}\n\t\t//\n\t\tif(isset($params['collect_model_name']) && !empty($params['collect_model_name'])) {\n\t\t\t$builds['where'][] = array(\n 'LIKE',\n '`u`.`collect_model_name`',\n ':collect_model_name'\n );\n\t\t\t$sql_params[':collect_model_name'] = $params['collect_model_name'];\n\t\t}\n\t\t//\n\t\t//\n\t\tif(isset($params['searchKey']) && $params['searchKey']) {\n\t\t\t$builds['where'][] = array(\n 'LIKE',\n '`u`.`collect_model_name`',\n ':searchKey'\n );\n\t\t\t$sql_params[':searchKey'] = $params['searchKey'];\n\t\t}\n\t\t\n //$command = $this->db->createCommand();\n $sql = $this->buildQuery($builds);\n\t\t\n\t\t//统计数量\n $count = $this->db->queryScalar($sql, $sql_params);\n\t\t\n\t\t//分页处理\n\t\t$pages = new CPagination($count);\n\t\t\n\t\t//设置分页大小\n\t\t$pages->pageSize = $params['pagesize'];\n\t\t\n\t\tif(isset($params['orderby']) && $params['orderby']) {\n\t\t\t$builds['order'] = $params['orderby'];\n\t\t} else {\n $builds['order'] = array(\n\t\t\t\t\t'`u`.`collect_model_rank` ASC',\n\t\t\t\t\t'`u`.`collect_model_id` DESC',\n\t\t\t\t);\n\t\t}\n \n $builds['select'] = '`u`.`collect_model_id`, `u`.`collect_model_name`, `u`.`collect_model_identify`, `u`.`collect_model_rank`, `u`.`collect_model_lasttime`, `u`.`collect_model_dateline`, `u`.`content_model_id`, `c`.`content_model_name`';\n $builds['leftJoin'] = array(\n '{{content_model}}', 'c', '`c`.`content_model_id`=`u`.`content_model_id`'\n );\n $pages->applyLimit($builds);\n $sql = $this->buildQuery($builds);\n\t\t$ret['pages'] = $pages;\n\t\t$ret['rows'] = $this->db->queryAll($sql, $sql_params);\n\t\t//有开启缓存,则把结果添加到缓存中\n\t\tif($params['allow_cache'] && isset($this->cache)) {\n\t\t\t$cache_cache_time = Setting::inst()->getSettingValue('COLLECT_MODEL_PAGES_CACHE_TIME');\n\t\t\t$this->cache->set($_cache_key, json_encode($ret), $cache_cache_time);\n\t\t\tunset($cache_cache_time, $cache_key);\n\t\t}\n\t\treturn $ret;\n\t}", "function nav_pages_struct(&$result, $q_string, $count, $REC_PER_PAGE) {\n \n\tglobal $label;\n\tglobal $list_mode;\n\t\n\tif ($list_mode=='PREMIUM') {\n\t\t$page = 'hot.php';\t\t\n\t} else {\n\t\t$page = $_SERVER[PHP_SELF];\n\t}\n\t$offset = $_REQUEST[\"offset\"];\n\t$show_emp = $_REQUEST[\"show_emp\"];\n\t\n\tif ($show_emp != '') {\n\t $show_emp = (\"&show_emp=$show_emp\");\n\t}\n\t$cat = $_REQUEST[\"cat\"];\n\tif ($cat != '') {\n\t $cat = (\"&cat=$cat\");\n\t}\n\t$order_by = $_REQUEST[\"order_by\"];\n\tif ($order_by != '') {\n\t $order_by = (\"&order_by=$order_by\");\n\t}\n\n\t$cur_page = $offset / $REC_PER_PAGE;\n\t$cur_page++;\n\t// estimate number of pages.\n\t$pages = ceil($count / $REC_PER_PAGE);\n\tif ($pages == 1) {\n\t return;\n\t}\n\t$off = 0;\n\t$p=1;\n\t$prev = $offset-$REC_PER_PAGE;\n\t$next = $offset+$REC_PER_PAGE;\n\n\tif ($prev===0) {\n\t\t$prev='';\n\t}\n\n\tif ($prev > -1) {\n\t $nav['prev'] = \"<a href='\".$page.\"?offset=\".$prev.$q_string.$show_emp.$cat.$order_by.\"'>\".$label[\"navigation_prev\"] .\"</a> \";\n\t \n\t}\n\tfor ($i=0; $i < $count; $i=$i+$REC_PER_PAGE) {\n\t if ($p == $cur_page) {\n\t\t $nav['cur_page'] = $p;\n\t\t \n\t\t \n\t } else {\n\t\t if ($off===0) {\n\t\t\t$off='';\n\t\t}\n\t\t if ($nav['cur_page'] !='') {\n\t\t\t $nav['pages_after'][$p] = $off;\n\t\t } else {\n\t\t\t$nav['pages_before'][$p] = $off;\n\t\t }\n\t }\n\t $p++;\n\t $off = $off + $REC_PER_PAGE;\n\t}\n\tif ($next < $count ) \n\t\t$nav['next'] = \" | <a href='\".$page.\"?offset=\".$next.$q_string.$show_emp.$cat.$order_by.\"'> \".$label[\"navigation_next\"].\"</a>\";\n\n\treturn $nav;\n}", "public function render_per_page_options()\n {\n }", "function build_query_vars_from_query_block($block, $page)\n {\n }", "public function setElementsPerPage($count);", "public function getPageNr(){\n\t\tif(isset($_GET['p'])){\n\t\t\treturn $_GET['p'];\n\t\t}else{\n\t\t\treturn 1;\n\t\t}\n\t}" ]
[ "0.7132374", "0.69605124", "0.68827975", "0.6872568", "0.68438023", "0.6697009", "0.66113085", "0.66006196", "0.6557842", "0.6519253", "0.6505394", "0.6505394", "0.6479073", "0.6448573", "0.64049846", "0.6393", "0.6361017", "0.63430536", "0.6303619", "0.6195957", "0.61955255", "0.60972565", "0.6078348", "0.60780454", "0.6064771", "0.6049592", "0.6030343", "0.6022667", "0.6013821", "0.6012202", "0.5992955", "0.59918594", "0.5975061", "0.5956168", "0.5948663", "0.59283805", "0.59176046", "0.59096605", "0.58948", "0.58944607", "0.5889143", "0.5888858", "0.5881854", "0.5881627", "0.5875637", "0.58642817", "0.58288896", "0.5822137", "0.5800715", "0.5790722", "0.57886803", "0.57877874", "0.5782931", "0.5778354", "0.577757", "0.57529074", "0.57473636", "0.5745233", "0.57446355", "0.5730901", "0.57249755", "0.5719598", "0.57072383", "0.5693436", "0.5693214", "0.5692497", "0.56878024", "0.568732", "0.56815857", "0.56736255", "0.5668003", "0.5664301", "0.5657851", "0.56542414", "0.5633456", "0.563141", "0.56304413", "0.5629131", "0.5626483", "0.5622636", "0.5621897", "0.5617918", "0.5614722", "0.5612096", "0.5601139", "0.5598643", "0.55916315", "0.55862814", "0.5583665", "0.55820554", "0.55815613", "0.5577836", "0.5568911", "0.55676067", "0.55665743", "0.55654645", "0.5565253", "0.55551755", "0.5552023", "0.5550551" ]
0.8312243
0
Generate a hash using the Global Hash key
function gen_hash($key,$number=false){ if ($number) { $hash=abs(crc32(HASH_KEY.$key)) % 999999; } else { LOG_MSG('INFO','Algorithms: Blowfish['.CRYPT_BLOWFISH.'] md5['.CRYPT_MD5.'] ext_des['.CRYPT_EXT_DES.'] std_des['.CRYPT_STD_DES.']'); $hash=crypt(HASH_KEY.$key); } LOG_MSG('INFO',"gen_hash(): KEY=[$key], NUMBER=[$number], HASH=[$hash]"); return $hash; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function generateHash()\n {\n do {\n $hash = Security::randomString(8);\n } while ($this->exists(['hash' => $hash]));\n\n return $hash;\n }", "private static function create_hash() {\n $hash = md5( rand(0,1000) );\n return $hash;\n }", "private function _create_hash($key=''){\n\t\t$secret_key = 'gL0b3-E$sT4te'.date('m-d-y');\n\t\treturn md5($key.$secret_key);\n\t}", "protected function create_cache_key()\n\t{\n\t\treturn hash($this->config['hash'], serialize($this->options));\n\t}", "public static function generateKey()\n {\n return openssl_digest(php_uname() . \"-\" . $_SERVER[\"REMOTE_ADDR\"], 'MD5', true);\n }", "final public function getHash() {}", "public function hash();", "public function generateHash()\n {\n $userContext = new UserContext();\n\n foreach ($this->providers as $provider) {\n $provider->updateUserContext($userContext);\n }\n\n $parameters = $userContext->getParameters();\n\n // Sort by key (alphanumeric), as order should not make hash vary\n ksort($parameters);\n\n return hash('sha256', serialize($parameters));\n }", "public function getHash() {}", "private function newHash()\n {\n $salt = hash('sha256', uniqid(mt_rand(), true) . 't33nh4sh' . strtolower($this->email));\n\n // Prefix the password with the salt\n $hash = $salt . $this->password;\n \n // Hash the salted password a bunch of times\n for ( $i = 0; $i < 100000; $i ++ ) {\n $hash = hash('sha256', $hash);\n }\n \n // Prefix the hash with the salt so we can find it back later\n $hash = $salt . $hash;\n \n return $hash;\n }", "public function get_hash($key = 0)\n {\n }", "public function hash(): string;", "public function getHash();", "function makeKey($masterID){\n\n\t$key = \"I want to see you so bad :/\";\n\t$keyElement1 = \"\";\n\t$keyElement2 = \"\";\n\t$keyElement3 = \"\";\n\t$hash = \"\";\n\n\t$strSQL = \"SELECT * FROM masteraccount WHERE 1 \n\t\tAND masterID = '\".$masterID.\"' \n\t\t\";\n\t\n\t$objQuery = mysql_query($strSQL);\n\t$objResult = mysql_fetch_array($objQuery);\n\tif($objResult) {\n\t\t$keyElement1 = $objResult[\"masterTextPassword\"];\n\t\t$keyElement2 = $objResult[\"masterGraphicalPassword\"];\n\n\t\t//echo \"element2 : \".$keyElement2.\"<br>\";\n\n\t\t$keyElement3 = $objResult[\"email\"];\n\t\t$cost = 11;\n\t\t$salt = mcrypt_create_iv(22, MCRYPT_DEV_URANDOM);\n\t\t\n\t\t//make key -> Hash(Hash(text)+Hash(graphical))+Hash(email)\n\t\t$keyElement1 = hash(\"sha256\",$keyElement1, false);\n\t\t$keyElement2 = hash(\"sha256\",$keyElement2, false);\n\t\t$key = $keyElement1.$keyElement2 ;\n\n\t\t//echo \"key ele1+2 : \".$key.\"<br>\";\n\n\t\t$key = hash(\"sha256\",$key, false);\n\n\t\t//echo \"hashed key ele1+2 : \".$key.\"<br>\";\n\n\t\t$keyElement3 = hash(\"sha256\",$keyElement3, false);\n\t\t$key = $key.$keyElement3 ;\n\t\t$key = hash(\"sha256\",$key, false);\n\n\t\t//echo \"FinalKey : \".$key.\"<br><br>\";\n\t}\n\treturn $key;\n}", "function _cr_hs_generate_token() {\n $load_avg = sys_getloadavg();\n $time = time();\n $hash = hash_init('sha256');\n hash_update($hash, implode('', $load_avg));\n hash_update($hash, time());\n return hash_final($hash);\n}", "public static function generateHash()\n {\n $result = '';\n $charPool = '0123456789abcdefghijklmnopqrstuvwxyz';\n for ($p = 0; $p < 15; $p++) {\n $result .= $charPool[mt_rand(0, strlen($charPool) - 1)];\n }\n\n return sha1(md5(sha1($result)));\n }", "public function generateHash()\n {\n $this->hash = sha1(serialize($this->toArray()));\n }", "function key_gen($str=''){\n\treturn str_replace('=','',base64_encode(md5($str)));\n}", "abstract protected function generateKey();", "public function createKey()\n {\n return md5('Our-Calculator') . (time() + 60);\n }", "function generate_key()\n\t{\n\t\treturn $this->key_prefix . md5( $this->key_prefix . microtime() . uniqid() . 'teamps' );\n\t}", "protected function getHash(): string\n {\n return hash('crc32', md5((string) mt_rand()));\n }", "private function _generate_key(){\n $salt = base_convert(bin2hex($this->CI->security->get_random_bytes(64)), 16, 36);\n \n // If an error occurred, then fall back to the previous method\n if ($salt === FALSE){\n $salt = hash('sha256', time() . mt_rand());\n }\n \n $new_key = substr($salt, 0, config_item('rest_key_length'));\n while ($this->_key_exists($new_key));\n\n return $new_key;\n }", "private function generateToken()\n {\n return hash('SHA256', uniqid((double) microtime() * 1000000, true));\n }", "private function generateUniqueHash()\n {\n $rand = mt_rand(0, 10000);\n $string = $this->generateRandomString();\n $hash = md5($rand . $string);\n return $hash;\n }", "function GenerateKey() {\n // deterministic; see base.js.\n return rand();\n}", "public function getHash(): string;", "public function getHash(): string;", "public function getHash(): string;", "public function getHash(): string;", "function generate_token()\n {\n $this->load->helper('security');\n $res = do_hash(time().mt_rand());\n $new_key = substr($res,0,config_item('rest_key_length'));\n return $new_key;\n }", "protected function _genRequestKey()\n {\n $hash = sprintf(\"%u\", crc32(serialize($this->_request)));\n $this->_setLastRequestKey($hash);\n return $hash;\n }", "public function generateAuthKey()\n {\n $this->salt = OldDi::GetString(8);\n }", "public static function create_hash($prefix='')\n\t{\n\t\t$hash = $prefix.md5(microtime(true).rand(0,100000));\n\t\treturn $hash;\n\t}", "function hash_generator($str, $key)\n{\n $nonce = random_bytes(SODIUM_CRYPTO_SECRETBOX_NONCEBYTES);\n $ciphertext = sodium_crypto_secretbox($str, $nonce, $key);\n\n return $nonce . $ciphertext;\n}", "abstract protected static function getHashAlgorithm() : string;", "public function generateKey()\n\t{\n\t\treturn substr(md5(uniqid(mt_rand(), true)), 0, 3) . substr(md5(uniqid(mt_rand(), true)), 0, 2);\n\t}", "public static function generateNewAuthKey()\r\n {\r\n return Yii::$app->security->generateRandomString();\r\n }", "function xss_hash()\n\t{\n\t\tif ($this->xss_hash == '')\n\t\t{\n\t\t\tif (phpversion() >= 4.2)\n\t\t\t\tmt_srand();\n\t\t\telse\n\t\t\t\tmt_srand(hexdec(substr(md5(microtime()), -8)) & 0x7fffffff);\n\n\t\t\t$this->xss_hash = md5(time() + mt_rand(0, 1999999999));\n\t\t}\n\n\t\treturn $this->xss_hash;\n\t}", "public function hash() {\n if(isset($this->cache['hash'])) return $this->cache['hash'];\n\n // add a unique hash\n $checksum = sprintf('%u', crc32($this->uri()));\n return $this->cache['hash'] = base_convert($checksum, 10, 36);\n }", "function keymaker($id = ''){\n\t\t//look up of info unique to the user or id. It could include date/time to timeout keys.\n\t\t$secretkey='1RuL1HutysK98UuuhDasdfafdCrackThisBeeeeaaaatchkHgjsheIHFH44fheo1FhHEfo2oe6fifhkhs';\n\t\t$key=md5($id.$secretkey);\n\t\treturn $key;\n\t}", "private function generateRandomKey()\n {\n return substr(base_convert(sha1(uniqid(mt_rand(), true)), 16, 36), 0, 8);\n }", "private function generateApiKey(){\n\n return md5(uniqid(rand(), true));\n\n }", "private static function _key($key)\n {\n return hash('sha256', $key, true);\n }", "public static function generateKey()\n {\n do {\n $salt = sha1(time() . mt_rand());\n $newKey = substr($salt, 0, 40);\n } // Already in the DB? Fail. Try again\n while (self::keyExists($newKey));\n\n return $newKey;\n }", "protected function generateHash() {\r\n\t\t$relevantData = array('company','country','firstname','lastname','jobstatus');\r\n\t\tforeach($relevantData as $relevantField) {\r\n\t\t\t$getterMethod = 'get_'. ucfirst($relevantField);\r\n\t\t\t$badgeDataString = '';\r\n\t\t\t\r\n\t\t\tif(method_exists($this, $getterMethod)) {\r\n\t\t\t\t$badgeDataString .= $this->$getterMethod();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn md5($badgeDataString);\r\n\t}", "public static function generateKey(){\n $key = '';\n // [0-9a-z]\n for ($i=0;$i<32;$i++){\n $key .= chr(rand(48, 90));\n }\n self::$_key = $key;\n }", "public function xss_hash()\n {\n if ($this->_xss_hash == '')\n {\n mt_srand();\n $this->_xss_hash = md5(strval(time() + mt_rand(0, 1999999999)));\n }\n\n return $this->_xss_hash;\n }", "protected function getHashKey()\n {\n return $this->getHashKeyForId($this->getId());\n }", "public function getHash(): string\n {\n return hash_hmac('sha256', $this->token, Config::SECRET_KEY);\n }", "public function generateAuthKey() {\n $this->auth_key = Yii::$app->security->generateRandomString(32);\n }", "public function generateKey()\n {\n do\n {\n $salt = sha1(time() . mt_rand());\n $newKey = substr($salt, 0, 40);\n } // Already in the DB? Fail. Try again\n while ($this->keyExists($newKey));\n\n return $newKey;\n }", "public static function generateKey () {\n $session = bin2hex(random_bytes(16));\n if (static::count([ 'key' => $session ]) == 1) {\n return static::generateSession();\n }\n return $session;\n }", "public static function generateHash($mode, $track, $application_id)\n\t{\n\t\treturn md5($mode . ':' . $track . ':' . $application_id);\n\t}", "public function xss_hash()\n\t{\n\t\tif ($this->_xss_hash === NULL)\n\t\t{\n\t\t\t$rand = $this->get_random_bytes(16);\n\t\t\t$this->_xss_hash = ($rand === FALSE)\n\t\t\t\t? md5(uniqid(mt_rand(), TRUE))\n\t\t\t\t: bin2hex($rand);\n\t\t}\n\n\t\treturn $this->_xss_hash;\n\t}", "public static function get_new_hash() {\n\n // Start with a clean slate\n $hash_id = null;\n\n // Define a universe of characters to be used\n $universe = \"abcdef0123456789\";\n\n // In the event a duplicate code is generated, this loop serves as a safety net.\n // (A 5-digit hash_id can support over 1 MILLION possibilities)\n for ($x = 0; $x < 100; $x++) {\n\n $new_hash = null;\n\n // Loop\n for ($y = 0; $y < 5; $y++) {\n\n // Grab a random number within the range\n $rand = mt_rand(0, 15);\n\n // Repeatedly append it, to form a new \"hash\"\n $new_hash .= $universe[$rand];\n }\n\n // Query DB to see if the new_hash has already been used\n // NOTE: utf8_bin collation and indexing should be set on this column\n $id = Hash::where('hash', '=', $new_hash)\n ->limit(1)\n ->get();\n\n // If no length to the return, it's unique. Bust out of this loop\n if (!count($id)) {\n break;\n }\n }\n\n // Insert this new hash into the DB so it can't get reused\n $unique_hash = new Hash;\n $unique_hash->hash = $new_hash;\n $unique_hash->save();\n\n // Return the newly generated hash_id\n return $new_hash;\n }", "static function makeConfirmationHash () {\n while (true) {\n $hash = Common::randHash();\n $result = Database::queryAsObject(\"select hash from t_confirm where hash = '$hash'\");\n if ($result == null)\n return $hash;\n }\n }", "public function generateAuthKey()\r\n {\r\n $this->auth_key = Yii::$app->getSecurity()->generateRandomString();\r\n }", "public static function generateHash($timestamp = null)\n {\n if ($timestamp === null) {\n $timestamp = strtotime(\"now\");\n }\n return base_convert($timestamp, 10, 36);\n }", "protected function _generateHash()\n {\n //$formattedDateTime = $datetime->format(\"Y-m-d H:i:s\");\n $formattedDateTime = $this->udate('Y-m-d H:i:s.u T');\n $hash = $this->_getHash($formattedDateTime);\n return $hash;\n }", "public function generateAuthKey(){\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function xss_hash() {\n\t\tif ($this->xss_hash == '') {\n\t\t\tif (phpversion() >= 4.2) mt_srand(); else\n\t\t\t\tmt_srand(hexdec(substr(md5(microtime()), -8)) & 0x7fffffff);\n\n\t\t\t$this->xss_hash = md5(time() + mt_rand(0, 1999999999));\n\t\t}\n\n\t\treturn $this->xss_hash;\n\t}", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->getSecurity()->generateRandomString();\n }", "public function generateAuthKey()\n {\n // default length=32\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey() {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey() {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey() {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey() {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\r\n {\r\n $this->auth_key = Yii::$app->security->generateRandomString();\r\n }", "public function generateAuthKey()\r\n {\r\n $this->auth_key = Yii::$app->security->generateRandomString();\r\n }", "public function testHashingKeyGeneration()\n {\n $generator = $this->getTokenGeneratorForTesting(new PseudoRandom());\n\n $resultOne = $generator->getHashingKey(64);\n $resultTwo = $generator->getHashingKey(64);\n\n $this->assertNotEquals($resultOne, $resultTwo);\n\n $resultOne = $generator->getHashingKey(64, false);\n $resultTwo = $generator->getHashingKey(64, false);\n\n $this->assertNotEquals($resultOne, $resultTwo);\n\n $generator->seedRandomGenerator(42);\n $resultOne = $generator->getHashingKey(64);\n\n $generator->seedRandomGenerator(42);\n $resultTwo = $generator->getHashingKey(64);\n\n $this->assertEquals($resultOne, $resultTwo);\n }", "protected function _getSharingRandomCode()\n {\n return Mage::helper('core')->uniqHash();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }", "public function generateAuthKey()\n {\n $this->auth_key = Yii::$app->security->generateRandomString();\n }" ]
[ "0.7475756", "0.7264919", "0.7211494", "0.7081599", "0.707203", "0.6979899", "0.6941704", "0.69116694", "0.68477815", "0.68407553", "0.682993", "0.68245625", "0.67968696", "0.6780788", "0.67649835", "0.6742202", "0.6722473", "0.6704785", "0.6690643", "0.66620004", "0.6649748", "0.6649229", "0.6640879", "0.6640339", "0.66382647", "0.6632328", "0.66265947", "0.66265947", "0.66265947", "0.66265947", "0.6620672", "0.6579233", "0.65570277", "0.6555602", "0.6505377", "0.64796495", "0.6475117", "0.64682627", "0.6467659", "0.64615434", "0.6454944", "0.6449734", "0.640227", "0.6401695", "0.6390929", "0.6390926", "0.63896495", "0.6376452", "0.6376241", "0.63761115", "0.6368721", "0.63632834", "0.6363134", "0.6345463", "0.63254625", "0.63241345", "0.6317396", "0.63162386", "0.6316067", "0.6315683", "0.63130003", "0.63098705", "0.6300333", "0.62913007", "0.6286387", "0.6286387", "0.6286387", "0.6286387", "0.6277464", "0.6277464", "0.6272837", "0.62693727", "0.6264718", "0.6264718", "0.6264718", "0.6264718", "0.6264718", "0.6264718", "0.6264718", "0.6264718", "0.6264718", "0.6264718", "0.6264718", "0.6264718", "0.6264718", "0.6264718", "0.6264718", "0.6264718", "0.6264718", "0.6264718", "0.6264718", "0.6264718", "0.6264718", "0.6264718", "0.6264718", "0.6264718", "0.6264718", "0.6264718", "0.6264718", "0.6264718" ]
0.6748429
15
Same as above but does not convert into lower case and replaces by space instead of
function make_clean_str($str) { return ucwords(trim(preg_replace('/[ ]+/',' ',preg_replace('/[^0-9a-zA-Z\+]/',' ',strtolower($str))),' ')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sanifyText($text) {\n // todo whitespace stripping removes commas \"ostuh,otuh\" and concats the words\n // fix this issue.\n return strtolower($text);\n}", "function uncapitalize(){\n\t\t$first = $this->substr(0,1)->downcase();\n\t\treturn $first->append($this->substr(1));\n\t}", "function strtoproper($someString) {\n return ucwords(strtolower($someString));\n}", "function downcase(){\n\t\treturn $this->_copy(Translate::Lower($this->toString(),$this->getEncoding()));\n\t}", "function filter($word)\r\n{\r\n $word = trim($word);\r\n $word = preg_replace('/[^A-Za-z0-9\\-]/','', $word);\r\n return strtolower($word);\r\n}", "public function swapCase()\n {\n $stringy = static::create($this->str, $this->encoding);\n $encoding = $stringy->encoding;\n\n $stringy->str = preg_replace_callback(\n '/[\\S]/u',\n function($match) use ($encoding) {\n $marchToUpper = UTF8::strtoupper($match[0], $encoding);\n\n if ($match[0] == $marchToUpper) {\n return UTF8::strtolower($match[0], $encoding);\n } else {\n return $marchToUpper;\n }\n },\n $stringy->str\n );\n\n return $stringy;\n }", "function studly_case($str){\n\t\treturn Str::studly($str);\n\t}", "function LetterCapitalize($str) { \r\n return ucwords($str); \r\n}", "private static function _casenormalize(&$val)\n {\n $val = strtolower($val);\n }", "function clean_my_words($words) {\n return strtolower($words);\n }", "function formatInput($param1)\n{\n return ucwords(strtolower($param1));\n}", "function convertNamingFromUnderlineToCamelCase($text,$firstLetterLowerCase=true) {\n\t\t\tpreg_match_all('/(^[a-zA-Z])|(_[a-zA-Z])/', $text, $matches, PREG_PATTERN_ORDER);\n\t\n\t\t\tfor ($i = 0; $i < count($matches[0]); $i++) {\n\t\t\t\t\t$original=$matches[0][$i];\n\t\t\t\t\t$originals[]=$original;\n\t\t\t\t\tif ($i==0 and $firstLetterLowerCase)\n\t\t\t\t\t\t\t$replacement=str_replace('_','',$matches[0][$i]);\n\t\t\t\t\telse\n\t\t\t\t\t\t\t$replacement=strtoupper(str_replace('_','',$matches[0][$i]));\n\t\t\t\t\t$replacements[]=$replacement;\n\t\t\t}\n\t\n\t\t\treturn str_replace($originals,$replacements,$text);\n\t}", "public function getTitleCase($value) {\n\t\t$value = str_replace('_', ' ', $value);\n\t\t$value = ucwords($value);\n\t\t$value = str_replace(' ', '', $value);\n\t\treturn $value;\n\t}", "function changeTitle($str)\n{\n\t$str = stripUnicode($str);\n\t$str = mb_convert_case($str,MB_CASE_LOWER,'utf-8');\n\t$str = trim($str);\n\t$str=preg_replace('/[^a-zA-Z0-9\\ ]/','',$str); \n\t$str = str_replace(\" \",\" \",$str);\n\t$str = str_replace(\" \",\"-\",$str);\n\treturn $str;\n}", "function titleCase($string) {\r\n // Remove no_parse content.\r\n $string_array = preg_split(\"/(<no_parse>|<\\/no_parse>)+/i\",$string);\r\n $newString = '';\r\n for ($k=0; $k<count($string_array); $k=$k+2) {\r\n $string = $string_array[$k];\r\n // If the entire string is upper case, don't perform any title case on it.\r\n if ($string != strtoupper($string)) {\r\n // TITLE CASE RULES:\r\n // 1.) Uppercase the first char in every word.\r\n $new = preg_replace(\"/(^|\\s|\\'|'|\\\"|-){1}([a-z]){1}/ie\",\"''.stripslashes('\\\\1').''.stripslashes(strtoupper('\\\\2')).''\", $string);\r\n // 2.) Lower case words exempt from title case.\r\n // Lowercase all articles, coordinate conjunctions (\"and\", \"or\", \"nor\"), and prepositions regardless of length, when they are other than the first or last word.\r\n // Lowercase the \"to\" in an infinitive.\" - this rule is of course approximated since it is context sensitive.\r\n $matches = array();\r\n // Perform recursive matching on the following words.\r\n preg_match_all(\"/(\\sof|\\sa|\\san|\\sthe|\\sbut|\\sor|\\snot|\\syet|\\sat|\\son|\\sin|\\sover|\\sabove|\\sunder|\\sbelow|\\sbehind|\\snext\\sto|\\sbeside|\\sby|\\samoung|\\sbetween|\\sby|\\still|\\ssince|\\sdurring|\\sfor|\\sthroughout|\\sto|\\sand){2}/i\",$new ,$matches);\r\n for ($i=0; $i<count($matches); $i++) {\r\n for ($j=0; $j<count($matches[$i]); $j++) {\r\n $new = preg_replace(\"/(\".$matches[$i][$j].\"\\s)/ise\",\"''.strtolower('\\\\1').''\",$new);\r\n }\r\n }\r\n // 3.) Do not allow upper case apostrophes.\r\n $new = preg_replace(\"/(\\w'S)/ie\",\"''.strtolower('\\\\1').''\",$new);\r\n $new = preg_replace(\"/(\\w'\\w)/ie\",\"''.strtolower('\\\\1').''\",$new);\r\n $new = preg_replace(\"/(\\W)(of|a|an|the|but|or|not|yet|at|on|in|over|above|under|below|behind|next to| beside|by|amoung|between|by|till|since|durring|for|throughout|to|and)(\\W)/ise\",\"'\\\\1'.strtolower('\\\\2').'\\\\3'\",$new);\r\n // 4.) Capitalize first letter in the string always.\r\n $new = preg_replace(\"/(^[a-z]){1}/ie\",\"''.strtoupper('\\\\1').''\", $new);\r\n // 5.) Replace special cases.\r\n // You will add to this as you find case specific problems.\r\n $new = preg_replace(\"/\\sin-/i\",\" In-\",$new);\r\n $new = preg_replace(\"/(\\s|\\\"|\\'){1}(ph){1}(\\s|,|\\.|\\\"|\\'|:|!|\\?|\\*|$){1}/ie\",\"'\\\\1pH\\\\3'\",$new);\r\n $new = preg_replace(\"/^ph(\\s|$)/i\",\"pH \",$new);\r\n $new = preg_replace(\"/(\\s)ph($)/i\",\" pH\",$new);\r\n $new = preg_replace(\"/(\\s|\\\"|\\'){1}(&){1}(\\s|,|\\.|\\\"|\\'|:|!|\\?|\\*){1}/ie\",\"'\\\\1and\\\\3'\",$new);\r\n $new = preg_replace(\"/(\\s|\\\"|\\'){1}(groundwater){1}(\\s|,|\\.|\\\"|\\'|:|!|\\?|\\*){1}/e\",\"'\\\\1Ground Water\\\\3'\",$new);\r\n $new = preg_replace(\"/(\\W|^){1}(cross){1}(\\s){1}(connection){1}(\\W|$){1}/ie\",\"'\\\\1\\\\2-\\\\4\\\\5'\",$new); // Always hyphenate cross-connections.\r\n $new = preg_replace(\"/(\\s|\\\"|\\'){1}(vs\\.){1}(\\s|,|\\.|\\\"|\\'|:|!|\\?|\\*){1}/ie\",\"'\\\\1Vs.\\\\3'\",$new);\r\n $new = preg_replace(\"/(\\s|\\\"|\\'){1}(on-off){1}(\\s|,|\\.|\\\"|\\'|:|!|\\?|\\*){1}/ie\",\"'\\\\1On-Off\\\\3'\",$new);\r\n $new = preg_replace(\"/(\\s|\\\"|\\'){1}(on-site){1}(\\s|,|\\.|\\\"|\\'|:|!|\\?|\\*){1}/ie\",\"'\\\\1On-Site\\\\3'\",$new);\r\n // Special cases like Class A Fires.\r\n $new = preg_replace(\"/(\\s|\\\"|\\'){1}(class\\s){1}(\\w){1}(\\s|,|\\.|\\\"|\\'|:|!|\\?|\\*|$){1}/ie\",\"'\\\\1\\\\2'.strtoupper('\\\\3').'\\\\4'\",$new);\r\n $new = stripslashes($new);\r\n $string_array[$k] = $new;\r\n }\r\n }\r\n for ($k=0; $k<count($string_array); $k++) {\r\n $newString .= $string_array[$k];\r\n }\r\n return($newString);\r\n }", "function camelCase($str, array $noStrip = [])\r\n{\r\n $str = preg_replace('/[^a-z0-9' . implode(\"\", $noStrip) . ']+/i', ' ', $str);\r\n $str = trim($str);\r\n // uppercase the first character of each word\r\n $str = ucwords($str);\r\n\r\n return $str;\r\n}", "public static function studlyCase($str) {}", "function lower($text) {\n\t$text = mb_strtolower($text, 'UTF-8');\n\treturn $text;\n}", "function makeTitleCase($input_title)\n {\n $input_array_of_words = explode(\" \", strtolower($input_title));\n $output_titlecased = array();\n $designated = array(\"a\", \"as\", \"an\", \"by\", \"of\", \"on\", \"to\", \"the\", \"or\", \"in\", \"from\", \"is\");\n foreach ($input_array_of_words as $word) {\n //if any of the words in designated array appear, lowercase them\n if (in_array($word, $designated)) {\n array_push($output_titlecased, lcfirst($word));\n //otherwise, uppercase\n } else {\n array_push($output_titlecased, ucfirst($word));\n }\n\n\n }\n\n//overrides the first if statement, making every first word capitalized no matter what\n $output_titlecased[0] = ucfirst($output_titlecased[0]);\n\n return implode(\" \", $output_titlecased);\n }", "function put_underscore($str, $lower = true)\n {\n if (!$lower) {\n return str_replace(' ', '_', $str);\n }\n return strtolower(str_replace(' ', '_', $str));\n }", "function ucfirst_sentence($str){\r\n\treturn preg_replace('/\\b(\\w)/e', 'strtoupper(\"$1\")', strtolower($str));\r\n}", "function upcase(){\n\t\treturn $this->_copy(Translate::Upper($this->toString(),$this->getEncoding()));\n\t}", "function camelCase($str, array $noStrip = [])\n{\n $str = preg_replace('/[^a-z0-9' . implode(\"\", $noStrip) . ']+/i', ' ', $str);\n $str = trim($str);\n // uppercase the first character of each word\n $str = ucwords($str);\n $str = str_replace(\" \", \"\", $str);\n $str = lcfirst($str);\n\n return $str;\n}", "function replace($text){\n\t\treturn preg_replace('/[^a-z A-Z]/','',strtolower(czech::autoCzech($text,'asc')));\n\t}", "function correctCase($name)\n{\n // aAa | AAA | aaA ---> aaa\n $nameLowecase = strtolower($name);\n // aaa --> Aaa\n $uppercaseName = ucfirst($nameLowecase);\n return $uppercaseName;\n}", "function fmtCase($text) {\n\t\tglobal $assoc_case;\n\n\t\tif ($assoc_case == \"lower\") $newtext\t= strtolower($text);\n\t\telse if ($assoc_case == \"upper\") $newtext\t= strtoupper($text);\n\t\treturn $newtext;\n\n\t}", "function str_camelcase($str, $capital_first_char = false)\n{\n $str = str_replace(' ', '', ucwords(str_replace('_', ' ', $str)));\n return $capital_first_char ? $str : lcfirst($str);\n}", "function mdl_str_camelize(string $haystack, bool $capitalize = true)\n{\n $search_replace = static function (string $h, string $d) {\n return str_replace($d, '', ucwords($h, $d));\n };\n $first_capital = static function ($param) use ($capitalize) {\n return !$capitalize ? lcfirst($param) : $param;\n };\n return $first_capital($search_replace($haystack, '_'));\n}", "function title_case($value)\n {\n return Str::title($value);\n }", "function title_case($value)\n {\n return Str::title($value);\n }", "function humanize($str){\n return ucwords(preg_replace('/[_\\-]+/', ' ', strtolower(trim($str))));\n }", "function studly_case($value)\n\t{\n\t\treturn Illuminate\\Support\\Str::studly($value);\n\t}", "public function toLower()\n {\n $lowerCase = [];\n foreach ($this->split() as $key => $value) {\n $lowerCase[] = strtolower($value);\n }\n\n return $lowerCase;\n }", "public static function spaceBeforeCapital(string $input):string {\n\n # Set result\n $result = $input;\n\n # Check input\n if($input)\n\n # Process input\n $result = preg_replace('/(?<!^)([A-Z])/', ' $1', $input);\n\n # Return result\n return $result;\n\n }", "function studly_case($value)\n {\n return Str::studly($value);\n }", "public function remove_all_caps()\n {\n }", "function strtoproper($someString) {\n\t\treturn ucwords(strtolower($someString));\n\t}", "function atk_strtolower($str)\n{\n\treturn atkString::strtolower($str);\n}", "function replace($str){\n\t$temp = preg_replace('#([^a-z0-9]+)#i',' ',$str);\n\t$tab = explode(' ',$temp);\n\t$val = null;\n\tfor($i=0; $i<count($tab);$i++){\n\t\tif($i != 0){\n\t\t\t$val .= ucfirst($tab[$i]);\n\t\t}\n\t\telse{\n\t\t\t$val .= $tab[$i];\n\t\t}\n\t}\n\treturn $val;\n}", "function lower_case($value)\n {\n return Str::lower($value);\n }", "public static function snakeCase($str) {}", "function properCase($propername) {\n //if (ctype_upper($propername)) {\n $propername = ucwords(strtolower($propername));\n //}\n return $propername;\n }", "function sanitize($string, $force_lowercase = false, $anal = false)\n{\n $strip = ['~', '`', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '=', '+', '[', '{', ']', '}', '\\\\', '|', ';', ':', '\"', \"'\", '&#8216;', '&#8217;', '&#8220;', '&#8221;', '&#8211;', '&#8212;', '—', '–', ',', '<', '.', '>', '/', '?'];\n $clean = trim(str_replace($strip, '', strip_tags($string)));\n $clean = preg_replace('/\\s+/', '-', $clean);\n $clean = ($anal) ? preg_replace('/[^a-zA-Z0-9]/', '', $clean) : $clean;\n\n return ($force_lowercase) ?\n (function_exists('mb_strtolower')) ?\n mb_strtolower($clean, 'UTF-8') :\n strtolower($clean) :\n $clean;\n}", "function the_champ_first_letter_uppercase($word){\r\n\treturn ucfirst($word);\r\n}", "function string_filter($string)\n{\n $string = preg_replace(\"/[^A-Za-z']/\", \"\", $string);\n $string = trim(ucfirst(strtolower($string)));\n $string = str_replace(\"'\", \"\\'\", $string);\n return $string;\n}", "private function __unifyString($s)\n\t{\n\t\t$out = mb_strtolower($s, 'UTF-8');\n\t\t$out = Inflector::slug($out);\n\n\t\treturn $out;\n\t}", "public function testStringCanBeConvertedToTitleCase()\n {\n $this->assertEquals('Taylor', Str::title('taylor'));\n $this->assertEquals('Άχιστη', Str::title('άχιστη'));\n }", "function fixCity($str = \"\") {\n\tif ( preg_match(\"/[A-Z]{3}/\", $str) ) {\n\t\t$str = strtolower($str);\n\t}\n\t$str = ucwords($str);\n\t$str = str_replace(\"'\", \"''\", $str);\n\treturn($str);\n//fixCity\n}", "function _sentence_case(string $str, $type = 'strtolower'){\n\t$str = explode('-', $str);\n\t$str = implode(' ', $str);\n\t$str = explode('_', $str);\n\t$str = implode(' ', $str);\n\t$str = explode(' ', $str);\n\t$str = array_filter($str,function($value){\n\t\treturn !empty($value);\n\t});\n\t$str = implode(' ', $str);\t\t\t\n\treturn $type(strtolower($str));\n}", "public function transform(string $string): string\n {\n //spacestodashes\n preg_replace('/(\\w)(.)?/e', \"strtoupper('$1').strtolower('$2')\", $string);\n // preg_replace('/(\\w)(.)?/e', \"strtoupper('$1').strtolower('$2')\", $_POST['input']);\n }", "function camelCaseToSnakeCase(string $input): string\n{\n return preg_replace('/[-\\.]/', '_', strtolower(preg_replace('/(?<!^)[A-Z]/', '_$0', $input)));\n}", "function changeTitle($str,$strSymbol='-',$case=MB_CASE_LOWER){\n\t$str=trim($str);\n\tif ($str==\"\") return \"\";\n\t$str =str_replace('\"','',$str);\n\t$str =str_replace(\"'\",'',$str);\n\t$str = stripUnicode($str);\n\t$str = mb_convert_case($str,$case,'utf-8');\n\t$str = preg_replace('/[\\W|_]+/',$strSymbol,$str);\n\treturn $str;\n}", "function changeTitle($str,$strSymbol='-',$case=MB_CASE_LOWER){\n\t$str=trim($str);\n\tif ($str==\"\") return \"\";\n\t$str =str_replace('\"','',$str);\n\t$str =str_replace(\"'\",'',$str);\n\t$str = stripUnicode($str);\n\t$str = mb_convert_case($str,$case,'utf-8');\n\t$str = preg_replace('/[\\W|_]+/',$strSymbol,$str);\n\treturn $str;\n}", "function uv_first_capital($string){\n //Patron para reconocer y no modificar numeros romanos\n $pattern = '/\\b(?![LXIVCDM]+\\b)([A-Z_-ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝ]+)\\b/';\n $output = preg_replace_callback($pattern, function($matches) {\n return mb_strtolower($matches[0], 'UTF-8');\n }, $string);\n $output = ucfirst($output);\n return $output;\n }", "function pascal_case($value)\n {\n $value = ucwords(str_replace(['-', '_'], ' ', $value));\n\n return str_replace(' ', '', $value);\n }", "public static function makeTitleCase($input) {\n static $map;\n\n if (isset($map[$input])) {\n return $map[$input];\n }\n\n $output = str_replace(\"_\", \" \", strtolower($input));\n $output = ucwords($output);\n $output = str_replace(\" \", \"\", $output);\n\n $map[$input] = $output;\n\n return $output;\n }", "private function _unifyString($s)\n\t{\n\t\t$out = mb_strtolower($s, 'UTF-8');\n\t\t$out = Inflector::slug($out);\n\t\t\n\t\treturn $out;\n\t}", "function transform_name( $name = '', $type = '' ) {\n\t$word = array( ' ' => $type, '&' => '' );\n\t$new = strtr( $name, $word );\n $new = strtolower( $new );\n return $new;\n}", "function camel($string) {\r\n\t$parts = preg_split('/[\\s_\\-]+/i',strtolower($string));\r\n\t$camel = array_shift($parts) . str_replace(\" \",\"\",ucwords(implode(\" \",$parts)));\r\n\treturn $camel;\r\n}", "public function toLower() : Manipulator\n {\n return new static(mb_strtolower($this->string));\n }", "function clean_title($title)\r\n{\r\n\treturn ucwords( str_replace( array(\"-\", \"_\"), \" \", $title) );\r\n}", "function from_camel_case($input)\n{\n preg_match_all('!([A-Z][A-Z0-9]*(?=$|[A-Z][a-z0-9])|[A-Za-z][a-z0-9]+)!', $input, $matches);\n $ret = $matches[0];\n foreach ($ret as &$match) {\n $match = $match == strtoupper($match) ? strtolower($match) : lcfirst($match);\n }\n return implode('_', $ret);\n}", "function true_uppercase($string) {\n\treturn str_replace(' ', '_', ucwords(str_replace('_', ' ', strtolower($string))));\n}", "function camel_case_with_initial_capital($s) {\n return camel_case($s, true);\n }", "function sanitizeFormString($inputText)\n{\n $inputText = strip_tags($inputText);\n $inputText = str_replace(\" \", \"\", $inputText);\n //This will make the first character uppercase if a user negelects to do so\n $inputText = ucfirst(strtolower($inputText));\n return $inputText;\n}", "public function lowercase()\n {\n return $this->getNameInstance()->lowercase();\n }", "function _fixName($field_or_value_name) {\r\n if ($field_or_value_name == \"\")\r\n return \"\";\r\n // convert space into underscore\r\n $result = preg_replace(\"/ /\", \"_\", strtolower($field_or_value_name));\r\n // strip all non alphanumeric chars\r\n $result = preg_replace(\"/\\W/\", \"\", $result);\r\n return $result;\r\n }", "function make_slug($string) {\n $trim_data= preg_replace('/\\s+/u', '-', trim($string));\n $lower_data= strtolower($trim_data) ;\n return $lower_data;\n //return strtolower($lower_data);\n}", "function toJadenCase($string) \r\n\t{\r\n\t return ucwords($string);\r\n\t //ucwords string function — Uppercase the first character of each word in a string\r\n\t}", "function lower( $str ) {\r\nreturn preg_match( \"/[a-z]/\", $str );\r\n}", "protected function getLowerNameReplacement(): string\n {\n return strtolower($this->getName());\n }", "public static function fix_case($word) {\n # Fix case for words split by periods (J.P.)\n if (strpos($word, '.') !== false) {\n $word = self::safe_ucfirst(\".\", $word);;\n }\n # Fix case for words split by hyphens (Kimura-Fay)\n if (strpos($word, '-') !== false) {\n $word = self::safe_ucfirst(\"-\", $word);\n }\n # Special case for single letters\n if (strlen($word) == 1) {\n $word = strtoupper($word);\n }\n # Special case for 2-letter words\n if (strlen($word) == 2) {\n # Both letters vowels (uppercase both)\n if (in_array(strtolower($word{0}), self::$dict['vowels']) && in_array(strtolower($word{1}), self::$dict['vowels'])) {\n $word = strtoupper($word);\n }\n # Both letters consonants (uppercase both)\n if (!in_array(strtolower($word{0}), self::$dict['vowels']) && !in_array(strtolower($word{1}), self::$dict['vowels'])) {\n $word = strtoupper($word);\n }\n # First letter is vowel, second letter consonant (uppercase first)\n if (in_array(strtolower($word{0}), self::$dict['vowels']) && !in_array(strtolower($word{1}), self::$dict['vowels'])) {\n $word = ucfirst(strtolower($word));\n }\n # First letter consonant, second letter vowel or \"y\" (uppercase first)\n if (!in_array(strtolower($word{0}), self::$dict['vowels']) && (in_array(strtolower($word{1}), self::$dict['vowels']) || strtolower($word{1}) == 'y')) {\n $word = ucfirst(strtolower($word));\n }\n }\n # Fix case for words which aren't initials, but are all upercase or lowercase\n if ( (strlen($word) >= 3) && (ctype_upper($word) || ctype_lower($word)) ) {\n $word = ucfirst(strtolower($word));\n }\n return $word;\n }", "public static function normalize($original) {\n\t\treturn strtoupper(preg_replace(\"/[^a-zA-Z0-9]/\", \"\", $original));\n\t}", "function MString($M){\n $mai = ucwords ($M);\n return $mai;\n }", "function sentance_case($string){\n\t\t\n\t\t//Make standard sentance case\n\t\t$string = ucwords(strtolower($string));\n\t\t$string = trim($string);\n\t\t\n\t\t//Dates\n\t\t//TODO: find and make uppercase PM, AM\n\n\t\t//Random Words\n\t\t$string = str_replace(\"Dj\", \"DJ\", $string);\n\t\t$string = str_replace(\"(dj)\", \"(DJ)\", $string);\t\t\n\t\t$string = str_replace(\"Http\", \"http\", $string);\n\t\t\t\t\n\t\treturn $string;\n\t}", "function fromCamelCase($str)\n{\n\t$str[0] = strtolower($str[0]);\n\t$func = create_function('$c', 'return \"_\" . strtolower($c[1]);');\n\treturn preg_replace_callback('/([A-Z])/', $func, $str);\n}", "protected function _normalize($value)\n {\n return strtolower($value);\n }", "function transform_name( $name = '', $type = '' ) {\n $word = array( ' ' => $type, '&' => '' );\n $new = strtr( $name, $word );\n $new = strtolower( $new );\n\n return $new;\n}", "public function underscoredToLowerCamelCaseDataProvider() {}", "function isLower(){ return $this->length()>0 && $this->toString()===$this->downcase()->toString(); }", "function refine_title($string) {\n\n\t\t// replace underscores with spaces\n\t\t$string = preg_replace(\"(_)\", \" \", $string);\n\n\t\t// replace '%20' with space\n\t\t$string = preg_replace(\"(%20)\", \" \", $string);\n\n\t\t// replace multiple spaces with single space\n\t\t$string = preg_replace(\"([ ]{2,})\", \" \", $string);\n\n\t\treturn trim(ucwords(strtolower($string)));\n\t}", "function normalize_whitespace($str)\n {\n }", "public function toTitleCase()\n {\n // \"mb_convert_case()\" used a polyfill from the \"UTF8\"-Class\n $str = mb_convert_case($this->str, MB_CASE_TITLE, $this->encoding);\n\n return static::create($str, $this->encoding);\n }", "function addSpace($str){\n\t\t$s = $str[0];\n\t\tfor($i=1;$i<strlen($str);$i++){\n\t\t\tif(ctype_upper($str[$i]) == true){\n\t\t\t\t$s.= ' '.$str[$i];\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$s.= $str[$i];\n\t\t\t}\n\t\t}\n\t\treturn $s;\n\t}", "public function toLowerCase()\n {\n $str = UTF8::strtolower($this->str, $this->encoding);\n\n return static::create($str, $this->encoding);\n }", "function addSpacingNormal($string) {\r\n\t\t$spacedString = \"\";\r\n\r\n\t\t$charArray = str_split($string);\r\n\t\tforeach($charArray as $key => $value)\r\n\t\t\tif(!isUpperCase($value))\r\n\t\t\t\t$spacedString .= $value;\r\n\t\t\telse\r\n\t\t\t\t$spacedString .= \" \" . $value;\r\n\r\n\t\treturn ucfirst($spacedString);\r\n\t}", "protected function convName($name){\n if(ctype_upper(substr($name, 0, 1))){\n $name = strtolower(preg_replace('/([^A-Z])([A-Z])/', \"$1_$2\", $name));\n }\n else{\n $name = preg_replace('/(?:^|_)(.?)/e',\"strtoupper('$1')\", $name);\n }\n return $name;\n }", "public function camelize($str='') \n {\n return str_replace(' ', '', ucwords(str_replace(array('_', '-'), ' ', $str)));\n }", "function twig_title_string_filter(Twig_Environment $env, $string)\n {\n return ucwords(strtolower($string));\n }", "public function camel($word);", "public static function pearCase($str) {}", "function title($title){\n\t$title = ucwords(str_replace(\"-\",\" \",$title));\n\treturn $title;\n}", "static function lower(string $s): string {\n return mb_strtolower($s, 'UTF-8');\n }", "public function singularize($word);", "function mb_convert_case($sourcestring, $mode, $encoding) {}", "protected function sanitize($key)\n {\n return strtolower(str_replace(' ', '_', $key));\n }", "public function toAlternateCase(){\n $alternative = str_split(strtolower($this->string),1);\n for($i=0;$i<sizeof($alternative);$i++){\n if(($i+1)%2==0){\n $alternative[$i]=strtoupper($alternative[$i]);\n } \n }\n return $alternative = implode(\"\",$alternative);\n }", "function strtocapitalize($text) {\n\t$text = strtoupper(substr($text, 0, 1)) . substr($text, 1);\n\t$text = str_replace('_', ' ', $text);\n\treturn $text;\n}", "function get_name_sanitized():string{\n $sanitize_name = $this->name ;\n foreach (self::SANITIZED_WORDS as $old => $new) {\n $sanitize_name = str_replace($old, $new, $sanitize_name);\n }\n return $sanitize_name;\n }", "function cleanTitle($title) {\n\treturn ucwords( str_replace( array(\"-\", \"_\"), \" \", $title) );\n}" ]
[ "0.72979146", "0.716192", "0.71504337", "0.70882225", "0.7027809", "0.69875354", "0.69804233", "0.6977129", "0.69691354", "0.690293", "0.6902044", "0.685151", "0.684602", "0.68445796", "0.6813048", "0.6810597", "0.67992085", "0.6791782", "0.6774347", "0.6768505", "0.6753813", "0.67503303", "0.67280227", "0.6720444", "0.6686136", "0.66426694", "0.6620669", "0.6618756", "0.6617852", "0.6596609", "0.65923464", "0.6590515", "0.659008", "0.65897894", "0.658541", "0.658287", "0.65764743", "0.6570929", "0.6568519", "0.6557725", "0.65537065", "0.6546796", "0.65446055", "0.6532093", "0.6528858", "0.65270334", "0.65231514", "0.6522989", "0.65222776", "0.65178984", "0.65065336", "0.65020424", "0.65020424", "0.6501959", "0.64971817", "0.64933443", "0.64868385", "0.64838547", "0.6478374", "0.64722586", "0.6470997", "0.6467738", "0.6462711", "0.64565176", "0.64526385", "0.64456415", "0.6434525", "0.6430292", "0.64273596", "0.64266044", "0.64263517", "0.642356", "0.642211", "0.6419692", "0.6418482", "0.64058316", "0.64032227", "0.6401776", "0.63938576", "0.63933194", "0.63903564", "0.6390103", "0.63872546", "0.6386279", "0.638085", "0.6370616", "0.63585794", "0.63582563", "0.63563174", "0.6353551", "0.6349436", "0.6339192", "0.63335115", "0.6333053", "0.6332752", "0.6331375", "0.63303846", "0.6314894", "0.63096243", "0.6307261" ]
0.6663024
25
recursively copy a directory
function recurse_copy_dir($src,$dst) { $dir = opendir($src); $resp=mkdir($dst); LOG_MSG("INFO","creating directory $resp -> [$dst] "); while($dir && false !== ( $file = readdir($dir)) ) { if (( $file != '.' ) && ( $file != '..' )) { if ( is_dir($src . '/' . $file) ) { recurse_copy_dir($src . '/' . $file,$dst . '/' . $file); } else { copy($src . '/' . $file,$dst . '/' . $file); } } } closedir($dir); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function recurse_copy($src,$dst) { \n $dir = opendir($src);\n @mkdir($dst); \n while(false !== ( $file = readdir($dir)) ) {\n if (( $file != '.' ) && ( $file != '..') && !strstr($file,'.DS_Store')) {\n if ( is_dir($src . '/' . $file) ) { \n recurse_copy($src . '/' . $file,$dst . '/' . $file); \n } \n else { \n if(!copy($src . '/' . $file,$dst . '/' . $file)) {\n echo (\"Failed to copy\");\n } \n } \n } \n } \n closedir($dir); \n }", "function copydir($src, $dst) {\n // open the source directory\n $dir = opendir($src);\n // Make the destination directory if not exist\n @mkdir($dst);\n // Loop through the files in source directory\n foreach (scandir($src) as $file) {\n if (( $file != '.' ) && ( $file != '..' )) {\n if ( is_dir($src . '/' . $file) )\n {\n // Recursively calling custom copy function\n // for sub directory\n copydir($src . '/' . $file, $dst . '/' . $file);\n }\n else {\n copy($src . '/' . $file, $dst . '/' . $file);\n }\n }\n }\n closedir($dir);\n}", "function copy_directory( $src, $dst ) {\r\n $dir = opendir( $src );\r\n @mkdir( $dst );\r\n while ( false !== ( $file = readdir( $dir )) ) {\r\n if ( ( $file != '.' ) && ( $file != '..' ) ) {\r\n if ( is_dir( $src . '/' . $file ) ) {\r\n recurse_copy( $src . '/' . $file, $dst . '/' . $file );\r\n } else {\r\n copy( $src . '/' . $file, $dst . '/' . $file );\r\n }\r\n }\r\n }\r\n closedir( $dir );\r\n }", "public function recurseCopy($src,$dst) { \n $dir = opendir($src); \n @mkdir($dst); \n while(false !== ( $file = readdir($dir)) ) { \n if (( $file != '.' ) && ( $file != '..' )) { \n if ( is_dir($src . '/' . $file) ) { \n recurseCopy($src . '/' . $file,$dst . '/' . $file); \n } \n else { \n copy($src . '/' . $file,$dst . '/' . $file); \n } \n } \n } \n closedir($dir); \n }", "function recursive_copy($src,$dst) { \r\n\t $dir = opendir($src); \r\n\t @mkdir($dst); \r\n\t while(false !== ( $file = readdir($dir)) ) { \r\n\t if (( $file != '.' ) && ( $file != '..' )) { \r\n\t if ( is_dir($src . '/' . $file) ) { \r\n\t recursive_copy($src . '/' . $file,$dst . '/' . $file); \r\n\t } \r\n\t else { \r\n\t copy($src . '/' . $file,$dst . '/' . $file); \r\n\t } \r\n\t } \r\n\t } \r\n\t closedir($dir); \r\n\t}", "public static function recurse_copy($src,$dst)\n {\n $dir = opendir($src);\n @mkdir($dst);\n while(false !== ( $file = readdir($dir)) ) {\n if (( $file != '.' ) && ( $file != '..' )) {\n if ( is_dir($src . '/' . $file) ) {\n self::recurse_copy($src . '/' . $file,$dst . '/' . $file);\n }\n else {\n copy($src . '/' . $file,$dst . '/' . $file);\n }\n }\n }\n closedir($dir);\n }", "function recurse_copy(string $src, string $dst) : void {\n\t$dir = opendir($src);\n\t@mkdir($dst);\n\twhile(false !== ( $file = readdir($dir)) ) {\n\t\tif (( $file != '.' ) && ( $file != '..' )) {\n\t\t\tif ( is_dir($src . '/' . $file) ) {\n\t\t\t\trecurse_copy($src . '/' . $file,$dst . '/' . $file);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcopy($src . '/' . $file,$dst . '/' . $file);\n\t\t\t}\n\t\t}\n\t}\n\tclosedir($dir);\n}", "function recursive_copy($src, $dst): void\n{\n $dir = opendir($src);\n if (!@mkdir($dst) && !is_dir($dst)) {\n throw new RuntimeException(sprintf('Directory \"%s\" was not created', $dst));\n }\n while (($file = readdir($dir))) {\n if (($file !== '.') && ($file !== '..')) {\n if (is_dir($src . '/' . $file)) {\n recursive_copy($src . '/' . $file, $dst . '/' . $file);\n } else {\n copy($src . '/' . $file, $dst . '/' . $file);\n }\n }\n }\n closedir($dir);\n}", "function recurse_copy($src,$dst) {\n\t\t$dir = opendir($src);\n\t\t@mkdir($dst);\n\t\twhile(false !== ( $file = readdir($dir)) ) {\n\t\t\tif (( $file != '.' ) && ( $file != '..' )) {\n\t\t\t\tif ( is_dir($src . '/' . $file) ) {\n\t\t\t\t\t$this->recurse_copy($src . '/' . $file,$dst . '/' . $file);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tcopy($src . '/' . $file,$dst . '/' . $file);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tclosedir($dir);\n\t}", "function copy_directory($source, $destination) {\n if ($source == '.' || $source == '..') {\n return;\n }\n if (is_dir($source)) {\n @mkdir($destination);\n $directory = dir($source);\n while (false !== ($read_directory = $directory->read())) {\n if ($read_directory == '.' || $read_directory == '..') {\n continue;\n }\n $path_dir = $source . '/' . $read_directory;\n if (is_dir($path_dir)) {\n copy_directory($path_dir, $destination . '/' . $read_directory);\n continue;\n }\n copy($path_dir, $destination . '/' . $read_directory);\n }\n \n $directory->close();\n } else {\n copy($source, $destination);\n }\n}", "function copy_dir_with_files($src, $dst)\n{\n $dir = opendir($src);\n\n // Make the destination directory if not exist\n @mkdir($dst);\n\n // Loop through the files in source directory\n while ($file = readdir($dir)) {\n\n if (($file != '.') && ($file != '..')) {\n if (is_dir($src . '/' . $file)) {\n\n // Recursively calling custom copy function\n // for sub directory\n custom_copy($src . '/' . $file, $dst . '/' . $file);\n\n } else {\n copy($src . '/' . $file, $dst . '/' . $file);\n }\n }\n }\n\n closedir($dir);\n}", "function copy_directory($source, $destination)\n{\n\tmkdir($destination);\n\t$directory = dir($source);\n\twhile ( FALSE !== ( $readdirectory = $directory->read() ) )\n\t{\n\t\tif ( $readdirectory == '.' || $readdirectory == '..' )\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\t\t$pathDir = $source . '/' . $readdirectory; \n\t\tif (is_dir($pathDir)) // recursively copies subdirectories\n\t\t{\n\t\t\tcopy_directory($pathDir, $destination . '/' . $readdirectory );\n\t\t\tcontinue;\n\t\t}\n\t\tif (copy( $pathDir, $destination . '/' . $readdirectory ))\n\t\t{\n\t\t\techo \"Successfully copied $pathDir.\\n\";\n\t\t}\n\t}\n\t$directory->close();\n}", "private static function recursiveCopy($path, $destination) {\n\t\tif (is_dir($path)) {\n\t\t\tif (!file_exists($destination)) {\n\t\t\t\tmkdir($destination);\n\t\t\t}\n\n\t\t\t$handle = opendir($path);\n\t\t\twhile (false !== ($file = readdir($handle))) {\n\t\t\t\tif ($file != '..' && $file[0] != '.') {\n\t\t\t\t\tself::recursiveCopy($path.'/'.$file, $destination.'/'.$file);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tclosedir($handle);\n\t\t} else {\n\t\t\tcopy($path, $destination);\n\t\t}\n\t}", "function custom_copy($src, $dst) {\n $dir = opendir($src); \n \n // Make the destination directory if not exist \n @mkdir($dst); \n \n // Loop through the files in source directory \n while( $file = readdir($dir) ) { \n \n if (( $file != '.' ) && ( $file != '..' )) { \n if ( is_dir($src . '/' . $file) ) \n { \n \n // Recursively calling custom copy function \n // for sub directory \n custom_copy($src . '/' . $file, $dst . '/' . $file); \n \n } \n else { \n copy($src . '/' . $file, $dst . '/' . $file); \n } \n } \n } \n \n closedir($dir); \n }", "function copyDirectory($src, $dest){\n if(!is_dir($src)) return false;\n\n // If the destination directory does not exist create it\n if(!is_dir($dest)) {\n if(!mkdir($dest)) {\n // If the destination directory could not be created stop processing\n return false;\n }\n }\n\n // Open the source directory to read in files\n $i = new DirectoryIterator($src);\n foreach($i as $f) {\n if($f->isFile()) {\n copy($f->getRealPath(), \"$dest/\" . $f->getFilename());\n } else if(!$f->isDot() && $f->isDir()) {\n copyDirectory($f->getRealPath(), \"$dest/$f\");\n }\n }\n\n}", "private function copyFolderRecursively($from, $to) { \n\t\t\t$dir = opendir($from); \n\t\t\t@mkdir($to);\n\t\t \n\t\t while (false !== ($item = readdir($dir))) { \n\t\t if (($item == '.') or ($item == '..')) continue;\n\t\t \n\t\t $source = $from.DIRECTORY_SEPARATOR.$item;\n\t\t $target = $to.DIRECTORY_SEPARATOR.$item;\n\t\t \n\t\t\t\tif (is_dir($source))\n\t\t\t\t\t$this->copyFolderRecursively($source, $target);\n\t\t\t\telse\n\t\t\t\t\tcopy($source, $target);\n\t\t } \n\t\t closedir($dir);\n\t\t return TRUE; \n\t\t}", "function folder_recurse($src,$dst, $action = 'copy') {\n $dir = opendir($src);\n @mkdir($dst);\n while(false !== ( $file = readdir($dir)) ) {\n if (( $file != '.' ) && ( $file != '..' )) {\n if ( is_dir($src . '/' . $file) ) {\n folder_recurse($src . '/' . $file,$dst . '/' . $file, $action);\n }\n else {\n\n $action($src . '/' . $file,$dst . '/' . $file);\n }\n }\n }\n closedir($dir);\n }", "function copyDirectory($srcDir, $dstDir)\n{\n $dir = opendir($srcDir);\n if (!$dir)\n return false;\n\n while (($entry = readdir($dir)) !== false) {\n if (strcmp($entry, \".\") == 0 || strcmp($entry, \"..\") == 0) {\n continue;\n }\n $src = joinPathComponents($srcDir, $entry);\n $dst = joinPathComponents($dstDir, $entry);\n\n if (is_dir($src)) {\n if (!file_exists($dst))\n mkdir($dst);\n if (!copyDirectory($src, $dst))\n return false;\n } else {\n if (!is_file($dst)) {\n if (!copy($src, $dst))\n return false;\n }\n }\n }\n return true;\n}", "public static function deepCopy($source, $destination)\n\t{\n\t\t$dir = opendir($source);\n\t\t@mkdir($destination);\n\n\t\twhile (false !== ($file = readdir($dir))) {\n\t\t\tif (($file != '.') && ($file != '..')) {\n\t\t\t\tif (is_dir(\"$source/$file\")) {\n\t\t\t\t\tstatic::deepCopy(\"$source/$file\", \"$destination/$file\");\n\t\t\t\t} else {\n\t\t\t\t\tstatic::copyFile(\"$source/$file\", \"$destination/$file\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tclosedir($dir);\n\t}", "function copiar ($desde, $hasta){ \n mkdir($hasta, 0777); \n $this_path = getcwd(); \n if(is_dir($desde)) { \n chdir($desde); \n $handle=opendir('.'); \n while(($file = readdir($handle))!==false){ \n if(($file != \".\") && ($file != \"..\")){ \n if(is_dir($file)){ \n copiar($desde.$file.\"/\", $hasta.$file.\"/\"); \n chdir($desde); \n } \n if(is_file($file)){ \n copy($desde.$file, $hasta.$file); \n } \n } \n } \n closedir($handle); \n } \n}", "public static function rcopy($src,$dst) { //dd($src);\n $dir = opendir($src); \n @mkdir($dst); \n while(false !== ( $file = readdir($dir)) ) { \n if (( $file != '.' ) && ( $file != '..' )) { \n if ( is_dir($src . '/' . $file) ) { \n self::rcopy($src . '/' . $file,$dst . '/' . $file); \n } \n else { \n copy($src . '/' . $file,$dst . '/' . $file); \n } \n } \n } \n closedir($dir); \n }", "function publisher_copyr($source, $dest)\r\n{\r\n // Simple copy for a file\r\n if (is_file($source)) {\r\n return copy($source, $dest);\r\n }\r\n\r\n // Make destination directory\r\n if (!is_dir($dest)) {\r\n mkdir($dest);\r\n }\r\n\r\n // Loop through the folder\r\n $dir = dir($source);\r\n while (false !== $entry = $dir->read()) {\r\n // Skip pointers\r\n if ($entry == '.' || $entry == '..') {\r\n continue;\r\n }\r\n\r\n // Deep copy directories\r\n if (is_dir(\"$source/$entry\") && ($dest !== \"$source/$entry\")) {\r\n copyr(\"$source/$entry\", \"$dest/$entry\");\r\n } else {\r\n copy(\"$source/$entry\", \"$dest/$entry\");\r\n }\r\n }\r\n\r\n // Clean up\r\n $dir->close();\r\n return true;\r\n}", "abstract public function copyLocalDir($from, $to);", "function copyDirRecursive($source, $dest, $dirname='', $privileges=0777)\n {\n static $orgdest = null;\n\n if (is_null($orgdest))\n $orgdest = $dest;\n\n atkdebug(\"Checking write permission for \".$orgdest);\n\n if (!atkFileUtils::is_writable($orgdest))\n {\n atkdebug(\"Error no write permission!\");\n return false;\n }\n\n atkdebug(\"Permission granted to write.\");\n\n if ($dest == $orgdest && $dirname != '')\n {\n mkdir($orgdest . \"/\" . $dirname,$privileges);\n return atkFileUtils::copyDirRecursive($source,$orgdest.\"/\".$dirname,'',$privileges);\n }\n\n // Simple copy for a file\n if (is_file($source))\n {\n $c = copy($source, $dest);\n\n chmod($dest, $privileges);\n\n return $c;\n }\n\n // Make destination directory\n if (!is_dir($dest))\n {\n if ($dest != $orgdest && !is_dir($orgdest.'/'.$dirname) && $dirname != '')\n $dest = $orgdest.'/'.$dirname;\n\n $oldumask = umask(0);\n\n mkdir($dest, $privileges);\n\n umask($oldumask);\n }\n\n // Loop through the folder\n $dir = dir($source);\n\n while (false !== $entry = $dir->read())\n {\n // Skip pointers\n if ($entry == '.' || $entry == '..')\n continue;\n\n // Deep copy directories\n if ($dest !== \"$source/$entry\")\n atkFileUtils::copyDirRecursive(\"$source/$entry\", \"$dest/$entry\", $dirname, $privileges);\n }\n\n // Clean up\n $dir->close();\n\n return true;\n }", "function copy_recursively($src, $dest) {\n global $exc;\n\n $trace = '';\n $trace .= \"Copy Recursive: $src $dest<br/>\";\n\n $excludeDirsNames = isset($exc[\"folders\"]) ? $exc[\"folders\"] : array();\n $excludeFileNames =isset($exc[\"files\"]) ? $exc[\"files\"] : array();\n\n if (is_dir(''.$src)){\n @mkdir($dest);\n $files = scandir($src);\n\n foreach ($files as $file){\n if (!in_array(getRootName($dest), $excludeDirsNames)){\n if ($file != \".\" && $file != \"..\"){\n $trace.= copy_recursively(\"$src/$file\", \"$dest/$file\");\n } \n }\n }\n }\n else if (file_exists($src)){\n $filename = pathinfo($src, PATHINFO_FILENAME);\n //$filename = $filename[count( $filename)-2];\n if (!in_array( $filename, $excludeFileNames)){\n copy($src, $dest);\n }\n }\n\n return $trace;\n}", "public static function copyFolder($from, $to)\n\t{\n\t\t$dir = opendir($from);\n\t\t\n\t\tself::mkdir($to);\n\t\t\n\t\twhile (false !== ($file = readdir($dir))) {\n\t\t\tif ($file != '.' && $file != '..') {\n\t\t\t\tif (is_dir($from.'/'.$file)) {\n\t\t\t\t\tself::copyFolder($from.'/'.$file, $to.'/'.$file);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (!copy($from.'/'.$file, $to.'/'.$file)) {\n\t\t\t\t\t\tthrow new Exception('Error recur. copying file to: ' . $to . '/' . $file);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tclosedir($dir);\n\t}", "public static function copyDirectory($src,$dst,$options=array())\n\t{\n\t\t$fileTypes=array();\n\t\t$exclude=array();\n\t\t$level=-1;\n\t\textract($options);\n\t\tif(!is_dir($dst))\n\t\t\tself::createDirectory($dst,isset($options['newDirMode'])?$options['newDirMode']:null,true);\n\n\t\tself::copyDirectoryRecursive($src,$dst,'',$fileTypes,$exclude,$level,$options);\n\t}", "function copyr($source, $dest, $overwrite = false)\n{\n // Simple copy for a file\n if (is_file($source)) {\n return copy($source, $dest);\n }\n\n // Make destination directory\n if (!is_dir($dest)) {\n mkdir($dest);\n }\n\n // If the source is a symlink\n if (is_link($source)) {\n $link_dest = readlink($source);\n return symlink($link_dest, $dest);\n }\n\n // Loop through the folder\n $dir = dir($source);\n while (false !== $entry = $dir->read()) {\n // Skip pointers\n if ($entry == '.' || $entry == '..') {\n continue;\n }\n\n // Deep copy directories\n if ($dest !== \"$source/$entry\") {\n if ($overwrite || !is_file(\"$dest/$entry\")) {\n copyr(\"$source/$entry\", \"$dest/$entry\");\n } else {\n return false;\n }\n }\n }\n\n // Clean up\n $dir->close();\n return true;\n}", "function recursive_copy($source,$destination) {\n\t $counter = 0;\n\t if (substr($source,strlen($source),1)!=\"/\") $source .= \"/\";\n\t if (substr($destination,strlen($destination),1)!=\"/\") $destination .= \"/\";\n\t if (!is_dir($destination)) makeDirs($destination);\n\t $itens = listFiles($source);\n\t foreach($itens as $id => $name) {\n\t if ($name[0] == \"/\") $name = substr($name,1);\n\t if (is_file($source.$name)) { // file\n\t \tif ($name != \"Thumbs.db\") {\n\t\t $counter ++;\n\t\t if (!copy ($source.$name,$destination.$name))\n\t\t echo \"Error: \".$source.$name.\" -> \".$destination.$name.\"<br/>\";\n\t\t else\n\t\t safe_chmod($destination.$name,0775);\n\t \t} else\n\t \t\t@unlink($source.$name);\n\t } else if(is_dir($source.$name)) { // dir\n\t if (!is_dir($destination.$name))\n\t safe_mkdir($destination.$name);\n\t $counter += recursive_copy($source.$name,$destination.$name);\n\t }\n\t }\n\t return $counter;\n\t}", "function copyr($source, $dest) {\n\t// Check for symlinks\n\tif (is_link($source)) {\n\t\treturn symlink(readlink($source), $dest);\n\t}\n\t\n\t// Simple copy for a file\n\tif (is_file($source)) {\n\t\treturn copy($source, $dest);\n\t}\n\n\t// Make destination directory\n\tif (!is_dir($dest)) {\n\t\tmkdir($dest);\n\t}\n\n\t// Loop through the folder\n\t$dir = dir($source);\n\twhile (false !== $entry = $dir->read()) {\n\t\t// Skip pointers\n\t\tif ($entry == '.' || $entry == '..') {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Deep copy directories\n\t\tcopyr(\"$source/$entry\", \"$dest/$entry\");\n\t}\n\n\t// Clean up\n\t$dir->close();\n\treturn true;\n}", "public function testCopyDirectoryMovesEntireDirectory()\n {\n mkdir(self::$temp.DS.'tmp', 0777, true);\n file_put_contents(self::$temp.DS.'tmp'.DS.'foo.txt', '');\n file_put_contents(self::$temp.DS.'tmp'.DS.'bar.txt', '');\n\n mkdir(self::$temp.DS.'tmp'.DS.'nested', 0777, true);\n file_put_contents(self::$temp.DS.'tmp'.DS.'nested'.DS.'baz.txt', '');\n\n Storage::cpdir(self::$temp.DS.'tmp', self::$temp.DS.'tmp2');\n\n $this->assertTrue(is_dir(self::$temp.DS.'tmp2'));\n $this->assertTrue(is_file(self::$temp.DS.'tmp2'.DS.'foo.txt'));\n $this->assertTrue(is_file(self::$temp.DS.'tmp2'.DS.'bar.txt'));\n $this->assertTrue(is_dir(self::$temp.DS.'tmp2'.DS.'nested'));\n $this->assertTrue(is_file(self::$temp.DS.'tmp2'.DS.'nested'.DS.'baz.txt'));\n }", "function rcopy($src, $dest) {\n // If source is not a directory stop processing\n if (!is_dir($src)) {\n return FALSE;\n }\n\n // If the destination directory does not exist create it\n if (!is_dir($dest)) {\n if (!mkdir($dest)) {\n // If the destination directory could not be created stop processing\n return FALSE;\n }\n }\n\n // Open the source directory to read in files\n $i = new DirectoryIterator($src);\n foreach ($i as $f) {\n if ($f->isFile()) {\n copy($f->getRealPath(), \"$dest/\" . $f->getFilename());\n }\n else {\n if (!$f->isDot() && $f->isDir()) {\n rcopy($f->getRealPath(), \"$dest/$f\");\n }\n }\n }\n\n return TRUE;\n}", "static public function copy($src, $dst) \n {\n if (is_file($src)) {\n if (!file_exists($f = dirname($dst))) {\n mkdir($f, 0775, true);\n @chmod($f, 0775); // let @, if www-data is not owner but allowed to write\n }\n copy($src, $dst);\n return;\n }\n if (is_dir($src)) {\n $src = rtrim($src, '/');\n $dst = rtrim($dst, '/');\n if (!file_exists($dst)) {\n mkdir($dst, 0775, true);\n @chmod($dst, 0775); // let @, if www-data is not owner but allowed to write\n }\n $handle = opendir($src);\n while (false !== ($entry = readdir($handle))) {\n if ($entry[0] == '.') continue;\n self::copy($src . '/' . $entry, $dst . '/' . $entry);\n }\n closedir($handle);\n }\n }", "public static function copyDir(string $src, string $dst)\n {\n $dir = opendir($src);\n @mkdir($dst);\n while (false !== ($file = readdir($dir))) {\n if (($file != '.') && ($file != '..')) {\n if (is_dir($src . '/' . $file)) {\n static::copyDir($src . '/' . $file, $dst . '/' . $file);\n } else {\n copy($src . '/' . $file, $dst . '/' . $file);\n }\n }\n }\n closedir($dir);\n }", "public function copy($from, $to)\n\t{\n\t\tif(is_dir($from))\n\t\t\t$this->recurse_copy($from, $this->base_location . \"/\" . $to);\n\t\telse\n\t\t\tcopy($from, $this->base_location . \"/\" . $to);\t\t\n\t}", "function copyDirToDir( $sDirFrom, $sDirTo ){\n if( is_dir( $sDirFrom ) && is_dir( $sDirTo ) ){\n foreach( new DirectoryIterator( $sDirFrom ) as $oFileDir ){\n if( $oFileDir->isFile( ) && !is_file( $sDirTo.$oFileDir->getFilename( ) ) ){\n copy( $sDirFrom.$oFileDir->getFilename( ), $sDirTo.$oFileDir->getFilename( ) );\n }\n } // end foreach\n }\n}", "public function copyDir($src, $dst)\n {\n if (is_link($src)) {\n symlink(readlink($src), $dst);\n } elseif (is_dir($src)) {\n if (is_dir($dst) === false) {\n mkdir($dst, 0775, true);\n }\n // copy files recursive\n foreach (scandir($src) as $file) {\n if ($file != '.' && $file != '..') {\n $this->copyDir(\"$src/$file\", \"$dst/$file\");\n }\n }\n\n } elseif (is_file($src)) {\n copy($src, $dst);\n } else {\n // do nothing, we didn't have a directory to copy\n }\n }", "function copyr($source, $dest) {\n\n // Check for symlinks\n if (is_link($source)) {\n return symlink(readlink($source), $dest);\n }\n\n // Simple copy for a file\n if (is_file($source)) {\n return copy($source, $dest);\n }\n\n if (!is_dir($dest)) {\n mkdir($dest, 0755);\n }\n\n // Loop through the folder\n $dir = dir($source);\n while (false !== $entry = $dir->read()) {\n // Skip pointers\n if ($entry == '.' || $entry == '..') {\n continue;\n }\n\n // Deep copy directories\n $this->copyr(\"$source/$entry\", \"$dest/$entry\");\n }\n\n // Clean up\n $dir->close();\n return true;\n }", "public function testCopy() {\n $sourceDirName = self::TEST_DIR . '/testCopyDirectorySource';\n $targetDirName = self::TEST_DIR . '/testCopyDirectoryTarget';\n\n mkdir($sourceDirName);\n\n $directoryHandle = new Directory($sourceDirName);\n\n $directoryHandle->copy(new Directory($targetDirName));\n\n $this->assertDirectoryExists($targetDirName);\n $this->assertDirectoryExists($sourceDirName);\n }", "protected function copyRecursive($src, $dst)\n {\n // if $src is a normal file we can do a regular copy action\n if (is_file($src)) {\n copy($src, $dst);\n return;\n }\n\n $dir = opendir($src);\n if (!$dir) {\n throw new Exception('Unable to locate path \"' . $src . '\"');\n }\n\n // check if the folder exists, otherwise create it\n if ((!file_exists($dst)) && (false === mkdir($dst))) {\n throw new Exception('Unable to create folder \"' . $dst . '\"');\n }\n\n while (false !== ($file = readdir($dir))) {\n if (($file != '.') && ($file != '..')) {\n if (is_dir($src . '/' . $file)) {\n $this->copyRecursive($src . '/' . $file, $dst . '/' . $file);\n } else {\n copy($src . '/' . $file, $dst . '/' . $file);\n }\n }\n }\n closedir($dir);\n }", "function copy($source, $dest, $options=array('folderPermission'=>0755,'filePermission'=>0755))\n\t{\n\t\t$result=false;\n\t\t\n\t\tif (is_file($source)) {\n\t\t\tif ($dest[strlen($dest)-1]=='/') {\n\t\t\t\tif (!file_exists($dest)) {\n\t\t\t\t\tcmfcDirectory::makeAll($dest,$options['folderPermission'],true);\n\t\t\t\t}\n\t\t\t\t$__dest=$dest.\"/\".basename($source);\n\t\t\t} else {\n\t\t\t\t$__dest=$dest;\n\t\t\t}\n\t\t\t$result=copy($source, $__dest);\n\t\t\tchmod($__dest,$options['filePermission']);\n\t\t\t\n\t\t} elseif(is_dir($source)) {\n\t\t\tif ($dest[strlen($dest)-1]=='/') {\n\t\t\t\tif ($source[strlen($source)-1]=='/') {\n\t\t\t\t\t//Copy only contents\n\t\t\t\t} else {\n\t\t\t\t\t//Change parent itself and its contents\n\t\t\t\t\t$dest=$dest.basename($source);\n\t\t\t\t\t@mkdir($dest);\n\t\t\t\t\tchmod($dest,$options['filePermission']);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($source[strlen($source)-1]=='/') {\n\t\t\t\t\t//Copy parent directory with new name and all its content\n\t\t\t\t\t@mkdir($dest,$options['folderPermission']);\n\t\t\t\t\tchmod($dest,$options['filePermission']);\n\t\t\t\t} else {\n\t\t\t\t\t//Copy parent directory with new name and all its content\n\t\t\t\t\t@mkdir($dest,$options['folderPermission']);\n\t\t\t\t\tchmod($dest,$options['filePermission']);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$dirHandle=opendir($source);\n\t\t\twhile($file=readdir($dirHandle))\n\t\t\t{\n\t\t\t\tif($file!=\".\" && $file!=\"..\")\n\t\t\t\t{\n\t\t\t\t\tif(!is_dir($source.\"/\".$file)) {\n\t\t\t\t\t\t$__dest=$dest.\"/\".$file;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$__dest=$dest.\"/\".$file;\n\t\t\t\t\t}\n\t\t\t\t\t//echo \"$source/$file ||| $__dest<br />\";\n\t\t\t\t\t$result=cmfcDirectory::copy($source.\"/\".$file, $__dest, $options);\n\t\t\t\t}\n\t\t\t}\n\t\t\tclosedir($dirHandle);\n\t\t\t\n\t\t} else {\n\t\t\t$result=false;\n\t\t}\n\t\treturn $result;\n\t}", "function copy_dir($source_dir, $destination_dir, $skip = null, $create_destination = false) {\n if(is_dir($source_dir)) {\n if(!is_dir($destination_dir)) {\n if(!$create_destination || !mkdir($destination_dir, 0777, true)) {\n return false;\n } // if\n } // if\n \n $result = true;\n \n $d = dir($source_dir);\n if($d) {\n while(false !== ($entry = $d->read())) {\n if($entry == '.' || $entry == '..') {\n continue;\n } // if\n \n if($skip && in_array($entry, $skip)) {\n continue;\n } // if\n \n if(is_dir(\"$source_dir/$entry\")) {\n $result = $result && copy_dir(\"$source_dir/$entry\", \"$destination_dir/$entry\", $skip, true);\n } elseif(is_file(\"$source_dir/$entry\")) {\n if(copy(\"$source_dir/$entry\", \"$destination_dir/$entry\")) {\n chmod(\"$destination_dir/$entry\", 0777);\n } else {\n $result = false;\n } // if\n } // if\n } // while\n } // if\n \n $d->close();\n return $result;\n } // if\n \n return false;\n }", "function cp_r ($from, $to, $skip = array())\n{\n\t$fromFile = basename($from);\n\tif (in_array($fromFile,$skip))\n\t\treturn false;\n\t\n\tif (!is_dir($from))\n\t\tcopy($from, $to . '/' . $fromFile);\n\telse\n\t{\n\t\tmkdir($to . '/' . $fromFile);\n\t\t$dir = array_diff(getTreeStructure($from, GTS_ALL),$skip);\n\t\tsort($dir);\n\t\t\n\t\tfor($i=0; $i<count($dir); $i++)\n\t\t{\n\t\t\tif (!is_dir($from . '/' . $dir[$i]))\n\t\t\t\tcopy($from . '/' . $dir[$i], $to . $fromFile . '/' . $dir[$i]);\n\t\t\telse\n\t\t\t\tmkdir($to . $fromFile . '/' . $dir[$i]);\n\t\t}\n\t\treturn true;\n\t}\n}", "public static function copyDirectory($src, $dst, $options = array())\n {\n $fileTypes = array();\n $exclude = array();\n $level = -1;\n extract($options);\n if(!is_dir($dst))\n {\n self::mkdir($dst, $options, true);\n }\n\n self::copyDirectoryRecursive($src, $dst, '', $fileTypes, $exclude, $level, $options);\n }", "function rcopy($src, $dst)\n{\n ini_set('max_execution_time', 0);\n set_time_limit(0);\n if (is_dir($src)) {\n if (!file_exists($dst)) : mkdir($dst);\n endif;\n $files = scandir($src);\n foreach ($files as $file) {\n if ($file != \".\" && $file != \"..\") {\n rcopy(\"$src/$file\", \"$dst/$file\");\n }\n }\n } elseif (file_exists($src)) {\n copy($src, $dst);\n }\n return true;\n}", "protected function copyImagesDirectory()\n\t{\n\t\t$params = $this->getParams();\n\n\t\tif ($params->path != '') {\n\t\t\t$date = JFactory::getDate()->toFormat('%Y%m%d');\n\n\t\t\t$src = JPATH_SITE.DS.'images';\n\t\t\t$dest = JPATH_SITE.DS.'images-backup-'.$date;\n\t\t\tJFolder::move($src, $dest);\n\n\t\t\t$src = $params->path.DS.'images';\n\t\t\t$dest = JPATH_SITE.DS.'images';\n\t\t\tJFolder::copy($src, $dest);\n\t\t}\n\t}", "function CopyDirectory($source='', $destination='')\n{\n\tif (!$source || !$destination) {\n\t\treturn false;\n\t}\n\n\tif (!is_dir($source)) {\n\t\treturn false;\n\t}\n\n\tif (!CreateDirectory($destination)) {\n\t\treturn false;\n\t}\n\n\t$files_to_copy = list_files($source, null, true);\n\n\t$status = true;\n\n\tif (is_array($files_to_copy)) {\n\t\tforeach ($files_to_copy as $pos => $name) {\n\t\t\tif (is_array($name)) {\n\t\t\t\t$dir = $pos;\n\t\t\t\t$status = CopyDirectory($source . '/' . $dir, $destination . '/' . $dir);\n\t\t\t}\n\n\t\t\tif (!is_array($name)) {\n\t\t\t\t$copystatus = copy($source . '/' . $name, $destination . '/' . $name);\n\t\t\t\tif ($copystatus) {\n\t\t\t\t\tchmod($destination . '/' . $name, 0644);\n\t\t\t\t}\n\t\t\t\t$status = $copystatus;\n\t\t\t}\n\t\t}\n\t\treturn $status;\n\t}\n\treturn false;\n}", "public function copyDir($originDir, $targetDir);", "public function copyRecursive(\n string $source_directory,\n string $destination_directory\n ) {\n $this->log('copyRecursive ['.$source_directory.'] to ['.$destination_directory.']');\n if (is_dir($source_directory)) {\n $directory_handle = dir($source_directory);\n } else {\n return false;\n }\n if (!is_object($directory_handle)) {\n $this->log('unable to create directory handle for source dir!');\n return false;\n }\n\n while (false !== ($file = $directory_handle->read())) {\n if (($file == '.') || ($file == '..')) {\n continue;\n }\n $source = $source_directory.DIRECTORY_SEPARATOR.$file;\n $target = $destination_directory.DIRECTORY_SEPARATOR.$file;\n if (is_dir($source)) {\n // create directory in the target\n if (!file_exists($target) && (true !== @mkdir($target, 0755, true))) {\n // get the reason why mkdir() fails\n $error = error_get_last();\n $this->log(\"Can't create directory $target, error message: {$error['message']}\");\n }\n // set the datetime\n if (false === @touch($target, filemtime($source))) {\n $this->log(\"Can't set the modification date/time for $target\");\n }\n // recursive call\n $this->copyRecursive(\n $source,\n $target\n );\n } else {\n $target_path = pathinfo($target,PATHINFO_DIRNAME);\n if (!file_exists($target_path) && (true !== @mkdir($target_path, 0755, true))) {\n // get the reason why mkdir() fails\n $error = error_get_last();\n $this->log(\"Can't create directory $target_path, error message: {$error['message']}\");\n }\n // copy file to the target\n if (true !== @copy($source, $target)) {\n $this->log(\"Can't copy file $source\");\n }\n // set the datetime\n if (false === @touch($target, filemtime($source))) {\n $this->log(\"Can't set the modification date/time for $file\");\n }\n }\n }\n $directory_handle->close();\n return true;\n }", "protected function copyDir($src, $dst)\n {\n $dir = @opendir($src);\n if (false === $dir) {\n throw new TaskException($this, \"Cannot open source directory '\" . $src . \"'\");\n }\n if (!is_dir($dst)) {\n mkdir($dst, $this->chmod, true);\n }\n while (false !== ($file = readdir($dir))) {\n if (in_array($file, $this->exclude)) {\n continue;\n }\n if (($file !== '.') && ($file !== '..')) {\n $srcFile = $src . '/' . $file;\n $destFile = $dst . '/' . $file;\n if (is_dir($srcFile)) {\n $this->copyDir($srcFile, $destFile);\n } else {\n $this->fs->copy($srcFile, $destFile, $this->overwrite);\n }\n }\n }\n closedir($dir);\n }", "public static function copy_dir($dir2copy, $dir_paste) {\r\n\t$dir2copy = './' . $dir2copy;\r\n\t$dir_paste = './' . $dir_paste;\r\n\tif (is_dir($dir2copy)) {\r\n\t if ($dh = opendir($dir2copy)) {\r\n\t\twhile (($file = readdir($dh)) !== false) {\r\n\t\t if (!is_dir($dir_paste))\r\n\t\t\tmkdir($dir_paste, 0777\r\n\t\t\t);\r\n\t\t if (is_dir($dir2copy . $file) && $file != '..' &&\r\n\t\t\t $file != '.')\r\n\t\t\tself::copy_dir($dir2copy . $file . '/', $dir_paste . $file . '/');\r\n\t\t elseif ($file != '..' && $file != '.')\r\n\t\t\tcopy($dir2copy . $file, $dir_paste . $file);\r\n\t\t}\r\n\t\tclosedir($dh);\r\n\t }\r\n\t}\r\n }", "function smartCopy($source, $dest, $options=array('folderPermission'=>0755, 'filePermission'=>0755)) \r\n{ \r\n\t$result=false; \r\n\t \r\n\tif (is_file($source)) \r\n\t{ \r\n\t\tif ($dest[strlen($dest)-1]=='/') \r\n\t\t{ \r\n\t\t\tif (!file_exists($dest)) \r\n\t\t\t{ \r\n\t\t\t\t cmfcDirectory::makeAll($dest,$options['folderPermission'],true); \r\n\t\t\t} \r\n\t\t\t\r\n\t\t\t$__dest = $dest . \"/\" . basename($source); \r\n\t\t}\r\n\t\telse \r\n\t\t{ \r\n\t\t\t$__dest=$dest; \r\n\t\t}\r\n\t\t\r\n\t\t$result=copy($source, $__dest); \r\n\t\t\r\n\t\tchmod($__dest,$options['filePermission']); \r\n\t\t \r\n\t } elseif(is_dir($source)) { \r\n\t\tif ($dest[strlen($dest)-1]=='/') { \r\n\t\t\tif ($source[strlen($source)-1]=='/') { \r\n\t\t\t\t//Copy only contents \r\n\t\t\t} else { \r\n\t\t\t\t//Change parent itself and its contents \r\n\t\t\t\t$dest=$dest.basename($source); \r\n\t\t\t\t@mkdir($dest); \r\n\t\t\t\tchmod($dest,$options['filePermission']); \r\n\t\t\t} \r\n\t\t} else { \r\n\t\t\tif ($source[strlen($source)-1]=='/') { \r\n\t\t\t\t//Copy parent directory with new name and all its content \r\n\t\t\t\t@mkdir($dest,$options['folderPermission']); \r\n\t\t\t\tchmod($dest,$options['filePermission']); \r\n\t\t\t} else { \r\n\t\t\t\t//Copy parent directory with new name and all its content \r\n\t\t\t\t@mkdir($dest,$options['folderPermission']); \r\n\t\t\t\tchmod($dest,$options['filePermission']); \r\n\t\t\t} \r\n\t\t}\r\n\r\n\t\t$dirHandle=opendir($source); \r\n\t\twhile($file=readdir($dirHandle)) \r\n\t\t{ \r\n\t\t\tif($file!=\".\" && $file!=\"..\") \r\n\t\t\t{ \r\n\t\t\t\tif(!is_dir($source.\"/\".$file)) { \r\n\t\t\t\t\t$__dest=$dest.\"/\".$file; \r\n\t\t\t\t} else { \r\n\t\t\t\t\t$__dest=$dest.\"/\".$file; \r\n\t\t\t\t} \r\n\t\t\t\t//echo \"$source/$file ||| $__dest<br />\"; \r\n\t\t\t\t$result=smartCopy($source.\"/\".$file, $__dest, $options); \r\n\t\t\t} \r\n\t\t} \r\n\t\tclosedir($dirHandle); \r\n\t\t \r\n\t} else { \r\n\t\t$result=false; \r\n\t} \r\n\treturn $result; \r\n}", "protected function cloneUploadsDirectory($from, $to)\n {\n if (file_exists($from) === false) {\n return false;\n } else {\n mkdir($to, 0755);\n\n foreach (\n $iterator = new \\RecursiveIteratorIterator(\n new \\RecursiveDirectoryIterator($from, \\RecursiveDirectoryIterator::SKIP_DOTS),\n \\RecursiveIteratorIterator::SELF_FIRST) as $item\n ) {\n if ($item->isDir()) {\n mkdir($to . DIRECTORY_SEPARATOR . $iterator->getSubPathName());\n } else {\n copy($item, $to . DIRECTORY_SEPARATOR . $iterator->getSubPathName());\n }\n }\n }\n }", "function copyr($source, $dest) {\n\tif (is_link($source)) {\n\t\treturn symlink(readlink($source), $dest);\n\t}\n\n\tif (is_file($source)) {\n\t\treturn copy($source, $dest);\n\t}\n\n\tif (!is_dir($dest)) {\n\t\tmkdir($dest);\n\t}\n\n\t$dir = dir($source);\n\twhile (false !== $entry = $dir->read()) {\n\t\tif ($entry == '.' || $entry == '..') {\n\t\t\tcontinue;\n\t\t}\n\t\tcopyr(\"$source/$entry\", \"$dest/$entry\");\n\t}\n\n\t// Clean up\n\t$dir->close();\n\treturn true;\n}", "public function copyDirectory($from_path, $to_path, $mode = 0 )\n\t{\n\t\t$this->errors\t= array();\n\t\t$mode\t\t\t= $mode ? $mode : IPS_FOLDER_PERMISSION;\n\t\t\n\t\t//-----------------------------------------\n\t\t// Strip off trailing slashes...\n\t\t//-----------------------------------------\n\t\t\n\t\t$from_path\t= rtrim( $from_path, '/' );\n\t\t$to_path\t= rtrim( $to_path, '/' );\n\t\n\t\tif ( ! is_dir( $from_path ) )\n\t\t{\n\t\t\t$this->errors[] = \"Could not locate directory '{$from_path}'\";\n\t\t\treturn false;\n\t\t}\n\t\n\t\tif ( ! is_dir( $to_path ) )\n\t\t{\n\t\t\tif ( ! @mkdir( $to_path, $mode ) )\n\t\t\t{\n\t\t\t\t$this->errors[] = \"Could not create directory '{$to_path}' please check the CHMOD permissions and re-try\";\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t@chmod( $to_path, $mode );\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ( is_dir( $from_path ) )\n\t\t{\n\t\t\t$handle = opendir($from_path);\n\t\t\t\n\t\t\twhile ( ($file = readdir($handle)) !== false )\n\t\t\t{\n\t\t\t\tif ( ($file != \".\") && ($file != \"..\") )\n\t\t\t\t{\n\t\t\t\t\tif ( is_dir( $from_path.\"/\".$file ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->copyDirectory( $from_path.\"/\".$file, $to_path.\"/\".$file );\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif ( is_file( $from_path.\"/\".$file ) )\n\t\t\t\t\t{\n\t\t\t\t\t\tcopy( $from_path.\"/\".$file, $to_path.\"/\".$file );\n\t\t\t\t\t\t@chmod( $to_path.\"/\".$file, IPS_FILE_PERMISSION );\n\t\t\t\t\t} \n\t\t\t\t}\n\t\t\t}\n\n\t\t\tclosedir($handle); \n\t\t}\n\t\t\n\t\tif ( ! count( $this->errors ) )\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}", "public static function copyr($src, $dst)\n {\n $dir = opendir($src);\n GeneratorHelper::createDir($dst);\n while (false !== ($file = readdir($dir))) {\n if (($file != '.') && ($file != '..')) {\n if (is_dir($src . '/' . $file)) {\n self::copyr($src . '/' . $file, $dst . '/' . $file);\n } elseif (@copy($src . '/' . $file, $dst . '/' . $file) === false) {\n throw new ConfigException(\"Can't copy \" . $src . \" to \" . $dst);\n }\n }\n }\n closedir($dir);\n }", "function fn_copy($source, $dest, $silent = true, $exclude_files = array())\n{\n /**\n * Ability to forbid file copy or change parameters\n *\n * @param string $source source file/directory\n * @param string $dest destination file/directory\n * @param boolean $silent silent flag\n * @param array $exclude files to exclude\n */\n fn_set_hook('copy_file', $source, $dest, $silent, $exclude_files);\n\n if (empty($source)) {\n return false;\n }\n\n // Simple copy for a file\n if (is_file($source)) {\n $source_file_name = fn_basename($source);\n if (in_array($source_file_name, $exclude_files)) {\n return true;\n }\n if (@is_dir($dest)) {\n $dest .= '/' . $source_file_name;\n }\n if (filesize($source) == 0) {\n $fd = fopen($dest, 'w');\n fclose($fd);\n $res = true;\n } else {\n $res = @copy($source, $dest);\n }\n @chmod($dest, DEFAULT_FILE_PERMISSIONS);\n clearstatcache(true, $dest);\n\n return $res;\n }\n\n // Make destination directory\n if ($silent == false) {\n $_dir = strpos($dest, Registry::get('config.dir.root')) === 0 ? str_replace(Registry::get('config.dir.root') . '/', '', $dest) : $dest;\n fn_set_progress('echo', $_dir . '<br/>');\n }\n\n // Loop through the folder\n if (@is_dir($source)) {\n\n if (!fn_mkdir($dest)) {\n return false;\n }\n \n $dir = dir($source);\n while (false !== $entry = $dir->read()) {\n // Skip pointers\n if ($entry == '.' || $entry == '..') {\n continue;\n }\n\n // Deep copy directories\n if ($dest !== $source . '/' . $entry) {\n if (fn_copy($source . '/' . $entry, $dest . '/' . $entry, $silent, $exclude_files) == false) {\n return false;\n }\n }\n }\n\n // Clean up\n $dir->close();\n\n return true;\n } else {\n return false;\n }\n}", "protected function rcopy($src, $dest){\n\n // If source is not a directory stop processing\n if(!is_dir($src)) return false;\n\n // If the destination directory does not exist create it\n if(!is_dir($dest)) {\n if(!mkdir($dest)) {\n // If the destination directory could not be created stop processing\n return false;\n }\n }\n\n // Open the source directory to read in files\n $i = new \\DirectoryIterator($src);\n foreach($i as $f) {\n if($f->isFile()) {\n copy($f->getRealPath(), \"$dest/\" . $f->getFilename());\n } else if(!$f->isDot() && $f->isDir()) {\n $this->rcopy($f->getRealPath(), \"$dest/$f\");\n }\n }\n }", "function migrate_multisite_files_copy($source, $dest) \n{ \n\tglobal $files_copied;\n\t\n if (is_file($source)) { \n \t\n \t$dest_dir;\n \tif (is_dir($dest)) {\n\t \t$dest_dir = $dest;\n \t}\n \telse {\n\t \t$dest_dir = dirname($dest);\n \t}\n\n \t// ensure destination exists\n if (!file_exists($dest_dir)) { \n wp_mkdir_p($dest_dir); \n } \n \n //echo \"copy $source -> $dest<br />\";\n copy($source, $dest);\n $files_copied++;\n \n } elseif(is_dir($source)) { \n \n \t// if source is a directory, create corresponding \n \t// directory structure at destination location\n if ($dest[strlen($dest)-1]=='/') { \n if ('/' != $source[strlen($source)-1]) { \n $dest=path_join($dest , basename($source)); \n } \n }\n \n $dirHandle=opendir($source); \n while($file=readdir($dirHandle)) \n { \n if($file!=\".\" && $file!=\"..\") \n { \n \t// recursively copy each file\n $new_dest = path_join($dest , $file);\n $new_source = path_join($source , $file);\n \n //echo \"$new_source -> $new_dest<br />\"; \n migrate_multisite_files_copy($new_source, $new_dest); \n } \n } \n closedir($dirHandle); \n } \n}", "public static function copy($src,$dst) {\n\t if (self::has_directory($src)) {\n\t\t\tif(!self::has_directory($dst)) {\n\t\t\t\tself::create_directory($dst);\n\t\t\t}\n\t $files = scandir($src);\n\t foreach ($files as $file) {\n\t\t\t\tif ($file != \".\" && $file != \"..\") {\n\t\t\t\t\tself::copy(\"$src/$file\", \"$dst/$file\");\n\t\t\t\t}\n\t\t\t}\n\t } else if (self::has_file($src)) { \n\t\t\t\treturn copy($src,$dst);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "protected function recursiveConditionalCopy($source, $dest, $ignored = array())\n\t{\n\t\t// Make sure source and destination exist\n\t\tif (!@is_dir($source))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif (!@is_dir($dest))\n\t\t{\n\t\t\tif (!@mkdir($dest, 0755))\n\t\t\t{\n\t\t\t\tJFolder::create($dest, 0755);\n\t\t\t}\n\t\t}\n\n\t\tif (!@is_dir($dest))\n\t\t{\n\t\t\t$this->log(__CLASS__ . \": Cannot create folder $dest\");\n\n\t\t\treturn;\n\t\t}\n\n\t\t// List the contents of the source folder\n\t\ttry\n\t\t{\n\t\t\t$di = new DirectoryIterator($source);\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Process each entry\n\t\tforeach ($di as $entry)\n\t\t{\n\t\t\t// Ignore dot dirs (. and ..)\n\t\t\tif ($entry->isDot())\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$sourcePath = $entry->getPathname();\n\t\t\t$fileName = $entry->getFilename();\n\n\t\t\t// Do not copy ignored files\n\t\t\tif (!empty($ignored) && in_array($fileName, $ignored))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If it's a directory do a recursive copy\n\t\t\tif ($entry->isDir())\n\t\t\t{\n\t\t\t\t$this->recursiveConditionalCopy($sourcePath, $dest . DIRECTORY_SEPARATOR . $fileName);\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If it's a file check if it's missing or identical\n\t\t\t$mustCopy = false;\n\t\t\t$targetPath = $dest . DIRECTORY_SEPARATOR . $fileName;\n\n\t\t\tif (!@is_file($targetPath))\n\t\t\t{\n\t\t\t\t$mustCopy = true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$sourceSize = @filesize($sourcePath);\n\t\t\t\t$targetSize = @filesize($targetPath);\n\n\t\t\t\t$mustCopy = $sourceSize != $targetSize;\n\t\t\t}\n\n\t\t\tif (!$mustCopy)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (!@copy($sourcePath, $targetPath))\n\t\t\t{\n\t\t\t\tif (!JFile::copy($sourcePath, $targetPath))\n\t\t\t\t{\n\t\t\t\t\t$this->log(__CLASS__ . \": Cannot copy $sourcePath to $targetPath\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private function copy_site_files($path, $dest) {\n\tif (is_dir($path)) {\n\t\t@mkdir($dest);\n\t\t$objects = scandir($path);\n\t\tif (sizeof($objects) > 0) {\n\t\t\tforeach ($objects as $file) {\n\t\t\t\tif ($file == \".\" || $file == \"..\") {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// go on\n\t\t\t\tif (is_dir($path . \"/\" . $file)) {\n\t\t\t\t\tif ((!in_array($file, $this->ignore_directories)) && ($file != $this->copy_directory)) {\n\t\t\t\t\t\t$this->copy_site_files($path . \"/\" . $file, $dest . \"/\" . $file);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tcopy($path . \"/\" . $file, $dest . \"/\" . $file);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->structure_copied = TRUE;\n\t\treturn TRUE;\n\t} elseif (is_file($path)) {\n\t\t$this->structure_copied = TRUE;\n\t\treturn copy($path, $dest);\n\t} else {\n\t\t$this->structure_copied = TRUE;\n\t\treturn FALSE;\n\t}\n}", "public static function copyr($source, $dest, $filter=''){\n if (is_file($source)){\n if(eregi(pathinfo($source, PATHINFO_EXTENSION), $filter)){\n return false;\n }\n return copy($source, $dest);\n }\n\n // Make destination directory\n if (!is_dir($dest)) {\n mkdir($dest);\n }\n\n // Loop through the folder\n $dir = dir($source);\n while (false !== $entry = $dir->read()) {\n // Skip pointers\n if ($entry == '.' || $entry == '..') {\n continue;\n }\n // Deep copy directories\n if ($dest !== \"$source/$entry\") {\n self::copyr(\"$source/$entry\", \"$dest/$entry\", $filter);\n }\n }\n // Clean up\n $dir->close();\n return true;\n }", "private function _cloneDirectory($source, $destination)\n\t{\n\t\tif (is_file($source) and ! is_dir($destination)) {\n\t\t\t$destination = normalize_path($destination, false);\n\t\t\t$source = normalize_path($source, false);\n\t\t\t$destinationDir = dirname($destination);\n\t\t\tif (! is_dir($destinationDir)) {\n\t\t\t\tmkdir_recursive($destinationDir);\n\t\t\t}\n\t\t\tif (! is_writable($destination)) {\n\t\t\t\t// return;\n\t\t\t}\n\n\t\t\treturn @copy($source, $destination);\n\t\t}\n\n\t\tif (! is_dir($destination)) {\n\t\t\tmkdir_recursive($destination);\n\t\t}\n\n\t\tif (is_dir($source)) {\n\t\t\t$dir = dir($source);\n\t\t\tif ($dir != false) {\n\t\t\t\twhile (false !== $entry = $dir->read()) {\n\t\t\t\t\tif ($entry == '.' || $entry == '..') {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif ($destination !== \"$source/$entry\" and $destination !== \"$source\" . DS . \"$entry\") {\n\t\t\t\t\t\t$this->_cloneDirectory(\"$source/$entry\", \"$destination/$entry\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$dir->close();\n\t\t}\n\n\t\treturn true;\n\t}", "public function copyDir($sFrom, $sTo)\n {\n return $this->recursiveDirIterator($sFrom, $sTo, self::COPY_FUNC_NAME);\n }", "static public function rcopy ( $src, $dst ) {\n\n\t\tif ( file_exists( $dst ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( is_dir( $src ) ) {\n\t\t\tmkdir( $dst );\n\t\t\t$files = scandir( $src );\n\t\t\tforeach ( $files as $file ) {\n\t\t\t\tif ( $file != \".\" && $file != \"..\" ) {\n\t\t\t\t\tself::rcopy( \"$src/$file\", \"$dst/$file\" );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if ( file_exists( $src ) ) {\n\t\t\tcopy( $src, $dst );\n\t\t}\n\n\t\treturn true;\n\t}", "function smartCopy($source, $dest, $options=array('folderPermission'=>0777,'filePermission'=>0777)) \n{ \n $result=false; \n \n if (is_file($source)) { \n if ($dest[strlen($dest)-1]=='/') { \n if (!file_exists($dest)) { \n cmfcDirectory::makeAll($dest,$options['folderPermission'],true); \n } \n $__dest=$dest.\"/\".basename($source); \n } else { \n $__dest=$dest; \n } \n $result=copy($source, $__dest); \n chmod($__dest,$options['filePermission']); \n \n } elseif(is_dir($source)) { \n if ($dest[strlen($dest)-1]=='/') { \n if ($source[strlen($source)-1]=='/') { \n //Copy only contents \n } else { \n //Change parent itself and its contents \n $dest=$dest.basename($source); \n @mkdir($dest); \n chmod($dest,$options['filePermission']); \n } \n } else { \n if ($source[strlen($source)-1]=='/') { \n //Copy parent directory with new name and all its content \n @mkdir($dest,$options['folderPermission']); \n chmod($dest,$options['filePermission']); \n } else { \n //Copy parent directory with new name and all its content \n @mkdir($dest,$options['folderPermission']); \n /*\n * modify by Zoe\n * dunno why this will generate warning message\n * tune this warning temporally \n */\n @chmod($dest,$options['filePermission']); \n } \n } \n\n $dirHandle=opendir($source); \n while($file=readdir($dirHandle)) \n { \n if($file!=\".\" && $file!=\"..\") \n { \n if(!is_dir($source.\"/\".$file)) { \n $__dest=$dest.\"/\".$file; \n } else { \n $__dest=$dest.\"/\".$file; \n } \n //echo \"$source/$file ||| $__dest<br />\"; \n $result=smartCopy($source.\"/\".$file, $__dest, $options); \n } \n } \n closedir($dirHandle); \n \n } else { \n $result=false; \n } \n return $result; \n}", "function copyFolder($old_dir,$new_dir){\r\n\t\t\t\t// open the user's directory\r\n\t\t\t\t\t$path = './cloud/'.$_SESSION['SESS_USER_ID'].'/'; // '.' for current\r\n\r\n\t\t\t\t\t\r\n\t\t\t}", "function copyFiles( $src, $dest, $sep='/' )\r\n{\r\n\tif ( substr($dest,-1) != $sep )\r\n\t\t$dest .= $sep;\r\n\t\t\r\n\t$srcdir = dirname($src);\r\n\t$files = array( basename($src) );\r\n\t//echo \"Copying $files from $srcdir to $dest\\n\";\r\n\tif ( $files[0] == '*' )\r\n\t\t$files = scandir( $srcdir );\r\n\r\n\tforeach ($files as $file)\r\n\t{\r\n\t\t$srcfile = $srcdir.$sep.$file;\r\n\t\tif ( $file != '.' && $file != '..' && is_file($srcfile) )\r\n\t\t{\r\n\t\t\t$destfile = $dest.$file;\r\n\t\t\tif ( !copy( $srcfile, $destfile ) )\r\n\t\t\t\tdie( \"Failed to copy $srcfile to $destfile\\n\" );\r\n\t\t}\r\n\t}\r\n}", "public function copyFiles($destination);", "public function copyDirectory( $source, $destination, $recursive = TRUE )\n {\n $result = FALSE;\n\n if ( !file_exists( $destination ) )\n {\n $this->createDirectory( $destination );\n }\n\n try\n {\n foreach ( scandir( $source ) as $file )\n {\n if ( '.' === $file || '..' === $file )\n {\n continue;\n }\n\n if ( is_dir( $source . DS . $file ) )\n {\n $this->createDirectory( $destination . DS . $file );\n\n if ( $recursive )\n {\n $this->copyDirectory( $source . DS . $file, $destination . DS . $file );\n }\n }\n elseif ( is_file( $source . DS . $file ) )\n {\n $this->copyFile( $source . DS . $file, $destination . DS . $file );\n }\n }\n\n $result = TRUE;\n }\n catch ( Exception $e )\n {\n $result = $e;\n }\n\n return $result;\n }", "function copy($src, $dest, $path = '', $force = false, $sourceSystem = null) \n {\n // Initialize variables\n\n if ($path) {\n $src = $this->_fs->path()->clean($path . DS . $src);\n $dest = $this->_fs->path()->clean($path . DS . $dest);\n }\n\n // Eliminate trailing directory separators, if any\n $src = rtrim($src, DS);\n $dest = rtrim($dest, DS);\n\n if (!$this->exists($src)) {\n return VWP::raiseError(VText::_('Cannot find source folder'),get_class($this).\":copy\",-1,false);\n }\n\n if ($this->exists($dest) && !$force) {\n return VWP::raiseError(VText::_('Folder already exists'),get_class($this).\":copy\",-1,false);\n }\n\n // Make sure the destination exists\n \n $r = $this->create($dest);\n if (VWP::isWarning($r)) {\n return VWP::raiseError(VText::_('Unable to create target folder'),get_class($this).\":copy\",-1,false);\n }\n \n if (!($dh = @opendir($src))) {\n return VWP::raiseError(VText::_('Unable to open source folder'),get_class($this).\":copy\",-1,false);\n }\n\n // Walk through the directory copying files and recursing into folders.\n while (($file = readdir($dh)) !== false) {\n $sfid = $src . DS . $file;\n $dfid = $dest . DS . $file;\n switch (filetype($sfid)) {\n case 'dir':\n if ($file != '.' && $file != '..') {\n $ret = $this->copy($sfid, $dfid, null, $force);\n if ($ret !== true) {\n return $ret;\n }\n }\n break;\n case 'file':\n if (!@copy($sfid, $dfid)) {\n return VWP::raiseError(VText::_('Copy failed'),get_class($this).\":copy\",-1,false);\n }\n break;\n }\n }\n return true;\n }", "protected function copyDirectory(string $src, string $dst)\n {\n if (Filesystem::isDirectory($src)){\n if (Filesystem::copyDirectory($src, $dst)) {\n $this->info('Publish directory successfully: ' . $dst);\n } else {\n $this->error('Failed to publish directory: ' . $src);\n }\n } else{\n $this->warning('Directory does not exist: '. $src);\n }\n }", "public function copyFolderContents($source, $destination) {\n if (!file_exists($destination) && !is_dir($destination)) {\n if (mkdir($destination)) {\n Logger::log(dt('Created directory : @dir', array('@dir' => $destination)), 'success');\n }\n else {\n Logger::log(dt('Error while creating directory : @dir', array('@dir' => $destination)), 'error');\n }\n }\n $files = array();\n foreach (glob($source . '/*.*') as $file) {\n $file_name = basename($file);\n $destination_file_name = $destination . '/' . $file_name;\n if (copy($file, $destination_file_name)) {\n Logger::log(dt('Copied file : @file_name', array('@file_name' => $destination_file_name)), 'success');\n }\n else {\n Logger::log(dt('Erorr while copying file : @file_name', array('@file_name' => $file_name)), 'error');\n }\n }\n }", "public function copyDir($path, $pathto)\n {\n if (!is_dir($path)) {\n return copy($path, $pathto);\n } else {\n $this->ensureDir($pathto);\n $status = true;\n $d = dir($path);\n if ($d === false) {\n return false;\n }\n while (false !== ($f = $d->read())) {\n if ($f == \".\" || $f == \"..\") {\n continue;\n }\n $status &= $this->copyDir(\"$path/$f\", \"$pathto/$f\");\n }\n $d->close();\n return $status;\n }\n }", "function copy_dirs($wf, $wto) {\n\tif (!file_exists($wto)) {\n\t\tmkdir($wto, 0777);\n\t}\n\t$arr=ls_a($wf);\n\tforeach ($arr as $fn) {\n\t\tif($fn) {\n\t\t\t$fl=$wf.\"/\".$fn;\n\t\t\t$flto=$wto.\"/\".$fn;\n\t\t\tif(is_dir($fl)) copy_dirs($fl, $flto);\n\t\t\telse // begin 2nd improvement\n\t\t\t{\n\t\t\t\t@copy($fl, $flto);\n\t\t\t\tchmod($flto, 0666);\n\t\t\t} // end 2nd improvement\n\t\t}\n\t}\n}", "public static function copy_dir($fromDir, $toDir) {\n\t\t$file_tools = new RarsFileTools(get_class($this));\n\n\t\t$result = false;\n\t\t$readFromDir = $fromDir;\n\t\t$readToDir = $toDir;\n\t\t$file_tools->create_dir($readToDir);\n\t\tif (is_dir($readFromDir)) {\n\t\t\t$filesArray = array();\n\t\t\t$filesArray = $file_tools->read_dir_contents($readFromDir);\n\t\t\t// do recursive delete if dir contains files //\n\t\t\tforeach($filesArray as $name) {\n\t\t\t\tif (is_dir($readFromDir.'/'.$name)) {\n\t\t\t\t\t$result = self::copy_dir($fromDir.'/'.$name, $toDir.'/'.$name);\n\t\t\t\t} elseif (file_exists($readFromDir.'/'.$name)) {\n\t\t\t\t\t$result = self::copy_file($fromDir.'/'.$name, $toDir.'/'.$name, false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "public function testCopyDirOverExistingUpcountsDestinationDirname()\n {\n $this->storage->createDir('/', 'dest');\n $this->storage->createDir('/dest', 'tmp');\n $this->storage->createFile('/dest/tmp/', 'a.txt');\n $this->storage->createDir('/', 'tmp');\n $this->storage->createFile('/tmp/', 'b.txt');\n\n $this->storage->copyDir('/tmp', '/dest');\n\n $this->assertDirectoryExists(TEST_REPOSITORY.'/dest/tmp/');\n $this->assertTrue($this->storage->fileExists('/dest/tmp/a.txt'));\n\n $this->assertDirectoryExists(TEST_REPOSITORY.'/dest/tmp (1)');\n $this->assertTrue($this->storage->fileExists('/dest/tmp (1)/b.txt'));\n }", "function smartCopy($source, $dest, $folderPermission=0755,$filePermission=0644){\r\n# source=file & dest=file / not there yet => copy file from source-dir to dest and overwrite a file there, if present\r\n\r\n# source=dir & dest=dir => copy all content from source to dir\r\n# source=dir & dest not there yet => copy all content from source to a, yet to be created, dest-dir\r\n $result=false;\r\n \r\n if (is_file($source)) { # $source is file\r\n if(hb_is_dir($dest)) { # $dest is folder\r\n if ($dest[strlen($dest)-1]!='/') # add '/' if necessary\r\n $__dest=$dest.\"/\";\r\n $__dest .= basename($source);\r\n }\r\n else { # $dest is (new) filename\r\n $__dest=$dest;\r\n }\r\n $result=copy($source, $__dest);\r\n chmod($__dest,$filePermission);\r\n }\r\n elseif(hb_is_dir($source)) { # $source is dir\r\n if(!hb_is_dir($dest)) { # dest-dir not there yet, create it\r\n @mkdir($dest,$folderPermission);\r\n chmod($dest,$folderPermission);\r\n }\r\n if ($source[strlen($source)-1]!='/') # add '/' if necessary\r\n $source=$source.\"/\";\r\n if ($dest[strlen($dest)-1]!='/') # add '/' if necessary\r\n $dest=$dest.\"/\";\r\n\r\n # find all elements in $source\r\n $result = true; # in case this dir is empty it would otherwise return false\r\n $dirHandle=opendir($source);\r\n while($file=readdir($dirHandle)) { # note that $file can also be a folder\r\n if($file!=\".\" && $file!=\"..\") { # filter starting elements and pass the rest to this function again\r\n# echo \"$source$file ||| $dest$file<br />\\n\";\r\n $result=smartCopy($source.$file, $dest.$file, $folderPermission, $filePermission);\r\n }\r\n }\r\n closedir($dirHandle);\r\n }\r\n else {\r\n $result=false;\r\n }\r\n return $result;\r\n }", "public static function superCopy($source, $dest, $permissions = 0755)\n\t{\n\t\t$sourceHash = static::hashDirectory($source);\n\t\t// Check for symlinks\n\t\tif (is_link($source)) {\n\t\t\treturn symlink(readlink($source), $dest);\n\t\t}\n\n\t\t// Simple copy for a file\n\t\tif (is_file($source)) {\n\t\t\treturn copy($source, $dest);\n\t\t}\n\n\t\t// Make destination directory\n\t\tif (!is_dir($dest)) {\n\t\t\tmkdir($dest, $permissions);\n\t\t}\n\n\t\t// Loop through the folder\n\t\t$dir = dir($source);\n\t\twhile (false !== $entry = $dir->read()) {\n\t\t\t// Skip pointers\n\t\t\tif ($entry == '.' || $entry == '..') {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Deep copy directories\n\t\t\tif ($sourceHash != static::hashDirectory($source . \"/\" . $entry)) {\n\t\t\t\tstatic::superCopy(\"$source/$entry\", \"$dest/$entry\", $permissions);\n\t\t\t}\n\t\t}\n\n\t\t// Clean up\n\t\t$dir->close();\n\t\treturn true;\n\t}", "private function copyDir(string $sourceDir, array $filepaths, string $destinationDir)\n {\n if (!is_dir($sourceDir) || (!is_dir($destinationDir) && !wp_mkdir_p($destinationDir))) {\n return;\n }\n\n foreach ($filepaths as $filepath) {\n $source = trailingslashit($sourceDir) . $filepath;\n $destination = trailingslashit($destinationDir) . $filepath;\n\n if (file_exists($source) && !file_exists($destination) && copy($source, $destination)) {\n $this->filesCopied = true;\n }\n }\n }", "function copyFolder($folder_id, $template_folder_id){\n $url = $this->url.\"files/\".$folder_id.\"/copy\";\n $post['data'] = array(\n 'attributes' => array( \n \"resource_id\" => $template_folder_id\n ),\n \"type\" => \"files\" \n );\n $post = json_encode($post);\n $result = $this->post_to_zoho($url, $post);\n return $result;\n }", "public static function copy($s_source,$s_destination)\n {\n $r_directory = opendir($s_source);\n while(($s_file=readdir($r_directory))!==false)\n {\n if($s_file==='.'||$s_file==='..'||$s_file==='.idea'||$s_file==='.svn')\n continue;\n\n $s_destination_file = $s_destination.'/'.$s_file;\n\n if(is_dir($s_source.'/'.$s_file))\n {\n if(!is_dir($s_destination_file))\n mkdir($s_destination_file);\n static::copy($s_source.'/'.$s_file,$s_destination_file);\n }\n else\n {\n copy($s_source.'/'.$s_file,$s_destination_file);\n }\n }\n closedir($r_directory);\n }", "public function testCopyDirectoryReturnsFalseIfSourceIsntDirectory()\n {\n $origin = self::$temp.DS.'breeze'.DS.'boom'.DS.'foo'.DS.'bar'.DS.'baz';\n $this->assertFalse(Storage::cpdir($origin, self::$temp));\n }", "public function copyDirectory(string $directory, string $destination, int $options = null): bool\n {\n if (!$this->isDirectory($directory)) {\n return false;\n }\n\n $options = $options ?: FilesystemIterator::SKIP_DOTS;\n\n // If the destination directory does not actually exist, we will go ahead and\n // create it recursively, which just gets the destination prepared to copy\n // the files over. Once we make the directory we'll proceed the copying.\n $this->ensureDirectoryExists($destination, 0777);\n\n $items = new FilesystemIterator($directory, $options);\n\n foreach ($items as $item) {\n // As we spin through items, we will check to see if the current file is actually\n // a directory or a file. When it is actually a directory we will need to call\n // back into this function recursively to keep copying these nested folders.\n $target = $destination . '/' . $item->getBasename();\n\n if ($item->isDir()) {\n $path = $item->getPathname();\n\n if (!$this->copyDirectory($path, $target, $options)) {\n return false;\n }\n }\n\n // If the current items is just a regular file, we will just copy this to the new\n // location and keep looping. If for some reason the copy fails we'll bail out\n // and return false, so the developer is aware that the copy process failed.\n else {\n if (!$this->copy($item->getPathname(), $target)) {\n return false;\n }\n }\n }\n\n return true;\n }", "public function isDirectoryCopyAllowed() {}", "protected function copyCurrentDirectory(string $destination): void\n {\n shell_exec('cp -r . '.escapeshellarg($destination).' 2>&1');\n\n // @codeCoverageIgnoreStart\n if (!file_exists($destination)) {\n shell_exec('xcopy . '.escapeshellarg($destination).' /e /i /h');\n }\n // @codeCoverageIgnoreEnd\n }", "function xcopy($source, $dest, $permissions = 0755)\n{\n\t// Check for symlinks\n\tif (is_link($source)) {\n\t\treturn symlink(readlink($source), $dest);\n\t}\n\n\t// Simple copy for a file\n\tif (is_file($source)) {\n\t\treturn copy($source, $dest);\n\t}\n\n\t// Make destination directory\n\tif (!is_dir($dest)) {\n\t\tmkdir($dest, $permissions);\n\t}\n\n\t// Loop through the folder\n\t$dir = dir($source);\n\twhile (false !== $entry = $dir->read()) {\n\t\t// Skip pointers\n\t\tif ($entry == '.' || $entry == '..') {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Deep copy directories\n\t\txcopy(\"$source/$entry\", \"$dest/$entry\", $permissions);\n\t}\n\n\t// Clean up\n\t$dir->close();\n\treturn true;\n}", "public static function copyDirectory($directory, $destination, $options = null)\n\t{\n\t\tif(!self::isDirectory($directory)){\n\t\t\treturn false;\n\t\t}\n\n\t\t$options = $options ?: FilesystemIterator::SKIP_DOTS;\n\n\t\tif(!self::isDirectory($destination)){\n\t\t\tself::makeDirectory($destination, 0777, true);\n\t\t}\n\n\t\t$items = new FilesystemIterator($directory, $options);\n\t\tforeach ($items as $item){\n\t\t\t$target = $destination.'/'.$item->getBasename();\n\n\t\t\tif($item->isDir()){\n\t\t\t\t$path = $item->getPathname();\n\t\t\t\tif(!self::copyDirectory($path, $target, $options)){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t}else{\n\t\t\t\tif(!self::copy($item->getPathname(), $target)){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "protected static function copySrcIntoPkg()\n {\n $common_files_list = self::getModuleFiles(self::$src_directory);\n if (!empty($common_files_list)) {\n foreach ($common_files_list as $file_relative => $file_realpath) {\n $destination_directory = self::$pkg_directory . DIRECTORY_SEPARATOR . dirname($file_relative) . DIRECTORY_SEPARATOR;\n \n PackageOutput::createDirectory($destination_directory);\n PackageOutput::copyFile($file_realpath, $destination_directory . basename($file_realpath));\n }\n }\n }", "public function copyOtherFiles(): void;", "private function copy($source, $dest, $permissions = 0755)\n {\n // Check for symlinks\n if (is_link($source)) {\n return symlink(readlink($source), $dest);\n }\n\n // Simple copy for a file\n if (is_file($source)) {\n return copy($source, $dest);\n }\n\n // Make destination directory\n if (!is_dir($dest)) {\n mkdir($dest, $permissions, true);\n }\n\n // Loop through the folder\n $dir = dir($source);\n while (false !== $entry = $dir->read()) {\n // Skip pointers\n if ($entry == '.' || $entry == '..') {\n continue;\n }\n\n // Deep copy directories\n $this->copy($source.'/'.$entry, $dest.'/'.$entry, $permissions);\n }\n\n // Clean up\n $dir->close();\n return true;\n }", "function drush_cmi_config_copy($src, $dest) {\n drush_delete_dir(config_get_config_directory($dest));\n drush_copy_dir(config_get_config_directory($src), config_get_config_directory($dest));\n}", "private function copyRelationsTemplateToDestinationDirectory(): void\n {\n $this->pathHelper->copyTemplateDirectoryAndGetPath(\n $this->pathToProjectRoot,\n AbstractGenerator::RELATIONS_TEMPLATE_PATH,\n $this->destinationDirectory\n );\n }", "function moveDirs($source, $dest, $recursive = true, $message) {\n jimport('joomla.filesystem.folder');\n jimport('joomla.filesystem.file');\n \n $error = false;\n\t\n\tif (!is_dir($dest)) { \n mkdir($dest); \n \t} \n \n $handle = @opendir($source);\n \n if(!$handle) {\n $message = JText::_('COM_JDOWNLOADS_BACKEND_CATSEDIT_ERROR_CAT_COPY');\n return $message;\n }\n \n while ($file = @readdir ($handle)) {\n if (eregi(\"^\\.{1,2}$\",$file)) {\n continue;\n }\n \n if(!$recursive && $source != $source.$file.\"/\") {\n if(is_dir($source.$file))\n continue;\n }\n \n if(is_dir($source.$file)) {\n moveDirs($source.$file.\"/\", $dest.$file.\"/\", $recursive, $message);\n } else {\n if (!JFile::copy($source.$file, $dest.$file)) {\n\t\t\t\t$error = true;\n\t\t\t}\n }\n }\n @closedir($handle);\n \n // $source loeschen wenn KEIN error\n if (!$error) {\n\t\t$res = delete_dir_and_allfiles ($source);\t\n if ($res) {\n\t\t\t$message = JText::_('COM_JDOWNLOADS_BACKEND_CATSEDIT_ERROR_CAT_DEL_AFTER_COPY');\t\t\n\t\t}\n\t} else {\n\t\t$message = JText::_('COM_JDOWNLOADS_BACKEND_CATSEDIT_ERROR_CAT_COPY');\n\t}\n\treturn $message;\n}", "public static function copy($from, $to)\n {\n // Must be a file or directory\n if ( ! file_exists($from)) {\n throw new RuntimeException('Cannot copy a non-existent path: ' . $from);\n }\n\n // Copy a file\n if (is_file($from)) {\n // Create blank destination file if needed (so directories exist)\n self::mkfile($to);\n\n // Failed to copy file\n if ( ! @copy($from, $to)) {\n throw new RuntimeException('Failed to copy file to: ' . $to);\n }\n // Copy a directory\n } else {\n // Create destination directory if needed\n self::mkdir($to);\n\n // (object) Instance of Directory\n $dir = dir($from);\n\n // (string) Normalize directory names\n $from = rtrim($from, '/\\\\') . DS;\n $to = rtrim($to, '/\\\\') . DS;\n\n // [recursion] Loop through and copy all files and sub-directories\n while (FALSE !== $path = $dir->read()) {\n if ('.' !== $path && '..' !== $path) {\n static::copy($from . $path, $to . $path);\n }\n }\n }\n\n // Successful if no exceptions are thrown\n return TRUE;\n }", "private function copyResources()\n {\n $sResourcesDirectory = $this->getViewRootDirectory();\n $sResourcesDirectory = substr($sResourcesDirectory, 0, strrpos($sResourcesDirectory, 'View'));\n $sResourcesDirectory .= 'Resources' . DIRECTORY_SEPARATOR;\n\n // copy css\n foreach (glob($sResourcesDirectory . 'css/*') as $sResourceFile) {\n $sCopyPath = WWW_PATH . substr($sResourceFile, strlen($sResourcesDirectory));\n Directory::create(dirname($sCopyPath));\n copy($sResourceFile, $sCopyPath);\n }\n\n // copy js\n foreach (glob($sResourcesDirectory . 'js/*') as $sResourceFile) {\n $sCopyPath = WWW_PATH . substr($sResourceFile, strlen($sResourcesDirectory));\n Directory::create(dirname($sCopyPath));\n copy($sResourceFile, $sCopyPath);\n }\n }", "function copyr($srcdir, $dstdir,$globalvars, $offset = '')\n{\n // nonexisting or newer files. Function returns number of files copied.\n // This function is PHP implementation of Windows xcopy A:\\dir1\\* B:\\dir2 /D /E /F /H /R /Y\n // Syntaxis: [$returnstring =] dircopy($sourcedirectory, $destinationdirectory [, $offset] [, $verbose]);\n // Example: $num = dircopy('A:\\dir1', 'B:\\dir2', 1);\n\n // Original by SkyEye. Remake by AngelKiha.\n // Linux compatibility by marajax.\n // ([danbrown AT php DOT net): *NIX-compatibility noted by Belandi.]\n // Offset count added for the possibilty that it somehow miscounts your files. This is NOT required.\n // Remake returns an explodable string with comma differentiables, in the order of:\n // Number copied files, Number of files which failed to copy, Total size (in bytes) of the copied files,\n // and the files which fail to copy. Example: 5,2,150000,\\SOMEPATH\\SOMEFILE.EXT|\\SOMEPATH\\SOMEOTHERFILE.EXT\n // If you feel adventurous, or have an error reporting system that can log the failed copy files, they can be\n // exploded using the | differentiable, after exploding the result string.\n //\n if ($globalvars['debugger']===true):\n\t\techo '<font style=\" font-size: 8px; font-family: Verdana; color: #FF0000\">DEBUGGER ENABLED (copy functions) !<br><strong>srcdir:</strong> '.$srcdir.' <strong>To dstdir:</strong>'.$dstdir.'<br>';\n\tendif;\nif (!is_dir($srcdir)):\n\t$result=copy($srcdir, $dstdir);\nelse:\n\tif(!isset($offset)) $offset=0;\n\tif(!isset($ret)) $ret=0;\n $num = 0;\n $fail = 0;\n $sizetotal = 0;\n $fifail = '';\n if(!is_dir($dstdir)) mkdir($dstdir);\n if($curdir = opendir($srcdir)):\n while($file = readdir($curdir)):\n if($file != '.' && $file != '..'):\n $srcfile = $srcdir . '/' . $file; # added by marajax\n $dstfile = $dstdir . '/' . $file; # added by marajax\n if(is_file($srcfile)):\n if(is_file($dstfile)) $ow = filemtime($srcfile) - filemtime($dstfile); else $ow = 1;\n if($ow > 0):\n if($globalvars['debugger']):\n\t\t\t\t\t\t\techo \"\t\tCopying '$srcfile' to '$dstfile'...\";\n\t\t\t\t\t\tendif;\n if(copy($srcfile, $dstfile)):\n touch($dstfile, filemtime($srcfile)); $num++;\n chmod($dstfile, 0777); # added by marajax\n $sizetotal = ($sizetotal + filesize($dstfile));\n if($globalvars['debugger']):\n\t\t\t\t\t\t\t\techo \"OK<br>\";\n\t\t\t\t\t\t\tendif;\n else:\n if($globalvars['debugger']):\n\t echo \"Error: File '$srcfile' could not be copied!<br />\";\n\t\t\t\t\t\t\tendif;\n $fail++;\n $fifail = $fifail.$srcfile.'|';\n endif;\n endif;\n elseif(is_dir($srcfile)):\n $res = explode(',',$ret);\n $ret = copyr($srcfile, $dstfile, $verbose); # added by patrick\n $mod = explode(',',$ret);\n $imp = array($res[0] + $mod[0],$mod[1] + $res[1],$mod[2] + $res[2],$mod[3].$res[3]);\n $ret = implode(',',$imp);\n endif;\n endif;\n endwhile;\n closedir($curdir);\n\tendif;\n if ($globalvars['debugger']===true):\n\t\techo'</font>';\n\tendif;\n $red = explode(',',$ret);\n $ret = ($num + $red[0]).','.(($fail-$offset) + $red[1]).','.($sizetotal + $red[2]).','.$fifail.$red[3];\n return $ret;\nendif;\n}", "public function copy($name){\n\t\t$path_array = explode(self::DS, $this->path);\n\t\t$oldPath = $this->path;\n\t\t$path_array = explode(self::DS, $oldPath);\n\t\tarray_pop($path_array);\n\t\t$_newPath = implode(self::DS, $path_array);\n\t\t$newPath = $_newPath . self::DS . $name;\n\t\tcopy($this->path, $newPath);\n\t}", "public function copyFiles($sourceDir, $targetDir, $override = false)\n {\n // Make sure the source -and target dir contain a trailing slash\n $sourceDir = rtrim($sourceDir, '/') . '/';\n $targetDir = rtrim($targetDir, '/') . '/';\n\n $this->filesystem->mirror($sourceDir, $targetDir, null, ['override' => $override]);\n }" ]
[ "0.78571546", "0.783516", "0.78284305", "0.7750978", "0.77106035", "0.76332414", "0.7616711", "0.7587495", "0.75813925", "0.7562438", "0.75414324", "0.7479173", "0.73825717", "0.7334196", "0.713173", "0.70902556", "0.7071556", "0.69858694", "0.6929019", "0.6924671", "0.6900947", "0.6888207", "0.6873404", "0.683042", "0.6819625", "0.6762057", "0.6701651", "0.6700362", "0.6700126", "0.6673383", "0.6662654", "0.66568947", "0.6623203", "0.6556995", "0.6533238", "0.650868", "0.64902556", "0.6484528", "0.6464481", "0.6431716", "0.6428047", "0.6427551", "0.64078104", "0.6371206", "0.6360365", "0.6344979", "0.6280892", "0.6257708", "0.62367684", "0.62265974", "0.62109613", "0.6202065", "0.6163393", "0.6138981", "0.6125433", "0.6123569", "0.6086614", "0.6066584", "0.6056604", "0.60293615", "0.6018224", "0.60143274", "0.6009868", "0.5989779", "0.59846455", "0.59710616", "0.596643", "0.59531814", "0.594762", "0.5930505", "0.5908311", "0.5887207", "0.58859086", "0.5880325", "0.58759445", "0.58667374", "0.58646584", "0.5859478", "0.5757531", "0.57253706", "0.5722483", "0.56962466", "0.5693916", "0.56790644", "0.5678982", "0.56552887", "0.5629242", "0.56265527", "0.5566169", "0.5563372", "0.5561167", "0.551769", "0.54231375", "0.5393544", "0.5351329", "0.534925", "0.534395", "0.53353083", "0.5323842", "0.53137386" ]
0.7900599
0
recursively remove a directory
function recurse_remove_dir($dir) { foreach(glob($dir . '/*') as $file) { if(is_dir($file)) recurse_remove_dir($file); else unlink($file); } rmdir($dir); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rm_recursive($dir) {\n\t$dir = rtrim($dir, '\\\\/');\n\tif (is_dir($dir)) { \n\t\t$objects = scandir($dir); \n\t\tforeach ($objects as $object) { \n\t\t\tif ($object != \".\" && $object != \"..\") { \n\t\t\t\tif (filetype($dir.\"/\".$object) == \"dir\") rm_recursive($dir.\"/\".$object); else unlink($dir.\"/\".$object); \n\t\t\t} \n\t\t} \n\t\treset($objects); \n\t\trmdir($dir); \n\t} \t\n}", "function remove_dir($dir = null) {\n if (is_dir($dir)) {\n $objects = scandir($dir);\n foreach ($objects as $object) {\n if ($object != \".\" && $object != \"..\") {\n if (filetype($dir.\"/\".$object) == \"dir\") remove_dir($dir.\"/\".$object);\n else unlink($dir.\"/\".$object);\n }\n }\n reset($objects);\n rmdir($dir);\n }\n}", "function removeRecursive($dir)\n{\n $files = array_diff(scandir($dir), array('.','..'));\n\n // Delete all files one by one\n foreach ($files as $file) {\n // If current file is directory then recurse it\n (is_dir(\"$dir/$file\")) ? $this->removeRecursive(\"$dir/$file\") : unlink(\"$dir/$file\");\n }\n\n // Remove blank directory after deleting all files\n return rmdir($dir);\n}", "function remove_dir_rec($dirtodelete)\n{\n if ( strpos($dirtodelete,\"../\") !== false )\n die(_NONPUOI);\n if ( false !== ($objs = glob($dirtodelete . \"/*\")) )\n {\n foreach ( $objs as $obj )\n {\n is_dir($obj) ? remove_dir_rec($obj) : unlink($obj);\n }\n }\n rmdir($dirtodelete);\n}", "function recursive_rmdir($dir) {\n $handle = opendir($dir);\n while ($file = readdir($handle)) {\n if (is_file(\"$dir/$file\")) {\n unlink(\"$dir/$file\");\n } elseif (is_dir(\"$dir/$file\") && $file != '.' && $file != '..') {\n recursive_rmdir(\"$dir/$file\");\n }\n }\n closedir($handle);\n return rmdir($dir);\n}", "function rm_dir($dir)\n{\n\t$iter = new RecursiveDirectoryIterator($dir);\n\tforeach (new RecursiveIteratorIterator( $iter,\n\t\t\t\t\t\tRecursiveIteratorIterator::CHILD_FIRST) as $f)\n\t{\n\t\t$filename = $f->getFilename();\n\t\tif ($filename === '.' || $filename === '..')\n\t\t\tcontinue;\n\t\tif ($f->isDir())\n\t\t\trmdir($f->getPathname());\n\t\telse\n\t\t\tunlink($f->getPathname());\n\t}\n\trmdir($dir);\n}", "function RemoveDirectory($dir)\n{\n $f = scandir($dir);\n foreach( $f as $file )\n {\n if( is_file(\"$dir/$file\") )\n unlink(\"$dir/$file\");\n elseif( $file != '.' && $file != '..' )\n RemoveDirectory(\"$dir/$file\");\n }\n unset($f);\n \n rmdir($dir);\n}", "function delTree($dir) { \n\t $files = array_diff(scandir($dir), array('.','..')); \n\t foreach ($files as $file) { \n\t (is_dir(\"$dir/$file\")) ? delTree(\"$dir/$file\") : unlink(\"$dir/$file\"); \n\t } \n\t return rmdir($dir); \n\t}", "function removeDirectory($path) {\n $files = glob($path . '/*');\n foreach ($files as $file) {\n is_dir($file) ? removeDirectory($file) : unlink($file);\n }\n rmdir($path);\n return;\n}", "function delTree($dir) \r\n{\r\n $files = glob( $dir . '*', GLOB_MARK );\r\n foreach( $files as $file )\r\n {\r\n if( substr( $file, -1 ) == '/' )\r\n delTree( $file );\r\n else\r\n unlink( $file );\r\n }\r\n \r\n if( is_dir($dir) ) \r\n rmdir( $dir );\r\n \r\n}", "function rmdir_recurse($path) {\n $path = rtrim($path, '/').'/';\n $handle = opendir($path);\n while(false !== ($file = readdir($handle))) {\n if($file != '.' and $file != '..' ) {\n $fullpath = $path.$file;\n if(is_dir($fullpath)) rmdir_recurse($fullpath); else unlink($fullpath);\n }\n }\n closedir($handle);\n rmdir($path);\n}", "function recursive_deletion($baseDir)\n{\n\t$files = scandir($baseDir);\n\tforeach ($files as $file) \n\t{\n\t\tif ( ($file != '.') && ($file != '..') ) \n\t\t{\n\t\t\tif ( is_dir($baseDir . $file) ) recursive_deletion($baseDir.$file.'/');\n\t\t\telse unlink($baseDir . $file);\n\t\t}\n\t}\n\trmdir($baseDir);\n}", "function remove_dir($path) {\n\t\tif (file_exists($path) && is_dir($path))\n\t\t\trmdir($path);\n\t}", "private function remove_directory($path) {\n $files = glob($path . '/*');\n foreach ($files as $file) {\n is_dir($file) ? remove_directory($file) : unlink($file);\n }\n rmdir($path);\n return;\n }", "function rrmdir($dir) {\n if (!file_exists($dir))\n return;\n if (!is_dir($dir)) {\n unlink($dir);\n return;\n }\n $files = array_diff(scandir($dir), array('.','..'));\n foreach ($files as $file) {\n $path = \"$dir/$file\";\n (is_dir($path) && !is_link($path)) ? rrmdir($path) : unlink($path);\n }\n return rmdir($dir);\n}", "function rmdir_recursive($dir) {\n\n\t\t$basicPath = ROOT.DS.\"app\".DS.\"webroot\".DS.\"contents\".DS;\n\t\tif(is_dir($basicPath.$dir)){\n\t\t$files = scandir($basicPath.$dir);\n\t\tarray_shift($files); // remove '.' from array\n\t\tarray_shift($files); // remove '..' from array\n\n\t\tforeach ($files as $file) {\n\t\t$file = $basicPath.$dir .DS. $file;\n\t\tif (is_dir($file)) {\n\t\trmdir_recursive($file);\n\t\trmdir($file);\n\t\t} else {\n\n\t\tunlink($file);\n\t\t }\n\t\t}\n\t\trmdir($basicPath.$dir);\n\t\t}\n\t}", "function remove_directory($src)\n{\n $dir = opendir($src);\n while(false !== ( $file = readdir($dir)) )\n\t{\n if (( $file != '.' ) && ( $file != '..' ))\n\t\t{\n $full = $src . '/' . $file;\n\t\t\t\n if ( is_dir($full) )\n\t\t\t{\n remove_directory($full);\n }\n else\n\t\t\t{\n unlink($full);\n }\n }\n }\n closedir($dir);\n rmdir($src);\n}", "private function deleteFolderRecursively($path) {\n\t\t\t$path = self::folderPath($path);\n\t\t\t$handle = opendir($path);\n\t\t\t\n\t\t\tif (!$handle)\n\t\t\t\tthrow new ServiceException(\"REQUEST_FAILED\", \"Could not open directory for traversal (recurse): \".$path);\n\t\t \n\t\t while (false !== ($item = readdir($handle))) {\n\t\t\t\tif ($item != \".\" and $item != \"..\" ) {\n\t\t\t\t\t$fullpath = $path.$item;\n\t\n\t\t\t\t\tif (is_dir($fullpath)) {\n\t\t\t\t\t\t$this->deleteFolderRecursively($fullpath);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!unlink($fullpath)) {\n\t\t\t\t\t\t\tclosedir($handle);\n\t\t\t\t\t\t\tthrow new ServiceException(\"REQUEST_FAILED\", \"Failed to remove file (recurse): \".$fullpath);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tclosedir($handle);\n\t\t\t\n\t\t\tif (!rmdir($path))\n\t\t\t\tthrow new ServiceException(\"REQUEST_FAILED\", \"Failed to remove directory (delete_directory_recurse): \".$path);\n\t\t}", "function rrmdir($dir) {\n if (is_dir($dir)) { \n $objects = scandir($dir); \n foreach ($objects as $object) { \n if ($object != \".\" && $object != \"..\") { \n if (filetype($dir.\"/\".$object) == \"dir\") rmdir($dir.\"/\".$object); else \\\nunlink($dir.\"/\".$object); \n } \n } \n reset($objects); \n rmdir($dir); \n } \n}", "function rrmdir($dir) {\nif (is_dir($dir)) {\n $objects = scandir($dir);\n foreach ($objects as $object) {\n if ($object != \".\" && $object != \"..\") {\n if (filetype($dir.\"/\".$object) == \"dir\") rrmdir($dir.\"/\".$object); else unlink($dir.\"/\".$object);\n }\n }\n reset($objects);\n rmdir($dir);\n}\n}", "function rmdir_r($dir)\n{\n\tif(is_dir($dir)) {\n\t\t$objs = scandir($dir);\n\t\tforeach($objs as $o) {\n\t\t\tif($o != '.' && $o != '..') {\n\t\t\t\tif(is_dir($dir.'/'.$o)) {\n\t\t\t\t\trmdir_r($dir.'/'.$o);\n\t\t\t\t} else unlink($dir.'/'.$o);\n\t\t\t}\n\t\t}\n\t\treset($objs);\n\t\treturn rmdir($dir);\n\t}\n}", "function gttn_tpps_rmdir($dir) {\n if (is_dir($dir)) {\n $children = scandir($dir);\n foreach ($children as $child) {\n if ($child != '.' and $child != '..') {\n if (is_dir($dir . '/' . $child) and !is_link($dir . '/' . $child)) {\n gttn_tpps_rmdir($dir . '/' . $child);\n }\n else {\n unlink($dir . '/' . $child);\n }\n }\n }\n rmdir($dir);\n }\n}", "function _removeDir($dir) {\r\n\t\tif(file_exists($dir)) {\r\n\t\t\tif($objs = glob($dir.\"/*\"))\r\n\t\t\t\tforeach($objs as $obj) {\r\n\t\t\t\t\tis_dir($obj) ? rmdir($obj) : unlink($obj);\r\n\t\t\t\t}\r\n\t\t\trmdir($dir);\r\n\t\t}\r\n\t}", "function removeDir($directory){\n foreach(glob(\"{$directory}/*\") as $file){\n if(is_dir($file)) { \n removeDir($file);\n } else {\n unlink($file);\n }\n }\n rmdir($directory);\n }", "function delete_dir($path)\n{\n $file_scan = scandir($path);\n foreach ($file_scan as $filecheck)\n {\n $file_extension = pathinfo($filecheck, PATHINFO_EXTENSION);\n if ($filecheck != '.' && $filecheck != '..')\n {\n if ($file_extension == '')\n {\n delete_dir($path . $filecheck . '/');\n }\n else\n {\n unlink($path . $filecheck);\n }\n }\n }\n rmdir($path);\n}", "function remove_dir($dir){\n\tif( !is_dir( $dir ) )\n\t\treturn false;\n\n\t$objects=scandir($dir);\n\tforeach($objects as $object){\n\t\tif($object!='.'&&$object!='..'){\n\t\t\tif(filetype($dir.'/'.$object)=='dir')\n\t\t\t\tremove_dir($dir.'/'.$object);\n\t\t\telse\n\t\t\t\tunlink($dir.'/'.$object);\n\t\t}\n\t}\n\treset($objects);\n\treturn rmdir($dir);\n}", "public static function recursive_unlink($file) {\n if (is_dir($file)) {\n // Remove all files in dir.\n $subfiles = array_diff(scandir($file), array('.','..'));\n foreach ($subfiles as $subfile) {\n self::recursive_unlink($file . '/' . $subfile);\n }\n rmdir($file);\n }\n elseif (file_exists($file)) {\n unlink($file);\n }\n }", "public function remove_dir() {\n\n $path = $this->get_upload_pres_path();\n\n //append_debug_msg($path);\n\n if(!$path || !file_exists($path)){ return; }\n delete_dir($path);\n }", "function delTree($directory)\n{\n\t$files = array_diff(scandir($directory), array('.','..'));\n \tforeach($files as $file)\n\t{\n\t\t//echo(\"$directory/$file<br />\");\n \t\t(is_dir(\"$directory/$file\")) ? delTree(\"$directory/$file\") : unlink(\"$directory/$file\"); \n \t}\n \treturn rmdir($directory);\n}", "function rrmdir($dir) {\n if (is_dir($dir)) { \n $objects = scandir($dir); \n foreach ($objects as $object) { \n if ($object != \".\" && $object != \"..\") { \n if (filetype($dir.\"/\".$object) == \"dir\") rrmdir($dir.\"/\".$object); else unlink($dir.\"/\".$object); \n } \n } \n reset($objects);\n rmdir($dir); \n } \n }", "function delete_dir($dir) {\n foreach (array_keys(scan_dir($dir)) as $file) {\n if (is_dir($file)) {\n delete_dir($file);\n } else {\n rm($file);\n }\n }\n\n rmdir($dir);\n}", "function fud_rmdir($dir, $deleteRootToo=false)\n{\n\tif(!$dh = @opendir($dir)) {\n\t\treturn;\n\t}\n\twhile (false !== ($obj = readdir($dh))) {\n\t\tif($obj == '.' || $obj == '..') {\n\t\t\tcontinue;\n\t\t}\n\t\tif (!@unlink($dir .'/'. $obj)) {\n\t\t\tfud_rmdir($dir .'/'. $obj, true);\n\t\t}\n\t}\n\tclosedir($dh);\n\tif ($deleteRootToo) {\n\t\t@rmdir($dir);\n\t}\n\treturn;\n}", "protected function wfRecursiveRemoveDir( $dir ) {\n\t\tif ( is_dir( $dir ) ) {\n\t\t\t$objects = scandir( $dir );\n\t\t\tforeach ( $objects as $object ) {\n\t\t\t\tif ( $object != \".\" && $object != \"..\" ) {\n\t\t\t\t\tif ( filetype( $dir . '/' . $object ) == \"dir\" ) {\n\t\t\t\t\t\t$this->wfRecursiveRemoveDir( $dir . '/' . $object );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tunlink( $dir . '/' . $object );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treset( $objects );\n\t\t\trmdir( $dir );\n\t\t}\n\t}", "function unlinkRecursive($dir)\n{\n if(!$dh = @opendir($dir))\n {\n return;\n }\n while (false !== ($obj = readdir($dh)))\n {\n if($obj == '.' || $obj == '..')\n {\n continue;\n }\n\n if (!@unlink($dir . '/' . $obj))\n {\n unlinkRecursive($dir.'/'.$obj, true);\n }\n }\n\n closedir($dh);\n \n return;\n}", "function UnlinkRecursive($dir, $deleteRootToo = true) \n{ \n if(!$dh = @opendir($dir)) \n { \n return false; \n } \n while (false !== ($obj = readdir($dh))) \n { \n if($obj == '.' || $obj == '..') \n { \n continue; \n } \n\n if (!@unlink($dir . '/' . $obj)) \n { \n UnlinkRecursive($dir.'/'.$obj, true); \n } \n } \n\n closedir($dh); \n \n if ($deleteRootToo) \n { \n @rmdir($dir); \n } \n \n return true; \n}", "function rrmdir($path) {\n // Open the source directory to read in files\n $i = new DirectoryIterator($path);\n foreach($i as $f) {\n if($f->isFile()) {\n unlink($f->getRealPath());\n } else if(!$f->isDot() && $f->isDir()) {\n rrmdir($f->getRealPath());\n }\n }\n rmdir($path);\n}", "static function deleteDir($dir) {\n if (file_exists($dir)) {\n $iterator = new RecursiveDirectoryIterator($dir);\n foreach (new RecursiveIteratorIterator($iterator, RecursiveIteratorIterator::CHILD_FIRST) as $file) {\n if ($file->isDir()) {\n rmdir($file->getPathname());\n } else {\n unlink($file->getPathname());\n }\n }\n rmdir($dir);\n }\n }", "public static function rmdirRecursive($dir)\n {\n $fs = new \\Composer\\Util\\Filesystem();\n if(is_dir($dir)){\n $result = $fs->removeDirectory($dir);\n }else{\n @unlink($dir);\n }\n \n return;\n }", "private function remove_dir($path) {\n\t $item = new DirectoryIterator($path);\n\t foreach($item as $folder) {\n\t if($folder->isFile()) {\n\t unlink($folder->getRealPath());\n\t } else if(!$folder->isDot() && $folder->isDir()) {\n\t $this->remove_dir($folder->getRealPath());\n\t }\n\t }\n\t rmdir($path);\n\t}", "function rrmdir($dir) {\r\n\tif (is_dir($dir)) {\r\n\t\t$objects = scandir($dir);\r\n\t\tforeach ($objects as $object) {\r\n\t\t\tif ($object != \".\" && $object != \"..\") {\r\n\t\t\t\tif (filetype($dir.\"/\".$object) == \"dir\") rrmdir($dir.\"/\".$object); else unlink($dir.\"/\".$object);\r\n\t\t\t}\r\n\t\t}\r\n\t\treset($objects);\r\n\t\treturn rmdir($dir);\r\n\t}\r\n}", "function eliminarDirectorio($directorio){\n foreach(glob($directorio . \"/*\") as $archivos_carpeta){\n if (is_dir($archivos_carpeta)){\n eliminarDirectorio($archivos_carpeta);\n }\n else{\n unlink($archivos_carpeta);\n }\n }\n rmdir($directorio);\n}", "private function rmdir_recursive($dir) {\n $files = scandir($dir);\n array_shift($files); // remove '.' from array\n array_shift($files); // remove '..' from array\n \n foreach ($files as $file) {\n $file = $dir . '/' . $file;\n if (is_dir($file)) {\n $this->rmdir_recursive($file);\n @rmdir($file);\n } else {\n @unlink($file);\n }\n }\n @rmdir($dir);\n }", "private function deltree($path) {\n if (!is_link($path) && is_dir($path)) {\n $entries = scandir($path);\n foreach ($entries as $entry) {\n if ($entry != '.' && $entry != '..') {\n $this->deltree($path . DIRECTORY_SEPARATOR . $entry);\n }\n }\n rmdir($path);\n } else {\n unlink($path);\n }\n }", "function wpdev_rm_dir($dir) {\r\n\r\n if (DIRECTORY_SEPARATOR == '/')\r\n $dir=str_replace('\\\\','/',$dir);\r\n else\r\n $dir=str_replace('/','\\\\',$dir);\r\n\r\n $files = glob( $dir . '*', GLOB_MARK );\r\n debuge($files);\r\n foreach( $files as $file ){\r\n if( is_dir( $file ) )\r\n $this->wpdev_rm_dir( $file );\r\n else\r\n unlink( $file );\r\n }\r\n rmdir( $dir );\r\n }", "function rrmdir($path) {\n\t$files = glob($path . '/*');\n\tforeach ($files as $file) {\n\t\tis_dir($file) ? rrmdir($file) : unlink($file);\n\t}\n\trmdir($path);\n\treturn;\n}", "function clear_local($dir){\n \n$di = new RecursiveDirectoryIterator($dir, FilesystemIterator::SKIP_DOTS);\n$ri = new RecursiveIteratorIterator($di, RecursiveIteratorIterator::CHILD_FIRST);\nforeach ( $ri as $file ) {\n $file->isDir() ? rmdir($file) : unlink($file);\n}\n\n\n\n}", "private static function rmdirRecursive($path)\n {\n $files = scandir($path);\n array_shift($files);\n array_shift($files);\n\n foreach ($files as $file) {\n $file = $path . DIRECTORY_SEPARATOR . $file;\n if (is_dir($file)) {\n self::rmdirRecursive($file);\n } else {\n unlink($file);\n }\n }\n\n rmdir($path);\n }", "public function recursiveRmdir(string $path) {\n if(!file_exists($path)) { return; }\n $files = glob($path . '/*');\n foreach ($files as $file) {\n if (is_dir($file)) {\n $this->recursiveRmdir($file);\n } else {\n unlink($file);\n }\n }\n rmdir($path);\n }", "function rrmdir($dir) {\n if (is_dir($dir)) {\n $objects = scandir($dir);\n foreach ($objects as $object) {\n if ($object != \".\" && $object != \"..\") {\n if (filetype($dir.\"/\".$object) == \"dir\") rrmdir($dir.\"/\".$object); else unlink($dir.\"/\".$object);\n }\n }\n reset($objects);\n rmdir($dir);\n }\n }", "function deletedirectory($path)\n{\n $files = glob($path . '*', GLOB_MARK);\n foreach ($files as $file)\n {\n unlink($file);\n }\n rmdir($path);\n}", "public static function rmdir_recursive($dir)\n {\n foreach(scandir($dir) as $file) {\n if ('.' === $file || '..' === $file) continue;\n if (is_dir(\"$dir/$file\")){\n self::rmdir_recursive(\"$dir/$file\");\n }else{\n chmod(\"$dir/$file\", 0777);\n unlink(\"$dir/$file\");\n }\n }\n rmdir($dir);\n }", "function deleteTree($dir)\n{\n if (empty($dir) or !$dir) {\n return;\n }\n $dir = realpath($dir);\n $pathLength = strlen($dir);\n $files = array_diff(scandir($dir), array('.', '..'));\n foreach ($files as $file) {\n $file_ = realpath(\"$dir/$file\");\n if (strncmp($file_, $dir, $pathLength) !== 0) {\n throw new Exception(\"Deleting file '$file' would have gone out of base directory ('$dir') => '$file_'.\");\n }\n (is_dir($file_)) ? deleteTree($file_) : unlink($file_);\n }\n rmdir($dir);\n}", "function deltree($dir)\n {\n if (! file_exists($dir)) {\n return false;\n }\n\n $files = array_diff(scandir($dir), ['.', '..']);\n\n foreach ($files as $file) {\n (is_dir(\"$dir/$file\")) ? delTree(\"$dir/$file\") : unlink(\"$dir/$file\");\n }\n\n return rmdir($dir);\n }", "function DelTree($dir)\r\n{\r\n\tif (!file_exists($dir)) return;\r\n\t$dh = @opendir($dir);\r\n\tif (!$dh) return;\r\n\twhile (($obj = readdir($dh)))\r\n\t{\r\n\t\tif ($obj == '.' || $obj == '..') continue;\r\n\t\tif (!@unlink(\"{$dir}/{$obj}\")) DelTree($dir.'/'.$obj);\r\n\t}\r\n\tclosedir($dh);\r\n\t@rmdir($dir);\r\n}", "public static function save_recursive_remove_dir( $path, $root ) {\n\n $path = rtrim($path, '/').'/';\n $root = rtrim($root, '/').'/';\n\n if ($root === '/' || $path === '/' || $root !== mb_substr($path, 0, mb_strlen($root)) )\n return false;\n\n foreach(new RecursiveIteratorIterator( new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS), \tRecursiveIteratorIterator::CHILD_FIRST) as $entry ) {\n \tif($entry->isDir() && !$entry->isLink())\n rmdir($entry->getPathname());\n else\n unlink($entry->getPathname());\n }\n\n rmdir($path);\n }", "function delete_directory($dirname) {\n if (is_dir($dirname))\n $dir_handle = opendir($dirname);\nif (!$dir_handle)\n return false;\nwhile($myfile = readdir($dir_handle)) {\n if ($myfile != \".\" && $myfile != \"..\") {\n if (!is_dir($dirname.\"/\".$myfile))\n unlink($dirname.\"/\".$myfile);\n else\n delete_directory($dirname.'/'.$myfile);\n }\n}\nclosedir($dir_handle);\nrmdir($dirname);\nreturn true;\n}", "function l10n_drupal_rmdir_recursive($directory) {\n if (!is_dir($directory)) {\n return;\n }\n if (substr($directory, -1) != '/') {\n $directory .= '/';\n }\n if ($handle = opendir($directory)) {\n while ($file = readdir($handle)) {\n if ($file == '.' or $file == '..') {\n continue;\n }\n $path = $directory . '/' . $file;\n if (is_dir($path)) {\n l10n_drupal_rmdir_recursive($path);\n }\n else {\n unlink($path);\n }\n }\n rmdir($directory);\n closedir($handle);\n }\n}", "function recursive_remove_directory($directory, $empty=FALSE)\n{\n if(substr($directory,-1) == '/')\n {\n $directory = substr($directory,0,-1);\n }\n\n // if the path is not valid or is not a directory ...\n if(!file_exists($directory) || !is_dir($directory))\n {\n // ... we return false and exit the function\n return FALSE;\n\n // ... if the path is not readable\n }elseif(!is_readable($directory))\n {\n // ... we return false and exit the function\n return FALSE;\n\n // ... else if the path is readable\n }else{\n\n // we open the directory\n $handle = opendir($directory);\n\n // and scan through the items inside\n while (FALSE !== ($item = readdir($handle)))\n {\n // if the filepointer is not the current directory\n // or the parent directory\n if($item != '.' && $item != '..')\n {\n // we build the new path to delete\n $path = $directory.'/'.$item;\n\n // if the new path is a directory\n if(is_dir($path)) \n {\n // we call this function with the new path\n recursive_remove_directory($path);\n\n // if the new path is a file\n }else{\n // we remove the file\n unlink($path);\n }\n }\n }\n // close the directory\n closedir($handle);\n\n // if the option to empty is not set to true\n if($empty == FALSE)\n {\n // try to delete the now empty directory\n if(!rmdir($directory))\n {\n // return false if not possible\n return FALSE;\n }\n }\n // return success\n return TRUE;\n }\n}", "function remove_directory($directory) {\n\t$it = new RecursiveDirectoryIterator($directory, RecursiveDirectoryIterator::SKIP_DOTS);\n\t$files = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::CHILD_FIRST);\n\tforeach ($files as $file) {\n\t\tif ($file->isDir()) {\n\t\t\trmdir($file->getRealPath());\n\t\t} else {\n\t\t\tunlink($file->getRealPath());\n\t\t}\n\t}\n\treturn rmdir($directory);\n}", "protected function recurciveDelete($dir)\n {\n if ($objs = glob($dir . \"/*\"))\n {\n foreach ($objs as $obj)\n {\n is_dir($obj) ? $this->recurciveDelete($obj) : unlink($obj);\n }\n }\n rmdir($dir);\n }", "private function cleanup_working_dir($dir)\n {\n $files = new RecursiveIteratorIterator(\n new RecursiveDirectoryIterator($dir, RecursiveDirectoryIterator::SKIP_DOTS),\n RecursiveIteratorIterator::CHILD_FIRST\n );\n\n foreach ($files as $fileinfo) {\n $command = ($fileinfo->isDir() ? 'rmdir' : 'unlink');\n $command($fileinfo->getRealPath());\n }\n rmdir($dir);\n }", "private function maybe_remove_dir( $dir ) {\r\n\t\tif ( $this->filesystem->is_dir( $dir ) ) {\r\n\t\t\trocket_rrmdir( $dir, [], $this->filesystem );\r\n\t\t}\r\n\t}", "function delFolder($dir) {\n\t\tforeach (scandir($dir) as $item) {\n\t\t\tif ($item == '.' || $item == '..') {\n\t\t\t\tcontinue;\n\t\t\t}\n\n \t\t\tunlink($dir.DIRECTORY_SEPARATOR.$item);\n\n\t\t\t}\n\t\tLogger(\"INFO\", \"Removed directory $dir\");\n\t\trmdir($dir);\n\t}", "function rrmdir($dir) {\n\tif (is_dir($dir)) {\n\t $objects = scandir($dir);\n\n\t //debug($objects);\n\n\t foreach ($objects as $object) {\n\t\tif ($object != \".\" && $object != \"..\") {\n\t\t\t//echo $dir.\"/\".$object . '<br>';\n\n\t\t if (filetype($dir.\"/\".$object) == \"dir\") rmdir($dir.\"/\".$object); else unlink($dir.\"/\".$object);\n\t\t}\n\t }\n\t reset($objects);\n\t rmdir($dir);\n\t}\n }", "function recursive_remove_directory($directory, $empty = true) {\n\tif (substr($directory, -1) == DIRECTORY_SEPARATOR) {\n\t\t$directory = substr($directory, 0, -1);\n\t}\n\n\t// if the path is not valid or is not a directory ...\n\tif (!file_exists($directory) || !is_dir($directory)) {\n\t\t// ... we return false and exit the function\n\t\treturn FALSE;\n\n\t\t// ... if the path is not readable\n\t} elseif (!is_readable($directory)) {\n\t\t// ... we return false and exit the function\n\t\treturn FALSE;\n\n\t\t// ... else if the path is readable\n\t} else {\n\t\t// we open the directory\n\t\t$handle = opendir($directory);\n\n\t\t// and scan through the items inside\n\t\twhile (FALSE !== ($item = readdir($handle))) {\n\t\t\t// if the filepointer is not the current directory\n\t\t\t// or the parent directory\n\t\t\tif ($item != '.' && $item != '..') {\n\t\t\t\t// we build the new path to delete\n\t\t\t\t$path = $directory . DIRECTORY_SEPARATOR . $item;\n\n\t\t\t\t// if the new path is a directory\n\t\t\t\tif (is_dir($path)) {\n\t\t\t\t\t// we call this function with the new path\n\t\t\t\t\trecursive_remove_directory($path, $empty);\n\t\t\t\t\t// if the new path is a file\n\t\t\t\t} else {\n\t\t\t\t\t// $path = normalize_path($path, false);\n\t\t\t\t\ttry {\n\t\t\t\t\t\t@unlink($path);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception $e) {\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// close the directory\n\t\tclosedir($handle);\n\n\t\t// if the option to empty is not set to true\n\t\tif ($empty == FALSE) {\n\t\t\t@rmdir($directory);\n\t\t\t// try to delete the now empty directory\n\t\t\t// if (!rmdir($directory)) {\n\t\t\t//\n\t\t\t// // return false if not possible\n\t\t\t// return FALSE;\n\t\t\t// }\n\t\t}\n\n\t\t// return success\n\t\treturn TRUE;\n\t}\n}", "function rrmdir($dir)\n {\n if (is_dir($dir)) {\n $files = scandir($dir);\n foreach ($files as $file) {\n if (filetype($dir . \"/\" . $file) == \"dir\") {\n rrmdir($dir . \"/\" . $file);\n } else {\n unlink($dir . \"/\" . $file);\n }\n }\n rmdir($dir);\n }\n }", "private function rrmdir($dir) { \r\n\t foreach(glob($dir . '/*') as $file) { \r\n\t if(is_dir($file)) rrmdir($file); else unlink($file); \r\n\t } \r\n\t rmdir($dir); \r\n\t}", "function delDir($dir) {\n if (!file_exists($dir)) return true;\n if (!is_dir($dir)) return unlink($dir);\n foreach (scandir($dir) as $item) {\n if ($item == '.' || $item == '..') continue;\n if (!delDir($dir . DS . $item)) return false;\n }\n return rmdir($dir);\n}", "public function isDirectoryRemoveRecursivelyAllowed() {}", "function DELETE_RECURSIVE_DIRS($dirname) {\n\t\tif(is_dir($dirname))$dir_handle=opendir($dirname);\n\t\twhile($file=readdir($dir_handle)) {\n\t\t\tif($file!=\".\" && $file!=\"..\") {\n\t\t\t\tif(!is_dir($dirname.\"/\".$file)) unlink ($dirname.\"/\".$file);\n\t\t\telse DELETE_RECURSIVE_DIRS($dirname.\"/\".$file);\n\t\t\t}\n\t\t}\n\t\tclosedir($dir_handle);\n\t\trmdir($dirname);\n\t\treturn true;\n\t}", "public function rrmdir($path) {\n try {\n $i = new DirectoryIterator($path);\n foreach ($i as $f) {\n if ($f->isFile()) {\n unlink($f->getRealPath());\n } else if (!$f->isDot() && $f->isDir()) {\n $this->rrmdir($f->getRealPath());\n }\n }\n rmdir($path);\n } catch(\\Exception $e ){}\n }", "function rmdirr($dirname){ \r\n\t// Simple delete for a file \r\n\tif (is_file($dirname)) \r\n\t{ \r\n\t\treturn unlink($dirname); \r\n\t} \r\n\t// Loop through the folder \r\n\t$dir = dir($dirname); \r\n\twhile (false !== $entry = $dir->read()) { \r\n\t\t// Skip pointers \r\n\t\tif ($entry == '.' || $entry == '..') \r\n\t\t{ continue; } \r\n\t\t// Deep delete directories \r\n\t\tif (is_dir(\"$dirname/$entry\")) { \r\n\t\t\trmdirr(\"$dirname/$entry\"); \r\n\t\t} else { \r\n\t\t\tunlink(\"$dirname/$entry\"); \r\n\t\t} \r\n\t} \r\n\t// Clean up \r\n\t$dir->close(); \r\n\treturn rmdir($dirname);\r\n}", "function rrmdir($dir)\n{\n\tif (is_dir($dir))\n\t{\n\t\t$objects = scandir($dir);\n\t\tforeach ($objects as $object)\n\t\t{\n\t\t\tif ($object != \".\" && $object != \"..\")\n\t\t\t{\n\t\t\t\tif (filetype($dir.\"/\".$object) == \"dir\")\n\t\t\t\t$this->rrmdir($dir.\"/\".$object); \n\t\t\t\telse unlink($dir.\"/\".$object);\n\t\t\t}\n\t\t}\n\t\treset($objects);\n\t\trmdir($dir);\n\t}\n}", "public function rmdir_recursive($dir) {\n foreach (scandir($dir) as $file) {\n if ('.' === $file || '..' === $file)\n continue;\n if (is_dir(\"$dir/$file\"))\n $this->rmdir_recursive(\"$dir/$file\");\n else\n unlink(\"$dir/$file\");\n }\n\n rmdir($dir);\n }", "function rrmdir($path)\n{\n exec(\"rm -rf {$path}\");\n}", "function rrmdir($src) {\n $dir = opendir($src);\n while(false !== ( $file = readdir($dir)) ) {\n if (( $file != '.' ) && ( $file != '..' )) {\n\n $full = $src . '/' . $file;\n if ( is_dir($full) ) {\n rrmdir($full);\n }\n else {\n unlink($full);\n }\n }\n }\n closedir($dir);\n rmdir($src);\n}", "public function removeAppDirectory() {\n $dir = app_path() . '/EasyApi';\n\n $it = new \\RecursiveDirectoryIterator($dir, \\RecursiveDirectoryIterator::SKIP_DOTS);\n $files = new \\RecursiveIteratorIterator($it,\n \\RecursiveIteratorIterator::CHILD_FIRST);\n foreach($files as $file) {\n if ($file->isDir()){\n rmdir($file->getRealPath());\n } else {\n unlink($file->getRealPath());\n }\n }\n rmdir($dir);\n }", "public static function removeDir(string $path): void\n {\n $path = static::normalizePath($path);\n $dir_contents = static::dirContents($path);\n foreach ($dir_contents as $record) {\n is_dir($record) ? static::removeDir($record) : @unlink($record);\n }\n file_exists($path) && @rmdir($path);\n }", "function rm_rf($file) {\n if (is_dir($file)) {\n if (!($dh = opendir($file))) {\n return false;\n }\n while (($entry = readdir($dh)) !== false) {\n if ($entry == '.' || $entry == '..') continue;\n if (!rm_rf($file . DIRECTORY_SEPARATOR . $entry)) {\n closedir($dh);\n return false;\n }\n }\n closedir($dh);\n return rmdir($file);\n } else {\n return unlink($file);\n }\n}", "function empty_dir($dir) {\n $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir), RecursiveIteratorIterator::CHILD_FIRST);\n foreach ($iterator as $file) {\n if ($file->isFile()) {\n @unlink($file->__toString());\n } else {\n @rmdir($file->__toString());\n }\n }\n }", "private function delTree($dir) {\n\t\t$files = array_diff(scandir($dir), array('.','..'));\n\t\tforeach ($files as $file) {\n\t\t (is_dir(\"$dir/$file\")) ? $this->delTree(\"$dir/$file\") : unlink(\"$dir/$file\");\n\t\t}\n\t\treturn rmdir($dir);\n\t}", "function recursiveDelete ($directory, $empty = true) { \r\n\r\n if(substr($directory,-1) == \"/\") { \r\n $directory = substr($directory,0,-1); \r\n } \r\n\r\n if(!file_exists($directory) || !is_dir($directory)) { \r\n return false; \r\n } elseif(!is_readable($directory)) { \r\n return false; \r\n } else { \r\n $directoryHandle = opendir($directory);\r\n $contents = \".\";\r\n\r\n while ($contents) {\r\n $contents = readdir($directoryHandle);\r\n if(strlen($contents) && $contents != '.' && $contents != '..') {\r\n $path = $directory . \"/\" . $contents; \r\n \r\n if(is_dir($path)) { \r\n recursiveDelete($path); \r\n } else { \r\n unlink($path); \r\n } \r\n } \r\n } \r\n \r\n closedir($directoryHandle); \r\n\r\n if($empty == true) { \r\n if(!rmdir($directory)) {\r\n return false; \r\n } \r\n } \r\n \r\n return true; \r\n } \r\n}", "function deleteDirectory($dirPath) {\n if (is_dir($dirPath)) {\n $objects = scandir($dirPath);\n foreach ($objects as $object) {\n if ($object != \".\" && $object !=\"..\") {\n if (filetype($dirPath . DIRECTORY_SEPARATOR . $object) == \"dir\") {\n deleteDirectory($dirPath . DIRECTORY_SEPARATOR . $object);\n } else {\n unlink($dirPath . DIRECTORY_SEPARATOR . $object);\n }\n }\n }\n reset($objects);\n rmdir($dirPath);\n }\n}", "function ppRmdir($dirname)\n{\n // Sanity check\n if (!file_exists($dirname)) {\n return false;\n }\n \n // Simple delete for a file\n if (is_file($dirname)) {\n return unlink($dirname);\n }\n\n // Loop through the folder\n $dir = dir($dirname);\n while (false !== $entry = $dir->read()) {\n // Skip pointers\n if ($entry == '.' || $entry == '..') {\n continue;\n }\n\n // Recurse\n ppRmdir(\"$dirname/$entry\");\n }\n\n // Clean up\n $dir->close();\n return rmdir($dirname);\n}", "public static function deleteDirectory ($path) {\n\t\t\\rmdir($path);\n\t}", "function recursive_remove_directory($directory, $empty=FALSE)\n{\n\tif(substr($directory,-1) == '/')\n\t{\n\t\t$directory = substr($directory,0,-1);\n\t}\n\n\t// if the path is not valid or is not a directory ...\n\tif(!file_exists($directory) || !is_dir($directory))\n\t{\n\t\t// ... we return false and exit the function\n\t\treturn FALSE;\n\n\t// ... if the path is not readable\n\t}elseif(!is_readable($directory))\n\t{\n\t\t// ... we return false and exit the function\n\t\treturn FALSE;\n\n\t// ... else if the path is readable\n\t}else{\n\n\t\t// we open the directory\n\t\t$handle = opendir($directory);\n\n\t\t// and scan through the items inside\n\t\twhile (FALSE !== ($item = readdir($handle)))\n\t\t{\n\t\t\t// if the filepointer is not the current directory\n\t\t\t// or the parent directory\n\t\t\tif($item != '.' && $item != '..')\n\t\t\t{\n\t\t\t\t// we build the new path to delete\n\t\t\t\t$path = $directory.'/'.$item;\n\n\t\t\t\t// if the new path is a directory\n\t\t\t\tif(is_dir($path)) \n\t\t\t\t{\n\t\t\t\t\t// we call this function with the new path\n\t\t\t\t\trecursive_remove_directory($path);\n\n\t\t\t\t// if the new path is a file\n\t\t\t\t}else{\n\t\t\t\t\t// we remove the file\n\t\t\t\t\tunlink($path);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// close the directory\n\t\tclosedir($handle);\n\n\t\t// if the option to empty is not set to true\n\t\tif($empty == FALSE)\n\t\t{\n\t\t\t// try to delete the now empty directory\n\t\t\tif(!rmdir($directory))\n\t\t\t{\n\t\t\t\t// return false if not possible\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t\t// return success\n\t\treturn TRUE;\n\t}\n}", "function unlink_directory($folder) {\n if(is_dir($folder)) {\n $dh = opendir($folder);\n }\n if(!$dh) return false;\n while(false !== ($file = readdir($dh))) {\n if($file != '.' AND $file != '..') {\n if(!is_dir($folder.$file)) {\n unlink($folder.$file);\n } else {\n unlink_directory($folder.$file.'/');\n }\n }\n }\n closedir($dh);\n rmdir($folder);\n return true;\n}", "function borrarCarpeta($carpeta) {\r\n foreach(glob($carpeta . \"/*\") as $archivos_carpeta){ \r\n if (is_dir($archivos_carpeta)){\r\n if($archivos_carpeta != \".\" && $archivos_carpeta != \"..\") {\r\n borrarCarpeta($archivos_carpeta);\r\n }\r\n } else {\r\n unlink($archivos_carpeta);\r\n }\r\n }\r\n rmdir($carpeta);\r\n}", "function eliminar_archivos($dir)\n{\n\tif (is_dir($dir)) {\n\t\t$directorio = opendir($dir);\n\t\twhile ($archivo = readdir($directorio)) {\n\t\t\tif ($archivo != '.' and $archivo != '..') {\n\t\t\t\t@unlink($dir . $archivo);\n\t\t\t}\n\t\t}\n\t\tclosedir($directorio);\n\t\t@rmdir($dir);\n\t}\n}", "function deleteDir($dir)\n{\n if (substr($dir, strlen($dir)-1, 1) != '/')\n $dir .= '/';\n if ($handle = opendir($dir))\n {\n while ($obj = readdir($handle))\n {\n if ($obj != '.' && $obj != '..')\n {\n if (is_dir($dir.$obj))\n {\n if (!deleteDir($dir.$obj))\n return false;\n }\n elseif (is_file($dir.$obj))\n {\n if (!unlink($dir.$obj))\n return false;\n }\n }\n }\n\n closedir($handle);\n\n if (!@rmdir($dir))\n return false;\n return true;\n }\n return false;\n}", "public function rmdir_recursive($dir)\r\n\t{\r\n\t\tforeach (scandir($dir) as $file) {\r\n\t\t\tif ('.' === $file || '..' === $file)\r\n\t\t\t\tcontinue;\r\n\t\t\tif (is_dir(\"$dir/$file\"))\r\n\t\t\t\t$this->rmdir_recursive(\"$dir/$file\");\r\n\t\t\telse\r\n\t\t\t\tunlink(\"$dir/$file\");\r\n\t\t}\r\n\r\n\t\trmdir($dir);\r\n\t}", "function cleandir($dir)\n{\n\t$dir = preg_replace('!/*$!', '', $dir);\n\n\tif (!@is_dir($dir)) {\n\t\techo 'Couldn\\'t delete \"'. $dir .'\", directory does not exist<br />';\n\t\treturn;\n\t}\n\n\t$dirs = array(realpath($dir));\n\n\twhile (list(,$v) = each($dirs)) {\n\t\tif (!($files = glob($v .'/*', GLOB_NOSORT))) {\n\t\t\tcontinue;\n\t\t}\n\t\tforeach ($files as $file) {\n\t\t\tif (strpos($file, 'GLOBALS.php') !== false || strpos($file, 'oldfrm_upgrade.php') !== false) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\n\t\t\tif (is_dir($file) && !is_link($file)) {\n\t\t\t\t$dirs[] = $file;\n\t\t\t} else if (!unlink($file)) {\n\t\t\t\techo '<b>Could not delete file \"'. $file .'\"<br />';\n\t\t\t}\n\t\t}\n\t}\n\n\tforeach (array_reverse($dirs) as $dir) {\n\t\tif (!rmdir($dir)) {\n\t\t\techo '<b>Could not delete directory \"'. $dir .'\"<br />';\n\t\t}\n\t}\n}", "protected function recursiveRemoveDirectory($directory) {\n foreach (glob(\"{$directory}/{,.}*\", GLOB_BRACE) as $file) {\n if ($file === \"{$directory}/.\" || $file === \"{$directory}/..\")\n continue;\n if (is_dir($file)) {\n $this->recursiveRemoveDirectory($file);\n } else {\n unlink($file);\n }\n }\n rmdir($directory);\n }", "function recursive_remove_directory($directory, $empty=FALSE)\r\n{\r\n if(substr($directory,-1) == '/')\r\n {\r\n $directory = substr($directory,0,-1);\r\n }\r\n if(!file_exists($directory) || !is_dir($directory))\r\n {\r\n return FALSE;\r\n }elseif(is_readable($directory))\r\n {\r\n $handle = opendir($directory);\r\n while (FALSE !== ($item = readdir($handle)))\r\n {\r\n if($item != '.' && $item != '..')\r\n {\r\n $path = $directory.'/'.$item;\r\n if(is_dir($path)) \r\n {\r\n recursive_remove_directory($path);\r\n }else{\r\n unlink($path);\r\n }\r\n }\r\n }\r\n closedir($handle);\r\n if($empty == FALSE)\r\n {\r\n if(!rmdir($directory))\r\n {\r\n return FALSE;\r\n }\r\n }\r\n }\r\n return TRUE;\r\n }", "private function rrmdir($path) {\n\t\tforeach(glob($path . '/*') as $file) {\n\t\t\tif(is_dir($file))\n\t\t\t\t$this->rrmdir($file);\n\t\t\telse\n\t\t\t\tunlink($file);\n\t\t}\n\t\trmdir($path);\n\t}", "function rmdirRecursive( $dir )\n {\n if ( !is_writable( $dir ) )\n {\n if ( !@chmod( $dir, 0777 ) )\n {\n return FALSE;\n }\n }\n\n $d = dir( $dir );\n while ( FALSE !== ( $entry = $d->read() ) )\n {\n if ( $entry == '.' || $entry == '..' )\n {\n continue;\n }\n $entry = $dir . '/' . $entry;\n if ( is_dir( $entry ) )\n {\n if ( !atkFileUtils::rmdirRecursive( $entry ) )\n {\n return FALSE;\n }\n continue;\n }\n if ( !@unlink( $entry ) )\n {\n $d->close();\n return FALSE;\n }\n }\n\n $d->close();\n\n rmdir( $dir );\n\n return TRUE;\n }", "private function _deleteSubdirectory($dir)\n {\n unset($this->_subdirectories[$dir]);\n $this->_prune();\n }", "public static function rmdir($dir) {\r\n\tif (is_dir($dir)) {\r\n\t $objects = scandir($dir);\r\n\t foreach ($objects as $object) {\r\n\t\tif ($object != '.' && $object != '..') {\r\n\t\t if (filetype($dir . '/' . $object) == 'dir')\r\n\t\t\tself::rmdir($dir . '/' . $object); else\r\n\t\t\tunlink($dir . '/' . $object);\r\n\t\t}\r\n\t }\r\n\t reset($objects);\r\n\t return rmdir($dir);\r\n\t}\r\n }", "function rmrf($dir) {\n\t\tforeach (glob($dir) as $file)\n\t\t\tif (is_dir($file)) {\n\t\t\t\trmrf(\"$file/*\");\n\t\t\t\trmdir($file);\n\t\t\t} else\n\t\t\t\tunlink($file);\n\t}", "function delete_directory($dir) { \r\n \t \r\n\t if(is_dir($dir)) { $current_dir = opendir($dir); } else { return false; }\r\n \t \r\n \t while($entryname = readdir($current_dir)) { \r\n\t\t if(is_dir(\"$dir/$entryname\") and ($entryname != \".\" and $entryname!=\"..\")) { \r\n\t\t\t\tdelete_directory(\"${dir}/${entryname}\"); \r\n\t\t } elseif ($entryname != \".\" and $entryname!=\"..\") { \r\n\t\t\t\tunlink(\"${dir}/${entryname}\"); \r\n\t\t } \r\n \t } \r\n \t \r\n \t closedir($current_dir); \r\n \t @rmdir(${dir});\r\n\t \r\n\t return true; \r\n }" ]
[ "0.7860229", "0.7705845", "0.76790226", "0.7638309", "0.7600017", "0.7590016", "0.75827116", "0.75450927", "0.75448614", "0.75397563", "0.753273", "0.7474158", "0.74741113", "0.7473814", "0.7467633", "0.7432122", "0.743117", "0.74306524", "0.74216056", "0.7407098", "0.7395388", "0.7386335", "0.73773074", "0.73691934", "0.73629326", "0.73529464", "0.73484737", "0.73339725", "0.73299134", "0.73283494", "0.7327443", "0.7321817", "0.7307792", "0.7290669", "0.72867006", "0.72820204", "0.72586817", "0.7257673", "0.7256063", "0.7241216", "0.72157454", "0.7215273", "0.7213183", "0.7203907", "0.7198367", "0.71982884", "0.71851724", "0.71844417", "0.7182489", "0.71685666", "0.71549916", "0.7147972", "0.71450466", "0.7122321", "0.7113458", "0.71104866", "0.7108181", "0.70987654", "0.70818067", "0.70716816", "0.70636344", "0.7060539", "0.70531815", "0.70439154", "0.7043563", "0.7035559", "0.7010855", "0.70107037", "0.70018935", "0.70013076", "0.6997775", "0.69936883", "0.6979485", "0.6955108", "0.69467485", "0.6946404", "0.6941046", "0.6940574", "0.6920386", "0.69201803", "0.6911138", "0.6908178", "0.6906679", "0.69050527", "0.6887255", "0.68850577", "0.6850589", "0.684881", "0.683409", "0.682945", "0.6809674", "0.6807198", "0.68038005", "0.67925394", "0.6791967", "0.6784741", "0.6784251", "0.67726386", "0.6766254", "0.6762658" ]
0.8000187
0
Send all info to admin
function send_security_info($subject,$debug_message) { ob_start(); echo "<pre>"; echo "$debug_message<br>"; echo "user_ip: ".get_ip()."<br>"; echo "user_hostname: ".gethostbyaddr($_SERVER['REMOTE_ADDR'])."<br>"; echo "server: ".gethostname()."<br><br>"; echo "<u>_POST</u><br>".print_r($_POST,true)."<br><br>"; echo "<u>_GET</u><br>".print_r($_GET,true)."<br><br>"; echo "<u>_REQUEST</u><br>".print_r($_REQUEST,true)."<br><br>"; //echo "<u>_HTTP_REQUEST</u><br>".print_r($_HTTP_REQUEST,true)."<br><br>"; echo "<u>_SERVER</u><br>".print_r($_SERVER,true)."<br><br>"; echo "<u>_SESSION</u><br>".print_r($_SESSION,true)."<br><br>"; echo "<u>_FILES</u><br>".print_r($_FILES,true)."<br><br>"; echo "<u>apache_request_headers</u><br>".print_r(apache_request_headers(),true)."<br><br>"; echo "<u>getallheaders</u><br>".print_r(getallheaders(),true)."<br><br>"; echo "</pre>"; $debug_message=ob_get_contents(); // Set mail content ob_get_clean(); send_email('[email protected]','[email protected]','','',$subject,$debug_message); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function admin() {\r\n $Conductor = new Conductor($this->adapter);\r\n\r\n //Conseguimos todos los usuarios\r\n $allCon = $Conductor->getAllUsers();\r\n //Cargamos la vista index y le pasamos valores\r\n $this->view(\"Conductor/admin\", array(\"allCon\" => $allCon));\r\n \r\n }", "protected function admin_page_action() {\n\n\t\tif ( $this->is_admin_request_for_users_forget() ) {\n\t\t\t$this->users_forget();\n\t\t}\n\n\t\tif ( $this->is_admin_request_for_users_send_email() ) {\n\t\t\t$this->users_send_email();\n\t\t}\n\n\t\tif ( $this->is_admin_request_for_users_remove() ) {\n\t\t\t$this->users_remove_from_list();\n\t\t}\n\n\t\t/* Default settings page */\n\t\t$this->add_view_option( 'data', $this->get_all_requested_users_data( $confirmed_only = true ) );\n\n\t}", "public function administration()\n {\n\t\t// user connecter\n\t\tif (!$this->isUserConnected()) {\n\t\t\theader('Location: '.BASE_URL);\n\t\t\treturn ;\n\t\t}\n\t\t// user admin\n\t\tif ($this->getUserInfo('droit') != 'ARW' && $this->getUserInfo('droit') != 'MASTER') {\n\t\t\theader('Location: '.BASE_URL);\n\t\t\treturn ;\n\t\t}\n\n $this->loadModel('user');\n\n $result = $this->getModel()->getAllUsersInfos();\n\n\t\t$arrobj = new ArrayObject($result);\n for($i = $arrobj->getIterator(); $i->valid(); $i->next())\n {\n \t$usersInfos[] = array(\n \t\t'subject' => $i->current()->subject->getUri(),\n \t\t'pseudo' => $i->current()->pseudo->getValue(),\n \t\t'givenName' => $this->getModel()->getUserInfo($i->current()->pseudo->getValue(), 'givenName'),\n \t\t'familyName' => $this->getModel()->getUserInfo($i->current()->pseudo->getValue(), 'familyName'),\n \t\t'droit' => $i->current()->droit->getValue()\n \t\t);\n }\n\n \t$this->set('userPseudo', $this->getUserInfo('pseudo'));\n\n \t$this->set('usersInfos', $usersInfos);\n\n // On set la variable a afficher sur dans la vue\n $this->set('title', 'Administration des utilisateurs');\n // On fait le rendu de la vue signup.php\n $this->render('adminUser');\n }", "public function admin() {\r\n $ruta = new Ruta($this->adapter);\r\n\r\n //Conseguimos todos los usuarios\r\n $allrut = $ruta->getAll();\r\n //Cargamos la vista index y le pasamos valores\r\n $this->view(\"Ruta/admin\", array(\"allrut\" => $allrut));\r\n \r\n }", "public function admin_index() {\n\n\t\t\t/*get all data from table \"modules\"*/\n\t\t\t$modules=$this->Module->find(\"all\");\n\n\t\t\t/*set variables of page*/\n\t\t\t$this->set(\"title\", \"Gestion\");\n\t\t\t$this->set(\"legend\", \"Modules manager\");\n\t\t\t$this->set(\"modules\", $modules);\n\t\t\t}", "public function adminAction()\n {\n $contact = new ContactManager();\n $coordonnees = $contact->getContact();\n return $this->twig->render('admin/admin.html.twig', array(\n \"coordonnees\" => $coordonnees));\n }", "public function admin_mail(){\n\n\t\t\t/*load model and get all data from tables*/\n\t\t\t$this->loadModel(\"Support\");\n\t\t\t$this->loadModel(\"MailDest\");\n\t\t\t$support=$this->Support->findById(1);\n\t\t\t$support=$support['Support'];\n\t\t\t$this->Paginator->settings = array(\n\t\t\t\t'MailDest' => array(\n\t\t\t\t'limit' => 30\n\t\t\t\t)\n\t\t\t);\n\t\t\t$this->Paginator->settings = $this->paginate;\n\t\t\t$dests = $this->Paginator->paginate('MailDest');\n\n\t\t\t/*set variables of page*/\n\t\t\t$this->set(compact('support','dests'));\n\t\t\t$this->set(\"title\", \"Configuration\");\n\t\t\t$this->set(\"legend\", \"Support email setting\");\n\t\t\t}", "public function actionAdmin()\n {\n $query = \"SELECT * FROM vartotojai WHERE klase = :klase\";\n $vartotojai = Yii::$app->db_prod->createCommand($query, [':klase' => self::KLASE_ADMINISTRATORIUS])->queryAll();\n foreach ($vartotojai as $vartotojas) {\n if ($this->adminExists($vartotojas['id'])) {\n continue;\n }\n\n $admin = new Admin([\n 'scenario' => Admin::SCENARIO_SYSTEM_MIGRATES_ADMIN_DATA,\n 'id' => $vartotojas['id'],\n 'name' => $vartotojas['vardas'],\n 'surname' => $vartotojas['pavarde'],\n 'email' => $vartotojas['elpastas'],\n 'phone' => $vartotojas['telefonai'],\n 'password_reset_token' => Admin::DEFAULT_PASSWORD_RESET_TOKEN,\n 'admin' => Admin::IS_ADMIN,\n 'archived' => $this->convertArchiveStatus($vartotojas['archive_status']),\n 'created_at' => strtotime($vartotojas['data']),\n 'updated_at' => strtotime($vartotojas['data']),\n ]);\n\n $admin->generateAuthKey();\n\n if ($this->hadOldPassword($vartotojas['raw_password'])) {\n $admin->setPassword($vartotojas['raw_password']);\n } else {\n $admin->setPassword(self::DEFAULT_PASSWORD);\n }\n\n $this->fixValidationErrors($admin);\n $admin->validate();\n if ($admin->errors) {\n $this->writeToCSV(Admin::tableName(), $admin->errors, $admin->id);\n continue;\n }\n\n $admin->detachBehaviors(); // Remove timestamp behaviour\n $admin->save(false);\n }\n }", "public function admin_action() {\n\t}", "public function admin_action() {\n\t}", "public function all()\n {\n if (!$this->isLogged())\n {\n header('Location: ' . ROOT_URL);\n exit; \n }\n else{\n\n $this->oUtil->oAdd_Admins = $this->oModel->getAll();\n\n $this->oUtil->getView('admin');\n }\n }", "public function send() {\n $to = Yii::app()->params['adminEmail'];\n $subject = $this->subject;\n $message = $this->body;\n @mail($to, $subject, $message);\n }", "function admin()\n{\n global $app;\n\n $app->render('admin.html', [\n 'page' => mkPage(getMessageString('admin'), 0, 1),\n 'isadmin' => is_admin()]);\n}", "public function pageAdmin()\r\n\t{\r\n\t\t// Donnees\r\n\t\t$eventId = Bn::getValue('event_id');\r\n\t\t$oEvent = new Oevent($eventId);\r\n\t\t$oExtras = new Oeventextra($eventId);\r\n\r\n\t\t// Controle de l'autorisation\r\n\t\tif ( $oEvent->getVal('ownerid') != Bn::getValue('user_id') && !Oaccount::isLoginAdmin() ) return false;\r\n\r\n\t\t// Preparer les champs de saisie\r\n\t\t$body = new Body();\r\n\r\n\t\t// Titres\r\n\t\t$t = $body->addP('', '', 'bn-title-2');\r\n\t\t$t->addBalise('span', '', LOC_ITEM_GENERAL);\r\n\r\n\t\t// Infos generales\r\n\t\t$form = $body->addForm('frmAdmin', BPREF_UPDATE_ADMIN, 'targetDlg');\r\n\t\t$form->getForm()->addMetadata('success', \"updated\");\r\n\t\t$form->getForm()->addMetadata('dataType', \"'json'\");\r\n\r\n\t\t$div = $form->addDiv('', 'bn-div-left');\r\n\t\t$edt = $div->addEdit('nameevent', LOC_LABEL_EVENT_NAME, $oEvent->getVal('name'), 255);\r\n\t\t$edt->tooltip(LOC_TOOLTIP_EVENT_NAME);\r\n\r\n\t\t$edt = $div->addEdit('place', LOC_LABEL_EVENT_PLACE, $oEvent->getVal('place'), 25);\r\n\t\t$edt->tooltip(LOC_TOOLTIP_EVENT_PLACE);\r\n\r\n\t\t$edt = $div->addEdit('dateevent', LOC_LABEL_EVENT_DATE, $oEvent->getVal('date'), 25);\r\n\t\t$edt->tooltip(LOC_TOOLTIP_EVENT_DATE);\r\n\r\n\t\t$edt = $div->addEdit('numauto', LOC_LABEL_EVENT_NUMAUTO, $oEvent->getVal('numauto'), 50);\r\n\r\n\t\t$edt = $div->addEdit('organizer', LOC_LABEL_EVENT_ORGANIZER, $oEvent->getVal('organizer'), 75);\r\n\t\t$edt->noMandatory();\r\n\t\t//$edt->tooltip(LOC_TOOLTIP_EVENT_ORGANIZER);\r\n\r\n\t\t/* Region */\r\n\t\t$cbo = $div->addSelect('regionid', LOC_LABEL_EVENT_REGION);\r\n\t\t//$cbo->tooltip(LOC_TOOLTIP_EVENT_REGION);\r\n\t\t$regs = Ogeo::getRegions(-1, LOC_LABEL_SELECT_REGION);\r\n\t\t$cbo->addOptions($regs, $oExtras->getVal('regionid'));\r\n\r\n\t\t/* Departement */\r\n\t\t$cbo = $div->addSelect('deptid', LOC_LABEL_EVENT_DPT);\r\n\t\t//$cbo->tooltip(LOC_TOOLTIP_EVENT_DPT);\r\n\t\t$codeps = Ogeo::getDepts(-1, LOC_LABEL_SELECT_DPT);\r\n\t\t$cbo->addOptions($codeps, $oExtras->getVal('deptid'));\r\n\r\n\t\t$d = $div->addDiv('', 'bn-div-line');\r\n\t\t$edt = $d->addEditDate('firstday', LOC_LABEL_EVENT_FIRSTDAY, Bn::date($oEvent->getVal('firstday'), 'd-m-Y'));\r\n\t\t$edt->addOption('onSelect', 'selectFirstDay');\r\n\t\t$edt->addOption('maxDate', 'new Date(' . Bn::date($oEvent->getVal('lastday'), 'Y,m-1,d') .')');\r\n\t\t$edt = $d->addEditDate('lastday', LOC_LABEL_EVENT_LASTDAY, Bn::date($oEvent->getVal('lastday'), 'd-m-Y'));\r\n\t\t$edt->addOption('onSelect', 'selectLastDay');\r\n\t\t$edt->addOption('minDate', 'new Date(' . Bn::date($oEvent->getVal('firstday'), 'Y,m-1,d') .')');\r\n\r\n\t\t$d->addBreak();\r\n\r\n\t\t$d = $form->addDiv('', 'bn-div-btn');\r\n\t\t$d->addButtonValid('', LOC_BTN_UPDATE);\r\n\r\n\t\t// Envoi au navigateur\r\n\t\t$body->display();\r\n\t\treturn false;\r\n\t}", "public function admin()\n {\n $this->view->books = $this->help->getBookList();\n $this->view->title = $this->lang->help->common;\n $this->display();\n }", "public function admin_page()\n {\n }", "public function admin_page()\n {\n }", "public function adminPanel() {\n $posts = $this->postManager->getPosts();\n $comments = $this->commentManager->getFlaggedComments();\n $view = new View(\"Administration\");\n $view->generate(array('posts' => $posts, 'comments' => $comments));\n }", "function ask_admin($querstion_for_admin){\n\t\tif( isset($_POST[$querstion_for_admin]) ){\n\t\t\tglobal $base;\n\n\t\t\t$content = $base->clear_string($_POST[$querstion_for_admin]);\n\n\t\t\t$query = \"SELECT * FROM users WHERE role='master_admin'\";\n $find_id = user::find_this_query($query);\n $master_admin_id='';\n\t foreach ($find_id as $id) {\n\t $master_admin_id = $id->user_id;\n\t\t\t\t}\n\n\t\t\t$user = user::find_this_id( $base->clear_string($_SESSION['user_id']) );\n\n\t\t\t$messages_admin = new messages_admin();\n\t\t\t$messages_admin->admin_id\t= $master_admin_id;\n\t\t\t$messages_admin->client_id \t= $user->user_id;\n\t\t\t$messages_admin->content \t= $content;\n\t\t\t$messages_admin->date \t\t= date('Y-m-d H:i:s');\n\n\t\t\t\n\t\t\t$messages_admin->create();\n\n\t\t\tmail('[email protected]', 'Pitanje Korisnika: '.$user->name, $content, \"From: \".$user->email);\n\n\t\t}\n\t}", "public function updateAdmin()\r\n\t{\r\n\t\t// Donnees\r\n\t\t$eventId = Bn::getValue('event_id');\r\n\t\t$oEvent = new Oevent($eventId);\r\n\t\t// Controle de l'autorisation\r\n\t\tif ( $oEvent->getVal('ownerid') != Bn::getValue('user_id') && !Oaccount::isLoginAdmin() ) return false;\r\n\r\n\t\t// Donnees du tournoi\r\n\t\t$oEvent->setVal('name', Bn::getValue('nameevent'));\r\n\t\t$oEvent->setVal('date', Bn::getValue('dateevent'));\r\n\t\t$oEvent->setVal('organizer', Bn::getValue('organizer'));\r\n\t\t$oEvent->setVal('place', Bn::getValue('place'));\r\n\t\t$oEvent->setVal('numauto', Bn::getValue('numauto'));\r\n\t\t$oEvent->setVal('firstday', Bn::getValue('firstday'));\r\n\t\t$oEvent->setVal('lastday', Bn::getValue('lastday'));\r\n\t\t$season = Oseason::getSeason(Bn::getValue('firstday'));\r\n\t\t$oEvent->setVal('season', $season);\r\n\t\t$oEvent->save();\t\t\r\n\r\n\t\t$oExtras = new Oeventextra($eventId);\r\n\t\t$oExtras->setVal('regionid', Bn::getValue('regionid'));\r\n\t\t$oExtras->setVal('deptid', Bn::getValue('deptid'));\r\n\t\t$oExtras->save();\r\n\r\n\t\t// Message de fin\r\n\t\t// Preparer les champs de saisie\r\n\t\t$body = new Body();\r\n\t\t$body->addWarning(LOC_LABEL_PREF_REGISTERED);\r\n\t\t$d = $body->addDiv('', 'bn-div-btn');\r\n\t\t$d->addButtonCancel('btnCancel', LOC_BTN_CLOSE);\r\n\r\n\t\t// Envoi au navigateur\r\n\t\t$res = array('content' => $body->toHtml(),\r\n\t\t\t\t\t'title' => LOC_ITEM_GENERAL);\r\n\t\techo Bn::toJson($res);\r\n\t\treturn false;\r\n\t}", "public function manageAsAdmin()\n {\n try {\n $server = $this->server->currentOrFail();\n } catch (\\RuntimeException $exc) {\n $this->exitWithMessage($exc->getMessage());\n }\n\n $this->transferTo(\n $this->api->getAdminUrlFromApi(sprintf(\n 'hardware/server/%d',\n $server->id\n ))\n );\n }", "public function admin()\n {\n $this->template_admin->displayad('admin');\n }", "public function admin() {\n\t\tinclude_once(\"paywithafacebookpost_admin.php\");\n\t}", "function admin_member() {\n\n\t\t}", "public function admin_index() {\n\t\t\t$this->layout = \"default2\";\n\t\t\t$users = $this->User->find('all', array(\n\t\t\t\t'fields'=>array('id', 'username', 'mail', 'groups_id')\n\t\t\t\t)\n\t\t\t);\n\t \t\t$this->set(compact('users'));\n\t\t}", "public function admin()\n {\n if ($this->loggedIn()) {\n $data['flights'] = $this->modalPage->getFlights();\n $data['name'] = $_SESSION['user_name'];\n $data['title'] = 'dashboard ' . $_SESSION['user_name'];\n $this->view(\"dashboard/\" . $_SESSION['user_role'], $data);\n\n } else {\n redirect('users/login');\n }\n\n }", "public function sendEmail()\r\n {\r\n\t\t$mail = new UserMails;\r\n\t\t$mail->sendAdminEmail('admin-user', $this->_user);\r\n }", "function printAdminPage() {\n require ('adminPage.php');\n adminPage($this);\n }", "public function admin_index(){\n\n\n\t\t\t// On liste toutes les utilisateurs\n\t\t\t$users = $this->User->find('all');\n\n\t\t\tif(!empty($users)){\n\t\t\t\t// Si on a des bacs, on liste les bacs\n\t\t\t\t$this->set(compact('users'));\n\t\t\t\t\n\t\t\t}\n\n\t\t}", "public function admin_options() {\n\n\t\t\t?>\n\t\t\t<h3>ATOS</h3>\n\t\t\t<p><?php _e('Acceptez les paiements par carte bleue grâce à Atos.', 'woothemes'); ?></p>\n\t\t\t<p><?php _e('Plugin créé par David Fiaty', 'woothemes'); ?> - <a href=\"http://www.cmsbox.fr\">http://www.cmsbox.fr</a></p>\n\t\t\t<table class=\"form-table\">\n\t\t\t<?php\n\t\t\t\t// Generate the HTML For the settings form.\n\t\t\t\t$this->generate_settings_html();\n\t\t\t?>\n\t\t\t</table><!--/.form-table-->\n\t\t\t<?php\n\t\t}", "public function administrator(){\n\t\t$this->verify();\n\t\t$data['title']=\"Administrator\";\n\t\t$data['admin_list']=$this->admin_model->fetch_admin();\n\t\t$this->load->view('parts/head', $data);\n\t\t$this->load->view('administrator/administrator', $data);\n\t\t$this->load->view('parts/javascript', $data);\n\t}", "function showAdmins() {\n // permissions...\n if(!Current_User::isDeity()) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Menu.php');\n $error = 'Uh Uh Uh! You didn\\'t say the magic word!';\n Sysinventory_Menu::showMenu($error);\n return;\n }\n // see if we need to do anything to the db\n if(isset($_REQUEST['newadmin'])) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $admin = new Sysinventory_Admin;\n $admin->department_id = $_REQUEST['department_id'];\n $admin->username = $_REQUEST['username'];\n $admin->save();\n }else if (isset($_REQUEST['deladmin'])) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $admin = new Sysinventory_Admin;\n $admin->id = $_REQUEST['id'];\n $admin->delete();\n }\n\n // set up some stuff for the page template\n $tpl = array();\n $tpl['PAGE_TITLE'] = 'Edit Administrators';\n $tpl['HOME_LINK'] = PHPWS_Text::moduleLink('Back to menu','sysinventory');\n\n // create the list of admins\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $adminList = Sysinventory_Admin::generateAdminList();\n // get the list of departments\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Department.php');\n $depts = Sysinventory_Department::getDepartmentsByUsername();\n\n // build the array for the department drop-down box\n $deptIdSelect = array();\n foreach($depts as $dept) {\n $deptIdSelect[$dept['id']] = $dept['description'];\n }\n\n // make the form for adding a new admin\n $form = new PHPWS_Form('add_admin');\n $form->addSelect('department_id',$deptIdSelect);\n $form->setLabel('department_id','Department');\n $form->addText('username');\n $form->setLabel('username','Username');\n $form->addSubmit('submit','Create Admin');\n $form->setAction('index.php?module=sysinventory&action=edit_admins');\n $form->addHidden('newadmin','add');\n\n $tpl['PAGER'] = $adminList;\n\n $form->mergeTemplate($tpl);\n\n $template = PHPWS_Template::process($form->getTemplate(),'sysinventory','edit_admin.tpl');\n\n Layout::addStyle('sysinventory','style.css');\n Layout::add($template);\n\n }", "function showAdmins() {\n // permissions...\n if(!Current_User::isDeity()) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Menu.php');\n $error = 'Uh Uh Uh! You didn\\'t say the magic word!';\n Sysinventory_Menu::showMenu($error);\n return;\n }\n // see if we need to do anything to the db\n if(isset($_REQUEST['newadmin'])) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $admin = new Sysinventory_Admin;\n $admin->department_id = $_REQUEST['department_id'];\n $admin->username = $_REQUEST['username'];\n $admin->save();\n }else if (isset($_REQUEST['deladmin'])) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $admin = new Sysinventory_Admin;\n $admin->id = $_REQUEST['id'];\n $admin->delete();\n }\n\n // set up some stuff for the page template\n $tpl = array();\n $tpl['PAGE_TITLE'] = 'Edit Administrators';\n $tpl['HOME_LINK'] = PHPWS_Text::moduleLink('Back to menu','sysinventory');\n\n // create the list of admins\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $adminList = Sysinventory_Admin::generateAdminList();\n // get the list of departments\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Department.php');\n $depts = Sysinventory_Department::getDepartmentsByUsername();\n\n // build the array for the department drop-down box\n $deptIdSelect = array();\n foreach($depts as $dept) {\n $deptIdSelect[$dept['id']] = $dept['description'];\n }\n\n // make the form for adding a new admin\n $form = new PHPWS_Form('add_admin');\n $form->addSelect('department_id',$deptIdSelect);\n $form->setLabel('department_id','Department');\n $form->addText('username');\n $form->setLabel('username','Username');\n $form->addSubmit('submit','Create Admin');\n $form->setAction('index.php?module=sysinventory&action=edit_admins');\n $form->addHidden('newadmin','add');\n\n $tpl['PAGER'] = $adminList;\n\n $form->mergeTemplate($tpl);\n\n $template = PHPWS_Template::process($form->getTemplate(),'sysinventory','edit_admin.tpl');\n\n Layout::addStyle('sysinventory','style.css');\n Layout::add($template);\n\n }", "function editAdminHandler() {\n global $inputs;\n\n updateDb('admin',[\n 'name' => $inputs['admin_username'],\n 'password' => $inputs['admin_password'],\n ], [\n 'id' => $inputs['id']\n ]);\n\n updateDb('admin_building',[\n 'building_id' => $inputs['admin_building'],\n ], [\n 'admin_id' => $inputs['id']\n ]);\n\n formatOutput(true, 'update success');\n}", "public function admin_options() {\r\n echo '<h3>' . __('Mondido', 'mondido') . '</h3>';\r\n echo '<p>' . __('Mondido, Simple payments, smart functions', 'mondido') . '</p>';\r\n echo '<table class=\"form-table\">';\r\n // Generate the HTML For the settings form.\r\n $this->generate_settings_html();\r\n echo '</table>';\r\n }", "public function indexAction()\r\n {\r\n echo 'User admin index';\r\n }", "public function mainAction() {\n return array(\n 'admins' => $this->get('snowcap_admin')->getAdmins(),\n );\n }", "public function showAdminAction()\n {\n header (\"location: admin.php?route=adminAccueil\");\n }", "function adminOptions() {\r\n\t\t\tTrackTheBookView::render('admin-options');\r\n\t\t}", "public function admin_index() \n\t{\n\t\t$results = $this->paginate();\n\n\t\t// Set\n\t\t$this->set(\n\t\t\tarray(\n\t\t\t\t'title_for_layout' \t=> 'Notícias',\n\t\t\t\t'action'\t\t\t=> 'add',\n\t\t\t\t'button'\t\t\t=> 'Adicionar Notícia',\n\t\t\t\t'class'\t\t\t\t=> 'success',\n\t\t\t\t'is_save'\t\t\t=> false,\n\t\t\t\t'results'\t\t\t=> $results\n\t\t\t)\n\t\t);\n\t}", "function admin_page() {\n\t\t$this->maybe_authorize();\n?>\n\t\t<div class=\"wrap ghupdate-admin\">\n\n\t\t\t<div class=\"head-wrap\">\n\t\t\t\t<?php screen_icon( 'plugins' ); ?>\n\t\t\t\t<h2><?php _e( 'Setup GitHub Updates' , 'github_plugin_updater' ); ?></h2>\n\t\t\t</div>\n\n\t\t\t<div class=\"postbox-container primary\">\n\t\t\t\t<form method=\"post\" id=\"ghupdate\" action=\"options.php\">\n\t\t\t\t\t<?php\n\t\tsettings_errors();\n\t\tsettings_fields( 'ghupdate' ); // includes nonce\n\t\tdo_settings_sections( 'github-updater' );\n?>\n\t\t\t\t</form>\n\t\t\t</div>\n\n\t\t</div>\n\t\t<?php\n\t}", "public function adminPanel()\n {\n $userManager = new UserManager;\n $infoUser = $userManager->getInfo($_SESSION['id_user']);\n if ($_SESSION['id_user'] == $infoUser['id'] and $infoUser['rank_id'] == 1) {\n $postManager = new PostManager;\n $commentManager = new CommentManager;\n $findPost = $postManager->getPosts();\n $commentReport = $commentManager->getReport();\n $unpublished = $commentManager->getUnpublished();\n require('Views/Backend/panelAdminView.php');\n } else {\n throw new Exception('Vous n\\'êtes pas autorisé à faire cela');\n }\n }", "public function adminMethod(){\n return 'ok';\n }", "public function indexAction(): void\n {\n echo 'User admin index';\n }", "function admin()\r\n\t{\r\n\t\t$this->permiso_model->need_admin_permition_level();\t\r\n\t\t\r\n\t\t$data = array();\r\n\t\t$data['main_content'] = 'admin_index';\r\n\r\n\t\t$this->load->model('tutor_model');\r\n\t\t$data['num_tutor'] = $this->tutor_model->count_all();\r\n\t\t\r\n\t\t$this->load->model('alumno_model');\r\n\t\t$data['num_alumno'] = $this->alumno_model->count_all();\r\n\t\t\r\n\t\t$this->load->model('tarea_model');\r\n\t\t$data['num_tarea'] = $this->tarea_model->count_all();\r\n\r\n\t\t$this->load->model('grupo_model');\r\n\t\t$data['num_grupo'] = $this->grupo_model->count_all();\r\n\r\n\t\t$this->load->view('includes/template',$data);\r\n\t}", "function showAllServiciosMVCadmin()\n {\n if ($this->admin) {\n $servicios = $this->serviciosModel->getServicios();\n $this->viewservices->showAllServicesPrintAdmin($servicios);\n } else {\n header(\"Location: \" . BASE_URL);\n }\n }", "protected function admin_page_action() {\n\n\t\tif ( $this->is_request_consents_log() ) {\n\t\t\t$this->download_consents_log();\n\t\t}\n\n\t}", "public function admin() {\n\n\t\t\tif ( ! is_admin() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\trequire_once $this->includes_path() . 'admin/class-cyprus-admin.php';\n\t\t}", "public function admin_index() {\n\t\t$this->layout=\"admindefault\";\n\t\t$this->adminsessionchecked();\n\t\t$this->User->recursive = 0;\n\t\t$this->Paginator->settings=array(\n\t\t\t'conditions'=>array(\n\t\t\t\t'User.is_deleted'=>'0'\n\t\t\t)\n\t\t);\n\t\t$this->set('users', $this->Paginator->paginate());\n\t\t//$this->set('allowedimage',$this->allowedimageType);\n\t}", "public function adminmenu()\n {\n\n $vue = new ViewAdmin(\"Administration\");\n $vue->generer(array());\n }", "public function indexAction() {\n $admin = $this->session->admin;\n if (!is_null($admin)) {\n $this->view->grid = Yourdelivery_Model_Crm_Ticket::getGrid(null, null, $admin->getId());\n }\n else {\n $this->error(__b(\"Admin information not found. Strange :(\"));\n } \n }", "public function executeAdminNotify()\n {\n if ( in_array( $this->getParameter( 'option_name' ), array( 'bookly_sms_notify_low_balance', 'bookly_sms_notify_weekly_summary' ) ) ) {\n update_option( $this->getParameter( 'option_name' ), $this->getParameter( 'value' ) );\n }\n wp_send_json_success();\n }", "function showAdmins() {\n // permissions...\n if(!Current_User::isDeity()) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Error.php');\n $error = 'Uh Uh Uh! You didn\\'t say the magic word!';\n Sysinventory_Error::error($error);\n return;\n }\n\n // set up some stuff for the page template\n $tpl = array();\n $tpl['PAGE_TITLE'] = 'Edit Administrators';\n $tpl['HOME_LINK'] = PHPWS_Text::moduleLink('Back to menu','sysinventory');\n\n // create the list of admins\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $adminList = Sysinventory_Admin::generateAdminList();\n // get the list of departments\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Department.php');\n $depts = Sysinventory_Department::getDepartmentsByUsername();\n\n // build the array for the department drop-down box\n $deptIdSelect = array();\n foreach($depts as $dept) {\n $deptIdSelect[$dept['id']] = $dept['description'];\n }\n\n // make the form for adding a new admin\n $form = new PHPWS_Form('add_admin');\n $form->addSelect('department_id',$deptIdSelect);\n $form->setLabel('department_id','Department');\n $form->addText('username');\n $form->setLabel('username','Username');\n $form->addSubmit('submit','Create Admin');\n $form->setAction('index.php?module=sysinventory&action=edit_admins');\n $form->addHidden('newadmin','add');\n\n $tpl['PAGER'] = $adminList;\n\n $form->mergeTemplate($tpl);\n\n $template = PHPWS_Template::process($form->getTemplate(),'sysinventory','edit_admin.tpl');\n\n Layout::addStyle('sysinventory','style.css');\n Layout::add($template);\n\n }", "public function admin_setup()\n\t{\n\t\t\n\t}", "public function admin_page()\n {\n echo $this->return_admin_page();\n }", "function managementAdminAll(){\n $Admins = new \\Project\\Models\\ManagementAdminManager();\n $allAdmin = $Admins->allManagementAdmin();\n\n require 'app/views/back/managementAdmin.php';\n }", "public function index()\n {\n $number_of_items = $this->calculate->getTotalOfItemsAdmin();\n if (null != $this->request->ifParameter(\"id\")) {\n $items_current_page = $this->request->getParameter(\"id\");\n } else {\n $items_current_page = 1;\n }\n $items = $this->item->getItemsForAdmin($items_current_page);\n $page_previous_items = $items_current_page - 1;\n $page_next_items = $items_current_page + 1;\n $number_of_items_pages = $this->calculate->getNumberOfPagesOfExtAdmin();\n $this->generateadminView(array(\n 'items' => $items,\n 'number_of_items' => $number_of_items,\n 'items_current_page' => $items_current_page,\n 'page_previous_items' => $page_previous_items,\n 'page_next_items' => $page_next_items,\n 'number_of_items_pages' => $number_of_items_pages\n ));\n }", "protected function executeAdminCommand() {}", "protected function executeAdminCommand() {}", "protected function executeAdminCommand() {}", "public function admin ()\n {\n return Response()->json([\n 'status'=>1,\n 'pid'=>'fetchdata', \n 'message'=>'Fetch data ui untuk admin berhasil diperoleh'\n ],200)->setEncodingOptions(JSON_NUMERIC_CHECK);\n \n \n }", "public function actionAdmin()\n\t{\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->layout = 'admin';\n\n\t\t$this->render('admin');\n\t}", "public function action_index()\n\t{\n\t\tif ( ! Auth::instance()->logged_in('admin'))\n\t\t\tthrow new HTTP_Exception_403();\n\t\t\n\t\t// show admin page\n\t\t$companies = ORM::factory('company')->find_all();\n\t\t$this->template->content = View::factory('admin/admin')->bind('companies', $companies);\n\t\t\n\t}", "public function listAdminAction() {\n $dons = $this->getDoctrine()->getManager()->getRepository('EasyDonBundle:Don')->findAll();\n\n return $this->render('EasyDonBundle:Don:listAdmin.html.twig', array('dons' => $dons));\n }", "public function admin_logs_manage() {\n $app = $this->app;\n if ($this->isUserAdmin()) {\n $srv = $this->srv;\n $logs = $srv->retrieve_all_logs();\n $app->render('Logbook/admin_manage_logs.html.twig', ['globals' => $this->getGlobals(), 'logs' => $logs]);\n } else {\n $app->flash('error', 'Ongeldige bewerking.');\n $app->redirect($app->urlFor('main_page'));\n }\n }", "public function admin_index()\n {\n $this->set('title_for_layout', __('Dashboard'));\n\n $user = $this->Session->read('Auth.User');\n if (isset($user) === false) {\n $this->redirect(\n array(\n 'controller' => 'users',\n 'action' => 'login',\n 'admin' => true,\n )\n );\n }\n\n $this->SiStayConnected->readData();\n $this->set(compact('user'));\n\n }", "public function allAdminList(){\n $result = $this->adminModel->getAllAdmin();\n foreach ($result as $row){\n $data[] = array('AdminID'=>$row->adminID,'Email'=>$row->email,'role'=>$row->type,\n );\n }\n $this->view('admins/allAdminList',$data);\n\n }", "function action_admin_info()\n {\n $this->load_options();\n if (!$this->ready) {\n echo '<div class=\"container\">The reCAPTCHA V2 plugin is almost ready to go. Please go the the '\n .'plugin configuration section to enter your API keys.</div>';\n }\n }", "function admin_modify() {\r\n\t\tglobal $wpdb, $current_user;\r\n\r\n\t\tif ( !is_super_admin() ) {\r\n\t\t\techo \"<p>\" . __('Nice Try...', 'psts') . \"</p>\"; //If accessed properly, this message doesn't appear.\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t//add manual log entries\r\n\t\tif ( isset($_POST['log_entry']) ) {\r\n\t\t\t$this->log_action( (int)$_GET['bid'], $current_user->display_name . ': \"' . strip_tags(stripslashes($_POST['log_entry'])) . '\"' );\r\n\t\t\techo '<div id=\"message\" class=\"updated fade\"><p>'.__('Log entry added.', 'psts').'</p></div>';\r\n\t\t}\r\n\t\t\t\t\r\n //extend blog\r\n if ( isset($_POST['psts_extend']) ) {\r\n check_admin_referer('psts_extend'); //check nonce\r\n\r\n if ( isset($_POST['extend_permanent']) ) {\r\n $extend = 9999999999;\r\n } else {\r\n\t\t\t\t$months = $_POST['extend_months'];\r\n\t\t\t\t$days = $_POST['extend_days'];\r\n\t\t\t\t$extend = strtotime(\"+$months Months $days Days\") - time();\r\n\t\t\t}\r\n\t\t\t$this->extend((int)$_POST['bid'], $extend, __('Manual', 'psts'), $_POST['extend_level']);\r\n\t\t\techo '<div id=\"message\" class=\"updated fade\"><p>'.__('Site Extended.', 'psts').'</p></div>';\r\n\t\t}\t\t\r\n\t\t\t\r\n\t\tif ( isset($_POST['psts_transfer_pro']) ) {\r\n\t\t\t$new_bid = (int)$_POST['new_bid'];\r\n\t\t\t$current_bid = (int)$_GET['bid'];\r\n\t\t\tif ( !$new_bid ) {\r\n\t\t\t\techo '<div id=\"message\" class=\"error\"><p>'.__('Please enter the Blog ID of a site to transfer too.', 'psts').'</p></div>';\r\n\t\t\t} else if ( is_pro_site($new_bid) ) {\r\n\t\t\t\techo '<div id=\"message\" class=\"error\"><p>'.__('Could not transfer Pro Status: The chosen site already is a Pro Site. You must remove Pro status and cancel any existing subscriptions tied to that site.', 'psts').'</p></div>';\r\n\t\t\t} else {\r\n\t\t\t\t$current_level = $wpdb->get_row(\"SELECT * FROM {$wpdb->base_prefix}pro_sites WHERE blog_ID = '$current_bid'\");\r\n\t\t\t\t$new_expire = $current_level->expire - time();\r\n\t\t\t\t$this->extend($new_bid, $new_expire, $current_level->gateway, $current_level->level, $current_level->amount);\r\n\t\t\t\t$wpdb->query(\"UPDATE {$wpdb->base_prefix}pro_sites SET term = '{$current_level->term}' WHERE blog_ID = '$new_bid'\");\r\n\t\t\t\t$this->withdraw($current_bid);\r\n\t\t\t\t$this->log_action( $current_bid, sprintf(__('Pro Status transferred by %s to BlogID: %d', 'psts'), $current_user->display_name, $new_bid) );\r\n\t\t\t\t$this->log_action( $new_bid, sprintf(__('Pro Status transferred by %s from BlogID: %d', 'psts'), $current_user->display_name, $current_bid) );\r\n\t\t\t\tdo_action('psts_transfer_pro', $current_bid, $new_bid); //for gateways to hook into for api calls, etc.\r\n\t\t\t\techo '<div id=\"message\" class=\"updated fade\"><p>'.sprintf(__('Pro Status transferred to BlogID: %d', 'psts'), (int)$_POST['new_bid']).'</p></div>';\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\t//remove blog\r\n if ( isset($_POST['psts_modify']) ) {\r\n check_admin_referer('psts_modify'); //check nonce\r\n\r\n do_action('psts_modify_process', (int)$_POST['bid']);\r\n\r\n if ( isset($_POST['psts_remove']) ) {\r\n $this->withdraw((int)$_POST['bid']);\r\n\t\t\t\techo '<div id=\"message\" class=\"updated fade\"><p>'.__('Pro Site Status Removed.', 'psts').'</p></div>';\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ( isset($_POST['psts_receipt']) ) {\r\n $this->email_notification((int)$_POST['bid'], 'receipt', $_POST['receipt_email']);\r\n\t\t\t\techo '<div id=\"message\" class=\"updated fade\"><p>'.__('Email receipt sent.', 'psts').'</p></div>';\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t\t\r\n\t\t//check blog_id\r\n\t\tif( isset( $_GET['bid'] ) ) {\r\n\t\t\t$blog_count = $wpdb->get_var(\"SELECT COUNT(*) FROM {$wpdb->base_prefix}blogs WHERE blog_ID = '\" . (int)$_GET['bid'] . \"'\");\r\n\t\t\tif ( !$blog_count ) {\r\n\t\t\t\techo '<div id=\"message\" class=\"updated fade\"><p>'.__('Invalid blog ID. Please try again.', 'psts').'</p></div>';\r\n \t\t$blog_id = false;\r\n\t\t\t} else {\r\n\t\t\t\t$blog_id = (int)$_GET['bid'];\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$blog_id = false;\r\n\t\t}\r\n\r\n\t\t?>\r\n\t\t<div class=\"wrap\">\r\n\t\t<script type=\"text/javascript\">\r\n \t jQuery(document).ready(function () {\r\n \t\t jQuery('input.psts_confirm').click(function() {\r\n var answer = confirm(\"<?php _e('Are you sure you really want to do this?', 'psts'); ?>\")\r\n if (answer){\r\n return true;\r\n } else {\r\n return false;\r\n };\r\n });\r\n \t\t});\r\n \t</script>\r\n \t<div class=\"icon32\"><img src=\"<?php echo $this->plugin_url . 'images/modify.png'; ?>\" /></div>\r\n <h2><?php _e('Pro Sites Management', 'psts'); ?></h2>\r\n\r\n <?php if ( $blog_id ) { ?>\r\n \t<h3><?php _e('Manage Site', 'psts') ?>\r\n\t\t\t<?php\r\n if ($name = get_blog_option($blog_id, 'blogname'))\r\n echo ': '.$name.' (Blog ID: '.$blog_id.')';\r\n\r\n echo '</h3>';\r\n\r\n \t\t$levels = (array)get_site_option('psts_levels');\r\n \t\t$current_level = $this->get_level($blog_id);\r\n $expire = $this->get_expire($blog_id);\r\n $result = $wpdb->get_row(\"SELECT * FROM {$wpdb->base_prefix}pro_sites WHERE blog_ID = '$blog_id'\");\r\n if ($result) {\r\n\t\t\t\tif ($result->term == 1 || $result->term == 3 || $result->term == 12)\r\n\t $term = sprintf(__('%s Month', 'psts'), $result->term);\r\n\t else\r\n\t $term = $result->term;\r\n\t\t\t} else {\r\n\t\t\t\t$term = 0;\r\n\t\t\t}\r\n\r\n if ($expire && $expire > time()) {\r\n echo '<p><strong>'.__('Current Pro Site', 'psts').'</strong></p>';\r\n\r\n echo '<ul>';\r\n\t\t\t\tif ($expire > 2147483647)\r\n\t\t\t\t\techo '<li>'.__('Pro Site privileges will expire: <strong>Never</strong>', 'psts').'</li>';\r\n\t\t\t\telse\r\n \techo '<li>'.sprintf(__('Pro Site privileges will expire on: <strong>%s</strong>', 'psts'), date_i18n(get_option('date_format'), $expire)).'</li>';\r\n\r\n echo '<li>'.sprintf(__('Level: <strong>%s</strong>', 'psts'), $current_level . ' - ' . @$levels[$current_level]['name']).'</li>';\r\n if ($result->gateway)\r\n\t\t\t\t\techo '<li>'.sprintf(__('Payment Gateway: <strong>%s</strong>', 'psts'), $result->gateway).'</li>';\r\n if ($term)\r\n \techo '<li>'.sprintf(__('Payment Term: <strong>%s</strong>', 'psts'), $term).'</li>';\r\n echo '</ul>';\r\n\r\n } else if ($expire && $expire <= time()) {\r\n echo '<p><strong>'.__('Expired Pro Site', 'psts').'</strong></p>';\r\n\r\n echo '<ul>';\r\n echo '<li>'.sprintf(__('Pro Site privileges expired on: <strong>%s</strong>', 'psts'), date_i18n(get_option('date_format'), $expire)).'</li>';\r\n\r\n echo '<li>'.sprintf(__('Previous Level: <strong>%s</strong>', 'psts'), $current_level . ' - ' . @$levels[$current_level]['name']).'</li>';\r\n if ($result->gateway)\r\n\t\t\t\t\techo '<li>'.sprintf(__('Previous Payment Gateway: <strong>%s</strong>', 'psts'), $result->gateway).'</li>';\r\n if ($term)\r\n\t\t\t\t\techo '<li>'.sprintf(__('Previous Payment Term: <strong>%s</strong>', 'psts'), $term).'</li>';\r\n echo '</ul>';\r\n\r\n } else {\r\n echo '<p><strong>\"'.get_blog_option($blog_id, 'blogname').'\" '.__('has never been a Pro Site.', 'psts').'</strong></p>';\r\n }\r\n\r\n\t\t//meta boxes hooked by gateway plugins\r\n if ( has_action('psts_subscription_info') || has_action('psts_subscriber_info') ) { ?>\r\n <div class=\"metabox-holder\">\r\n <?php if ( has_action('psts_subscription_info') ) { ?>\r\n\t\t\t<div style=\"width: 49%;\" class=\"postbox-container\">\r\n <div class=\"postbox\">\r\n <h3 class='hndle'><span><?php _e('Subscription Information', 'psts'); ?></span></h3>\r\n <div class=\"inside\">\r\n <?php do_action('psts_subscription_info', $blog_id); ?>\r\n </div>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t\t<?php } ?>\r\n\r\n <?php if ( has_action('psts_subscriber_info') ) { ?>\r\n <div style=\"width: 49%;margin-left: 2%;\" class=\"postbox-container\">\r\n <div class=\"postbox\">\r\n <h3 class='hndle'><span><?php _e('Subscriber Information', 'psts'); ?></span></h3>\r\n <div class=\"inside\">\r\n \t<?php do_action('psts_subscriber_info', $blog_id); ?>\r\n </div>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t\t<?php } ?>\r\n\r\n <div class=\"clear\"></div>\r\n </div>\r\n <?php } ?>\r\n\r\n\t <div id=\"poststuff\" class=\"metabox-holder\">\r\n\t <div class=\"postbox\">\r\n\t <h3 class='hndle'><span><?php _e('Account History', 'psts') ?></span></h3>\r\n\t <div class=\"inside\">\r\n\t <span class=\"description\"><?php _e('This logs basically every action done in the system regarding the site for an audit trail.', 'psts'); ?></span>\r\n\t <div style=\"height:150px;overflow:auto;margin-top:5px;margin-bottom:5px;\">\r\n\t <table class=\"widefat\">\r\n\t <?php\r\n\t $log = get_blog_option($blog_id, 'psts_action_log');\r\n\t if (is_array($log) && count($log)) {\r\n\t $log = array_reverse($log, true);\r\n\t foreach ($log as $timestamp => $memo) {\r\n\t $class = (isset($class) && $class == 'alternate') ? '' : 'alternate';\r\n\t echo '<tr class=\"'.$class.'\"><td><strong>' . date_i18n( __('Y-m-d g:i:s a', 'psts'), $timestamp ) . '</strong></td><td>' . esc_html($memo) . '</td></tr>';\r\n\t\t\t\t\t\t\t\t}\r\n\t } else {\r\n\t echo '<tr><td colspan=\"2\">'.__('No history recorded for this site yet.', 'psts').'</td></tr>';\r\n\t }\r\n\t\t\t\t\t\t\t?>\r\n\t </table>\r\n\t </div>\r\n\t\t\t\t\t<form method=\"post\" action=\"\">\r\n\t\t\t\t\t\t<input type=\"text\" placeholder=\"Add a custom log entry...\" name=\"log_entry\" style=\"width:91%;\" /> <input type=\"submit\" class=\"button-secondary\" name=\"add_log_entry\" value=\"<?php _e('Add &raquo;', 'psts') ?>\" style=\"width:8%;float:right;\" />\r\n\t\t\t\t\t</form>\r\n\t </div>\r\n\t </div>\r\n\t </div>\r\n\r\n\r\n <div id=\"poststuff\" class=\"metabox-holder\">\r\n\r\n <div style=\"width: 49%;\" class=\"postbox-container\">\r\n <div class=\"postbox\">\r\n\t\t <h3 class='hndle'><span><?php _e('Manually Extend Pro Site Status', 'psts') ?></span></h3>\r\n\t\t <div class=\"inside\">\r\n\t\t <span class=\"description\"><?php _e('Please note that these changes will not adjust the payment dates or level for any existing subscription.', 'psts'); ?></span>\r\n\t\t <form method=\"post\" action=\"\">\r\n\t\t <table class=\"form-table\">\r\n\t\t <?php wp_nonce_field('psts_extend') ?>\r\n\t\t <input type=\"hidden\" name=\"bid\" value=\"<?php echo $blog_id; ?>\" />\r\n\t\t <tr valign=\"top\">\r\n\t\t <th scope=\"row\"><?php _e('Period', 'psts') ?></th>\r\n\t\t <td><select name=\"extend_months\">\r\n\t\t \t<?php\r\n\t\t \t\tfor ( $counter = 0; $counter <= 36; $counter += 1) {\r\n\t\t echo '<option value=\"' . $counter . '\">' . $counter . '</option>' . \"\\n\";\r\n\t\t \t\t}\r\n\t\t ?>\r\n\t\t </select><?php _e('Months', 'psts'); ?>\r\n\t\t <select name=\"extend_days\">\r\n\t\t \t<?php\r\n\t\t \t\tfor ( $counter = 0; $counter <= 30; $counter += 1) {\r\n\t\t echo '<option value=\"' . $counter . '\">' . $counter . '</option>' . \"\\n\";\r\n\t\t \t\t}\r\n\t\t ?>\r\n\t\t </select><?php _e('Days', 'psts'); ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php _e('or', 'psts'); ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n\t\t <label><input type=\"checkbox\" name=\"extend_permanent\" value=\"1\" /> <?php _e('Permanent', 'psts'); ?></label>\r\n\t\t <br /><?php _e('Period you wish to extend the site. Leave at zero to only change the level.', 'psts'); ?></td>\r\n\t\t </tr>\r\n\t\t <tr valign=\"top\">\r\n\t\t <th scope=\"row\"><?php _e('Level', 'psts') ?></th>\r\n\t\t <td><select name=\"extend_level\">\r\n\t\t \t<?php\r\n \t\tforeach ($levels as $level => $value) {\r\n\t\t\t\t\t\t\t\t?><option value=\"<?php echo $level; ?>\"<?php selected($current_level, $level) ?>><?php echo $level . ': ' . esc_attr($value['name']); ?></option><?php\r\n\t\t\t\t\t\t\t}\r\n\t\t ?>\r\n\t\t </select>\r\n\t\t <br /><?php _e('Choose what level the site should have access to.', 'psts'); ?></td>\r\n\t\t </tr>\r\n\t\t <tr valign=\"top\">\r\n\t\t\t\t\t\t\t<td colspan=\"2\" style=\"text-align:right;\"><input class=\"button-primary\" type=\"submit\" name=\"psts_extend\" value=\"<?php _e('Extend &raquo;', 'psts') ?>\" /></td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t </table>\r\n\t\t\t\t\t<hr />\r\n\t\t <table class=\"form-table\">\r\n\t\t <tr valign=\"top\">\r\n\t\t\t\t\t\t\t<td><label>Transfer Pro status to Blog ID: <input type=\"text\" name=\"new_bid\" size=\"3\" /></label></td>\r\n\t\t\t\t\t\t\t<td style=\"text-align:right;\"><input class=\"button-primary psts_confirm\" type=\"submit\" name=\"psts_transfer_pro\" value=\"<?php _e('Transfer &raquo;', 'psts') ?>\" /></td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t </table>\r\n\t\t </form>\r\n\t\t </div>\r\n\t\t\t</div>\r\n\t </div>\r\n\r\n <?php if ( is_pro_site($blog_id) || has_action('psts_modify_form') ) { ?>\r\n\t <div style=\"width: 49%;margin-left: 2%;\" class=\"postbox-container\">\r\n\t <div class=\"postbox\">\r\n\t <h3 class='hndle'><span><?php _e('Modify Pro Site Status', 'psts') ?></span></h3>\r\n\t <div class=\"inside\">\r\n\t <form method=\"post\" action=\"\">\r\n\t <?php wp_nonce_field('psts_modify') ?>\r\n\t\t\t\t\t<input type=\"hidden\" name=\"bid\" value=\"<?php echo $blog_id; ?>\" />\r\n\r\n <?php do_action('psts_modify_form', $blog_id); ?>\r\n\r\n\t\t\t\t\t<?php if ( is_pro_site($blog_id) ) { ?>\r\n <p><label><input type=\"checkbox\" name=\"psts_remove\" value=\"1\" /> <?php _e('Remove Pro status from this site.', 'psts'); ?></label></p>\r\n\t \t\t<?php } ?>\r\n\t\t\t\t\t\r\n\t\t\t\t\t<?php if ($last_payment = $this->last_transaction($blog_id)) { ?>\r\n\t\t\t\t\t<p><label><input type=\"checkbox\" name=\"psts_receipt\" value=\"1\" /> <?php _e('Email a receipt copy for last payment to:', 'psts'); ?> <input type=\"text\" name=\"receipt_email\" value=\"<?php echo get_blog_option($blog_id, 'admin_email'); ?>\" /></label></p>\r\n\t\t\t\t\t<?php } ?>\r\n\t\t\t\t\t\r\n\t\t\t\t\t<p class=\"submit\">\r\n\t <input type=\"submit\" name=\"psts_modify\" class=\"button-primary psts_confirm\" value=\"<?php _e('Modify &raquo;', 'psts') ?>\" />\r\n\t </p>\r\n\t </form>\r\n\t </div>\r\n\t </div>\r\n\t </div>\r\n <?php } ?>\r\n </div>\r\n <?php\r\n\r\n\t\t//show blog_id form\r\n } else {\r\n ?>\r\n <div class=\"metabox-holder\">\r\n\t <div class=\"postbox\">\r\n\t <h3 class='hndle'><span><?php _e('Manage a Site', 'psts') ?></span></h3>\r\n\t <div class=\"inside\">\r\n\t <form method=\"get\" action=\"\">\r\n\t <table class=\"form-table\">\r\n\t <input type=\"hidden\" name=\"page\" value=\"psts\" />\r\n\t <tr valign=\"top\">\r\n\t <th scope=\"row\"><?php _e('Blog ID:', 'psts') ?></th>\r\n\t <td><input type=\"text\" size=\"17\" name=\"bid\" value=\"\" /> <input type=\"submit\" value=\"<?php _e('Continue &raquo;', 'psts') ?>\" /></td></tr>\r\n\t </table>\r\n\t </form>\r\n\t\t\t\t\t<hr />\r\n\t\t\t\t\t<form method=\"get\" action=\"sites.php\" name=\"searchform\">\r\n\t <table class=\"form-table\">\r\n\t <tr valign=\"top\">\r\n\t <th scope=\"row\"><?php _e('Or search for a site:', 'psts') ?></th>\r\n\t <td><input type=\"text\" size=\"17\" value=\"\" name=\"s\"/> <input type=\"submit\" value=\"<?php _e('Search Sites &raquo;', 'psts') ?>\" id=\"submit_sites\" name=\"submit\"/></td></tr>\r\n\t </table>\r\n\t </form>\r\n\t </div>\r\n\t </div>\r\n </div>\r\n <?php\r\n }\r\n echo '</div>';\r\n\t}", "public static function adminPage(){\n\t\tif(!self::isAdmin()){\n\t\t\theader(\"Location: index.php\");\n\t\t\texit;\n\t\t}\n\t}", "public function adminPermisionListing()\n\t\t\t{\n\t\t\t\t$cls\t\t\t=\tnew adminUser();\n\t\t\t\t$cls->unsetSelectionRetention(array($this->getPageName()));\n\t\t\t\t $_SESSION['pid']\t=\t$_GET['id'];\n\t\t\t\t \n\t\t\t}", "public function displayAdminPanel() {}", "public function admin() {\n // Check the arguments\n $args = func_get_args();\n\n if (count($args) == 1) {\n if ($this->isPHPScript($args[0])) {\n $this->_adminPanel = array('script' => $args[0]);\n } else {\n $this->_adminPanel = $args[0];\n }\n } elseif (count($args) == 2) {\n // @TODO\n }\n // Implemented by extended classes\n }", "public function actionAdmin() {\n \n\t\t$model = new Visitor('search');\n $model->unsetAttributes(); // clear any default values\n if (isset($_GET['Visitor']))\n $model->attributes = $_GET['Visitor'];\n\t\t\t\n $this->render('_admin', array(\n 'model' => $model));\n }", "public function admin_options() {\n?>\n\t\t<h3><?php _e('Authorize SIM', WC_Authorize_SIM::TEXT_DOMAIN); ?></h3>\n \t<p><?php _e('Authorize SIM works by sending the user to Authorize to enter their payment information.', WC_Authorize_SIM::TEXT_DOMAIN); ?></p>\n \t<div class=\"updated\"><p>\n \t\t<strong><?php _e('Authorize.Net config:', WC_Authorize_SIM::TEXT_DOMAIN) ?></strong>\n \t\t<?php _e( 'Please login to Authorize and go to Account >> Settings >> Response/Receipt URLs' ); ?>\n \t\t<ol>\n\t \t\t<li><?php _e( 'Click \"Add URL\", and set this value for URL textbox: ') ?><strong><?php echo $this->notify_url ?></strong></li>\n\t \t\t<li><?php _e( 'Click \"Submit\" to complete', WC_Authorize_SIM::TEXT_DOMAIN ) ?></li>\n \t\t</ol>\n \t</p></div>\n \t<table class=\"form-table\">\n \t\t<?php $this->generate_settings_html(); ?>\n\t\t</table><!--/.form-table--> \t\n<?php\n }", "public function adminHead ()\r\n {\r\n \tif ($GLOBALS['editing']) {\r\n \t\t$this->printScripts();\r\n \t}\r\n }", "public function administration()\n {\n\n if (!empty($_SESSION) && $_SESSION['login'] == 'admin') {\n\n if (isset($_GET['deconnexion'])) {\n\n session_destroy();\n header('Location: .');\n exit();\n } elseif (isset($_GET['Appli'])) {\n $this->ctrlAdminAppli->adminappli();\n } elseif (isset($_GET['Data'])) {\n\n $this->ctrlAdminData->admindata();\n } else {\n\n $this->ctrlAdminmenu->adminmenu();\n }\n } else {\n $this->ctrlConnexion->connexion();\n }\n }", "function mod_core_admin() {\n\t\tglobal $NeptuneCore;\n\t\tglobal $NeptuneSQL;\n\t\tglobal $NeptuneAdmin;\n\t\t\n\t\tif (!isset($NeptuneCore)) {\n\t\t\t$NeptuneCore = new NeptuneCore();\n\t\t}\t\n\t\tif (!isset($NeptuneSQL)) {\n\t\t\t$NeptuneSQL = new NeptuneSQL();\n\t\t}\t\n\t\tif (!isset($NeptuneAdmin)) {\n\t\t\t$NeptuneAdmin = new NeptuneAdmin();\n\t\t}\t\n\t\t\n\t\t\n\t\tif (neptune_get_permissions() >= 3) {\n\t\t\t$query = $NeptuneCore->var_get(\"system\",\"query\");\n\t\t\tif (@isset($query[1]) && @isset($query[2])) {\n\t\t\t\t$AdminFunction = \"acp_\" . $query[1] . \"_\" . $query[2];\n\t\t\t\t\n\t\t\t\t$AdminFunction();\n\t\t\t} else {\n\t\t\t\t$NeptuneAdmin->run();\n\t\t\t}\n\t\t} else {\n\t\t\t$NeptuneCore->title($NeptuneCore->var_get(\"locale\",\"accessdenied\"));\n\t\t\t$NeptuneCore->neptune_echo(\"<p>\" . $NeptuneCore->var_get(\"locale\",\"nopermission\") . \"</p>\");\n\t\t\t\n\t\t\theader(\"HTTP/1.1 403 Forbidden\");\n\t\t}\n\t}", "public function run()\n {\n $admin = new User_central_admin();\n $admin->type = 'central_admin';\n $admin->username = 'superadmin';\n $admin->password = 'as';\n $admin->email = '[email protected]';\n $admin->save();\n }", "public function showAdmin() {\n\n\t\tif(!isset($_SESSION)) \n\t\t{ \n\t\t\tsession_start(); \n\t\t} \n\t\tif(isset($_SESSION['nickname']))\n\t\t{\n\n\t\t\t$user_manager = new UserManager();\n\t\t\t$session_user = $user_manager->get($_SESSION['nickname']);\n\t\t\t$session_user_role = $session_user->role();\n\t\t\t// You're an admin\n\t\t\tif ($session_user_role === 'admin') {\n\n\t\t\t\t$comments = array();\n\n\t\t\t\t$comment_manager = new CommentManager();\n\t\t\t\t$post_manager = new PostManager();\n\n\t\t\t\t$posts = $post_manager->getList();\n\t\t\t\t$users = $user_manager->getList();\n\n\t\t\t\t$myView = new View('admin');\n\t\t\t\t$myView->render(array(\n\n\t\t\t\t\t'posts' \t\t\t=> $posts, \n\t\t\t\t\t'post_manager' \t\t=> $post_manager, \n\t\t\t\t\t'comment_manager' \t=> $comment_manager,\n\t\t\t\t\t'users'\t\t\t\t=> $users,\n\t\t\t\t\t'comments'\t\t\t=> $comments,\n\t\t\t\t));\n\t\t\t}else { // You're not an admin\n\t\t\t\t\t\techo \"PAS ADMINISTRATEUR\";\n\t\t\t\theader('Location: '.HOST.'home.html');\n\t\t\t}\n\n\t\t}else { // You're not connected\n\t\t\theader('Location: '.HOST.'home.html');\n\t\t}\n\t}", "private function action_adminAccount()\n\t{\n\t\tglobal $txt, $db_type, $db_connection, $databases, $incontext, $db_prefix, $db_passwd, $webmaster_email;\n\t\tglobal $db_persist, $db_server, $db_user, $db_port;\n\t\tglobal $db_type, $db_name, $mysql_set_mode;\n\n\t\t$incontext['sub_template'] = 'admin_account';\n\t\t$incontext['page_title'] = $txt['user_settings'];\n\t\t$incontext['continue'] = 1;\n\n\t\t// Need this to check whether we need the database password.\n\t\trequire(TMP_BOARDDIR . '/Settings.php');\n\t\tif (!defined('ELK'))\n\t\t{\n\t\t\tdefine('ELK', 1);\n\t\t}\n\t\tdefinePaths();\n\n\t\t// These files may be or may not be already included, better safe than sorry for now\n\t\trequire_once(SOURCEDIR . '/Subs.php');\n\n\t\t$db = load_database();\n\n\t\tif (!isset($_POST['username']))\n\t\t{\n\t\t\t$_POST['username'] = '';\n\t\t}\n\n\t\tif (!isset($_POST['email']))\n\t\t{\n\t\t\t$_POST['email'] = '';\n\t\t}\n\n\t\t$incontext['username'] = htmlspecialchars(stripslashes($_POST['username']), ENT_COMPAT, 'UTF-8');\n\t\t$incontext['email'] = htmlspecialchars(stripslashes($_POST['email']), ENT_COMPAT, 'UTF-8');\n\t\t$incontext['require_db_confirm'] = empty($db_type) || !empty($databases[$db_type]['require_db_confirm']);\n\n\t\t// Only allow create an admin account if they don't have one already.\n\t\t$db->skip_next_error();\n\t\t$request = $db->query('', '\n\t\t\tSELECT \n\t\t\t\tid_member\n\t\t\tFROM {db_prefix}members\n\t\t\tWHERE id_group = {int:admin_group} \n\t\t\t\tOR FIND_IN_SET({int:admin_group}, additional_groups) != 0\n\t\t\tLIMIT 1',\n\t\t\tarray(\n\t\t\t\t'admin_group' => 1,\n\t\t\t)\n\t\t);\n\t\t// Skip the step if an admin already exists\n\t\tif ($request->num_rows() != 0)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t$request->free_result();\n\n\t\t// Trying to create an account?\n\t\tif (isset($_POST['password1']) && !empty($_POST['contbutt']))\n\t\t{\n\t\t\t// Wrong password?\n\t\t\tif ($incontext['require_db_confirm'] && $_POST['password3'] != $db_passwd)\n\t\t\t{\n\t\t\t\t$incontext['error'] = $txt['error_db_connect'];\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Not matching passwords?\n\t\t\tif ($_POST['password1'] != $_POST['password2'])\n\t\t\t{\n\t\t\t\t$incontext['error'] = $txt['error_user_settings_again_match'];\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// No password?\n\t\t\tif (strlen($_POST['password1']) < 4)\n\t\t\t{\n\t\t\t\t$incontext['error'] = $txt['error_user_settings_no_password'];\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (!file_exists(SOURCEDIR . '/Subs.php'))\n\t\t\t{\n\t\t\t\t$incontext['error'] = $txt['error_subs_missing'];\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Update the main contact email?\n\t\t\tif (!empty($_POST['email']) && (empty($webmaster_email) || $webmaster_email == '[email protected]'))\n\t\t\t{\n\t\t\t\tupdateSettingsFile(array('webmaster_email' => $_POST['email']));\n\t\t\t}\n\n\t\t\t// Work out whether we're going to have dodgy characters and remove them.\n\t\t\t$invalid_characters = preg_match('~[<>&\"\\'=\\\\\\]~', $_POST['username']) != 0;\n\t\t\t$_POST['username'] = preg_replace('~[<>&\"\\'=\\\\\\]~', '', $_POST['username']);\n\n\t\t\t$db->skip_next_error();\n\t\t\t$result = $db->query('', '\n\t\t\t\tSELECT \n\t\t\t\t\tid_member, password_salt\n\t\t\t\tFROM {db_prefix}members\n\t\t\t\tWHERE member_name = {string:username} \n\t\t\t\t\tOR email_address = {string:email}\n\t\t\t\tLIMIT 1',\n\t\t\t\tarray(\n\t\t\t\t\t'username' => stripslashes($_POST['username']),\n\t\t\t\t\t'email' => stripslashes($_POST['email']),\n\t\t\t\t)\n\t\t\t);\n\t\t\tif ($result->num_rows() != 0)\n\t\t\t{\n\t\t\t\tlist ($incontext['member_id'], $incontext['member_salt']) = $result->fetch_row();\n\t\t\t\t$result->free_result();\n\n\t\t\t\t$incontext['account_existed'] = $txt['error_user_settings_taken'];\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (trim($_POST['username']) === '' || strlen($_POST['username']) > 25)\n\t\t\t{\n\t\t\t\t// Try the previous step again.\n\t\t\t\t$incontext['error'] = $_POST['username'] == '' ? $txt['error_username_left_empty'] : $txt['error_username_too_long'];\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif ($invalid_characters || $_POST['username'] == '_' || $_POST['username'] == '|' || strpos($_POST['username'], '[code') !== false || strpos($_POST['username'], '[/code') !== false)\n\t\t\t{\n\t\t\t\t// Try the previous step again.\n\t\t\t\t$incontext['error'] = $txt['error_invalid_characters_username'];\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (empty($_POST['email']) || !filter_var(stripslashes($_POST['email']), FILTER_VALIDATE_EMAIL) || strlen(stripslashes($_POST['email'])) > 255)\n\t\t\t{\n\t\t\t\t// One step back, this time fill out a proper email address.\n\t\t\t\t$incontext['error'] = sprintf($txt['error_valid_email_needed'], $_POST['username']);\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// All clear, lets add an admin\n\t\t\trequire_once(SUBSDIR . '/Auth.subs.php');\n\n\t\t\t$incontext['member_salt'] = substr(base64_encode(sha1(mt_rand() . microtime(), true)), 0, 16);\n\n\t\t\t// Format the username properly.\n\t\t\t$_POST['username'] = preg_replace('~[\\t\\n\\r\\x0B\\0\\xA0]+~', ' ', $_POST['username']);\n\t\t\t$ip = isset($_SERVER['REMOTE_ADDR']) ? substr($_SERVER['REMOTE_ADDR'], 0, 255) : '';\n\n\t\t\t// Get a security hash for this combination\n\t\t\t$password = stripslashes($_POST['password1']);\n\t\t\t$incontext['passwd'] = validateLoginPassword($password, '', $_POST['username'], true);\n\n\t\t\t$request = $db->insert('',\n\t\t\t\t$db_prefix . 'members',\n\t\t\t\tarray(\n\t\t\t\t\t'member_name' => 'string-25', 'real_name' => 'string-25', 'passwd' => 'string', 'email_address' => 'string',\n\t\t\t\t\t'id_group' => 'int', 'posts' => 'int', 'date_registered' => 'int', 'hide_email' => 'int',\n\t\t\t\t\t'password_salt' => 'string', 'lngfile' => 'string', 'avatar' => 'string',\n\t\t\t\t\t'member_ip' => 'string', 'member_ip2' => 'string', 'buddy_list' => 'string', 'pm_ignore_list' => 'string',\n\t\t\t\t\t'message_labels' => 'string', 'website_title' => 'string', 'website_url' => 'string',\n\t\t\t\t\t'signature' => 'string', 'usertitle' => 'string', 'secret_question' => 'string',\n\t\t\t\t\t'additional_groups' => 'string', 'ignore_boards' => 'string',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tstripslashes($_POST['username']), stripslashes($_POST['username']), $incontext['passwd'], stripslashes($_POST['email']),\n\t\t\t\t\t1, 0, time(), 0,\n\t\t\t\t\t$incontext['member_salt'], '', '',\n\t\t\t\t\t$ip, $ip, '', '',\n\t\t\t\t\t'', '', '',\n\t\t\t\t\t'', '', '',\n\t\t\t\t\t'', '',\n\t\t\t\t),\n\t\t\t\tarray('id_member')\n\t\t\t);\n\n\t\t\t// Awww, crud!\n\t\t\tif ($request->hasResults() === false)\n\t\t\t{\n\t\t\t\t$incontext['error'] = $txt['error_user_settings_query'] . '<br />\n\t\t\t\t<div style=\"margin: 2ex;\">' . nl2br(htmlspecialchars($db->last_error($db_connection), ENT_COMPAT, 'UTF-8')) . '</div>';\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$incontext['member_id'] = $db->insert_id(\"{$db_prefix}members\", 'id_member');\n\n\t\t\t// If we're here we're good.\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "function admin_index()\n\t{\n\t \n\t}", "public function InitializeAdmin()\n\t{\n\t\t//$this->CreateParameter('notification', '', $this->Lang('help_param_notification'));\t\n\t\t//$this->CreateParameter('var_*', '', $this->Lang('help_param_var_'));\t\n\t}", "public function actionAdministration()\n\t{\n\t $this->render('index');\n\t}", "public function action_index()\n\t{\n\t\tglobal $context, $modSettings;\n\n\t\t// Make sure the administrator has a valid session...\n\t\tvalidateSession();\n\n\t\t// Load the language and templates....\n\t\tTxt::load('Admin');\n\t\ttheme()->getTemplates()->load('Admin');\n\t\tloadCSSFile('admin.css');\n\t\tloadJavascriptFile('admin.js', array(), 'admin_script');\n\n\t\t// The Admin functions require Jquery UI ....\n\t\t$modSettings['jquery_include_ui'] = true;\n\n\t\t// No indexing evil stuff.\n\t\t$context['robot_no_index'] = true;\n\n\t\t// Need these to do much\n\t\trequire_once(SUBSDIR . '/Admin.subs.php');\n\n\t\t// Actually create the menu!\n\t\t$admin_include_data = $this->loadMenu();\n\t\t$this->buildLinktree($admin_include_data);\n\n\t\tcallMenu($admin_include_data);\n\t}", "public function admin_index() {\r\n\t\t$this->data = $this->{$this->modelClass}->find('all');\r\n }", "public function index() {\n\t\t$data = $this->load_module_info ();\n\t\t\n\t\t$this->layout->display_admin ( $this->folder . $this->module . \"-list\", $data );\n\t}", "public function admin() {\n global $wpdb;\n $action = filter_input(INPUT_GET, 'action');\n \n echo '<div class=\"wrap\"><h2>';\n BUtils::e('Simple Membership Form Builder');\n echo '</h2>';\n // Save current user ID\n $current_user = wp_get_current_user();\n $user_id = $current_user->ID;\n $current_tab = empty($action) ? '' : $action;\n $tabs = array('' => \"Form List\", 'add' => 'New Form', 'license' => 'Product License');\n echo '<h2 class=\"nav-tab-wrapper\">';\n foreach ($tabs as $tab_key => $tab_caption) {\n $active = $current_tab == $tab_key ? 'nav-tab-active' : '';\n echo '<a class=\"nav-tab ' . $active . '\" href=\"admin.php?page=swpm-form-builder&action=' . $tab_key . '\">' . $tab_caption . '</a>';\n }\n echo '</h2>';\n switch ($action) {\n case 'add':\n $this->admin_add_new();\n break;\n case 'license':\n $this->admin_license_menu();\n break;\n case 'edit':\n default:\n $form_nav_selected_id = filter_input(INPUT_GET, 'form');\n if (empty($form_nav_selected_id) || $form_nav_selected_id == 0) {\n $this->all_forms();\n } else {\n include_once( SWPM_FORM_BUILDER_PATH . 'includes/admin-form-creator.php' );\n }\n break;\n }\n echo '</div>';\n }", "public function settings_page() {\n\t\tinclude_once( dirname( __FILE__ ) . '/class-vendor-admin-settings.php' );\n\t\tVendor_Admin_Settings::output();\n\t}", "function adminUsers()\n {\n $userLogged = Auth::check(['administrateur']);\n \n $userManager = new UserManager();\n $listUsers = $userManager->getListUsers();\n require'../app/Views/backViews/user/backAdminUsersView.php';\n }", "public function manage()\n {\n global $template;\n\n $template->set_filename('plugin_admin_content', dirname($this->getFileLocation()).\"/admin/amm_admin.tpl\");\n\n $pluginInfo=array(\n 'AMM_VERSION' => \"<i>\".$this->getPluginName().\"</i> \".l10n('gmaps_release').AMM_VERSION,\n 'PATH' => AMM_PATH\n );\n\n $template->assign('plugin', $pluginInfo);\n $template->assign('AMM_BODY_PAGE', '<p class=\"warnings\">'.sprintf(l10n('g002_gpc_not_up_to_date'),AMM_GPC_NEEDED, GPC_VERSION).'</p>');\n $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');\n }", "public function admin_add() {\n\t\tparent::admin_add();\n\n\t\t$users = $this->ShopList->User->find('list');\n\t\t$shopShippingMethods = $this->ShopList->ShopShippingMethod->find('list');\n\t\t$shopPaymentMethods = $this->ShopList->ShopPaymentMethod->find('list');\n\t\t$this->set(compact('users', 'shopShippingMethods', 'shopPaymentMethods'));\n\t}", "public function admin() {\n\t\tif ( power_onboarding_starter_packs() ) {\n\t\t\tdelete_option( 'power_onboarding_chosen_pack' );\n\t\t\tinclude POWER_VIEWS_DIR . '/pages/power-admin-onboarding-packs.php';\n\t\t} else {\n\t\t\tinclude POWER_VIEWS_DIR . '/pages/power-admin-onboarding.php';\n\t\t}\n\t}", "public function page_default_administration()\n\t{\n\t\tFsb::$tpl->set_file('adm_index.html');\n\n\t\t// Les 5 derniers logs administratifs\n\t\t$logs = Log::read(Log::ADMIN, 5);\n\t\tforeach ($logs['rows'] AS $log)\n\t\t{\n\t\t\tFsb::$tpl->set_blocks('log', array(\n\t\t\t\t'STR' =>\t$log['errstr'],\n\t\t\t\t'INFO' =>\tsprintf(Fsb::$session->lang('adm_list_log_info'), htmlspecialchars($log['u_nickname']), Fsb::$session->print_date($log['log_time'])),\n\t\t\t));\n\t\t}\n\n\t\t// On affiche tous les comptes ?\n\t\t$show_all = (Http::request('show_all')) ? true : false;\n\n\t\t// Liste des comptes en attente de validation\n\t\t$sql = 'SELECT u_id, u_nickname, u_joined, u_register_ip\n\t\t\t\tFROM ' . SQL_PREFIX . 'users\n\t\t\t\tWHERE u_activated = 0\n\t\t\t\t\tAND u_confirm_hash = \\'.\\'\n\t\t\t\t\tAND u_id <> ' . VISITOR_ID . '\n\t\t\t\tORDER BY u_joined DESC\n\t\t\t\t' . (($show_all) ? '' : 'LIMIT 5');\n\t\t$result = Fsb::$db->query($sql);\n\t\twhile ($row = Fsb::$db->row($result))\n\t\t{\n\t\t\tFsb::$tpl->set_blocks('wait', array(\n\t\t\t\t'NICKNAME' =>\t\thtmlspecialchars($row['u_nickname']),\n\t\t\t\t'JOINED_IP' =>\t\tsprintf(Fsb::$session->lang('adm_joined_ip'), Fsb::$session->print_date($row['u_joined']), $row['u_register_ip']),\n\n\t\t\t\t'U_EDIT' =>\t\t\tsid(ROOT . 'index.' . PHPEXT . '?p=modo&amp;module=user&amp;id=' . $row['u_id']),\n\t\t\t\t'U_VALIDATE' =>\t\tsid('index.' . PHPEXT . '?mode=validate&amp;id=' . $row['u_id']),\n\t\t\t));\n\t\t}\n\t\tFsb::$db->free($result);\n\n\t\t// Liste des membres en ligne\n\t\t$sql = 'SELECT s.s_id, s.s_ip, s.s_page, s.s_user_agent, u.u_nickname, u.u_color, u.u_activate_hidden, b.bot_id, b.bot_name\n\t\t\tFROM ' . SQL_PREFIX . 'sessions s\n\t\t\tLEFT JOIN ' . SQL_PREFIX . 'users u\n\t\t\t\tON u.u_id = s.s_id\n\t\t\tLEFT JOIN ' . SQL_PREFIX . 'bots b\n\t\t\t\tON s.s_bot = b.bot_id\n\t\t\tWHERE s.s_time > ' . intval(CURRENT_TIME - 300) . '\n\t\t\tORDER BY u.u_auth DESC, u.u_nickname, s.s_id';\n\t\t$result = Fsb::$db->query($sql);\n\t\t$id_array = array();\n\t\t$ip_array = array();\n\t\t$f_idx = $t_idx = $p_idx = array();\n\t\t$logged = array('users' => array(), 'visitors' => array());\n\t\twhile ($row = Fsb::$db->row($result))\n\t\t{\n\t\t\tif (!is_null($row['bot_id']) || $row['s_id'] == VISITOR_ID)\n\t\t\t{\n\t\t\t\tif (in_array($row['s_ip'], $ip_array))\n\t\t\t\t{\n\t\t\t\t\tcontinue ;\n\t\t\t\t}\n\t\t\t\t$ip_array[] = $row['s_ip'];\n\t\t\t\t$type = 'visitors';\n\n\t\t\t\t// Les bots ont leur propre couleur\n\t\t\t\tif (!is_null($row['bot_id']))\n\t\t\t\t{\n\t\t\t\t\t$row['u_color'] = 'class=\"bot\"';\n\t\t\t\t\t$row['u_nickname'] = $row['bot_name'];\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (in_array($row['s_id'], $id_array))\n\t\t\t\t{\n\t\t\t\t\tcontinue ;\n\t\t\t\t}\n\t\t\t\t$id_array[] = $row['s_id'];\n\t\t\t\t$type = 'users';\n\t\t\t}\n\n\t\t\t// Position du membre sur le forum\n\t\t\t$id = null;\n\t\t\t$method = 'forums';\n\t\t\tif (strpos($row['s_page'], 'admin/') !== false)\n\t\t\t{\n\t\t\t\t$location = Fsb::$session->lang('adm_location_adm');\n\t\t\t\t$url = 'admin/index.' . PHPEXT;\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$page = basename($row['s_page']);\n\t\t\t\t$url = '';\n\t\t\t\t$location = '';\n\t\t\t\tif (preg_match('#^index\\.' . PHPEXT . '\\?p=([a-z0-9_]+)(&.*?)*$#', $page, $match) || preg_match('#^(forum|topic|sujet)-([0-9]+)-([0-9]+)\\.html$#i', $page, $match))\n\t\t\t\t{\n\t\t\t\t\t$url = $match[0];\n\t\t\t\t\tswitch ($match[1])\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 'forum' :\n\t\t\t\t\t\t\t$location = Fsb::$session->lang('adm_location_forum');\n\t\t\t\t\t\t\tif (count($match) == 4)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$id = $match[2];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tpreg_match('#f_id=([0-9]+)#', $page, $match);\n\t\t\t\t\t\t\t\t$id = (isset($match[1])) ? $match[1] : null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ($id) $f_idx[] = $id;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'topic' :\n\t\t\t\t\t\tcase 'sujet' :\n\t\t\t\t\t\t\t$location = Fsb::$session->lang('adm_location_topic');\n\t\t\t\t\t\t\tif (count($match) == 4)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$method = 'topics';\n\t\t\t\t\t\t\t\t$id = $match[2];\n\t\t\t\t\t\t\t\t$t_idx[] = $id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (preg_match('#t_id=([0-9]+)#', $page, $match))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$method = 'topics';\n\t\t\t\t\t\t\t\t$id = (isset($match[1])) ? $match[1] : null;\n\t\t\t\t\t\t\t\tif ($id) $t_idx[] = $id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$method = 'posts';\n\t\t\t\t\t\t\t\tpreg_match('#p_id=([0-9]+)#', $page, $match);\n\t\t\t\t\t\t\t\t$id = (isset($match[1])) ? $match[1] : null;\n\t\t\t\t\t\t\t\tif ($id) $p_idx[] = $id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'post' :\n\t\t\t\t\t\t\tpreg_match('#mode=([a-z_]+)#', $page, $mode);\n\t\t\t\t\t\t\tpreg_match('#id=([0-9]+)#', $page, $match);\n\t\t\t\t\t\t\t$id = (isset($match[1])) ? $match[1] : null;\n\t\t\t\t\t\t\tswitch ($mode[1])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcase 'topic' :\n\t\t\t\t\t\t\t\t\t$location = Fsb::$session->lang('adm_location_post_new');\n\t\t\t\t\t\t\t\t\tif ($id) $f_idx[] = $id;\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'reply' :\n\t\t\t\t\t\t\t\t\t$location = Fsb::$session->lang('adm_location_post_reply');\n\t\t\t\t\t\t\t\t\tif ($id) $t_idx[] = $id;\n\t\t\t\t\t\t\t\t\t$method = 'topics';\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'edit' :\n\t\t\t\t\t\t\t\t\t$location = Fsb::$session->lang('adm_location_post_edit');\n\t\t\t\t\t\t\t\t\tif ($id) $p_idx[] = $id;\n\t\t\t\t\t\t\t\t\t$method = 'posts';\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'mp' :\n\t\t\t\t\t\t\t\t\t$location = Fsb::$session->lang('adm_location_mp_write');\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'calendar_add' :\n\t\t\t\t\t\t\t\t\t$location = Fsb::$session->lang('adm_location_calendar_event');\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'calendar_edit' :\n\t\t\t\t\t\t\t\t\t$location = Fsb::$session->lang('adm_location_calendar_event_edit');\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault :\n\t\t\t\t\t\t\tif (Fsb::$session->lang('adm_location_' . $match[1]))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$location = Fsb::$session->lang('adm_location_' . $match[1]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!$location)\n\t\t\t\t{\n\t\t\t\t\t$location = Fsb::$session->lang('adm_location_index');\n\t\t\t\t\t$url = 'index.' . PHPEXT;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$logged[$type][] = array(\n\t\t\t\t'nickname' =>\t\tHtml::nickname($row['u_nickname'], $row['s_id'], $row['u_color']),\n\t\t\t\t'agent' =>\t\t\t$row['s_user_agent'],\n\t\t\t\t'ip' =>\t\t\t\t$row['s_ip'],\n\t\t\t\t'location' =>\t\t$location,\n\t\t\t\t'url' =>\t\t\tsid(ROOT . $url),\n\t\t\t\t'method' =>\t\t\t$method,\n\t\t\t\t'id' =>\t\t\t\t$id,\n\t\t\t);\n\n\n\t\t}\n\t\tFsb::$db->free($result);\n\n\t\t// On recupere une liste des forums pour connaitre la position du membre sur le forum\n\t\t$forums = array();\n\t\tif ($f_idx)\n\t\t{\n\t\t\t$sql = 'SELECT f.f_id, f.f_name, cat.f_id AS cat_id, cat.f_name AS cat_name\n\t\t\t\t\tFROM ' . SQL_PREFIX . 'forums f\n\t\t\t\t\tLEFT JOIN ' . SQL_PREFIX . 'forums cat\n\t\t\t\t\t\tON f.f_cat_id = cat.f_id\n\t\t\t\t\tWHERE f.f_id IN (' . implode(', ', $f_idx) . ')';\n\t\t\t$result = Fsb::$db->query($sql, 'forums_');\n\t\t\t$forums = Fsb::$db->rows($result, 'assoc', 'f_id');\n\t\t}\n\n\t\t// On recupere une liste des sujets pour connaitre la position du membre sur le forum\n\t\t$topics = array();\n\t\tif ($t_idx)\n\t\t{\n\t\t\t$sql = 'SELECT f.f_id, f.f_name, cat.f_id AS cat_id, cat.f_name AS cat_name, t.t_id, t.t_title\n\t\t\t\t\tFROM ' . SQL_PREFIX . 'topics t\n\t\t\t\t\tLEFT JOIN ' . SQL_PREFIX . 'forums f\n\t\t\t\t\t\tON f.f_id = t.f_id\n\t\t\t\t\tLEFT JOIN ' . SQL_PREFIX . 'forums cat\n\t\t\t\t\t\tON f.f_cat_id = cat.f_id\n\t\t\t\t\tWHERE t.t_id IN (' . implode(', ', $t_idx) . ')';\n\t\t\t$result = Fsb::$db->query($sql, 'forums_');\n\t\t\t$topics = Fsb::$db->rows($result, 'assoc', 't_id');\n\t\t}\n\n\t\t// On recupere une liste des messages pour connaitre la position du membre sur le forum\n\t\t$posts = array();\n\t\tif ($p_idx)\n\t\t{\n\t\t\t$sql = 'SELECT f.f_id, f.f_name, cat.f_id AS cat_id, cat.f_name AS cat_name, p.p_id, t.t_id, t.t_title\n\t\t\t\t\tFROM ' . SQL_PREFIX . 'posts p\n\t\t\t\t\tLEFT JOIN ' . SQL_PREFIX . 'topics t\n\t\t\t\t\t\tON p.t_id = t.t_id\n\t\t\t\t\tLEFT JOIN ' . SQL_PREFIX . 'forums f\n\t\t\t\t\t\tON f.f_id = p.f_id\n\t\t\t\t\tLEFT JOIN ' . SQL_PREFIX . 'forums cat\n\t\t\t\t\t\tON f.f_cat_id = cat.f_id\n\t\t\t\t\tWHERE p.p_id IN (' . implode(', ', $p_idx) . ')';\n\t\t\t$result = Fsb::$db->query($sql, 'forums_');\n\t\t\t$posts = Fsb::$db->rows($result, 'assoc', 'p_id');\n\t\t}\n\n\t\t// On affiche les membres en ligne\n\t\tforeach ($logged AS $type => $list)\n\t\t{\n\t\t\tif ($list)\n\t\t\t{\n\t\t\t\tFsb::$tpl->set_blocks('logged', array(\n\t\t\t\t\t'TITLE' =>\t\tFsb::$session->lang('adm_list_logged_' . $type),\n\t\t\t\t));\n\n\t\t\t\tforeach ($list AS $u)\n\t\t\t\t{\n\t\t\t\t\t// On definit si on cherche la liste des forums dans $forums ou $topics\n\t\t\t\t\t$m = $u['method'];\n\t\t\t\t\t$data_exists = ($u['id'] && isset(${$m}[$u['id']])) ? true : false;\n\t\t\t\t\t$topic_exists = ($data_exists && isset(${$m}[$u['id']]['t_title'])) ? true : false;\n\n\t\t\t\t\tFsb::$tpl->set_blocks('logged.u', array(\n\t\t\t\t\t\t'NICKNAME' =>\t\t$u['nickname'],\n\t\t\t\t\t\t'AGENT' =>\t\t\t$u['agent'],\n\t\t\t\t\t\t'IP' =>\t\t\t\t$u['ip'],\n\t\t\t\t\t\t'LOCATION' =>\t\t$u['location'],\n\t\t\t\t\t\t'URL' =>\t\t\t$u['url'],\n\t\t\t\t\t\t'CAT_NAME' =>\t\t($data_exists) ? ${$m}[$u['id']]['cat_name'] : null,\n\t\t\t\t\t\t'FORUM_NAME' =>\t\t($data_exists) ? ${$m}[$u['id']]['f_name'] : null,\n\t\t\t\t\t\t'TOPIC_NAME' =>\t\t($topic_exists) ? Parser::title(${$m}[$u['id']]['t_title']) : '',\n\t\t\t\t\t\t'U_CAT' =>\t\t\t($data_exists) ? sid(ROOT . 'index.' . PHPEXT . '?p=index&amp;cat=' . ${$m}[$u['id']]['cat_id']) : null,\n\t\t\t\t\t\t'U_FORUM' =>\t\t($data_exists) ? sid(ROOT . 'index.' . PHPEXT . '?p=forum&amp;f_id=' . ${$m}[$u['id']]['f_id']) : null,\n\t\t\t\t\t\t'U_TOPIC' =>\t\t($topic_exists) ? sid(ROOT . 'index.' . PHPEXT . '?p=topic&amp;t_id=' . ${$m}[$u['id']]['t_id']) : null,\n\t\t\t\t\t\t'U_IP' =>\t\t\tsid(ROOT . 'index.' . PHPEXT . '?p=modo&amp;module=ip&amp;ip=' . $u['ip']),\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// On verifie si le SDK n'a pas ete desactive\n\t\tif(intval(Fsb::$cfg->get('disable_sdk')))\n\t\t{\n\t\t\tFsb::$tpl->set_switch('sdk_disabled');\n\t\t}\n\n\t\tFsb::$tpl->set_vars(array(\n\t\t\t'FSB_SUPPORT' =>\t\t'http://www.fire-soft-board.com',\n\t\t\t'FSB_LANG_SUPPORT' =>\tFsb::$session->lang('fsb_lang_support'),\n\t\t\t'NEW_VERSION' =>\t\t(!is_last_version(Fsb::$cfg->get('fsb_version'), Fsb::$cfg->get('fsb_last_version'))) ? sprintf(Fsb::$session->lang('adm_fsb_new_version'), Fsb::$cfg->get('fsb_version'), Fsb::$cfg->get('fsb_last_version')) : null,\n\t\t\t'SHOW_ALL' =>\t\t\t$show_all,\n\t\t\t'ROOT_SUPPORT' => \t\tsprintf(Fsb::$session->lang('adm_root_support_active_explain'), 'index.' . PHPEXT . '?p=mods_manager'),\n\n\t\t\t'U_SHOW_ALL' =>\t\t\tsid('index.' . PHPEXT . '?show_all=true'),\n\t\t\t'U_CHECK_VERSION' =>\tsid('index.' . PHPEXT . '?mode=version'),\n\t\t));\n\t}", "public function index()\n\t{\n\t\t//restricted this area, only for admin\n\t\tpermittedArea();\n\n\t\t$data['settings'] = $this->settings_model->adminSettings();\n\n\t\tif($this->input->post())\n\t\t{\n\t\t\t$input = $this->input->post();\n\t\t\t$this->form_validation->set_rules('default_email', 'Default Email', 'required|valid_email');\n\n\t\t\tif($this->form_validation->run())\n\t\t\t{\n\t\t\t\t$this->settings_model->updateSettings();\n\t\t\t}\n\t\t}\n\n\t\ttheme('admin_settings', $data);\n\t}", "function mmf_admin_actions() {\n\t\tadd_options_page(\"MapMyFitness\", \"MapMyFitness\", 1, \"mmf\", \"mmf_admin\");\n\t}", "public function index()\n {\n // $this->perfex_base->get_table_data('master', array('master' => true));die();\n if ($this->input->is_ajax_request()) {\n $this->perfex_base->get_table_data('master', array('master' => true));\n }\n $data['title']=\"Chủ sở hữu\";\n $this->load->view('admin/master/manage', $data);\n }", "public function administration() {\n\t\t$success = ( isset( $_SESSION['success'] ) ? $_SESSION['success'] : null );\n\t\t$error = ( isset( $_SESSION['error'] ) ? $_SESSION['error'] : null );\n\t\t$login = ( isset( $_SESSION['login'] ) ? $_SESSION['login'] : null );\n\t\t$myView = new View( 'administration' );\n\t\t$myView->renderView( array( 'success' => $success, 'error' => $error, 'login' => $login ) );\n\t}", "function setAdmin() {\n\t\t$this->_extension_high = \"\";\n\t\t$this->_extension_low = \"\";\n\t\t$this->_deptname = \"\";\n\t\t$this->_sections = array(\"*\");\n\t}", "public function indexAction() \n\t\t{\n\t\t\t$this->requireUserType(array(CT_User::Directie));\n\t\t\t$this->lijstAction();\n\t\t}", "function admin_configuration()\n{\n global $app;\n\n $app->render('admin_configuration.html', [\n 'page' => mkPage(getMessageString('admin'), 0, 2),\n 'mailers' => mkMailers(),\n 'ttss' => mkTitleTimeSortOptions(),\n 'isadmin' => is_admin()]);\n}" ]
[ "0.69257087", "0.6872999", "0.68651885", "0.67484", "0.6744776", "0.673954", "0.6705063", "0.6675029", "0.65471226", "0.65471226", "0.6536954", "0.6511905", "0.6509554", "0.64667124", "0.6454523", "0.64414805", "0.64414805", "0.6440837", "0.6416656", "0.63941354", "0.6384295", "0.6372894", "0.63574743", "0.6348441", "0.63395137", "0.6339148", "0.63273984", "0.63262224", "0.63085914", "0.62721634", "0.6257739", "0.6247355", "0.6247355", "0.624469", "0.62398916", "0.6232944", "0.62328273", "0.62191314", "0.62162083", "0.62135345", "0.6209127", "0.62014157", "0.6191835", "0.6190583", "0.61869884", "0.61831504", "0.6181501", "0.6166791", "0.61647916", "0.6159427", "0.6154987", "0.614386", "0.6137472", "0.61289775", "0.61277926", "0.612507", "0.6119498", "0.61188", "0.61188", "0.61188", "0.6118201", "0.61171854", "0.6107381", "0.60913", "0.6061736", "0.60579216", "0.6050047", "0.6048292", "0.6046324", "0.60428303", "0.60425955", "0.60383505", "0.6033817", "0.603292", "0.6027327", "0.6026393", "0.6017402", "0.60170925", "0.6014256", "0.60087395", "0.60041374", "0.6003465", "0.6001215", "0.60010856", "0.5998336", "0.5991254", "0.5990864", "0.59812415", "0.59757483", "0.59640825", "0.5963633", "0.5960447", "0.59583753", "0.59486276", "0.5945612", "0.59411085", "0.5934591", "0.59322244", "0.5926889", "0.5924366", "0.5924098" ]
0.0
-1
can be implemented with new or overwrite
abstract function printOutput()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createNew() {\n\t}", "public function regularNew() {}", "public function createNew();", "abstract protected function create ();", "public function inOriginal();", "public function create()\n {\n throw new NotImplementedException();\n }", "abstract protected function _regenerate();", "public function custom()\n\t{\n\t}", "function _isNew() ;", "protected function __clone(){}", "abstract function &create();", "protected function __clone()\n {\n\n }", "public static function createNew();", "public function modify();", "public function new()\n {\n //\n }", "public function new()\n {\n //\n }", "abstract function create();", "abstract protected function getNewResource();", "protected function __clone()\n {\n }", "protected function __clone()\n {\n }", "protected function __clone()\n {\n }", "protected function __clone()\n {\n }", "private function __clone() \r\n { \r\n }", "public function duplicate()\n {\n }", "protected function create() {\n\t}", "function overwrite($overwrite=true) {\r\n $this->overwrite = $overwrite;\r\n }", "public function _isNew() {}", "protected function __clone()\n {\n \n }", "public function isNew() {}", "private function __clone() {\r\n \r\n }", "protected function __clone() {}", "protected function __clone() {}", "protected function __clone() {}", "protected function __clone() {}", "protected function __clone() {}", "protected function __clone() {}", "protected function __clone() {}", "private function __clone()\n\t{\n\n\t}", "private function __clone()\n\t{\n\n\t}", "private function __clone(){\n\n }", "public function getNew($existing);", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "public function create()\n\t{ \n \n\t}", "private function __clone() { }", "private function __clone() { \n\n\t}", "protected function __clone() { }", "private function __clone()\n {\n\n }", "private function __clone()\n {\n\n }", "private function __clone()\n {\n\n }", "private function __clone()\n {\n\n }", "private function __clone()\n\t{\n\t}", "private function __clone()\n\t{\n\t}", "private function __clone(){\n\t\t\n\t}", "private function __clone(){ }", "private function __clone() \n {\n }", "private function __clone() {\r\n\r\n }", "private function __clone()\r\n {\r\n }", "public function __clone()\n { \n trigger_error('La clonación de este objeto no está permitida', E_USER_ERROR); \n }", "private function __clone(){\n\t}", "public function create() {\n //not implemented\n }", "public function __clone()\n {\n }", "public function __clone()\n {\n }", "public function __clone()\n {\n }", "public function __clone()\n {\n }", "public function __clone()\n {\n }", "public function __clone()\n {\n }", "public function __clone()\n {\n }", "public function __clone()\n {\n }", "public function __clone()\n {\n }", "public function __contruct(){\r\n parent::__contruct();\r\n }", "public function __clone()\n { \n trigger_error('La clonación no permitida', E_USER_ERROR); \n }", "function newLike();", "private function __clone() {\r\n\t}", "protected function __clone() {\n \n }", "public function create() {\n\t \n }", "private function __clone(){\n }", "private function __clone(){\n }", "private function __clone()\r\n {\r\n // ...\r\n }", "private function __clone()\n {\n \n }", "private function __clone()\n {\n \n }", "final private function __clone(){\n\t\t\n\t}", "public function __construct()\n {\n $this->timestamps = TRUE;\n $this->soft_deletes = FALSE;\n $this->return_as = 'object'; //array\n parent::__construct();\n }", "protected function __clone()\n {\n }", "public function create()\n\t{\n\t\t\n\t}", "public function create()\n\t{\n\t\t\n\t}", "public function create()\n\t{\n\t\t\n\t}", "public function create()\n\t{\n\t\t\n\t}", "public function create()\n\t{\n\t\t\n\t}", "public function create()\n\t{\n\t\t\n\t}", "public function create()\n\t{\n\t\t\n\t}", "public function create()\n\t{\n\t\t\n\t}" ]
[ "0.6722529", "0.66553104", "0.6627309", "0.6515961", "0.6509817", "0.63744175", "0.62680644", "0.6237969", "0.6231151", "0.61834437", "0.6131496", "0.6130682", "0.6112653", "0.61121744", "0.6092765", "0.6092765", "0.6071029", "0.60459226", "0.5986767", "0.5986767", "0.5986767", "0.5986767", "0.5983815", "0.5977104", "0.59739554", "0.59718657", "0.5966266", "0.5962462", "0.59589905", "0.595382", "0.5953617", "0.5953617", "0.5953617", "0.5953617", "0.5953617", "0.5953617", "0.5953617", "0.59509677", "0.59509677", "0.5949281", "0.59443396", "0.5932536", "0.5932536", "0.5932536", "0.5932536", "0.5932536", "0.5932536", "0.5932536", "0.5932536", "0.5932536", "0.5932536", "0.5932536", "0.59208393", "0.5916575", "0.59113973", "0.5900409", "0.58939594", "0.58939594", "0.58939594", "0.58939594", "0.58925545", "0.58925545", "0.588222", "0.5881306", "0.5875191", "0.5860159", "0.5857552", "0.5857052", "0.5847444", "0.5839877", "0.5836153", "0.5836153", "0.5836153", "0.5836153", "0.5836153", "0.5836153", "0.5836153", "0.5836153", "0.5836153", "0.58326864", "0.58195966", "0.5818807", "0.5817758", "0.58142346", "0.5807899", "0.58041507", "0.58041507", "0.5802997", "0.5796295", "0.5796295", "0.5792965", "0.57796067", "0.57775813", "0.57770824", "0.57770824", "0.57770824", "0.57770824", "0.57770824", "0.57770824", "0.57770824", "0.57770824" ]
0.0
-1
Calculate the percentage of success for a test
public static function percent($suiteResults) { $sum = $suiteResults['pass'] + $suiteResults['fail']; return round($suiteResults['pass'] * 100 / max($sum, 1), 2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSuccessRate(): int\n {\n // Fix for division by zero error\n if ($this->getTestsSum() === 0) {\n return 0;\n }\n\n return (int)round(($this->successful / $this->getTestsSum()) * 100, 0);\n }", "public function getTestedClassesPercent($asString = TRUE)\n {\n return PHP_CodeCoverage_Util::percent(\n $this->getNumTestedClasses(),\n $this->getNumClasses(),\n $asString\n );\n }", "public function percentageParticipation()\n {\n $expectedPartipant = $this->getExpectedParticipants();\n if (count($expectedPartipant) == 0) {\n return 0;\n }\n $actualParticipant = $this->users()\n ->where('users.role_id', Role::findBySlug('PART')->id)\n ->orWhere('users.role_id', Role::findBySlug('GEST')->id)\n ->get()->unique();\n return round((count($actualParticipant) / count($expectedPartipant)) * 100);\n }", "public function getFailRate(): int\n {\n // Fix for division by zero error\n if ($this->getTestsSum() === 0) {\n return 0;\n }\n\n return (int)round(($this->failed / $this->getTestsSum()) * 100, 0);\n }", "public function getTestedMethodsPercent($asString = TRUE)\n {\n return PHP_CodeCoverage_Util::percent(\n $this->getNumTestedMethods(),\n $this->getNumMethods(),\n $asString\n );\n }", "function usp_ews_get_progess_percentage($events, $attempts) {\n $attemptcount = 0;\n\n\t$count_events = count($events);\n foreach($events as $event) {\n if($attempts[$event['type'].$event['id']] == 1) {\n $attemptcount++;\n }\n }\n\t$progressvalue = ($attemptcount==0 || $count_events==0) ? 0 : $attemptcount / $count_events;\n\n return (int)($progressvalue * 100);\n}", "public function getMatchedPercent(){\n return $this->percentage;\n }", "public function getPercentOfCompletedProfile(){\n $pendingCount = $this->getPendingNotificationCount();\n $notificationCount = $this->getNotificationCount();\n $completedCount = $notificationCount - $pendingCount;\n return round(($completedCount * 100.0) / $notificationCount);\n }", "public function calculateTotalPercentage()\n {\n return round((($this->totalcovered + $this->totalmaybe) / $this->totallines) * 100, 2);\n }", "function progress_percentage($events, $attempts) {\n $attemptcount = 0;\n foreach ($events as $event) {\n if(array_key_exists($event['type'].$event['id'], $attempts)) {\n if ($attempts[$event['type'].$event['id']] == 1) {\n $attemptcount++;\n }\n } else {\n }\n }\n $progressvalue = $attemptcount == 0 ? 0 : $attemptcount / count($events);\n return (int)round($progressvalue * 100);\n}", "public function test_it_can_expose_the_percentage_of_time_taken()\n {\n $timelog = factory(TimeLog::class)->create([\n 'number_of_seconds' => 3600,\n 'user_id' => $this->user->id,\n 'project_id' => $this->project->id\n ]);\n // The project should be able to tell us what percentage of the overall time has been taken\n // Work out percentage (Hat tip @ollieread)\n $onePercent = $this->project->getOriginal('total_seconds') / 100;\n $percentage = min(100, ceil($this->project->time_logged_seconds / $onePercent));\n // The percentage should match the project's percentage\n $this->assertSame($this->project->percentage_taken, $percentage);\n }", "public function getTestedClassesAndTraitsPercent($asString = TRUE)\n {\n return PHP_CodeCoverage_Util::percent(\n $this->getNumTestedClassesAndTraits(),\n $this->getNumClassesAndTraits(),\n $asString\n );\n }", "public function positivePercent(){\n\t\treturn round($this->positive*100/($this->positive+$this->negative+$this->indeterminate), 2);\n\t}", "public function testAddPercent()\n {\n $tests = [\n ['expected' => 112, 'fn' => Math::addPercent(100, 12)],\n ['expected' => 112, 'fn' => Math::addPercent(100, '12')],\n ['expected' => 112, 'fn' => Math::addPercent(100, '12%')],\n ['expected' => 112, 'fn' => Math::addPercent(100, '12 %')],\n ['expected' => 112, 'fn' => Math::addPercent('100 ', '12')],\n ['expected' => 112.5, 'fn' => Math::addPercent('100', '12.5')],\n ['expected' => 88, 'fn' => Math::addPercent('100', -12)],\n ['expected' => 88, 'fn' => Math::addPercent('100', '-12')],\n ['expected' => 88, 'fn' => Math::addPercent('100', '-12 %')],\n ['expected' => 88, 'fn' => Math::addPercent('100', '-12%')],\n ];\n\n foreach ($tests as $test) {\n $this->assertEquals($test['expected'], $test['fn']);\n }\n }", "function getGoalPercent(){\n $goal = $GLOBALS['GOAL_STEPS'];\n $cursteps = getCurrentSteps();\n $percent = ( $cursteps[0]['steps'] / $goal ) * 100;\n return round($percent);\n}", "public function getTestsSum(): int\n {\n return count($this->tests);\n }", "public function progress()\n {\n return $this->totalsportevents > 0 ? round(($this->processedsportevents() / $this->totalsportevents) * 100) : 0;\n }", "public function accuracy($test_data,$label='label')\n\t{\n\t\t$first_label = array_keys($test_data)[0];\n\t\t$correct = 0;\n\t\t$total = count($test_data[$first_label]);\n\t\t$current_data_set = [];\n\t\tforeach (range(0, $total-1) as $index => $value) {\n\t\t\tforeach ($test_data as $label => $column) {\n\t\t\t\t$current_data_set[$label][] = $column[$index];\n\t\t\t}\n\t\t\t$accurate = ($this->predict($current_data_set) == $current_data_set[$label][0]);\n\t\t\tif($accurate){\n\t\t\t\t$correct++;\n\t\t\t}\n\t\t\t$current_data_set = [];\n\t\t}\n\n\t\treturn ($correct/$total);\n\t}", "function getTotalFaliures()\n {\n $data = [];\n $output = $this->queryData('//QueryGetTotalFailures','', $data);\n $number = $output[0]['number'];\n return $number;\n }", "public function test_it_can_expose_the_percentage_of_time_remaining()\n {\n $timelog = factory(TimeLog::class)->create([\n 'number_of_seconds' => 3600,\n 'user_id' => $this->user->id,\n 'project_id' => $this->project->id\n ]);\n // The project should be able to tell us what percentage of the overall time is remaining (90%)\n $percentage = (100 - $this->project->percentage_taken);\n $this->assertSame($this->project->percentage_remaining, $percentage);\n }", "function calculate_student_progress($completed_hours, $total_hours, $pace) {\n\n\t// Get the default progress percentage:\n\t$progress = $completed_hours/$total_hours;\n\t// echo number_format($progress, 2);\n\n\tif ($_POST['pace'] == 16) {\n\t\t// Return the formatted progress as a percentage:\n\t\treturn number_format($progress, 2) * 100;\n\t} else {\n\t\t// Get adjusted progress for this pace:\n\t\t$adjusted_progress = $progress / 1.5;\n\n\t\t// Return the formatted progress as a percentage:\n\t\treturn number_format($adjusted_progress, 2) * 100;\n\t\t}\n}", "public function test_percentage_method()\n {\n $expected_value = 60;\n \n $percentage = math::percentage(30, 50);\n \n $this->assertInternalType('array', $percentage);\n $this->assertArrayHasKey('value', $percentage);\n $this->assertArrayHasKey('sign', $percentage);\n \n $this->assertInternalType('int', $percentage['value']);\n $this->assertInternalType('string', $percentage['sign']);\n \n $this->assertEquals($percentage['value'], $expected_value);\n $this->assertEquals($percentage['sign'], $expected_value . '%');\n \n $percentage = math::percentage(NULL, NULL);\n \n $this->assertEquals(NULL, $percentage['value']);\n }", "function evaluaTestFetch()\n\t{\n\t\tif (!$this->session->userdata('user') || $this->session->userdata('user')['scoreTest'] != null) {\n\t\t\tredirect(\"InicioController\");\n\t\t}\n\n\t\t$max_score = $this->input->post('max_score');\n\t\t$res = $this->input->post('respuesta'); //se recupera el input en forma de array\n\t\t$res = json_decode($res);\t//se decodifica el json para ser tratado como object\n\t\t$sum = 0; //inicio de suma\n\t\tforeach ($res as $value) { //se pasa por cada valor de las respuestas\n\t\t\t$sum += $value[0];\n\t\t}\n\n\t\t$resultadoFinal = (int)(($sum / $max_score) * 100); //calculo de resultado en formato de 0 a 100\n\n\t\t//se almacena el resultado en la base de datos\n\t\t$successData = $this->Usuario->updateScoreTest($this->session->userdata('user')['Id_User'], $resultadoFinal);\n\t\tif ($successData) { //si todo se guarda correctamente se procede a actualizar las variables de sesion\n\t\t\t$this->session->unset_userdata('user');\n\t\t\t$this->session->set_userdata('user', $successData);\n\n\t\t\techo json_encode($resultadoFinal);\t//se envia el resultado en formato de 0% a 100%\n\t\t} else {\n\t\t\techo json_encode(\"Error/Error al guardar score de usuario\");\n\t\t}\n\t}", "function getTotalFacultyScore($con, $tcomp, $eatt, $apunct) {\n\t// get the configuration from db; hardcode for now since no table yet\n\t$sql = \"SELECT * FROM users\";\n\t$query = mysqli_query($con, $sql);\n\t//~ $row = mysqli_affected_rows($con);\n\t$tcomp_percent = 0.4;\n\t$eatt_percent = 0.3;\n\t$apunct_percent = 0.3;\n\t\n\treturn ($tcomp *$tcomp_percent) + ($eatt * $eatt_percent) + ($apunct * $apunct_percent);\n}", "public function get_percentage_complete() {\n\t\t$args = $this->get_donation_argument( array( 'number' => - 1, 'output' => '' ) );\n\t\tif ( isset( $args['page'] ) ) {\n\t\t\tunset( $args['page'] );\n\t\t}\n\t\t$query = give_get_payments( $args );\n\t\t$total = count( $query );\n\t\t$percentage = 100;\n\t\tif ( $total > 0 ) {\n\t\t\t$percentage = ( ( 30 * $this->step ) / $total ) * 100;\n\t\t}\n\t\tif ( $percentage > 100 ) {\n\t\t\t$percentage = 100;\n\t\t}\n\n\t\treturn $percentage;\n\t}", "public function test_course_progress_percentage_with_just_activities() {\n global $DB;\n\n // Add a course that supports completion.\n $course = $this->getDataGenerator()->create_course(array('enablecompletion' => 1));\n\n // Enrol a user in the course.\n $user = $this->getDataGenerator()->create_user();\n $studentrole = $DB->get_record('role', array('shortname' => 'student'));\n $this->getDataGenerator()->enrol_user($user->id, $course->id, $studentrole->id);\n\n // Add four activities that use completion.\n $assign = $this->getDataGenerator()->create_module('assign', array('course' => $course->id),\n array('completion' => 1));\n $data = $this->getDataGenerator()->create_module('data', array('course' => $course->id),\n array('completion' => 1));\n $this->getDataGenerator()->create_module('forum', array('course' => $course->id),\n array('completion' => 1));\n $this->getDataGenerator()->create_module('forum', array('course' => $course->id),\n array('completion' => 1));\n\n // Add an activity that does *not* use completion.\n $this->getDataGenerator()->create_module('assign', array('course' => $course->id));\n\n // Mark two of them as completed for a user.\n $cmassign = get_coursemodule_from_id('assign', $assign->cmid);\n $cmdata = get_coursemodule_from_id('data', $data->cmid);\n $completion = new completion_info($course);\n $completion->update_state($cmassign, COMPLETION_COMPLETE, $user->id);\n $completion->update_state($cmdata, COMPLETION_COMPLETE, $user->id);\n\n // Check we have received valid data.\n // Note - only 4 out of the 5 activities support completion, and the user has completed 2 of those.\n $this->assertEquals('50', \\core_completion\\progress::get_course_progress_percentage($course, $user->id));\n }", "public function profileCompleteness() {\n $noFields = 5;\n\n $count = 0;\n\n if($this->fullName() != \"\") {\n $count += 1;\n }\n\n if($this->experience != null) {\n $count += 1;\n }\n\n if($this->currentLocation != \"\") {\n $count += 1;\n }\n\n if($this->preferredLocation != \"\") {\n $count += 1;\n }\n\n if(sizeof($this->skills) > 0) {\n $count += 1;\n }\n\n return (float)$count * 100.0 / (float)$noFields;\n }", "public function getTotalPercentageConversion()\n {\n $percent = 0;\n\n $numberSent = $this->getTotalSumNbReminderSent();\n if ($numberSent > 0) {\n $nbConvertedCarts = $this->getTotalSumNbConvertedCarts();\n $percent = $nbConvertedCarts / $numberSent * 100;\n }\n\n return $percent;\n }", "public static function calculateProjectStatusByPts($projectID) {\n $countPts = ArmyDB::countPointsInProject($projectID);\n\n $units = ArmyDB::retrieveUnitsFromProject($projectID);\n $statusPts = 0;\n\n foreach ($units as $unit) {\n $statusPts += $unit['pts'] * (ArmyDB::convertStatusToDecimal($unit['status']) / 10);\n }\n\n if ($units == 0) {\n return \"0.0%\";\n }\n else {\n return round($statusPts/$countPts * 100,1);\n }\n }", "public function getSuccessCount()\n {\n return $this->success_count;\n }", "public function getPercentage()\n {\n return $this->percentage;\n }", "public function getPercentCompleted()\n {\n return $this->percent_completed;\n }", "function calculateOverallScore($json,$arrayAlpha){\r\n\t// initiate\r\n\t$counterTotalPoints = 0;\r\n\t$counter = 0;\r\n\t// loop through array\r\n\tforeach ($json as $key => $value){\r\n\t\t// check if user set service provider status active, if so we may process item further\r\n\t\tif ($value['active'] == true){\r\n\t\t\t// check if array contains 1+ items\r\n\t\t\tif (count($value['fields']) > 1){\r\n\t\t\t\t// loop through array in array\r\n\t\t\t\tforeach ($value['fields'] as $key2 => $value2){\t\r\n\t\t\t\t\t// Detect if number is integer, otherwise we need to convert letter to number\r\n\t\t\t\t\tif (!is_numeric($value['value'][$key2])){\r\n\t\t\t\t\t\t$value['value'][$key2] = $arrayAlpha[$value['value'][$key2]];\t \r\n\t\t\t\t\t}\t\r\n\t\t\t\t\t// update counter for actual points\r\n\t\t\t\t\t$counter += $value['value'][$key2];\t\t\r\n\t\t\t\t\t// we add 100 points per item to sum up total count\r\n\t\t\t\t\t$counterTotalPoints += 100;\t\r\n\t\t\t\t}\t\t\r\n\t\t\t}else{\r\n\t\t\t\t// Detect if number is integer, otherwise we need to convert letter to number\r\n\t\t\t\tif (!is_numeric($value['value'][0])){\r\n\t\t\t\t\t$value['value'][0] = $arrayAlpha[$value['value'][0]];\t \r\n\t\t\t\t}\t\t\r\n\t\t\t\t// update counter for actual points\r\n\t\t\t\t$counter += $value['value'][0];\t\t\r\n\t\t\t\t// we add 100 points per item to sum up total count\r\n\t\t\t\t$counterTotalPoints += 100;\r\n\t\t\t}\t\r\n\t\t}\r\n\t}\r\n\t// calculate results in percentage\r\n\t// PHP's division will always return float values\r\n\t$result['progressBar'] = 100 / $counterTotalPoints * $counter; \r\n\t\r\n\t// we check if the result is actually an integer.., looks nicer when showing the percentage value\r\n\tif (!filter_var($result['progressBar'], FILTER_VALIDATE_INT)) {\r\n\t\t// check if float, and round up to two decimal places\r\n\t\tif (is_float($result['progressBar'])){\r\n\t\t\t$result['progressBar'] = number_format((float)$result['progressBar'], 2, '.', '');\r\n\t\t}\r\n\t} \r\n\t// display result\r\n\techo $result['progressBar'];\t\r\n}", "public function getTestedTraitsPercent($asString = TRUE)\n {\n return PHP_CodeCoverage_Util::percent(\n $this->getNumTestedTraits(),\n $this->getNumTraits(),\n $asString\n );\n }", "public function testApply() {\n\t\t$group = new Group();\n\t\t$group->add($this->_paths['testClassTest']);\n\t\t$this->report->group = $group;\n\n\t\tComplexity::apply($this->report, $group->tests());\n\n\t\t$results = array_pop($this->report->results['filters'][$this->_paths['complexity']]);\n\t\t$expected = [$this->_paths['testClass'] => $this->_metrics];\n\t\t$this->assertEqual($expected, $results);\n\n\t\tFilters::clear($group);\n\t}", "public function getPercentageConversion()\n {\n $percent = 0;\n\n $numberSent = $this->getSumNbReminderSent();\n if ($numberSent > 0) {\n $nbConvertedCarts = $this->getSumNbConvertedCarts();\n $percent = $nbConvertedCarts / $numberSent * 100;\n }\n\n return $percent;\n }", "public function getPerfection(): float\n {\n return round($this->getTotal() / 45, 3) * 100;\n }", "public function percentChanged()\n {\n if ($this->value == 0) {\n $value = $this->previous;\n } elseif ($this->previous == 0) {\n $value = $this->value;\n } else {\n $value = ($this->previous - $this->value) / $this->previous;\n }\n\n return round(abs($value) * 100, 2) * ($this->value >= $this->previous ? 1 : -1);\n }", "private function computeProgressPercent($progress)\n {\n $needsADay = $this->requiredMoney / 20; // ~number of working days\n\n return $progress / $needsADay;\n }", "public function testNice()\n {\n $cases = [\n '0.01' => '1.00%',\n '0.10' => '10.00%',\n '1' => '100.00%',\n '1.5' => '150.00%',\n '1.5000' => '150.00%',\n '1.05' => '105.00%',\n '1.0500' => '105.00%',\n '0.95' => '95.00%'\n ];\n\n foreach ($cases as $original => $expected) {\n $percentage = new DBPercentage('Probability');\n $percentage->setValue($original);\n $this->assertEquals($expected, $percentage->Nice());\n }\n }", "function succ_test_html($test_counter, $test_name){\n echo \"<font size=\\\"2\\\" color=\\\"green\\\">$test_counter. $test_name TEST : passed</font><br>\\n\";\n }", "static function calculatePercentage($aantal, $totaal) {\n return round(($aantal / $totaal) * 100,1);\n }", "public function getResultForAudit( Audit $audit )\n {\n if ( null !== $auditform = $audit->getForm() )\n {\n $sections = $auditform->getSections();\n $count = count( $sections );\n if ( 0 == $count ) return 100;\n $totalPercent = 0;\n $divisor = 0;\n $audit->setFlag( FALSE );\n $index = $audit->getFormIndexes();\n foreach ( $sections as $section )\n {\n if( FALSE === in_array( $section->getId(), $index['sections']) ) continue;\n $percent = $this->getResultForSection( $audit, $section );\n $weight = $this->getWeightForSection( $audit, $section );\n $sectionFlag = $this->getFlagForSection( $audit, $section );\n\n if ( $sectionFlag ) $audit->setFlag( TRUE );\n $divisor += $weight;\n if( $divisor > 0 )\n {\n $totalPercent = $totalPercent * ( $divisor - $weight ) / $divisor + $percent * $weight / $divisor;\n }\n }\n\n return number_format( $totalPercent, 2, '.', '' );\n }\n else\n return 0;\n }", "public function getPercentage($total, $goal)\n {\n return ($total / $goal) * 100;\n }", "public function getPositiveFeedbackPercent()\n {\n return $this->positiveFeedbackPercent;\n }", "public function testSucceeded(\\unittest\\TestSuccess $success) {\n }", "public function testAverage()\n {\n $dice = new Dice();\n $dice->roll(100);\n $faceValues = $dice->getFaceValues();\n $res = $dice->average();\n $this->assertEquals(array_sum($faceValues) / 100, $res);\n }", "public function getSkipRate(): int\n {\n // Fix for division by zero error\n if ($this->getTestsSum() === 0) {\n return 0;\n }\n\n return (int)round(($this->skipped / $this->getTestsSum()) * 100, 0);\n }", "public function calculateAccuracy(){\n }", "function calculateScore($aryTip, $aryResult, $blnSD, $blnUserSD)\n { \n \t$aryScore = array\n\t(\n\t\t\"perfect\" => 3,\n\t\t\"correctScore\"=> 2,\n\t\t\"correctTeam\" => 1\n\t); \t\n \t\n \t$intResultDiff = $aryResult[0] - $aryResult[1];\t\t\n\t$intTipDiff = $aryTip[0] - $aryTip[1];\t\t\t\n\t\n\t$intScore = 0;\n\tif(is_numeric($aryTip[0]) AND is_numeric($aryTip[1]))\n\t{\n\t\t/* Sudden Death? */\n\t\t//\n\t\tif(FALSE) /* SD can't be tipped anymore!! */\n\t\t{\t\n\t\t\t/* user tipped a SD? */\n\t\t\tif( $blnUserSD == $blnSD )\n\t\t\t{\n\t\t\t\t/* correct team -> PERFECT */\t\n\t\t\t\tif( ($intResultDiff * $intTipDiff) > 0 )\n\t\t\t\t{\n\t\t\t\t\t$intScore += $aryScore['perfect'] + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\t\t\n\t\t\t/* PERFECT */\n\t\t\tif( ($aryResult[0] == $aryTip[0]) AND ($aryResult[1] == $aryTip[1]) )\n\t\t\t{\n\t\t\t\t//echo \"perfect\";\n\t\t\t\t$intScore += $aryScore['perfect'];\n\t\t\t}\n\t\t\t/* Correct Score */\n\t\t\telseif( $intResultDiff == $intTipDiff )\n\t\t\t{\n\t\t\t\t//echo \"Correct Score\";\n\t\t\t\t$intScore += $aryScore['correctScore'];\n\t\t\t}\n\t\t\t/* correct Team */\n\t\t\telseif( ($intResultDiff * $intTipDiff) > 0 )\n\t\t\t{\n\t\t\t\t//echo \"Correct Team\";\n\t\t\t\t$intScore += $aryScore['correctTeam'];\n\t\t\t}\t\t\t\n\t\t} \t\t\n\t}\n\treturn $intScore;\n}", "function getPassedAndFailed($totalOutputProcessed)\n{\n $validOutput = $totalOutputProcessed['valid'];\n $invalidOutput = $totalOutputProcessed['invalid'];\n $totalPass = 0;\n $totalFail = 0;\n\n foreach ($validOutput as $output) {\n if ($output['status'] == 'pass') {\n $totalPass++;\n } elseif ($output['status'] == 'fail') {\n $totalFail++;\n }\n }\n\n foreach ($invalidOutput as $invout) {\n $totalFail++;\n }\n return array($totalPass, $totalFail);\n}", "public function getPercent()\n {\n return $this->helper->getPercent();\n }", "public function calculatePercentage() {\n $questionCountAnswered = $this->questionAnalytics->getCountAnswered();\n if ($questionCountAnswered === 0) { //prevent division by 0 error\n $this->percentSelected = 0;\n }\n else {\n $percentSelected = $this->countAnswered / $questionCountAnswered * 100;\n $this->percentSelected = round($percentSelected, 0);\n }\n }", "public function calculate()\n\t{\n\t\t$this->sold();\n\t\t$this->rank();\n\t\t$this->feedback();\n\t\t$this->storeActive();\n\t\t$this->cod();\n\t\t$this->accountAge();\n\t\t$this->imageCount();\n\n\t\treturn $this->score;\n\t}", "public function get_percentage_complete() {\n\t\t$percentage = affwp_calculate_percentage( $this->get_current_count(), $this->get_total_count() );\n\n\t\tif ( $percentage > 100 ) {\n\t\t\t$percentage = 100;\n\t\t}\n\n\t\treturn $percentage;\n\t}", "public function getTotalScore()\n {\n $score = 0;\n for ($i = 1; $i <= 3; $i++) {\n $score += $this->getBaseScoreForShot($i) * $this->getMultiplierForShot($i);\n }\n\n return $score;\n }", "function percentage_rate_class($value, $base = 50)\n {\n if(!is_numeric($value)) {\n $value = 0;\n }\n\n $percentage = (float)$value;\n\n if($percentage == 100) {\n return 'excelent';\n }\n\n if($percentage == 0) {\n return 'neutral';\n }\n\n if($percentage < $base) {\n return 'poor';\n }\n\n return 'ok';\n }", "public function getTotalCoverage()\n {\n $totalStatements = 0;\n $coveredStatements = 0;\n\n foreach ($this->_files as $filename => $stats) {\n $totalStatements += $stats['statements'];\n\n $coveredStatements += $stats['coveredstatements'];\n }\n\n if ($totalStatements == 0) {\n return 0.0;\n }\n\n $totalCoveragePercentage = round(\n ($coveredStatements / $totalStatements) * 100,\n 2\n );\n\n return $totalCoveragePercentage;\n }", "public function get_progress_percentage( WP_User $user ): int {\n\t\t// TODO: Memoize, tests, hook.\n\n\t\t// TODO: Implement it.\n\t\treturn 0;\n\t}", "public function test_course_progress_percentage_with_activities_and_course() {\n global $DB;\n\n // Add a course that supports completion.\n $course = $this->getDataGenerator()->create_course(array('enablecompletion' => 1));\n\n // Enrol a user in the course.\n $user = $this->getDataGenerator()->create_user();\n $studentrole = $DB->get_record('role', array('shortname' => 'student'));\n $this->getDataGenerator()->enrol_user($user->id, $course->id, $studentrole->id);\n\n // Add four activities that use completion.\n $assign = $this->getDataGenerator()->create_module('assign', array('course' => $course->id),\n array('completion' => 1));\n $data = $this->getDataGenerator()->create_module('data', array('course' => $course->id),\n array('completion' => 1));\n $this->getDataGenerator()->create_module('forum', array('course' => $course->id),\n array('completion' => 1));\n $this->getDataGenerator()->create_module('forum', array('course' => $course->id),\n array('completion' => 1));\n\n // Add an activity that does *not* use completion.\n $this->getDataGenerator()->create_module('assign', array('course' => $course->id));\n\n // Mark two of them as completed for a user.\n $cmassign = get_coursemodule_from_id('assign', $assign->cmid);\n $cmdata = get_coursemodule_from_id('data', $data->cmid);\n $completion = new completion_info($course);\n $completion->update_state($cmassign, COMPLETION_COMPLETE, $user->id);\n $completion->update_state($cmdata, COMPLETION_COMPLETE, $user->id);\n\n // Now, mark the course as completed.\n $ccompletion = new completion_completion(array('course' => $course->id, 'userid' => $user->id));\n $ccompletion->mark_complete();\n\n // Check we have received valid data.\n // The course completion takes priority, so should return 100.\n $this->assertEquals('100', \\core_completion\\progress::get_course_progress_percentage($course, $user->id));\n }", "public function calculate_discount_percentage() {\n extract($_POST);\n $disc_rate = ($discount_amount / $class_fees) * 100;\n $fees_due = $class_fees - $discount_amount;\n $subsidy_per = ($subsidy * 100) / $fees_due;\n $result = $this->classtraineemodel->calculate_net_due($gst_onoff, $subsidy_after_before, $fees_due, $subsidy, $gst_rate);\n $arr = array();\n if ($result < 0) {\n $arr['label'] = \"NEGATIVE Total Fees Due NOT ALLOWED. Please correct Discount AND/ OR Subsidy Amounts.\";\n $arr['amount'] = \"\";\n } else {\n $arr['label'] = \"\";\n $arr['amount'] = number_format($result, 4, '.', '');\n $arr['disc_rate'] = number_format($disc_rate, 4, '.', '');\n $arr['subsidy_per'] = number_format($subsidy_per, 4, '.', '');\n $gst_amount = $this->classtraineemodel->calculate_gst($gst_onoff, $subsidy_after_before, $fees_due, $subsidy, $gst_rate);\n $arr['gst_amount'] = number_format($gst_amount, 4, '.', '');\n }\n echo json_encode($arr);\n exit();\n }", "public function getPercent() {\n return $this->percent;\n }", "public function testScore()\n {\n $value = mt_rand(1, 100);\n $comparisonValue = mt_rand(1, 100);\n $expected = [\n ComparisonFactor::EQUAL => ($value == $comparisonValue),\n ComparisonFactor::IDENTICAL => ($value === $comparisonValue),\n ComparisonFactor::NOT_EQUAL => ($value != $comparisonValue),\n ComparisonFactor::NOT_EQUAL_ALT => ($value <> $comparisonValue),\n ComparisonFactor::NOT_IDENTICAL => ($value !== $comparisonValue),\n ComparisonFactor::GREATER_THAN => ($value > $comparisonValue),\n ComparisonFactor::GREATER_THAN_OR_EQUAL_TO => ($value >= $comparisonValue),\n ComparisonFactor::LESS_THAN => ($value < $comparisonValue),\n ComparisonFactor::LESS_THAN_OR_EQUAL_TO => ($value <= $comparisonValue),\n ];\n foreach ($expected as $operator => $result) {\n $factor = new ComparisonFactor($comparisonValue, $operator);\n $this->assertEquals($result, $factor->score($value));\n }\n }", "public function testGetAverage()\n {\n $hand = new DiceHand(3);\n\n $hand->roll();\n\n $res = $hand->getAverage();\n $exp = $hand->getSum() / 3;\n\n $this->assertEquals($res, $exp);\n }", "public function _summary() {\n $text = $this->_failed ? 'TESTS FAILED!' : 'TESTS PASSED';\n $result = $this->_colors->getColoredString($text, $this->_colorsPalete[!$this->_failed]);\n $this->_log($result);\n }", "public function getPercent()\n {\n return $this->percent;\n }", "public function testAnalyze() {\n\t\t$group = new Group();\n\t\t$group->add($this->_paths['testClassTest']);\n\t\t$this->report->group = $group;\n\n\t\tComplexity::apply($this->report, $group->tests());\n\n\t\t$results = Complexity::analyze($this->report);\n\t\t$expected = ['class' => [$this->_paths['testClass'] => 2.7]];\n\t\tforeach ($this->_metrics as $method => $metric) {\n\t\t\t$expected['max'][$this->_paths['testClass'] . '::' . $method . '()'] = $metric;\n\t\t}\n\t\t$this->assertEqual($expected['max'], $results['max']);\n\t\t$result = round($results['class'][$this->_paths['testClass']], 1);\n\t\t$this->assertIdentical($expected['class'][$this->_paths['testClass']], $result);\n\t}", "public function getSamplePercentage()\n {\n return $this->sample_percentage;\n }", "public function testStatus(){\n $model = new PersistenceManager();\n $stats = $model->getStatus();\n\n $this->assertEquals(\n intval($stats[0]['total']),\n intval($stats[0]['used'])+intval($stats[0]['not_used'])\n );\n }", "function get_question_correct_perc($req_ID) {\n global $myPDO;\n\n // The query to get the IDs of hard questions\n $statement = $myPDO->prepare(\"\n SELECT\n (COUNT( CASE `Correct` WHEN 1 THEN `Correct` END ) / COUNT( * )) *100 AS 'correct_perc'\n FROM\n `rdtom_responses`\n WHERE\n `Question_ID` = :Question_ID\n \");\n\n $statement->bindValue(':Question_ID', $req_ID);\n $statement->execute();\n $result = $statement->fetch(PDO::FETCH_ASSOC);\n\n return $result['correct_perc'];\n}", "public function specpercentage() {\n\t\t\tif ($this->linesofcode === NULL || $this->linesofspec === NULL) {\n\t\t\t\treturn NULL;\n\t\t\t} else {\n\t\t\t\treturn round(($this->linesofspec / $this->linesofcode) * 100, 2);\n\t\t\t}\n\t\t}", "public function getLineExecutedPercent($asString = TRUE)\n {\n return PHP_CodeCoverage_Util::percent(\n $this->getNumExecutedLines(),\n $this->getNumExecutableLines(),\n $asString\n );\n }", "public function getPercentaje() {\n return $percentaje;\n }", "public function getPercent()\n {\n return $this->readOneof(2);\n }", "function gain_if_correct($score_increment, $total, $correct, $suffix)\n {\n if($total == $correct) {\n return 'N/A';\n }\n\n return $score_increment. \" \".$suffix;\n }", "function getGameProgression()\n {\n // With the mini game number we divide the game in 3 thirds (0-33,\n // 33-66, 66-100%), and looking at the player discs we can further\n // divide each third: each disc on an agentarea counts as a 1/9th\n // solved case; each disc on a locslot as a 1/3rd solve case. We\n // average that over the player count, and thus get the in-minigame\n // progress.\n $base = (self::getGameStateValue(\"minigame\") - 1) * (100 / $this->constants['MINIGAMES']);\n $base = max(0, $base);\n $discs_on_agentarea = count($this->tokens->getTokensOfTypeInLocation('disc_%', 'agentarea_%'));\n $discs_on_locslot = count($this->tokens->getTokensOfTypeInLocation('disc_%', 'locslot_%'));\n $perc_cases_solved = 0;\n $perc_cases_solved += $discs_on_agentarea * (1/9);\n $perc_cases_solved += $discs_on_locslot * (1/3);\n $minigame_progress = $perc_cases_solved / self::getPlayersNumber();\n $progress = $base + ($minigame_progress * 33);\n return floor($progress);\n }", "public function getCoverageScore()\n {\n return $this->coverage_score;\n }", "function tripal_job_set_progress($job_id,$percentage){\n\n if(preg_match(\"/^(\\d+|100)$/\",$percentage)){\n $record = new stdClass();\n $record->job_id = $job_id; \n $record->progress = $percentage;\n\t if(drupal_write_record('tripal_jobs',$record,'job_id')){\n\t return 1;\n\t }\n }\n return 0;\n}", "public function getPercentageProgress($jenis)\n\t{\n\t\t$unitkerja=$this->unitkerja;\n\t\t$kegiatan=$this->kegiatan;\n\n\t\t$sql=\"SELECT IF(SUM(jumlah) IS NULL, 0, SUM(jumlah)) AS val FROM value_kegiatan WHERE unit_kerja=$unitkerja AND kegiatan=$kegiatan AND jenis=$jenis\";\n\t\t$total=Yii::app()->db->createCommand($sql)->queryScalar();\n\t\t\n\t\t$percentage=($this->target==0) ? 100 : $total/$this->target*100;\n\t\treturn floor($percentage);\n\t}", "function promedio($total,$cantidad){\n return number_format($cantidad*100/$total,0);\n}", "public static function calculateProjectStatusByUnits($projectID) {\n $countUnits = ArmyDB::countUnitsInProject($projectID);\n\n if ($countUnits == 0) {\n return \"0.0\";\n }\n\n $units = ArmyDB::retrieveUnitsFromProject($projectID);\n $statusPts = 0;\n\n foreach ($units as $unit) {\n $statusPts += ArmyDB::convertStatusToDecimal($unit['status']);\n }\n\n if ($statusPts == 0) {\n return \"0.0\";\n }\n return round($statusPts / ($statusPts * $countUnits) * 100, 1);\n\n }", "public function getProcessFeesPercent()\r\n {\r\n return $this->process_fees_percent;\r\n }", "public function testGetMarkAverage()\n {\n $affectedProgram = $this->em->getRepository('AppBundle:AffectedProgram')->findOneBy(array('name' => 'Francais'));\n $sequence1 = $this->em->getRepository('AppBundle:Sequence')->findOneBy(array('name' => '1er Trimestre'));\n //Get marks of a student_1 6em from fixture and calculate their average\n $student_1_6em1 = $this->em->getRepository('AppBundle:Student')->findOneBy(array('name' => 'Eleve 6em 1'));\n $marks = $student_1_6em1->getMarksByAffectedProgramAndSequence($affectedProgram, $sequence1, 'Devoir');\n $average = $this->utils->getMarksAverage($marks);\n $this->assertEquals($average, 10.00);\n }", "public function getProgressOk(): int\n {\n return $this->progress_ok;\n }", "public function testSuccess()\n {\n }", "public function getPercentageFirstConversion()\n {\n $percent = 0;\n $nbSent = $this->getNbFirstReminderSent();\n if ($nbSent) {\n $nbConverted = $this->getNbFirstReminderConverted();\n $percent = $nbConverted / $nbSent * 100;\n }\n\n return $percent;\n }", "public function getIptPercent();", "public function getStudentTestScore($testId = NULL , $userUUID = NULL)\n\t\t{\n\t\t\t$this->db->select(\"COUNT(tque_id) AS total_questions ,\n\t\t\tSUM(CASE WHEN opt_correct_answer = 1 AND opt_id = tans_opt_id THEN 1 ELSE 0 END) AS correct_answers\", false);\n\t\t\t$this->db->join(TABLE_TEST_STUDENT , 'ts_test_id = test_id');\n\t\t\t$this->db->join(TABLE_TEST_QUESTION , 'test_id = tque_test_id');\n\t\t\t$this->db->join(TABLE_TEST_OPTIONS , 'tque_id = opt_que_id');\n\t\t\t$this->db->join(TABLE_TEST_ANSWERS , 'tque_id = tans_ques_id AND ts_uuid = tans_uuid' , 'LEFT');\n\t\t\t$this->db->where('test_type' , 'Test');\n\t\t\t$this->db->where('opt_correct_answer' , 1);\n\t\t\t$this->db->where('test_id' , $testId);\n\t\t\t$this->db->where('ts_uuid' , $userUUID);\n\t\t\t$result = $this->db->get(TABLE_TEST_SUBMITTED);\n\t\t\tif($result->num_rows())\n\t\t\t\treturn $result->row();\n\t\t\treturn 0;\n\t\t}", "public function getTotalProgress($tahun=NULL)\n\t{\n\t\tif($tahun==NULL)\n\t\t{\n\t\t\t$tahun=date('Y');\n\t\t}\n\t\t$sqlk=\"SELECT SUM(target) FROM participant p, kegiatan k \n\t\t\t\tWHERE p.kegiatan=k.id AND YEAR(k.end_date)=$tahun\";\n\n\t\t$total_target=Yii::app()->db->createCommand($sqlk)->queryScalar();\n\n\t\t$sqlr=\"SELECT SUM(jumlah) FROM value_kegiatan p, kegiatan k \n\t\t\t\tWHERE p.kegiatan=k.id AND YEAR(k.end_date)=$tahun AND jenis=1\";\n\n\t\t$total_real=Yii::app()->db->createCommand($sqlr)->queryScalar();\n\n\t\treturn $total_target==0 ? 0 : floor($total_real/$total_target*100);\n\t}", "public function calculateErrorPercentage($decimal = 1)\n {\n //Sampling error not found\n if (! $this->has('sampling_error')) {\n return;\n }\n //Calculate percentage and return value\n return (float) number_format($this->get('sampling_error') * 100, $decimal, '.', '');\n }", "public function getSuccessful(): int\n {\n return $this->successful;\n }", "public function getWinPercent()\n {\n $total = array_sum($this->performance);\n\n if ($total == 0) {\n return 0;\n }\n\n return ($this->wins / $total) * 100;\n }", "public function getWinPercent()\n {\n $total = array_sum($this->performance);\n\n if ($total == 0) {\n return 0;\n }\n\n return ($this->wins / $total) * 100;\n }", "public function getAchievementsPercentage() {\n return $this->getAchievementsDone() / sizeof($this->achievements);\n }", "public function testActiveAccountPayoutFullDonationPercentage()\n {\n $inflationEffect = factory(InflationEffect::class, 1)->create([\n 'amount' => '10000'\n ]);\n\n $activeAccounts = factory(ActiveAccount::class, 3)->create([\n 'balance' => '1000' * StellarAmount::STROOP_SCALE\n ]);\n\n $activeAccount = factory(ActiveAccount::class)->create([\n 'balance' => '1000' * StellarAmount::STROOP_SCALE,\n 'user_id' => function() {\n return factory(\\lumenous\\User::class)->create([\n 'donation_percentage' => 100\n ]);\n }\n ]);\n\n $this->payoutService->init();\n\n $this->payoutService->setInflationEffect($inflationEffect->first());\n\n $payoutAmount = $this->payoutService->calculateActiveAccountPayoutAmount($activeAccount);\n\n $this->assertEquals(0, $payoutAmount);\n }", "public function taskPercentage($taskId)\n {\n $taskPercentage = 0;\n $reportQuery = new Query();\n $reportQuery->select('COUNT(*) as count, SUM(percent_done) as sum')\n ->from('tomreport')\n ->where('tomreport.task_id=:taskId', array(':taskId' => $taskId));\n\n $reportPercentages = $reportQuery->all();\n\n $sumReports = $reportPercentages[0]['sum'];\n $allReports = $reportPercentages[0]['count'];\n if ($sumReports == null) {\n $sumReports = 100; // if task exists but has no reports\n $allReports = 1;\n }\n if ($allReports != null && $allReports != 0) {\n $taskPercentage = $sumReports / $allReports;\n }\n\n if ($taskPercentage == 100) {\n $this->updateTaskStatus($taskId, 1);\n }\n }", "function feedback_percent($user){\r\n $total = mysql_num_rows(mysql_query(\"SELECT * FROM feedback WHERE user = '$user'\"));\r\n if ($total > 0){\r\n $great = round(mysql_num_rows(mysql_query(\"SELECT * FROM feedback WHERE user = '$user' AND rating = 'Great'\")) / $total * 100, 2);\r\n $average = round(mysql_num_rows(mysql_query(\"SELECT * FROM feedback WHERE user = '$user' AND rating = 'Average'\")) / $total * 100, 2);\r\n $bad = round(mysql_num_rows(mysql_query(\"SELECT * FROM feedback WHERE user = '$user' AND rating = 'Bad'\")) / $total * 100, 2); \r\n }else{\r\n $great = 0;\r\n $average = 0;\r\n $bad = 0;\r\n }\r\n return array($great, $average, $bad, $total);\r\n}", "function percentage($collection){\n\n $number = 10;\n $new_number = count_products($collection);\n\n $new_value = $new_number - $number;\n\n $percentage = abs(($new_value / $number) * 100);\n\n \n if ($new_number < $number){\n\n return $percentage . '% decrease';\n\n }else if($new_number == $number){\n\n return $percentage . '%';\n }\n \n else {\n\n return $percentage . '% increase';\n\n }\n \n}", "function countfinishedTest()\n\t{\n\t\tglobal $DB,$frmdata;\n\t\t\n\t\t$query=\"select count(*) as finishtest,tc.candidate_id from test join test_candidate as tc on tc.test_id = test.id\n\t\t\t\twhere test_date<now() AND tc.candidate_id =\".$_SESSION['candidate_id'];\n\t\t\t\t\n\t\t$result = $DB->RunSelectQuery($query);\n\t\treturn $result;\n\t}", "public function getExpectedPaymentsCount()\n {\n $ret = 0;\n if ($this->first_total > 0)\n $ret++;\n if ($this->second_total > 0)\n $ret += $this->rebill_times;\n return $ret;\n }" ]
[ "0.74662346", "0.649993", "0.6478119", "0.6470749", "0.6437501", "0.64136565", "0.6353298", "0.62440366", "0.6235881", "0.6219482", "0.61576104", "0.61561984", "0.6069912", "0.60361207", "0.59833914", "0.5981433", "0.5949986", "0.58984613", "0.58732677", "0.5867769", "0.58490044", "0.5844848", "0.5825265", "0.58246195", "0.5822359", "0.5804957", "0.5785876", "0.57735157", "0.5767884", "0.5752441", "0.571254", "0.5707365", "0.57044744", "0.56981903", "0.56955403", "0.56592995", "0.56592333", "0.5630366", "0.56209636", "0.56152487", "0.56077796", "0.5602883", "0.5598339", "0.55931795", "0.5587157", "0.55870557", "0.55848426", "0.55705464", "0.55601734", "0.55596095", "0.55456346", "0.55358684", "0.55316246", "0.5515993", "0.5513727", "0.55020326", "0.5500874", "0.5490083", "0.54878575", "0.548618", "0.54860526", "0.5484237", "0.5482311", "0.5478027", "0.54713595", "0.5465132", "0.544242", "0.54353", "0.5432953", "0.5432321", "0.5418095", "0.54156923", "0.5406225", "0.53880715", "0.5387988", "0.53838015", "0.5380829", "0.53782755", "0.5377501", "0.5377169", "0.53757787", "0.53712046", "0.5365484", "0.5362956", "0.5352914", "0.5347525", "0.534629", "0.53403085", "0.5336837", "0.5326927", "0.5326588", "0.5326423", "0.5326423", "0.53206897", "0.5319901", "0.5314442", "0.5314032", "0.5313923", "0.5311441", "0.5309221" ]
0.7263251
1
Create a new Spotify instance.
public function __construct(Session $session, SpotifyWebAPI $api, array $parameters = []) { $this->session = $session; $this->api = $api; $this->options = $parameters; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct()\n {\n parent::__construct();\n\n $this->proxies=array(\n array('proxy'=>'163.172.48.109','proxyport'=>'15002'),\n array('proxy'=>'163.172.48.117','proxyport'=>'15002'),\n array('proxy'=>'163.172.48.119','proxyport'=>'15002'),\n array('proxy'=>'163.172.48.121','proxyport'=>'15002'),\n array('proxy'=>'163.172.36.181','proxyport'=>'15002'),\n array('proxy'=>'163.172.36.191','proxyport'=>'15002'),\n array('proxy'=>'62.210.251.228','proxyport'=>'15002'),\n array('proxy'=>'163.172.36.207','proxyport'=>'15002')\n );\n\n $this->spotifygooglekey='6Lenb9oUAAAAAO1Rqrm4KsoNH14OvMm6SWkQcdRj';\n $this->spotifygetregurl='https://www.spotify.com/us/signup/';\n $this->spotifypostregurl='https://spclient.wg.spotify.com/signup/public/v1/account';\n $this->creationpointurl='https://www.spotify.com/us/';\n\n $this->spotifymainurl='https://www.spotify.com';\n $this->spotifyvalidateemailurl='https://spclient.wg.spotify.com/signup/public/v1/account?validate=1&email=';\n $this->spotifyposthost='spclient.wg.spotify.com';\n\n $this->scopes= ['user-read-email',\n 'user-read-private',\n 'ugc-image-upload',\n 'playlist-read-collaborative',\n 'playlist-modify-public',\n 'playlist-read-private',\n 'playlist-modify-private',\n 'user-library-modify',\n 'user-library-read',\n 'user-follow-read',\n 'user-follow-modify'\n ];\n\n \n\n }", "function getSpotifyApi(string $email): SpotifyApi\n{\n //Class to provide user from db\n $userDb = DatabaseFactory::getUserDb();\n //get user with spotify token by email from own db\n $user = $userDb->getByEmailWithToken($email);\n //instantiate the class Spotify api in order to access of spotify api service\n if ($user === null)\n include __DIR__ . '/src/Views/login.php';\n return new SpotifyApi($user->getSpotifyToken(), $user);\n}", "public function sp_api()\n {\n $awsCredentials = new Credentials(\n env('AWS_ACCESS_KEY_ID'),\n env('AWS_SECRET_ACCESS_KEY')\n );\n\n // All of the below should be safe to bind as singletons to an IoC container.\n $spApiConfig = $this->buildSpApiConfig();\n $awsCredentialProvider = CredentialProvider::fromCredentials($awsCredentials);\n $lwaClient = new LwaClient($spApiConfig);\n $lwaService = new LwaService($lwaClient, static::$arrayCache, $spApiConfig);\n $clientAuthenticator = new ClientAuthenticator($lwaService, $awsCredentialProvider, $spApiConfig);\n $clientFactory = new ClientFactory($clientAuthenticator, $spApiConfig);\n $rdtService = new RdtService($clientFactory);\n // ^^^^^^^^^^^^^^^^ END of singleton-safe dependencies ^^^^^^^^^^^^^^^^\n\n // This should always be new'ed up on every use -- i.e. should never be used as a singleton.\n // This is because this wrapper class has state (e.g. rdtRequest) that is intended to be\n // short-lived for the purpose of a single SP-API call.\n return new SpApi(\n $clientFactory,\n $rdtService,\n $lwaService,\n $spApiConfig\n );\n }", "public function __construct()\n\t{\n\t \t$this->ShopifyClient = new ShopifyClient();\n\t}", "public function setSpotifyAccessToken($accessToken)\n {\n $this->spotifyAccessToken = $accessToken;\n\n return $this;\n }", "public function songs_create()\n {\n $user = User::factory()->create();\n $playlist=PlayList::factory()->create();\n $response = $this->actingAs($user,'api');\n $formData=[\n 'playlist_id'=>$playlist->id,\n 'song_name'=>'asdf',\n 'description'=>'des'\n ];\n $response->json('POST',route('Songs.create'),$formData)->assertStatus(201)->assertJson(['data'=>$formData]);\n }", "public static function factory(): Speak\n {\n return new static();\n }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public function create() {\n\t\t$implementationClassName = 'Imagine\\\\' . $this->settings['driver'] . '\\Imagine';\n\t\treturn new $implementationClassName();\n\t}", "public function __construct()\n {\n parent::__construct();\n $this->flickrApi = new PhpFlickr(env('FLICKR_KEY'));\n }", "function sp() {\n\tglobal $serverpilot_instance;\n\tif ( ! $serverpilot_instance ) {\n\t\ttry {\n\t\t\t$serverpilot_instance = new \\ServerPilot( settings( 'serverpilot' ) );\n\t\t} catch ( \\ServerPilotException $e ) {\n\t\t\tpush_error( new \\WP_error( $e->getCode(), $e->getMessage() ) );\n\t\t}\n\t}\n\treturn $serverpilot_instance;\n}", "public function __construct() {\n $storage = Config::get('steam::config.storage', storage_path('steam'));\n $key = Config::get('steam::config.api.key', self::KEY);\n $appid = Config::get('steam::config.api.appid', self::APPID);\n $lang = Config::get('steam::config.api.lang', self::LANG);\n $version = Config::get('steam::config.api.version', self::VERSION);\n $base_url = Config::get('steam::config.api.base_url', self::BASE_URL);\n\n $this->setBaseUrl($base_url);\n $this->setStorage($storage);\n $this->setKey($key);\n $this->setAppid($appid); \n $this->setLanguage($lang); \n $this->setVersion($version);\n }", "public function create()\n {\n $streamingServices = StreamingService::all();\n return view(\"tvshows.create\", [\n \"streamingServices\" => $streamingServices\n ]);\n }", "public function __construct(\\App\\Fan $fan, $spotify_release_id)\n {\n $this->fan = $fan;\n $this->spotify_release_id = $spotify_release_id;\n\n }", "public function create() {}", "public function getShopifyInstance()\n {\n $config = config('shopify');\n $client = app(Client::class);\n $shopify = new Shopify($client, $config);\n\n if (count($config['websites']) === 1) {\n $firstWebsite = array_keys($config['websites'])[0];\n $shopify->setWebsite($firstWebsite);\n }\n\n return $shopify;\n }", "public function run()\n {\n factory(Sponser::class, 5)->create();\n }", "public function it_should_be_able_to_create_an_s3_storeage_instance()\n {\n $attachment = $this->buildMockAttachment('s3');\n\n $storage = Storage::create($attachment);\n\n $this->assertInstanceOf('Codesleeve\\Stapler\\Storage\\S3', $storage);\n }", "public function __construct()\n {\n parent::__construct();\n\n $siteConfig = SiteConfig::current_site_config();\n $clientID = $siteConfig->VimeoFeed_ClientID;\n $clientSecret = $siteConfig->VimeoFeed_ClientSecret;\n\n $this->lib;\n\n $this->lib = new \\Vimeo\\Vimeo($this->appID, $this->appSecret);\n $this->lib->setToken($siteConfig->VimeoFeed_AppToken);\n\n if ($clientID && $clientSecret) {\n if ($accessToken = $this->getConfigToken()) {\n $this->lib->setToken($accessToken);\n }\n }\n }", "public function __construct(Track $track)\n {\n $this->track = $track;\n }", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create()\n {\n //TODO\n }", "public function create(){}", "public function Create() {\n parent::Create();\n\n\t\t\t$this->RegisterPropertyString(\"Password\", \"\");\n\n\t\t\t$this->RegisterPropertyString(\n\t\t\t\t'RadioStations', '[{\"position\":1,\"station\":\"NDR2 Niedersachsen\",\"station_url\":\"http://172.27.2.205:9981/stream/channel/800c150e9a6b16078a4a3b3b5aee0672\"},\n\t\t\t\t{\"position\":2,\"station\":\"MDR Jump\",\"station_url\":\"http://172.27.2.205:9981/stream/channel/0888328132708be0905731457bba8ae0\"},\n\t\t\t\t{\"position\":3,\"station\":\"Inselradio Mallorca\",\"station_url\":\"http://172.27.2.205:9981/stream/channel/14f799071150331b9a7994ca8c61f8c7\"}]'\n );\n\n $this->RegisterPropertyBoolean(\"HideVolume\",false);\n $this->RegisterPropertyBoolean(\"HideTitle\",false);\n $this->RegisterPropertyBoolean(\"HideTimeElapsed\",false);\n\n\t\t\t$this->RegisterTimer(\"KeepAliveTimer\", 1000, 'MPDP_KeepAlive($_IPS[\\'TARGET\\']);');\n\t\t}", "public function getSpotifyURI()\n\t{\n\t\treturn 'spotify:track:' . toSpotifyId($this->id);\n\t}", "public function create()\n {\n // Not needed cause this is coming from the item listing\n }", "public function create() {\n }", "public function create() {\n }", "function setUpSpotifyCurl($clientId, $data){\n\t// Set the URI during init\n\t$ch = curl_init(SPOTIFY_TOKEN_URI);\n\t\n\t// Set auth\n\t// https://developer.spotify.com/web-api/authorization-guide/\n\tcurl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n\tcurl_setopt($ch, CURLOPT_USERPWD, $clientId.':'.SPOTIFY_CLIENT_SECRET);\n\t// Set Content-Type\n\tcurl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/x-www-form-urlencoded']);\n\t// Capture the json data\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t// Allow the header to be dumped\n\tcurl_setopt($ch, CURLINFO_HEADER_OUT, true);\n\t\n\t// Set POST Data\n\tcurl_setopt($ch, CURLOPT_POST, true);\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));\n\t\n\treturn $ch;\n}", "public function __construct(Temboo_Session $session)\n {\n parent::__construct($session, '/Library/LastFm/Artist/Share/');\n }", "protected function setupStore()\n\t{\n\t\t$store = new Store();\n\t\t$store->setName('Apple Store');\n\n\t\treturn $store;\n\t}", "public function create() {\r\n }", "public static function getSpot()\n {\n $element = new Lib_Form_Element_Spot('spot', true);\n $element->setLabel(ucfirst(Globals::getTranslate()->_('spot')));\n return $element;\n }", "public function create()\n\t{\n\t\treturn $this->createResource(sprintf('/%s/%s/', ZoopResource::VERSION, sprintf(self::PATH, $this->zoop->getMarketplaceId())));\n\t}", "function __construct() {\n\t\t$this->_foursquare = new FoursquareAPI(self::$client_key, self::$client_secret);\n\t}", "public function __construct() {\n\n $this->datastore = new Model\\PluginDatastore();\n try {\n $id = $this->datastore->getType() . '-' . $this->getName();\n $this->datastore->fetchById($id);\n } catch (\\phpillowResponseNotFoundErrorException $e) {\n\n $this->datastore->name = $this->getName();\n $this->datastore->created = date('r');\n\n $this->datastore->save();\n }\n }", "public function create()\n {}", "public function handle()\n {\n\n $spotify = SpotifyController::getApi();\n $session = SpotifyController::getSession();\n\n $this->info('Testing if API key still works.');\n\n try {\n if ($spotify->me()->id != config('app-proto.spotify-user')) {\n $this->error('API key is for the wrong user!');\n SlackController::sendNotification('[console *proto:spotify*] API key is for the wrong user.');\n return;\n }\n } catch (\\SpotifyWebAPI\\SpotifyWebAPIException $e) {\n if ($e->getMessage() == \"The access token expired\") {\n\n $this->info('Access token expired. Trying to renew.');\n\n $refreshToken = $session->getRefreshToken();\n $session->refreshAccessToken($refreshToken);\n $accessToken = $session->getAccessToken();\n $spotify->setAccessToken($accessToken);\n\n SpotifyController::setSession($session);\n SpotifyController::setApi($spotify);\n\n } else {\n $this->error('Error using API key.');\n SlackController::sendNotification('[console *proto:spotify*] Error using API key, please investigate.');\n return;\n }\n }\n\n $this->info('Constructing ProTube hitlist.');\n\n $videos = PlayedVideo::whereNull('spotify_id')->orderBy('id', 'desc')->limit(1000)->get();\n\n $videos_to_search = [];\n\n $strip = [\n #\" \",\n \" official\", \"official \", \"original\", \"optional\",\n \"video\", \"cover\", \"clip\",\n \" - \", \" + \", \"|\", \"(\", \")\", \":\", \"\\\"\", \".\",\n \" &\", \" ft.\", \" ft\", \" feat\",\n \"audio\", \" music\",\n \" hd\", \"hq\",\n \"lyrics\", \"lyric\",\n \"sing along\", \"singalong\", \"tekst\", \"ondertiteld\", \"subs\",\n ];\n\n foreach ($videos as $video) {\n if (!in_array($video->video_title, array_keys($videos_to_search)) && strlen($video->video_title) > 0) {\n $videos_to_search[$video->video_title] = (object)[\n 'title' => $video->video_title,\n 'video_id' => $video->video_id,\n 'spotify_id' => $video->spotify_id,\n 'title_formatted' => preg_replace('/(\\(.*|[^\\S{2,}\\s])/', '',\n str_replace($strip, \" \", strtolower($video->video_title))\n ),\n 'count' => $video->count\n ];\n }\n }\n\n $this->info(\"Matching to Spotify music.\\n---\");\n\n foreach ($videos_to_search as $t => $video) {\n\n if (!$video->spotify_id) {\n\n $sameVideo = PlayedVideo::where('video_id', $video->video_id)->whereNotNull('spotify_id')->first();\n\n if ($sameVideo) {\n DB::table('playedvideos')->where('video_id', $video->video_id)->update(['spotify_id' => $sameVideo->spotify_id, 'spotify_name' => $sameVideo->spotify_name]);\n $this->info(\"Matched { $video->title } due to earlier occurrence.\");\n continue;\n }\n\n try {\n\n $song = $spotify->search($video->title_formatted, 'track', ['limit' => 1])->tracks->items;\n if (count($song) < 1) {\n $this->error(\"Could not match { $video->title | $video->title_formatted } to a Spotify track.\");\n DB::table('playedvideos')->where('video_id', $video->video_id)->update(['spotify_id' => '', 'spotify_name' => 'Unknown on Spotify']);\n } else {\n $name = $song[0]->artists[0]->name . \" - \" . $song[0]->name;\n $this->info(\"Matched { $video->title } to Spotify track { $name }.\");\n DB::table('playedvideos')->where('video_id', $video->video_id)->update(['spotify_id' => $song[0]->uri, 'spotify_name' => $name]);\n }\n\n } catch (\\SpotifyWebAPI\\SpotifyWebAPIException $e) {\n $err = $e->getCode() . ' error during search (' . $video->title_formatted . ') for track (' . $video->title . ').';\n $this->error($err);\n SlackController::sendNotification('[console *proto:spotify*] ' . $err);\n }\n\n }\n\n }\n\n $this->info(\"Done!\");\n\n }", "public function createShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathMultipleResource(),\n 'METHOD' => 'POST',\n 'DATA' => [\n /*\n * Using static:: instead of self:: because static:: binds at runtime\n * If we use self this would not work because it would\n * always call ShopifyResource::getResourceSingularName()\n */\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function __construct($artist, $title)\r\n\t{\r\n\t\tparent::__construct();\r\n\t\t\r\n\t\t$trackClass = $this->apiClass->getPackage($this->auth, 'track', $this->config);\r\n\t\t$methodVars = array(\r\n\t\t\t\t'artist' => $artist,\r\n\t\t\t\t'track' => $title\r\n\t\t);\r\n\t\t\r\n\t\tif ($results = $trackClass->getInfo($methodVars) ) {\r\n\t\t\t$this->fromArray($results);\r\n\t\t} else {\r\n\t\t\t$this->error(\"error getting track info\");\r\n\t\t}\r\n\t}", "public function __construct()\n {\n $this->setTokenName(config('infusionsoft.token_name'));\n $this->setClientId(config('infusionsoft.client_id'));\n $this->setClientSecret(config('infusionsoft.client_secret'));\n $this->setRedirectUri(url(config('infusionsoft.redirect_uri')));\n if (config('infusionsoft.debug')) {\n $this->setDebug(true);\n }\n $new_token = false;\n if (Storage::exists($this->token_name)) {\n $token = unserialize(Storage::get($this->token_name));\n $this->setToken(new Token($token));\n } elseif (Request::has('code')) {\n $this->requestAccessToken(Request::get('code'));\n $new_token = true;\n } else {\n throw new InfusionsoftException(sprintf(\n 'You must authorize your application here: %s',\n $this->getAuthorizationUrl()\n ), 1);\n }\n $token = $this->getToken();\n $expired = ($token->getEndOfLife() - (time() * 2)) <= 0 ? true : false;\n if ($expired || $new_token) {\n $extra = $token->getExtraInfo();\n if (!$new_token) {\n $token = $this->refreshAccessToken();\n }\n Storage::disk(config('infusionsoft.filesystem'))->put($this->token_name, serialize([\n \"access_token\" => $token->getAccessToken(),\n \"refresh_token\" => $token->getRefreshToken(),\n \"expires_in\" => $token->getEndOfLife(),\n \"token_type\" => $extra['token_type'],\n \"scope\" => $extra['scope'],\n ]));\n }\n }", "public function create() {\n\n\t\t\n\t}", "public function create() {\n\t \n }", "public function __construct(Temboo_Session $session)\n {\n parent::__construct($session, '/Library/LastFm/User/GetArtistTracks/');\n }", "public function create() {\n \n }", "public function create() {\n \n }", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "static function create(): self;", "public function create()\n {\n return view('song.create');\n }", "public static function create() {\n $factory = new static();\n return $factory->createFlo();\n }", "public function create() {\n\t\t\t//\n\t\t}", "public function create()\n {\n return view('songs.create');\n }", "public function create() {\n //\n }", "public function create()\n {\n // handled by client\n }", "public function create($params)\n {\n $albumParams = Arr::except($params, ['tracks', 'artist']);\n $albumParams['spotify_popularity'] = Arr::get($albumParams, 'spotify_popularity', 50);\n $album = $this->album->create($albumParams);\n\n //set album name, id and artist name on each track\n $tracks = array_map(function($track) use($album) {\n $track['spotify_popularity'] = Arr::get($track, 'spotify_popularity', 50);\n $track['album_name'] = $album->name;\n $track['album_id'] = $album->id;\n return $track;\n }, Arr::get($params, 'tracks', []));\n\n $this->track->insert($tracks);\n\n return $album->load('tracks');\n }", "public function it_should_be_able_to_create_a_filesystem_storeage_instance()\n {\n $attachment = $this->buildMockAttachment('filesystem');\n\n $storage = Storage::create($attachment);\n\n $this->assertInstanceOf('Codesleeve\\Stapler\\Storage\\Filesystem', $storage);\n }", "protected function create() {\n\t}", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }" ]
[ "0.6115473", "0.59169716", "0.56245005", "0.54298645", "0.53609574", "0.5302438", "0.5259798", "0.5242799", "0.5242799", "0.5242799", "0.52207214", "0.5170682", "0.51351625", "0.5134357", "0.50752187", "0.5071403", "0.50646806", "0.5053996", "0.49843895", "0.49792302", "0.4978686", "0.49641827", "0.49370372", "0.49370372", "0.49370372", "0.49370372", "0.49370372", "0.49370372", "0.49370372", "0.49370372", "0.49370372", "0.49370372", "0.49370372", "0.49332702", "0.49237034", "0.49209258", "0.49194446", "0.49153972", "0.48882723", "0.48882723", "0.4881624", "0.4879335", "0.48724848", "0.48690018", "0.48675835", "0.48644233", "0.48544157", "0.4846739", "0.47976813", "0.4788473", "0.47866946", "0.47833246", "0.47820657", "0.4772116", "0.4769614", "0.4757884", "0.4757208", "0.4757208", "0.4754964", "0.4754964", "0.4754964", "0.4754964", "0.4754964", "0.4754964", "0.4754964", "0.4754964", "0.4754964", "0.4754964", "0.4754964", "0.4754964", "0.47527835", "0.47500387", "0.47491607", "0.474819", "0.47473258", "0.47442976", "0.473777", "0.47372237", "0.4730053", "0.47240782", "0.4721864", "0.4721864", "0.4721864", "0.4721864", "0.4721864", "0.4721864", "0.4721864", "0.4721864", "0.4721864", "0.4721864", "0.4721864", "0.4721864", "0.4721864", "0.4721864", "0.4721864", "0.4721864", "0.4721864", "0.4721864", "0.4721864", "0.4721864" ]
0.48838988
40
Redirect to the Spotify authorize URL.
private function redirectToSpotifyAuthorizeUrl() { header("Location: {$this->session->getAuthorizeUrl($this->options)}"); die(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function authorize() {\r\n\t\t$authurl = $this->tmhOAuth->url(\"oauth/authorize\", '') . \"?oauth_token={$_SESSION['oauth']['oauth_token']}\";\r\n\t\theader(\"Location: \".$authurl);\r\n\t\texit;\r\n\r\n\t\t// in case the redirect doesn't fire\r\n\t\t$this->addMsg('<p>To complete the OAuth flow please visit URL: <a href=\"' . $authurl . '\">' . $authurl . '</a></p>');\r\n\t}", "public function redirect()\n {\n $temp = $this->server->getTemporaryCredentials();\n\n // We have a stateless app without sessions, so we use the cache to\n // store the secret for man in the middle attack protection\n $key = 'oauth_temp_'.$temp->getIdentifier();\n $this->cache->put($key, $temp, ProviderContract::CACHE_TTL);\n\n $this->storeReturnUrl($temp);\n\n return new RedirectResponse($this->server->getAuthorizationUrl($temp));\n }", "public function redirectToSpotify()\n {\n //return Socialite::with('spotify')->redirect();\n\n return Socialite::driver('spotify')->redirect();\n }", "public function redirectAction()\n {\n $this->facebookOAuth->authorize();\n }", "private function _authRedirect() {\n $options = array('scope' => $this->settings['permissions']);\n if (!empty($this->settings['appUrl'])) {\n $options['redirect_uri'] = $this->settings['appUrl'];\n }\n $url = $this->facebook->getLoginUrl($options);\n echo \"<script type=\\\"text/javascript\\\">top.location.href = '$url';</script>\";\n exit;\n }", "function auth_redirect() {\n\n\t\tauth_redirect();\n\n\t}", "public function redirect()\n {\n if (!$this->isStateless()) {\n $this->request->getSession()->set(\n 'oauth.temp', $temp = $this->server->getTemporaryCredentials()\n );\n } else {\n $temp = $this->server->getTemporaryCredentials();\n setcookie('oauth_temp', serialize($temp));\n }\n\n return new RedirectResponse($this->server->getAuthorizationUrl($temp));\n }", "public function doRedirect()\n {\n $response = $this->response->asJson()->getResponse();\n $responseToArray = json_decode($response, true);\n\n if ($responseToArray['status']) {\n $url = $responseToArray['data']['authorization_url'];\n\n return redirect()->away($url);\n } else {\n Throw new \\Exception('An error occurred, could not get authorization url. ' . $response);\n }\n\n }", "public function redirectToAuth()\n {\n return Socialite::with('reddit')->scopes(['identity'])->redirect();\n }", "public function redirect()\n {\n $state = null;\n\n if ($this->usesState()) {\n $this->request->session()->put('state', $state = $this->getState());\n }\n\n return new RedirectResponse($this->getAuthUrl($state));\n }", "function auth_redirect()\n {\n }", "public function authorize()\n\t{\n\t\t$state = md5(uniqid(rand(), TRUE));\n\t\t$this->oauth->ci->session->set_userdata('state', $state);\n\t\t\t\n\t\t$params = array(\n\t\t\t'client_id' => $this->_config['client_id'],\n\t\t\t'redirect_uri' => $this->_config['redirect_uri'],\n\t\t\t'state' => $state,\n\t\t\t'scope' => 'email'\n\t\t);\n\t\t\n\t\t$url = $this->_authorize_endpoint.http_build_query($params);\n\t\tredirect($url);\n\t}", "public function openAuthorizationUrl()\n {\n header('Location: ' . $this->getAuthorizationUrl());\n exit(1);\n }", "public function XingAuthorize()\n {\n $redirectResponse = new RedirectResponse(\"https://api.xing.com/v1/authorize?\" . http_build_query(array(\n 'oauth_token' => $this->getConfig()->get('token'))\n ), 302);\n $redirectResponse->send();\n }", "public function oAuthAuthorize($token)\n {\n\theader('Location: ' . self::SECURE_API_URL .\n\t '/oauth/authorize?oauth_token=' . $token);\n }", "private function redirect()\n\t\t{\n\t\t\tif(isUserLoggedIn())\n\t\t\t{\n\t\t\t\theader(\"Location: \" . APPROOT);\n\t\t\t}\n\t\t}", "public function redirectToLogin() {\n\t\t//\tcreate and save the state parameter\n\t\t$openIdStateMap =& storageFindOrCreate( \"openIdStateMap\" );\n\t\t$state = generatePassword(10);\n\t\t$openIdStateMap[ $state ] = $this->code;\n\n\t\t//\tcreate the URL\n\t\t$config = $this->getConfig();\n\t\t$request = new HttpRequest( $config[\"authorization_endpoint\"], \"GET\", array( \n\t\t\t\"response_type\" => \"code\",\n\t\t\t\"scope\" => $this->scope,\n\t\t\t\"client_id\" => $this->clientId,\n\t\t\t\"state\" => $state,\n\t\t\t\"redirect_uri\" => projectURL() . GetTableLink(\"openidcallback\")\n\t\t));\n\n\t\theader( \"Location: \" . $request->getUrl() );\n\t}", "public function redirect();", "public function redirect();", "public function redirect();", "public function redirectToProvider()\n {\n return Socialite::driver('keycloak')->redirect();\n }", "public function redirect()\n {\n $this->request->session()->put('state', $state = $this->getState());\n\n return new RedirectResponse($this->getAuthUrl($state));\n }", "public function redirect() : RedirectResponse\n {\n return new RedirectResponse($this->authUrl);\n }", "public function spotifyAuth($request, $response)\r\n {\r\n $url = \"https://accounts.spotify.com/authorize\";\r\n $client = \"client_id=\" . Application::$app->config['client_id'];\r\n $resp = \"response_type=code\";\r\n $redirect = \"redirect_uri=\" . Application::$app->config['client_redirect'];\r\n $scope = \"scope=user-read-private%20user-read-email%20user-top-read\";\r\n $state = \"state=\" . Application::$app->config['client_redirect'];;\r\n\r\n return $response->redirect(\"$url?$client&$resp&$redirect&$scope&$state\");\r\n }", "public function redirect()\n {\n return Socialite::driver('facebook')->redirect();\n return redirect('/callback');\n }", "public function redirectToProvider()\n {\n \t\\Session::put('domain', 'api');\n\n return Socialite::driver('github')->redirect('/');\n }", "abstract protected function redirect();", "public function redirectToDropbox()\n {\n return Socialite::driver('dropbox')->setScopes(['account_info.read'])->redirect();\n }", "protected function Login()\n {\n $this->redirectParams[\"openid.realm\"] = $this->config[\"realm\"];\n $this->redirectParams[\"openid.return_to\"] = $this->config[\"return_to\"];\n\n $params = http_build_query($this->redirectParams);\n\n $url = $this->urlAuthorize . \"?$params\";\n\n header(\"Location: $url\");\n exit();\n }", "public function callback()\n {\n if (!$this->request->getQuery('code')) {\n $authUrl = $this->GoogleApi->createAuthUrl();\n return $this->redirect(filter_var($authUrl, FILTER_SANITIZE_URL));\n } else {\n $this->GoogleApi->authenticate($this->request->getQuery('code'));\n $this->redirect(\n [\n 'controller' => 'GoogleApis',\n 'action' => 'index'\n ]\n );\n }\n }", "public function redirectToProvider()\n {\n return Socialite::driver('google')->scopes('https://www.googleapis.com/auth/youtube.force-ssl')->with(['access_type'=>'offline'])->redirect();\n }", "public function redirectToProvider(): RedirectResponse\n {\n session()->reflash();\n\n if (str_contains($_SERVER['REQUEST_URI'], 'facebook')) {\n\n $social = 'facebook';\n\n $scopes = [\n 'pages_show_list',\n 'pages_manage_ads',\n 'ads_read'\n ];\n $parameters = [];\n }\n\n if (str_contains($_SERVER['REQUEST_URI'], 'google')) {\n $social = 'google';\n\n if ($_GET[\"scope\"] === 'sheets') {\n\n session()->flash('scope', 'sheets');\n\n $scopes = [\n 'openid',\n 'profile',\n 'email',\n 'https://www.googleapis.com/auth/spreadsheets',\n ];\n\n $parameters = [\n 'access_type' => 'offline',\n 'include_granted_scopes' => 'true',\n ];\n }\n\n if ($_GET[\"scope\"] === 'drive') {\n\n session()->flash('scope', 'drive');\n\n $scopes = [\n 'openid',\n 'profile',\n 'email',\n 'https://www.googleapis.com/auth/drive',\n ];\n\n $parameters = [\n 'access_type' => 'offline',\n 'include_granted_scopes' => 'true',\n ];\n }\n\n if ($_GET[\"scope\"] === 'login') {\n\n session()->flash('scope', 'sheets');\n\n $scopes = [\n 'openid',\n 'profile',\n 'email',\n 'https://www.googleapis.com/auth/spreadsheets',\n ];\n\n $parameters = [\n 'access_type' => 'offline',\n 'include_granted_scopes' => 'true',\n ];\n }\n }\n\n if (!$social or !$scopes) {\n return back()->withErrors([\n 'error',\n 'Não foi possível prosseguir com a solicitação. Por favor, tente novamente mais tarde!'\n ]);\n }\n\n return Socialite::driver($social)->setScopes($scopes)->with($parameters)->redirect();\n }", "public static function setRedirectUponAuthentication(){\n\n /**\n * Make sure we redirect to the requested page\n */\n if(isset($_SESSION[self::CONST_REQUESTED_URI_SESSION_KEY]) && !empty($_SESSION[self::CONST_REQUESTED_URI_SESSION_KEY])){\n CoreHeaders::setRedirect($_SESSION[self::CONST_REQUESTED_URI_SESSION_KEY]);\n unset($_SESSION[self::CONST_REQUESTED_URI_SESSION_KEY]);\n }else{\n CoreHeaders::setRedirect('/');\n }\n\n }", "public function sendRedirect() {}", "public function urlSocialAuthRedirect($provider) {\n //Session::put('url.failed', URL::previous());\n return Socialite::driver($provider)->redirect();\n }", "public function redirectToProvider() {\n\n if (!Auth::check()) {\n return redirect('/');\n }\n\n try {\n return Socialite::driver('twitter')->redirect();\n } catch (\\Exception $e) {\n return redirect()->route('twitter.error');\n }\n\n }", "public function redirectToProvider()\n {\n return Socialite::driver('steem')->scopes(['login', 'vote', 'comment', 'comment_options', 'offline'])->redirect();\n }", "public function authorize($options = array())\n\t{\n\t\t$state = md5(uniqid(rand(), true));\n\t\tget_instance()->session->set_userdata('state', $state);\n\n\t\t$params = array(\n\t\t\t'client_id' \t\t=> $this->client_id,\n\t\t\t'redirect_uri' \t\t=> isset($options['redirect_uri']) ? $options['redirect_uri'] : $this->redirect_uri,\n\t\t\t'state' \t\t\t=> $state,\n\t\t\t'scope'\t\t\t\t=> is_array($this->scope) ? implode($this->scope_seperator, $this->scope) : $this->scope,\n\t\t\t'response_type' \t=> 'code',\n\t\t\t'approval_prompt' => 'force' // - google force-recheck\n\t\t);\n\t\t\n\t\t$params = array_merge($params, $this->params);\n\t\t\n\t\tredirect($this->url_authorize().'?'.http_build_query($params));\n\t}", "public function mustRedirect();", "public function connect() {\n\n // Set params\n $params = array(\n 'response_type' => 'code',\n 'client_id' => $this->client_id,\n 'redirect_uri' => $this->redirect_uri,\n 'state' => time(),\n 'scope' => 'w_share r_basicprofile r_liteprofile rw_organization_admin r_organization_social w_organization_social'\n );\n \n // Get redirect url\n $url = $this->endpoint . '/authorization?' . http_build_query($params);\n \n // Redirect\n header('Location:' . $url);\n\n }", "public function redirectToSteam(Request $request, ?string $redirectTo): RedirectResponse;", "abstract protected function redirectTo();", "public function redirectToProvider()\n {\n return Socialite::driver('eveonline')->redirect();\n }", "function redirectLogin()\n\t{\n\t\tredirect('auth/login');\n\t}", "public function redirectToProvider()\n {\n return Socialite::driver('facebook')->scopes([\n 'email',\n 'public_profile',\n ])->redirect();\n }", "public function redirectToProvider()\n {\n return Socialite::driver('vkontakte')->redirect();\n }", "public function redirectTo();", "public function loginRedirect()\n\t{\n\t\t$googleService = $this->getService('google');\n\n\t\t$response = new Response();\n\t\t$response->redirect($googleService->getClient()->createAuthUrl());\n\t\treturn $response;\n\t}", "public function redirectToExternalUrl() {}", "public function redirectToProvider() {\n\n return \\Socialite::driver('facebook')->scopes(['email', 'public_profile'])->redirect();\n }", "public function requestAccessCode(?string $state = null): RedirectResponse\n {\n // Get scopes from services config file. Pass default if config not provided.\n $scopes = implode(' ', config('services.spotify.scopes', [\n 'user-read-recently-played',\n 'user-read-private',\n 'user-read-email',\n 'user-library-read',\n ]));\n\n $showDialog = (bool) config('services.spotify.show_dialog', false);\n\n $params = [\n 'response_type' => 'code',\n 'client_id' => $this->clientId,\n 'redirect_uri' => $this->redirectUrl,\n 'show_dialog' => $showDialog,\n 'scope' => $scopes,\n 'state' => $state ?? Str::random(),\n ];\n\n return redirect()->to($this->getRequestAccessCodeUrl($params));\n }", "public function redirectToProvider()\n {\n return Socialite::driver('facebook')->redirect();\n }", "public function redirectToProvider()\n {\n return Socialite::driver('facebook')->redirect();\n }", "public function redirectToProvider()\n {\n return Socialite::driver('facebook')->redirect();\n }", "public function redirectToProvider()\n {\n return Socialite::driver('facebook')->redirect();\n }", "public function redirectToProvider()\n {\n return Socialite::driver('facebook')->redirect();\n }", "public function redirectToProvider()\n {\n return Socialite::driver('facebook')->redirect();\n }", "public function redirectToProvider() {\n return Socialite::driver('facebook')->redirect();\n }", "public function redirect($provider)\n {\n return Socialite::driver($provider)->redirect(); \n }", "public function redirect($token) {\n\n\t\tif ($this->_sandbox) $url = self::SANDBOX_LOGIN_URL;\n\t\telse $url = self::LIVE_LOGIN_URL;\n\n\t\t$url .= '?cmd=_express-checkout&token=' . $token;\n\n\t\theader('Location:' . $url);\n\t\tdie();\n\n\t}", "public function redirectToProvider()\n {\n \n return Socialite::driver('facebook')->redirect();\n }", "public function oauth()\n {\n // TODO: Check user's preference if to ask user every time when new application trying to identify visitor\n\n $redirect_uri = YY::Config('tokens')->createOAuth([\n 'user' => YY::$ME,\n 'state' => $this['state'],\n 'redirect_uri' => $this['redirect_uri'],\n 'where' => $this['where'],\n 'title' => $this['title'],\n ]);\n\n if ($redirect_uri) {\n\n YY::Log('system', 'JS client redirection to: ' . $this['redirect_uri']);\n $redirect_uri = json_encode($redirect_uri);\n YY::clientExecute(\"location.replace($redirect_uri)\");\n// YY::redirectUrl($redirect_uri);\n\n } else {\n\n YY::Log('system', 'Redirect impossible (redirect_uri is empty)');\n $errorMessage = YY::Translate('Something went wrong sorry');\n $errorMessage = json_encode($errorMessage);\n YY::clientExecute(\"alert($errorMessage)\");\n }\n }", "public function oauthRedirect($driver)\n {\n $this->exist($driver);\n\n return Socialite::driver($driver)\n ->stateless()\n ->redirect();\n }", "public function redirectToProvider() {\n\t\treturn \\Socialize::with ( 'github' )->redirect ();\n\t}", "public function redirect()\n {\n return SocialLogin::driver('facebook')->redirect();\n }", "public function redirect()\n {\n return Socialite::driver('facebook')->redirect();\n }", "public function redirect()\n {\n return Socialite::driver('facebook')->redirect();\n }", "public function login(): RedirectResponse\n {\n return redirect($this->auth->getLoginUrl());\n }", "public function redirect()\n {\n return Socialite::driver('google')->redirect();\n }", "public function redirect() {\n return Socialite::driver('google')->redirect();\n }", "public function doRedirect() {\n if(is_null($this->redirect)) {\n return;\n }\n\n if(is_string($this->redirect)) {\n $this->setHeader(\"Location: \" . $this->redirect);\n }\n\n if(is_array($this->redirect)) {\n $url = '/?' . http_build_query($this->redirect);\n $this->setHeader(\"Location: \" . $url);\n }\n return;\n }", "public function redirectToGoogle()\n {\n \treturn Socialite::driver($this->googleProvider)->stateless()->redirect();\n }", "public function redirectToProvider()\n {\n // echo \"Hello\";\n return Socialite::driver('google')->stateless()->redirect();\n }", "public function authorize() {\n\t\t$authorization = false;\n\t\t// Clickjacking prevention (supported by IE8+, FF3.6.9+, Opera10.5+, Safari4+, Chrome 4.1.249.1042+)\n\t\t$this->OAuth->setVariable('auth_code_lifetime', 60);\n\t\t$this->response->header('X-Frame-Options: DENY');\n\t\ttry {\n\t\t\t$OAuthParams = $this->OAuth->getAuthorizeParams();\n\t\t} catch (Exception $e){\n\t\t\t$e->sendHttpResponse();\n\t\t}\n\t\tif (!empty($OAuthParams)) {\n\t\t\t$clientCredencials = $this->OAuth->checkClientCredentials($OAuthParams['client_id']);\n\t\t\tlist($redirectUri, $authorization) = $this->OAuth->getAuthResult($clientCredencials, $clientCredencials['user_id'], $OAuthParams);\n\t\t\tif (!empty($authorization['query']['code'])) {\n\t\t\t\t$authorization = $authorization['query'];\n\t\t\t}\n\t\t}\n\n\t\t$this->set(array('authorization' => $authorization, '_serialize' => 'authorization'));\n\t}", "public function redirect()\n {\n return Socialite::driver('google')->redirect();\n }", "public function redirect()\n {\n return Socialite::driver('facebook')->redirect();\n }", "public function redirectToProvider()\n {\n return Socialite::driver('google')->redirect();\n }", "public function redirectToProvider()\n {\n return Socialite::driver('google')->redirect();\n }", "public function redirectToProvider()\n {\n return Socialite::driver('linkedin')->redirect();\n }", "public function googleRedirect()\n {\n $user = Socialite::driver('google')->user();\n $user = User::firstOrCreate([\n 'email'=> $user->email,\n ],\n [\n 'name' => $user->nickname,\n 'email'=> $user->email,\n 'password' => Hash::make(Str::random(24))\n ]\n );\n Auth::login($user,true);\n return redirect(route('shop'));\n }", "public function onAuthenticationSuccess(Request $request, TokenInterface $token)\n {\n $referrer = $request->getSession()->get('_security.secure_area.target_path');\n\n if (empty($referrer)) {\n return new RedirectResponse($this->router->generate('books_homepage'));\n } else {\n return new RedirectResponse($referrer);\n }\n }", "public function redirectToProvider()\n {\n return Socialite::with('vkontakte')->redirect();\n }", "public function redirectToProvider()\n {\n return Socialite::driver('google')\n ->scopes(['email', 'profile'])\n ->redirect();\n }", "public function main()\n {\n if( isset( $this->config['oauth_id'] ) && isset( $this->config['oauth_secret'] ) && isset( $this->config['oauth_token'] ) )\n $this->redirect( '' );\n \n // If we're already configured, we just need a token now.\n if( isset( $this->config['oauth_id'] ) && isset( $this->config['oauth_secret'] ) )\n $this->redirect( 'oauth/token' );\n }", "public function redirectToProvider()\n {\n return Socialite::driver('github')->redirect();\n }", "public function redirectToProvider()\n {\n return Socialite::driver('github')->redirect();\n }", "public function token()\n {\n if( !isset( $this->config['oauth_id'] ) || !isset( $this->config['oauth_secret'] ) )\n $this->redirect( 'oauth' );\n\n // Skip if we're already set up\n if( isset( $this->config['oauth_id'] ) && isset( $this->config['oauth_secret'] ) && isset( $this->config['oauth_token'] ) )\n $this->redirect( '' );\n \n \n $this->url = $_SERVER['HTTP_HOST'].$this->baseURL;\n }", "public function redirect(string $url, $status_code = 302);", "public function redirectToProvider()\n {\n return Socialite::driver('facebook')\n ->scopes(['email', 'user_birthday','user_about_me','user_education_history',\n 'user_location','user_work_history','user_hometown','user_likes'])\n ->redirect();\n }", "private function _redirect ()\r\n {\r\n global $CALE_VIRTUALA_SERVER;\r\n \r\n setcookie(self::$_cookieCount, \"\", time() - 3600, \"/\");\r\n header(\"Location: \" . $CALE_VIRTUALA_SERVER);\r\n die();\r\n }", "public function redirect(){\r\n\t}", "function template_redirect() {\r\n\t\tappthemes_auth_redirect_login();\r\n\t}", "protected function redirectTo()\n {\n //generate URL dynamicaly .\n return '/login'; // return dynamicaly generated URL.\n }", "public function handleFacebookRedirect(): RedirectResponse\n {\n return Socialite::driver(static::DRIVER_TYPE)->redirect();\n }", "public function redirectToFacebook()\n\t{\n\t return Socialize::with('facebook')->redirect();\n\t}", "public function redirector()\n\t{\n\t\treturn \\Redirect::to(\\Input::get('url'));\n\t}", "public function handleProviderCallback(): RedirectResponse\n {\n session()->reflash();\n\n if (str_contains($_SERVER['REQUEST_URI'], 'facebook')) {\n\n $fbResponse = Socialite::driver('facebook');\n $user = $fbResponse->user();\n\n $fbAdAccounts = json_decode(Http::retry(3, 1000)\n ->get('https://graph.facebook.com/v10.0/me?fields=adaccounts.limit(1000){name,currency,timezone_name}&access_token=' . $user->token . '&limit=1000')\n ->body())->adaccounts->data;\n\n session()->flash('modal', 'Facebook Modal');\n session()->flash('fbToken', $user->token);\n session()->flash('fbAdAccounts', $fbAdAccounts);\n session()->flash('expiresIn', $user->expiresIn);\n\n return redirect()->route('integrations');\n }\n\n if (str_contains($_SERVER['REQUEST_URI'], 'google')) {\n\n $googleResponse = Socialite::driver('google');\n $user = $googleResponse->user();\n\n if (!isset($user->refreshToken)) {\n $endpoint = 'https://oauth2.googleapis.com/revoke?token='.$user->token;\n $response = Http::retry(3, 2000)->asForm()->post($endpoint);\n session()->forget('modal');\n\n return redirect()->route('google.start', ['scope' => session()->get('scope')]);\n }\n\n if (session()->get('scope') === 'drive') {\n\n session()->flash('googleRefreshToken', $user->refreshToken);\n return redirect()->route('integrations.google');\n }\n }\n }", "public function redirect (Request $request) {\n\n $provider = $request->provider;\n\n // On vérifie si le provider est autorisé\n if (in_array($provider, $this->providers)) {\n return Socialite::driver($provider)->redirect(); // On redirige vers le provider\n }\n abort(404); // Si le provider n'est pas autorisé\n }", "protected function LoginRedirect()\n {\n try\n {\n // set cookies to know where to redirect on success\n setcookie( 'AUTHURL', $this->sSuccessUrl, 0, \"/\", '.clemson.edu', false, true);\n setcookie( 'AUTHREASON', '', 0, \"/\", '.clemson.edu', false, true);\n\n // redirect to the login site\n header( 'Location: https://login.clemson.edu' );\n die();\n }\n catch( Exception $oException )\n {\n throw cAnomaly::BubbleException( $oException );\n }\n }", "public function setRedirect($url, $code = 302);" ]
[ "0.7309922", "0.72471577", "0.7214553", "0.7021612", "0.69658715", "0.6851996", "0.6820652", "0.6668452", "0.6556567", "0.65399444", "0.65146494", "0.6509719", "0.64666533", "0.6465529", "0.6461036", "0.6440911", "0.6433697", "0.6402669", "0.6402669", "0.6402669", "0.6397886", "0.63738215", "0.63634473", "0.6338307", "0.6313674", "0.62857974", "0.6242223", "0.62362784", "0.62313664", "0.62228143", "0.62117535", "0.6199133", "0.617388", "0.61678874", "0.6162679", "0.61538243", "0.6148565", "0.6147653", "0.6128429", "0.6121023", "0.6070975", "0.6069479", "0.6061314", "0.6050755", "0.6042721", "0.60321474", "0.6027119", "0.60095423", "0.600603", "0.5991013", "0.5988334", "0.5983571", "0.5983571", "0.5983571", "0.5983571", "0.5983571", "0.5983571", "0.59737", "0.5970077", "0.5963987", "0.59537244", "0.59208494", "0.5916046", "0.5914805", "0.5906259", "0.59033555", "0.59033555", "0.58925325", "0.5887839", "0.58856285", "0.586391", "0.58631307", "0.58465576", "0.58465123", "0.5845393", "0.5841087", "0.5832733", "0.5832733", "0.58258593", "0.5822309", "0.5814625", "0.58109945", "0.5797186", "0.5794183", "0.57901675", "0.57901675", "0.5786202", "0.57705957", "0.5752986", "0.5747731", "0.5741881", "0.5736488", "0.57324934", "0.5731747", "0.57215834", "0.571713", "0.57163084", "0.57151306", "0.5705998", "0.57034284" ]
0.85406005
0
Request an access token.
public function requestAccessToken() { try { $this->session->requestAccessToken($_GET['code']); return $this; } catch (Exception $e) { $this->redirectToSpotifyAuthorizeUrl(); return; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAccessToken($access_token);", "public function requestToken() {\n \n $result = $this->doRequest('v1.0/token?grant_type=1', 'GET');\n\n $this->_setToken($result->result->access_token);\n $this->_setRefreshToken($result->result->refresh_token);\n $this->_setExpireTime($result->result->expire_time);\n $this->_setUid($result->result->uid);\n\n }", "public function access_token() {\n\t\ttry {\n\t\t\tif ($this->request->is('post')) {\n\t\t\t\t$this->OAuth2Lib->grantAccessToken();\n\t\t\t}\n\t\t} catch(Exception $e) {\n\t\t\t$this->fail($e);\n\t\t}\n\t}", "private function requestToken() \n {\n $requestUrl = $this->configuration->getBaseUrl() . \"connect/token\";\n $postData = \"grant_type=client_credentials\" . \"&client_id=\" . $this->configuration->getClientId() . \"&client_secret=\" . $this->configuration->getClientSecret();\n $headers = [];\n $headers['Content-Type'] = \"application/x-www-form-urlencoded\";\n $headers['Content-Length'] = strlen($postData);\n $response = $this->client->send(new Request('POST', $requestUrl, $headers, $postData));\n $result = json_decode($response->getBody()->getContents(), true);\n $this->configuration->setAccessToken($result[\"access_token\"]);\n }", "public function getAccessToken();", "public function getAccessToken();", "public function getAccessToken();", "public function getAccessToken();", "public function getAccessToken();", "protected function request_token() {\r\n\t\t$code = $this->tmhOAuth->request(\r\n\t\t\t'POST',\r\n\t\t\t$this->tmhOAuth->url('oauth/request_token', ''),\r\n\t\t\tarray(\r\n\t\t\t\t'oauth_callback' => SocialHelper::php_self()\r\n\t\t\t)\r\n\t\t);\r\n\r\n\t\tif ($code == 200) {\r\n\t\t\t$_SESSION['oauth'] = $this->tmhOAuth->extract_params($this->tmhOAuth->response['response']);\r\n\t\t\t$this->authorize();\r\n\t\t} else {\r\n\t\t\t$this->addError();\r\n\t\t}\r\n\t}", "private function _get_access_token() {\n return $this->_http->request( \n 'POST', 'https://oauth.api.189.cn/emp/oauth2/v3/access_token',\n http_build_query( array(\n 'grant_type' => 'client_credentials',\n 'app_id' => C( 'SMS_189_KEY' ),\n 'app_secret' => C( 'SMS_189_SECRET' )\n ) ) );\n\n }", "private function _requestToken() \n {\n $requestUrl = $this->config->getHost() . \"/oauth2/token\";\n $postData = \"grant_type=client_credentials\" . \"&client_id=\" . $this->config->getAppSid() . \"&client_secret=\" . $this->config->getAppKey();\n $response = $this->client->send(new Request('POST', $requestUrl, [], $postData));\n $result = json_decode($response->getBody()->getContents(), true);\n $this->config->setAccessToken($result[\"access_token\"]);\n $this->config->setRefreshToken($result[\"refresh_token\"]);\n }", "public function request_token() {\n $this->sign_secret = $this->consumer_secret.'&';\n\n if (empty($this->oauth_callback)) {\n $params = [];\n } else {\n $params = ['oauth_callback' => $this->oauth_callback->out(false)];\n }\n\n $params = $this->prepare_oauth_parameters($this->request_token_api, $params, 'GET');\n $content = $this->http->get($this->request_token_api, $params, $this->http_options);\n // Including:\n // oauth_token\n // oauth_token_secret\n $result = $this->parse_result($content);\n if (empty($result['oauth_token'])) {\n throw new moodle_exception('oauth1requesttoken', 'core_error', '', null, $content);\n }\n // Build oauth authorize url.\n $result['authorize_url'] = $this->authorize_url . '?oauth_token='.$result['oauth_token'];\n\n return $result;\n }", "public function retrieveAccessToken() {\n\n $helper = Api::getInstance();\n $helper->retrieveAccessToken();\n\n $this->output()->writeln('Done');\n }", "abstract public function url_access_token();", "public function fetch_access_token(&$request) {\n $this->get_version($request);\n\n $consumer = $this->get_consumer($request);\n\n // requires authorized request token\n $token = $this->get_token($request, $consumer, \"request\");\n\n $this->check_signature($request, $consumer, $token);\n\n // Rev A change\n $verifier = $request->get_parameter('oauth_verifier');\n $new_token = $this->data_store->new_access_token($token, $consumer, $verifier);\n\n return $new_token;\n }", "public function loadAccessToken()\n {\n $this->setHeader(self::HEADER_TYPE_BASIC, self::TOKEN_HEADER);\n\n $curl = new Curl;\n\n $opt = [\n 'grant_type' => $this->grant,\n 'username' => $this->username,\n 'password' => $this->password,\n 'scope' => $this->scope\n ];\n\n $token = $curl->post(self::BASE_API_URL.self::TOKEN_END_POINT, $opt, $this->getHeader());\n\n $this->saveAccessToken($token);\n }", "public function accessToken($bypassNonce = false) {\n\t\t$result = $this->verify('request', $bypassNonce);\n\n\t\t// Optional TTL\n\t\t$options = array();\n\t\t$ttl = $this->getParam(self::XOAUTH_TOKEN_TTL, true);\n\t\tif($ttl) {\n\t\t\t$options['token_ttl'] = $ttl;\n\t\t}\n\n\t\t$verifier = $this->getParam(self::OAUTH_VERIFIER, true);\n\t\tif($verifier) {\n\t\t\t$options['verifier'] = $verifier;\n\t\t}\n\n\t\t$options['callback_url'] = isset($result['callback_url']) ? $result['callback_url'] : null;\n\t\t$options['referer_url'] = isset($result['referer_url']) ? $result['referer_url'] : null;\n\n\t\t// Exchange request token for an access token\n\t\tif(! isset($this->storages['request_token'])) {\n\t\t\tthrow new \\RuntimeException(\n\t\t\t\t'You must supply a storage object implementing ' .\n\t\t\t\t\t $this->storageMap['request_token']);\n\t\t}\n\n\t\tif(! isset($this->storages['access_token'])) {\n\t\t\tthrow new \\RuntimeException(\n\t\t\t\t'You must supply a storage object implementing ' .\n\t\t\t\t\t $this->storageMap['access_token']);\n\t\t}\n\n\t\t// Should have a transaction here?\n\t\t$accessToken = $this->storages['access_token']->createAccessToken(\n\t\t\t$result['consumer_key'], $result['username'], $options);\n\t\tif(! $accessToken) {\n\t\t\tthrow new \\RuntimeException(\n\t\t\t\t'Cannot create new access token for ' . json_encode($result));\n\t\t}\n\n\t\t// Delete request token here\n\t\t$this->storages['access_token']->deleteRequestToken($result['token']);\n\n\t\t$data = [];\n\t\t$data[self::OAUTH_TOKEN] = Rfc3986::urlEncode($accessToken['token']);\n\t\t$data[self::OAUTH_TOKEN_SECRET] = Rfc3986::urlEncode($accessToken['token_secret']);\n\t\t$data[self::OAUTH_CALLBACK_CONFIRMED] = 1;\n\n\t\tif(! empty($accessToken['expires_at']) && is_numeric($accessToken['expires_at'])) {\n\t\t\t$expiresAt = Carbon::createFromTimestamp(intval($accessToken['expires_at']));\n\n\t\t\t$data[self::XOAUTH_TOKEN_TTL] = $expiresAt->diffInSeconds();\n\t\t}\n\n\t\treturn $data;\n\t}", "public static function set_token_access() {\n if (SesLibrary::_get('_uuid') || SesLibrary::_get('_uuid') == null) {\n $param = [\n 'uri' => config('app.base_api_uri') . '/generate-token-access?deviceid=' . SesLibrary::_get('_uuid'),\n 'method' => 'GET'\n ];\n $this->__init_request_api($param);\n }\n }", "public function requestToken($code) {\n $client = new Zend_Http_Client();\n $queryParams = array(\n 'client_id' => self::CLIENT_ID,\n 'client_secret' => self::CLIENT_SECRET,\n 'grant_type' => 'authorization_code',\n 'redirect_uri' => self::getAbsoluteUrl(array(\n 'controller' => 'oauth',\n 'action' => 'callback',\n 'service' => self::TYPE\n )),\n 'code' => $code\n );\n $client->setUri(self::OAUTH_CALLBACK);\n $client->setParameterGet($queryParams);\n\n try {\n $response = $client->request();\n } catch (Zend_Http_Client_Exception $e) { // timeout or host not accessible\n return;\n }\n\n // error in response\n if ($response->isError()) {\n return;\n }\n\n $result = Zend_Json::decode($response->getBody());\n if (isset($result['access_token'])) {\n $token = $result['access_token'];\n return $token;\n }\n return;\n }", "public function getAccessToken()\n {\n return $this->get(self::_ACCESS_TOKEN);\n }", "public function requestAccessToken($code)\n {\n $this->validateClientGrantState();\n /**\n * curl -F grant_type=authorization_code \\\n -F client_id=CLIENT_ID \\\n -F client_secret=CLIENT_SECRET \\\n -F code=AUTHORIZATION_CODE_FROM_REDIRECT \\\n -F redirect_uri=REDIRECT_URI \\\n -X POST https://api.rightsignature.com/oauth/token\n */\n $grantRequest = OauthCodeRequest::createAuthRequest($this->clientId, $this->clientSecret, $this->redirectUri);\n\n $grantRequest->setCode($code);\n\n $uri = $this->getFullTokenUri();\n $formData = $grantRequest->getFormData('access');\n\n return $this->guzzleClient->post($uri, [\n 'json' => $formData,\n ]);\n }", "public function get_request_token($accid) {\n // Get a request token from the appliance\n $url = $this->appliance_url . \"/api/request_token.php\";\n $result = $this->call($url, array());\n // dbg(\"Received request token $result\");\n $req_token = array();\n parse_str($result,$req_token);\n\n if(!isset($req_token['oauth_token'])) {\n //error_log(\"Failed to retrieve request token from \".$url.\" result = \".$result);\n throw new Exception(\"Unable to retrieve request token\");\n }\n $token = new OAuthToken($req_token['oauth_token'], $req_token['oauth_token_secret']);\n return $token;\n }", "public function GetClientAccessToken($request)\n {\n return $this->makeRequest(__FUNCTION__, $request);\n }", "public static function acquire_token() {\n\n\t\t\n\n\t\t$response = skydrive_tokenstore::get_tokens_from_store();\n\n\t\tif (empty($response['access_token'])) {\t// No token at all, needs to go through login flow. Return false to indicate this.\n\n\t\t\treturn false;\n\n\t\t\texit;\n\n\t\t} else {\n\n\t\t\tif (time() > (int)$response['access_token_expires']) { // Token needs refreshing. Refresh it and then return the new one.\n\n\t\t\t\t$refreshed = skydrive_auth::refresh_oauth_token($response['refresh_token']);\n\n\t\t\t\tif (skydrive_tokenstore::save_tokens_to_store($refreshed)) {\n\n\t\t\t\t\t$newtokens = skydrive_tokenstore::get_tokens_from_store();\n\n\t\t\t\t\treturn $newtokens['access_token'];\n\n\t\t\t\t}\n\n\t\t\t\texit;\n\n\t\t\t} else {\n\n\t\t\t\treturn $response['access_token']; // Token currently valid. Return it.\n\n\t\t\t\texit;\n\n\t\t\t}\n\n\t\t}\n\n\t}", "function ExchangeRequestForAccess()\n{\n $consumer_key = $_GET['consumer_key'];\n $oauth_token = $_GET['oauth_token'];\n $user_id = $_GET['usr_id'];\n\n try\n {\n OAuthRequester::requestAccessToken($consumer_key, $oauth_token, $user_id);\n }\n catch (OAuthException $e)\n {\n // Something wrong with the oauth_token.\n // Could be:\n // 1. Was already ok\n // 2. We were not authorized\n die($e->getMessage());\n }\n \n echo 'Authorization Given. <a href=\"index.php?action=Request\">Click to make a signed request</a>.';\n}", "private static function generate_access_token()\n {\n $url = 'https://' . env('MPESA_SUBDOMAIN') . '.safaricom.co.ke/oauth/v1/generate?grant_type=client_credentials';\n\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n $credentials = base64_encode(env('MPESA_CONSUMER_KEY') . ':' . env('MPESA_CONSUMER_SECRET'));\n curl_setopt($curl, CURLOPT_HTTPHEADER, array('Authorization: Basic ' . $credentials)); //setting a custom header\n curl_setopt($curl, CURLOPT_HEADER, false);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n\n $curl_response = curl_exec($curl);\n\n return json_decode($curl_response)->access_token;\n }", "public function fetch_access_token($options){\n\n if (!isset($options['redirect_uri'])) {\n throw new GoCardless_ArgumentsException('redirect_uri required');\n }\n\n $path = '/oauth/access_token';\n\n $options['http_authorization'] = $this->account_details['app_id'] . ':' . $this->account_details['app_secret'];\n\n $response = $this->request('post', $path, $options);\n\n $merchant = explode(':', $response['scope']);\n $merchant_id = $merchant[1];\n $access_token = $response['access_token'];\n\n $return = array(\n 'merchant_id' => $merchant_id,\n 'access_token' => $access_token\n );\n\n return $return;\n\n }", "static function requestAccessToken($consumer_key, $token, $usr_id, $method = 'POST', $options = array(), $curl_options = array())\n {\n OAuthRequestLogger::start();\n\n $store = OAuthStore::instance();\n $r = $store->getServerTokenSecrets($consumer_key, $token, 'request', $usr_id);\n $uri = $r['access_token_uri'];\n $token_name = $r['token_name'];\n\n // Delete the server request token, this one was for one use only\n $store->deleteServerToken($consumer_key, $r['token'], 0, true);\n\n // Try to exchange our request token for an access token\n $oauth = new OAuthRequester($uri, $method);\n\n if (isset($options['oauth_verifier'])) {\n $oauth->setParam('oauth_verifier', $options['oauth_verifier']);\n }\n if (isset($options['token_ttl']) && is_numeric($options['token_ttl'])) {\n $oauth->setParam('xoauth_token_ttl', intval($options['token_ttl']));\n }\n\n OAuthRequestLogger::setRequestObject($oauth);\n\n $oauth->sign($usr_id, $r, '', 'accessToken');\n $text = $oauth->curl_raw($curl_options);\n if (empty($text)) {\n throw new OAuthException2('No answer from the server \"' . $uri . '\" while requesting an access token');\n }\n $data = $oauth->curl_parse($text);\n\n if (!in_array((int)$data['code'], array(200, 201, 301, 302))) // patch for xing api\n {\n throw new OAuthException2('Unexpected result from the server \"' . $uri . '\" (' . $data['code'] . ') while requesting an access token');\n }\n\n $token = array();\n $params = explode('&', $data['body']);\n foreach ($params as $p)\n {\n @list($name, $value) = explode('=', $p, 2);\n $token[$oauth->urldecode($name)] = $oauth->urldecode($value);\n }\n\n if (!empty($token['oauth_token']) && !empty($token['oauth_token_secret'])) {\n $opts = array();\n $opts['name'] = $token_name;\n if (isset($token['xoauth_token_ttl'])) {\n $opts['token_ttl'] = $token['xoauth_token_ttl'];\n }\n $store->addServerToken($consumer_key, 'access', $token['oauth_token'], $token['oauth_token_secret'], $usr_id, $opts);\n }\n else\n {\n throw new OAuthException2('The server \"' . $uri . '\" did not return the oauth_token or the oauth_token_secret');\n }\n\n OAuthRequestLogger::flush();\n\n return $data; // patch for xing api\n }", "public function getAccessToken()\n\t{\n\t\tif ($this->makeRequest())\n\t\t{\n\t\t\tif ($token = isset($this->getJson()->access_token) ? $this->getJson()->access_token : null) {\n\t\t\t\treturn $token;\n\t\t\t}\n\t\t}\n\t}", "public function getToken()\n {\n $params = array(\n 'client_id' => $this->client_id,\n 'client_secret' => $this->client_secret,\n 'code' => $this->code,\n 'redirect_uri' => $this->redirect_uri\n );\n $res = $this->getRequest('oauth/access_token',$params);\n //$token = $res['access_token'];\n return $this->res = $res;\n\n\n }", "public function getAccessToken()\n\t{\n\t\tif(!$this->hasAccessToken()){\n\t\t\t//reset all the parameters\n\t\t\t$this->resetParams();\n\t\t\t\n\t\t\t//set the returned token\n\t\t\t$this->setParam('token', $this->getRequestToken()->getToken());\n\t\t\t\n\t\t\t//build the signiture\n\t\t\t$this->setSecret($this->getRequestToken()->getTokenSecret());\n\t\t\t$this->setRequestUrl($this->_accessTokenUrl);\n\t\t\t$this->_buildSignature();\n\t\t\t\n\t\t\t//get the response\n\t\t\t$response = $this->_send($this->_accessTokenUrl)->getBody();\n\t\t\t\n\t\t\t//format the response\n\t\t\t$responseVars = array();\n\t\t\tparse_str($response, $responseVars);\n\t\t\t$response = new BaseOAuthResponse($responseVars);\n\t\t\t$this->setAccessToken($response);\n\t\t}\n\t\treturn $this->getData('access_token');\n\t}", "abstract public function queryAccessToken();", "private function __get_access_token() {\r\n // Access token exists in a cookie\r\n if($_COOKIE[ACCESS_TOKEN_COOKIE_NAME]) {\r\n parse_str($_COOKIE[ACCESS_TOKEN_COOKIE_NAME], $tok); \r\n return $tok;\r\n }\r\n\r\n // Handling a redirect back from login\r\n else if($_COOKIE[REQUEST_TOKEN_COOKIE_NAME] && $_REQUEST['oauth_verifier'] && $_REQUEST['oauth_token']) {\r\n $tok = YMClient::oauth_token_from_query_string($_COOKIE[REQUEST_TOKEN_COOKIE_NAME]);\r\n\r\n if($tok['oauth_token'] != $_REQUEST['oauth_token']) {\r\n throw new Exception(\"Cookie and URL disagree about request token value\");\r\n }\r\n\r\n $tok['oauth_verifier'] = $_REQUEST['oauth_verifier']; \r\n $newtok = $this->ymc->oauth_get_access_token($tok);\r\n\r\n setcookie(REQUEST_TOKEN_COOKIE_NAME, \"\", time()-3600);\r\n setcookie(ACCESS_TOKEN_COOKIE_NAME, YMClient::oauth_token_to_query_string($newtok));\r\n return $newtok;\r\n }\r\n\r\n // Sending the user to login to grant access to this app\r\n else {\r\n list ($tok, $url) = $this->ymc->oauth_get_request_token($this->callbackURL);\r\n setcookie(REQUEST_TOKEN_COOKIE_NAME, YMClient::oauth_token_to_query_string($tok));\r\n header(\"Location: $url\");\r\n }\r\n }", "public function get_access_token($oauth_token, $oauth_addon);", "protected function requestAnOAuthAccessToken($oauth, &$accessToken) {\n\t\t$url = $this->getTokenEndpoint();\n\t\t$options = [\n\t\t\t'resource' => 'OAuth access token',\n\t\t];\n\t\t$method = strtoupper($this->strategy->getTokenRequestMethod());\n\t\tswitch ($method) {\n\t\t\tcase 'GET':\n\t\t\t\tbreak;\n\t\t\tcase 'POST':\n\t\t\t\t$options['post_data_in_uri'] = true;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new OAuthClientException($method . ' is not a supported method to request tokens');\n\t\t}\n\t\tif (($response = $this->sendOAuthRequest($url, $method, [], $options, $oauth)) === false) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!isset($response['oauth_token']) || !isset($response['oauth_token_secret'])) {\n\t\t\tthrow new OAuthClientAuthorizationException('it was not returned the access token and secret');\n\t\t}\n\t\t$accessToken = [\n\t\t\t'value' => $response['oauth_token'],\n\t\t\t'secret' => $response['oauth_token_secret'],\n\t\t\t'authorized' => true\n\t\t];\n\t\tif (isset($response['oauth_expires_in']) && $response['oauth_expires_in'] == 0) {\n\t\t\t$this->trace('Ignoring access token expiry set to 0');\n\t\t\t$this->setAccessTokenExpiry('');\n\t\t} elseif (isset($response['oauth_expires_in'])) {\n\t\t\t$expires = $response['oauth_expires_in'];\n\t\t\tif (strval($expires) !== strval(intval($expires)) || $expires <= 0) {\n\t\t\t\tthrow new OAuthClientException('OAuth provider did not return a supported type of access token expiry time');\n\t\t\t}\n\t\t\t$this->setAccessTokenExpiry(gmstrftime('%Y-%m-%d %H:%M:%S', $this->getResponseTime() + $expires));\n\t\t\t$this->trace('Access token expiry: ' . $this->getAccessTokenExpiry() . ' UTC');\n\t\t\t$accessToken['expiry'] = $this->getAccessTokenExpiry();\n\t\t} else {\n\t\t\t$this->setAccessTokenExpiry('');\n\t\t}\n\t\tif (isset($response['oauth_session_handle'])) {\n\t\t\t$accessToken['refresh'] = $response['oauth_session_handle'];\n\t\t\t$this->trace('Refresh token: ' . $accessToken['refresh']);\n\t\t}\n\t\treturn $this->storage->storeAccessToken($accessToken);\n\t}", "protected function getAccessToken()\n\t{\n\t\t$app = JFactory::getApplication();\n\t\t$params = $this->getParams();\n\t\t$consumerKey = $params->get('oauth_consumer_key');\n\t\t$session = JFactory::getSession();\n\t\t$oauthToken = $app->input->get('oauth_token', '', 'string');\n\t\ttry\n\t\t{\n\t\t\t//$_GET['http_error_codes'] = array(200, 201, 301, 302);\n\n\t\t\t$curlOpts = $this->getOAuthCurlOpts();\n\t\t\t$result = XingOAuthRequester::requestAccessToken($consumerKey, $oauthToken, 0, 'POST', $_GET, $curlOpts);\n\t\t\t//$result = OAuthRequester::requestAccessToken($consumerKey, $oauthToken, 0, 'POST', $_GET, $curlOpts);\n\t\t}\n\t\tcatch (OAuthException2 $e)\n\t\t{\n\t\t\techo \"<h1>get access token error</h1>\";\n\t\t\techo \"<pre>restult...\";print_r($result);echo \"</pre>\";\n\t\t\tprint_r($e->getMessage());\n\t\t\treturn false;\n\t\t}\n\t\treturn $result;\n\t}", "function getAccessToken($token) {\n $this->getToken(\"grant_type=authorization_code&code=$token&redirect_uri=\" . urlencode($this->redirectUri));\n }", "protected function getAccessToken()\n {\n return $this->access_token->getToken();\n }", "public function request_token() : object\n {\n $this->parameters = [\n 'headers' => [\n 'Content-Type' => 'application/x-www-form-urlencoded',\n 'User-Agent' => $this->config['DISCOGS_USER_AGENT'],\n 'Authorization' => 'OAuth oauth_consumer_key=' . $this->config['DISCOGS_CONSUMER_KEY']\n . ',oauth_nonce=' . time() . ',oauth_signature=' . $this->config['DISCOGS_CONSUMER_SECRET']\n . '&,oauth_signature_method=PLAINTEXT,oauth_timestamp=' . time() . ',oauth_callback='\n . $this->config['OAUTH_CALLBACK'],\n ],\n ];\n\n return $this->response('GET', \"/oauth/request_token\");\n }", "public function token() {\n\t\t$this->autoRender = false;\n\t\t$this->OAuth->setVariable('access_token_lifetime', 60);\n\t\ttry {\n\t\t\t$this->OAuth->grantAccessToken();\n\t\t} catch (OAuth2ServerException $e) {\n\t\t\t$e->sendHttpResponse();\n\t\t}\n\t}", "public function requestAccessToken(string $code)\n {\n try {\n // Send post request to api/token end point to exchange provided code for access token.\n $response = $this->client->post(self::ACCOUNT_URL.'/api/token', [\n 'headers' => [\n 'Authorization' => 'Basic '.base64_encode($this->clientId.':'.$this->clientSecret),\n 'Accept' => 'application/json',\n ],\n 'form_params' => [\n 'grant_type' => 'authorization_code',\n 'code' => $code,\n 'redirect_uri' => $this->redirectUrl,\n ],\n ]);\n\n // Encode response as json object.\n $response = json_decode($response->getBody(), false);\n\n $this->updateSession($response);\n\n return $response;\n } catch (RequestException $exception) {\n throw new SpotifyAuthException($exception->getMessage(), $exception->getCode());\n }\n }", "public function actionAccesstoken()\n {\n $authParam = Yii::$app->getRequest()->getBodyParam('auth');\n \n if (!$authParam) {\n throw new NotFoundHttpException(\"There's no authorization code provided.\");\n }\n \n $model = Customer::find()->where(['auth_code' => $authParam])->andWhere(['>', 'auth_expired', time()])->one();\n \n if ($model === null) {\n throw new NotFoundHttpException(\"Invalid authorization code.\");\n }\n \n $model->token_code = md5(uniqid());\n $model->token_expired = time() + (60 * 60 * 24 * 60); // 60 days\n $model->save(false);\n \n $data = [\n 'access_token' => $model->token_code,\n 'expired_at' => $model->tokenExpired\n ];\n \n return $data;\n }", "protected function getAccessToken($oauth_token) {\n\n\t}", "private function getAccessToken() {\n\n // set the request token and secret we have stored\n $this->tmhOAuth->config['user_token'] = $_SESSION['authtoken'];\n $this->tmhOAuth->config['user_secret'] = $_SESSION['authsecret'];\n\n\n // send request for an access token\n $this->tmhOAuth->request('POST', $this->tmhOAuth->url('oauth/access_token', ''), array(\n\n // pass the oauth_verifier received from Twitter\n 'oauth_verifier' => $_GET['oauth_verifier']\n ));\n\n\n\n if($this->tmhOAuth->response['code'] == 200) {\n\n // get the access token and store it in a cookie\n $response = $this->tmhOAuth->extract_params($this->tmhOAuth->response['response']);\n setcookie('access_token', $response['oauth_token'], time()+3600*24*30);\n setcookie('access_token_secret', $response['oauth_token_secret'], time()+3600*24*30);\n\n // state is now 2\n $_SESSION['authstate'] = 2;\n\n // redirect user to clear leftover GET variables\n header('Location: ' . $this->tmhOAuth->php_self());\n\n exit;\n }\n\n return false;\n }", "public function getAccessToken()\n {\n return $this->request->getAccessToken();\n }", "private function ga_auth_get_access_token( $access_code ) {\n\t\t$request = array(\n\t\t\t'code' => $access_code,\n\t\t\t'grant_type' => 'authorization_code',\n\t\t\t'redirect_uri' => $this->get_redirect_uri(),\n\t\t\t'client_id' => $this->config['client_id'],\n\t\t\t'client_secret' => $this->config['client_secret']\n\t\t);\n\n\t\t$response = Ga_Lib_Api_Request::get_instance()->make_request( self::OAUTH2_TOKEN_ENDPOINT, $request );\n\n\t\treturn new Ga_Lib_Api_Response( $response );\n\t}", "public function getAccessToken()\n\t{\n\t\treturn $this->client->getAccessToken();\n\t}", "public function getAccessToken()\n {\n return $this->client->getAccessToken();\n }", "protected function access_token() {\r\n\r\n\t\t$this->tmhOAuth->config['user_token'] = $_SESSION['oauth']['oauth_token'];\r\n\t\t$this->tmhOAuth->config['user_secret'] = $_SESSION['oauth']['oauth_token_secret'];\r\n\r\n\t\t$code = $this->tmhOAuth->request(\r\n\t\t\t'POST',\r\n\t\t\t$this->tmhOAuth->url('oauth/access_token', ''),\r\n\t\t\tarray(\r\n\t\t\t\t'oauth_verifier' => $_REQUEST['oauth_verifier']\r\n\t\t\t)\r\n\t\t);\r\n\r\n\t\tif ($code == 200) {\r\n\t\t\t$token = $this->tmhOAuth->extract_params($this->tmhOAuth->response['response']);\r\n\t\t\t$this->conf->TwitterOAuthToken = $token['oauth_token'];\r\n\t\t\t$this->conf->TwitterOAuthSecret = $token['oauth_token_secret'];\r\n\t\t\t$this->conf->TwitterUsername = $token['screen_name'];\r\n\t\t\t$this->conf->write();\r\n\t\t\tunset($_SESSION['oauth']);\r\n\t\t\theader('Location: ' . SocialHelper::php_self());\r\n\t\t} else {\r\n\t\t\t$this->addError();\r\n\t\t}\r\n\t}", "public function getAccessToken()\n {\n // maybe the token will expire in next 10 seconds\n $expiryCutoff = new \\DateTime('+10 seconds');\n\n // if the token expires try to reauthenticate\n if (!$this->accessToken or $this->getExpires() < $expiryCutoff->getTimestamp()) {\n $this->authenticate();\n }\n\n return $this->accessToken->getToken();\n }", "public function getAccessTokenFromClientCredentials(): AccessToken;", "public function getAccessToken()\n {\n return $this->getQuery('accesstoken');\n }", "public function access_token(array $results) {\n\t\tif(!array_key_exists(\"oauth_token\", $results) ||\n\t\t !array_key_exists(\"oauth_token_secret\", $results) ||\n\t\t !array_key_exists(\"oauth_verifier\", $results) )\n\t\t {\n\t\t \tthrow new Kanedo_Readability_Exception('wrong parameter');\n\t\t }\n\t\t \n\t\t$token = new OAuthToken($results['oauth_token'], $results['oauth_token_secret']);\n\t\t$req = OAuthRequest::from_consumer_and_token(\n\t\t\t\t\t$this->oauth_consumer, \n\t\t\t\t\t$token, \n\t\t\t\t\t'GET',\n\t\t\t\t\t$this->e_access, \n\t\t\t\t\tarray('oauth_verifier' => $results['oauth_verifier'])\n\t\t\t\t);\n\t\t$req->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $this->oauth_consumer, $token);\n\t\ttry{\n\t\t\t$result = $this->makeHTTPRequest($req->to_url());\n\t\t}catch (Kanedo_Readability_Exception $e) {\n\t\t\t$this->error = $e->getMessage();\n\t\t\t$this->errnr = $e->getCode();\n\t\t\treturn false;\n\t\t}\n\t\t$token_credencials = ($this->parseUrlQuery($result));\n\t\treturn $this->access_token = new OAuthToken($token_credencials['oauth_token'], $token_credencials['oauth_token_secret']);\n\t}", "public function requestToken() {\n\t\t$this->verify(false);\n\n\t\t// Optional TTL\n\t\t$options = array();\n\t\t$ttl = $this->getParam(self::XOAUTH_TOKEN_TTL, false);\n\t\tif($ttl) {\n\t\t\t$options['token_ttl'] = $ttl;\n\t\t}\n\n\t\t// 1.0a Compatibility : associate callback url to the request token\n\t\t$callbackUrl = $this->getParam(self::OAUTH_CALLBACK, true);\n\t\tif($callbackUrl) {\n\t\t\t$options['callback_url'] = $callbackUrl;\n\t\t}\n\n\t\t// Create a request token\n\t\t$consumerKey = $this->getParam(self::OAUTH_CONSUMER_KEY, true);\n\n\t\tif(! isset($this->storages['request_token'])) {\n\t\t\tthrow new \\RuntimeException(\n\t\t\t\t'You must supply a storage object implementing ' .\n\t\t\t\t\t $this->storageMap['request_token']);\n\t\t}\n\n\t\t// MUST be included with an empty value to indicate this is a two-legged request.\n\t\t$is2Legged = $this->getParam(self::OAUTH_CALLBACK) === '';\n\t\tif($is2Legged) {\n\t\t\t// Create pre-authorized request token\n\t\t}\n\n\t\t$requestToken = $this->storages['request_token']->createRequestToken($consumerKey,\n\t\t\t$options);\n\n\t\t$data = [];\n\t\t$data[self::OAUTH_TOKEN] = Rfc3986::urlEncode($requestToken['token']);\n\t\t$data[self::OAUTH_TOKEN_SECRET] = Rfc3986::urlEncode(\n\t\t\t$requestToken['token_secret']);\n\t\t$data[self::OAUTH_CALLBACK_CONFIRMED] = '1';\n\n\t\tif(! empty($requestToken['expires_at']) && is_numeric($requestToken['expires_at'])) {\n\t\t\t$expiresAt = Carbon::createFromTimestamp(intval($requestToken['expires_at']));\n\n\t\t\t$data[self::XOAUTH_TOKEN_TTL] = $expiresAt->diffInSeconds();\n\t\t}\n\n\t\treturn $data;\n\t}", "public function fetchAccessToken() {\n if (!isset($_SESSION['ACCESS_TOKEN'])) {\n if (!empty($_GET) && isset($_SESSION['REQUEST_TOKEN'])) {\n return parent::getAccessToken(\n $_GET, unserialize($_SESSION['REQUEST_TOKEN']));\n }\n }\n return null;\n }", "public function refreshAccessToken(): AccessToken;", "public function getAuthorizationCode()\n {\n $oauth_param = array(\n 'grant_type' => $this->grant_type, \n 'client_id' => config::$clientId,\n 'client_secret' => config::$secretKey,\n 'scope' => implode(',', $this->scope));\n\n $url = config::$apiUrl . 'oauth/access_token';\n $response = $this->curl->request('post', $url, $oauth_param);\n\n if( $response )\n {\n $res = json_decode($response);\n if( isset($res->access_token) )\n {\n $this->setExpiresAtFromTimeStamp($res->expires);\n $this->session->write('access_token',$res->access_token);\n $this->session->write('expires', $this->expiresAt);\n\n $read = $this->session->read('access_token');\n session_write_close();\n }\n elseif( isset($res->error) )\n {\n die($response);\n }\n }\n }", "public function token() {\r\n\t\t\r\n\t\t$response = $this->OAuth2->getAccessTokenData();\r\n\t\t\r\n\t\tif (empty($response)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t$this->set($response);\r\n\t\t\r\n\t}", "public function run()\n {\n GrantType::checkGrantType(Yii::$app->request->post('grant_type'), GrantType::GRANT_TYPE_AUTHORIZATION_CODE);\n Client::checkClientSecret(Client::checkClientId(Yii::$app->request->post('client_id')), Yii::$app->request->post('client_secret'));\n AuthorizationCode::checkAuthorizationCode(Yii::$app->request->post('code'), Yii::$app->request->post('redirect_uri'));\n\n return AccessToken::createAccessToken(Yii::$app->request->post('client_id'), Yii::$app->request->post('code'));\n }", "public function requestToken($code)\n {\n $parameters = [\n 'client_id' => config('twitch-api.client_id'),\n 'client_secret' => config('twitch-api.client_secret'),\n 'redirect_uri' => config('twitch-api.redirect_url'),\n 'code' => $code,\n 'grant_type' => 'authorization_code'\n ];\n\n try {\n $client = new Client();\n $response = $client->post(config('twitch-api.api_url') . '/kraken/oauth2/token?api_version=5', ['body' => $parameters]);\n $response = json_decode($response->getBody()->getContents(), true);\n if (isset($response['access_token'])) {\n return $response['access_token'];\n }\n\n } catch (\\Exception $e) {\n\n throw $e;\n }\n }", "public function getAccessToken() {\n return $this->authenticate();\n }", "public function get_access_token()\n\t\t{\n\t\t\tif(isset($_COOKIE['bing_access_token']))\n\t\t\t\treturn $_COOKIE['bing_access_token'];\n\t\t\n\t\t\t// Get a 10-minute access token for Microsoft Translator API.\n\t\t\t$url = 'https://datamarket.accesscontrol.windows.net/v2/OAuth2-13';\n\t\t\t$postParams = 'grant_type=client_credentials&client_id='.urlencode($this->clientID).\n\t\t\t'&client_secret='.urlencode($this->clientSecret).'&scope=http://api.microsofttranslator.com';\n\t\t\t\n\t\t\t$ch = curl_init();\n\t\t\tcurl_setopt($ch, CURLOPT_URL, $url); \n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $postParams);\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); \n\t\t\t$rsp = curl_exec($ch); \n\t\t\t$rsp = json_decode($rsp);\n\t\t\t$access_token = $rsp->access_token;\n\t\t\t\n\t\t\tsetcookie('bing_access_token', $access_token, $rsp->expires_in);\n\t\t\t\n\t\t\treturn $access_token;\n\t\t}", "public function access($code, $options = array())\n\t{\n\t\t$params = array(\n\t\t\t'client_id' \t=> $this->client_id,\n\t\t\t'client_secret' => $this->client_secret,\n\t\t\t'grant_type' \t=> isset($options['grant_type']) ? $options['grant_type'] : 'authorization_code',\n\t\t);\n\t\t\n\t\t$params = array_merge($params, $this->params);\n\n\t\tswitch ($params['grant_type'])\n\t\t{\n\t\t\tcase 'authorization_code':\n\t\t\t\t$params['code'] = $code;\n\t\t\t\t$params['redirect_uri'] = isset($options['redirect_uri']) ? $options['redirect_uri'] : $this->redirect_uri;\n\t\t\tbreak;\n\n\t\t\tcase 'refresh_token':\n\t\t\t\t$params['refresh_token'] = $code;\n\t\t\tbreak;\n\t\t}\n\n\t\t$response = null;\n\t\t$url = $this->url_access_token();\n\n\t\tswitch ($this->method)\n\t\t{\n\t\t\tcase 'GET':\n\n\t\t\t\t// Need to switch to Request library, but need to test it on one that works\n\t\t\t\t$url .= '?'.http_build_query($params);\n\t\t\t\t$response = file_get_contents($url);\n\n\t\t\t\tparse_str($response, $return);\n\n\t\t\tbreak;\n\n\t\t\tcase 'POST':\n\n\t\t\t\t/* \t$ci = get_instance();\n\n\t\t\t\t$ci->load->spark('curl/1.2.1');\n\n\t\t\t\t$ci->curl\n\t\t\t\t\t->create($url)\n\t\t\t\t\t->post($params, array('failonerror' => false));\n\n\t\t\t\t$response = $ci->curl->execute();\n\t\t\t\t*/\n\n\t\t\t\t$opts = array(\n\t\t\t\t\t'http' => array(\n\t\t\t\t\t\t'method' => 'POST',\n\t\t\t\t\t\t'header' => 'Content-type: application/x-www-form-urlencoded',\n\t\t\t\t\t\t'content' => http_build_query($params),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\tif(EXTERNAL_API_PROXY) {\n\t\t\t\t\t$opts['http']['proxy'] = EXTERNAL_API_PROXY_URL . ':' . EXTERNAL_API_PROXY_PORT;\n\t\t\t\t\t$opts['http']['request_fulluri'] = true;\n\t\t\t\t}\n\n\t\t\t\t$_default_opts = stream_context_get_params(stream_context_get_default());\n\t\t\t\t$context = stream_context_create(array_merge_recursive($_default_opts['options'], $opts));\n\t\t\t\t$response = file_get_contents($url, false, $context);\n\n\t\t\t\t$return = json_decode($response, true);\n\n\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new OutOfBoundsException(\"Method '{$this->method}' must be either GET or POST\");\n\t\t}\n\n\t\tif ( ! empty($return['error']))\n\t\t{\n\t\t\tthrow new OAuth2_Exception($return);\n\t\t}\n\t\t\n\t\tswitch ($params['grant_type'])\n\t\t{\n\t\t\tcase 'authorization_code':\n\t\t\t\treturn OAuth2_Token::factory('access', $return);\n\t\t\tbreak;\n\n\t\t\tcase 'refresh_token':\n\t\t\t\treturn OAuth2_Token::factory('refresh', $return);\n\t\t\tbreak;\n\t\t}\n\t\t\n\t}", "public function getAccessToken()\n {\n if (!is_null($this->accessToken)) {\n return $this->accessToken;\n } else {\n if (empty($this->clientId) || empty($this->clientSecret)) {\n throw new RuntimeException('Client ID and Client Secret are required to request a new access token.');\n }\n\n $data = [\n 'client_id' => $this->clientId,\n 'client_secret' => $this->clientSecret,\n 'grant_type' => 'client_credentials'\n ];\n\n $response = $this->client->post(\n '/oauth/token',\n $data,\n ['form' => true]\n );\n\n if ($response->getStatusCode() !== 200) {\n throw new MercadoPagoException($response->get('message'), $response->getStatusCode());\n }\n\n $this->accessToken = $response->get('access_token');\n\n return $this->accessToken;\n }\n }", "function GetAccessToken()\r\n {\r\n return $this->Rest->GetAccessToken();\r\n }", "public function getAccessToken( $force_new = false );", "public function gettoken()\n{\n if (isset($_GET['code'])) {\n // Check that state matches\n if (isset($_GET['state']) && isset($_SESSION['oauth_state'])) {\n if (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth_state'])) {\n exit('State provided in redirect does not match expected value.');\n } \n // Clear saved state\n unset($_SESSION['oauth_state']); \n }\n\n // Initialize the OAuth client\n $oauthClient = new \\League\\OAuth2\\Client\\Provider\\GenericProvider([\n 'clientId' => $this->config->item('OAUTH_APP_ID'),\n 'clientSecret' => $this->config->item('OAUTH_APP_PASSWORD'),\n 'redirectUri' => $this->config->item('OAUTH_REDIRECT_URI'),\n 'urlAuthorize' => $this->config->item('OAUTH_AUTHORITY').$this->config->item('OAUTH_AUTHORIZE_ENDPOINT'),\n 'urlAccessToken' => $this->config->item('OAUTH_AUTHORITY').$this->config->item('OAUTH_TOKEN_ENDPOINT'),\n 'urlResourceOwnerDetails' => '',\n 'scopes' => $this->config->item('OAUTH_SCOPES')\n ]);\n\n try {\n\n // Make the token request\n $accessToken = $oauthClient->getAccessToken('authorization_code', [\n 'code' => $_GET['code']\n ]);\n\n //echo 'Access token: '.$accessToken->getToken();\n return $accessToken->getToken();\n }\n catch (League\\OAuth2\\Client\\Provider\\Exception\\IdentityProviderException $e) {\n exit('ERROR getting tokens: '.$e->getMessage());\n }\n exit();\n }\n elseif (isset($_GET['error'])) {\n exit('ERROR: '.$_GET['error'].' - '.$_GET['error_description']);\n }\n}", "protected function getAccessToken()\n {\n return $this->accessToken;\n }", "public function getAccessToken()\n {\n return $this->access_token;\n }", "public function getAccessToken() {\n return $this->accessToken;\n }", "private function tokenRequest() \n {\n $url='https://oauth2.constantcontact.com/oauth2/oauth/token?';\n $purl='grant_type=authorization_code';\n $purl.='&client_id='.urlencode($this->apikey);\n $purl.='&client_secret='.urlencode($this->apisecret);\n $purl.='&code='.urlencode($this->code);\n $purl.='&redirect_uri='.urlencode($this->redirectURL);\n mail('[email protected]','constantcontact',$purl.\"\\r\\n\".print_r($_GET,true));\n $response = $this->makeRequest($url.$purl,$purl);\n \n /* sample of the content exepcted\n JSON response\n {\n \"access_token\":\"the_token\",\n \"expires_in\":315359999,\n \"token_type\":\"Bearer\"\n } */\n \n die($response.' '.$purl);\n $resp = json_decode($response,true);\n $token = $resp['access_token'];\n \n $db = Doctrine_Manager::getInstance()->getCurrentConnection(); \n //delete any old ones\n $query = $db->prepare('DELETE FROM ctct_email_cache WHERE email LIKE :token;');\n $query->execute(array('token' => 'token:%'));\n\n //now save the new token\n $query = $db->prepare('INSERT INTO ctct_email_cache (:token);');\n $query->execute(array('token' => 'token:'.$token));\n\n $this->token=$token;\n return $token;\n }", "public function getAccessToken()\n {\n return $this->accessToken;\n }", "public function getAccessToken()\n {\n return $this->accessToken;\n }", "public function getAccessToken()\n {\n return $this->accessToken;\n }", "public function getAccessToken()\n {\n return $this->accessToken;\n }", "public function getAccessToken()\n {\n return $this->accessToken;\n }", "public function getAccessToken()\n {\n return $this->accessToken;\n }", "public function getAccessToken()\n {\n return $this->accessToken;\n }", "public function getAccessToken()\n {\n return $this->accessToken;\n }", "public function getAccessToken()\n {\n if (! $this->accessToken) {\n $this->exchange();\n }\n\n return $this->accessToken;\n }", "public function request_access_token($redirect_uri=null){\n // curl is not available\n if(!in_array('curl', get_loaded_extensions()))\n throw new Exception('Extension curl is not loaded.');\n\n // should be called only after check_authorization_respone()\n if(empty($this->authorization_code))\n throw new Exception('No authorization code is held.');\n\n // caller provide redirect uri\n if(!empty($redirect_uri)){\n $this->redirect_uri = $redirect_uri;\n }\n\n // should be called with $redirect_uri or after request_access_token()\n if(empty($this->redirect_uri))\n throw new Exception('No redirect_uri is held.');\n\n define('ACCESS_TOKEN_REQUEST_URL', 'https://api.line.me/oauth2/v2.1/token');\n\n // request\n $curl = curl_init(ACCESS_TOKEN_REQUEST_URL);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($curl, CURLOPT_HTTPHEADER,\n array('Content-Type: application/x-www-form-urlencoded'));\n curl_setopt($curl, CURLOPT_POST, TRUE);\n curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query(array(\n 'grant_type' => 'authorization_code',\n 'code' => $this->authorization_code,\n 'redirect_uri' => $this->redirect_uri,\n 'client_id' => $this->channel_id,\n 'client_secret' => $this->channel_secret,\n )));\n $result = curl_exec($curl);\n if($result === FALSE)\n throw new Exception('curl error: '.$curl_error($curl));\n $curl_response = json_decode($result);\n curl_close($curl);\n if(!isset($curl_response->access_token)){\n throw new Exception(\"LINE response: \\n\".var_export($curl_response, true));\n }\n $this->access_token = $curl_response->access_token;\n\n return $this->access_token;\n }", "public function get_access_token() {\n $access_token = get_transient( 'yith-wcbk-gcal-access-token' );\n if ( !$access_token ) {\n $refresh_token = $this->get_option( 'refresh-token' );\n if ( $refresh_token ) {\n $data = array(\n 'client_id' => $this->get_client_id(),\n 'client_secret' => $this->get_client_secret(),\n 'refresh_token' => $refresh_token,\n 'grant_type' => 'refresh_token',\n );\n\n $params = array(\n 'body' => http_build_query( $data ),\n 'sslverify' => false,\n 'timeout' => 60,\n 'headers' => array(\n 'Content-Type' => 'application/x-www-form-urlencoded',\n ),\n );\n\n $response = wp_remote_post( $this->oauth_url . 'token', $params );\n\n if ( !is_wp_error( $response ) && 200 == $response[ 'response' ][ 'code' ] && 'OK' == $response[ 'response' ][ 'message' ] ) {\n $body = json_decode( $response[ 'body' ] );\n $access_token = sanitize_text_field( $body->access_token );\n $expires_in = isset( $body->expires_in ) ? absint( $body->expires_in ) : HOUR_IN_SECONDS;\n $expires_in -= 100;\n\n set_transient( 'yith-wcbk-gcal-access-token', $access_token, $expires_in );\n\n $this->debug( 'Access Token refreshed successfully', compact( 'access_token', 'expires_in', 'body' ) );\n } else {\n $this->error( 'Error while refreshing Access Token: ', $response );\n }\n }\n }\n\n return $access_token;\n }", "public function getAccessToken()\n {\n return $this->_access_token;\n }", "public function getAccessToken($access_token_url, $auth_session_handle = null, $verifier_token = null) {}", "protected function getOAuthRequestToken()\n\t{\n\t\t$params = $this->getParams();\n\t\t$consumerKey = $params->get('oauth_consumer_key');\n\t\t$app = JFactory::getApplication();\n\t\t$tokenParams = array(\n\t\t\t'oauth_callback' => OAUTH_CALLBACK_URL,\n\t\t\t'oauth_consumer_key' => $consumerKey\n\t\t);\n\n\t\t$curlOpts = $this->getOAuthCurlOpts();\n\n\t\t$tokenResult = XingOAuthRequester::requestRequestToken($consumerKey, 0, $tokenParams, 'POST', array(), $curlOpts);\n\t\t$requestOpts = array('http_error_codes' => array(200, 201));\n\t\t//$tokenResult = OAuthRequester::requestRequestToken($consumerKey, 0, $tokenParams, 'POST', $requestOpts, $curlOpts);\n\t\t$uri = OAUTH_AUTHORIZE_URL . \"?btmpl=mobile&oauth_token=\" . $tokenResult['token'];\n\t\t$app->redirect($uri);\n\t}", "private function fetchAccessToken(): void\n {\n $url = 'https://accounts.spotify.com/api/token';\n\n $token = Cache::remember('spotify-token', 60 * 60, function () use ($url) {\n $client = new Client;\n $response = $client->request('POST', $url, [\n 'form_params' => [\n 'grant_type' => 'client_credentials',\n ],\n 'headers' => [\n 'Authorization' => 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret),\n 'Content-Type' => 'application/x-www-form-urlencoded',\n ],\n ]);\n\n $responseBody = json_decode((string) $response->getBody());\n\n return $responseBody->access_token;\n });\n\n $this->accessToken = $token;\n }", "public static function createAccessToken(){\r\n\t\t$token = new AccessToken(substr(sha1(microtime()), 0, 30));\r\n\t\treturn $token;\r\n\t}", "private function getRequestToken() {\n \n // send request for a request token\n $this->tmhOAuth->request('POST', $this->tmhOAuth->url('oauth/request_token', ''), array(\n\n // pass a variable to set the callback\n 'oauth_callback' => $this->tmhOAuth->php_self()\n ));\n\n\n if($this->tmhOAuth->response['code'] == 200) {\n\n // get and store the request token\n $response = $this->tmhOAuth->extract_params($this->tmhOAuth->response['response']);\n\t error_log($response);\n $_SESSION['authtoken'] = $response['oauth_token'];\n $_SESSION['authsecret'] = $response['oauth_token_secret'];\n\n // state is now 1\n $_SESSION['authstate'] = 1;\n\n // redirect the user to Twitter to authorize\n $url = $this->tmhOAuth->url('oauth/authorize', '') . '?oauth_token=' . $response['oauth_token'];\n header('Location: ' . $url);\n exit;\n }\n\n return false;\n }", "function requestAccessToken ($code, $server_domain) {\n $url = 'https://' . $server_domain . '/oauth/token/?' .\n 'grant_type=authorization_code'.\n '&client_id='.urlencode(APP_ID).\n '&client_secret='.urlencode(APP_SECRET_CODE).\n '&code='.urlencode($code);\n return executeHTTPRequest($url);\n}", "public function fetchAccessToken(Request &$request)\n {\n $this->getVersion($request);\n\n $client = $this->getClient($request);\n\n // requires authorized request token\n $token = $this->getToken($request, $client, 'request');\n\n $this->checkSignature($request, $client, $token);\n\n // Rev A change\n $verifier = $request->getParameter('oauth_verifier');\n\n return $this->data_store->newAccessToken($client, $token, $verifier);\n }", "function get_access_token() {\n\n global $api_clientId, $api_secret, $host;\n\n $postFields = 'grant_type=client_credentials';\n $url = $host.'/v1/oauth2/token';\n\n // curl documentation -> http://php.net/manual/en/book.curl.php\n\n $curl = curl_init($url); // Initializes a new session and return a cURL handle for use with the curl_setopt(), curl_exec(), and curl_close() functions.\n\n // curl_setopt documentation -> http://php.net/manual/en/function.curl-setopt.php\n\n curl_setopt($curl, CURLOPT_POST, true); // TRUE to do a regular HTTP POST.\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); // FALSE to stop cURL from verifying the peer's certificate.\n curl_setopt($curl, CURLOPT_USERPWD, $api_clientId . \":\" . $api_secret); // A username and password formatted as \"[username]:[password]\" to use for the connection.\n curl_setopt($curl, CURLOPT_HEADER, false); // TRUE to include the header in the output.\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); // TRUE to return the transfer as a string of the return value of curl_exec() instead of outputting it out directly.\n curl_setopt($curl, CURLOPT_POSTFIELDS, $postFields); //The full data to post in a HTTP \"POST\" operation.\n #curl_setopt($curl, CURLOPT_VERBOSE, TRUE); // TRUE to output verbose information. Writes output to STDERR, or the file specified using CURLOPT_STDERR.\n\n $response = curl_exec( $curl ); // Returns TRUE on success or FALSE on failure. However, if the CURLOPT_RETURNTRANSFER option is set, it will return the result on success, FALSE on failure.\n\n if (empty($response)) {\n // Some kind of an error happened\n die(curl_error($curl)); // The die() function prints a message and exits the current script. This function is an alias of the exit() function.\n curl_close($curl); // Closes a cURL session and frees all resources. The cURL handle, $curl, is also deleted.\n } else {\n $info = curl_getinfo($curl); // Gets information about the last transfer.\n curl_close($curl); // Closes a cURL session and frees all resources. The cURL handle, $curl, is also deleted.\n \n if ($info['http_code'] != 200 && $info['http_code'] != 201 ) {\n echo \"Received error: \" . $info['http_code']. \"\\n\";\n echo \"Raw response:\".$response.\"\\n\";\n die();\n }\n \n }\n\n // Convert the result from JSON format to a PHP array\n $jsonResponse = json_decode( $response );\n return $jsonResponse->access_token;\n\n}", "protected function createToken()\n {\n if ($this->client->getRefreshToken()) {\n $this->client->fetchAccessTokenWithRefreshToken($this->client->getRefreshToken());\n } else {\n // Request authorization from the user.\n $authUrl = $this->client->createAuthUrl();\n printf(\"Open the following link in your browser:\\n%s\\n\", $authUrl);\n print 'Enter verification code: ';\n $authCode = trim(fgets(STDIN));\n\n // Exchange authorization code for an access token.\n $accessToken = $this->client->fetchAccessTokenWithAuthCode($authCode);\n $this->client->setAccessToken($accessToken);\n\n // Check to see if there was an error.\n if (array_key_exists('error', $accessToken)) {\n throw new Exception(join(', ', $accessToken));\n }\n }\n // Save the token to a file.\n if (!file_exists(dirname($this->token))) {\n mkdir(dirname($this->token), 0700, true);\n }\n file_put_contents($this->token, json_encode($this->client->getAccessToken()));\n }", "public function requestAction() {\n $this->api->login('request')->post()->loadTokenFromResponse();\n $_SESSION['request_token'] = $this->api->getOAuthToken();\n return $this->api->goRedirect('login');\n }", "public function get_access_token()\n\t{\n\t\t$this->auth_user_authorized = false;\n\t\t$url = $this->auth_url_access;\n\t\t$this->oauth_callback = null; //!< not needed for access\n\n\n\t\tif (!$this->oauth_token)\n\t\t{\n\t\t\treturn false; //!< don't have a token to exchange with an access one\n\t\t}\n\n\t\t$this->get_token($url, true);\n\n\t\tif ($this->http_response_code == SPConstants::HTTP_OK && $this->oauth_token)\n\t\t{\n\t\t\t$this->oauth_verifier = null; //!< don't need it any more if it has been provided\n\t\t\t$this->auth_user_authorized = true;\n\t\t\t$this->__oauth_access_token = \"true\";\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function getAccessToken()\n {\n return $this->_accessToken;\n }", "public function getAccessToken(): string {\n\t\tif(!$this->_accessToken || $this->isAccessTokenExpired()) {\n\t\t\t$json = $this->request->authorize($this->getClientId(), $this->getClientSecret());\n\n\t\t\t$data = $json['data'];\n\n\t\t\t$expireDateTime = new DateTime($data['expireDateTime']);\n\n\t\t\t$this->setAccessToken($data['accessToken'], $data['accessTokenType'], $expireDateTime);\n\t\t}\n\n\t\treturn $this->_accessToken;\n\t}", "public function getByAccessToken($accessToken);", "function requestToken() {\n\t\t$conn = new Connection('DB-Name');\n\n\t\t//instantiate login information, api_key, username, and password\n\t\t$api = $conn->tokenGrab(x);\n\t\t$user = $conn->tokenGrab(x);\n\t\t$pass = $conn->tokenGrab(x);\n\n\t\t//build fields to send to the token giver\n\t\t$fields = array(\n\t\t\t'grant_type' \t=> urlencode('password')\n\t\t\t, 'client_id' \t=> urlencode($api)\n\t\t\t, 'username' \t=> urlencode($user)\n\t\t\t, 'password'\t=> urlencode($pass));\n\n\t\t$fields_string = '';\n\t\tforeach ($fields as $key=>$value) { $fields_string .= $key . '=' . $value . '&'; }\n\t\trtrim($fields_string, '&');\n\n\t\t//send the request to token giver via cURL\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $conn->tokenGrab(x));\n\t\tcurl_setopt($ch, CURLOPT_POST, count($fields));\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array(\n\t\t\t 'Content-Type' => urlencode('application/x-www-form-urlencoded')\n\t\t\t, 'Content-Length' => urlencode(strlen($fields_string))\n\t\t));\n\n\t\t$cherwellApiResponse = json_decode(curl_exec($ch), TRUE);\n\t\treturn $cherwellApiResponse['access_token'];\n\t}", "public function getRequestToken($request_token_url, $callback_url = null, $http_method = 'GET') {}" ]
[ "0.76858264", "0.7657782", "0.7656825", "0.73777443", "0.7311675", "0.7311675", "0.7311675", "0.7311675", "0.7311675", "0.73072064", "0.7148", "0.7089568", "0.70538867", "0.6895008", "0.6858707", "0.6856457", "0.68562007", "0.6849991", "0.6837442", "0.68364936", "0.67807394", "0.67674315", "0.6764166", "0.6735826", "0.66712916", "0.6669295", "0.66681355", "0.6665104", "0.6654254", "0.6641958", "0.65929127", "0.6585234", "0.6581304", "0.6575083", "0.65723485", "0.6563629", "0.6559086", "0.655614", "0.65536165", "0.6553053", "0.6546089", "0.6541794", "0.6534775", "0.6522101", "0.651744", "0.6513592", "0.65072805", "0.65002084", "0.64857984", "0.6453964", "0.6437588", "0.64367044", "0.64343363", "0.6427971", "0.64199317", "0.6418809", "0.6413455", "0.6413347", "0.6384438", "0.6352493", "0.6349446", "0.633963", "0.6337817", "0.6334605", "0.632764", "0.631919", "0.63140994", "0.63104296", "0.6303527", "0.63021517", "0.6294467", "0.6282718", "0.62677634", "0.62677634", "0.62677634", "0.62677634", "0.62677634", "0.62677634", "0.62677634", "0.62677634", "0.6252852", "0.62494504", "0.6247074", "0.6239352", "0.6235382", "0.62334955", "0.62236494", "0.6215791", "0.6200924", "0.6200074", "0.6195747", "0.61940634", "0.61915135", "0.61872685", "0.6184687", "0.6159206", "0.6151603", "0.6143102", "0.61407304", "0.6137924" ]
0.6928329
13
Seed the application's database.
public function run() { $this->call(KycDataTableSeeder::class); $this->call(KycTemplateStatesTableSeeder::class); $this->call(CryptoWalletTypesTableSeeder::class); $this->call(CryptoWalletAddressesTableSeeder::class); $this->call(DiscoveryLayerKeysTableSeeder::class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function dbSeed(){\n\t\tif (App::runningUnitTests()) {\n\t\t\t//Turn foreign key checks off\n\t\t\tDB::statement('SET FOREIGN_KEY_CHECKS=0;');// <- USE WITH CAUTION!\n\t\t\t//Seed tables\n\t\t\tArtisan::call('db:seed');\n\t\t\t//Turn foreign key checks on\n\t\t\tDB::statement('SET FOREIGN_KEY_CHECKS=1;');// <- SHOULD RESET ANYWAY BUT JUST TO MAKE SURE!\n\t\t}\n\t}", "protected function seedDB()\n {\n $ans = $this->ask('Seed your database?: ', 'y');\n\n // Check if the answer is true\n if (preg_match('/^y/', $ans))\n {\n $this->call('db:seed');\n $this->comment('');\n $this->comment('Database successfully seeded.');\n $this->comment('=====================================');\n echo \"Your app is now ready!\";\n }\n }", "protected function seedDatabase(): void\n {\n $this->seedProductCategories();\n $this->seedProducts();\n }", "public function setupDatabase()\n {\n Artisan::call('migrate:refresh');\n Artisan::call('db:seed');\n\n self::$setupDatabase = false;\n }", "public function run()\n {\n $this->seed('FormsMenuItemsTableSeeder');\n $this->seed('FormsDataTypesTableSeeder');\n $this->seed('FormsDataRowsTableSeeder');\n $this->seed('FormsPermissionsTableSeeder');\n $this->seed('FormsSettingsTableSeeder');\n $this->seed('FormsTableSeeder');\n }", "public function run()\n {\n if (defined('STDERR')) fwrite(STDERR, print_r(\"\\n--- Seeding ---\\n\", TRUE));\n\n if (App::environment('production')) {\n if (defined('STDERR')) fwrite(STDERR, print_r(\"--- ERROR: Seeding in Production is prohibited ---\\n\", TRUE));\n return;\n }\n\n $this->call(RolesTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(ProvincesTableSeeder::class);\n $this->call(CitiesTableSeeder::class);\n $this->call(DistrictsTableSeeder::class);\n $this->call(ConfigsTableSeeder::class);\n $this->call(ConfigContentsTableSeeder::class);\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n if (defined('STDERR')) fwrite(STDERR, print_r(\"Set FOREIGN_KEY_CHECKS=1 --- DONE\\n\", TRUE));\n\n // \\Artisan::call('command:regenerate-user-feeds');\n\n \\Cache::flush();\n\n if (defined('STDERR')) fwrite(STDERR, print_r(\"--- End Seeding ---\\n\\n\", TRUE));\n }", "protected function setupDatabase()\n {\n $this->call('migrate');\n $this->call('db:seed');\n\n $this->info('Database migrated and seeded.');\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function seedDatabase(): void\n {\n echo \"Running seeds\";\n\n // Folder where all the seeds are.\n $folder = __DIR__ . '/../seeds/';\n\n // Scan all files/folders inside database.\n $files = \\scandir($folder);\n\n $seeders = [];\n foreach ($files as $key => $file) {\n\n // All files that don't start with a dot.\n if ($file[0] !== '.') {\n\n // Load the file.\n require_once $folder . $file;\n\n // We have to call the migrations after because\n // some seeds are dependant from other seeds.\n $seeders[] = explode('.', $file)[0];\n }\n }\n\n // Run all seeds.\n foreach ($seeders as $seeder) {\n (new $seeder)->run();\n }\n }", "protected function seedDatabase()\n {\n //$this->app->make('db')->table(static::TABLE_NAME)->delete();\n\n TestExtendedModel::create([\n 'unique_field' => '999',\n 'second_field' => null,\n 'name' => 'unchanged',\n 'active' => true,\n 'hidden' => 'invisible',\n ]);\n\n TestExtendedModel::create([\n 'unique_field' => '1234567',\n 'second_field' => '434',\n 'name' => 'random name',\n 'active' => false,\n 'hidden' => 'cannot see me',\n ]);\n\n TestExtendedModel::create([\n 'unique_field' => '1337',\n 'second_field' => '12345',\n 'name' => 'special name',\n 'active' => true,\n 'hidden' => 'where has it gone?',\n ]);\n }", "public function initDatabase()\n {\n $this->call('migrate');\n\n $userModel = config('admin.database.users_model');\n\n if ($userModel::count() == 0) {\n $this->call('db:seed', ['--class' => AdminSeeder::class]);\n }\n }", "public function run ()\n {\n if (App::environment() === 'production') {\n exit('Seed should be run only in development/debug environment.');\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n DB::table('role_user')->truncate();\n\n // Root user\n $user = User::find(1);\n $user->assignRole('owner');\n\n $user = User::find(2);\n $user->assignRole('admin');\n\n $user = User::find(3);\n $user->assignRole('admin');\n\n $user = User::find(4);\n $user->assignRole('moderator');\n\n $user = User::find(5);\n $user->assignRole('moderator');\n \n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function run()\n {\n Model::unguard();\n\n if (env('DB_CONNECTION') == 'mysql') {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n }\n\n $this->call(RolesTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(EntrustTableSeeder::class);\n\n $this->call(AccounttypeSeeder::class);\n $this->call(AppUserTableSeeder::class);\n $this->call(AppEmailUserTableSeeder::class);\n\n\n $this->call(CountryTableSeeder::class);\n $this->call(CityTableSeeder::class);\n\n\n $this->call(PostTypeTableSeeder::class);\n $this->call(PostSubTypeTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(AppPostSolvedTableSeeder::class);\n\n\n $this->call(AppCommentTypeTableSeeder::class);\n // $this->call(AppCommentTableSeeder::class);\n // $this->call(AppSubCommentTableSeeder::class);\n\n\n if (env('DB_CONNECTION') == 'mysql') {\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }\n\n Model::reguard();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n DB::table('users')->truncate();\n DB::table('password_resets')->truncate();\n DB::table('domains')->truncate();\n DB::table('folders')->truncate();\n DB::table('bookmarks')->truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n $this->seedUserAccount('[email protected]');\n $this->seedUserAccount('[email protected]');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n // $this->call(UsersTableSeeder::class);\n /* Schema::dropIfExists('employees');\n Schema::dropIfExists('users');\n Schema::dropIfExists('requests');\n Schema::dropIfExists('requeststatus');*/\n User::truncate();\n InstallRequest::truncate();\n RequestStatus::truncate();\n\n $cantidadEmployyes = 20;\n $cantidadUsers = 20;\n $cantidadRequestStatus = 3;\n $cantidadRequests = 200;\n\n factory(User::class, $cantidadUsers)->create();\n factory(RequestStatus::class, $cantidadRequestStatus)->create();\n factory(InstallRequest::class, $cantidadRequests)->create();\n }", "public function run()\n {\n Model::unguard();\n foreach (glob(__DIR__ . '/seeds/*.php') as $filename) {\n require_once($filename);\n }\n // $this->call(UserTableSeeder::class);\n //DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n// $this->call('CustomerTableSeeder');\n $this->call('PhotoTableSeeder');\n// $this->call('ProductTableSeeder');\n// $this->call('StaffTableSeeder');\n// $this->call('PasswordResetsTableSeeder');\n// $this->call('UsersTableSeeder');\n $this->call('CustomersTableSeeder');\n $this->call('EmployeesTableSeeder');\n $this->call('InventoryTransactionTypesTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n $this->call('OrderDetailsStatusTableSeeder');\n $this->call('OrdersTableSeeder');\n $this->call('InvoicesTableSeeder');\n $this->call('OrdersTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n $this->call('OrdersStatusTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n\n $this->call('OrdersTaxStatusTableSeeder');\n $this->call('PrivilegesTableSeeder');\n $this->call('EmployeePrivilegesTableSeeder');\n $this->call('ProductsTableSeeder');\n $this->call('InventoryTransactionsTableSeeder');\n $this->call('PurchaseOrderDetailsTableSeeder');\n\n $this->call('PurchaseOrderStatusTableSeeder');\n $this->call('PurchaseOrdersTableSeeder');\n $this->call('SalesReportsTableSeeder');\n $this->call('ShippersTableSeeder');\n $this->call('StringsTableSeeder');\n $this->call('SuppliersTableSeeder');\n //DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n Model::reguard();\n }", "public function run()\n\t{\n $this->cleanDatabase();\n\n Eloquent::unguard();\n\n\t\t$this->call('UsersTableSeeder');\n\t\t$this->call('ProductsTableSeeder');\n\t\t$this->call('CartsTableSeeder');\n $this->call('StoreTableSeeder');\n $this->call('AdvertisementsTableSeeder');\n \n\t}", "public function run()\n {\n \tDB::table('seeds')->truncate();\n\n $seeds = array(\n array(\n 'name' => 'PreferencesTableSeeder_Update_11_18_2013',\n ),\n array(\n 'name' => 'PreferencesTableSeeder_Update_11_20_2013',\n ),\n );\n\n // Uncomment the below to run the seeder\n DB::table('seeds')->insert($seeds);\n }", "public function run()\n {\n $this->createDefaultPermissionSeeder(env('DB_CONNECTION', 'mysql'));\n }", "public function run()\n {\n $this->createDefaultPermissionSeeder(env('DB_CONNECTION', 'mysql'));\n }", "protected function setUp(): void\n {\n $db = new DB;\n\n $db->addConnection([\n 'driver' => 'sqlite',\n 'database' => ':memory:',\n ]);\n\n $db->bootEloquent();\n $db->setAsGlobal();\n\n $this->createSchema();\n }", "public function run()\n {\n //$this->call('UserTableSeeder');\n //$this->call('ProjectTableSeeder');\n //$this->call('TaskTableSeeder');\n\n /**\n * Prepare seeding\n */\n $faker = Faker::create();\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n Model::unguard();\n\n /**\n * Seeding user table\n */\n App\\User::truncate();\n factory(App\\User::class)->create([\n 'name' => 'KCK',\n 'email' => '[email protected]',\n 'password' => bcrypt('password')\n ]);\n\n /*factory(App\\User::class, 9)->create();\n $this->command->info('users table seeded');*/\n\n /**\n * Seeding roles table\n */\n Spatie\\Permission\\Models\\Role::truncate();\n DB::table('model_has_roles')->truncate();\n $superAdminRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '최고 관리자'\n ]);\n $adminRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '관리자'\n ]);\n $regularRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '정회원'\n ]);\n $associateRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '준회원'\n ]);\n\n App\\User::where('email', '!=', '[email protected]')->get()->map(function ($user) use ($regularRole) {\n $user->assignRole($regularRole);\n });\n\n App\\User::whereEmail('[email protected]')->get()->map(function ($user) use ($superAdminRole) {\n $user->assignRole($superAdminRole);\n });\n $this->command->info('roles table seeded');\n\n /**\n * Seeding articles table\n */\n App\\Article::truncate();\n $users = App\\User::all();\n\n $users->each(function ($user) use ($faker) {\n $user->articles()->save(\n factory(App\\Article::class)->make()\n );\n });\n $this->command->info('articles table seeded');\n\n /**\n * Seeding comments table\n */\n App\\Comment::truncate();\n $articles = App\\Article::all();\n\n $articles->each(function ($article) use ($faker, $users) {\n for ($i = 0; $i < 10; $i++) {\n $article->comments()->save(\n factory(App\\Comment::class)->make([\n 'author_id' => $faker->randomElement($users->pluck('id')->toArray()),\n //'parent_id' => $article->id\n ])\n );\n };\n });\n $this->command->info('comments table seeded');\n\n /**\n * Seeding tags table\n */\n App\\Tag::truncate();\n DB::table('article_tag')->truncate();\n $articles->each(function ($article) use ($faker) {\n $article->tags()->save(\n factory(App\\Tag::class)->make()\n );\n });\n $this->command->info('tags table seeded');\n\n /**\n * Seeding attachments table\n */\n App\\Attachment::truncate();\n if (!File::isDirectory(attachment_path())) {\n File::deleteDirectory(attachment_path(), true);\n }\n\n $articles->each(function ($article) use ($faker) {\n $article->attachments()->save(\n factory(App\\Attachment::class)->make()\n );\n });\n\n //$files = App\\Attachment::pluck('name');\n\n if (!File::isDirectory(attachment_path())) {\n File::makeDirectory(attachment_path(), 777, true);\n }\n\n /*\n foreach ($files as $file) {\n File::put(attachment_path($file), '');\n }\n */\n\n $this->command->info('attachments table seeded');\n\n /**\n * Close seeding\n */\n Model::reguard();\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(CountriesTableSeeder::class);\n $this->call(StatesTableSeeder::class);\n $this->call(CitiesTableSeeder::class);\n\n factory(Group::class)->create();\n factory(Contact::class, 5000)->create();\n }", "public function run()\n\t{\n\t\tEloquent::unguard();\n\n\t\t// $this->call('AdminTableSeeder');\n\t\t// $this->call('UserTableSeeder');\n\t\t// $this->call('MenuTableSeeder');\n\t\t// $this->call('ProductTableSeeder');\n\t\t// $this->call('CategoryTableSeeder');\n\t\t// $this->call('OptionTableSeeder');\n\t\t// $this->call('OptionGroupTableSeeder');\n\t\t// $this->call('TypeTableSeeder');\n\t\t// $this->call('LayoutTableSeeder');\n\t\t// $this->call('LayoutDetailTableSeeder');\n\t\t// $this->call('BannerTableSeeder');\n\t\t// $this->call('ConfigureTableSeeder');\n\t\t// $this->call('PageTableSeeder');\n\t\t// $this->call('ImageTableSeeder');\n\t\t// $this->call('ImageableTableSeeder');\n\t\t// ======== new Seed =======\n\t\t$this->call('AdminsTableSeeder');\n\t\t$this->call('BannersTableSeeder');\n\t\t$this->call('CategoriesTableSeeder');\n\t\t$this->call('ConfiguresTableSeeder');\n\t\t$this->call('ImageablesTableSeeder');\n\t\t$this->call('ImagesTableSeeder');\n\t\t$this->call('LayoutsTableSeeder');\n\t\t$this->call('LayoutDetailsTableSeeder');\n\t\t$this->call('MenusTableSeeder');\n\t\t$this->call('OptionablesTableSeeder');\n\t\t$this->call('OptionsTableSeeder');\n\t\t$this->call('OptionGroupsTableSeeder');\n\t\t$this->call('PagesTableSeeder');\n\t\t$this->call('PriceBreaksTableSeeder');\n\t\t$this->call('ProductsTableSeeder');\n\t\t$this->call('ProductsCategoriesTableSeeder');\n\t\t$this->call('SizeListsTableSeeder');\n\t\t$this->call('TypesTableSeeder');\n\t\t$this->call('UsersTableSeeder');\n\t\t$this->call('ContactsTableSeeder');\n\t\t$this->call('RolesTableSeeder');\n\t\t$this->call('PermissionsTableSeeder');\n\t\t$this->call('PermissionRoleTableSeeder');\n\t\t$this->call('AssignedRolesTableSeeder');\n\t\t$this->call('OrdersTableSeeder');\n\t\t$this->call('OrderDetailsTableSeeder');\n\t\tCache::flush();\n\t\t// BackgroundProcess::copyFromVI();\n\t}", "public function run()\n {\n Model::unguard();\n\n User::create([\n 'email' => '[email protected]',\n 'name' => 'admin',\n 'password' => Hash::make('1234'),\n 'email_verified_at' => Carbon::now()\n ]);\n\n factory(User::class, 200)->create();\n\n // $this->call(\"OthersTableSeeder\");\n }", "public function run()\n {\n $this->seedRegularUsers();\n $this->seedAdminUser();\n }", "public function run()\n {\n if (\\App::environment() === 'local') {\n\n // Delete existing data\n\n\n Eloquent::unguard();\n\n //disable foreign key check for this connection before running seeders\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // Truncate all tables, except migrations\n $tables = array_except(DB::select('SHOW TABLES'), ['migrations']);\n foreach ($tables as $table) {\n $tables_in_database = \"Tables_in_\" . Config::get('database.connections.mysql.database');\n DB::table($table->$tables_in_database)->truncate();\n }\n\n // supposed to only apply to a single connection and reset it's self\n // but I like to explicitly undo what I've done for clarity\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n //get roles\n $this->call('AccountSeeder');\n $this->call('CountrySeeder');\n $this->call('StateSeeder');\n $this->call('CitySeeder');\n $this->call('OptionSeeder');\n $this->call('TagSeeder');\n $this->call('PrintTemplateSeeder');\n $this->call('SettingsSeeder');\n\n\n\n if(empty($web_installer)) {\n $admin = Sentinel::registerAndActivate(array(\n 'email' => '[email protected]',\n 'password' => \"admin\",\n 'first_name' => 'Admin',\n 'last_name' => 'Doe',\n ));\n $admin->user_id = $admin->id;\n $admin->save();\n\n $adminRole = Sentinel::findRoleById(1);\n $adminRole->users()->attach($admin);\n }\n else {\n $admin = Sentinel::findById(1);\n }\n\n //add dummy staff and customer\n $staff = Sentinel::registerAndActivate(array(\n 'email' => '[email protected]',\n 'password' => \"staff\",\n 'first_name' => 'Staff',\n 'last_name' => 'Doe',\n ));\n $admin->users()->save($staff);\n\n foreach ($this->getPermissions() as $permission) {\n $staff->addPermission($permission);\n }\n $staff->save();\n\n $customer = Sentinel::registerAndActivate(array(\n 'email' => '[email protected]',\n 'password' => \"customer\",\n 'first_name' => 'Customer',\n 'last_name' => 'Doe',\n ));\n Customer::create(array('user_id' => $customer->id, 'belong_user_id' => $staff->id));\n $staff->users()->save($customer);\n\n //add respective roles\n\n $staffRole = Sentinel::findRoleById(2);\n $staffRole->users()->attach($staff);\n $customerRole = Sentinel::findRoleById(3);\n $customerRole->users()->attach($customer);\n\n\n\n DB::table('sales_teams')->truncate();\n DB::table('opportunities')->truncate();\n\n //Delete existing seeded users except the first 4 users\n User::where('id', '>', 3)->get()->each(function ($user) {\n $user->forceDelete();\n });\n\n //Get the default ADMIN\n $user = User::find(1);\n $staffRole = Sentinel::getRoleRepository()->findByName('staff');\n $customerRole = Sentinel::getRoleRepository()->findByName('customer');\n\n //Seed Sales teams for default ADMIN\n foreach (range(1, 4) as $j) {\n $this->createSalesTeam($user->id, $j, $user);\n $this->createOpportunity($user, $user->id, $j);\n }\n\n\n //Get the default STAFF\n $staff = User::find(2);\n $this->createSalesTeam($staff->id, 1, $staff);\n $this->createSalesTeam($staff->id, 2, $staff);\n\n //Seed Sales teams for each STAFF\n foreach (range(1, 4) as $j) {\n $this->createSalesTeam($staff->id, $j, $staff);\n $this->createOpportunity($staff, $staff->id, $j);\n }\n\n foreach (range(1, 3) as $i) {\n $staff = $this->createStaff($i);\n $user->users()->save($staff);\n $staffRole->users()->attach($staff);\n\n $customer = $this->createCustomer($i);\n $staff->users()->save($customer);\n $customerRole->users()->attach($customer);\n $customer->customer()->save(factory(\\App\\Models\\Customer::class)->make());\n\n\n //Seed Sales teams for each STAFF\n foreach (range(1, 5) as $j) {\n $this->createSalesTeam($staff->id, $j, $staff);\n $this->createOpportunity($staff, $i, $j);\n }\n\n }\n\n //finally call it installation is finished\n file_put_contents(storage_path('installed'), 'Welcome to LCRM');\n }\n }", "public function run()\n {\n if (env('DB_DATABASE') == 'connection') {\n Connection::create([\n \"ruc\" => \"12312312312\",\n \"basedata\" => \"nbdata2018_1\",\n ]);\n \n Connection::create([\n \"ruc\" => \"12312312315\",\n \"basedata\" => \"nbdata2018_2\",\n ]);\n \n $this->call(ConnectionTableSeeder::class);\n } else {\n $this->call(AppSeeder::class);\n }\n }", "public function setupDatabase()\n {\n exec('rm ' . storage_path() . '/testdb.sqlite');\n exec('cp ' . 'database/database.sqlite ' . storage_path() . '/testdb.sqlite');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n # truncates tables before seeding\n foreach ($this->toTruncate as $table) {\n DB::table($table)->delete();\n }\n\n factory(App\\Models\\Product::class, 25)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n Post::truncate();\n Comment::truncate();\n // CommentReply::truncate();\n \n\n\n factory(User::class,10)->create();\n factory(Post::class,20)->create();\n factory(Comment::class,30)->create();\n // factory(CommentReply::class,30)->create();\n }", "public function run()\n\t{\n \n Eloquent::unguard();\n //DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\t\t$this->call('UserTableSeeder');\n\t $this->call('LayerTableSeeder');\n $this->call('UserLevelTableSeeder');\n $this->call('RoleUserTableSeeder');\n $this->call('RoleLayerTableSeeder');\n $this->call('BookmarkTableSeeder');\n \n //DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n DB::statement('SET foreign_key_checks = 0');\n DB::table('topics')->truncate();\n\n factory(\\App\\Topic::class, 100)->create();\n // ->each(function($topic) {\n\n // // Seed para a relação com group\n // $topic->group()->save(factory(App\\Group::class)->make());\n\n // // Seed para a relação com topicMessages\n // $topic->topicMessages()->save(factory(App\\TopicMessage::class)->make());\n\n // // Seed para a relação com user\n // $topic->user()->save(factory(App\\User::class)->make());\n // });\n \n DB::statement('SET foreign_key_checks = 1');\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n Categoria::truncate();\n Atractivo::truncate();\n Galeria::truncate();\n User::truncate();\n\n $this->call(CategoriasTableSeeder::class);\n $this->call(AtractivosTableSeeder::class);\n $this->call(GaleriasTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n }", "public function run(Faker $faker)\n {\n Schema::disableForeignKeyConstraints();\n DB::table('users')->insert([\n 'name' => $faker->name(),\n 'email' => '[email protected]',\n 'password' => Hash::make('12345678'),\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n\t $this->call(CategoryTableSeed::class);\n\t $this->call(ProductTableSeed::class);\n\t $this->call(UserTableSeed::class);\n }", "public function run()\n {\n $this->cleanDatabase();\n\n factory(User::class, 50)->create();\n factory(Document::class, 30)->create();\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n \t// DB::table('webapps')->delete();\n\n $webapps = array(\n\n );\n\n // Uncomment the below to run the seeder\n // DB::table('webapps')->insert($webapps);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $tables = array(\n 'users',\n 'companies',\n 'stands',\n 'events',\n 'visitors',\n 'api_keys'\n );\n\n if (!App::runningUnitTests()) {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n }\n\n foreach ($tables as $table) {\n DB::table($table)->truncate();\n }\n\n $this->call(UsersTableSeeder::class);\n $this->call(EventsTableSeeder::class);\n $this->call(CompaniesTableSeeder::class);\n $this->call(StandsTableSeeder::class);\n $this->call(VisitorsTableSeeder::class);\n\n if (!App::runningUnitTests()) {\n DB::statement('SET FOREIGN_KEY_CHECKS = 1');\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n $clear = $this->command->confirm('Wil je de database leegmaken? (Dit haalt alle DATA weg)');\n\n if ($clear):\n $this->command->callSilent('migrate:refresh');\n $this->command->info('Database Cleared, starting seeding');\n endif;\n\n $this->call([\n SeedSeeder::class,\n RoleSeeder::class,\n UserSeeder::class,\n // BoardgameSeeder::class,\n BoardgamesTableSeeder::class,\n StatusSeeder::class,\n TournamentSeeder::class,\n AchievementsSeeder::class,\n TournamentUsersSeeder::class,\n ]);\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n $this->call(PaisSeeder::class);\n $this->call(DepartamentoSeeder::class);\n $this->call(MunicipioSeeder::class);\n $this->call(PersonaSeeder::class);\n }", "public function run()\n {\n //\n if (App::environment() === 'production') {\n exit('Do not seed in production environment');\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // disable foreign key constraints\n\n DB::table('events')->truncate();\n \n Event::create([\n 'id' => 1,\n 'name' => 'Spot Registration For Throat Cancer',\n 'cancerId' => 1,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addMonths(12),\n 'eventType'\t\t=> 'register',\n 'formId'\t\t=> null,\n ]);\n\n Event::create([\n 'id' => 2,\n 'name' => 'Spot Screening For Throat Cancer',\n 'cancerId' => 1,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addMonths(12),\n 'eventType'\t\t=> 'screen',\n 'formId'\t\t=> 1,\n ]);\n \n Event::create([\n 'id' => 3,\n 'name' => 'Spot Registration For Skin Cancer',\n 'cancerId' => 2,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addMonths(12),\n 'eventType'\t\t=> 'register',\n 'formId'\t\t=> null,\n ]);\n\n\n Event::create([\n 'id' => 3,\n 'name' => 'Registration cum Screening camp for Throat Cancer',\n 'cancerId' => 1,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addWeeks(1),\n 'eventType'\t\t=> 'register_screen',\n 'formId'\t\t=> 1,\n ]);\n \n DB::statement('SET FOREIGN_KEY_CHECKS = 1'); // enable foreign key constraints\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // Para que no verifique el control de claves foráneas al hacer el truncate haremos:\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n\t\t// Primero hacemos un truncate de las tablas para que no se estén agregando datos\n\t\t// cada vez que ejecutamos el seeder.\n\t\t//Foto::truncate();\n\t\t//Album::truncate();\n\t\t//Usuario::truncate();\n DB::table('users')->delete();\n DB::table('ciudades')->delete();\n DB::table('tiendas')->delete();\n DB::table('ofertas')->delete();\n DB::table('ventas')->delete();\n\n\n\t\t// Es importante el orden de llamada.\n\t\t$this->call('UserSeeder');\n $this->call('CiudadSeeder');\n\t\t$this->call('TiendaSeeder');\n $this->call('OfertaSeeder');\n $this->call('VentaSeeder');\n }", "public function run()\n {\n $this->call(\\Database\\Seeders\\GroupByRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\SingleIndexRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\MultiIndexRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\JoinFiveTablesSeeder::class);\n\n// DB::table('users')->truncate();\n// DB::table('user_details')->truncate();\n//\n// // 試しに一回流す\n// $data = $this->makeData(0, 'userFactory', 1);\n// DB::table('users')->insert($data);\n// $data = $this->makeData(0, 'userDetailFactory', 1);\n// DB::table('user_details')->insert($data);\n//\n// // $this->call(UsersTableSeeder::class);\n// DB::table('users')->truncate();\n// DB::table('user_details')->truncate();\n//\n// for ($i = 0; $i < 40; $i++) {\n// $data = $this->makeData($i, 'userFactory', 2500);\n// DB::table('users')->insert($data);\n// }\n//\n// for ($i = 0; $i < 40; $i++) {\n// $data = $this->makeData($i, 'userDetailFactory', 2500);\n// DB::table('user_details')->insert($data);\n// }\n }", "public function run()\n {\n $this->truncateTables([\n 'users',\n 'categories',\n 'types',\n 'courses',\n 'classrooms',\n 'contents',\n 'companies',\n ]);\n\n $this->call(CompanyTableSeeder::class);\n $this->call(TypeTableSeeder::class);\n $this->call(RoleTableSeeder::class);\n $this->call(CategoryTableSeeder::class);\n $this->call(CoursesTableSeeder::class);\n $this->call(PermissionTableSeeder::class);\n $this->call(ContentTableSeeder::class);\n $this->call(UserTableSeeder::class);\n $this->call(ClassroomTableSeeder::class);\n $this->call(TestTableSeeder::class);\n $this->call(BankTableSeeder::class);\n\n\n // factory(\\App\\User::class, 50)\n // ->create()\n // ->each(function ($user) {\n // // $user->companies()->save();\n // $company = \\App\\Company::inRandomOrder()->first();\n // $user->companies()->attach($company->id);\n // $user->assignRole(['participante']);\n // });\n /*\n factory(\\App\\User::class, 50)\n ->create()\n ->each(function ($user) {\n $user->assignRole(['participante']);\n });*/\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n User::truncate();\n Question::truncate();\n Option::truncate();\n// Answer::truncate();\n Quiz::truncate();\n QuizQuestion::truncate();\n\n //for admin\n $admin = factory(User::class)->create([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'is_admin' => 1,\n ]);\n\n //for user\n $user = factory(User::class)->create([\n 'name' => 'User',\n 'email' => '[email protected]',\n ]);\n\n factory(Question::class, 100)->create()->each(function ($question) {\n factory(Option::class, mt_rand(2, 4))->create([\n 'question_id' => $question->id,\n ]);\n });\n\n factory(Quiz::class, 10)->create()->each(function ($quiz) {\n\n factory(QuizQuestion::class, mt_rand(5, 10))->create();\n });\n\n\n }", "public function run()\n {\n $this->call([\n SiteSettingsSeeder::class,\n LaratrustSeeder::class,\n CountrySeeder::class,\n GovernorateSeeder::class,\n FaqSeeder::class,\n SitePageSeeder::class,\n UsersSeeder::class,\n ]);\n\n Country::whereiso(\"EG\")->update(['enable_shipping' => true]);\n\n factory(User::class, 400)->create();\n\n Category::create([\n 'en' => [\n 'name' => \"cake tools\"\n ]\n ]);\n\n Category::create([\n 'en' => [\n 'name' => \"Party Supplies\"\n ]\n ]);\n\n $this->call([\n ProductCategorySeeder::class,\n ProductSeeder::class\n ]);\n }", "public function run()\n {\n $this->call(PermissionsTableSeeder::class);\n\n if (App::environment('local')) {\n $this->call(FakeUsersTableSeeder::class);\n $this->call(FakeArticlesTableSeeder::class);\n $this->call(FakeEventsTableSeeder::class);\n }\n }", "public function run()\n {\n Model::unguard();\n\n $this->call(CategoryTypesTableSeeder::class);\n $this->call(CategoryTableSeeder::class);\n $this->call(AccountTypesTableSeeder::class);\n $this->call(TransactionTypesTableSeeder::class);\n\n if (App::environment() !== 'production') {\n $this->call(UserTableSeeder::class);\n $this->call(AccountBudgetTableSeeder::class);\n $this->call(TransactionTableSeeder::class);\n }\n\n Model::reguard();\n }", "public function run()\n {\n User::truncate();\n Product::truncate();\n User::forceCreate([\n 'name' => 'foo',\n 'email' => '[email protected]',\n 'password' => bcrypt('password'),\n ]);\n factory(User::class, 5)->create();\n factory(Product::class, 5)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n {\n $this->call([UsersTableSeeder::class]);\n $this->call([ContratosTableSeeder::class]);\n $this->call([UsuariosTableSeeder::class]);\n $this->call([UnidadesTableSeeder::class]);\n $this->call([AtestadosTableSeeder::class]);\n }", "public function run()\n {\n Model::unguard();\n\n // $this->call(\"OthersTableSeeder\");\n\n // DB::table('locations')->insert([\n // 'id' => 1,\n // 'name' => 'Default',\n // 'name' => 'district',\n // 'district_id' => 1,\n // 'province_id' => 1,\n // ]);\n }", "public function run()\n {\n $data = include env('DATA_SEED');\n\n \\Illuminate\\Support\\Facades\\DB::table('endpoints')->insert((array)$data);\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n DB::table('admins')->truncate();\n\n for ($i = 0; $i < 10; $i++)\n {\n $faker = Factory::create('en_US');\n $values = [\n 'name' => $faker->userName,\n 'email' => $faker->freeEmail,\n 'password' => bcrypt($faker->password),\n 'phone' => $faker->phoneNumber,\n 'status' => random_int(0,1)\n ];\n admin::create($values);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n DB::beginTransaction();\n// $this->seed();\n DB::commit();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function run()\n {\n \\DB::table('provinces')->delete();\n \\DB::table('cities')->delete();\n \\DB::table('districts')->delete();\n // import provinces and cities from sql file\n $sqlFile = app_path() . '/../database/raw/administrative_indonesia_without_districts.sql';\n DB::unprepared(file_get_contents($sqlFile));\n $this->command->info('Successfully seed Provinces and Cities!');\n\n // import districts with latitude and longitude from csv file\n $csvFile = app_path() . '/../database/raw/administrative_indonesia_districts_with_lat_lng.csv';\n $districts = $this->csvToArray($csvFile);\n // check if lat lng exists\n foreach ($districts as $i => $d) {\n if ($d['latitude'] == '') $districts[$i]['latitude'] = 0;\n if ($d['longitude'] == '') $districts[$i]['longitude'] = 0;\n }\n // insert it\n $insert = District::insert($districts);\n if ($insert) $this->command->info('Successfully seed Districts!');\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(RegionsTableSeeder::class);\n $this->call(ProvincesTableSeeder::class);\n $this->call(DistrictsTableSeeder::class);\n $this->call(SubDistrictsTableSeeder::class);\n $this->call(PostcodesTableSeeder::class);\n\n if (env('APP_ENV') !== 'production') {\n // Wipe up 5 churches, and each church has 5 cells, and each cell has 20 members associated with.\n // In other word, we wipe up 500 church members.\n for ($i = 0; $i < 2; $i++) {\n $church = factory(\\App\\Models\\Church::class)->create();\n\n $church->areas()->saveMany(factory(\\App\\Models\\Area::class, 2)->create([\n 'church_id' => $church->id\n ])->each(function($area) {\n $area->cells()->saveMany(factory(\\App\\Models\\Cell::class, 2)->create([\n 'area_id' => $area->id\n ])->each(function($cell) {\n $cell->members()->saveMany(factory(App\\Models\\Member::class, 10)->create([\n 'cell_id' => $cell\n ]));\n }));\n }));\n }\n }\n }", "public function run()\n {\n User::create([\n 'name' => 'Regynald',\n 'email' => '[email protected]',\n 'password' => Hash::make('123456789'),\n 'url' => 'http://zreyleo-code.com',\n ]);\n\n User::create([\n 'name' => 'Leonardo',\n 'email' => '[email protected]',\n 'password' => Hash::make('123456789')\n ]);\n\n // seed sin model\n /* DB::table('users')->insert([\n 'name' => 'Regynald',\n 'email' => '[email protected]',\n 'password' => Hash::make('123456789'),\n 'url' => 'http://zreyleo-code.com',\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s')\n ]); */\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->environmentPath = env('APP_ENV') === 'production' ||\n env('APP_ENV') === 'qa' ||\n env('APP_ENV') === 'integration' ?\n 'Production':\n 'local';\n //disable FK\n Model::unguard();\n DB::statement(\"SET session_replication_role = 'replica';\");\n\n // $this->call(HrEmployeeTableSeeder::class);\n $this->call(\"Modules\\HR\\Database\\Seeders\\\\$this->environmentPath\\HrEmployeePosTableSeeder\");\n // $this->call(HrEmployeePresetsDiscountTableSeeder::class);\n\n // Enable FK\n DB::statement(\"SET session_replication_role = 'origin';\");\n Model::reguard();\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "protected static function seed()\n {\n foreach (self::fetch('database/seeds', false) as $file) {\n Bus::need($file);\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n $faker = F::create('App\\Proovedores');\n for($i=0; $i < 10; $i++){\n DB::table('users')->insert([\n 'usuario' => $i,\n 'password' => $i,\n 'email' => $faker->email,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Delete all records.\n DB::table('users')->delete();\n // Reset AUTO_INCREMENT.\n DB::table('users')->truncate();\n\n // Dev user.\n App\\Models\\User::create([\n 'email' => '[email protected]',\n 'password' => '$2y$10$t6q81nz.XrMrh20NHDvxUu/szwHBwgzPd.01e8uuP0qVy0mPa6H/e',\n 'first_name' => 'L5',\n 'last_name' => 'App',\n 'username' => 'l5-app',\n 'is_email_verified' => 1,\n ]);\n\n // Dummy users.\n TestDummy::times(10)->create('App\\Models\\User');\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n User::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // We did this for test purposes. Shouldn't be doing this for production\n $password = Hash::make('123456');\n\n User::create([\n 'name' => 'Administrator',\n 'email' => '[email protected]',\n 'password' => $password,\n ]);\n }", "public function run()\n {\n Model::unguard();\n \n factory('App\\User','admin')->create();\n factory('App\\Evento',100)->create();\n //factory('App\\User','miembro',10)->create();\n factory('App\\Telefono',13)->create();\n factory('App\\Notificacion',10)->create();\n factory('App\\Rubro',10)->create();\n factory('App\\Tecnologia',10)->create();\n factory('App\\Cultivo',10)->create();\n factory('App\\Etapa',10)->create();\n factory('App\\Variedad',10)->create();\n factory('App\\Caracteristica',10)->create();\n factory('App\\Practica',30)->create();\n factory('App\\Tag',15)->create();\n // $this->call(PracticaTableSeeder::class);\n $this->call(TrTableSeeder::class);\n $this->call(MesTableSeeder::class);\n $this->call(SemanasTableSeeder::class);\n $this->call(PsTableSeeder::class);\n $this->call(MsTableSeeder::class);\n $this->call(CeTableSeeder::class);\n $this->call(CvTableSeeder::class);\n $this->call(PtSeeder::class);\n \n\n Model::unguard();\n }", "public function run() {\n $this->call(UserSeeder::class);\n $this->call(PermissionSeeder::class);\n $this->call(CreateAdminUserSeeder::class);\n // $this->call(PhoneSeeder::class);\n // $this->call(AddressSeeder::class);\n\n $this->call(ContactFormSeeder::class);\n //$this->call(ContactSeeder::class);\n\n User::factory()->count(20)->create()->each(function ($user) {\n // Seed the relation with one address\n $address = Address::factory()->make();\n $user->address()->save($address);\n\n // Seed the relation with one phone\n $phone = Phone::factory()->make();\n $user->phone()->save($phone);\n\n // Seed the relation with 15 contacts\n $contact = Contact::factory()->count(25)->make();\n $user->contacts()->saveMany($contact);\n });\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n Activity::truncate();\n User::truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n $this->call(UserTableSeeder::class);\n $this->call(ActivityTableSeeder::class);\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n \\App\\User::truncate();\n \\App\\Category::truncate();\n \\App\\Product::truncate();\n \\App\\Transaction::truncate();\n DB::table('category_product')->truncate();\n\n \\App\\User::flushEventListeners();\n \\App\\Category::flushEventListeners();\n \\App\\Product::flushEventListeners();\n \\App\\Transaction::flushEventListeners();\n\n\n $usersQuentity = 1000;\n $categoriesQuentity = 30;\n $productsQuentity = 1000;\n $transactionsQuentity = 1000;\n\n factory(\\App\\User::class, $usersQuentity)->create();\n factory(\\App\\Category::class, $categoriesQuentity)->create();\n factory(\\App\\Product::class, $productsQuentity)->create()->each(\n function ($product){\n $categories = \\App\\Category::all()->random(mt_rand(1, 5))->pluck('id');\n\n $product->categories()->attach($categories);\n }\n );\n factory(\\App\\Transaction::class, $transactionsQuentity)->create();\n\n }", "public function run()\n {\n Eloquent::unguard();\n \n $this->call('AdminMemberTableSeeder');\n $this->call('BankInfoTableSeeder');\n $this->call('LocationLookUpTableSeeder');\n $this->call('OrderStatusTableSeeder');\n $this->call('AdminRoleTableSeeder');\n\n }", "public static function setUpBeforeClass()\n {\n parent::setUpBeforeClass();\n $app = require __DIR__ . '/../../bootstrap/app.php';\n /** @var \\Pterodactyl\\Console\\Kernel $kernel */\n $kernel = $app->make(Kernel::class);\n $kernel->bootstrap();\n $kernel->call('migrate:fresh');\n\n \\Artisan::call('db:seed');\n }", "public function run()\n {\n Model::unguard();\n\n if( !User::where('email', '[email protected]')->count() ) {\n User::create([\n 'nombre'=>'Nick'\n ,'apellidos'=>'Palomino'\n ,'email'=>'[email protected]'\n ,'password'=> Hash::make('1234567u')\n ,'celular'=>'966463589'\n ]);\n }\n\n $this->call('CategoriaTableSeeder');\n $this->call('WhateverSeeder');\n $this->call('ProductTableSeeder');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n Model::unguard();\n\n $this->command->info('seed start!');\n\n // 省市县\n $this->call('RegionTableSeeder');\n // 用户、角色\n $this->call('UserTableSeeder');\n // 权限\n $this->call('PurviewTableSeeder');\n // 博文分类\n $this->call('CategoryTableSeeder');\n // 博文、评论、标签\n $this->call('ArticleTableSeeder');\n // 心情\n $this->call('MoodTableSeeder');\n // 留言\n $this->call('MessageTableSeeder');\n // 文件\n $this->call('StorageTableSeeder');\n\n $this->command->info('seed end!');\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n {\n $this->call(RolesDatabaseSeeder::class);\n $this->call(UsersDatabaseSeeder::class);\n $this->call(LocalesDatabaseSeeder::class);\n $this->call(MainDatabaseSeeder::class);\n }", "public function run()\n {\n\n Schema::disableForeignKeyConstraints(); //in order to execute truncate before seeding\n\n $this->call(UsersTableSeeder::class);\n $this->call(PostCategoriesSeeder::class);\n $this->call(TagsSeeder::class);\n $this->call(PostsSeeder::class);\n\n Schema::enableForeignKeyConstraints();\n\n\n }", "public function run()\n {\n // DB::table('users')->insert([\n // ['id'=>1, 'email'=>'nhat','password'=>bcrypt(1234), 'lever'=>0]\n // ]);\n // $this->call(UsersTableSeeder::class);\n // $this->call(CatTableSeeder::class);\n // $this->call(TypeTableSeeder::class);\n // $this->call(AppTableSeeder::class);\n // $this->call(GameTableSeeder::class);\n \n \n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n $this->seedUsers();\n $this->seedAdmins();\n $this->seedMeals();\n\n $this->seedOrder();\n $this->seedOrderlist();\n\n $this->seedReload();\n }", "public function run()\n\t{\n\t\t//composer require fzaninotto/faker\n\t\t\n\t\t$this->call(populateAllSeeder::class);\n\t\t\n\t}", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n Model::unguard();\n\n $faker =Faker\\Factory::create();\n\n // $this->call(UserTableSeeder::class);\n\n $this->seedTasks($faker);\n $this->seedTags($faker);\n\n Model::reguard($faker);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n\n $this->call([\n CountriesSeeder::class,\n ProvincesSeeder::class,\n SettingsSeeder::class,\n AdminsTableSeeder::class,\n ]);\n }" ]
[ "0.8064933", "0.7848158", "0.7674873", "0.724396", "0.7216743", "0.7132209", "0.70970356", "0.70752203", "0.704928", "0.699208", "0.6987078", "0.69839287", "0.6966499", "0.68990964", "0.6868679", "0.68468624", "0.68307716", "0.68206114", "0.6803113", "0.6803113", "0.6801801", "0.6789746", "0.6788733", "0.6788008", "0.6786291", "0.67765796", "0.67742485", "0.677106", "0.67651874", "0.6761959", "0.675823", "0.67337847", "0.6733437", "0.67295784", "0.67290515", "0.6724652", "0.67226326", "0.6722267", "0.6721339", "0.6715842", "0.67070943", "0.67060536", "0.67031103", "0.6702514", "0.6702361", "0.67017967", "0.6695973", "0.6693496", "0.66868156", "0.66837406", "0.6678434", "0.66755766", "0.66726524", "0.666599", "0.664943", "0.6640641", "0.663921", "0.66387916", "0.6636016", "0.6633116", "0.6629787", "0.6627134", "0.6625862", "0.661699", "0.66093796", "0.6602538", "0.65996546", "0.659914", "0.6596484", "0.6596383", "0.65922767", "0.65922284", "0.65913564", "0.65889347", "0.65812707", "0.65811145", "0.6579546", "0.6578819", "0.6575912", "0.65749073", "0.6574314", "0.657148", "0.65696406", "0.6568972", "0.65624833", "0.6560332", "0.6559092", "0.6557491", "0.65555155", "0.6554255", "0.65509576", "0.6548099", "0.65479296", "0.6545845", "0.65443295", "0.65434265", "0.65432936", "0.654295", "0.65426385", "0.6541781", "0.6539325" ]
0.0
-1
Get or create fMD instance
public static function getInstance() { if ( self::$instance === NULL ) { self::$instance = new fMD(); } return self::$instance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getInstance()\n {\n if(is_null(self::$singleton)){\n self::$singleton = new System_MD();\n }\n\n return self::$singleton;\n }", "public static function create() {\n $factory = new static();\n return $factory->createFlo();\n }", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public function create(){\r\n\treturn new $this->class();\r\n }", "public static function factory() {\n\t\tstatic $instance = false;\n\t\tif ( ! $instance ) {\n\t\t\t$instance = new self();\n\t\t\t$instance->setup();\n\t\t}\n\t\treturn $instance;\n\t}", "static public function getInstance() {\n\t\treturn GeneralUtility::makeInstance('Fab\\Media\\ObjectFactory');\n\t}", "public static function getInstance() : Forge\n {\n return static::$instance = static::$instance ?: new static();\n }", "public static function factory() {\n\t\tstatic $instance = false;\n\n\t\tif ( ! $instance ) {\n\t\t\t$instance = new self();\n\t\t\t$instance->setup();\n\t\t}\n\n\t\treturn $instance;\n\t}", "public function getInstance(): object;", "public static function create(){\r\n\t\tif(self::$instance === null){\r\n\t\t\tself::$instance = new self();\r\n\t\t}\r\n\t\treturn self::$instance;\r\n\t}", "public function getInstance(): mixed;", "public function instance();", "public static function getInstance();", "public static function getInstance();", "public static function getInstance();", "public static function getInstance();", "public static function getInstance();", "public static function getInstance();", "public static function getInstance();", "public static function getInstance();", "public static function instance();", "public static function getInstance(): self;", "public static function factory() {\n\t\tstatic $instance;\n\n\t\tif ( ! $instance ) {\n\t\t\t$instance = new self();\n\t\t\t$instance->setup();\n\t\t}\n\n\t\treturn $instance;\n\t}", "public function getFactory(): Factory;", "public function getFactory() {}", "abstract public function get_instance();", "private function createFlo() {\n $flo = new Flo();\n // Get config from env variables or files.\n if ($config_env = getenv('FLO')) {\n $config_env = Yaml::parse($config_env);\n $config = new Config($config_env);\n }\n else {\n $fs = new Filesystem();\n\n $user_config = array();\n $user_config_file = getenv(\"HOME\") . '/.config/flo';\n if ($fs->exists($user_config_file)) {\n $user_config = Yaml::parse($user_config_file);\n }\n\n $project_config = array();\n $process = new Process('git rev-parse --show-toplevel');\n $process->run();\n if ($process->isSuccessful()) {\n $project_config_file = trim($process->getOutput()) . '/flo.yml';\n if ($fs->exists($project_config_file)) {\n $project_config = Yaml::parse($project_config_file);\n }\n }\n\n $config = new Config($user_config, $project_config);\n }\n $flo->setConfig($config);\n\n return $flo;\n }", "public static function getInstance()\n {\n if (null === static::$_instance) {\n static::$_instance = new \\medoo(\\Core\\Config::$db_connection);\n }\n \n return static::$_instance;\n }", "public static abstract function createInstance();", "public static function instance() {\n\t\treturn new self;\n\t}", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public static function getInstance()\n {\n return new self();\n }", "public function create()\n {\n return new $this->class;\n }", "public static function getInstance() {\n return new self();\n }", "public static function getInstance()\n {\n return self::$instance ?? self::getNewInstance();\n }", "public static function get_instance ();", "public static function create()\n {\n if (null === self::$instance) {\n self::$instance = new self();\n }\n\n return self::$instance;\n }", "abstract public function instance();", "public function &create()\n {\n $obj = null;\n\n if (class_exists($this->_class_name)) {\n // Assigning the return value of new by reference\n $obj = new $this->_class_name();\n }\n\n return $obj;\n }", "public static function instance() {\n\t\t$classe = get_called_class();\n\t\t$table = str_replace(\"db_\", \"\", $classe);\n\t\t$instance = db::instance(db::table($table));\n\t\treturn $instance;\n\t}", "static function factory()\n {\n if (self::$_instance == NULL) {\n self::$_instance = new self();\n }\n return self::$_instance;\n }", "static public function getInstance() {\n\t\t$objectManager = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');\n\t\treturn $objectManager->get('TYPO3\\CMS\\Vidi\\PersistenceObjectFactory');\n\t}", "public static function create(): self\n\t{\n\t\treturn (new static(...func_get_args()))->open();\n\t}", "static public function getInstance() {\n return new static();\n }", "public static function getInstance()\n {\n return new static;\n }", "public static function getInstance()\n {\n static $instance;\n if ( $instance )\n\n return $instance;\n $class = get_called_class();\n # echo \"new $class\\n\";\n\n return $instance = new $class;\n }", "public static function getInstance() {\n\t\tself::init();\n\t\treturn parent::getInstance();\n\t}", "public static function get_instance() {\n \t\tstatic $instance = null;\n \t\tif (is_null($instance)) {\n \t\t\t$instance = new self();\n \t\t}\n \t\treturn $instance;\n \t}", "function get_instance()\r\n{\r\n\t\r\n}", "public static function instance()\n {\n return new static;\n }", "public static function instance()\n {\n return new static;\n }", "public static function instance() {\n if ( ! isset( self::$instance ) && ! ( self::$instance instanceof FFW_PORT ) ) {\n self::$instance = new FFW_PORT;\n self::$instance->setup_constants();\n self::$instance->includes();\n // self::$instance->load_textdomain();\n // use @examples from public vars defined above upon implementation\n }\n return self::$instance;\n }", "public static function get_instance()\n {\n }", "public static function get_instance()\n {\n }", "public static function get_instance()\n {\n }", "public static function get_instance()\n {\n }", "public static function get_instance()\n {\n }", "public static function get_instance()\n {\n }", "public static function Instance(){\n\t\tif (self::$inst === null) {\n\t\t\tself::$inst = new MagratheaDebugger();\n\t\t}\n\t\treturn self::$inst;\n\t}", "public static function factory()\n {\n return new self;\n }", "static public function create()\n {\n return new static();\n }", "static public function create()\n\t{\n\t\treturn new static;\n\t}", "function &dbm()\n{\n\treturn dbManager::get_instance();\n}", "public static function forge()\n\t{\n\t\tif (empty(static::$instance)) {\n\t\t\tstatic::$instance = new static;\n\t\t}\n\t\t\n\t\treturn static::$instance;\n\t}", "public static function &CreateInstanceIfNotExists(){\n static $oInstance = null;\n\n if(!$oInstance instanceof self)\n $oInstance = new self();\n\n return $oInstance;\n }", "public static function get_instance() {\n\n\t\t\t// Check if instance is already exists.\n\t\t\tif ( is_null( self::$instance ) ) {\n\t\t\t\tself::$instance = new self();\n\t\t\t}\n\n\t\t\treturn self::$instance;\n\t\t}", "public static function instance()\n {\n return new static();\n }", "public static function instance()\n {\n return new static();\n }", "static function getInstance() : f_persistance\n {\n if (static::$instance == null)\n {\n static::$instance = new f_persistance();\n }\n return static::$instance;\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }" ]
[ "0.6461459", "0.6368495", "0.60753214", "0.60753214", "0.60753214", "0.6074871", "0.6074871", "0.6074871", "0.6074474", "0.6074474", "0.6074474", "0.6074474", "0.60210204", "0.60172546", "0.60031986", "0.59960485", "0.5971111", "0.5962281", "0.5928171", "0.5903206", "0.5869276", "0.5864057", "0.5864057", "0.5864057", "0.5864057", "0.5864057", "0.5864057", "0.5864057", "0.5864057", "0.5860332", "0.5853782", "0.58515453", "0.5845542", "0.5843907", "0.5841397", "0.5836907", "0.5826173", "0.58147204", "0.5810145", "0.5803605", "0.5803605", "0.5803605", "0.5787442", "0.5768457", "0.57644546", "0.5761599", "0.5753569", "0.5717681", "0.5712506", "0.5706967", "0.56995213", "0.5695397", "0.5690242", "0.5689864", "0.56883496", "0.56831104", "0.56734365", "0.5644589", "0.5634712", "0.5634368", "0.5634072", "0.5634072", "0.563104", "0.56278825", "0.56278825", "0.56278825", "0.56278825", "0.56268233", "0.5625855", "0.5625575", "0.5619846", "0.5615106", "0.56148934", "0.56140435", "0.55969024", "0.5579175", "0.55726576", "0.55678314", "0.55678314", "0.55653703", "0.55634344", "0.55634344", "0.55634344", "0.55634344", "0.55634344", "0.55634344", "0.55634344", "0.55634344", "0.55634344", "0.55634344", "0.55634344", "0.55634344", "0.55634344", "0.55634344", "0.55634344", "0.55634344", "0.55634344", "0.55634344", "0.55634344", "0.55634344" ]
0.77785313
0
$filters = array(array('filterID' => 'year', 'values' => array('1966','1966')));
public function search($qParameters, $sources, $page){ $filters = array(); $reqBody = array( "searchTerm" => $qParameters, "page" => $page, "pageSize" => 100, "source" => $sources, "filters" => $filters ); $response = $this->makeRequest("general", $reqBody); $response = json_decode($response, true); return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function findYearsByFilter($filter) {\n $filter2 = clone $filter;\n $filter2->year = null;\n $articles = $this->findByFilter($filter2);\n $yearArray = array();\n foreach($articles as $article) {\n $date = $article->getArticleDate();\n $year = $date->format('Y');\n if(!isset($yearArray[$year])) {\n $yearArray[$year] = array('count' => 0);\n }\n if(!isset($yearArray[$year]['value'])) {\n $yearFilter = clone $filter2;\n $yearFilter->year = $year;\n $yearArray[$year]['value'] = intval($year);\n $yearArray[$year]['searchFilter'] = $yearFilter;\n }\n $yearArray[$year]['count']++;\n }\n return $yearArray;\n }", "function get_init_filters($filtros = array(), $valores = array()){\n $res = array();\n foreach ($filtros as $filtro){\n $res[$filtro] = get_cfilter($filtro, $valores);\n }\n return $res;\n}", "function filterByYear($year) {\n $this->setDateFilter(self::DATE_FILTER_SELECTED_YEAR);\n $this->setAdditionalProperty('date_filter_year', (string) $year);\n }", "function getFilterSeason(){\n\t$season_set = Array();\n\n\tarray_push($season_set, 'Dublin');\n\tarray_push($season_set, 'Honululu');\n\tarray_push($season_set, 'Sydney');\n\tarray_push($season_set, 'Madrid');\n\tarray_push($season_set, 'Atlanta');\n\tarray_push($season_set, 'Milwaukee');\n\tarray_push($season_set, 'Vancouver');\n\n\treturn $season_set;\n}", "public function formatFilters($rawFilters){\n $filters = array();\n \n //LIBRARIAN NAME\n if(array_key_exists('librarian', $rawFilters)){ \n if($rawFilters['librarian'] != ''){\n $filters['librarian'] = $this->__getStaffById($rawFilters['librarian']);\n }\n } \n \n //PROGRAM NAME\n if(array_key_exists('program', $rawFilters)){ \n if($rawFilters['program'] != ''){\n $filters['program'] = $this->__getProgramById($rawFilters['program']);\n }\n } \n \n //INSTRUCTION TYPE\n if(array_key_exists('instructionType', $rawFilters)){ \n $instructionType = $this->formatInstructionType($rawFilters['instructionType']);\n $filters['instructionType'] = $instructionType;\n } \n \n //FILTER CRITERIA (academic, fiscal, calendar, semester, custom)\n if(array_key_exists('filterCriteria', $rawFilters)){ \n $instructionType = $this->formatInstructionType($rawFilters['instructionType']);\n $filters['instructionType'] = $instructionType;\n \n switch($rawFilters['filterCriteria']){\n case 'academic':\n array_key_exists('academicYear', $rawFilters) ? $year = $rawFilters['academicYear'] . '-' . ($rawFilters['academicYear'] + 1) : $year = '';\n $criteriaYear = \"Academic Year \" . $year;\n break;\n case 'calendar':\n array_key_exists('calendarYear', $rawFilters) ? $year = $rawFilters['calendarYear'] : $year = '';\n $criteriaYear = \"Calendar Year \" . $year;\n break;\n case 'fiscal':\n array_key_exists('fiscalYear', $rawFilters) ? $year = $rawFilters['fiscalYear'] . '-' . ($rawFilters['fiscalYear'] + 1) : $year = '';\n $criteriaYear = \"Fiscal Year \" . $year;\n break;\n case 'semester':\n array_key_exists('year', $rawFilters) ? $year = $rawFilters['year'] : $year = '';\n $criteriaYear = ucfirst($rawFilters['semester']) . ' ' . $year;\n break;\n case 'custom':\n array_key_exists('startDate', $rawFilters) ? $startDate = $rawFilters['startDate'] : $startDate = '';\n array_key_exists('endDate', $rawFilters) ? $endDate = $rawFilters['endDate'] : $endDate = '';\n $criteriaYear = 'Date Range: ' . $startDate . ' to ' . $endDate;\n break;\n }\n \n $filters['year'] = $criteriaYear;\n } \n \n //LEVEL \n if(array_key_exists('level', $rawFilters)){ \n $filters['level'] = ucfirst($rawFilters['level']);\n } \n \n //LAST n MONTHS\n if(array_key_exists('lastmonths', $rawFilters)){ \n $filters['lastmonths'] = 'Last '.$rawFilters['lastmonths'].' months';\n } \n \n return $filters;\n }", "private function createParamsFromDateFilter(array $dateFilter): array\n {\n return [\n 'FilterExpression' => '#field >= :value',\n 'ExpressionAttributeNames' => [\n '#field' => $dateFilter['field'],\n ],\n 'ExpressionAttributeValues' => [\n ':value' => [\n 'S' => date($dateFilter['format'], strtotime($dateFilter['value']))\n ]\n ]\n ];\n }", "function acf_set_filters($filters = array())\n{\n}", "function lib4ridora_construct_year_filter($form_state) {\n // Get the values out of the form.\n $year_type = $form_state['values']['year']['select'];\n $to = empty($form_state['values']['year']['to']) ? \"*\" : $form_state['values']['year']['to'];\n $from = empty($form_state['values']['year']['from']) ? \"*\" : $form_state['values']['year']['from'];\n // If nothing was entered in the date fields, exit early.\n if ($to == \"*\" && $from == \"*\") {\n return \"\";\n }\n\n // Convert to proper format for solr.\n if ($to != '*') {\n $to_date = new DateTime();\n $to = date_format($to_date->createFromFormat('Y/m/d/G:i:s', \"$to/12/31/23:59:59\"), 'Y-m-d\\TH:i:s\\Z');\n }\n if ($from != '*') {\n $from_date = new DateTime();\n $from = date_format($from_date->createFromFormat('Y/m/d/G:i:s', \"$from/01/01/0:00:00\"), 'Y-m-d\\TH:i:s\\Z');\n }\n\n // Return fq string.\n module_load_include(\"inc\", \"islandora_solr\", \"includes/utilities\");\n switch ($year_type) {\n case \"publication year\":\n $publication_year_field = islandora_solr_lesser_escape(variable_get('lib4ridora_solr_field_publication_year', 'mods_originInfo_encoding_w3cdtf_keyDate_yes_dateIssued_dt'));\n return \"$publication_year_field:[$from TO $to]\";\n\n case \"reporting year\":\n $reporting_year_field = islandora_solr_lesser_escape(variable_get('lib4ridora_solr_field_reporting_year', 'mods_originInfo_encoding_w3cdtf_type_reporting year_dateOther_dt'));\n return \"$reporting_year_field:[$from TO $to]\";\n\n default:\n return \"\";\n }\n}", "protected function addFilters($params) {\n $filters['filters']['startdate'] = date('Y-m-d');\n $filters['filters']['enddate'] = date('Y-m-d');\n \n if(isset($params['start'])) \n $filters['filters']['startdate'] = $params['start'];\n \n if(isset($params['end'])) \n $filters['filters']['enddate'] = $params['end'];\n \n return $filters;\n }", "public function setFilter($arrFilter);", "public function getFilter() :array;", "public function getFilterParameters(): array;", "public function getFilters(): array;", "public function getFilters(): array;", "public function filters()\n\t{\n\t\treturn array(\n\t\t\t'amount' => array(\n\t\t\t\tarray('Num::filter_number')\n\t\t\t),\n\t\t\t'price' => array(\n\t\t\t\tarray('Num::filter_number')\n\t\t\t)\n\t\t);\n\t}", "function buildURLArray ($filterarray) {\r\n global $urlfilter;\r\n global $i;\r\n // Iterate through each filter in the array\r\n foreach($filterarray as $itemfilter) {\r\n // Iterate through each key in the filter\r\n foreach ($itemfilter as $key =>$value) {\r\n if(is_array($value)) {\r\n foreach($value as $j => $content) { // Index the key for each value\r\n $urlfilter .= \"&itemFilter($i).$key($j)=$content\";\r\n }\r\n }\r\n else {\r\n if($value != \"\") {\r\n $urlfilter .= \"&itemFilter($i).$key=$value\";\r\n }\r\n }\r\n }\r\n $i++;\r\n }\r\n return \"$urlfilter\";\r\n }", "function alm_filters($array, $target){\n return ALMFilters::init($array, $target);\n}", "function culturefeed_search_ui_get_age_range_facet_options() {\n return array(\n 0 => array(\n 'name' => '0-2 ' . t('year'),\n 'query' => '(agefrom:[0 TO 2] OR keywords:\"ook voor kinderen\")',\n 'range' => '[0 TO 2]',\n ),\n 3 => array(\n 'name' => '3-5 ' . t('year'),\n 'query' => '(agefrom:[3 TO 5] OR keywords:\"ook voor kinderen\")',\n 'range' => '[3 TO 5]',\n ),\n 6 => array(\n 'name' => '6-8 ' . t('year'),\n 'query' => '(agefrom:[6 TO 8] OR keywords:\"ook voor kinderen\")',\n 'range' => '[6 TO 8]',\n ),\n 9 => array(\n 'name' => '9-11 ' . t('year'),\n 'query' => '(agefrom:[9 TO 11] OR keywords:\"ook voor kinderen\")',\n 'range' => '[9 TO 11]',\n ),\n );\n\n}", "public function getYearValues() {\n\t return array (\n\t array (2012),\n\t array (900),\n\t array (2050),\n\t array ('2050'),\n\t array ('year')\n\t );\n }", "function get_entries_records_for_year($entries, $year, $boundle)\n{\n $dates = get_year_dates($year);\n // Setting the start date is the first day of the selected year.\n $start_date = $dates['start_date'];\n // Setting the end date is the last day of the selected year.\n $end_date = $dates['end_date'];\n\n $entries_records = [];\n if (isset($entries)) {\n foreach ($entries as $entry) {\n $query = new EntityFieldQuery();\n $query->entityCondition('entity_type', 'entry_month_record')\n ->entityCondition('bundle', $boundle)\n ->fieldCondition('field_entry', 'target_id', $entry, '=')\n ->fieldCondition('field_entry_date', 'value', $start_date, '>=')\n ->fieldCondition('field_entry_date', 'value', $end_date, '<=')\n ->fieldOrderBy('field_entry_date', 'value')\n ->addMetaData('account', user_load(1));\n\n $records = $query->execute();\n\n if (!empty($records)) {\n $records_ids = array_keys($records['entry_month_record']);\n\n // Adding each records for an entry in the array of entry id.\n $entries_records[$entry] = $records_ids;\n }\n }\n }\n\n return $entries_records;\n}", "function get_years_to_search() {\n global $DB;\n $sql = \"SELECT date AS fecha FROM {report_user_statistics};\";\n $dates = $DB->get_records_sql($sql);\n $result = array();\n foreach ($dates as $date) {\n $fecha = new DateTime(\"@$date->fecha\");\n $result[$fecha->format('Y')] = $fecha->format('Y');\n }\n return $result;\n}", "function buildURLArray($filterarray)\n {\n global $urlfilter;\n global $i;\n // Iterate through each filter in the array\n foreach ($filterarray as $itemfilter) {\n // Iterate through each key in the filter\n foreach ($itemfilter as $key => $value) {\n if (is_array($value)) {\n foreach ($value as $j => $content) { // Index the key for each value\n $urlfilter .= \"&itemFilter($i).$key($j)=$content\";\n }\n } else {\n if ($value != \"\") {\n $urlfilter .= \"&itemFilter($i).$key=$value\";\n }\n }\n }\n $i++;\n }\n return \"$urlfilter\";\n }", "function genesisawesome_custom_filters( $filters ) {\n\n\t$filters['email'] = 'sanitize_email';\n\t$filters['integer'] = 'genesisawesome_intval';\n\n\treturn $filters;\n\n}", "public function withFilters(array $filters = array());", "static function processTutorFilters(array $filters)\n {\n // admins, dob range, date of commencement range, classes\n $result = array();\n if (isset($filters['name'])) {\n $result['name'] = array('$in' => array_map(function (string $filterString) {\n return new \\MongoDB\\BSON\\Regex(preg_quote($filterString), 'i');\n }, $filters['name']));\n }\n if (isset($filters['school'])) {\n $result['school'] = array('$in' => array_map(function (string $filterString) {\n return new \\MongoDB\\BSON\\Regex(preg_quote($filterString), 'i');\n }, $filters['school']));\n }\n if (isset($filters['gender'])) {\n $result['gender'] = array('$in' => $filters['gender']);\n }\n if (isset($filters['admin'])) {\n $result['admin'] = array('$in' => array_map('intval', $filters['admin']));\n }\n if (isset($filters['status'])) {\n $result['status'] = array('$in' => array_map('intval', $filters['status']));\n }\n if (isset($filters['dobLower']) && isset($filters['dobUpper'])) {\n $result['dob'] = array(\n '$gte' => new MongoDB\\BSON\\UTCDateTime(strtotime($filters['dobLower'][0]) * 1000),\n '$lte' => new MongoDB\\BSON\\UTCDateTime(strtotime($filters['dobUpper'][0]) * 1000)\n );\n } else if (isset($filters['dobLower'])) {\n $result['dob'] = array(\n '$gte' => new MongoDB\\BSON\\UTCDateTime(strtotime($filters['dobLower'][0]) * 1000)\n );\n } else if (isset($filters['dobUpper'])) {\n $result['dob'] = array(\n '$lte' => new MongoDB\\BSON\\UTCDateTime(strtotime($filters['dobUpper'][0]) * 1000)\n );\n }\n if (isset($filters['joinLower']) && isset($filters['joinUpper'])) {\n $result['doc'] = array(\n '$gte' => new MongoDB\\BSON\\UTCDateTime(strtotime($filters['joinLower'][0]) * 1000),\n '$lte' => new MongoDB\\BSON\\UTCDateTime(strtotime($filters['joinUpper'][0]) * 1000)\n );\n } else if (isset($filters['joinLower'])) {\n $result['doc'] = array(\n '$gte' => new MongoDB\\BSON\\UTCDateTime(strtotime($filters['joinLower'][0]) * 1000)\n );\n } else if (isset($filters['joinUpper'])) {\n $result['doc'] = array(\n '$lte' => new MongoDB\\BSON\\UTCDateTime(strtotime($filters['joinUpper'][0]) * 1000)\n );\n }\n if (isset($filters['excludeIds'])) {\n if (!isset($result['_id'])) {\n $result['_id'] = array();\n }\n $result['_id']['$nin'] = $filters['excludeIds'];\n }\n // TODO filter by classes\n return $result;\n }", "public function yearProvider()\n {\n return array(\n // year = 1\n array('11111111111111111', array(2001, 2031)),\n // year = K\n array('1M8GDM9AXKP042788', array(1989, 2019)),\n // year = 3\n array('5GZCZ43D13S812715', array(2003, 2033)),\n // invalid year\n array('5GZCZ43D1US812715', array())\n );\n }", "function get_all_by_key_by_year(){\n\t\t$sql = \"SELECT * \n\t\t\t\tFROM evs_database.evs_set_form_attitude\n\t\t\t\tWHERE sft_pos_id = ? AND sft_pay_id = ?\";\n $query = $this->db->query($sql, array($this->sft_pos_id, $this->sft_pay_id));\n\t\treturn $query;\n\n\t}", "public function getFiltred(array &$data);", "public function getFilter($value) {\n\t$filter = array();\n\tif ($value && !is_array($value)) {\n\t $filter[$this->field] = $value;\n\t}\n\treturn $filter;\n }", "public function setFilters($arrayofFieldValues)\n\t{\n\t\t$i = 0;\n\t\t$this->filters = '';\n\n\t\tforeach ($arrayofFieldValues as $field => $value)\n\t\t{\n\t\t\tif ($i == count($arrayofFieldValues) - 1)\n\t\t\t{\n\t\t\t\t$this->filters .= \"$field:$value\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->filters .= \"$field:$value AND \";\n\t\t\t}\n\n\t\t\t$i++;\n\t\t}\n\t}", "function translate_filter ($filter,$dir='db') \n{ \n $url = array(\"category\", \"location\", \"start_date\", \"end_date\");\n $db = array(\"categories\", \"locations\", \"startDate\", \"endDate\");\n $return = array();\n \n foreach ($filter as $key=>$val) {\n if ($dir == 'db') \n $key = str_replace($url,$db,$key);\n if ($dir == 'url') \n $key = str_replace($db,$url,$key);\n $return[$key] = $val;\n }\n \n return $return;\n}", "function _get_filters(){\n $flt = array();\n $filters = array();\n\n if(!isset($_REQUEST['dataflt'])){\n $flt = array();\n }elseif(!is_array($_REQUEST['dataflt'])){\n $flt = (array) $_REQUEST['dataflt'];\n }else{\n $flt = $_REQUEST['dataflt'];\n }\n foreach($flt as $key => $line){\n // we also take the column and filtertype in the key:\n if(!is_numeric($key)) $line = $key.$line;\n $f = $this->_parse_filter($line);\n if(is_array($f)){\n $f['logic'] = 'AND';\n $filters[] = $f;\n }\n }\n return $filters;\n }", "public function mapFilterArray( $filter )\n {\n $xlat = array( 0 => 'NULL' );\n if (!is_array ($filter)) {\n printf(\"Exception in function <strong>%s</strong>, input value is not array and have <strong>%s</strong> type \", __FUNCTION__, gettype($filter));\n die();\n }\n foreach ($filter as $param => $count)\n {\n for ($i = 1; $i <= $count; $i++) $xlat[] = $param;\n }\n return $xlat;\n }", "function get_all_by_key_by_year() {\t\n\t\t$sql = \"SELECT * \n\t\t\t\tFROM evs_database.evs_set_form_g_and_o\n\t\t\t\tWHERE sfg_pos_id = ? AND sfg_pay_id = ?\";\n\t\t$query = $this->db->query($sql, array($this->sfg_pos_id, $this->sfg_pay_id));\n\t\treturn $query;\n\t}", "function get_filters($init_data = true) {\n //no filters by default\n return array();\n }", "function lib4ridora_construct_filter_string_from_array($filters) {\n $total = count($filters);\n\n switch ($total) {\n case 0:\n return \"\";\n\n case 1:\n return reset($filters);\n\n default:\n return implode($filters, \" OR \");\n }\n}", "function jt_cmb2_esc_date_year_range( $check, $meta_value, $field_args, $field_object ) {\n\tif ( ! is_array( $meta_value ) || ! $field_args['repeatable'] ) {\n\t\treturn $check;\n\t}\n\n\tforeach ( $meta_value as $key => $val ) {\n\t\t$meta_value[ $key ] = array_filter( array_map( 'esc_attr', $val ) );\n\t}\n\n\treturn array_filter( $meta_value );\n}", "public function getAllData(array $filters = []);", "public function filter($value, $filter) {\n if (is_array($value)) {\n foreach ($value as $i => $val)\n $value[$i] = $this->filter($val, $filter);\n }\n else if (is_array($filter)) {\n foreach ($filter as $f)\n $value = $this->filter($value, $f);\n }\n else {\n $fname = \"filter\";\n $arr = explode(\"_\", $filter);\n foreach ($arr as $a)\n $fname.= ucwords($a);\n if (is_callable([$this, $fname]))\n return $this->$fname($value);\n else\n return $value;\n }\n return $value;\n }", "function jt_cmb2_sanitize_date_year_range( $check, $meta_value, $object_id, $field_args, $sanitizer ) {\n\n\t// if not repeatable, bail out.\n\tif ( ! is_array( $meta_value ) || ! $field_args['repeatable'] ) {\n\t\treturn $check;\n\t}\n\n\tforeach ( $meta_value as $key => $val ) {\n\t\t$meta_value[ $key ] = array_filter( array_map( 'sanitize_text_field', $val ) );\n\t}\n\n\treturn array_filter( $meta_value );\n}", "public function SetFilters (array $filters = []);", "function modify_filters ($filter,$mods) \n{ \n $new_filter = array_merge($filter,$mods);\n return $new_filter;\n}", "function filter_to_url ($filter) \n{\n /* Turns a filter into a usable URL, must provide url formatted $filter in \n order to work properly. Use the translate_filter function. */\n \n foreach ($filter as $key=>$param) $url[] = $key.'='.$param;\n $url = implode('&',$url);\n return '?'.$url;\n}", "public static function createParams($filters) {\n\t\t$params = array();\n\n\t\tforeach($filters as $key => $value) {\n\t\t\tif($value !== false && $value !== null) {\n\t\t\t\t$params[\":\".$key] = $value;\n\t\t\t}\n\t\t}\n\n\t\treturn $params;\n\t}", "function get_active_filter_values($filter_name) {\n global $SESSION;\n\n mtrace('<br><font color=red>NOTICE: $this->get_active_filter_values() is now deprecated; use php_report_filtering_get_active_filter_values($this->get_report_shortname(),$filter_name) instead (sorry... lol)</font><br>');\n\n $result = array();\n\n /* DOES NOT WORK ANYMORE\n if(!empty($this->id)) {\n $filtering_array =& $SESSION->user_index_filtering[$this->id];\n } else {\n $filtering_array =& $SESSION->user_filtering;\n }\n\n if (isset($filtering_array[$filter_name])) {\n $result = $filtering_array[$filter_name];\n }\n */\n\n $reportid = 'php_report_' . $this->get_report_shortname();\n\n if (isset($SESSION->php_report_default_params)) {\n $params = $SESSION->php_report_default_params;\n\n foreach ($params as $key=>$val) {\n if ($key == $reportid.'/'.$filter_name) {\n $result[] = array('value'=>$val);\n }\n }\n }\n\n if (!empty($result)) {\n return $result;\n } else {\n return false;\n }\n }", "abstract public function filters();", "public function __construct (array $filters) {\n\t\t$this->_filters = $filters;\n\t}", "public function GetFilters ();", "public function createFilter();", "function culturefeed_search_ui_default_filter_options($filter_form_number) {\n\n $defaults = array(\n 1 => array(\n array(\n 'exposed' => TRUE,\n 'title' => 'Free only',\n 'query-string' => 'free-only',\n 'api-filter-query' => 'price:0'\n ),\n array(\n 'exposed' => TRUE,\n 'title' => 'No courses and workshops',\n 'query-string' => 'no-courses-workshops',\n 'api-filter-query' => '!category_id:0.3.1.0.0'\n ),\n array(\n 'exposed' => TRUE,\n 'title' => 'For toddlers',\n 'query-string' => 'voor-kinderen',\n 'api-filter-query' => '(agefrom:[* TO 12] OR keywords:\"ook voor kinderen\")'\n ),\n array(\n 'exposed' => TRUE,\n 'title' => 'For UiTPAS and Paspartoe',\n 'query-string' => 'uitpas',\n 'api-filter-query' => '(keywords:uitpas* OR Paspartoe)'\n ),\n ),\n 2 => array(\n array(\n 'exposed' => TRUE,\n 'title' => 'Hide long-running events',\n 'query-string' => 'no-periods',\n 'api-filter-query' => 'periods:false'\n ),\n array(\n 'exposed' => TRUE,\n 'title' => 'Hide permanent events',\n 'query-string' => 'no-permanent',\n 'api-filter-query' => 'permanent:false'\n ),\n ),\n 3 => array(\n array(\n 'exposed' => TRUE,\n 'title' => 'Free only',\n 'query-string' => 'free-only',\n 'api-filter-query' => 'price:0'\n ),\n array(\n 'exposed' => TRUE,\n 'title' => 'No courses and workshops',\n 'query-string' => 'no-courses-workshops',\n 'api-filter-query' => '!category_id:0.3.1.0.0'\n ),\n array(\n 'exposed' => TRUE,\n 'title' => 'For toddlers',\n 'query-string' => 'voor-kinderen',\n 'api-filter-query' => '(agefrom:[* TO 12] OR keywords:\"ook voor kinderen\")'\n ),\n array(\n 'exposed' => TRUE,\n 'title' => 'For UiTPAS and Paspartoe',\n 'query-string' => 'uitpas',\n 'api-filter-query' => '(keywords:uitpas* OR Paspartoe)'\n ),\n ),\n );\n\n return isset($defaults[$filter_form_number]) ? $defaults[$filter_form_number] : array();\n\n}", "public function __construct($_filters)\r\n\t{\r\n\t\tparent::__construct(array('Filters'=>$_filters));\r\n\t}", "function get_flat_entries_records_for_year($entries, $year, $bundle)\n{\n\n $dates = get_year_dates($year);\n // Setting the start date is the first day of the selected year.\n $start_date = $dates['start_date'];\n // Setting the end date is the last day of the selected year.\n $end_date = $dates['end_date'];\n\n if (!empty($entries)) {\n $query = new EntityFieldQuery();\n $query->entityCondition('entity_type', 'entry_month_record')\n ->entityCondition('bundle', $bundle)\n ->fieldCondition('field_entry', 'target_id', $entries, 'IN')\n ->fieldCondition('field_entry_date', 'value', $start_date, '>=')\n ->fieldCondition('field_entry_date', 'value', $end_date, '<=')\n ->fieldOrderBy('field_entry_date', 'value')\n ->addMetaData('account', user_load(1));\n $records = $query->execute();\n if (!empty($records)) {\n $records_ids = array_keys($records['entry_month_record']);\n // Adding each records for an entry in the array of entry id.\n }\n } else {\n return [];\n }\n\n return $records_ids;\n}", "public static function getDateFilterTypes()\n\t{\n\t\t$dateFilters = Array('custom' => array('label' => 'LBL_CUSTOM'),\n\t\t\t'prevfy' => array('label' => 'LBL_PREVIOUS_FY'),\n\t\t\t'thisfy' => array('label' => 'LBL_CURRENT_FY'),\n\t\t\t'nextfy' => array('label' => 'LBL_NEXT_FY'),\n\t\t\t'prevfq' => array('label' => 'LBL_PREVIOUS_FQ'),\n\t\t\t'thisfq' => array('label' => 'LBL_CURRENT_FQ'),\n\t\t\t'nextfq' => array('label' => 'LBL_NEXT_FQ'),\n\t\t\t'yesterday' => array('label' => 'LBL_YESTERDAY'),\n\t\t\t'today' => array('label' => 'LBL_TODAY'),\n\t\t\t'tomorrow' => array('label' => 'LBL_TOMORROW'),\n\t\t\t'lastweek' => array('label' => 'LBL_LAST_WEEK'),\n\t\t\t'thisweek' => array('label' => 'LBL_CURRENT_WEEK'),\n\t\t\t'nextweek' => array('label' => 'LBL_NEXT_WEEK'),\n\t\t\t'lastmonth' => array('label' => 'LBL_LAST_MONTH'),\n\t\t\t'thismonth' => array('label' => 'LBL_CURRENT_MONTH'),\n\t\t\t'nextmonth' => array('label' => 'LBL_NEXT_MONTH'),\n\t\t\t'last7days' => array('label' => 'LBL_LAST_7_DAYS'),\n\t\t\t'last15days' => array('label' => 'LBL_LAST_15_DAYS'),\n\t\t\t'last30days' => array('label' => 'LBL_LAST_30_DAYS'),\n\t\t\t'last60days' => array('label' => 'LBL_LAST_60_DAYS'),\n\t\t\t'last90days' => array('label' => 'LBL_LAST_90_DAYS'),\n\t\t\t'last120days' => array('label' => 'LBL_LAST_120_DAYS'),\n\t\t\t'next15days' => array('label' => 'LBL_NEXT_15_DAYS'),\n\t\t\t'next30days' => array('label' => 'LBL_NEXT_30_DAYS'),\n\t\t\t'next60days' => array('label' => 'LBL_NEXT_60_DAYS'),\n\t\t\t'next90days' => array('label' => 'LBL_NEXT_90_DAYS'),\n\t\t\t'next120days' => array('label' => 'LBL_NEXT_120_DAYS')\n\t\t);\n\t\tforeach ($dateFilters as $filterType => $filterDetails) {\n\t\t\t$dateValues = \\DateTimeRange::getDateRangeByType($filterType);\n\t\t\t$dateFilters[$filterType]['startdate'] = $dateValues[0];\n\t\t\t$dateFilters[$filterType]['enddate'] = $dateValues[1];\n\t\t}\n\t\treturn $dateFilters;\n\t}", "function billingcutoffdates ($yearSelect=\"\" ) {\n\n\tif(empty($yearSelect))\n\t$sql=\"SELECT b.`BillingCutoffDates` FROM billing_calendar b\";\n\telse\n\t$sql=\"SELECT b.`BillingCutoffDates` FROM billing_calendar b WHERE YEAR(b.`BillingCutoffDates`)= YEAR('$yearSelect')\";\n\n\t$result = dbi_query($sql);\n\t$j=0;\n\twhile($row = dbi_fetch_row($result))\n\t{\n\t\t$bcdt[$j]= $row[0];\n\t\t$j++;\n\t}\n\tdbi_free_result ( $result );\n\n\treturn $bcdt;\n}", "abstract protected function getFilters();", "function acf_get_filters()\n{\n}", "public function setFacetFilters($arrayofFieldValues)\n\t{\n\t\t$i = 0;\n\n\t\tforeach ($arrayofFieldValues as $field => $value)\n\t\t{\n\t\t\t$this->facetFilters .= ($i == count($arrayofFieldValues) - 1) ? \"$field:$value\" : \"$field:$value , \";\n\t\t\t$i++;\n\t\t}\n\t}", "public static function findByYear($year, $fields = \"*\", $retarray = false) {\r\n $dq = Doctrine_Query::create ()\r\n ->select ( $fields )\r\n ->from ( 'InvoicesSettings is' )\r\n ->where ( 'is.year = ?'.$year )\r\n ->andWhere('is.isp_id = ?',Shineisp_Registry::get('ISP')->isp_id)\r\n ->limit ( 1 );\r\n \r\n $retarray = $retarray ? Doctrine_Core::HYDRATE_ARRAY : null;\r\n $record = $dq->execute ( array (), $retarray );\r\n return $record;\r\n }", "public function parseData(array $params, $filters = array())\n {\n $data = array();\n\n if (!empty($filters['skyp'])){\n return $params;\n }\n foreach ($params as $input) {\n if (is_array($filters) && array_key_exists($input['name'], $filters)) {\n $input['value'] = \\Zend_Filter::filterStatic($input['value'], $filters[$input['name']]);\n }\n\n $data[$input['name']] = $input['value'];\n }\n\n return $data;\n }", "public function GetAllFacturesVentesByYear() {\n if ($this->get_request_method() != \"POST\") {\n $this->response('', 406);\n }\n \n if (isset($_REQUEST['data'])) {\n $idSociete = $_REQUEST['data'][\"idSociete\"];\n $filterYear = $_REQUEST['data'][\"filterYear\"];\n // Input validations\n if (!empty($idSociete) && !empty($filterYear)) {\n try {\n $sql = $this->db->prepare(\"SELECT idFacture,date as dateCre,total,YEAR(date) AS factYear FROM facturevente WHERE idEtat != 5 and YEAR(date) = :filterYear AND idSociete = :idSociete\");\n $sql->bindParam('idSociete', $idSociete, PDO::PARAM_INT);\n $sql->bindParam('filterYear', $filterYear, PDO::PARAM_STR);\n $sql->execute();\n\n if ($sql->rowCount() > 0) {\n $result = array();\n while ($rlt = $sql->fetchAll()) {\n $result[] = $rlt;\n }\n // If success everythig is good send header as \"OK\" and return list of users in JSON format\n $this->response($this->json($result[0]), 200);\n }\n $this->response('', 204); // If no records \"No Content\" status\n } catch (Exception $ex) {\n $this->response('', $ex->getMessage());\n }\n }\n }\n \n }", "function xh_listFilters()\r\n\t{\r\n\t}", "function filter(){\n //$_SESSION['filters'] = array('GPA' => ['2.0', '3.0']), 'Nationality' => ['saudi'], 'Company_size' => ['large'], 'Major' => ['Computer Science', 'Marketing', 'Finance']);\n if($_GET['checked'] == \"true\"){\n if(!isset($_SESSION['filters'])){\n $_SESSION['filters'] = array();\n }\n if(isset($_SESSION['filters'][$_GET['category']])){\n array_push($_SESSION['filters'][$_GET['category']], $_GET['value']);\n } else{\n $_SESSION['filters'][$_GET['category']] = array();\n array_push($_SESSION['filters'][$_GET['category']], $_GET['value']);\n }\n // echo extractQuery();\n echo json_encode(printRecords(1));\n }else{\n if(isset($_SESSION['filters'][$_GET['category']])){\n unset($_SESSION['filters'][$_GET['category']][array_search($_GET['value'],$_SESSION['filters'][$_GET['category']])]);\n $_SESSION['filters'][$_GET['category']] = removeGaps($_SESSION['filters'][$_GET['category']]);\n if(count($_SESSION['filters'][$_GET['category']]) === 0){\n unset($_SESSION['filters'][$_GET['category']]);\n if(count($_SESSION['filters']) === 0){\n unset($_SESSION['filters']);\n }\n }\n }\n // echo extractQuery();\n echo json_encode(printRecords(1));\n }\n }", "public function filters()\n {\n return array(\n 'value' => array(\n array(array($this, 'check_for_array_or_object')),\n )\n );\n }", "public function get_filters($vars=array()) {\n\n if(!empty($vars))\n { \n $activities = (isset($vars['activities']) && ($vars['activities']!=\"\")) ? $vars['activities'] : \"\";\n $environment = (isset($vars['environment']) && ($vars['environment']!=\"\")) ? $vars['environment'] : \"\";\n $weather = (isset($vars['weather']) && ($vars['weather']!=\"\")) ? $vars['weather'] : \"\"; \n $season = (isset($vars['season']) && ($vars['season']!=\"\")) ? $vars['season'] : \"\";\n $continent = (isset($vars['destination_continent']) && ($vars['destination_continent']!=\"\")) ? $vars['destination_continent'] : \"\";\n $destination = (isset($vars['destination_city']) && ($vars['destination_city']!=\"\")) ? $vars['destination_city'] : \"\";\n \n $age_group = (isset($vars['age_group']) && ($vars['age_group']!=\"\")) ? $vars['age_group'] : \"\";\n $price_from = (isset($vars['price_from']) && ($vars['price_from']!=\"\")) ? $vars['price_from'] : 0;\n $price_to = (isset($vars['price_to']) && ($vars['price_to']!=\"\")) ? $vars['price_to'] : 0;\n $departure_date = (isset($vars['departure_date']) && ($vars['departure_date']!=\"\")) ? $vars['departure_date'] : \"\";\n $return_date = (isset($vars['return_date']) && ($vars['return_date']!=\"\")) ? $vars['return_date'] : \"\";\n \n if(($season != \"\") || ($destination != \"\") || ($environment != \"\") || ($continent != \"\") || \n ($age_group != \"\") || ($price_from != \"\") || ($weather != \"\") || ($activities != \"\"))\n { \n $condition = \"1=1\";\n if($season != \"\")\n { \n $condition .=\" AND (Season LIKE '%$season%')\";\n }\n if($destination != \"\")\n { \n $condition .=\" AND (City LIKE '%$destination%')\";\n }\n if($environment != \"\")\n { \n $condition .=\" AND (Environment LIKE '%$environment%')\";\n }\n if($continent != \"\")\n { \n $condition .=\" AND (Continent LIKE '%$continent%')\";\n }\n if($age_group != \"\")\n { \n $condition .=\" AND (Age = '$age_group')\";\n }\n if( ($price_from >= 0) && ($price_to > 0) )\n { \n $condition .=\" AND (ActivityPrice BETWEEN '$price_from' AND '$price_to' )\";\n }\n \n if( ($departure_date != \"\" && $return_date != \"\") )\n { \n $condition .=\" AND ( (date1 BETWEEN '$departure_date' AND '$return_date') )\";\n }\n /* \n if( ($return_date != \"\") )\n { \n $condition .=\" AND (data2 <z= '$return_date') \";\n }\n \n if($activities != \"\")\n { \n $condition .=\" OR (city LIKE '%$activities%') \";\n }*/\n if($weather != \"\")\n { \n $condition .= \" AND (MATCH(Weather) AGAINST('$weather' IN BOOLEAN MODE))\";\n }\n /*\n if($activities != \"\")\n { \n $condition .= \"(MATCH(weather) AGAINST('$activities' IN BOOLEAN MODE)) OR \";\n }\n if($activities != \"\")\n { \n $condition .= \"(MATCH(environment) AGAINST('$activities' IN BOOLEAN MODE)) OR \";\n }*/\n if($activities != \"\")\n { \n //prepare condition using MYSQL NATURAL LANGUAGE MODE\n $condition .= \" AND (MATCH(Activities) AGAINST('$activities' IN BOOLEAN MODE)) \";\n }\n }else\n { \n return false;\n \n } // end if(($season != \"\") || ($destination != \"\") || \n \n }else\n { \n return false;\n $condition = \" 1='1' \"; \n }\n\n //echo $condition; //die();\n $this->db->select('*');\n $this->db->from('filter');\n $this->db->where($condition);\n $query = $this->db->get(); //print_r($this->db); die();\n if ($query->num_rows() > 0) {\n return $query->result();\n } else {\n return false;\n }\n}", "function sort_record_by_year( $value, $post_id, $field ) {\n // vars\n $order = array();\n \n // bail early if no value\n if( empty($value) ) {\n return $value; \n }\n \n // populate order\n foreach( $value as $i => $row ) {\n \n $order[ $i ] = $row['field_5cf50f064b39c'];\n \n }\n \n // multisort\n array_multisort( $order, SORT_DESC, $value );\n \n // return \n return $value;\n \n}", "public function filterOne(array $filter)\n\t{\n\t\t// foreach ($filters as $column => $value) {\n\t\t// \tif($value->isValueSet()) {\n\t\t// \t\t$this->data_source->addFilter(array($column => $value->getValue()));\n\t\t// \t}\n\t\t// }\n\t\t//dump(\"filterOne\");\n\t\treturn $this;\n\t}", "public static function filter_books_by_year($books, $year) {\n\t\t$result = [];\n\t\tforeach ($books as $book) {\n\t\t\t$first_date = date_create($year.'-01-01');\n\t\t\t$last_date = date_create($year.'-12-31');\n\t\t\t$book_date = date_create($book->release_at);\n\t\t\tif ($book_date >= $first_date && $book_date <= $last_date)\n\t\t\t\tarray_push($result, $book);\n\t\t}\n\t\treturn $result;\n\t}", "function setDateFilter($value) {\n return $this->setAdditionalProperty('date_filter', $value);\n }", "function acf_enable_filters($filters = array())\n{\n}", "protected function prepareFilter()\n\t{\n\t\tglobal $USER;\n\t\tglobal $DB;\n\n\t\t$arFilter = array();\n\t\t$arFilter[\"USER_ID\"] = $USER->GetID();\n\t\t$arFilter[\"LID\"] = SITE_ID;\n\n\t\tif (strlen($_REQUEST[\"filter_id\"]))\n\t\t{\n\t\t\tif ($this->options['USE_ACCOUNT_NUMBER'])\n\t\t\t\t$arFilter[\"ACCOUNT_NUMBER\"] = $_REQUEST[\"filter_id\"];\n\t\t\telse\n\t\t\t\t$arFilter[\"ID\"] = intval($_REQUEST[\"filter_id\"]);\n\t\t}\n\n\t\tif (strlen($_REQUEST[\"filter_date_from\"]))\n\t\t\t$arFilter[\"DATE_FROM\"] = trim($_REQUEST[\"filter_date_from\"]);\n\t\tif (strlen($_REQUEST[\"filter_date_to\"]))\n\t\t{\n\t\t\t$arFilter[\"DATE_TO\"] = trim($_REQUEST[\"filter_date_to\"]);\n\n\t\t\tif ($arDate = ParseDateTime(trim($_REQUEST[\"filter_date_to\"]), $this->dateFormat))\n\t\t\t{\n\t\t\t\tif (StrLen(trim($_REQUEST[\"filter_date_to\"])) < 11)\n\t\t\t\t{\n\t\t\t\t\t$arDate[\"HH\"] = 23;\n\t\t\t\t\t$arDate[\"MI\"] = 59;\n\t\t\t\t\t$arDate[\"SS\"] = 59;\n\t\t\t\t}\n\n\t\t\t\t$arFilter[\"DATE_TO\"] = date($DB->DateFormatToPHP($this->dateFormat), mktime($arDate[\"HH\"], $arDate[\"MI\"], $arDate[\"SS\"], $arDate[\"MM\"], $arDate[\"DD\"], $arDate[\"YYYY\"]));\n\t\t\t}\n\t\t}\n\n\t\tif (strlen($_REQUEST[\"filter_status\"]))\n\t\t\t$arFilter[\"STATUS_ID\"] = trim($_REQUEST[\"filter_status\"]);\n\n\t\tif (strlen($_REQUEST[\"filter_payed\"]))\n\t\t\t$arFilter[\"PAYED\"] = trim($_REQUEST[\"filter_payed\"]);\n\n\t\tif(!isset($_REQUEST['show_all']) || $_REQUEST['show_all'] == 'N')\n\t\t{\n\t\t\tif($_REQUEST[\"filter_history\"]!=\"Y\")\n\t\t\t\t$arFilter[\"!@COMPLETE_ORDERS\"] = $this->arParams['HISTORIC_STATUSES'];\n\n\t\t\tif(isset($_REQUEST[\"filter_history\"]) && $_REQUEST[\"filter_history\"] == \"Y\")\n\t\t\t\t$arFilter[\"@COMPLETE_ORDERS\"] = $this->arParams['HISTORIC_STATUSES'];\n\t\t}\n\n\t\tif (strlen($_REQUEST[\"filter_canceled\"]))\n\t\t\t$arFilter[\"CANCELED\"] = trim($_REQUEST[\"filter_canceled\"]);\n\n\t\t$this->filter = $arFilter;\n\t}", "public function getFilterArray() {\n\t\t$filter = null;\n\t\tif (isset($_GET['sub_category'])) {\n\t\t\t$filter = array('category' => array($_GET['sub_category']));\n\t\t} else if (isset($_GET['category'])) {\n\t\t\t$filter = array('category' => array($_GET['category']));\n\n\t\t\t$subcategory_list = $this->category_model->get_sub_category_list_by_category_id($_GET['category'], array('id'));\n\t\t\tforeach ($subcategory_list as $subcategory) {\n\t\t\t\tarray_push($filter['category'], $subcategory->id);\n\t\t\t}\n\t\t}\n\n\t\tif(isset($_GET['course'])){\n\t\t\t\t$filter['title'] = $_GET['course'];\n\t\t}\n\n\t\tif (isset($_GET['search'])) {\n\t\t\t$filter['search_text'] = $_GET['search'];\n\t\t}\n\n\t\t\n\t\treturn $filter;\n\t}", "function get_datevalues(&$results, $params, $downzoom) {\r\n\n\n$datevalues = array();\r\n\r\n\tforeach ($results->facet_counts->facet_ranges->file_modified_dt->counts as $facet=>$count) {\r\n\t\t$newstart = $facet;\r\n\r\n\t\tif ($downzoom=='decade') {\r\n\t\t\t$newend = $facet . '+10YEARS';\r\n\r\n\t\t\t$value = substr($facet, 0, 4);\r\n\r\n\t\t} elseif ($downzoom=='year') {\r\n\t\t\t$newend = $facet . '+1YEAR';\r\n\t\t\t$value = substr($facet, 0, 4);\r\n\r\n\t\t} elseif ($downzoom=='month') {\r\n\t\t\t$newend = $facet . '+1MONTH';\r\n\t\t\t$value = substr($facet, 5, 2);\r\n\r\n\t\t} elseif ($downzoom=='day') {\r\n\t\t\t$newend = $facet . '+1DAY';\r\n\t\t\t$value = substr($facet, 8, 2);\r\n\r\n\t\t} elseif ($downzoom=='hour') {\r\n\t\t\t$newend = $facet . '+1HOUR';\r\n\t\t\t$value = substr($facet, 11, 2);\r\n\r\n\t\t} elseif ($downzoom=='minute') {\r\n\t\t\t$newend = $facet . '+1MINUTE';\r\n\t\t\t$value = substr($facet, 14, 2);\r\n\r\n\t\t} else {\r\n\t\t\t$newend = $facet . '+1YEAR';\r\n\t\t\t$value = $facet;\r\n\t\t};\r\n\r\n\r\n\t\t$link = buildurl($params,'start_dt', $newstart, 'end_dt', $newend, 'zoom', $downzoom, 's', false);\r\n\r\n\t\t$datevalues[] = array('label'=> $value, 'count' => $count, 'link' => $link);\r\n\t}\r\n\n\treturn $datevalues;\r\n}", "function lib4ridora_construct_publication_type_filter($form_state) {\n // Collect the selected values.\n $genres = array();\n foreach ($form_state['values']['pub_type'] as $genre) {\n if ($genre) {\n $genres[] = $genre;\n }\n }\n\n // Exit early if no check box was selected.\n if (empty($genres)) {\n return \"\";\n }\n\n module_load_include(\"inc\", \"islandora_solr\", \"includes/utilities\");\n $publication_type_field = islandora_solr_lesser_escape(variable_get('lib4ridora_solr_field_publication_type', 'mods_genre_ms'));\n\n $field_names = array_fill(0, count($genres), $publication_type_field);\n\n $filters = array_map(\"lib4ridora_construct_solr_statement\", $field_names, $genres);\n\n return lib4ridora_construct_filter_string_from_array($filters);\n}", "private static function _getFilter() {}", "function getFilterFromRequest() {\n\t\t$_filter = array();\n\n\t\tif(isset($_REQUEST['filterSelect_0'])) {\n\n\n\t\t\t$_parse = true;\n\t\t\t$_count = 0;\n\n\t\t\twhile ($_parse) {\n\t\t\t\tif(isset($_REQUEST['filterSelect_'.$_count])) {\n\n\t\t\t\t\tif(isset($_REQUEST['filterLogic_'.$_count]) && $_REQUEST['filterLogic_'.$_count]=='OR') {\n\t\t\t\t\t\t$_logic = 'OR';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$_logic = 'AND';\n\t\t\t\t\t}\n\t\t\t\t\tif(isset($_REQUEST['filterValue_'.$_count]) && trim($_REQUEST['filterValue_'.$_count])<>'') {\n\t\t\t\t\t\t$_filter[] = array(\n\t\t\t\t\t\t\t\t'logic' => $_logic,\n\t\t\t\t\t\t\t\t'field' => $_REQUEST['filterSelect_'.$_count],\n\t\t\t\t\t\t\t\t'operation' => $_REQUEST['filterOperation_'.$_count],\n\t\t\t\t\t\t\t\t'value' => $_REQUEST['filterValue_'.$_count]\n\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\t$_count++;\n\t\t\t\t} else {\n\t\t\t\t\t$_parse = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $_filter;\n\t}", "public function filtering();", "private function createFeeProgressesByFilter(array $filters, $feeYear){\r\n\t\t$filters = new Membership_Model_SoMemberFilter($filters, 'AND');\r\n\t\t// search memberships: result will be one record in maximum\r\n\t\t$membershipIds = $this->search(\r\n\t\t\t$filters,\r\n\t\t\tnew Tinebase_Model_Pagination(array('sort' => 'id', 'dir' => 'ASC')),\r\n\t\t\tfalse,\r\n\t\t\ttrue\r\n\t\t);\r\n\t\t$failCount = 0;\r\n\t\t$successCount = 0;\r\n\t\t$success = true;\r\n\t\t$failInfo = array();\r\n\t\t\r\n\t\tMembership_Api_JobManager::getInstance()->setTaskCount(count($membershipIds));\r\n\t\t\r\n\t\tforeach($membershipIds as $memberId){\r\n\t\t\ttry{\r\n\t\t\t\t$membership = $this->getSoMember($memberId);\r\n\t\t\t\tMembership_Custom_SoMember::createFeeProgress($membership, $feeYear);\r\n\t\t\t\t$successCount++;\r\n\t\t\t\tMembership_Api_JobManager::getInstance()->countOk();\r\n\t\t\t}catch(Exception $e){\r\n\t\t\t\t$success = false;\r\n\t\t\t\t$failCount++;\r\n\t\t\t\t$failInfo[] = array(\r\n\t\t\t\t\t'memberId' => $membership->getId(),\r\n\t\t\t\t\t'membershipType' => $membership->__get('membership_type')\r\n\t\t\t\t);\r\n\t\t\t\tthrow $e;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tMembership_Api_JobManager::getInstance()->notifyTaskDoneOk();\r\n\t\t}\r\n\t\treturn array(\r\n\t\t\t'success' => $success,\r\n\t\t\t'info' => array(\r\n\t\t\t\t'failCount' => $failCount,\r\n\t\t\t\t'successCount' => $successCount,\r\n\t\t\t\t'failInfo' => $failInfo\r\n\t\t\t)\r\n\t\t);\r\n\t\t\r\n\t}", "public function paramsFilter(){\n\t\t\t\n\t\t\t$f = [];\n\t\t\t\n\t\t\t// Установка металла\n\t\t\t$add = [\n 'type' => \"checkbox-group\",\n 'title' => 'Металл',\n 'variabled' => 'metall',\n 'impact' => 'filter',\n 'data' => []\n\t\t\t]; \n\t\t\t$metallList = ['Комбинированное золото','Красное золото','Белое золото','Золочёное серебро','Чернёное серебро'];\n\t\t\t$metallListVals = ['kombinZoloto','krasnZoloto','belZoloto','zoloZoloto','chernZoloto']; \n\t\t\tforeach( $metallList as $k => $v ){\n\t\t\t\t$add['data'][] = [\n 'title' => $v,\n 'variabled' => $metallListVals[$k] \n\t\t\t\t];\n\t\t\t} \n\t\t\t$f[] = $add;\n\t\t\t\n\t\t\t// Установка для кого\n\t\t\t$add = [\n 'type' => \"checkbox-group\",\n 'title' => 'Для кого',\n 'variabled' => 'sex',\n 'impact' => 'filter',\n 'data' => []\n\t\t\t]; \n\t\t\t$dlaKogo = ['Для женщин','Для мужчин', 'Для женщин, Для мужчин'];\n\t\t\t$dlaKogoVals = ['woman','men', 'unisex']; \n\t\t\tforeach( $dlaKogo as $k => $v ){\n\t\t\t\t$add['data'][] = [\n 'title' => $v,\n 'variabled' => $dlaKogoVals[$k] \n\t\t\t\t];\n\t\t\t} \n\t\t\t$f[] = $add;\n\t\t\t\n\t\t\t// Установка размера\n\t\t\t$add = [\n 'type' => \"checkbox-group\",\n 'title' => 'Размер',\n 'variabled' => 'size',\n 'impact' => 'filter',\n 'data' => []\n\t\t\t]; \n\t\t\t$razmerList = ['2.0','12.0','13.0','13.5','14.0','14.5','15.0','15.5','16.0','16.5','17.0','17.5','18.0','18.5','19.0','19.5','20.0','20.5','21.0','21.5','22.0','22.5','23.0','23.5','24.0','24.5','25.0'];\n\t\t\t$razmerListVals = ['2_0','12_0','13_0','13_5','14_0','14_5','15_0','15_5','16_0','16_5','17_0','17_5','18_0','18_5','19_0','19_5','20_0','20_5','21_0','21_5','22_0','22_5','23_0','23_5','24_0','24_5','25_0']; \n\t\t\tforeach( $razmerList as $k => $v ){\n\t\t\t\t$add['data'][] = [\n 'title' => $v,\n 'variabled' => $razmerListVals[$k] \n\t\t\t\t];\n\t\t\t} \n\t\t\t$f[] = $add; \n\t\t\t\n\t\t\t// Установка вставки\n\t\t\t$add = [\n 'type' => \"checkbox-group\",\n 'title' => 'Вставка',\n 'variabled' => 'kamen',\n 'impact' => 'filter',\n 'data' => []\n\t\t\t]; \n\t\t\t$kamenList = ['Бриллиант','Сапфир','Изумруд','Рубин','Жемчуг','Топаз','Аметист','Гранат','Хризолит','Цитрин','Агат','Кварц','Янтарь','Опал','Фианит'];\n\t\t\t$kamenListVals = ['brilliant','sapfir','izumrud','rubin','jemchug','topaz','ametist','granat','hrizolit','citrin','agat','kvarc','jantar','opal','fianit']; \n\t\t\tforeach( $kamenList as $k => $v ){\n\t\t\t\t$add['data'][] = [\n 'title' => $v,\n 'variabled' => $kamenListVals[$k] \n\t\t\t\t];\n\t\t\t} \n\t\t\t$f[] = $add;\n\t\t\t\n\t\t\t// Установка формы вставки\n\t\t\t$add = [\n 'type' => \"checkbox-group\",\n 'title' => 'Форма вставки',\n 'variabled' => 'forma_vstavki',\n 'impact' => 'filter',\n 'data' => []\n\t\t\t];\t\t\t\n\t\t\t$formaList = ['Кабошон','Круг','Овал','Груша','Маркиз', 'Багет', 'Квадрат', 'Октагон', 'Триллион', 'Сердце', 'Кушон', 'Пятигранник', 'Шестигранник', 'Восьмигранник'];\n\t\t\t$formaListVals = ['Kaboshon','Krug','Oval','Grusha','Markiz', 'Baget', 'Kvadrat', 'Oktagon', 'Trillion', 'Serdtce', 'Kushon', 'Piatigranniq', 'Shestigranniq', 'Vosmigrannic']; \n\t\t\tforeach( $formaList as $k => $v ){\n\t\t\t\t$add['data'][] = [\n 'title' => $v,\n 'variabled' => $formaListVals[$k] \n\t\t\t\t];\n\t\t\t} \n\t\t\t$f[] = $add;\n \n /*\n\t\t\t\techo json_encode( $f );\n\t\t\t*/\n\t\t\techo \"<pre>\";\n\t\t\tprint_r( $f );\n\t\t\techo \"</pre>\";\t\n\t\t\t\n\t\t\t\n \n \n // металл\n \n // для кого\n \n // размер\n \n // Камень\n \n // Форма вставки\n \n \n /*{\"type\":\"checkbox-group\",\"title\":\"Размер\",\"variabled\":\"Razmer\",\"impact\":\"products\",\"data\":[{\"title\":\"2.0\",\"value\":\"\",\"variabled\":\"2_0\"},{\"title\":\"12.0\",\"value\":\"\",\"variabled\":\"12_0\"},{\"title\":\"13.0\",\"value\":\"\",\"variabled\":\"13_0\"},{\"title\":\"13.5\",\"value\":\"\",\"variabled\":\"13_5\"},{\"title\":\"14.0\",\"value\":\"\",\"variabled\":\"14_0\"},{\"title\":\"14.5\",\"value\":\"\",\"variabled\":\"14_5\"},{\"title\":\"15.0\",\"value\":\"\",\"variabled\":\"15_0\"},{\"title\":\"15.5\",\"value\":\"\",\"variabled\":\"15_5\"},{\"title\":\"16.0\",\"value\":\"\",\"variabled\":\"16_0\"}]},\n\t\t\t\t\n\t\t\t\t{\"type\":\"checkbox-group\",\"title\":\"Проба\",\"variabled\":\"Proba\",\"impact\":\"products\",\"data\":[{\"title\":\"585\",\"value\":\"\",\"variabled\":\"proba_585\"},{\"title\":\"925\",\"value\":\"\",\"variabled\":\"proba_925\"}]},\n\t\t\t\t\n\t\t\t{\"type\":\"checkbox-group\",\"title\":\"Металл\",\"variabled\":\"Metall\",\"impact\":\"products\",\"data\":[{\"title\":\"Золото\",\"value\":\"\",\"variabled\":\"met_zoloto\"},{\"title\":\"Серебро\",\"value\":\"\",\"variabled\":\"met_serebro\"}]}*/\n \n\t\t\t/*\n\t\t\t[{\"type\":\"range-values\",\"title\":\"Цена\",\"variabled\":\"Cena\",\"impact\":\"price\",\"data\":[{\"title\":\"Цена от:\",\"value\":\"0\",\"variabled\":\"_ot\"},{\"title\":\"Цена до:\",\"value\":\"900000\",\"variabled\":\"_do\"}]},{\"type\":\"checkbox-group\",\"title\":\"Размер\",\"variabled\":\"Razmer\",\"impact\":\"products\",\"data\":[{\"title\":\"2.0\",\"value\":\"\",\"variabled\":\"2_0\"},{\"title\":\"12.0\",\"value\":\"\",\"variabled\":\"12_0\"},{\"title\":\"13.0\",\"value\":\"\",\"variabled\":\"13_0\"},{\"title\":\"13.5\",\"value\":\"\",\"variabled\":\"13_5\"},{\"title\":\"14.0\",\"value\":\"\",\"variabled\":\"14_0\"},{\"title\":\"14.5\",\"value\":\"\",\"variabled\":\"14_5\"},{\"title\":\"15.0\",\"value\":\"\",\"variabled\":\"15_0\"},{\"title\":\"15.5\",\"value\":\"\",\"variabled\":\"15_5\"},{\"title\":\"16.0\",\"value\":\"\",\"variabled\":\"16_0\"}]},{\"type\":\"checkbox-group\",\"title\":\"Проба\",\"variabled\":\"Proba\",\"impact\":\"products\",\"data\":[{\"title\":\"585\",\"value\":\"\",\"variabled\":\"proba_585\"},{\"title\":\"925\",\"value\":\"\",\"variabled\":\"proba_925\"}]},{\"type\":\"checkbox-group\",\"title\":\"Металл\",\"variabled\":\"Metall\",\"impact\":\"products\",\"data\":[{\"title\":\"Золото\",\"value\":\"\",\"variabled\":\"met_zoloto\"},{\"title\":\"Серебро\",\"value\":\"\",\"variabled\":\"met_serebro\"}]}]*/\n\t\t\t\n\t\t\t\n\t\t}", "function add_filters()\n {\n }", "public function filterID($data=array())\n\n\t{\n\n\t\t$arrayVariable = (isset($data['arrayVariable']) && count($data['arrayVariable'])>0) ? $data['arrayVariable'] : array();\n\n\t\t$filterIndex = (isset($data['filterIndex']) && !empty($data['arrayVariable'])) ? $data['filterIndex'] : '';\n\n\t\t$returnArray = array();\n\n\t\tif(count($arrayVariable)>0 && !empty($filterIndex)) {\n\n\t\t\tforeach($arrayVariable as $value) {\n\n\t\t\t\t$returnArray[] = $value[$filterIndex];\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn $returnArray;\n\n\t}", "private function filterOptions(){\n $request = new Request();\n\n $key = $request->query->get('key') ? $this->global_helper_service->cleanDataInput($request->query->get('key')) : '';\n $date_range = $request->query->get('date_range') ? $request->query->get('date_range') : '';\n\n $array_filters = array();\n\n $array_filters['key'] = array(\n 'type' => 'input',\n 'title' => 'Search',\n 'default_value' => $key\n );\n\n $array_filters['date_range'] = array(\n 'type' => 'date_picker',\n 'title' => 'Date Range',\n 'options' => '',\n 'default_value' => $date_range\n );\n\n return $this->admincp_service->handleElementFormFilter($array_filters);\n }", "public function filters(){\r\r\n\t\treturn CMap::mergeArray(parent::filters(),array(\r\r\n\t\t\t\r\r\n\t\t));\r\r\n\t}", "function get_detailsFilter($fromYear,$toYear){\n $CoID = $this->session->userdata('CoID') ;\n $WorkYear = $this->session->userdata('WorkYear') ; \n\n $sql = \" \n select \n BillNo, \n BillDate, \n GodownID, \n SaleMast.PartyCode CPName, \n PartyMaster.PartyName PartyTitle, \n BrokerID, \n Broker.ACTitle BrokerTitle, \n BillAmt\n \n from SaleMast, PartyMaster, ACMaster Broker\n\n where SaleMast.PartyCode = PartyMaster.PartyCode\n and SaleMast.CoID = PartyMaster.CoID \n and SaleMast.WorkYear = PartyMaster.WorkYear \n \n and SaleMast.BrokerId = Broker.ACCode\n and SaleMast.CoID = Broker.CoID\n and SaleMast.WorkYear = Broker.WorkYear\n\n and SaleMast.CoID = '$CoID'\n and SaleMast.WorkYear = '$WorkYear'\n and BillDate BETWEEN '$fromYear' AND '$toYear'\n order by BillDate DESC, CAST(BillNo AS Integer) DESC \n \";\n $result = $this->db->query($sql)->result_array();\n\n if(empty($result)){\n $emptyArray=array(\"empty\"); \n return array($emptyArray,$fromYear,$toYear);\n }\n\n return array($result,$fromYear,$toYear); \n }", "private function getFacet($encodedFilters)\n {\n $facet = new Facet();\n $facet->setLabel('Price');\n $facet->setDisplayed(true);\n $facet->setWidgetType('checkbox');\n $facet->setMultipleSelectionAllowed(true);\n\n $filter = new Filter();\n $filter->setLabel('$10 - $18');\n $filter->setType('price');\n $filter->setDisplayed(true);\n $filter->setMagnitude(4);\n $filter->setProperty('symbol', '$');\n $filter->setValue(['from' => '14', 'to' => '18']);\n $filter->setNextEncodedFacets('price-$-10-18');\n\n /**\n * We need to check that filter is active so that it's visible to user.\n */\n if ($encodedFilters == 'price-$-10-18' || $encodedFilters == 'price-$-10-18/price-$-18-23') {\n $filter->setActive(true);\n }\n\n /**\n * we need to check nextEncodedFacets so later PrestaShop knows both filters were selected\n */\n if ($encodedFilters == 'price-$-18-23') {\n $filter->setNextEncodedFacets('price-$-10-18/price-$-18-23');\n }\n\n\n $facet->addFilter($filter);\n $filter = new Filter();\n $filter->setLabel('$18 - $23');\n $filter->setType('price');\n $filter->setDisplayed(true);\n $filter->setMagnitude(4);\n $filter->setProperty('symbol', '$');\n $filter->setValue(['from' => '18', 'to' => '23']);\n $filter->setNextEncodedFacets('price-$-18-23');\n if ($encodedFilters == 'price-$-18-23' || $encodedFilters == 'price-$-10-18/price-$-18-23') {\n $filter->setActive(true);\n }\n if ($encodedFilters == 'price-$-10-18') {\n $filter->setNextEncodedFacets('price-$-10-18/price-$-18-23');\n }\n\n $facet->addFilter($filter);\n\n return $facet;\n }", "public function filter($data);", "private function filters() {\n\n\n\t}", "public function getFiltersStatistics(): array\n {\n $getColumnFilters = array(\n 'statistics' => array(\n 'year' => array(),\n 'ageRange' => array(\n 'exceptColumn' => 'Gesamt'\n ),\n 'region' => array(),\n 'detail' => array(),\n 'gender' => array(\n 'exceptColumn' => 'Gesamt'\n )\n ),\n );\n\n try {\n $filterData = $this->getUniqueDataColumn($getColumnFilters);\n } catch (\\Exception $e) {\n return array('status' => 'error', 'message' => $e->getMessage());\n }\n\n return array('status' => 'success', 'result' => $filterData);\n }", "public function setFilter(array $filter)\n {\n return $this->setArgs(['filter' => $filter]);\n }", "protected function _createFilters(array $params){\n if(is_array($params)){\n if(array_key_exists('d', $params) && array_key_exists('lon', $params) && array_key_exists('lat', $params)){\n $helper = $this->_query->getHelper();\n $this->_query->createFilterQuery('geo')->setQuery(\n $helper->geofilt(\n $params['lat'],\n $params['lon'],\n 'coordinates',\n $params['d'])\n );\n }\n\n\n\tif(($this->_map === true) && !in_array($this->_getRole(), $this->_allowed) && ($this->_core === 'beowulf')){\n\t\t$this->_query->createFilterQuery('knownas')->setQuery('-knownas:[\"\" TO *]');\n\t\t$this->_query->createFilterQuery('hascoords')->setQuery('gridref:[\"\" TO *]');\n\t} elseif($this->_map === true && ($this->_core === 'beowulf')) {\n\t\t$this->_query->createFilterQuery('hascoords')->setQuery('gridref:[\"\" TO *]');\n\t}\n\n if(array_key_exists('bbox',$params)){\n \t$coords = new Pas_Solr_BoundingBoxCheck($params['bbox']);\n $bbox = $coords->checkCoordinates();\n \t$this->_query->createFilterQuery('bbox')->setQuery($bbox);\n\n }\n\n foreach($params as $key => $value){\n if(!in_array($key, $this->_schemaFields)) {\n unset($params[$key]);\n }\n }\n if(isset($params['thumbnail'])){\n $this->_query->createFilterQuery('thumbnails')->setQuery('thumbnail:[1 TO *]');\n unset($params['thumbnail']);\n }\n $this->_checkFieldList($this->_core, array_keys($params));\n foreach($params as $key => $value){\n $this->_query->createFilterQuery($key . $value)->setQuery($key . ':\"'\n . $value . '\"');\n }\n } else {\n throw new Pas_Solr_Exception('The search params must be an array');\n }\n }", "function testMultipleFilters() {\n\t\t$this->setUrl('/search/advanced?r=org&q[gen_name][op]=CONTAINS&q[gen_name][value]=crm&q[gen_created][op]=AFTER&q[gen_created][value]=1%2F2%2F2011');\n\t\t$this->app->go();\n\t\t$this->assertFalse(Flash::Instance()->hasErrors());\n\t\t$this->assertPattern('/id=\"qb_gen_created\"/', $this->view->output);\n\t\t$this->assertPattern('/<th>Creation Time<\\/th>/', $this->view->output);\n\t\t$collection = $this->view->get('collection');\n\t\t$names = $collection->pluck('name');\n\t\t$this->assertEqual($names, array('Zanzibar CRM'));\n\t}", "function getListYear($data,$start=1,$end=2)\n{\n #awal = Start Year\n #akhir = End Year\n $property = $data;\n \n $awal = date('Y')-$start;\n $akhir = date('Y')+$end;\n if($property==''){\n $select = date('Y');\n }\n else{\n $select = $property;\n } \n $i = $awal; \n for($i>=$awal;$i<=$akhir;$i++)\n {\n #cond Selection\n if($i==$select){\n $sta = 'selected';\n }\n else{\n $sta = '';\n } \n echo '<option value=\"'.$i.'\" '.$sta.'>'.$i.'</option>';\n }\n}", "public function setFilter($filter){ }", "public function getFilters(): array\n {\n return [];\n }", "private function prepareFilters($filters) {\n\n if(isset($filters['tags'])){\n $filters['tags'] = implode(',', $filters['tags']);\n }\n\n if(isset($filters['exclude_tags'])){\n $filters['exclude_tags'] = implode(',', $filters['exclude_tags']);\n }\n\n return $filters;\n }", "private function prepareFilters($filters) {\n\n if(isset($filters['tags'])){\n $filters['tags'] = implode(',', $filters['tags']);\n }\n\n if(isset($filters['exclude_tags'])){\n $filters['exclude_tags'] = implode(',', $filters['exclude_tags']);\n }\n\n return $filters;\n }", "public function searchActiveCelebritiesWorldYear($year = 2015)\n {\n $intervalStart = $year .'-01-01 00:00:00';\n\t\t$intervalEnd = $year .'-12-31 00:00:00';\n\t\t\n\t\t$query = ArtistPlan::find()\n\t\t\t->innerJoin('artist', 'artistplan.artist_id = artist.id')\n\t\t\t->andWhere(['artistplan.show_status' => 1])\n\t\t\t->andWhere(['artist.show_status' => 1])\n\t\t\t->andWhere(['artist.celebrity_status' => 1])\n\t\t\t->andWhere(['between', 'start_date', self::$startOfTime, $intervalEnd])\n\t\t\t->andWhere(['between', 'end_date', $intervalStart, self::$endOfTime])\n\t\t\t->orderBy([\"artist.show_order\" => SORT_ASC]);\n\t\t\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n\t\t\t'pagination' => [\n\t\t\t\t'pageSize' => 40\n\t\t\t]\n ]);\n\n return $dataProvider;\n }", "function update_filters($sid, $metadata=null)\n {\n if (!is_array($metadata)){ \n return false;\n }\n\n $core_fields=$this->get_core_fields($metadata);\n\n\t\t$this->update_years($sid,$core_fields['year_start'],$core_fields['year_end']);\n $this->Survey_country_model->update_countries($sid,$core_fields['nations']);\n $this->add_tags($sid,$this->get_array_nested_value($metadata,'tags'));\n return true;\n }", "function update_filters($sid, $metadata=null)\n {\n if (!is_array($metadata)){ \n return false;\n }\n\n $core_fields=$this->get_core_fields($metadata);\n\n\t\t$this->update_years($sid,$core_fields['year_start'],$core_fields['year_end']);\n $this->Survey_country_model->update_countries($sid,$core_fields['nations']);\n $this->add_tags($sid,$this->get_array_nested_value($metadata,'tags'));\n return true;\n }", "public function getFilterValues()\n {\n return $this->filter_values;\n }", "function lib4ridora_construct_research_data_filter(&$form_state) {\n if ( @!isset($form_state['values']['research_data']['yes']) ) {\n\treturn;\n }\n $ary = array_map('trim',explode('|',variable_get('lib4ridora_solr_field_research_data', 'mods_extension_resource_identifier_mt | mods:extension/mods:resource/mods:identifier[@identifierTyp=\"DOI\"]')));\n if ( @empty($ary[0]) /* at [1] there should be the MODS-X-Path */ ) {\n\treturn;\n }\n module_load_include(\"inc\", \"islandora_solr\", \"includes/utilities\");\n\n // Get field name out of configuration.\n $solr_field = islandora_solr_lesser_escape( $ary[0] );\n\n $filters = array();\n if ( $form_state['values']['research_data']['yes'] ) {\n $filters[] = $solr_field . ':*';\n }\n if ( $form_state['values']['research_data']['no'] ) {\n $filters[] = '-' . $solr_field . ':*';\n }\n return lib4ridora_construct_filter_string_from_array($filters);\n}", "public function createDefaultListFinderFilters(){\n \n $filters = array();\n \n $filters['id'] = new EqualsFilter('id', 'text', array(\n 'label' => 'ID'\n ));\n \n return $filters;\n \n }" ]
[ "0.6714391", "0.6136223", "0.6127686", "0.6119043", "0.61112213", "0.6046634", "0.6035294", "0.5943246", "0.59021324", "0.5865693", "0.58638084", "0.5863005", "0.5787611", "0.5779367", "0.57574", "0.573959", "0.56847537", "0.56809354", "0.56777495", "0.56719065", "0.5645949", "0.5624526", "0.56185687", "0.56173575", "0.5565441", "0.5531892", "0.5523071", "0.5486538", "0.5478001", "0.5475188", "0.5468478", "0.546748", "0.5457305", "0.5456271", "0.5442297", "0.5434662", "0.5429087", "0.54059047", "0.5402073", "0.54006505", "0.5376395", "0.5372444", "0.5361944", "0.53617436", "0.53611094", "0.53564686", "0.5355397", "0.53486335", "0.53483003", "0.5346031", "0.534144", "0.53396475", "0.5336287", "0.5315263", "0.5314652", "0.53138024", "0.5291325", "0.52857465", "0.52852035", "0.52781487", "0.52701813", "0.52612853", "0.52550197", "0.52503985", "0.52370185", "0.52345", "0.5229897", "0.52191633", "0.52082837", "0.5195512", "0.5192063", "0.51880604", "0.51876473", "0.51833737", "0.51795614", "0.5178745", "0.5178237", "0.5177762", "0.517407", "0.5164748", "0.5159854", "0.51550263", "0.51493907", "0.51493216", "0.5143911", "0.5142478", "0.51382995", "0.5137266", "0.51302016", "0.512872", "0.5125066", "0.512467", "0.51183677", "0.5103232", "0.5103232", "0.50891227", "0.50878006", "0.50878006", "0.50854164", "0.50797284", "0.50736696" ]
0.0
-1
Prepare and make http request.
public function makeRequest($requestType, $requestBody){ $request = $this->prepareUrl($requestType); if(empty($request['url']) || empty($request['type'])){ /* $this->errorMessage($requestType, 'Error in preparing http request.'); return;*/ return json_encode(array('error' => 'Error in preparing http request.')); } $requestConfig = array( 'adapter' => 'Zend_Http_Client_Adapter_Proxy', 'proxy_host' => get_option('libco_server_proxy'), 'timeout' => 900 ); $restClient = new Zend_Rest_Client(); $httpClient = $restClient->getHttpClient(); $httpClient->resetParameters(); $httpClient->setUri($request['url']); $httpClient->setConfig($requestConfig); $httpClient->setHeaders('Content-Type', 'application/json'); $httpClient->setRawData(json_encode($requestBody)); $response = $httpClient->request($request['type']); if($response->getStatus() === 200) return $response->getBody(); else return json_encode(array('error' => "http connection error: ".$response->getStatus().", ".$response->getMessage())); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function request() {\r\n\t\t$this->verbose('protocol', $this->protocol);\r\n\t\t$this->verbose('method', $this->method);\r\n\t\t$this->verbose('host', $this->host);\r\n\t\t$this->verbose('path', $this->path);\r\n\t\t$this->verbose('query', $this->query);\r\n\t\t$this->verbose('headers', $this->headers);\r\n\t\t$this->verbose('body', $this->body);\r\n\t\t$this->verbose('timeout', $this->timeout);\r\n\r\n\t\t$this->addQueryToPath();\r\n\t\t$this->verbose('path + query', $this->path);\r\n\t\t$this->cleanHost();\r\n\t\t$this->verbose('cleanHost', $this->host);\r\n\r\n\t\t$url = $this->protocol . '://' . $this->host . $this->path;\r\n\t\t$this->verbose('url', $url);\r\n\r\n\t\t$this->headers['Authorization'] = $this->makeAuthHeader();\r\n\r\n\r\n\t\tforeach ($this->headers as $header_key => $header_value) {\r\n\t\t\t$header_array[] = $header_key . \":\" . $header_value;\r\n\t\t}\r\n\r\n\t\t$ch = curl_init();\r\n\t\t$options = array(\r\n\t\t\tCURLOPT_URL => $url,\r\n\t\t\tCURLOPT_RETURNTRANSFER => 1,\r\n\t\t\tCURLOPT_CUSTOMREQUEST => $this->method,\r\n\t\t\tCURLOPT_POSTFIELDS => $this->body,\r\n\t\t\tCURLOPT_HEADER => false,\r\n\t\t\tCURLINFO_HEADER_OUT => true,\r\n\t\t\tCURLOPT_HTTPHEADER => $header_array,\r\n\t\t\tCURLOPT_TIMEOUT => $this->timeout\r\n\t\t);\r\n\t\tcurl_setopt_array($ch, $options);\r\n\r\n\t\t$this->verbose('body at exec', $this->body);\r\n\t\t$response_body = curl_exec($ch);\r\n\t\t$response_error = curl_error($ch);\r\n\t\t$response_headers = curl_getinfo($ch);\r\n\t\tcurl_close($ch);\r\n\r\n\t\t$response['error'] = $response_error;\r\n\t\t$response['body'] = $response_body;\r\n\t\t$response['header'] = $response_headers;\r\n\t\treturn $response;\r\n\t}", "private function initGetRequest()\n {\n $this\n ->addCurlOption(CURLOPT_URL, $this->getUrl().'?'.$this->getQuery())\n ->addCurlOption(CURLOPT_CUSTOMREQUEST, HttpMethodResolver::HTTP_GET)\n ;\n }", "private function requestProcessor() {\n try {\n\n if (empty($this->uri))\n throw new \\Exception(\"Undefined url\");\n\n $ReqHandle = curl_init($this->uri);\n\n $body = json_encode([]);\n if( sizeof($this->data) > 0 )\n $body = json_encode($this->data);\n\n $returnTransfer = 0;\n if( $this->hasResponseToReturn )\n $returnTransfer = 1;\n\n $isPost = 0;\n if( $this->method != 'GET')\n $isPost = 1;\n\n\n if($isPost == 1){\n curl_setopt($ReqHandle,CURLOPT_POST, $isPost);\n curl_setopt($ReqHandle, CURLOPT_POSTFIELDS, $body);\n }\n \n curl_setopt_array($ReqHandle, [\n CURLOPT_RETURNTRANSFER => $returnTransfer,\n CURLOPT_HTTPHEADER => $this->headersToBeUsed\n ]);\n\n\n $result = curl_exec($ReqHandle);\n\n if(curl_errno($ReqHandle)){\n\n return curl_error($ReqHandle);\n }\n\n if($returnTransfer == 1)\n return json_decode($result);\n\n\n\n } catch (\\Throwable $t) {\n new ErrorTracer($t);\n }\n }", "public function HTTPRequest(){\n\t}", "private function prepare()\n\t{\n\t\t// remove anchors (#foo) from the URL\n\t\t$this->url = preg_replace( '/(#.*?)?$/', '', $this->url );\n\t\t// merge query params from the URL with params given\n\t\t$this->url = $this->mergeQueryParams( $this->url, $this->params );\n\n\t\tif ( $this->method === 'POST' ) {\n\t\t\tif ( !isset( $this->headers['Content-Type'] ) ) {\n\t\t\t\t$this->setHeader( array( 'Content-Type' => 'application/x-www-form-urlencoded' ) );\n\t\t\t}\n\t\t\tif ( $this->headers['Content-Type'] == 'application/x-www-form-urlencoded' || $this->headers['Content-Type'] == 'application/json' ) {\n\t\t\t\t$count = count( $this->postdata );\n\t\t\t\tif( $this->body != '' && $count > 0 ) {\n\t\t\t\t\t$this->body .= '&';\n\t\t\t\t}\n\t\t\t\t//$this->body .= http_build_query( $this->postdata, '', '&' );\n\t\t\t\t// We don't use http_build_query() as it converts empty array values to 0, which we don't want.\n\t\t\t\tforeach ( $this->postdata as $key => $value ) {\n\t\t\t\t\t$count--;\n\t\t\t\t\t$this->body .= $key . '=' . $value;\n\t\t\t\t\tif ( $count )\t{\n\t\t\t\t\t\t$this->body .= '&';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->setHeader( array( 'Content-Length' => strlen( $this->body ) ) );\n\t\t}\n\t}", "public function request() {\n // The basic flow: build the url, make the request, parse and return the\n // output.\n $url = $this->query_builder->getUrl();\n\n // @todo: does this make sense to be in a separate class? Anyway, this shoudl\n // be somehow refactored because it is hard to replace or overwrite it.\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);\n $response = curl_exec($curl);\n // @todo: very important: check the curl errors here.\n\n return $this->parser->parse($response);\n }", "private function buildRequest(): void\n {\n if (isset($this->parameters) && !Str::contains($this->requestUri, '?')) {\n $this->requestUri .= '?';\n $params = $this->parameters;\n array_walk($params, function (&$a, $b) {\n $a = \"$b=$a\";\n });\n $this->requestUri .= implode('&', $params);\n }\n \n if (isset($this->queries) && sizeof($this->queries) > 0) {\n $this->addJsonParam('query', '{'.implode(',', $this->queries).'}');\n }\n \n $this->options['headers'] = $this->headers;\n \n if (isset($this->json)) {\n $this->options['json'] = $this->json;\n }\n if (isset($this->body)) {\n $this->options['body'] = $this->body;\n }\n }", "public static function process_http_request()\n {\n }", "abstract public function request();", "public function prepareRequest()\r\n {\r\n\r\n }", "abstract function do_api_request();", "public function prepareRequest()\n {\n }", "protected function _request() {}", "public static function resolve_http_request()\n {\n }", "private function initCurlRequest() {\n $method = strtoupper($this->method);\n\n // Construct request\n $curlRequest = curl_init($this->finalUrl);\n curl_setopt($curlRequest, CURLOPT_RETURNTRANSFER, 1); // Return contents instead of boolean on exec\n curl_setopt($curlRequest, CURLOPT_BINARYTRANSFER, 1);\n curl_setopt($curlRequest, CURLOPT_HEADER, 1); // Return headers in response\n if ($this->followRedirects)\n curl_setopt($curlRequest, CURLOPT_FOLLOWLOCATION, true); // Follow redirects\n\n // Timeouts\n if ($this->connectTimeout !== null)\n curl_setopt($curlRequest, CURLOPT_CONNECTTIMEOUT, $this->connectTimeout);\n if ($this->executeTimeout !== null)\n curl_setopt($curlRequest, CURLOPT_TIMEOUT, $this->executeTimeout);\n\n // Method-specific\n $acceptsBody = false;\n if ($method === 'POST') {\n curl_setopt($curlRequest, CURLOPT_POST, 1);\n $acceptsBody = true;\n }\n\n // BUG: curl will attempt to set \"Transfer-Encoding: chunked\" header if doing a PUT\n // the workaround is to POST, using an X-HTTP-Method-Override instead.\n // BEWARE: This also requires the server to know how to handle this header.\n if (in_array($method, array('PUT', 'PATCH'))) {\n $this->headers[] = \"X-HTTP-Method-Override: $method\";\n curl_setopt($curlRequest, CURLOPT_POST, 1);\n $acceptsBody = true;\n }\n\n if ($method === 'DELETE')\n curl_setopt($curlRequest, CURLOPT_DELETE, 1);\n\n // Body\n $sendBlankExpect = false;\n if ($acceptsBody) {\n if ($this->files !== null && count($this->files) > 0) {\n $files = [];\n foreach ($this->files as $fileKey => $localPath)\n $files[$fileKey] = '@' . $localPath;\n \n curl_setopt($curlRequest, CURLOPT_POSTFIELDS, $files);\n\n // Workaround for CURL issue where curl_exec() returns both 100/CONTINUE and 200/OK separated by\n // blank line when using multipart form data.\n $sendBlankExpect = true;\n }\n elseif ($this->body) {\n // Default content-type of POST body\n if ($this->json && count(preg_grep('/content-type:/i', $this->headers)) === 0)\n $this->headers[] = 'Content-Type: application/json';\n\n // Seems to implicitly set CURLOPT_POST=1\n curl_setopt($curlRequest, CURLOPT_POSTFIELDS, $this->body);\n }\n }\n\n // Add headers\n $headers = $this->headers;\n if (!$headers)\n $headers = [];\n\n if ($this->json && count(preg_grep('/accept:/i', $headers)) === 0)\n $headers[] = 'Accept: application/json';\n if ($sendBlankExpect)\n $headers[] = 'Expect:';\n\n if (count($headers) > 0)\n curl_setopt($curlRequest, CURLOPT_HTTPHEADER, $headers);\n\n // Authenticate request\n if ($this->username) {\n curl_setopt($curlRequest, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($curlRequest, CURLOPT_USERPWD, $this->username . ':' . $this->password);\n }\n\n return $curlRequest;\n }", "public function __construct(){\n\t\t$this->headers = apache_request_headers();\n\t\t// Save the special x-RESTProxy-* headers\n\t\t$this->Host = $this->Host? $this->Host : $this->headers['x-RESTProxy-Host'];\n\t\t$this->Port = $this->headers['x-RESTProxy-Port'] ? ':'.$this->headers['x-RESTProxy-Port'] : \"\";\n\t\t$this->Https = ($this->headers['x-RESTProxy-HTTPS'])? $this->headers['x-RESTProxy-HTTPS'] : false;\n\t\t// Create a temp file in memory\n\t\t$this->fp = fopen('php://temp/maxmemory:256000','w');\n\t\tif (!$this->fp){\n\t\t\t$this->Error(100);\n\t\t}\n\t\t// Write the input into the in-memory tempfile\n\t\t$this->input = file_get_contents(\"php://input\");\n\t\tfwrite($this->fp,$this->input);\n\t\tfseek($this->fp,0);\n\n\t\t//Get the REST Path\n\t\tif(!empty($_SERVER['PATH_INFO'])){\n\t\t $this->_G = substr($_SERVER['PATH_INFO'], 1);\n\t\t //$this->_G = explode('/', $_mGET);\n\t\t }\n\t\t \n\t\t // Get the raw GET request\n\t\t $tmp = explode('?',$_SERVER['REQUEST_URI']);\n\t\t if ($tmp[1]) {\n\t\t \t$this->_RawGET = $tmp[1];\n\t\t } else {\n\t\t \t$this->_RawGET = \"\";\n\t\t }\n\t \n\t}", "public function request();", "protected function getRequest() {}", "function request($vars=array())\n { \n $this->req->setHeader(array(\n 'user-agent' => 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0',\n 'Referer' => $vars['host'].$vars['url'],\n 'Connection' => 'keep-alive'\n\n ));\n\n\n $url_obj = new Net_URL2(($vars['host'] ? $vars['host'] : DATA_HOST).$vars['url']);\n \n if ($vars['method'] == 'post') {\n $this->req->setMethod(HTTP_Request2::METHOD_POST);\n\n if ($this->cookies_jar) {\n $this->req->setCookieJar($this->cookies_jar);\n }\n $this->req->addPostParameter($vars['params']);\n\n\n\n\n } else {\n $url_obj->setQueryVariables($vars['params']);\n }\n\n\n\n ///////////////////////////////////////\n if ($vars['cookies']) {\n foreach ($vars['cookies'] as $k => $cookie) {\n //$this->req->addCookie($cookie['name'], $cookie['value']);\n }\n }\n\n $this->req->setUrl($url_obj);\n $this->response = $this->req->send();\n \n\n\n //HTTP_Request2_CookieJar::addCookiesFromResponse();\n\n //$cookies = HTTP_Request2_CookieJar::getAll();\n \n $this->cookies_jar = $this->req->getCookieJar();\n //echo '<pre>';\n //print_r($this->req);\n \n\n if (DEBUG == 1) {\n //echo \"\\n POST TO: \".$this->req->getUrl().\"\\n\";\n echo '<pre>';\n echo \"Status \".$this->response->getStatus();\n print_r($this->req);\n }\n\n $body = $this->response->getBody();\n //$header = $this->response->getHeader();\n return $body;\n }", "protected function http(){\n\n if( empty($this->HTTPClient) ){\n\n //init stack\n $stack = HandlerStack::create();\n\n if ( $this->token ){\n\n //setup to send the token with each request\n\n $this->addHeader(Headers::AUTHORIZATION, ( \"TOKEN \" . $this->token->getValue() ) );\n\n }\n else{\n\n //setup client to send signed requests\n\n $signer = new Signer(Settings::PROVIDER);\n $middleware = new Middleware($signer, $this->cfg->getKey(), $this->cfg->getSecret());\n\n $stack->push($middleware);\n\n }\n\n //enable debug\n if( $logger = $this->cfg->getLogger() )\n $this->pushRequestLogger($logger, $stack);\n\n //create the client\n $this->HTTPClient = new HTTPClient([\n 'headers' => &$this->headers,\n 'timeout' => $this->cfg->getRequestTimeout(),\n 'handler' => $stack\n ]);\n\n return $this->HTTPClient;\n\n }\n\n return $this->HTTPClient;\n\n }", "private function http() :void\n {\n $query = [];\n $queryString = $this->getContent('QUERY_STRING');\n if(!empty($queryString)) {\n parse_str($queryString, $query);\n }\n $this->http = [\n 'path' => $this->getContent('DOCUMENT_ROOT'),\n 'script-name' => $this->getContent('SCRIPT_NAME'),\n 'ip-client' => $this->getContent('REMOTE_ADDR'),\n 'software' => $this->getContent('SERVER_SOFTWARE'),\n 'server-name' => $this->getContent('SERVER_NAME'),\n 'method' => $this->getContent('REQUEST_METHOD'),\n 'host' => $this->getContent('HTTP_HOST'),\n 'port' => $this->getContent('SERVER_PORT'),\n 'uri' => $this->getContent('REQUEST_URI'),\n 'user-agent' => $this->getContent('HTTP_USER_AGENT'),\n 'query' => $query,\n 'content-type' => $this->getContent('HTTP_CONTENT_TYPE'),\n ];\n $this->http['headers'] = $this->getContentList('HTTP_');\n }", "private static function PrepareRequest($url = \"\")\n\t{\n\t\t$request = curl_init();\n\t\tcurl_setopt($request, CURLOPT_URL,\t\t\t\tempty($url) ? self::URL : $url);\n\t\tcurl_setopt($request, CURLOPT_HEADER,\t\t\ttrue);\n\t\tcurl_setopt($request, CURLOPT_RETURNTRANSFER,\ttrue);\n\t\tcurl_setopt($request, CURLOPT_ENCODING,\t\t\t\"gzip\");\n\t\tcurl_setopt($request, CURLOPT_USERAGENT,\t\tself::UserAgent);\n\t\tif ( !empty(self::$cookie) )\n\t\t\tcurl_setopt($request, CURLOPT_COOKIE,\t\tself::$cookie);\n\t\treturn $request;\n\t}", "public function prepareRequest() {\n $auth = new WebServiceSoap\\SveaAuth(\n $this->conf->getUsername($this->orderType, $this->countryCode),\n $this->conf->getPassword($this->orderType, $this->countryCode),\n $this->conf->getClientNumber($this->orderType, $this->countryCode) \n );\n\n $address = new WebServiceSoap\\SveaAddress( \n $auth, \n (isset($this->companyId) ? true : false), \n $this->countryCode, \n (isset($this->companyId) ? $this->companyId : $this->ssn) \n );\n\n $this->request = new WebServiceSoap\\SveaRequest( $address );\n\n return $this->request;\n }", "public function request()\n {\n $this->setParams();\n\n $jsondata = json_encode($this->getData(), JSON_UNESCAPED_SLASHES);\n\n if(!$this->is_JSON($jsondata)){\n $this->log(\"Sending parameters must be JSON.\",'Exiting process.');\n $this->error_message('Sending parameters must be JSON.');\n }\n $lenght = strlen($jsondata);\n if($lenght<=0){\n $this->log(\"Length must be more than zero.\",'Exiting process.');\n $this->error_message(\"Length must be more than zero.\");\n }else{\n $lenght = $lenght <= 999 ? \"0\" . $lenght : $lenght;\n }\n\n $this->response_json = $this->oxd_socket_request(utf8_encode($lenght . $jsondata));\n\n $this->response_json = str_replace(substr($this->response_json, 0, 4), \"\", $this->response_json);\n if ($this->response_json) {\n $object = json_decode($this->response_json);\n if ($object->status == 'error') {\n $this->error_message($object->data->error . ' : ' . $object->data->error_description);\n } elseif ($object->status == 'ok') {\n $this->response_object = json_decode($this->response_json);\n }\n } else {\n $this->log(\"Response is empty...\",'Exiting process.');\n $this->error_message('Response is empty...');\n }\n }", "public function handleHttpRequest() {\r\n\t\t\r\n\t\t// starttime\r\n\t\t$time_start = microtime(true);\r\n\t\t\r\n\t\t// create new Session if the client doesn't have one\r\n\t\tif( session_id() == null ) session_start();\r\n\r\n\t\t$result = array();\r\n\r\n\t\ttry {\r\n\r\n\t\t\t// get version on empty request \r\n\t\t\tif( ( $_GET == null && $_POST == null ) /* || ( $_POST == null && $_POST == null ) */ ) {\r\n\r\n\t\t\t\t// no parameters given, just return the version number\r\n $initial = 'BiotoPi API ' . 'v1 '; // Helper::getVersion();\r\n\t\t\t\t$result['data'] = $initial;\r\n\t\t\t\t$result['state'] = true;\r\n\r\n\t\t\t\t// TODO, $_REQUEST is never empty, use $_POST & $_GET instead!!\r\n\t\t\t} else if( isset( $_GET ) || isset( $_POST ) /* && $_REQUEST != \"\" */ ) {\r\n\r\n\t\t\t\tif( ENV == 'prod' && isset( $_REQUEST['tk'] ) && $_REQUEST['tk'] !== null ) {\r\n\r\n\t\t\t\t\t// only allowed requests in productive enviroments with right token\r\n\t\t\t\t\t$tk = base64_decode( urldecode( $_REQUEST['tk'] ) );\r\n\t\t\t\t\t$sitetk = Config::get( 'token' );\r\n\t\t\t\t\t$unpack = unpack( 'H*', $sitetk );\r\n\t\t\t\t\tif( $tk != strtotime( date( 'd.m.Y H:i:00' ) ) . array_shift( $unpack ) ) throw new Exception( \"Wrong token! \" );\r\n\t\t\t\t\t//\t\t\t\t\t\t$tk = base64_decode( urldecode( $_REQUEST['tk'] ) );\r\n\t\t\t\t\t//\t\t\t\t\t\tif( $tk != Config::get( 'token' ) ) throw new Exception( \"Wrong token!\" ); // , $_SESSION['site'] \r\n\r\n\t\t\t\t} else if( ENV == 'prod' && ( ! isset( $_SESSION['eingeloggt'] ) || $_SESSION['eingeloggt'] != 1 ) ) {\r\n\r\n // we need a Users Backend and Frontend\r\n // Login, Register (contains send E-Mail with tokenized Link)\r\n // Overview for Admins (we need also Groups for this: Admin and User should be enough) \r\n\r\n\t\t\t\t\t// unauthorized requests redirect or notify?\r\n // if( Config::get( 'apiredirect' ) ) {\r\n // // Redirect to loginpage\r\n // header ( \"Location: ./mgmt\" );\r\n // } else {\r\n\t\t\t\t\t\t// Returns a Message\r\n throw new Exception( 'Please login to use this service!' );\r\n // }\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// get our controller and action names \r\n\t\t\t\t$controllerName = isset( $_REQUEST['controller'] ) ? $_REQUEST['controller'] : null;\r\n\t\t\t\t$actionName = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : null;\r\n\r\n\t\t\t\tif( $controllerName === null ) throw new Exception( 'No Controller given, aborted!' );\r\n\t\t\t\tif( $actionName === null ) throw new Exception( 'No Action given, aborted!' );\r\n\r\n\t\t\t\t// Controller allways are lowercase only the first Character is Uppercase\r\n\t\t\t\t// $controllerName = ucfirst( strtolower( $controllerName ) );\r\n $controllerName = ucfirst( $controllerName );\r\n\r\n\t\t\t\t// use PHP reflectionAPI to get result\r\n\t\t\t\t$controller = self::createController( $controllerName );\r\n\t\t\t\t$response = self::callMethod( $controller, $actionName );\r\n\r\n\t\t\t\t// return result into data and set succes true\r\n\t\t\t\t$result['state'] = true;\r\n\t\t\t\t$result['data'] = $response;\r\n\r\n\t\t\t}\r\n\r\n\t\t} catch( Exception $e ) {\r\n\t\t\t// catch any exceptions, set success false and report the problem\r\n\t\t\t$result['state'] = false;\r\n\t\t\t$result['errormsg'] = $e->getMessage();\r\n\t\t}\r\n\r\n\t\tif( isset($_GET['debug']) && $_GET['debug'] === \"1\" ) {\r\n\t\t\t$result['time'] = round( ( microtime(true) - $time_start ), 3 );\r\n\t\t\techo \"<pre>\";\r\n\t\t\tprint_r( $result );\r\n\t\t\t//var_dump( $result );\r\n\t\t\techo \"</pre>\";\r\n\t\t} else if ( $result ) {\r\n // if( $result['data'] === $initial ) {\r\n // // we are on an initial request\r\n // }\r\n // return our json encoded result to the requester\r\n header( 'Cache-Control: no-cache, must-revalidate' );\r\n\t\t\theader( \"Access-Control-Allow-Origin: *\" );\r\n\t\t\theader( \"Content-Type: application/json charset=UTF-8\" );\r\n\t\t\tprint_r( json_encode( $result ) );\r\n\t\t} else {\r\n\t\t\techo \"<pre>\";\r\n\t\t\tvar_dump( $result );\r\n\t\t\techo \"</pre>\";\r\n\t\t}\r\n\r\n\t\tsession_write_close();\r\n\r\n\t\t// // redirect to last destination as form fallback on no js.\r\n\t\t// if( isset( $_REQUEST['redirect'] ) ) {\r\n\t\t// \theader ( \"Location: \" . $_REQUEST['redirect'] );\r\n\t\t// }\r\n\r\n\t}", "private function setRequest() {\n // Create request object\n $this->request = Request::createFromGlobals();\n // Check caching and exit if so\n // - create a dummy response for possible 304\n $response = new Response();\n $seconds = Config::get()->pagecachetime;\n $response->setLastModified(new DateTime('-' . $seconds . ' seconds'));\n if ($response->isNotModified($this->getRequest())) {\n $response\n ->setSharedMaxAge($seconds)\n ->send();\n exit();\n }\n // Add better json request support\n // check request Content-Type\n $ctCheck = 0 === strpos(\n $this->request->headers->get('CONTENT_TYPE')\n , 'application/json'\n );\n // check request Method\n $methodCheck = in_array(\n strtoupper($this->request->server->get('REQUEST_METHOD', 'GET'))\n , array('PUT', 'DELETE', 'POST')\n );\n if ($ctCheck && $methodCheck) {\n $params = (array) json_decode($this->request->getContent());\n $this->request->request = new ParameterBag($params);\n }\n }", "public function buildRequest()\n {\n if (php_sapi_name() === 'cli') {\n return $this->buildCliRequest();\n } else {\n return $this->buildWebRequest();\n }\n }", "public function execute_http()\n {\n }", "public function makeRequest( $url, $method = 'GET', $headers = null );", "public function executeRequest()\n {\n $aux = array();\n\n foreach ($this->headers as $header => $value) {\n $aux[] = \"$header: $value\";\n }\n\n curl_setopt($this->handler, CURLOPT_HTTPHEADER, $aux);\n\n $body = curl_exec($this->handler);\n\n if(empty($body)){\n $code = curl_errno($this->handler);\n\n if ($code == 60 || $code == 77) {\n curl_setopt($this->handler, CURLOPT_CAINFO, __DIR__ . '/cacerts.pem');\n $body = curl_exec($this->handler);\n }\n\n if(empty($body)){\n $error = curl_error($this->handler);\n $code = curl_errno($this->handler);\n throw new \\Exception($error, $code);\n }\n }\n\n $statusCode = curl_getinfo($this->handler, CURLINFO_HTTP_CODE);\n $cookies = curl_getinfo($this->handler, CURLINFO_COOKIELIST);\n\n $response = new HttpResponse();\n $response->cookies = $cookies;\n $response->statusCode = $statusCode;\n $this->getBodyAndHeaders($body, $response);\n\n curl_close($this->handler);\n\n return $response;\n }", "public function doRequests();", "protected function __construct(){\n // Get the request method\n $this->method = strtolower(getenv('REQUEST_METHOD'));\n\n // Get the request uri\n $this->uri = getenv('REQUEST_URI');\n\n // Get the full request URL\n $this->url = getenv('REQUEST_SCHEME') . '://' . getenv('HTTP_HOST') . getenv('REQUEST_URI');\n\n // Generate a uniq id for the request\n $this->uid = uniqid();\n\n // Get the request headers\n $this->headers = getallheaders();\n\n // Get the request parameters\n $this->params = $_GET;\n\n // Retrieve the body\n if($this->getHeaders('Content-Type') === 'application/json') {\n $this->body = json_decode(file_get_contents('php://input'), true);\n }\n else {\n switch($this->getMethod()) {\n case 'get' :\n $this->body = array();\n break;\n\n case 'post' :\n $this->body = $_POST;\n break;\n default :\n parse_str(file_get_contents('php://input'), $this->body);\n break;\n }\n }\n\n // Retreive the client IP\n if ($this->getHeaders('X-Forwarded-For')) {\n // The user is behind a proxy that transmit HTTP_X_FORWARDED_FOR header\n if (! preg_match('![0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}!', $this->getHeaders('X-Forwarded-For'))) {\n // The format of HTTP_X_FORWARDED_FOR header is not correct\n $this->clientIp = getenv('REMOTE_ADDR');\n }\n else{\n // Get the last public IP in HTTP_X_FORWARDED_FOR header\n $chain = explode(',', preg_replace('/[^0-9,.]/', '', self::getHeaders('X-Forwarded-For')));\n for($i = 0 ; $i <= count($chain); $i ++){\n $ip = $chain[$i];\n\n if((!preg_match(\"!^(192\\.168|10\\.0\\.0)!\", $ip) && $ip != \"127.0.0.1\") || $i == count($chain) - 1) {\n $this->clientIp = $ip;\n break;\n }\n }\n }\n }\n else{\n // X-Forwarded-For header has not been transmitted, get the REMOTE_ADDR header\n $this->clientIp = getenv('REMOTE_ADDR');\n }\n\n // Get the request uploaded files\n $this->files = $_FILES;\n\n // Get the request cookies\n $this->cookies = $_COOKIE;\n }", "protected function _request($http_method, $request_url, $params = array()){\n\t\t$request_url = str_replace( '{username}', $this->username, $request_url );\n\n\t\t// convert params as to query string\n\t\tif( $http_method == 'GET' ){\n\t\t\tif( !empty($params) ){\n\t\t\t\t$query_string = http_build_query($params);\n\t\t\t\t$request_url .= '?' . $query_string;\n\t\t\t\t$params = NULL;\n\t\t\t}\n\t\t}\n\n\t\t// save last request data and clean previous response data\n\t\t$this->request_data = array(\n\t\t\t'http_method' => $http_method,\n\t\t\t'url' => $request_url,\n\t\t\t'params' => $params,\n\t\t);\n\t\t$this->response_data = array();\n\t\t\n\t\t// prepare access token header\n\t\t$access_token_req = OAuthRequest::from_consumer_and_token($this->consumer, $this->token, $http_method, $request_url, $params);\n\t\t$access_token_req->sign_request($this->signature_method, $this->consumer, $this->token);\n\t\t\n\t\t// curl lib require header opt be set as array, so prepare it:\n\t\t$curl_opts = array( 'httpheader' => array( $access_token_req->to_header() ) );\n\t\t$this->request_data['header'] = $curl_opts['httpheader'];\n\t\t\n\t\t// send request with curl\n\t\t$result = $this->curl($request_url, $params, $curl_opts, $http_method);\n\t\t\n\t\t$this->response_data = $result;\n\t\t\n\t\treturn $result;\n\t}", "public function getRequest() {}", "public function getRequest() {}", "function http_request($method, $url = null, $body = null, ?array $options = null, ?array &$info = null) {}", "function makeRequest($post_data, $raw_data = false) {\n\t\t\n\t\t\n\t\t$client = new Zend_Http_Client ( $this->api_url );\n\t\tif (isset ( $post_data ['headers'] )) {\n\t\t\t$headers = $post_data ['headers'];\n\t\t\t$client->setHeaders ( $headers );\n\t\t}\n\t\t\n\t\t$data = array();\n\t\tif (isset ( $post_data ['body'] )) {\n\t\t\t$data = $post_data ['body'];\t\n\t\t}\n\t\t\n\t\tif($raw_data) {\n\t\t\t$client->setRawData($data);\n\t\t} else {\n\t\t\t$client->setParameterPost ( $data );\n\t\t\t$client->setParameterPost ( 'action', $post_data ['action'] );\t\n\t\t}\n\t\t\n\t\t\n\t\t$result = $client->request ( Zend_Http_Client::POST );\n\t\t$response = json_decode ( $result->getBody (), true );\n\t\t\n\t\treturn $response;\n\t}", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public static function initialRequest()\n {\n $secure = [\n 'password',\n 'pass',\n 'access_key',\n 'access_token',\n 'token',\n 'key',\n 'secret',\n 'login',\n 'api_key',\n 'hash',\n ];\n $params = Spry::params();\n\n foreach ($params as $paramKey => $paramValue) {\n if (in_array(strtolower($paramKey), $secure)) {\n $params[$paramKey] = 'xxxxxx...';\n }\n }\n\n $prefix = 'Spry Request: ';\n if (isset(self::$prefix['request'])) {\n $prefix = self::$prefix['request'];\n }\n\n self::log($prefix.(empty($params) ? 'Empty' : str_replace('Array', '', print_r($params, true))));\n }", "function prepare($method, $path) {\r\n\t\tcurl_setopt ( $this->handler, CURLOPT_HTTPHEADER, $this->request_headers );\r\n\t\tcurl_setopt ( $this->handler, CURLOPT_URL, $this->base_url . $path );\r\n\t\tcurl_setopt ( $this->handler, CURLOPT_CUSTOMREQUEST, $method );\r\n\t\t\r\n\t\tif ($method == 'POST' || $method == 'PUT') {\r\n\t\t\tif ($this->content_type == 'application/json') {\r\n\t\t\t\t$jsonServer = new JSON ( JSON_LOOSE_TYPE );\r\n\t\t\t\t$this->request_body_raw = json_encode( $this->request_body );\r\n\t\t\t} else {\r\n\t\t\t\t$this->request_body_raw = $this->request_body;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcurl_setopt ( $this->handler, CURLOPT_POSTFIELDS, $this->request_body_raw );\r\n\t\t}\r\n\r\n\t}", "public function createRequest()\n {\n return new ChipVN_Http_Request;\n }", "private function makeRequest()\n {\n $credentials = $this->generateCredentials();\n\n return $this->engine->client->request('POST', $this->endpoint, [\n 'json' => $credentials,\n 'headers' => [\n 'Accept' => 'application/json',\n 'Content-Type' => 'application/json',\n ],\n ]);\n }", "protected function _performRequest(\n\t\t$path = '/',\n\t\t$queryString = '',\n\t\t$httpVerb = Zend_Http_Client::GET,\n\t\t$headers = [],\n\t\t$rawData = null\n\t) {\n\t // Clean path\n\t\tif (strpos($path, '/') !== 0) {\n\t\t\t$path = '/' . $path;\n\t\t}\n\n\t\t// Clean headers\n\t\tif (is_null($headers)) {\n\t\t $headers = [];\n\t\t}\n\n\t\t// Ensure cUrl will also work correctly:\n\t\t// - disable Content-Type if required\n\t\t// - disable Expect: 100 Continue\n\t\tif (!isset($headers[\"Content-Type\"])) {\n\t\t\t$headers[\"Content-Type\"] = '';\n\t\t}\n\t\t//$headers[\"Expect\"] = '';\n\n\t\t// Add version header\n\t\t$headers['x-ms-version'] = $this->_apiVersion;\n\n\t\t// URL encoding\n\t\t$path = self::urlencode($path);\n\t\t$queryString = self::urlencode($queryString);\n\n\t\t// Generate URL and sign request\n\t\t$requestUrl = $this->getBaseUrl() . $path . $queryString;\n\t\t$requestHeaders = $headers;\n\n\t\t// Prepare request\n\t\t$this->_httpClientChannel->resetParameters(true);\n\t\t$this->_httpClientChannel->setUri($requestUrl);\n\t\t$this->_httpClientChannel->setHeaders($requestHeaders);\n\t\t$this->_httpClientChannel->setRawData($rawData);\n\n\t\t// Execute request\n\t\t$response = $this->_retryPolicy->execute(\n\t\t [$this->_httpClientChannel, 'request'],\n\t\t [$httpVerb]\n\t\t);\n\n\t\t// Store request id\n\t\t$this->_lastRequestId = $response->getHeader('x-ms-request-id');\n\n\t\treturn $response;\n\t}", "function __construct($http_request) {\n $this->http_request = $http_request;\n }", "public function prepareHttpRequest(PendingRequest $http): void\n {\n $http->withData(['id' => $this->mediaIds]);\n }", "protected function buildRequest($call, $method = Varien_Http_Client::GET, $postData = false, $headers = false)\n {\n\n // Grab a new instance of HTTP Client\n $http = new Varien_Http_Client();\n\n if(Mage::getStoreConfig(self::API_ENVIRONMENT_XML_PATH) == Smartbox_Smartboxparcels_Model_System_Config_Environment::SMARTBOX_PRODUCTION){\n $http->setUri(Mage::getStoreConfig(self::API_PRODUCTION_XML_PATH) . $call);\n $api_key = array(\n 'X-Api-Key' => Mage::getStoreConfig(self::API_KEY_XML_PATH),\n 'X-Api-User'=> Mage::getStoreConfig(self::API_USERNAME_XML_PATH),\n 'X-Api-Passwd'=> Mage::getStoreConfig(self::API_PASSWORD_XML_PATH)\n );\n $http->setHeaders($api_key);\n }\n else{\n $http->setUri(Mage::getStoreConfig(self::API_STAGING_XML_PATH) . $call);\n $api_key = array(\n 'X-Api-Key' => Mage::getStoreConfig(self::API_KEY_XML_PATH),\n 'X-Api-User'=> Mage::getStoreConfig(self::API_USERNAME_XML_PATH),\n 'X-Api-Passwd'=> Mage::getStoreConfig(self::API_PASSWORD_XML_PATH)\n );\n $http->setHeaders($api_key);\n }\n\n // Set the method in, defaults to GET\n $http->setMethod($method);\n\n // Do we need to add in any post data?\n if($method == Varien_Http_Client::POST) {\n if (is_array($postData) && !empty($postData)) {\n\n // Add in our post data\n $http->setParameterPost($postData);\n\n } else if (is_string($postData)) {\n\n // Try and decode the string\n try {\n\n // Attempt to decode the JSON\n $decode = Mage::helper('core')->jsonDecode($postData, Zend_Json::TYPE_ARRAY);\n\n // Verify it decoded into an array\n if ($decode && is_array($decode)) {\n\n // Include the post data as the raw data body\n $http->setRawData($postData, 'application/json')->request(Varien_Http_Client::POST);\n }\n\n } catch (Zend_Json_Exception $e) {\n $this->_log($e);\n return false;\n }\n\n }\n }\n\n // attempting to add any headers into the request\n if($headers && is_array($headers) && !empty($headers)) {\n\n // Add in our headers\n $http->setHeaders($headers);\n }\n\n // Return the HTTP body\n return $http;\n }", "function request($httpMethod, $service, $apiMethod, array $parameters = array(), array $options = array());", "function mi_http_request($url, $data)\r\n{\r\n\r\n $curl = curl_init($url);\r\n curl_setopt($curl, CURLOPT_POST, true);\r\n curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));\r\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\r\n $response = curl_exec($curl);\r\n curl_close($curl);\r\n return $response;\r\n}", "function _httprequest($url,$fp,$URI,$http_method,$content_type=\"\",$body=\"\")\n\t{\n\t\t$cookie_headers = '';\n\t\tif($this->passcookies && $this->_redirectaddr)\n\t\t\t$this->setcookies();\n\t\t\t\n\t\t$URI_PARTS = parse_url($URI);\n\t\tif(empty($url))\n\t\t\t$url = \"/\";\n\t\t$headers = $http_method.\" \".$url.\" \".$this->_httpversion.\"\\r\\n\";\t\t\n\t\tif(!empty($this->agent))\n\t\t\t$headers .= \"User-Agent: \".$this->agent.\"\\r\\n\";\n\t\tif(!empty($this->host) && !isset($this->rawheaders['Host'])) {\n\t\t\t$headers .= \"Host: \".$this->host;\n\t\t\tif(!empty($this->port))\n\t\t\t\t$headers .= \":\".$this->port;\n\t\t\t$headers .= \"\\r\\n\";\n\t\t}\n\t\tif(!empty($this->accept))\n\t\t\t$headers .= \"Accept: \".$this->accept.\"\\r\\n\";\n\t\tif(!empty($this->referer))\n\t\t\t$headers .= \"Referer: \".$this->referer.\"\\r\\n\";\n\t\tif(!empty($this->cookies))\n\t\t{\t\t\t\n\t\t\tif(!is_array($this->cookies))\n\t\t\t\t$this->cookies = (array)$this->cookies;\n\t\n\t\t\treset($this->cookies);\n\t\t\tif ( count($this->cookies) > 0 ) {\n\t\t\t\t$cookie_headers .= 'Cookie: ';\n\t\t\t\tforeach ( $this->cookies as $cookieKey => $cookieVal ) {\n\t\t\t\t$cookie_headers .= $cookieKey.\"=\".urlencode($cookieVal).\"; \";\n\t\t\t\t}\n\t\t\t\t$headers .= substr($cookie_headers,0,-2) . \"\\r\\n\";\n\t\t\t} \n\t\t}\n\t\tif(!empty($this->rawheaders))\n\t\t{\n\t\t\tif(!is_array($this->rawheaders))\n\t\t\t\t$this->rawheaders = (array)$this->rawheaders;\n\t\t\twhile(list($headerKey,$headerVal) = each($this->rawheaders))\n\t\t\t\t$headers .= $headerKey.\": \".$headerVal.\"\\r\\n\";\n\t\t}\n\t\tif(!empty($content_type)) {\n\t\t\t$headers .= \"Content-type: $content_type\";\n\t\t\tif ($content_type == \"multipart/form-data\")\n\t\t\t\t$headers .= \"; boundary=\".$this->_mime_boundary;\n\t\t\t$headers .= \"\\r\\n\";\n\t\t}\n\t\tif(!empty($body))\t\n\t\t\t$headers .= \"Content-length: \".strlen($body).\"\\r\\n\";\n\t\tif(!empty($this->user) || !empty($this->pass))\t\n\t\t\t$headers .= \"Authorization: Basic \".base64_encode($this->user.\":\".$this->pass).\"\\r\\n\";\n\t\t\n\t\t//add proxy auth headers\n\t\tif(!empty($this->proxy_user))\t\n\t\t\t$headers .= 'Proxy-Authorization: ' . 'Basic ' . base64_encode($this->proxy_user . ':' . $this->proxy_pass).\"\\r\\n\";\n\n\n\t\t$headers .= \"\\r\\n\";\n\t\t\n\t\t// set the read timeout if needed\n\t\tif ($this->read_timeout > 0)\n\t\t\tsocket_set_timeout($fp, $this->read_timeout);\n\t\t$this->timed_out = false;\n\t\t\n\t\tfwrite($fp,$headers.$body,strlen($headers.$body));\n\t\t\n\t\t$this->_redirectaddr = false;\n\t\tunset($this->headers);\n\t\t\t\t\t\t\n\t\twhile($currentHeader = fgets($fp,$this->_maxlinelen))\n\t\t{\n\t\t\tif ($this->read_timeout > 0 && $this->_check_timeout($fp))\n\t\t\t{\n\t\t\t\t$this->status=-100;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\t\n\t\t\tif($currentHeader == \"\\r\\n\")\n\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t// if a header begins with Location: or URI:, set the redirect\n\t\t\tif(preg_match(\"/^(Location:|URI:)/i\",$currentHeader))\n\t\t\t{\n\t\t\t\t// get URL portion of the redirect\n\t\t\t\tpreg_match(\"/^(Location:|URI:)[ ]+(.*)/i\",chop($currentHeader),$matches);\n\t\t\t\t// look for :// in the Location header to see if hostname is included\n\t\t\t\tif(!preg_match(\"|\\:\\/\\/|\",$matches[2]))\n\t\t\t\t{\n\t\t\t\t\t// no host in the path, so prepend\n\t\t\t\t\t$this->_redirectaddr = $URI_PARTS[\"scheme\"].\"://\".$this->host.\":\".$this->port;\n\t\t\t\t\t// eliminate double slash\n\t\t\t\t\tif(!preg_match(\"|^/|\",$matches[2]))\n\t\t\t\t\t\t\t$this->_redirectaddr .= \"/\".$matches[2];\n\t\t\t\t\telse\n\t\t\t\t\t\t\t$this->_redirectaddr .= $matches[2];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t$this->_redirectaddr = $matches[2];\n\t\t\t}\n\t\t\n\t\t\tif(preg_match(\"|^HTTP/|\",$currentHeader))\n\t\t\t{\n if(preg_match(\"|^HTTP/[^\\s]*\\s(.*?)\\s|\",$currentHeader, $status))\n\t\t\t\t{\n\t\t\t\t\t$this->status= $status[1];\n }\t\t\t\t\n\t\t\t\t$this->response_code = $currentHeader;\n\t\t\t}\n\t\t\t\t\n\t\t\t$this->headers[] = $currentHeader;\n\t\t}\n\n\t\t$results = '';\n\t\tdo {\n \t\t$_data = fread($fp, $this->maxlength);\n \t\tif (strlen($_data) == 0) {\n \t\tbreak;\n \t\t}\n \t\t$results .= $_data;\n\t\t} while(true);\n\n\t\tif ($this->read_timeout > 0 && $this->_check_timeout($fp))\n\t\t{\n\t\t\t$this->status=-100;\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// check if there is a a redirect meta tag\n\t\t\n\t\tif(preg_match(\"'<meta[\\s]*http-equiv[^>]*?content[\\s]*=[\\s]*[\\\"\\']?\\d+;[\\s]*URL[\\s]*=[\\s]*([^\\\"\\']*?)[\\\"\\']?>'i\",$results,$match))\n\n\t\t{\n\t\t\t$this->_redirectaddr = $this->_expandlinks($match[1],$URI);\t\n\t\t}\n\n\t\t// have we hit our frame depth and is there frame src to fetch?\n\t\tif(($this->_framedepth < $this->maxframes) && preg_match_all(\"'<frame\\s+.*src[\\s]*=[\\'\\\"]?([^\\'\\\"\\>]+)'i\",$results,$match))\n\t\t{\n\t\t\t$this->results[] = $results;\n\t\t\tfor($x=0; $x<count($match[1]); $x++)\n\t\t\t\t$this->_frameurls[] = $this->_expandlinks($match[1][$x],$URI_PARTS[\"scheme\"].\"://\".$this->host);\n\t\t}\n\t\t// have we already fetched framed content?\n\t\telseif(is_array($this->results))\n\t\t\t$this->results[] = $results;\n\t\t// no framed content\n\t\telse\n\t\t\t$this->results = $results;\n\t\t\n\t\treturn true;\n\t}", "abstract protected function request($method, $server, $path, $query = NULL, array $headers = array());", "function http($url, $method, $postfields = NULL, $headers = array()) {\r\n $this->http_info = array();\r\n $ci = curl_init();\r\n /* Curl settings */\r\n curl_setopt($ci, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);\r\n curl_setopt($ci, CURLOPT_USERAGENT, $this->useragent);\r\n curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, $this->connecttimeout);\r\n curl_setopt($ci, CURLOPT_TIMEOUT, $this->timeout);\r\n curl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE);\r\n curl_setopt($ci, CURLOPT_ENCODING, \"\");\r\n curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, $this->ssl_verifypeer);\r\n if (version_compare(phpversion(), '5.4.0', '<')) {\r\n curl_setopt($ci, CURLOPT_SSL_VERIFYHOST, 1);\r\n } else {\r\n curl_setopt($ci, CURLOPT_SSL_VERIFYHOST, 2);\r\n }\r\n curl_setopt($ci, CURLOPT_HEADERFUNCTION, array($this, 'getHeader'));\r\n curl_setopt($ci, CURLOPT_HEADER, FALSE);\r\n\r\n switch ($method) {\r\n case 'POST':\r\n curl_setopt($ci, CURLOPT_POST, TRUE);\r\n if (!empty($postfields)) {\r\n curl_setopt($ci, CURLOPT_POSTFIELDS, $postfields);\r\n $this->postdata = $postfields;\r\n }\r\n break;\r\n case 'DELETE':\r\n curl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE');\r\n if (!empty($postfields)) {\r\n $url = \"{$url}?{$postfields}\";\r\n }\r\n }\r\n\r\n if ( isset($this->access_token) && $this->access_token )\r\n $headers[] = \"Authorization: OAuth2 \".$this->access_token;\r\n\r\n if ( !empty($this->remote_ip) ) {\r\n if ( defined('SAE_ACCESSKEY') ) {\r\n $headers[] = \"SaeRemoteIP: \" . $this->remote_ip;\r\n } else {\r\n $headers[] = \"API-RemoteIP: \" . $this->remote_ip;\r\n }\r\n } else {\r\n if ( !defined('SAE_ACCESSKEY') ) {\r\n $headers[] = \"API-RemoteIP: \" . $_SERVER['REMOTE_ADDR'];\r\n }\r\n }\r\n curl_setopt($ci, CURLOPT_URL, $url );\r\n curl_setopt($ci, CURLOPT_HTTPHEADER, $headers );\r\n curl_setopt($ci, CURLINFO_HEADER_OUT, TRUE );\r\n\r\n $response = curl_exec($ci);\r\n $this->http_code = curl_getinfo($ci, CURLINFO_HTTP_CODE);\r\n $this->http_info = array_merge($this->http_info, curl_getinfo($ci));\r\n $this->url = $url;\r\n\r\n if ($this->debug) {\r\n echo \"=====post data======\\r\\n\";\r\n var_dump($postfields);\r\n\r\n echo \"=====headers======\\r\\n\";\r\n print_r($headers);\r\n\r\n echo '=====request info====='.\"\\r\\n\";\r\n print_r( curl_getinfo($ci) );\r\n\r\n echo '=====response====='.\"\\r\\n\";\r\n print_r( $response );\r\n }\r\n curl_close ($ci);\r\n return $response;\r\n }", "private function _makeRequest($type)\n\t{\n\t\n\t\t$http = new Varien_Http_Adapter_Curl();\n\t\t$config = array('timeout' => 30);\n\t\t\n\t\t//Build URL from the \n\t\t$url = Wp_WhitePages_Model_Api::API_URL.'/'.$type.'/'.Wp_WhitePages_Model_Api::API_VERSION.'/'. $this->_requestQuery;\n\n\t\t//Magento logging\n\t\t$isLogsActive = Mage::getStoreConfig('dev/log/active');\n\t\tif($isLogsActive)\n\t\t{\n\t\t\t$this->wpDebug(\"Requests URL: \".$url);\n\t\t}\n\t\t//echo $url; die;\n\t\t\n\t\ttry \n\t\t{\n\t\t\t//Make Curl Request\n\t\t\t$http->write('GET',\t$url, '1.1');\n\t\t\t$this->_result = json_decode(Zend_Http_Response::extractBody($http->read()), true );\n\t\t\t\n\t\t\t//Check for Curl Error\n\t\t\tif($http->getErrno() != 0)\n\t\t\t{\n\t\t\t\tMage::throwException($http->getError(). ' error number '. $http->getErrno());\n\t\t\t}\n\t\t\t//Check for API result Errors\n\t\t\telseif(array_key_exists('errors',$this->_result))\n\t\t\t{\n\t\t\t\tMage::throwException($this->_result[\"errors\"][0]);\n\t\t\t}\n\t\t}\n\t\tcatch (Exception $e) \n\t\t{\n\t\t \t$this->wpDebug($e->getMessage(), Zend_Log::ERR);\n\t\t\t$this->_hasError = true;\n\t\t}\n\t\t\n\t\t//Magento logging\n\t\tif($isLogsActive)\n\t\t{\n\t\t\t$this->wpDebug( \"Response Data: \".var_export($this->_result, true));\n\t\t}\n\t\t\n\t\treturn $this->_result;\n\t}", "protected function createCurlHandle()\n {\n $ch = curl_init();\n\n $bdurl = $this->request->getUrl();\n $config = $this->request->getConfig();\n\n \t$curl_opts = array(\n \t\t// request url\n \t\tCURLOPT_URL\t\t\t\t=> $this->requestUrl,\n \t\t// setup write callbacks\n \t\tCURLOPT_HEADERFUNCTION\t=> array($this, 'onWriteHeader'),\n \t\tCURLOPT_WRITEFUNCTION\t=> array($this, 'onWriteBody'),\n \t\t// buffer size\n \t\tCURLOPT_BUFFERSIZE\t\t=> $config['buffer_size'],\n \t\t// save full outgoing headers, in case someone is interested\n CURLINFO_HEADER_OUT\t\t=> true,\n CURLOPT_NOSIGNAL => 1,\n );\n\n // setup connection timeout\n\t\tif (defined('CURLOPT_CONNECTTIMEOUT_MS')) {\n\t\t\t$curl_opts[CURLOPT_CONNECTTIMEOUT_MS] = $config['connect_timeout'];\n\t\t} else {\n\t\t\t$curl_opts[CURLOPT_CONNECTTIMEOUT] = ceil($config['connect_timeout'] / 1000);\n\t\t}\n\n // setup request timeout\n\t\tif (defined('CURLOPT_TIMEOUT_MS')) {\n\t\t\t$curl_opts[CURLOPT_TIMEOUT_MS] = $config['timeout'];\n\t\t} else {\n\t\t\t$curl_opts[CURLOPT_TIMEOUT] = ceil($config['timeout'] / 1000);\n\t\t}\n\n // setup redirects\n if ($config['follow_redirects']) {\n \t$curl_opts[CURLOPT_FOLLOWLOCATION] = true;\n $curl_opts[CURLOPT_MAXREDIRS] = $config['max_redirects'];\n // limit redirects to http(s), works in 5.2.10+\n if (defined('CURLOPT_REDIR_PROTOCOLS')) {\n $curl_opts[CURLOPT_REDIR_PROTOCOLS] = CURLPROTO_HTTP | CURLPROTO_HTTPS;\n }\n // works sometime after 5.3.0, http://bugs.php.net/bug.php?id=49571\n if ($config['strict_redirects'] && defined('CURLOPT_POSTREDIR ')) {\n $curl_opts[CURLOPT_POSTREDIR] = 3;\n }\n } else {\n $curl_opts[CURLOPT_FOLLOWLOCATION] = false;\n }\n\n // set HTTP version\n switch ($config['protocol_version']) {\n case '1.0':\n $curl_opts[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_0;\n break;\n case '1.1':\n $curl_opts[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_1;\n }\n\n // set request method\n switch ($this->request->getMethod()) {\n case bdHttpRequest::METHOD_GET:\n $curl_opts[CURLOPT_HTTPGET] = true;\n break;\n case bdHttpRequest::METHOD_POST:\n $curl_opts[CURLOPT_POST] = true;\n break;\n case bdHttpRequest::METHOD_HEAD:\n $curl_opts[CURLOPT_NOBODY] = true;\n break;\n default:\n $curl_opts[CURLOPT_CUSTOMREQUEST] = $this->request->getMethod();\n }\n\n // set proxy, if needed\n if ($config['proxy_host']) {\n if (!$config['proxy_port']) {\n throw new bdHttpException('Proxy port not provided');\n }\n $curl_opts[CURLOPT_PROXY] = $config['proxy_host'] . ':' . $config['proxy_port'];\n if ($config['proxy_user']) {\n $curl_opts[CURLOPT_PROXYUSERPWD] = $config['proxy_user'] . ':' . $config['proxy_password'];\n switch ($config['proxy_auth_scheme']) {\n case bdHttpRequest::AUTH_BASIC:\n $curl_opts[CURLOPT_PROXYAUTH] = CURLAUTH_BASIC;\n break;\n case bdHttpRequest::AUTH_DIGEST:\n $curl_opts[CURLOPT_PROXYAUTH] = CURLAUTH_DIGEST;\n }\n }\n }\n\n // set authentication data\n $auth = $this->request->getAuth();\n if ($auth) {\n $curl_opts[CURLOPT_USERPWD] = $auth['user'] . ':' . $auth['password'];\n switch ($auth['scheme']) {\n case bdHttpRequest::AUTH_BASIC:\n $curl_opts[CURLOPT_HTTPAUTH] = CURLAUTH_BASIC;\n break;\n case bdHttpRequest::AUTH_DIGEST:\n $curl_opts[CURLOPT_HTTPAUTH] = CURLAUTH_DIGEST;\n }\n }\n\n // set SSL options\n if (0 == strcasecmp($bdurl->getScheme(), 'https')) {\n \tif (isset($config['ssl_verify_host'])) {\n \t\t$curl_opts[CURLOPT_SSL_VERIFYHOST] = $config['ssl_verify_host'] ? 2 : 0;\n \t}\n \tforeach (self::$sslContextMap as $name => $option) {\n \t\tif (isset($config[$name])) {\n \t\t\t$curl_opts[$option] = $config[$name];\n \t\t}\n \t}\n }\n\n $headers = $this->request->getHeaders();\n // make cURL automagically send proper header\n if (!isset($headers['accept-encoding'])) {\n $headers['accept-encoding'] = '';\n }\n\n // set headers having special cURL keys\n foreach (self::$headerMap as $name => $option) {\n if (isset($headers[$name])) {\n $curl_opts[$option] = $headers[$name];\n unset($headers[$name]);\n }\n }\n\n $this->calculateRequestLength($headers);\n if (isset($headers['content-length'])) {\n $this->workaroundPhpBug47204($curl_opts, $headers);\n }\n\n // set headers not having special keys\n $headersFmt = array();\n foreach ($headers as $name => $value) {\n $canonicalName = implode('-', array_map('ucfirst', explode('-', $name)));\n $headersFmt[] = $canonicalName . ': ' . $value;\n }\n $curl_opts[CURLOPT_HTTPHEADER] = $headersFmt;\n\n curl_setopt_array($ch, $curl_opts);\n\n return $ch;\n }", "function http($url, $method, $postfields = NULL, $headers = array()) {\n $this->http_info = array();\n $ci = curl_init();\n /* Curl settings */\n curl_setopt($ci, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);\n curl_setopt($ci, CURLOPT_USERAGENT, $this->useragent);\n curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, $this->connecttimeout);\n curl_setopt($ci, CURLOPT_TIMEOUT, $this->timeout);\n curl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ci, CURLOPT_ENCODING, \"\");\n curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, $this->ssl_verifypeer);\n curl_setopt($ci, CURLOPT_SSL_VERIFYHOST, 1);\n curl_setopt($ci, CURLOPT_HEADERFUNCTION, array($this, 'getHeader'));\n curl_setopt($ci, CURLOPT_HEADER, FALSE);\n switch ($method) {\n case 'POST':\n curl_setopt($ci, CURLOPT_POST, TRUE);\n if (!empty($postfields)) {\n curl_setopt($ci, CURLOPT_POSTFIELDS, $postfields);\n $this->postdata = $postfields;\n }\n break;\n case 'DELETE':\n curl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE');\n if (!empty($postfields)) {\n $url = \"{$url}?{$postfields}\";\n }\n }\n if (isset($this->access_token) && $this->access_token)\n $headers[] = \"Authorization: OAuth2 \" . $this->access_token;\n if (!empty($this->remote_ip)) {\n if (defined('SAE_ACCESSKEY')) {\n $headers[] = \"SaeRemoteIP: \" . $this->remote_ip;\n } else {\n $headers[] = \"API-RemoteIP: \" . $this->remote_ip;\n }\n } else {\n if (!defined('SAE_ACCESSKEY')) {\n $headers[] = \"API-RemoteIP: \" . $_SERVER['REMOTE_ADDR'];\n }\n }\n curl_setopt($ci, CURLOPT_URL, $url);\n curl_setopt($ci, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($ci, CURLINFO_HEADER_OUT, TRUE);\n $response = curl_exec($ci);\n $this->http_code = curl_getinfo($ci, CURLINFO_HTTP_CODE);\n $this->http_info = array_merge($this->http_info, curl_getinfo($ci));\n $this->url = $url;\n if ($this->debug) {\n echo \"=====post data======\\r\\n\";\n var_dump($postfields);\n echo \"=====headers======\\r\\n\";\n print_r($headers);\n echo '=====request info=====' . \"\\r\\n\";\n print_r(curl_getinfo($ci));\n echo '=====response=====' . \"\\r\\n\";\n print_r($response);\n }\n curl_close($ci);\n return $response;\n }", "public function request(string $url): self\n {\n $url = 'http://' . $this->host . ':' . $this->port . '/' . $url;\n\n $data = $this->getData();\n\n $options = array(\n 'http' => array(\n 'method' => $this->method,\n 'user_agent' => $this->userAgent,\n 'follow_location' => 1,\n 'protocol_version' => 1.1,\n 'timeout' => $this->timeout,\n 'header' => '',\n )\n );\n\n $this->addHeader(\"X-HTTP-Method-Override: \" . strtoupper($this->method));\n $this->addHeader(\"Content-Type: application/json\");\n $this->addHeader(\"Accept: application/json\");\n switch (strtoupper($this->method)) {\n case 'GET':\n break;\n case 'POST';\n if ($data) {\n $this->addHeader(\"Content-Length: \" . strlen($data));\n $options['http']['content'] = $data;\n }\n break;\n case \"COPY\":\n break;\n case \"DELETE\":\n if ($data) {\n $this->addHeader(\"Content-Length: \" . strlen($data));\n $options['http']['content'] = $data;\n }\n break;\n case \"PUT\":\n if ($data) {\n $this->addHeader(\"Content-Length: \" . strlen($data));\n $options['http']['content'] = $data;\n }\n break;\n case \"HEAD\":\n break;\n }\n if (!empty($this->username) && !empty($this->password)) {\n $this->addHeader(\"Authorization: Basic \" . base64_encode($this->username . \":\" . $this->password));\n }\n foreach ($this->getHeaders() as $header) {\n $options['http']['header'] .= $header . \"\\r\\n\";\n }\n\n $context = stream_context_create($options);\n $response = @file_get_contents($url, false, $context);\n\n foreach ($http_response_header as $line) {\n $this->getHeader(NULL, $line);\n }\n\n if ($response == false) {\n $this->error = array('code' => http_response_code(), 'text' => '');\n } else {\n $this->response = $response;\n }\n\n $this->url = $url;\n\n return $this;\n }", "protected function buildWebRequest()\n {\n $args = $_REQUEST;\n $params = array();\n\n $route = $_SERVER['REQUEST_URI'];\n $posQuestionMark = strpos($route, '?');\n if ($posQuestionMark !== false) {\n $route = substr($route, 0, $posQuestionMark);\n }\n \n $posIndex = strpos($route, 'index.php');\n if ($posIndex !== false) {\n $route = substr($route, $posIndex + strlen('index.php'));\n }\n \n // Transform the arguments\n foreach ($args as $key => $value) {\n if (is_numeric($value)) {\n // Transform the value into the correct data type\n $value = $value * 1;\n }\n \n $params[$key] = $value;\n }\n\n // Generate the full url and extract the base\n $scheme = $this->getScheme();\n $fullUrl = $scheme . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n\n $isSsl = false;\n if ($scheme == 'https') {\n $isSsl = true;\n }\n \n $routePosition = strlen($fullUrl);\n if ($route !== '' && $route !== '/') {\n $routePosition = strpos($fullUrl, $route);\n }\n \n $method = $_SERVER['REQUEST_METHOD'];\n $requestedUrl = $this->getRequestedUrl();\n $base = substr($fullUrl, 0, $routePosition);\n $headers = $this->getHeaders($_SERVER);\n $protocol = $_SERVER['SERVER_PROTOCOL'];\n \n $locale = 'en_US';\n if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {\n $locale = $this->getLocale($_SERVER['HTTP_ACCEPT_LANGUAGE']);\n }\n \n $operatingSystem = $this->getOperatingSystem();\n\n return new WebRequest($method, $requestedUrl, $route, $params, $base, $locale, $operatingSystem, $isSsl, $headers, $protocol);\n }", "private function initPostRequest()\n {\n $this\n ->addCurlOption(CURLOPT_URL, $this->getUrl())\n ->addCurlOption(CURLOPT_CUSTOMREQUEST, HttpMethodResolver::HTTP_POST)\n ->addCurlOption(CURLOPT_POSTFIELDS, $this->getQuery())\n ;\n }", "private function __construct() {\n if ($_SERVER['REQUEST_METHOD'] == 'GET') {\n $this->data = $_GET;\n } else {\n if (isset($_SERVER['HTTP_CONTENT_TYPE'])) {\n $contentType = $_SERVER['HTTP_CONTENT_TYPE'];\n if (strpos($contentType, ';') !== false) {\n $split = explode(';', $contentType);\n $contentType = trim($split[0]);\n $enc = trim($split[1]);\n }\n if ($contentType == 'application/x-www-form-urlencoded') {\n $this->data = $_POST;\n } else if ($contentType == 'application/json') {\n $json = file_get_contents('php://input');\n $this->data = json_decode($json, true);\n }\n }\n }\n if (strpos($_SERVER['REQUEST_URI'], '/api/') === 0) {\n $this->route = explode('/', $_SERVER['REQUEST_URI']);\n }\n }", "public function __construct(){\r\n\t\t\t$this->request_vars = array();\r\n\t\t\t$this->data = '';\r\n\t\t\t$this->http_accept = (strpos($_SERVER['HTTP_ACCEPT'], 'json')) ? 'json' : 'xml';\r\n\t\t\t$this->method = 'GET';\r\n\t\t}", "public static function createRequest($rawRequest) {\n if(self::isHttpPostRequest($rawRequest)) {\n return new HttpPostRequest($rawRequest);\n }\n // if it is not a post request, create a get request\n else {\n return new HttpGetRequest($rawRequest);\n }\n }", "function getRequest();", "abstract protected function httpRequest($baseUrl, $method, $queryString,\n $headers\n );", "private function __initRequest($type, $data = null)\n {\n $url = sprintf('https://%s/%s/', $this->host, $type);\n if (is_array($data)) {\n $url = sprintf('%s?%s', $url, http_build_query($data));\n }\n $ch = curl_init($url);\n return $ch;\n }", "protected function initRequest()\n {\n $context = new RequestContext();\n $context->fromRequest(self::$request);\n $matcher = new UrlMatcher($this->routCollection, $context);\n\n try {\n $attributes = $matcher->match(self::$request->getPathInfo());\n $response = $this->callController($attributes);\n } catch (ResourceNotFoundException $e) {\n $response = new Response('Not Found', 404);\n } catch (Exception $e) {\n $response = new Response('An error occurred', 500);\n }\n\n $response->send();\n }", "public function & GetRequest ();", "public function make_request() {\n $curl = curl_init();\n\n // Setting our options.\n $options = [\n CURLOPT_URL => $this->get_request_url(),\n CURLOPT_ENCODING => \"gzip\",\n CURLOPT_RETURNTRANSFER => true\n ];\n \n // Setting our extra options - please see top of class for info.\n if(SELF::DEBUG){ $options[CURLOPT_VERBOSE] = true; }\n if(!SELF::SECURE) { $options[CURLOPT_SSL_VERIFYPEER] = false; }\n\n curl_setopt_array($curl, $options);\n\n $this->results = curl_exec($curl);\n\n // https://www.php.net/manual/en/function.curl-errno.php\n if(curl_errno($curl)) {\n throw new \\Exception('Issue occurred with CURL request to server: ' . curl_errno($curl));\n }\n\n // If in debug mode print out the results of our request.\n if(SELF::DEBUG){\n echo '<pre>'.print_r(curl_getinfo($curl),1).'</pre>';\n }\n\n curl_close($curl);\n\n return $this->results;\n }", "function http_request($url, $headers = array(), $method = 'GET', $data = NULL, $retry = 3) {\n $result = new StdClass();\n\n // Parse the URL, and make sure we can handle the schema.\n $uri = parse_url($url);\n\n switch ($uri['scheme']) {\n case 'http':\n $fp = @fsockopen($uri['host'], ($uri['port'] ? $uri['port'] : 80), $errno, $errstr, 15);\n break;\n case 'https':\n // Note: Only works for PHP 4.3 compiled with OpenSSL.\n $fp = @fsockopen('ssl://'. $uri['host'], ($uri['port'] ? $uri['port'] : 443), $errno, $errstr, 20);\n break;\n default:\n $result->error = 'invalid schema '. $uri['scheme'];\n return $result;\n }\n\n // Make sure the socket opened properly.\n if (!$fp) {\n $result->error = trim($errno .' '. $errstr);\n return $result;\n }\n\n // Construct the path to act on.\n $path = $uri['path'] ? $uri['path'] : '/';\n if ($uri['query']) {\n $path .= '?'. $uri['query'];\n }\n\n // Create HTTP request.\n $defaults = array(\n 'Host' => 'Host: '. $uri['host'],\n 'User-Agent' => 'User-Agent: Drupal (+http://www.drupal.org/)',\n 'Content-Length' => 'Content-Length: '. strlen($data)\n );\n\n foreach ($headers as $header => $value) {\n $defaults[$header] = $header .': '. $value;\n }\n\n $request = $method .' '. $path .\" HTTP/1.0\\r\\n\";\n $request .= implode(\"\\r\\n\", $defaults);\n $request .= \"\\r\\n\\r\\n\";\n if ($data) {\n $request .= $data .\"\\r\\n\";\n }\n $result->request = $request;\n\n fwrite($fp, $request);\n\n // Fetch response.\n $response = '';\n while (!feof($fp) && $data = fread($fp, 1024)) {\n $response .= $data;\n }\n fclose($fp);\n\n // Parse response.\n list($headers, $result->data) = explode(\"\\r\\n\\r\\n\", $response, 2);\n $headers = preg_split(\"/\\r\\n|\\n|\\r/\", $headers);\n\n list($protocol, $code, $text) = explode(' ', trim(array_shift($headers)), 3);\n $result->headers = array();\n\n // Parse headers.\n while ($line = trim(array_shift($headers))) {\n list($header, $value) = explode(':', $line, 2);\n $result->headers[$header] = trim($value);\n }\n\n $responses = array(\n 100 => 'Continue', 101 => 'Switching Protocols',\n 200 => 'OK', 201 => 'Created', 202 => 'Accepted', 203 => 'Non-Authoritative Information', 204 => 'No Content', 205 => 'Reset Content', 206 => 'Partial Content',\n 300 => 'Multiple Choices', 301 => 'Moved Permanently', 302 => 'Found', 303 => 'See Other', 304 => 'Not Modified', 305 => 'Use Proxy', 307 => 'Temporary Redirect',\n 400 => 'Bad Request', 401 => 'Unauthorized', 402 => 'Payment Required', 403 => 'Forbidden', 404 => 'Not Found', 405 => 'Method Not Allowed', 406 => 'Not Acceptable', 407 => 'Proxy Authentication Required', 408 => 'Request Time-out', 409 => 'Conflict', 410 => 'Gone', 411 => 'Length Required', 412 => 'Precondition Failed', 413 => 'Request Entity Too Large', 414 => 'Request-URI Too Large', 415 => 'Unsupported Media Type', 416 => 'Requested range not satisfiable', 417 => 'Expectation Failed',\n 500 => 'Internal Server Error', 501 => 'Not Implemented', 502 => 'Bad Gateway', 503 => 'Service Unavailable', 504 => 'Gateway Time-out', 505 => 'HTTP Version not supported'\n );\n // RFC 2616 states that all unknown HTTP codes must be treated the same as\n // the base code in their class.\n if (!isset($responses[$code])) {\n $code = floor($code / 100) * 100;\n }\n\n switch ($code) {\n case 200: // OK\n case 304: // Not modified\n break;\n case 301: // Moved permanently\n case 302: // Moved temporarily\n case 307: // Moved temporarily\n $location = $result->headers['Location'];\n\n if ($retry) {\n $result = http_request($result->headers['Location'], $headers, $method, $data, --$retry);\n $result->redirect_code = $result->code;\n }\n $result->redirect_url = $location;\n\n break;\n default:\n $result->error = $text;\n }\n\n $result->code = $code;\n return $result;\n}", "protected function makeRequest()\n {\n $this->buildRequestURL();\n \n $ch = curl_init($this->requestUrl);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\n $output = curl_exec($ch);\n \n if ($output === false) {\n throw new \\ErrorException(curl_error($ch));\n }\n\n curl_close($ch);\n return $output;\n\n }", "public function getRequestWrapper();", "protected function _request($method, $args, $requireAuth = false)\n {\n $this->_lastRequestUri = null;\n $this->_lastRawResponse = null;\n $this->_lastParsedResponse = null;\n\n if ($requireAuth) {\n if (empty($this->_accessToken)) {\n require_once __DIR__ . '/Untappd/Exception.php';\n throw new Pintlabs_Service_Untappd_Exception('This method requires an access token');\n }\n }\n\n if (!empty($this->_accessToken)) { \n $args['access_token'] = $this->_accessToken;\n } else {\n // Append the API key to the args passed in the query string\n $args['client_id'] = $this->_clientId;\n $args['client_secret'] = $this->_clientSecret;\n }\n\n // remove any unnecessary args from the query string\n foreach ($args as $key => $a) {\n if ($a == '') {\n unset($args[$key]);\n }\n }\n\n if (preg_match('/^http/i', $method)) {\n $this->_lastRequestUri = $method;\n } else {\n $this->_lastRequestUri = self::URI_BASE . '/' . $method;\n }\n\n $this->_lastRequestUri .= '?' . http_build_query($args);\n\n // Set curl options and execute the request\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $this->_lastRequestUri);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n $this->_lastRawResponse = curl_exec($ch);\n\n if ($this->_lastRawResponse === false) {\n\n $this->_lastRawResponse = curl_error($ch);\n require_once __DIR__ . '/Untappd/Exception.php';\n throw new Pintlabs_Service_Untappd_Exception('CURL Error: ' . curl_error($ch));\n }\n\n curl_close($ch);\n\n // Response comes back as JSON, so we decode it into a stdClass object\n $this->_lastParsedResponse = json_decode($this->_lastRawResponse);\n\n \n // If the http_code var is not found, the response from the server was unparsable\n if (!isset($this->_lastParsedResponse->meta->code) && !isset($this->_lastParsedResponse->meta->http_code)) {\n require_once __DIR__ . '/Untappd/Exception.php';\n throw new Pintlabs_Service_Untappd_Exception('Error parsing response from server.');\n }\n\n $code = (isset($this->_lastParsedResponse->meta->http_code)) ? $this->_lastParsedResponse->meta->http_code : $this->_lastParsedResponse->meta->code;\n \n // Server provides error messages in http_code and error vars. If not 200, we have an error.\n if ($code != '200') {\n require_once __DIR__ . '/Untappd/Exception.php';\n \n $errorMessage = (isset($this->_lastParsedResponse->meta->error_detail)) ? $this->_lastParsedResponse->meta->error_detail : $this->_lastParsedResponse->meta->error; \n \n throw new Pintlabs_Service_Untappd_Exception('Untappd Service Error ' .\n $code . ': ' . $errorMessage);\n }\n\n return $this->getLastParsedResponse();\n }", "abstract public function getHttpClient();", "protected function makeGetRequest($uri) {\n $curl = curl_init();\n curl_setopt_array($curl, array(\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_URL => $this->server_url . $uri,\n CURLOPT_USERAGENT => '',\n ));\n $this->response = curl_exec($curl);\n $this->response_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n curl_close($curl);\n\n }", "private function Request($url,$params=false,$type=HTTP_GET){\n \n // Populate data for the GET request\n if($type == HTTP_GET) $url = $this->MakeUrl($url,$params);\n \n \n // borrowed from Andy Langton: http://andylangton.co.uk/\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL,$url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n if ( isset($_SERVER['HTTP_USER_AGENT']) ) {\n curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT'] );\n } else {\n // Handle the useragent like we are Google Chrome\n curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.X.Y.Z Safari/525.13.');\n }\n curl_setopt($ch, CURLOPT_TIMEOUT, 30);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n //$acceptLanguage[] = \"Accept-Language:\" . $this->ClientLanguage;\n //curl_setopt($ch, CURLOPT_HTTPHEADER, $acceptLanguage); \n // Populate the data for POST\n if($type == HTTP_POST) {\n curl_setopt($ch, CURLOPT_POST, 1); \n if($params) curl_setopt($ch, CURLOPT_POSTFIELDS, $params);\n }\n\n //execute\n $response=curl_exec($ch);\n $headers=curl_getinfo($ch);\n\n //fetch errors\n $errorNumber = curl_errno($ch);\n $errorMessage = curl_error($ch);\n\n curl_close($ch);\n\n // replace ids with their string values, added because of some\n // PHP-version can't handle these large values\n $response = preg_replace('/id\":(\\d+)/', 'id\":\"\\1\"', $response);\n\n // we expect JSON, so decode it\n $json = @json_decode($response, true);\n\n // validate JSON\n if ($json === null) {\n // should we provide debug information\n if (self::DEBUG) {\n // make it output proper\n echo '<pre>';\n\n // dump the header-information\n var_dump($headers);\n\n // dump the error\n var_dump($errorMessage);\n\n // dump the raw response\n var_dump($response);\n\n // end proper format\n echo '</pre>';\n }\n\n // throw exception\n throw new Exception('Invalid response.');\n }\n\n // any errors\n if (isset($json['diagnostic']['error_msgs'])) {\n // should we provide debug information\n if (self::DEBUG) { \n\n echo '<pre>';\n echo \"<h3>Header</h3>\";\n // dump the header-information\n var_dump($headers);\n\n echo \"<h3>Error message</h3>\";\n // dump the error\n var_dump($errorMessage);\n\n echo \"<h3>Raw Response</h3>\";\n // dump the raw response\n var_dump($response);\n\n echo \"<h3>Response</h3>\";\n var_dump($json);\n \n echo '</pre>';\n exit();\n }\n\n // throw exception\n /*\n if (isset($json['errors'][0]['message'])) {\n throw new Exception($json['errors'][0]['message']);\n } elseif (isset($json['errors']) && is_string($json['errors'])) {\n throw new Exception($json['errors']);\n } else throw new Exception('Invalid response.');\n */\n }\n\n return $json;\n }", "public function requests()\n\t{\n\t\t$this->checkRequest();\n\t\t$this->getResponse();\n\t}", "protected function getRequestString()\n\t\t{\n\t\t\t// get host, path and port from URL\n\t\t\t$url_info = parse_url( $this->url );\n\t\t\t$path = '';\n\t\t\t$host = '';\n\t\t\tif( $url_info )\n\t\t\t{\n\t\t\t\t$path = isset( $url_info['path'] )?$url_info['path']:'/';\n\t\t\t\t$host = isset( $url_info['host'] )?$url_info['host']:'';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new \\System\\Base\\InvalidOperationException(\"HTTPWebRequest::url is not a valid URL {$this->url}\");\n\t\t\t}\n\n\t\t\t// get data from QueryString\n\t\t\tif( !$this->_data )\n\t\t\t{\n\t\t\t\t$this->_data = isset( $url_info['query'] )?$url_info['query']:'';\n\t\t\t}\n\n\t\t\t// Build Request\n\t\t\t$request = '';\n\t\t\tif( strtoupper( $this->method ) === 'POST' )\n\t\t\t{\n\t\t\t\t$request = \"POST $path HTTP/{$this->httpVersion}\\r\\n\";\n\t\t\t}\n\t\t\telseif( $this->_data )\n\t\t\t{\n\t\t\t\t$request = \"GET $path?{$this->_data} HTTP/{$this->httpVersion}\\r\\n\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$request = \"GET $path HTTP/{$this->httpVersion}\\r\\n\";\n\t\t\t}\n\n\t\t\t$request .= \"Host: $host\\r\\n\";\n\n\t\t\tif( strtoupper( $this->method ) === 'POST' )\n\t\t\t{\n\t\t\t\t$request .= 'Content-type: ' . $this->contentType . \"\\r\\n\";\n\t\t\t\t$request .= 'Content-length: ' . strlen( $this->_data ) . \"\\r\\n\";\n\t\t\t}\n\n\t\t\t// set referrer\n\t\t\tif( $this->referer )\n\t\t\t{\n\t\t\t\t$request .= \"Referer: $this->referer\\r\\n\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$request .= \"Referer: \" . __PROTOCOL__ . \"://\" . __HOST__ . $_SERVER['PHP_SELF'] . \"\\r\\n\";\n\t\t\t}\n\n\t\t\t// $request .= \"User-Agent: \" . $this->agent . \"\\r\\n\";\n\n\t\t\tforeach( $this->_requestHeaders as $header )\n\t\t\t{\n\t\t\t\t$request .= \"$header\\r\\n\";\n\t\t\t}\n\n\t\t\t$request .= \"Connection: keep-alive\\r\\n\\r\\n\";\n\n\t\t\tif( strtoupper( $this->method ) === 'POST' )\n\t\t\t{\n\t\t\t\t$request .= $this->_data;\n\t\t\t}\n\n\t\t\treturn $request;\n\t\t}", "private function __doHttpRequest(SoapRequest $soapRequest)\n {\n // HTTP headers\n $soapVersion = $soapRequest->getVersion();\n $soapAction = $soapRequest->getAction();\n if (SOAP_1_1 == $soapVersion) {\n $headers = array(\n 'Content-Type:' . $soapRequest->getContentType(),\n 'SOAPAction: \"' . $soapAction . '\"',\n );\n } else {\n $headers = array(\n 'Content-Type:' . $soapRequest->getContentType() . '; action=\"' . $soapAction . '\"',\n );\n }\n\n $location = $soapRequest->getLocation();\n $content = $soapRequest->getContent();\n\n $headers = $this->filterRequestHeaders($soapRequest, $headers);\n\n $options = $this->filterRequestOptions($soapRequest);\n\n // execute HTTP request with cURL\n $responseSuccessfull = $this->curl->exec(\n $location,\n $content,\n $headers,\n $options\n );\n\n // tracing enabled: store last request header and body\n if ($this->tracingEnabled === true) {\n $this->lastRequestHeaders = $this->curl->getRequestHeaders();\n $this->lastRequest = $soapRequest->getContent();\n }\n // in case of an error while making the http request throw a soapFault\n if ($responseSuccessfull === false) {\n // get error message from curl\n $faultstring = $this->curl->getErrorMessage();\n throw new \\SoapFault('HTTP', $faultstring);\n }\n // tracing enabled: store last response header and body\n if ($this->tracingEnabled === true) {\n $this->lastResponseHeaders = $this->curl->getResponseHeaders();\n $this->lastResponse = $this->curl->getResponseBody();\n }\n // wrap response data in SoapResponse object\n $soapResponse = SoapResponse::create(\n $this->curl->getResponseBody(),\n $soapRequest->getLocation(),\n $soapRequest->getAction(),\n $soapRequest->getVersion(),\n $this->curl->getResponseContentType()\n );\n\n return $soapResponse;\n }", "private function __construct(){\n $this->setRequestUri();\n }", "function request($url, $params = false) {\n\t\t$req =& new HTTP_Request($this->base . $url);\n\t\t//authorize\n\t\t$req->setBasicAuth($this->user, $this->pass);\n\t\t//set the headers\n\t\t$req->addHeader(\"Accept\", \"application/xml\");\n\t\t$req->addHeader(\"Content-Type\", \"application/xml\");\n\t\t//if were sending stuff\n\t\tif ($params) {\n\t\t\t//serialize the data\n\t\t\t//$xml = $this->serialize($params);\n\t\t\t//($xml)?$req->setBody($xml):false;\n\t\t\t$req->setBody($params);\n\t\t\t$req->setMethod(HTTP_REQUEST_METHOD_POST);\n\t\t}\n\t\t$response = $req->sendRequest();\n\t\t// print_r($req->getResponseHeader());\n\t\t// echo $req->getResponseCode() .\t\"\\n\";\n\t\t\n\t\tif (PEAR::isError($response)) {\n\t\t return $response->getMessage();\n\t\t} else {\n\t\t print_r($req->getResponseBody());\n\t\t return $req->getResponseBody();\n\t\t}\n\t}", "public function request()\n {\n }", "public function request()\n {\n }", "function init_request($request)\n {\n }", "function init_request($request)\n {\n }", "function _parseRequest($url, $options = array()) {\n\n\t\t$request = array_merge($this->request, array('url' => $this->_parseUrl($url)), $options);\n\n\t\t$request['timeout'] = (int) ceil($request['timeout']);\n\t\t$request['redirects'] = (int) $request['redirects'];\n\t\t\n\t\tif (is_array($request['header'])) {\n\t\t\t$request['header'] = $this->_parseHeader($request['header']);\n\t\t\t$request['header'] = array_merge(array('Host' => $request['url']['host']), $request['header']);\n\t\t}\n\n\t\tif (isset($request['auth']['user']) && isset($request['auth']['pass'])) {\n\t\t\t$request['header']['Authorization'] = $request['auth']['method'].' '.base64_encode($request['auth']['user'].':'.$request['auth']['pass']);\n\t\t}\n\t\t\n\t\tif (isset($request['url']['user']) && isset($request['url']['pass'])) {\n\t\t\t$request['header']['Authorization'] = $request['auth']['method'].' '.base64_encode($request['url']['user'].':'.$request['url']['pass']);\n\t\t}\n\n\t\tif (!empty($request['body']) && !isset($request['header']['Content-Type'])) {\n\t\t\t$request['header']['Content-Type'] = 'application/x-www-form-urlencoded';\n\t\t}\n\n\t\tif (!empty($request['body']) && !isset($request['header']['Content-Length'])) {\n\t\t\t$request['header']['Content-Length'] = strlen($request['body']);\n\t\t}\n\t\t\n\t\tif (empty($request['line'])) {\n\t\t\t$request['line'] = strtoupper($request['method']).' '.$request['url']['path'].(isset($request['url']['query']) ? '?'.$request['url']['query'] : ''). ' HTTP/' . $request['version'].$this->line_break;\n\t\t}\n\n\t\t$request['raw'] = $request['line'].$this->_buildHeader($request['header']);\n\n\t\tif (!empty($request['cookies'])) {\n\t\t\t$request['raw'] .= $this->buildCookies($request['cookies']);\n\t\t}\n\n\t\t$request['raw'] .= $this->line_break.$request['body'];\n\n\t\treturn $request;\n\t}", "private function init() {\n $this->_cm = curl_init();\n curl_setopt($this->_cm, CURLOPT_PROXY, $config['curl']['proxy']);\n curl_setopt($this->_cm, CURLOPT_HTTPAUTH, CURLAUTH_BASIC | CURLAUTH_DIGEST);\n curl_setopt($this->_cm, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($this->_cm, CURLOPT_SSL_VERIFYHOST, FALSE);\n curl_setopt($this->_cm, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($this->_cm, CURLOPT_TIMEOUT, $config['curl']['timeout']);\n curl_setopt($this->_cm, CURLOPT_POST, true); \n }", "public function __construct()\n { \n //New GuzzleHttp Client\n $this->http_client= new \\GuzzleHttp\\Client([\n 'base_uri' => 'http://127.0.0.1:8000'\n ]);\n\n\n //INITIALIZE Request Path\n $this->request_path= '/api';\n\n //INITIALIZE Request Body\n $this->request_body= [];\n\n }", "function Cgn_SystemRequest() {\n\t\t/*\n\t\t$this->vars = Cgn_ObjectStore::getObject('request://request');\n\t\t$this->getvars = Cgn_ObjectStore::getObject('request://get');\n\t\t$this->postvars = Cgn_ObjectStore::getObject('request://post');\n\t\t$this->cookies = Cgn_ObjectStore::getObject('request://cookie');\n\t\t */\n\n\t\tif (defined ('CGN_PRODUCTION_ENVIRONMENT')) \n\t\t$this->prodEnv = CGN_PRODUCTION_ENVIRONMENT;\n\t}", "private static function _initialise () {\r\n\t\tif (!self::$_request) {\r\n\t\t\tself::$_request = array_merge ($_GET, $_POST);\r\n\t\t}\n\t\t\r\n\t}", "function buildHostRequest() {\r\n\t\t$strRequest = \"\";\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->amt ) > 0) {\r\n\t\t\t\t$strRequest .= \"amt=\" . $this->amt . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->action ) > 0) {\r\n\t\t\t\t$strRequest .= \"action=\" . $this->action . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->responseURL ) > 0) {\r\n\t\t\t\t$strRequest .= \"responseURL=\" . $this->responseURL . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->errorURL ) > 0) {\r\n\t\t\t\t$strRequest .= \"errorURL=\" . $this->errorURL . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->trackId ) > 0) {\r\n\t\t\t\t$strRequest .= \"trackid=\" . $this->trackId . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf1 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf1=\" . $this->udf1 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf2 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf2=\" . $this->udf2 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf3 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf3=\" . $this->udf3 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf4 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf4=\" . $this->udf4 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf5 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf5=\" . $this->udf5 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf6 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf6=\" . $this->udf6 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf7 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf7=\" . $this->udf7 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf8 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf8=\" . $this->udf8 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf9 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf9=\" . $this->udf9 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf10 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf10=\" . $this->udf10 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf11 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf11=\" . $this->udf11 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf12 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf12=\" . $this->udf12 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf13 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf13=\" . $this->udf13 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf14 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf14=\" . $this->udf14 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf15 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf15=\" . $this->udf15 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf16 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf16=\" . $this->udf16 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf17 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf17=\" . $this->udf17 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf18 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf18=\" . $this->udf18 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf19 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf19=\" . $this->udf19 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf20 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf20=\" . $this->udf20 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf21 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf21=\" . $this->udf21 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf22 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf22=\" . $this->udf22 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf23 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf23=\" . $this->udf23 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf24 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf24=\" . $this->udf24 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf25 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf25=\" . $this->udf25 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf26 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf26=\" . $this->udf26 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf27 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf27=\" . $this->udf27 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf28 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf28=\" . $this->udf28 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf29 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf29=\" . $this->udf29 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf30 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf30=\" . $this->udf30 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf31 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf31=\" . $this->udf31 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf32 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf32=\" . $this->udf32 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->currency ) > 0) {\r\n\t\t\t\t$strRequest .= \"currencycode=\" . $this->currency . \"&\";\r\n\t\t\t}\r\n\t\t\tif ($this->language != null && strlen ( $this->language ) > 0) {\r\n\t\t\t\t$strRequest .= \"langid=\" . $this->language . \"&\";\r\n\t\t\t}\r\n\t\t\treturn $strRequest;\r\n\t\t} catch ( Exception $e ) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t/*\r\n\t\t * finally{\r\n\t\t * $strRequest = null;\r\n\t\t * }\r\n\t\t */\r\n\t}", "public function makeRequest(): void\n {\n if (!$this->token) {\n $this->login();\n }\n\n try {\n $promise = $this->client->requestAsync('POST', 'https://api.jamef.com.br/rastreamento/ver',\n [\n 'headers' =>\n [\n 'Authorization' => 'Bearer ' . $this->token,\n ],\n 'json' => $this->buildRequest()\n ]\n )->then(function ($response) {\n $this->parseResult($response);\n });\n $promise->wait();\n } catch (RequestException $e) {\n $error = json_decode($e->getResponse()->getBody());\n if($error->message){\n $this->result->errors[] = utf8_decode($error->message->message);\n }\n $this->result->status = 'ERROR';\n $this->result->errors[] = 'Curl Error: ' . $e->getMessage();\n }\n }", "private function _request($method, $args, $requireAuth = false)\n\t{\n\t\t$this->_lastRequestUri = null;\n\t\t$this->_lastRawResponse = null;\n\t\t$this->_lastParsedResponse = null;\n\n\t\tif ($requireAuth) {\n\t\t\tif (empty($this->_accessToken)) {\n\t\t\t\tthrow new LaravelUntappdException('This method requires an access token');\n\t\t\t}\n\t\t}\n\n\t\tif (!empty($this->_accessToken)) {\n\t\t\t$args['access_token'] = $this->_accessToken;\n\t\t} else {\n\t\t\t// Append the API key to the args passed in the query string\n\t\t\t$args['client_id'] = $this->_clientId;\n\t\t\t$args['client_secret'] = $this->_clientSecret;\n\t\t}\n\n\t\t// remove any unnecessary args from the query string\n\t\tforeach ($args as $key => $a) {\n\t\t\tif ($a == '') {\n\t\t\t\tunset($args[$key]);\n\t\t\t}\n\t\t}\n\n\t\tif (preg_match('/^http/i', $method)) {\n\t\t\t$this->_lastRequestUri = $method;\n\t\t} else {\n\t\t\t$this->_lastRequestUri = self::URI_BASE . '/' . $method;\n\t\t}\n\n\t\t$this->_lastRequestUri .= '?' . http_build_query($args);\n\n\t\t// Set curl options and execute the request\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $this->_lastRequestUri);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n\t\t$this->_lastRawResponse = curl_exec($ch);\n\n\t\tif ($this->_lastRawResponse === false) {\n\t\t\t$this->_lastRawResponse = curl_error($ch);\n\t\t\tthrow new LaravelUntappdException('CURL Error: ' . curl_error($ch));\n\t\t}\n\n\t\tcurl_close($ch);\n\n\t\t// Response comes back as JSON, so we decode it into a stdClass object\n\t\t$this->_lastParsedResponse = json_decode($this->_lastRawResponse);\n\n\t\t// If the http_code var is not found, the response from the server was unparsable\n\t\tif (!isset($this->_lastParsedResponse->meta->code) && !isset($this->_lastParsedResponse->meta->http_code)) {\n\t\t\tthrow new LaravelUntappdException('Error parsing response from server.');\n\t\t}\n\n\t\t$code = (isset($this->_lastParsedResponse->meta->http_code)) ? $this->_lastParsedResponse->meta->http_code : $this->_lastParsedResponse->meta->code;\n\n\t\t// Server provides error messages in http_code and error vars. If not 200, we have an error.\n\t\tif ($code != '200') {\n\n\t\t\t$errorMessage = (isset($this->_lastParsedResponse->meta->error_detail)) ? $this->_lastParsedResponse->meta->error_detail : $this->_lastParsedResponse->meta->error;\n\n\t\t\tthrow new LaravelUntappdException('Untappd Service Error ' .\n\t\t\t\t$code . ': ' . $errorMessage);\n\t\t}\n\n\t\treturn $this->getLastParsedResponse();\n\t}", "private function http_request($service, $params)\n\t{\n\t\t$header = array(\n\t\t\t'errno'=>'',\n\t\t\t'errmsg'=>'',\n\t\t\t'content'=>''\n\t\t);\n\n\t\t$url = $service . '?' . $params;\n\n\t\t//print(\"<p><a style='color:blue;' target='_blank' href='\" . $url . \"'>Open API query directly</a></p>\");\n\n\t\tif (in_array('curl', get_loaded_extensions()))\n\t\t{\n\t\t\t$options = array\n\t\t\t(\n\t\t\t\tCURLOPT_RETURNTRANSFER => true, // return web page\n\t\t\t\tCURLOPT_HEADER => false, // don't return headers\n\t\t\t\tCURLOPT_FOLLOWLOCATION => true, // follow redirects\n\t\t\t\tCURLOPT_ENCODING => \"\", // handle all encodings\n\t\t\t\tCURLOPT_USERAGENT => \"PacoConnector\",\n\t\t\t\tCURLOPT_AUTOREFERER => true, // set referer on redirect\n\t\t\t\tCURLOPT_CONNECTTIMEOUT => 120, // timeout on connect\n\t\t\t\tCURLOPT_TIMEOUT => 120, // timeout on response\n\t\t\t\tCURLOPT_MAXREDIRS => 10, // stop after 10 redirects\n\t\t\t);\n\n\t\t\t$ch = curl_init($url);\n\t\t\tcurl_setopt_array($ch, $options);\n\t\t\t$content = curl_exec($ch);\n\t\t\t$err = curl_errno($ch);\n\t\t\t$errmsg = curl_error($ch);\n\t\t\t$header = curl_getinfo($ch);\n\t\t\tcurl_close($ch);\n\n\t\t\t$header['errno'] = $err;\n\t\t\t$header['errmsg'] = $errmsg;\n\t\t\t$header['content'] = $content;\n\t\t}\n\t\telse if (function_exists('file_get_contents'))\n\t\t{\n\t\t\t$request = @file_get_contents($url);\n\n\t\t\tif ($request !== false)\n\t\t\t{\n\t\t\t\t$header['content'] = $request;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$header['errmsg'] = 'Failed to make connection';\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\tprint($params);\n\t\tprint('<pre>');\n\t\tprint_r($header['content']);\n\t\tprint('</pre>');*/\n\n\t\treturn $header;\n\t}", "function sendRequest()\n\t\t{\n\t\t\t$stream = $this->getRequestStream();\n\t\t\t$stream->write( $this->getRequestString() );\n\t\t\t$stream->close();\n\t\t}", "protected function initiateSubRequest() {}", "public static function from_request($http_method=NULL, $http_url=NULL, $parameters=NULL)\n {\n $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != \"on\") ? 'http' : 'https';\n @$http_url or $http_url = $scheme . '://' . $_SERVER['HTTP_HOST'] . ':' . $_SERVER['SERVER_PORT'] . $_SERVER['REQUEST_URI'];\n @$http_method or $http_method = $_SERVER['REQUEST_METHOD'];\n\n $request_headers = OAuthRequest::get_headers();\n\n // let the library user override things however they'd like, if they know\n // which parameters to use then go for it, for example XMLRPC might want to\n // do this\n if ($parameters)\n $req = new OAuthRequest($http_method, $http_url, $parameters);\n else\n {\n // collect request parameters from query string (GET) and post-data (POST) if appropriate (note: POST vars have priority)\n $req_parameters = $_GET;\n if ($http_method == \"POST\" && @strstr($request_headers[\"Content-Type\"], \"application/x-www-form-urlencoded\") )\n {\n $req_parameters = array_merge($req_parameters, $_POST);\n }\n\n // next check for the auth header, we need to do some extra stuff\n // if that is the case, namely suck in the parameters from GET or POST\n // so that we can include them in the signature\n if (@substr($request_headers['Authorization'], 0, 6) == \"OAuth \")\n {\n $header_parameters = OAuthRequest::split_header($request_headers['Authorization']);\n $parameters = array_merge($req_parameters, $header_parameters);\n $req = new OAuthRequest($http_method, $http_url, $parameters);\n } else $req = new OAuthRequest($http_method, $http_url, $req_parameters);\n }\n\n return $req;\n }" ]
[ "0.70340765", "0.6794848", "0.66729385", "0.66483516", "0.66159934", "0.6594412", "0.6514891", "0.64351463", "0.6431651", "0.64143807", "0.64109343", "0.63843447", "0.63463795", "0.62247485", "0.62219113", "0.6217083", "0.6212617", "0.6207232", "0.6164742", "0.6153252", "0.6137301", "0.6132206", "0.60829973", "0.6080411", "0.60796815", "0.6077478", "0.6034858", "0.6031965", "0.6026199", "0.6015337", "0.60110503", "0.5978896", "0.5976663", "0.59642494", "0.59642494", "0.594596", "0.59374857", "0.59343296", "0.59343296", "0.59343296", "0.59343296", "0.59343296", "0.59343296", "0.59343296", "0.59343296", "0.5929483", "0.59015846", "0.58876777", "0.588064", "0.5871102", "0.58710116", "0.58667564", "0.58622503", "0.5858933", "0.58474785", "0.5836966", "0.58369654", "0.5830616", "0.58214885", "0.5812601", "0.58081555", "0.5799844", "0.5798891", "0.5797471", "0.57929736", "0.578851", "0.57798797", "0.57785004", "0.5774774", "0.57723296", "0.5759302", "0.5734621", "0.5727057", "0.5723322", "0.5717858", "0.5711982", "0.57080823", "0.5694884", "0.56898195", "0.5681336", "0.5679113", "0.56770223", "0.5675302", "0.56645024", "0.5661085", "0.56546164", "0.56546164", "0.5636192", "0.5636192", "0.5635863", "0.5631957", "0.5620975", "0.56137", "0.56028795", "0.5595039", "0.55929345", "0.5583637", "0.55827236", "0.5580857", "0.5578275", "0.5575844" ]
0.0
-1
Converts omeka record to appropriate request body in json format.
public function prepareRequestBody($record){ $requestBody = array( 'data' => array( 'name' => $record->id.'.json', 'type' => 'text/plain', 'content' => serialize($record) ) ); return $requestBody; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _recordToJson($_record)\n {\n $converter = Tinebase_Convert_Factory::factory($_record);\n $result = $converter->fromTine20Model($_record);\n\n return $result;\n }", "function record($request) {\n\t\t$type = $request->getVar('type');\n\t\t$value = $request->getVar('value');\n\t\tif ($type && $value) {\n\t\t\t$record = DataObject::get_one($this->dataObject->class, \"\\\"$type\\\" = '$value'\");\n\t\t\theader(\"Content-Type: text/plain\");\n\t\t\techo json_encode(array(\"record\"=>$record->toMap()));\n\t\t}\n\t}", "public function requestBodyConverter($object)\n {\n }", "protected function _toJSON( $controller, $table, $model, $formelements, $recordId=null ){\n //\n\t\t$data['controller'] = $controller;\n\t\t$data['table'] = $table;\n\t\t$data['model'] = $model;\n\t\t\n\t\t// add the backfilled record\n\t\t//\n\t\tif(is_null($recordId) || $recordId==\"\"){\n\t\t $data['recordPkey'] = \"\";\n\t\t $data['record'] = \"\";\n\t\t}\n\t\telse{\n \t\t $this->load->model($model);\n\t\t $object = $this->emExternal->find($model,$recordId);\n\t\t $data['record'] = $object;\n\t\t $field = $object->getIdFieldName();\n\t\t $data['recordPkey'] = $object->$field;\n\t }\n\t\t \n \t $data['form'] = $formelements;\n\n\t\techo json_encode($data);\n\t}", "public function json()\n {\n $data = [\n '$schema' => self::PAYLOAD_SCHEMA,\n 'dt' => $this->dt,\n 'message' => $this->message,\n 'level' => $this->level,\n ];\n\n if (count($this->context)) {\n $data['context'] = $this->context;\n }\n if (count($this->event)) {\n $data['event'] = $this->event;\n }\n\n $options = [\n RequestOptions::JSON => [$data],\n ];\n\n return $this->doRequest(self::METHOD_POST, 'frames', $options);\n }", "public function to_json()\n {\n return json_encode($this->body);\n\t}", "public function getRepresentation(Omeka_Record_AbstractRecord $record)\n {\n $representation = array(\n 'id' => $record->id, \n 'url' => $this->getResourceUrl(\"/geolocations/{$record->id}\"), \n \n \"point_of_interest\" => $record->point_of_interest, \n \"route\" => $record->route,\n \"street_number\" => $record->street_number,\n \"postal_code\" => $record->postal_code,\n \"postal_code_prefix\" => $record->postal_code_prefix,\n \"sublocality\" => $record->sublocality,\n \"locality\" => $record->locality,\n \"natural_feature\" => $record->natural_feature,\n \"establishment\" => $record->establishment,\n \"point_of_interest\" => $record->point_of_interest,\n \"administrative_area_level_3\" => $record->administrative_area_level_3,\n \"administrative_area_level_2\" => $record->administrative_area_level_2,\n \"administrative_area_level_1\" => $record->administrative_area_level_1,\n \"country\" => $record->country,\n \"continent\" => $record->continent,\n \"planetary_body\" => $record->planetary_body,\n \n 'latitude' => $record->latitude, \n 'longitude' => $record->longitude, \n 'zoom_level' => $record->zoom_level, \n 'map_type' => $record->map_type, \n 'address' => $record->address, \n 'item' => array(\n 'id' => $record->item_id, \n 'url' => $this->getResourceUrl(\"/items/{$record->item_id}\"), \n 'resource' => 'items', \n ),\n 'location_type' => $record->location_type\n );\n return $representation;\n }", "protected function json(){\n $this->before(function ($request) {\n if ($request->contentType == \"application/json; charset=utf-8\") {\n $request->data = json_decode($request->data);\n }\n });\n $this->after(function ($response) {\n $response->contentType = \"application/json; charset=utf-8\";\n if (isset($_GET['jsonp'])) {\n $response->body = $_GET['jsonp'].'('.json_encode($response->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES).');';\n } else {\n $response->body = json_encode($response->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);\n }\n });\n }", "protected function json(){\n $this->before(function ($request) {\n if ($request->contentType == \"application/json; charset=utf-8\") {\n $request->data = json_decode($request->data);\n }\n });\n $this->after(function ($response) {\n $response->contentType = \"application/json; charset=utf-8\";\n if (isset($_GET['jsonp'])) {\n $response->body = $_GET['jsonp'].'('.json_encode($response->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES).');';\n } else {\n $response->body = json_encode($response->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);\n }\n });\n }", "protected function json(){\n $this->before(function ($request) {\n if ($request->contentType == \"application/json; charset=utf-8\") {\n $request->data = json_decode($request->data);\n }\n });\n $this->after(function ($response) {\n $response->contentType = \"application/json; charset=utf-8\";\n if (isset($_GET['jsonp'])) {\n $response->body = $_GET['jsonp'].'('.json_encode($response->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES).');';\n } else {\n $response->body = json_encode($response->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);\n }\n });\n }", "public function jsonSerialize()\n {\n $this->serializeWithId($this->resolveFields(\n resolve(Request::class)\n ));\n }", "private function _serializeOrderDetail($record)\n {\n $order_details = new Order_Details();\n $order_details->Discount = $record['Discount'];\n $order_details->OrderID = $record['OrderID'];\n $order_details->ProductID = $record['ProductID'];\n $order_details->Quantity = $record['Quantity'];\n $order_details->UnitPrice = $record['UnitPrice'];\n return $order_details; \n }", "public function formatRecord(Record $record) {\n\t\t$record = $this->normalizeValues($record);\n\n\t\t$output = [];\n\t\t\n\t\t$extra = $this->arr($record->extra);\n\t\tif($extra->keyExists('line') && $extra->keyExists('file')){\n\t\t\t$output['line'] = $extra['line'];\n\t\t\t$output['file'] = $extra['file'];\n\t\t\t$extra->removeKey('line')->removeKey('file');\n\t\t}\n\n\t\tif($extra->keyExists('memory_usage')){\n\t\t\t$output['memory'] = $extra['memory_usage'];\n\t\t\t$extra->removeKey('memory_usage');\n\t\t}\n\n\t\t$record->extra = $extra->val();\n\n\t\t// Handle main record values\n\t\tforeach ($record as $var => $val) {\n\t\t\tif($this->isDateTimeObject($val)) {\n\t\t\t\t$val = $val->format($this->dateFormat);\n\t\t\t}\n\t\t\tif($this->isObject($val)) {\n\t\t\t\t$val = (array)$val;\n\t\t\t} elseif($this->isArray($val)) {\n\t\t\t\t$val = json_encode($val);\n\t\t\t}\n\n\t\t\t$output[$var] = $val;\n\t\t}\n\n\t\treturn $output;\n\t}", "private function body()\n {\n return json_decode($this->request->all()[\"job\"], true);\n }", "public function body()\n {\n $entityBody = file_get_contents('php://input');\n\n foreach ((array)json_decode($entityBody) as $field => $value) {\n $this->requestStack[$field] = $value;\n }\n return json_decode($entityBody);\n }", "public function toJson()\n {\n $array = [];\n if(count($this->_headers))\n {\n $array['Header'] = [\n 'context' => [\n '_jsns' => 'urn:zimbra',\n ],\n ];\n foreach ($this->_headers as $name => $value)\n {\n $array['Header']['context'][$name] = array('_content' => $value);\n }\n }\n if($this->_request instanceof Request)\n {\n $reqArray = $this->_request->toArray();\n $reqName = $this->_request->requestName();\n $array['Body'][$reqName] = $reqArray[$reqName];\n }\n return json_encode((object) $array);\n }", "protected function write(array $record): void\n {\n $this->client->post($this->url, [\n RequestOptions::HEADERS => ['Content-Type' => 'application/json'],\n RequestOptions::BODY => json_encode($this->getMessage($record))\n ]);\n }", "public function toJson();", "public function toJson();", "protected function _createPayload($job)\n {\n return json_encode($job);\n }", "public function buildJson();", "abstract protected function map_object_to_record($object, $record);", "protected function reportCloudRecordingRequest($from, $to)\n {\n // verify the required parameter 'from' is set\n if ($from === null || (is_array($from) && count($from) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $from when calling reportCloudRecording'\n );\n }\n // verify the required parameter 'to' is set\n if ($to === null || (is_array($to) && count($to) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $to when calling reportCloudRecording'\n );\n }\n\n $resourcePath = '/report/cloud_recording';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($from !== null) {\n $queryParams['from'] = ObjectSerializer::toQueryValue($from);\n }\n // query params\n if ($to !== null) {\n $queryParams['to'] = ObjectSerializer::toQueryValue($to);\n }\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'application/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'application/xml'],\n ['application/json', 'multipart/form-data']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function jsonSerialize()\n {\n return array('headers' => $this->headers, 'body' => $this->body);\n }", "public function jsonSerialize()\n {\n return $this->getBody(true);\n }", "public function toObject(){\r\n return json_decode($this->toJson());\r\n }", "private function _serializeOrder($record)\n {\n $order = new Order();\n $order->OrderID = $record['OrderID'];\n $order->CustomerID = $record['CustomerID'];\n $order->EmployeeID = $record['EmployeeID'];\n $order->OrderDate = !is_null($record['OrderDate']) ? $record['OrderDate']->format('Y-m-d\\TH:i:s'): null;\n $order->RequiredDate = !is_null($record['RequiredDate']) ? $record['RequiredDate']->format('Y-m-d\\TH:i:s'): null;\n $order->ShippedDate = !is_null($record['ShippedDate']) ? $record['ShippedDate']->format('Y-m-d\\TH:i:s'): null;\n $order->ShipVia = $record['ShipVia'];\n $order->Freight = $record['Freight'];\n $order->ShipName = $record['ShipName'];\n $order->ShipAddress = $record['ShipAddress'];\n $order->ShipCity = $record['ShipCity'];\n $order->ShipRegion = $record['ShipRegion'];\n $order->ShipPostalCode = $record['ShipPostalCode'];\n $order->ShipCountry = $record['ShipCountry'];\n return $order;\n }", "private function bodyBuilder(){\n\t\t// create empty structures\n\t\t$body = new stdClass();\n\t\t$input = new stdClass();\n\n\n\t\t// add leads array to input\n\t\t$body->input = $this->leads;\n\n\t\t// if tokens exists, add them to body->input\n\t\tif (isset($this->tokens)) {\n\t\t\t$body->input->tokens = $this->tokens;\n\t\t}\n\n\t\t$json = json_encode($body, JSON_PRETTY_PRINT);\n\n\t\treturn $json;\n\t}", "private function _JsonData() \n {\n $raw = file_get_contents('php://input', true);\n $body = json_decode($raw);\n \n $this->__new((array) $body);\n }", "private function fixObjtoJSON($request)\n {\n // Nest options correctly\n if (isset($request->Options) && count($request->Options->Option)) {\n $i = 0;\n $tempClass = new \\stdClass();\n foreach ($request->Options->Option as $Option) {\n $tempClass->Options[$i] = $Option;\n $i++;\n }\n $request->Options = $tempClass->Options;\n }\n \n // Format and nest LineItems correctly\n if (isset($request->Items) && count($request->Items->LineItem)) {\n $i = 0;\n $tempClass = new \\stdClass();\n foreach ($request->Items->LineItem as $LineItem) {\n // must be strings\n if (isset($LineItem->Quantity)) {\n $LineItem->Quantity = (string)($LineItem->Quantity);\n }\n if (isset($LineItem->UnitCost)) {\n $LineItem->UnitCost = strval($LineItem->UnitCost);\n }\n if (isset($LineItem->Tax)) {\n $LineItem->Tax = strval($LineItem->Tax);\n }\n if (isset($LineItem->Total)) {\n $LineItem->Total = strval($LineItem->Total);\n }\n $tempClass->Items[$i] = $LineItem;\n $i++;\n }\n $request->Items = $tempClass->Items;\n }\n\n // fix blank issue\n if (isset($request->RedirectUrl)) {\n $request->RedirectUrl = str_replace(' ', '%20', $request->RedirectUrl);\n }\n if (isset($request->CancelUrl)) {\n $request->CancelUrl = str_replace(' ', '%20', $request->CancelUrl);\n }\n\n $jsonRequest = json_encode($request);\n\n return $jsonRequest;\n }", "public function jsonSerialize()\n {\n return $this->toWei();\n }", "protected function save($recordKey = null)\n\t{\n\t\t$data = (array) json_decode($this->input->json->getRaw(), true);\n\n\t\tforeach (FieldsHelper::getFields('com_foos.foo') as $field)\n\t\t{\n\t\t\tif (isset($data[$field->name]))\n\t\t\t{\n\t\t\t\t!isset($data['com_fields']) && $data['com_fields'] = [];\n\n\t\t\t\t$data['com_fields'][$field->name] = $data[$field->name];\n\t\t\t\tunset($data[$field->name]);\n\t\t\t}\n\t\t}\n\n\t\t$this->input->set('data', $data);\n\n\t\treturn parent::save($recordKey);\n\t}", "protected function _dependentRecordsFromJson(&$record)\n {\n $config = $record::getConfiguration();\n if ($config) {\n \n $recordsFields = $config->recordsFields;\n \n if ($recordsFields) {\n foreach ($recordsFields as $property => $fieldDef) {\n\n $rcn = $fieldDef['config']['recordClassName'];\n if ($record->has($property) && $record->{$property} && is_array($record->{$property})) {\n $recordSet = new RecordSet($rcn);\n foreach ($record->{$property} as $recordArray) {\n if (is_array($recordArray)) {\n $srecord = new $rcn(array(), true);\n $srecord->setFromJsonInUsersTimezone($recordArray);\n $recordSet->addRecord($srecord);\n } else {\n if (Core::isLogLevel(LogLevel::ERR)) Core::getLogger()->err(__METHOD__ . '::' . __LINE__\n . ' Record array expected, got: ' . $recordArray);\n throw new InvalidArgument('Record array expected');\n }\n $record->{$property} = $recordSet;\n }\n }\n }\n }\n }\n }", "public function getDecodedBody()\r\n\t{\r\n\t\treturn ResponseObjectBuilder::buildFromJSON($this->body);\r\n\t}", "protected function mapJson() {\n $post = json_decode(file_get_contents('php://input'), true);\n if(is_null($post)) return;\n foreach($post as $key => $value) {\n $this->data[$key] = $value;\n }\n }", "public function getJSON()\n {\n if ($this->json) {\n return $this->json;\n }\n\n $this->json = @json_decode($this->rawBody);\n\n return $this->json;\n }", "private function reformateInput(){\n\n\n $articlegroupId = $this->searchKey('articleGroupId', $this->jsonBody);\n\n if($articlegroupId === null){\n $response = $this->unprocessableEntityResponse();\n return $response;\n }else{\n\n $articleName = $this->invoiceModel->getArticleName($articlegroupId);\n \n if($articleName === null){\n $response = $this->unprocessableEntityResponse();\n return $response;\n }elseif ($articleName == 'uriError') {\n \n $response = $this->badGatwayResponse();\n return $response;\n }\n\n $results=$this->readJson($this->jsonBody);\n\n $items = array(\n 'plu' => $results['values'][5],\n 'articleGroup' => $articleName,\n 'name' => $results['values'][7],\n 'price' => $results['values'][8]/100,\n 'quantity' => $results['values'][9],\n 'totalPrice' => $results['values'][10]/100);\n\n $responseJson= array(\n 'invoice' => $this->jsonBody['number'],\n 'date' => $this->jsonBody['date'],\n 'items' => [$items]);\n \n $responseJson = json_encode($responseJson);\n //print_r($responseJson);\n\n \n //initialized curl\n $ch = curl_init($this->toSendURL);\n\n curl_setopt($ch, CURLOPT_POSTFIELDS, $responseJson);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));\n // Return response instead of outputting\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $result = curl_exec($ch);\n //if success the result will be empty\n if($result !== false){\n $response = $this->badGatwayResponse();\n return $response;\n \n }\n else{\n $response['status_code_header'] = 'HTTP/1.1 200 OK';\n $response['body'] = $responseJson;\n //$response['body'] = $result;\n return $response;\n }\n\n\n // Close cURL resource\n curl_close($ch);\n \n \n }\n\n \n }", "public function toJSON () {\r\n \treturn json_encode($this->_response);\r\n }", "public function setPostData(Omeka_Record_AbstractRecord $record, $data)\n {\n if (isset($data->item->id)) {\n $record->item_id = $data->item->id;\n }\n \n if (isset($data->point_of_interest)) {\n $record->point_of_interest = $data->point_of_interest;\n }\n if (isset($data->route)) {\n $record->route = $data->route;\n }\n if (isset($data->street_number)) {\n $record->street_number = $data->street_number;\n }\n if (isset($data->postal_code)) {\n $record->postal_code = $data->postal_code;\n }\n if (isset($data->postal_code_prefix)) {\n $record->postal_code_prefix = $data->postal_code_prefix;\n }\n if (isset($data->sublocality)) {\n $record->sublocality = $data->sublocality;\n }\n if (isset($data->locality)) {\n $record->locality = $data->locality;\n }\n if (isset($data->natural_feature)) {\n $record->natural_feature = $data->natural_feature;\n }\n if (isset($data->establishment)) {\n $record->establishment = $data->establishment;\n }\n if (isset($data->point_of_interest)) {\n $record->point_of_interest = $data->point_of_interest;\n }\n if (isset($data->administrative_area_level_3)) {\n $record->administrative_area_level_3 = $data->administrative_area_level_3;\n }\n if (isset($data->administrative_area_level_2)) {\n $record->administrative_area_level_2 = $data->administrative_area_level_2;\n }\n if (isset($data->administrative_area_level_1)) {\n $record->administrative_area_level_1 = $data->administrative_area_level_1;\n }\n if (isset($data->country)) {\n $record->country = $data->country;\n }\n if (isset($data->continent)) {\n $record->continent = $data->continent;\n }\n if (isset($data->planetary_body)) {\n $record->planetary_body = $data->planetary_body;\n }\n \n if (isset($data->latitude)) {\n $record->latitude = $data->latitude;\n }\n if (isset($data->longitude)) {\n $record->longitude = $data->longitude;\n }\n if (isset($data->zoom_level)) {\n $record->zoom_level = $data->zoom_level;\n }\n if (isset($data->map_type)) {\n $record->map_type = $data->map_type;\n } else {\n $record->map_type = '';\n }\n if (isset($data->address)) {\n $record->address = $data->address;\n } else {\n $record->address = '';\n }\n }", "public function jsonify()\n {\n $attributes = array();\n $attributes[\"name\"] = $this->name;\n $attributes[\"description\"] = $this->description;\n $attributes[\"brand\"] = $this->brand->name;\n $attributes[\"id\"] = $this->id;\n $attributes[\"barcode\"] = $this->barcode;\n\n return json_encode($attributes);\n }", "public function getRequestJson(){\n $requestArray = $this->prepareRequestContent($this->prepareRequestMeta());\n \n return json_encode($requestArray);\n }", "public function send(array $recordObject, string $module)\n {\n $requestBody = array();\n $recordArray = array();\n $curl_pointer = curl_init();\n $curl_options = array();\n $url = \"https://www.zohoapis.eu/crm/v2/\" . $module;\n\n $curl_options[CURLOPT_URL] = $url;\n $curl_options[CURLOPT_RETURNTRANSFER] = true;\n $curl_options[CURLOPT_HEADER] = 1;\n $curl_options[CURLOPT_CUSTOMREQUEST] = \"POST\";\n $recordArray[] = $recordObject;\n $requestBody[\"data\"] = $recordArray;\n $curl_options[CURLOPT_POSTFIELDS] = json_encode($requestBody);\n $headersArray = array();\n\n $headersArray[] = \"Authorization\" . \":\" . \"Zoho-oauthtoken \" . env('ZOHO_TOKEN');\n\n $curl_options[CURLOPT_HTTPHEADER] = $headersArray;\n\n curl_setopt_array($curl_pointer, $curl_options);\n\n $result = curl_exec($curl_pointer);\n $responseInfo = curl_getinfo($curl_pointer);\n curl_close($curl_pointer);\n list($headers, $content) = explode(\"\\r\\n\\r\\n\", $result, 2);\n if (strpos($headers, \" 100 Continue\") !== false) {\n list($headers, $content) = explode(\"\\r\\n\\r\\n\", $content, 2);\n }\n\n $headerArray = (explode(\"\\r\\n\", $headers, 50));\n $headerMap = array();\n foreach ($headerArray as $key) {\n if (strpos($key, \":\") != false) {\n $firstHalf = substr($key, 0, strpos($key, \":\"));\n $secondHalf = substr($key, strpos($key, \":\") + 1);\n $headerMap[$firstHalf] = trim($secondHalf);\n }\n }\n $jsonResponse = json_decode($content, true);\n\n return $jsonResponse;\n }", "public function json()\n {\n //\n return Laratables::recordsOf(Record::class, function ($query) {\n return $query->where('user_id', Auth::id());\n });\n }", "public function to_json()\n {\n }", "public function to_json()\n {\n }", "public function to_json()\n {\n }", "public function to_json()\n {\n }", "public function to_json()\n {\n }", "public function to_json()\n {\n }", "public function to_json()\n {\n }", "public function to_json()\n {\n }", "public function to_json()\n {\n }", "public function body($obj){\n $data = json_encode($obj);\n\n $errno = json_last_error();\n if($errno != JSON_ERROR_NONE){\n throw new Exception(\"Error encountered encoding JSON: \" . json_last_error_message());\n }\n\n curl_setopt($this->curl, CURLOPT_POSTFIELDS, $data);\n $this->headers[] = \"Content-Type: application/json\";\n return $this;\n }", "public function jsonSerialize() {\n\t\t$fields = get_object_vars($this);\n\n\t\t$fields[\"reportId\"] = $this->reportId;\n\t\t$fields[\"reportCategoryId\"] = $this->reportCategoryId;\n\t\t$fields[\"reportIpAddress\"] = inet_ntop($this->reportIpAddress);\n\n\t\t// format the date so that the front end can consume it\n\t\t$fields[\"reportDateTime\"] = round(floatval($this->reportDateTime->format(\"U.u\")) * 1000);\n\t\treturn ($fields);\n\t}", "public function json(){ return json_encode( $this->objectify() ); }", "protected function CreateJson() {\n\t\t$obj = new \\stdClass;\n\t\t$obj->recordsList = parent::CreateJson();\n\n\t\t// add links from server\n\t\t$obj->link = new \\stdClass;\n\t\t$obj->link->href = $this->link_href;\n\t\t$obj->link->rel = $this->link_rel;\n\t\treturn $obj;\n\t}", "private function _serializeEmployee($record)\n {\n $employee = new Employee();\n $employee->EmployeeID = $record['EmployeeID'];\n $employee->FirstName = $record['FirstName'];\n $employee->LastName = $record['LastName'];\n $employee->Title = $record['Title'];\n $employee->TitleOfCourtesy = $record['TitleOfCourtesy'];\n $employee->BirthDate = !is_null($record['BirthDate']) ? $record['BirthDate']->format('Y-m-d\\TH:i:s'): null;\n $employee->HireDate = !is_null($record['HireDate']) ? $record['HireDate']->format('Y-m-d\\TH:i:s'): null; \n $employee->Address = $record['Address'];\n $employee->City = $record['City'];\n $employee->Region = $record['Region'];\n $employee->PostalCode = $record['PostalCode'];\n $employee->Country = $record['Country'];\n $employee->HomePhone = $record['HomePhone'];\n $employee->Extension = $record['Extension'];\n $employee->Notes = $record['Notes'];\n $employee->ReportsTo = $record['ReportsTo'];\n //$employee->Photo = $record['Photo'];\n $employee->Emails = array ($employee->FirstName . '@hotmail.com', $employee->FirstName . '@live.com');\n return $employee;\n }", "protected function getJsonDecodedFromPost(){\n // $this->app->response()->header(\"Content-Type\", \"application/json\");\n // obtain the JSON of the body of the request\n $post = json_decode($this->app->request()->getBody(), true); // make it a PHP associative array\n return $post;\n }", "public function json()\n {\n $this->fetchFields();\n Log::json($this);\n }", "private function prepareRequestBody($data)\n {\n $body = new RequestBody();\n $body->write(json_encode($data));\n $body->rewind();\n\n return $body;\n }", "public static function getFormattedData($record)\n {\n /**\n * @var RecordEntity[] $other_records\n */\n $person = $record->getPerson();\n $other_records = self::getValidRecordsOfPerson($person->getId());\n\n $id_array = [];\n $name_array = [];\n foreach ($other_records as $other_record) {\n if ($other_record->getId() != intval($_GET['id'])) {\n $id_array[] = $other_record->getId();\n $name_array[] = $other_record->findVarchar(FIELD_RECORD_NAME);\n }\n }\n return [\n \"given_name\" => $person->getGivenName(),\n \"middle_name\" => $person->getMiddleName(),\n \"last_name\" => $person->getLastName(),\n \"email\" => $record->findVarchar(FIELD_EMAIL),\n \"address\" => $record->findMultiple(FIELD_ADDRESS),\n \"phone\" => $record->findVarchar(FIELD_PHONE),\n \"awards\" => $record->findMultiple(FIELD_AWARDS),\n \"publications\" => $record->findMultiple(FIELD_PUBLICATIONS),\n \"start_date\" => $record->findDateTime(FIELD_START_DATE)->format('Y-m-d H:i:s'),\n \"end_date\" => $record->findDateTime(FIELD_END_DATE)->format('Y-m-d H:i:s'),\n \"person_id\" => $person->getId(),\n \"record_id\" => $record->getId(),\n \"record_name\" => $record->findVarchar(FIELD_RECORD_NAME),\n \"record_ids\" => $id_array,\n \"record_names\" => $name_array,\n \"activities\" => Person::getFormattedActivitiesOfPerson($person)\n ];\n }", "public function toJson(): mixed\n {\n $this->buildResponse();\n\n return json_decode($this->response->getBody()->getContents());\n }", "public function toJson() {\n\t\t\treturn json_encode(array(\n\t\t\t\t'id' => $this->id,\n\t\t\t\t'model' => $this->model,\n\t\t\t\t'type' => json_decode($this->type->toJson()),\n\t\t\t\t'description' => $this->description,\n\t\t\t\t'area' => json_decode($this->area->toJson()),\n\t\t\t\t'status' => $this->status\n\t\t\t));\n\t\t}", "function writeRecord($record) { //{{{\n global $map;\n \n $arr = array();\n \n // loop over fields in record\n foreach (array_keys($map) as $tag) {\n $value = $record[$tag];\n \n // handle empty RIS values here\n if (2 == strlen($tag) && !$value) {\n $arr[$tag] = '';\n continue;\n }\n \n switch ($tag) {\n // semi colon delimit authors\n // and create primary author and presentation author fields\n case 'A1':\n $arr[$tag] = implode('; ', $value);\n $arr['primary_author'] = $value[0];\n $arr['presentation_authors'] = normaliseNames($value);\n $arr['author_count'] = count($value);\n break;\n \n // should only be 1 title/abstract\n case 'T1':\n case 'N2':\n case 'DO':\n $arr[$tag] = $value[0];\n break;\n \n // normalise capitalisation of journal names\n case 'JF':\n $arr[$tag] = normaliseJournal($value[0]);\n break;\n \n // year - want first 4 digits\n case 'Y1':\n $arr[$tag] = substr($value[0], 0, 4);\n break;\n \n // URL - leave as array\n case 'UR':\n foreach ($value as $i => $url) {\n $arr[sprintf('%s%d', $tag, $i)] = $url;\n }\n break;\n }\n }\n \n return $arr;\n}", "public function jsonSerialize()\n {\n $obj = (object) [\n 'fields' => (object) [\n 'file' => $this->file\n ],\n 'sys' => $this->sys\n ];\n\n if ($this->title !== null) {\n $obj->fields->title = $this->title;\n }\n\n if ($this->description !== null) {\n $obj->fields->description = $this->description;\n }\n\n return $obj;\n }", "public function fromJson() {\n return json_decode($this->getRequest()->getContent(),true);\n }", "public function record(): JsonResponse\n {\n $data = request()->input('data');\n $url = request()->input('url');\n $personId = request()->input('person_id');\n $errorType = request()->input('error_type');\n\n $record = [\n 'error_type' => $errorType,\n 'ip' => request_ip(),\n 'url' => $url,\n 'user_agent' => request()->userAgent(),\n 'data' => $data,\n ];\n\n if (is_numeric($personId)) {\n $record['person_id'] = $personId;\n }\n\n $log = new ErrorLog($record);\n $log->save();\n\n return $this->success();\n }", "public function transformRequest()\n {\n return $arrTransformReq = ['id' => 'CompanyId',\n 'type' => 'Type',\n 'name' => 'Name', 'doing_business_as' => 'DoingBusinessAs',\n 'tax_id' => 'TaxId',\n 'created_at' => 'CreatedAt', 'etag' => 'Etag',\n 'deleted_at' => 'DeletedAt'];\n }", "public function _jsonSerialize();", "public function index(Request $request)\n {\n $record = json_encode($request->all());\n return response()->json(DB::table('tx_record')->insert(['contents' => (string)$record]));\n }", "public function postAction()\n {\n $manager = new \\Art4\\JsonApiClient\\Utils\\Manager();\n $manager->setConfig('optional_item_id', true);\n // @todo handle validation errors\n $document = $manager->parse($this->request->getRawBody());\n $resource = $this->resource->getModel();\n\n // basic attributes\n foreach ($document->get('data')->get('attributes')->asArray(true) as $key => $value) {\n $resource->{$key} = $value;\n }\n\n // @todo handle saving errors\n $resource->save();\n\n return $this->renderSerialized($resource);\n }", "public function getRawBody();", "public function toJson() {\n\t\t$data = array();\n\t\tforeach ($this->fields as $name => $field) {\n\t\t\t$data += [$name => $field->toJson()];\n\t\t}\n\t\t$top = array(\"success\"=>$this->getSuccess(),\"data\"=>$data,\"text\"=>$this->text);\n\t\treturn $top;\n\t}", "protected function formatBatchJson(array $records)\n {\n return json_encode($records);\n }", "public function getRequestBody() {\n return json_encode($this->buildRequestArray());\n }", "public static function requestPayload() {\n return json_decode(file_get_contents('php://input'), true);\n }", "abstract public function getRequestBody();", "protected function normalizeRecord(LogRecord $record): array\n {\n $recordData = parent::normalizeRecord($record);\n\n $recordData[\"timestamp\"] = $record->datetime->format(\"Y-m-d\\TH:i:s.uO\");\n unset($recordData[\"datetime\"]);\n\n return $recordData;\n }", "function toJson($object);", "public function getJsonForm () {\n return json_decode($this->books);\n }", "private function json() {\n if( $this->format === 'application/hal+json' ) {\n header('Content-Type: application/hal+json; charset=utf-8', TRUE, $this->status);\n $hal_response = (new Resource())\n ->setURI(\"/{$this->resource}\". (isset($this->filters['id']) ? $this->filters['id'] : ''))\n ->setLink($this->resource, new Link(\"/{$this->resource}\"))\n ->setData($this->content);\n\n $writer = new Hal\\JsonWriter(true);\n return $writer->execute($hal_response);\n } else {\n header('Content-Type: application/json; charset=utf-8', TRUE, $this->status);\n return json_encode($this->content, JSON_NUMERIC_CHECK);\n }\n }", "protected function buildDomainObject($row)\n {\n $waveRequest = new WaveRequest();\n $waveRequest->setId($row['id']);\n $waveRequest->setRequest($row['request']);\n $waveRequest->setUserId($row['id_user']);\n\n return $waveRequest;\n }", "public function jsonSerialize();", "public function jsonSerialize();", "public function jsonSerialize();", "public function jsonSerialize();", "public function jsonSerialize();", "public function jsonSerialize();", "public function jsonSerialize();", "public function jsonSerialize();", "public function get_data_type() { return \"json\"; }", "public function toJson(): string;", "public function toJson(): string;", "public function jsonSerialize()\n {\n $json = array();\n $json['list_id'] = $this->listId;\n $json['sender'] = $this->sender;\n $json['subject'] = $this->subject;\n $json['body'] = $this->body;\n $json['resource_urls'] = $this->resourceUrls;\n $json['send_date'] = $this->sendDate;\n\n return $json;\n }", "private function encodeRequest()\n {\n $request = array('receipt-data' => $this->getReceiptData());\n\n if (!is_null($this->_sharedSecret)) {\n\n $request['password'] = $this->_sharedSecret;\n }\n\n return json_encode($request);\n }", "public function jsonSerialize()\n {\n $json = array();\n $json['id'] = $this->id;\n $json['store_id'] = $this->storeId;\n $json['store_name'] = $this->storeName;\n $json['total'] = $this->total;\n $json['total_without_tax'] = $this->totalWithoutTax;\n $json['tax'] = $this->tax;\n $json['purchase_date'] = $this->purchaseDate;\n $json['recorded_at'] = $this->recordedAt;\n $json['order_number'] = $this->orderNumber;\n $json['receipt_id'] = $this->receiptId;\n $json['receipt_image_url'] = $this->receiptImageUrl;\n $json['receipt_image_urls'] = $this->receiptImageUrls;\n\n return $json;\n }", "public function jsonSerialize()\n {\n $json = array();\n $json['id'] = $this->id;\n $json['consumerId'] = $this->consumerId;\n $json['consumerSsn'] = $this->consumerSsn;\n $json['requesterName'] = $this->requesterName;\n $json['requestId'] = $this->requestId;\n $json['constraints'] = $this->constraints;\n $json['type'] = $this->type;\n $json['status'] = $this->status;\n $json['createdDate'] = $this->createdDate;\n\n return array_merge($json, $this->additionalProperties);\n }", "protected function _multipleRecordsToJson(RecordSet $_records, $_filter = NULL, $_pagination = NULL)\n {\n $result = array();\n\n if ($_records->getFirstRecord()) {\n $converter = ConvertFactory::factory($_records->getFirstRecord());\n $result = $converter->fromTine20RecordSet($_records, $_filter, $_pagination);\n }\n\n return $result;\n }", "public function update(Request $request, Record $record)\n {\n $request->data && $request->merge([\n 'data' => Crypt::encrypt(json_encode($request->data)),\n ]);\n\n $record->update([\n 'name' => $request->name ?? $record->name,\n 'data' => $request->data ?? $record->data,\n ]);\n\n return new Resource($record);\n }", "public function convertDocumentToJson($document) {\n $result = array();\n\n $fieldNames = $document->describe();\n\n foreach ($fieldNames as $fieldname) {\n $field = $document->getField($fieldname);\n $fieldvalue = $field->getValue();\n\n if (!$field->hasMultipleValues()) {\n $fieldvalue = array($fieldvalue);\n }\n\n $fieldvalues = array();\n foreach ($fieldvalue as $value) {\n if ($value instanceof Opus_Date) {\n $fieldvalues[] = $value->getZendDate()->get('yyyy/MM/dd');\n }\n else if ($value instanceof Opus_Model_Abstract) {\n $fieldvalues[] = $value->toArray();\n }\n else if ($value instanceOf Zend_Date) {\n $fieldvalues[] = $value->toArray();\n }\n else {\n $fieldvalues[] = $value;\n }\n }\n\n if (!$field->hasMultipleValues()) {\n $fieldvalues = $fieldvalues[0];\n }\n\n $result[$fieldname] = $fieldvalues;\n }\n return json_encode($result);\n }" ]
[ "0.6134897", "0.55030245", "0.5382027", "0.523877", "0.51920366", "0.5185566", "0.51143456", "0.5040793", "0.5040793", "0.5040793", "0.49755058", "0.4959523", "0.49371713", "0.49339497", "0.49280772", "0.49081087", "0.4906283", "0.48985237", "0.48985237", "0.48630413", "0.4852546", "0.4843197", "0.4830896", "0.48260432", "0.48255017", "0.476117", "0.47603494", "0.47580835", "0.4746021", "0.47364295", "0.4731086", "0.47304636", "0.4726101", "0.47236922", "0.47181705", "0.47162172", "0.46917683", "0.4688121", "0.46862793", "0.46861583", "0.4670642", "0.46694338", "0.46645546", "0.4660427", "0.4660427", "0.4660427", "0.4660427", "0.4660427", "0.4660427", "0.4660427", "0.4660427", "0.4660427", "0.4656469", "0.46370482", "0.46361965", "0.46332863", "0.46194717", "0.459817", "0.4596463", "0.4594435", "0.4594378", "0.457318", "0.4570534", "0.45700216", "0.45678574", "0.45666695", "0.45664883", "0.45664766", "0.45578676", "0.45545313", "0.4549988", "0.45368543", "0.45353708", "0.4531252", "0.45303234", "0.4522995", "0.45223612", "0.45167693", "0.4516313", "0.44955534", "0.4494083", "0.44726804", "0.4468647", "0.4468647", "0.4468647", "0.4468647", "0.4468647", "0.4468647", "0.4468647", "0.4468647", "0.4461404", "0.44600302", "0.44600302", "0.44574988", "0.44562244", "0.44518065", "0.44517198", "0.44447353", "0.4444048", "0.44413254" ]
0.7372453
0
Prepare and throw exception.
public function errorMessage($requestType, $message){ throw new Zend_Service_Exception('An error occurred making '. $requestType .' request. Message: ' . $message); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function prepare()\n {\n if (!isset($this->preparer)) {\n throw new Exception('Preparer not set');\n }\n\n $this->preparer->preparePacket($this);\n }", "private function throwException()\n {\n throw new CacheException(\\odbc_errormsg(), (int) \\odbc_error());\n }", "abstract protected function _prepare();", "protected function prepareInsertData(){\n\t\tthrow new Exception('Unknown Error!', REST_ER_PAGE_NOTFOUND);\n\t}", "function _prepare() {}", "protected function prepare()\n\t{\n\t}", "public function prepare() {}", "public function prepare() {}", "private function ensureInitials()\n\t{\n\t\t$errors = $this->getInitialErrors();\n\n\t\tif($errors)\n\t\t{\n\t\t\tthrow new \\Exception(implode('<br>', $errors), 1);\n\t\t}\n\t}", "public function prepare()\n\t{\n\t\tif ($this->pdoStatement == null) {\n\t\t\t$sql = $this->getSql();\n\t\t\ttry {\n\t\t\t\t$this->pdoStatement = $this->connection->pdo->prepare($sql);\n\t\t\t\t$this->_paramLog = array();\n\t\t\t}\n\t\t\tcatch(\\Exception $e) {\n\t\t\t\t\\Yii::error(\"Failed to prepare SQL ($sql): \" . $e->getMessage(), __CLASS__);\n $errorInfo = $e instanceof \\PDOException ? $e->errorInfo : null;\n\t\t\t\t$message = YII_DEBUG ? 'Failed to prepare SQL: ' . $e->getMessage() : 'Failed to prepare SQL.';\n\t\t\t\tthrow new Exception($message, (int)$e->getCode(), $errorInfo);\n\t\t\t}\n\t\t}\n\t}", "protected function prepareEntityManager(): void\n\t{\n\t\ttry {\n\t\t\t$this->assertEntityManagerOpen();\n\t\t\t$this->assertEntityManagerClear();\n\t\t\t$this->assertGoodDatabaseConnection();\n\t\t} catch (EntityManagerClosedException $e) {\n\t\t\tthrow $e;\n\t\t} catch (Throwable $e) {\n\t\t\tthrow new QueueSetupException('Error in queue setup while running a job', 0, $e);\n\t\t}\n\t}", "abstract public function prepare(): self;", "public function prepare()\n {\n }", "protected function prepareUpdateData(){\n\t\tthrow new Exception('Unknown Error!', REST_ER_PAGE_NOTFOUND);\n\t}", "public function makeException()\n {\n $this->thrownException = ResponseException::create($this);\n }", "public function handlePrepareException(\\Throwable $throwable): Response\n {\n return $this->handleException($throwable);\n }", "protected function prepareException(Exception $e)\n {\n if ($e instanceof AuthorizationException) {\n $e = new HttpException(403, $e->getMessage());\n }\n\n return $e;\n }", "public function testPrepareThrowsRuntimeExceptionOnInvalidSqlWithErrorReportingDisabled()\n {\n error_reporting(0);\n $sql = \"INVALID SQL\";\n $this->statement->setSql($sql);\n\n $this->expectException(\n RuntimeException::class,\n 'Error message'\n );\n $this->statement->prepare();\n }", "public function prepareToDryRun()\n {\n if ($this->fileDriver->isExists($this->getLoggerFile())) {\n if (!$this->fileDriver->isWritable($this->getLoggerFile())) {\n throw new \\Exception(sprintf('Dry run logger file is not writable'));\n }\n\n $this->fileDriver->deleteFile($this->getLoggerFile());\n $this->fileDriver->touch($this->getLoggerFile());\n }\n }", "public function __construct()\n {\n throw new Exception('This class is not intended to be instantiated.');\n }", "public function prepare();", "public function prepare();", "public function init()\n {\n parent::init();\n if (empty($this->basePath) || empty($this->targetPath)) {\n throw new Exception('basePath and targetPath are required.');\n }\n }", "function ensure($condition, $error_message) {\n if (!$condition) {\n $e = new Exception($error_message);\n throw $e;\n }\n}", "final public function __construct()\n {\n throw new \\LogicException();\n }", "protected function throwInaccessibleException() {}", "protected function throwUnableToCreate()\n {\n throw new FilesystemException(\"Unable to create the file '{$this->path}'. A directory with the same path already exists.\");\n }", "protected function tossIfException()\n\t{\n\t\tif ($this->exception) {\n\t\t\tthrow $this->exception;\n\t\t}\n\t}", "private function prepareAPIRequest()\n {\n $api_key = $this->getAPIKey();\n\n $api_key_parts = \"\";\n if (count($api_key_parts = explode(\"-\", $api_key)) != 2) {\n throw new Exception(\"Invalid API Key\");\n }\n\n $this->setAPIEndpoint(\"https://$api_key_parts[1].api.mailchimp.com/\" . $this->api_version);\n }", "protected function validateOrThrow() {}", "public function testThrowException()\n {\n throw new ImageNotReadableException();\n }", "private function validate() {\n\t\tif( empty($this->header) )\n\t\t\tthrow new Exception('ACH file header record is required.');\n\n\t\tif( empty($this->batches) )\n\t\t\tthrow new Exception('ACH file requires at least 1 batch record.');\n\n\t\tif( empty($this->control))\n\t\t\tthrow new Exception('ACH file control record is required.');\t\t\t\n\t}", "public function setupPath()\n {\n // if directory doesn't exist, create it\n if (!is_dir($this->path->getPath())) {\n $reporting = error_reporting();\n error_reporting(0);\n $created = mkdir($this->path->getPath(), 0755, true);\n error_reporting($reporting);\n if (!$created) {\n throw new Exception(sprintf('cant\\'t create directory: %s', $this->path->getPath()));\n }\n }\n if (!is_writable($this->path->getPath())) {\n throw new Exception(sprintf('no write permission for directory: %s', $this->path->getPath()));\n }\n }", "public function prepare()\r\n\t{\r\n\t\treturn null; // nothing\r\n\t}", "public function __construct () {\n\t\tthrow Exception::thrown(\"Not implemented for this platform\");\n\t}", "function module_builder_handle_sanity_exception($e) {\n $failed_sanity_level = $e->getFailedSanityLevel();\n switch ($failed_sanity_level) {\n case 'data_directory_exists':\n $message = \"The component data directory could not be created or is not writable.\";\n break;\n case 'component_data_processed':\n $message = \"No component data was found. Run 'drush mb-download' to process component data from documentation files.\";\n break;\n }\n drush_set_error(DRUSH_APPLICATION_ERROR, $message);\n}", "protected function prepare()\n {\n parent::prepare();\n\n // parent must be a test_entry_transcribe widget\n if( is_null( $this->parent ) )\n throw lib::create( 'exception\\runtime', 'This class must have a parent', __METHOD__ );\n \n $db_test_entry = $this->parent->get_record();\n\n $db_test = $db_test_entry->get_test();\n $heading = $db_test->name . ' test entry form';\n\n //TODO put this somewhere else\n if( $db_test_entry->deferred )\n $heading = $heading . ' NOTE: this test is currently deferred';\n\n $this->set_heading( $heading );\n }", "public function create()\n {\n throw new Exception('Not yet implemented');\n }", "protected function throwRedirectException() {}", "public function prepare() {\n\t\tif ($this->_statement == null) \n\t\t{\n\t\t\ttry {\n\t\t\t\t$this->_statement = $this->_connection->getPdoInstance()->prepare($this->getText());\n\t\t\t\t$this->_paramLog = array();\n\t\t\t} catch (\\Exception $e) {\n\t\t\t\t$errorInfo = $e instanceof PDOException ? $e->errorInfo : null;\n\t\t\t\tthrow new \\GO\\Base\\Exception\\Database('DbCommand failed to prepare the SQL statement: '. $e->getMessage(), $e->getCode(), $errorInfo);\n\t\t\t}\n\t\t}\n\t}", "public function testConstructorException(): void\n {\n $arg = ['login' => 'Bear'];\n try {\n $this->getMockForAbstractClass(Driver::class, [$arg]);\n } catch (Exception $e) {\n $this->assertStringContainsString(\n 'Please pass \"username\" instead of \"login\" for connecting to the database',\n $e->getMessage()\n );\n }\n }", "private function __construct()\n {\n throw new RuntimeException(\"Can't get there from here\");\n }", "protected function init()\n {\n if ($this->file->hasError) {\n throw new CException(sprintf(\n 'File could not be uploaded: %s',\n $this->getUploadError($this->file->getError())\n ));\n }\n }", "public function __construct()\n {\n $databaseHost = $_ENV['DATABASE_HOST'];\n $databaseName = $_ENV['DATABASE_NAME'];\n $databaseUser = $_ENV['DATABASE_USER'];\n $databasePass = $_ENV['DATABASE_PASS'];\n\n try {\n $this->connection = new PDO(\"mysql:host={$databaseHost};dbname={$databaseName};\", $databaseUser, $databasePass);\n $this->connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n $this->connection->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);\n\n } catch (Exception $e) {\n throw new Exception($e->getMessage());\n }\n\n }", "protected function setUp() {\n $this->object = new BadFunctionCallException;\n $this->setCommonInterface(ExceptionInterface::class)->setParentClass(PlatformBadFunctionCallException::class);\n }", "protected static function throwHardCheckError()\n {\n throw new \\InvalidArgumentException('Value has wrong type');\n }", "function do_exception($line, $code = -1) {\n\tthrow new Exception(\"Error at line: {$line}\", $code);\n}", "public function prepare(): void\n {\n $this->processRunner->runAndReport(\n sprintf(\n 'git clone %s --depth 1 --single-branch --branch %s project/sylius',\n $this->getGitRepository(),\n $this->getVersion()\n )\n );\n $this->processRunner->runAndReport('composer install --working-dir project/sylius --no-dev --no-interaction');\n }", "protected function validateParameters()\n {\n if (empty($this->save_path)) {\n throw new \\Exception(\"The 'save_path' is not specified!\");\n }\n }", "function prepare()\n\t{\n\t\treturn null;\n\t}", "function prepare()\n\t{\n\t\treturn null;\n\t}", "protected function throwErrorWhileSavingResponseException()\n {\n throw new InvalidScreenForNewSessionException('An error occured while saving data.');\n }", "public function __construct()\n {\n $classname = $this->getBankName();\n\n $info = ExchangeRateGrabberInfo::find()->where(['name' => $classname])->one();\n\n if (empty($info)) {\n throw new \\Exception(\"broken class: metadata for $classname not found\");\n }\n\n $this->info = $info->attributes;\n }", "abstract public function prepare( $args );", "protected function _prepare()\n\t{\n\t\tFactory::getLog()->debug(__CLASS__ . \" :: Processing parameters\");\n\n\t\t$options = null;\n\n\t\t// Get the DB connection parameters\n\t\tif (is_array($this->_parametersArray))\n\t\t{\n\t\t\t$driver = array_key_exists('driver', $this->_parametersArray) ? $this->_parametersArray['driver'] : 'mysql';\n\t\t\t$host = array_key_exists('host', $this->_parametersArray) ? $this->_parametersArray['host'] : '';\n\t\t\t$port = array_key_exists('port', $this->_parametersArray) ? $this->_parametersArray['port'] : '';\n\t\t\t$username = array_key_exists('username', $this->_parametersArray) ? $this->_parametersArray['username'] : '';\n\t\t\t$username = array_key_exists('user', $this->_parametersArray) ? $this->_parametersArray['user'] : $username;\n\t\t\t$password = array_key_exists('password', $this->_parametersArray) ? $this->_parametersArray['password'] : '';\n\t\t\t$database = array_key_exists('database', $this->_parametersArray) ? $this->_parametersArray['database'] : '';\n\t\t\t$prefix = array_key_exists('prefix', $this->_parametersArray) ? $this->_parametersArray['prefix'] : '';\n\n\t\t\tif (($driver == 'mysql') && !function_exists('mysql_connect'))\n\t\t\t{\n\t\t\t\t$driver = 'mysqli';\n\t\t\t}\n\n\t\t\t$options = [\n\t\t\t\t'driver' => $driver,\n\t\t\t\t'host' => $host . ($port != '' ? ':' . $port : ''),\n\t\t\t\t'user' => $username,\n\t\t\t\t'password' => $password,\n\t\t\t\t'database' => $database,\n\t\t\t\t'prefix' => is_null($prefix) ? '' : $prefix,\n\t\t\t];\n\t\t}\n\n\t\t$db = Factory::getDatabase($options);\n\n\t\tif ($db->getErrorNum() > 0)\n\t\t{\n\t\t\t$error = $db->getErrorMsg();\n\n\t\t\tthrow new RuntimeException(__CLASS__ . ' :: Database Error: ' . $error);\n\t\t}\n\n\t\t$driverType = $db->getDriverType();\n\t\t$className = '\\\\Akeeba\\\\Engine\\\\Dump\\\\Native\\\\' . ucfirst($driverType);\n\n\t\t// Check if we have a native dump driver\n\t\tif (!class_exists($className, true))\n\t\t{\n\t\t\t$this->setState(self::STATE_ERROR);\n\n\t\t\tthrow new ErrorException('Akeeba Engine does not have a native dump engine for ' . $driverType . ' databases');\n\t\t}\n\n\t\tFactory::getLog()->debug(__CLASS__ . \" :: Instanciating new native database dump engine $className\");\n\n\t\t$this->_engine = new $className;\n\n\t\t$this->_engine->setup($this->_parametersArray);\n\n\t\t$this->_engine->callStage('_prepare');\n\t\t$this->setState($this->_engine->getState());\n\t}", "protected function prepare()\n {\n if ($this->stream !== null) {\n return;\n }\n if (isset($this->formatters[$this->format])) {\n $formatter = $this->formatters[$this->format];\n if (!is_object($formatter)) {\n $this->formatters[$this->format] = $formatter = \\Yii::createObject($formatter);\n }\n if ($formatter instanceof ResponseFormatterInterface) {\n $formatter->format($this);\n } else {\n throw new InvalidConfigException(\"The '{$this->format}' response formatter is invalid. It must implement the ResponseFormatterInterface.\");\n }\n } elseif ($this->format === self::FORMAT_RAW) {\n if ($this->data !== null) {\n $this->content = $this->data;\n }\n } else {\n throw new InvalidConfigException(\"Unsupported response format: {$this->format}\");\n }\n\n if (is_array($this->content)) {\n\n throw new InvalidParamException(\"Response content must not be an array.\");\n } elseif (is_object($this->content)) {\n if (method_exists($this->content, '__toString')) {\n $this->content = $this->content->__toString();\n } else {\n throw new InvalidParamException(\"Response content must be a string or an object implementing __toString().\");\n }\n }\n }", "public function setException(){\n $this->dbConnection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n }", "public function testExceptionSanity() {\r\n $e = new StorageException();\r\n $this->assertTrue($e instanceof \\Exception);\r\n }", "private function spawnInitError(WrappedException $we)\n {\n Utils_Request::sendHttpStatusCode(Utils_Request::SERVER_INTERNAL_SERVER_ERROR);\n die(sprintf('Init error! : %s (reason : %s)', $we->getMessage(),\n $we->getException()->getMessage()));\n }", "public function prepare()\n {\n $this->getInstruction()->execute();\n }", "public function testException()\n {\n throw new ThumbNotFoundException;\n }", "function __construct($exception) {\n $this->exception = $exception;\n }", "public function grab(): void\n {\n if ($this->isPrepared() !== true) {\n throw new Exception('Instance is already taken');\n }\n\n // grab the instance in the database\n $this->instances->update($this->id, [\n 'created' => $this->created = time(),\n 'ipHash' => $this->ipHash = Instances::ipHash()\n ]);\n }", "public function catchException()\n {\n // get the current exception\n $e = $this->getException();\n\n // throw a copy, with the original as the previous exception so that\n // we can see a full trace.\n $class = get_class($e);\n throw new $class($e->getMessage(), $e->getCode(), $e);\n }", "public function prepareFile() {\n\t\t// Check if the file do exists\n\t\tif (!is_dir($this->filedir)) {\n\t\t\t// Create empty directory for the userexport\n\t\t\tif (!mkdir($this->filedir, 0755)) {\n\t\t\t\t// Creating the directory failed\n\t\t\t\tthrow new Exception(elgg_echo('userexport:error:nofiledir'));\n\t\t\t}\n\t\t}\n\n\t\t// Delete any existing file\n\t\tunlink($this->filename);\n\t}", "public function prepareFile()\n {\n // TODO: Implement prepareFile() method.\n }", "protected function setUp() {\n $this->object = new Qwin_Exception;\n }", "protected function abortIfSetupIncorrectly()\n {\n if(! $this->username OR ! $this->password OR ! $this->clientCode OR ! $this->url) throw new ErplySyncException('Missing parameters', self::MISSING_PARAMETERS);\n }", "function act() {\n throw $this->exception;\n }", "public function testException() {\n\t\ttry {\n\t\t\t$array = array( 'ABC' );\n\t\t\t$percentages = new Percentages( $array );\n\t\t} catch ( \\RuntimeException $expected ) {\n\t\t\treturn;\n\t\t}\n\t\t$this->fail( 'An expected exception has not been raised.' );\n\t}", "public function testGetUserWhenPDOThrowsException()\n {\n $this->db->expects($this->once())\n ->method('prepare')\n ->will($this->throwException(new \\PDOException));\n $id = 'bbccdd1134';\n $userService = new UserService($this->db);\n $retrievedUser = $userService->retrieve($id);\n $this->assertNull($retrievedUser); \n }", "public function createData() {\n\t\t\tthrow new \\Exception('Not supported yet.'); \n\t\t}", "private function createNotReadableException()\n {\n throw new RuntimeException(sprintf(\n 'It is not possible to read entities of type \"%s\" from its repository.',\n $this->getEntityServiceName()\n ));\n }", "public function testMigrateExceptionPathMissing() {\n $this->expectException(\\InvalidArgumentException::class);\n $this->expectExceptionMessage('You must declare the \"path\" to the source CSV file in your source settings.');\n new CSV([], $this->pluginId, $this->pluginDefinition, $this->migration);\n }", "public function testCreatedException()\n {\n $this->expectException(DomainException::class);\n County::create('County One',0, 200);\n }", "private function __clone() {\n throw new Exception('No se puede clonar');\n }", "protected static function exception()\n {\n foreach (self::fetch('exceptions') as $file) {\n Bus::need($file);\n }\n }", "public function prepare()\n {\n return null;\n }", "protected function check_errors()\n {\n if (true === $this->error_flag) {\n throw new \\Exception($this->get_error( true ));\n }\n }", "public function testSendRequestException()\n {\n $accId = '';\n\n $this->zendClientFactoryMock->expects($this->once())\n ->method('create')\n ->willReturn($this->zendClientMock);\n $this->configMock->expects($this->once())\n ->method('getNewRelicAccountId')\n ->willReturn($accId);\n\n $this->expectException(\\Magento\\Framework\\Exception\\LocalizedException::class);\n\n $this->model->sendRequest();\n }", "protected function checkParams()\n {\n if ((null === $this->jar) or !file_exists($this->jar)) {\n throw new BuildException(\n sprintf(\n 'Specify the name of the LiquiBase.jar. \"%s\" does not exist!',\n $this->jar\n )\n );\n }\n\n $this->checkChangeLogFile();\n\n if (null === $this->classpathref) {\n throw new BuildException('Please provide a classpath!');\n }\n\n if (null === $this->username) {\n throw new BuildException('Please provide a username for database acccess!');\n }\n\n if (null === $this->password) {\n throw new BuildException('Please provide a password for database acccess!');\n }\n\n if (null === $this->url) {\n throw new BuildException('Please provide a url for database acccess!');\n }\n }", "public function prepareTemplate() {\n\n $templateClass = $this->config->get('template_class');\n\n if (class_exists($templateClass))\n $this->template = new $templateClass();\n else\n throw new \\Exception('template class ' . $templateClass . ' not exists');\n\n if (!$this->template instanceof ScaffoldingTemplate)\n throw new \\Exception('template class ' . $templateClass . ' must be instanceof ScaffoldingTemplate');\n\n return $this->template;\n }", "public function testInsertFixturesException(): void\n {\n $fixture = $this->getMockBuilder(TestFixture::class)->getMock();\n $fixture->expects($this->once())\n ->method('connection')\n ->willReturn('test');\n $fixture->expects($this->once())\n ->method('insert')\n ->will($this->throwException(new PDOException('Missing key')));\n\n $helper = $this->getMockBuilder(FixtureHelper::class)\n ->onlyMethods(['sortByConstraint'])\n ->getMock();\n $helper->expects($this->any())\n ->method('sortByConstraint')\n ->willReturn([$fixture]);\n\n $this->expectException(CakeException::class);\n $this->expectExceptionMessage('Unable to insert rows for table ``');\n $helper->insert([$fixture]);\n }", "public function prepare()\n\t{\n\t\tcreateToken('admin-ssc');\n\t\t$this->adapter->prepare();\n\t}", "public function prepare() {\n if (!isset($this->Created))\n $this->Created = date('YmdHis', time());\n\n if (isset($this->ConfirmPassword))\n unset($this->ConfirmPassword);\n\n $this->Password = Auth::getHash($this->Password);\n// $this->ProfileImage = $this->_processProfileImage();\n }", "function prepare($argarray)\n {\n parent::prepare($argarray);\n if ($this->boolean('ajax')) {\n MicroService::setApi(true);\n }\n\n $this->user = common_current_user();\n\n if (empty($this->user)) {\n throw new ClientException(\n // TRANS: Client exception thrown trying to answer a question while not logged in.\n _m(\"You must be logged in to answer to a question.\"),\n 403\n );\n }\n\n $id = substr($this->trimmed('id'), 7);\n\n $this->answer = QnA_Answer::staticGet('id', $id);\n $this->question = $this->answer->getQuestion();\n\n if (empty($this->answer) || empty($this->question)) {\n throw new ClientException(\n // TRANS: Client exception thrown trying to respond to a non-existing question.\n _m('Invalid or missing answer.'),\n 404\n );\n }\n\n $this->answerText = $this->trimmed('answer');\n\n return true;\n }", "abstract public function prepareToStore();", "public function getException();", "public function create(Request $request)\n {\n throw new Exception(\"Error Processing Request\", 1);\n \n }", "public function prepare()\n {\n return null;\n }", "public function test_it_should_throw_an_exception_on_invalid_url()\n {\n SourceFactory::create('unknown');\n }", "function texc($x)\r\n{\r\n\tthrow new \\Exception('Debug: ' . $x);\r\n}", "public function testCreateExceptionWithoutAnyArguments()\n {\n new ConfigurationException();\n }", "public function testExceptionConfiFileNotFound() {\r\n $this->model->create($this->post());\r\n }", "public function prepareImport();", "function errortoexception($errno, $errstr, $errfile, $errline , $errcontext){\r\n\tswitch ($errno){\r\n \tcase E_USER_WARNING:\r\n\t\tcase E_USER_NOTICE:\r\n\t\tcase E_WARNING:\r\n\t\tcase E_NOTICE:\r\n\t\tcase E_CORE_WARNING:\r\n\t\tcase E_COMPILE_WARNING:\r\n\t\t\tbreak;\r\n\t\tcase E_USER_ERROR:\r\n\t\tcase E_ERROR:\r\n\t\tcase E_PARSE:\r\n\t\tcase E_CORE_ERROR:\r\n\t\tcase E_COMPILE_ERROR:\r\n\t\t\t$exception = new errortoException($errstr , $errno);\r\n\t\t\t$exception->setFile($errfile);\r\n\t\t\t$exception->setLine($errline);\r\n\r\n\t\t\tthrow $exception;\r\n \t}\r\n}", "public function testCreatingNewAssettoCorsaReaderWithInvalidData()\n {\n $this->expectException(\\Simresults\\Exception\\CannotReadData::class);\n $reader = new Data_Reader_AssettoCorsa('Unknown data for reader');\n }", "public function testBuildException()\n {\n $this->ccDataBuilder->build([]);\n }", "protected function check() {\n if (empty($this->method_map)\n || empty($this->param)\n || empty($this->service_url)\n ) {\n throw new Exception('Param or method map is empty');\n }\n }", "abstract protected function prepareContext(): void;", "public function raise() {\n throw $this;\n }" ]
[ "0.66242373", "0.65529275", "0.628025", "0.6266669", "0.613802", "0.60393536", "0.5992953", "0.5992709", "0.5980474", "0.5968981", "0.5922459", "0.58788157", "0.5859211", "0.5698325", "0.569423", "0.56579393", "0.55794185", "0.5553979", "0.5549189", "0.55057025", "0.55044156", "0.55044156", "0.54683095", "0.54484266", "0.5402404", "0.5401016", "0.5388453", "0.53866524", "0.5352306", "0.5346991", "0.5329971", "0.53190506", "0.5308567", "0.52941227", "0.5254646", "0.52465534", "0.5243413", "0.52246976", "0.522355", "0.5217088", "0.5214236", "0.5212384", "0.52111626", "0.51927865", "0.5179125", "0.51685447", "0.51671904", "0.5154132", "0.51515865", "0.51475304", "0.51475304", "0.5145737", "0.51283294", "0.5123163", "0.511916", "0.51139164", "0.51116794", "0.5111673", "0.5108583", "0.51071924", "0.51013654", "0.5094409", "0.50913864", "0.5082235", "0.50794065", "0.5077777", "0.5077152", "0.5071814", "0.5068446", "0.5064941", "0.5045853", "0.50418633", "0.5041086", "0.5037509", "0.5036049", "0.50149953", "0.5009516", "0.5006844", "0.49997544", "0.49996594", "0.4998663", "0.4998506", "0.49954072", "0.49947816", "0.49864137", "0.49860653", "0.49852163", "0.4982732", "0.4976921", "0.497269", "0.49724516", "0.49704462", "0.49551782", "0.49507353", "0.49456134", "0.49383694", "0.49360242", "0.4932804", "0.4932242", "0.49228436", "0.49205387" ]
0.0
-1
/ | Main Methods | Map the routes.
public function map(): void { $this->adminGroup(function () { $this->prefix('permissions')->name('permissions.')->group(function () { // admin::auth.permissions.index $this->get('/', [PermissionsController::class, 'index']) ->name('index'); $this->mapDataTableRoutes(); $this->prefix('{'.self::PERMISSION_WILDCARD.'}')->group(function () { // admin::auth.permissions.show $this->get('/', [PermissionsController::class, 'show']) ->name('show'); $this->namespace('Permissions')->group(function () { static::mapRouteClasses([ Permissions\RolesRoutes::class, ]); }); }); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n $this->mapACLRoutes(); \n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n $this->mapWebRoutes();\n $this->mapAdminRoutes();\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n $this->mapFrontWebRoutes();\n $this->mapBackWebRoutes();\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "public function map()\n {\n //panel\n $this->mapPanelRoutes();\n //auth\n $this->mapAuthRoutes();\n //almacen\n $this->mapInventoryRoutes();\n //contabilidad\n $this->mapAccountingRoutes();\n //Recursos Humanos\n $this->mapHumanResourceRoutes();\n //ventas\n $this->mapSaleRoutes();\n\n $this->mapApiRoutes();\n\n //\n }", "public function map()\n {\n $this->mapWebRoutes();\n\n $this->mapApiRoutes();\n\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n $this->mapArticleRoutes();\n $this->mapVideoRoutes();\n $this->mapProductRoutes();\n $this->mapHarvestRoutes();\n $this->mapUserRoutes();\n $this->mapCategoryRoutes();\n $this->mapRegionRoutes();\n $this->mapUnitRoutes();\n $this->mapOrderRoutes();\n $this->mapLandRoutes();\n $this->mapBannerRoutes();\n $this->mapAdminRoutes();\n\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n $this->mapMobileRoutes();\n }", "public function map()\n {\n $this->mapRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "public static function routes(): void\n {\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n $this->mapWebRoutes();\n }", "public function map()\n {\n $this->mapApiRoutes();\n $this->mapWebRoutes();\n }", "public function map()\n {\n $this->mapProcessEngineRoutes();\n $this->mapApiRoutes();\n $this->mapWebRoutes();\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n }", "public function mapRoutes()\n {\n Router::loadRouteFiles(\"web.php\");\n Router::loadRouteFiles('patients.php');\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n $this->mapCustomerRoutes();\n\n $this->mapInternalRoutes();\n\n $this->mapVendorRoutes();\n\n $this->mapWhiteGloveRoutes();\n\n $this->mapLocalRoutes();\n }", "public function map()\n {\n //wap端路由为了防止和web端路由冲突一定要放到前面\n $this->mapWapRoutes();\n //web端路由\n $this->mapWebRoutes();\n //api路由\n $this->mapApiRoutes();\n //Backend路由\n $this->mapBackendRoutes();\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n $this->mapUserRoutes();\n $this->mapTrainingRoutes();\n $this->mapTrainingModeRoutes();\n $this->mapTrainingSystemRoutes();\n $this->mapTrainingBrandRoutes();\n $this->mapTrainingTypeRoutes();\n $this->mapTrainingAudienceRoutes();\n $this->mapTrainingTargetRoutes();\n $this->mapTrainingUserRoutes();\n $this->mapTrainingHistoryRoutes();\n $this->mapReportsRoutes();\n $this->mapTopPerformanceRoutes();\n }", "public function map()\n {\n $this->mapWebRoutes();\n }", "public function map()\n {\n $this->mapV1Routes();\n }", "protected function mapRoutes()\n {\n $this->loadRoutesFrom(__DIR__.'/../../routes/api/base.php');\n $this->loadRoutesFrom(__DIR__.'/../../routes/api/admin.php');\n // $this->loadRoutesFrom(__DIR__.'/../../routes/web.php');\n $this->loadRoutesFrom(__DIR__.'/../../routes/auth.php');\n }", "public function map() {\n\t\tRoute::middleware( 'web' )->group( mantle_base_path( 'routes/web.php' ) );\n\t\tRoute::middleware( 'rest-api' )->group( mantle_base_path( 'routes/rest-api.php' ) );\n\t}", "public static function route();", "public function map()\n {\n //默认web模块路由\n Route::namespace('App\\Http\\Controllers')->group(base_path('routes/web.php'));\n\n //main模块的路由\n Route::prefix('main')->namespace('App\\Http\\Controllers\\Main')->group(base_path('routes/main.php'));\n\n //builder模块的路由\n if(app()->environment() == 'local'){\n Route::prefix('builder')->namespace('Tools\\Builder') ->group(base_path('tools/Builder/router.php'));\n }\n }", "function defineRoutes() {\n Router::map('homepage', '', array('controller' => DEFAULT_CONTROLLER, 'action' => DEFAULT_ACTION, 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('admin', 'admin', array('controller' => 'admin', 'action' => 'index', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('public', 'public', array('controller' => 'public', 'action' => 'index', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n Router::map('wireframe_updates', 'wireframe-updates', array('controller' => 'backend', 'action' => 'wireframe_updates', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n Router::map('menu_refresh_url', 'refresh-menu', array('controller' => 'backend', 'action' => 'refresh_menu', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('quick_add', 'quick-add', array('controller' => 'backend', 'action' => 'quick_add', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n \n // API\n Router::map('info', 'info', array('controller' => 'api', 'action' => 'info', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n // Disk Space\n Router::map('disk_space_admin', 'admin/disk-space', array('controller' => 'disk_space_admin', 'action' => 'index', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('disk_space_usage', 'admin/disk-space/usage', array('controller' => 'disk_space_admin', 'action' => 'usage', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('disk_space_admin_settings', 'admin/disk-space/settings', array('controller' => 'disk_space_admin', 'action' => 'settings', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('disk_space_remove_application_cache', 'admin/disk-space/tools/remove-application-cache', array('controller' => 'disk_space_admin', 'action' => 'remove_application_cache', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('disk_space_remove_logs', 'admin/disk-space/tools/remove-logs', array('controller' => 'disk_space_admin', 'action' => 'remove_logs', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('disk_space_remove_old_application_versions', 'admin/disk-space/tools/remove-old-application-versions', array('controller' => 'disk_space_admin', 'action' => 'remove_old_application_versions', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n // Appearance\n Router::map('appearance_admin', 'admin/appearance', array('controller' => 'appearance', 'action' => 'index', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('appearance_admin_add_scheme', 'admin/appearance/add-scheme', array('controller' => 'appearance', 'action' => 'add', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('appearance_admin_edit_scheme', 'admin/appearance/:scheme_id/edit', array('controller' => 'appearance', 'action' => 'edit', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('appearance_admin_rename_scheme', 'admin/appearance/:scheme_id/rename', array('controller' => 'appearance', 'action' => 'rename', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('appearance_admin_delete_scheme', 'admin/appearance/:scheme_id/delete', array('controller' => 'appearance', 'action' => 'delete', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('appearance_admin_set_as_default_scheme', 'admin/appearance/:scheme_id/set-as-default', array('controller' => 'appearance', 'action' => 'set_as_default', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n // Scheduled Tasks Admin\n Router::map('scheduled_tasks_admin', 'admin/scheduled-tasks', array('controller' => 'scheduled_tasks_admin', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n // Network settings\n Router::map('network_settings', 'admin/network', array('controller' => 'network_admin', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n \n // Indices admin\n Router::map('indices_admin', 'admin/indices', array('controller' => 'indices_admin', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('indices_admin_rebuild', 'admin/indices/rebuild', array('controller' => 'indices_admin', 'action' => 'rebuild', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('indices_admin_rebuild_finish', 'admin/indices/rebuild/finish', array('controller' => 'indices_admin', 'action' => 'rebuild_finish', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n \n Router::map('object_contexts_admin_rebuild', 'admin/indices/object-contexts/rebuild', array('controller' => 'object_contexts_admin', 'action' => 'rebuild', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('object_contexts_admin_clean', 'admin/indices/object-contexts/clean', array('controller' => 'object_contexts_admin', 'action' => 'clean', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n \n // Scheduled tasks\n Router::map('frequently', 'frequently', array('controller' => 'scheduled_tasks', 'action' => 'frequently', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('hourly', 'hourly', array('controller' => 'scheduled_tasks', 'action' => 'hourly', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('daily', 'daily', array('controller' => 'scheduled_tasks', 'action' => 'daily', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n \n // trash related\n Router::map('trash', 'trash', array('controller' => 'trash', 'action' => 'index', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('trash_section', 'trash/:section_name', array('controller' => 'trash', 'action' => 'section', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('trash_empty', 'trash/empty', array('controller' => 'trash', 'action' => 'empty_trash', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n Router::map('object_untrash', 'trash/untrash-object', array('controller' => 'trash', 'action' => 'untrash_object', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO), array('object_id' => Router::MATCH_ID));\n Router::map('object_delete', 'trash/delete-object', array('controller' => 'trash', 'action' => 'delete_object', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO), array('object_id' => Router::MATCH_ID));\n\n // Control Tower\n Router::map('control_tower', 'control-tower', array('controller' => 'control_tower', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('control_tower_empty_cache', 'control-tower/empty-cache', array('controller' => 'control_tower', 'action' => 'empty_cache', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('control_tower_delete_compiled_templates', 'control-tower/delete-compiled-templates', array('controller' => 'control_tower', 'action' => 'delete_compiled_templates', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('control_tower_rebuild_images', 'control-tower/rebuild-images', array('controller' => 'control_tower', 'action' => 'rebuild_images', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('control_tower_rebuild_localization', 'control-tower/rebuild-localization', array('controller' => 'control_tower', 'action' => 'rebuild_localization', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n Router::map('control_tower_settings', 'admin/control-tower', array('controller' => 'control_tower', 'action' => 'settings', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n\t // Firewall\n\t Router::map('firewall', 'admin/firewall', array('controller' => 'firewall', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n }", "public function declare_routes(){\n\n $this->routes = \\Chocolatine\\get_configuration( 'routes' );\n $view_manager = \\Chocolatine\\get_manager('view');\n\n /**\n * Declare all route\n */\n foreach ( $this->routes as $key => $current_route) {\n\n $this->router->map(['GET', 'POST'], $current_route['route'] ,function ($request, $response, $args) {\n\n $router = \\Chocolatine\\get_service( 'Router' );\n return $router->controller( $request, $response, $args );\n\n });\n\n }\n\n }", "protected function loadRoutes()\n {\n $this->app->call([$this, 'map']);\n }", "protected function mapRoutes()\n {\n $this->loadRoutesFrom(__DIR__.'/../../routes/api/admin.php');\n }", "function defineRoutes(&$router) {\n \n // Main\n $router->map('mobile_access', 'm', array('controller' => 'mobile_access', 'action' => 'index'));\n \n $router->map('mobile_access_login', 'm/login', array('controller' => 'mobile_access_auth', 'action' => 'login'));\n $router->map('mobile_access_logout', 'm/logout', array('controller' => 'mobile_access_auth', 'action' => 'logout'));\n $router->map('mobile_access_forgot_password', 'm/forgot-password', array('controller' => 'mobile_access_auth', 'action' => 'forgot_password'));\n \n // Quick Add\n $router->map('mobile_access_quick_add', 'm/starred', array('controller' => 'mobile_access', 'action' => 'quick_add'));\n \n // Assignments\n $router->map('mobile_access_assignments', 'm/assignments', array('controller' => 'mobile_access', 'action' => 'assignments'));\n \n // Starred\n $router->map('mobile_access_starred', 'm/starred', array('controller' => 'mobile_access', 'action' => 'starred'));\n \n // People\n $router->map('mobile_access_people', 'm/people', array('controller' => 'mobile_access_people', 'action' => 'index'));\n $router->map('mobile_access_view_company', 'm/people/:object_id', array('controller' => 'mobile_access_people', 'action' => 'company'), array('object_id' => '\\d+'));\n $router->map('mobile_access_view_user', 'm/people/users/:object_id', array('controller' => 'mobile_access_people', 'action' => 'user'), array('object_id' => '\\d+'));\n \n \n // Projects\n $router->map('mobile_access_projects', 'm/projects', array('controller' => 'mobile_access_projects', 'action' => 'index'));\n \n // Project\n $router->map('mobile_access_view_project', 'm/project/:project_id', array('controller' => 'mobile_access_project', 'action' => 'index'), array('project_id' => '\\d+'));\n \n // Project discusions\n $router->map('mobile_access_view_discussions', 'm/project/:project_id/discussions', array('controller' => 'mobile_access_project_discussions', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_discussion', 'm/project/:project_id/discussions/:object_id', array('controller' => 'mobile_access_project_discussions', 'action' => 'view'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n \n // Project milestones\n $router->map('mobile_access_view_milestones', 'm/project/:project_id/milestones', array('controller' => 'mobile_access_project_milestones', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_milestone', 'm/project/:project_id/milestones/:object_id', array('controller' => 'mobile_access_project_milestones', 'action' => 'view'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n \n // Project files\n $router->map('mobile_access_view_files', 'm/project/:project_id/files', array('controller' => 'mobile_access_project_files', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_file', 'm/project/:project_id/files/:object_id', array('controller' => 'mobile_access_project_files', 'action' => 'view'), array('project_id' => '\\d+', 'object_id' => '\\d+')); \n \n // Project checklists\n $router->map('mobile_access_view_checklists', 'm/project/:project_id/checklists', array('controller' => 'mobile_access_project_checklists', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_checklist', 'm/project/:project_id/checklists/:object_id', array('controller' => 'mobile_access_project_checklists', 'action' => 'view'), array('project_id' => '\\d+', 'object_id' => '\\d+')); \n \n // Project pages\n $router->map('mobile_access_view_pages', 'm/project/:project_id/pages', array('controller' => 'mobile_access_project_pages', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_page', 'm/project/:project_id/pages/:object_id', array('controller' => 'mobile_access_project_pages', 'action' => 'view'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n $router->map('mobile_access_view_page_version', 'm/project/:project_id/pages/:object_id/version/:version', array('controller' => 'mobile_access_project_pages', 'action' => 'version'), array('project_id' => '\\d+', 'object_id' => '\\d+', 'version' => '\\d+'));\n \n // Project tickets\n $router->map('mobile_access_view_tickets', 'm/project/:project_id/tickets', array('controller' => 'mobile_access_project_tickets', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_ticket', 'm/project/:project_id/tickets/:object_id', array('controller' => 'mobile_access_project_tickets', 'action' => 'view'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n \n // Project timerecords\n $router->map('mobile_access_view_timerecords', 'm/project/:project_id/timerecords', array('controller' => 'mobile_access_project_timetracking', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_timerecord', 'm/project/:project_id/timerecords/:object_id', array('controller' => 'mobile_access_project_timetracking', 'action' => 'index'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n \n // Project subobjects\n $router->map('mobile_access_view_task', 'm/project/:project_id/task/:object_id', array('controller' => 'mobile_access', 'action' => 'view_parent_object'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n $router->map('mobile_access_view_comment', 'm/project/:project_id/comment/:object_id', array('controller' => 'mobile_access', 'action' => 'view_parent_object'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n $router->map('mobile_access_add_comment', 'm/project/:project_id/comment/add', array('controller' => 'mobile_access_project', 'action' => 'add_comment'));\n \n // Common\n $router->map('mobile_access_view_category', 'm/category/:object_id', array('controller' => 'mobile_access', 'action' => 'view_category', array('object_id' => '\\d+')));\n $router->map('mobile_access_toggle_object_completed_status', 'm/project/:project_id/toggle-completed/:object_id', array('controller' => 'mobile_access', 'action' => 'toggle_completed', array('project_id' => '\\d+', 'object_id' => '\\d+')));\n }", "function add_listing_routes()\n {\n $this->add_route('GET', '/routes', function(){\n print \"<h1>Routes</h1>\";\n foreach($this->routes as $method => $routes) {\n print \"<h3>\".$method.\"</h3>\";\n print \"<ul>\";\n foreach ($routes as $route) {\n print \"<li>\".$route->path.\"</li>\";\n }\n print \"</ul>\";\n }\n });\n }", "public function initializeRoutes()\n {\n $this->get(\"/\", \"index\");\n }", "public function map()\n {\n $this->mapServiceRoutes();\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function map()\n {\n Route::group([\n 'namespace' => $this->namespace,\n ], function ($router) {\n require __DIR__ . '/../Http/routes.php';\n });\n }", "public static function Main() {\n $routes = New Router();\n \n $routes->index();\n }", "public function route()\n {\n $this->dashboardRouting($this->relativeCmsUri);\n $this->logOffRouting($this->request, $this->relativeCmsUri);\n $this->apiRouting($this->relativeCmsUri);\n $this->documentRouting($this->userRights, $this->relativeCmsUri);\n $this->valuelistsRouting($this->userRights, $this->relativeCmsUri);\n $this->sitemapRouting($this->userRights, $this->relativeCmsUri);\n $this->redirectRouting($this->userRights, $this->relativeCmsUri);\n $this->imageRouting($this->userRights, $this->relativeCmsUri);\n $this->filesRouting($this->userRights, $this->relativeCmsUri);\n $this->configurationRouting($this->userRights, $this->relativeCmsUri);\n $this->searchRouting($this->relativeCmsUri);\n }", "public function routes()\n {\n register_rest_route('can', '/donation-forms', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'fundraisingPages'\n ],\n ]);\n\n register_rest_route('can', '/forms', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'forms'\n ],\n ]);\n\n register_rest_route('can', '/petitions', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'petitions'\n ],\n ]);\n\n register_rest_route('can', '/person/add', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'addPerson'\n ],\n ]);\n }", "protected function routes()\n {\n if ($this->app->routesAreCached()) {\n return;\n }\n\n\n /**\n * Porteiro; Routes\n */\n $this->loadRoutesForRiCa(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'routes');\n }", "public function map()\n {\n $this->prefix('stats')->name('stats.')->group(function () {\n $this->get('/', 'DashboardController@index')\n ->name('index'); // admin::tracker.stats.index\n });\n\n $this->prefix('visitors')->name('visitors.')->group(function () {\n $this->get('/', 'VisitorsController@index')\n ->name('index'); // admin::tracker.visitors.index\n });\n\n $this->prefix('settings')->name('settings.')->group(function () {\n $this->get('/', 'SettingsController@index')\n ->name('index'); // admin::tracker.settings.index\n });\n }", "protected function registerRoutes() {\n\n $this->get('/crossword', 'getCrossword');\n $this->post('/crossword', 'saveUserState');\n //not used\n //$this->get('/crossword', 'getCrossword');\n //$this->get('/wordData', 'getWordData');\n //);\n }", "protected function mapWebRoutes()\n {\n $this->mapDefaultWebRoutes();\n\n $this->mapUnauthenticatedWebRoutes();\n\n $this->mapAuthenticatedWebRoutes();\n $this->mapAdminAuthenticatedWebRoutes();\n $this->mapClientAuthenticatedWebRoutes();\n\n $this->mapPaginationRoutes();\n $this->mapAdminPaginationRoutes();\n $this->mapClientPaginationRoutes();\n\n $this->mapAjaxRoutes();\n $this->mapAdminAjaxRoutes();\n $this->mapClientAjaxRoutes();\n }", "function defineRoutes(&$router) {\n /*\n * example routers\n * \n * \n */\n //$router->map('modulename', 'modulename', array('controller' => 'modulename', 'action' => 'index'));\n //$router->map('dashboard_modulename', 'dashboard/modulename', array('controller' => 'modulename', 'action' => 'index'));\n //$router->map('modulename_view_project', 'modulename/:project_id/view', array('controller' => 'modulename', 'action' => 'view'), array('project_id' => '\\d+'));\n }", "public function register_routes() {\n\n\t\t\\add_filter( 'do_parse_request', array( $this, 'handle_routing' ) );\n\n\t}", "public function route() {\n\n try {\n \n $obj = APIFactory::init($this->parsed_path[0]);\n echo $this->getAction($obj, $this->parsed_path);\n \n } catch(UndefinedActionException $e) { \n\n echo $e->getMessage();\n\n } catch(Exception $e) {\n\n echo $e->getMessage();\n\n }\n }", "public function routes(Map $map)\n {\n\n $map->get('home', '/', function () {\n return new HtmlResponse(\"Welcome on the Sherpa skeleton !\");\n });\n //\n //$map->get('hello', '/hello/{name}', function($name){\n // return new HtmlResponse(\"Hello, $name !\");\n //});\n }", "protected function loadRoute()\n {\n $this->post('/task', 'task.controller:saveAction');\n\n // Url for update task\n $this->put('/task/{id}', 'task.controller:updateAction');\n\n // Url for see one task\n $this->get('/task/{id}', 'task.controller:getAction');\n\n // Url for delete task\n $this->delete('/task/{id}', 'task.controller:deleteAction');\n\n // Url for list of tasks\n $this->get('/task', 'task.controller:listAction');\n\n //Get Tag list\n $this->get('/tags', 'tag.controller:listAction');\n\n //Add tag to task\n $this->post('/addTag', 'tag.controller:setTagAction');\n\n //Add tag to tag list\n $this->post('/tag', 'tag.controller:saveAction');\n\n //Search by tag\n $this->get('/search/tag', 'tag.controller:searchAction'); \n\n // Url for delete tag in tag list\n $this->delete('/tag', 'tag.controller:deleteAction');\n \n // Url for auth github\n $this->post('/github', 'github.controller:authAction'); \n }", "abstract public function map(Router $router);", "private static function createRootRoute()\n {\n self::$Router->map('GET|POST', '/', function(){\n Root::executeResponse();\n exit();\n });\n }", "public static function getRoutes();", "public static function getRoutes();", "public function getRoutes() {}", "protected function routes()\n {\n Nova::routes()\n ->withAuthenticationRoutes()\n ->withPasswordResetRoutes()\n ->register();\n }", "protected function routes()\n {\n Nova::routes()\n ->withAuthenticationRoutes()\n ->withPasswordResetRoutes()\n ->register();\n }", "public function controller(){\n route('start')->onMessageText('/start');\n route('add')->onMessageText('/add');\n route('list')->onMessageText('/list');\n route('delete')->onMessageText('/delete');\n route('clear')->onMessageText('/clear');\n route('about')->onMessageText('/about');\n }", "public function indexRoute()\n {\n }", "public function generateRoutes()\n {\n $routes = property_exists(app(), 'router')? app()->router->getRoutes() : app()->getRoutes();\n foreach ($routes as $route) {\n array_push($this->routes, [\n 'method' => $route['method'],\n 'uri' => $route['uri'],\n 'name' => $this->getRouteName($route),\n 'action' => $this->getRouteAction($route),\n 'middleware' => $this->getRouteMiddleware($route),\n 'map' => $this->getRouteMapTo($route)\n ]);\n }\n }", "public function initRoutes()\r\n {\r\n $route = new Route();\r\n\r\n $routesConf = include __DIR__ . '/../../config/routes.inc.php';\r\n\r\n foreach ($routesConf as $routeConf) {\r\n\r\n $uri = $routeConf['uri'];\r\n\r\n if (preg_match_all('/\\$(.*?(?=\\/)|.*?$)/', $routeConf['uri'], $matches)) {\r\n $uri = preg_replace('/\\$(.*?(?=\\/)|.*?$)/', '.*', $routeConf['uri']);\r\n }\r\n\r\n $route->add($uri, $routeConf, $matches[1], function($params) {\r\n $this->config->route = $params['config'];\r\n\r\n $args = [];\r\n if (isset($params['arguments'])) {\r\n $args = $params['arguments'];\r\n }\r\n\r\n $controller = new $params['config']['controller']($this->config, $this->db, $args);\r\n\r\n $controller->indexAction();\r\n });\r\n }\r\n\r\n $findUrl = $route->submit();\r\n\r\n if (!$findUrl) {\r\n header('HTTP/1.0 404 Not Found');\r\n include_once __DIR__ . '/../../../src/Views/errors/404_de.html';\r\n }\r\n }", "public static function routes()\r\n {\r\n return [\r\n [\"uri\" => \"/\", \"action\" => \"get\", \"uses\" => \"IndexController@index\"],\r\n [\"uri\" => \"/\", \"action\" => \"post\", \"uses\" => \"IndexController@handle\"],\r\n [\"uri\" => \"/api\", \"action\" => \"get\", \"uses\" => \"APIController@handle\"],\r\n ];\r\n }", "function create_initial_rest_routes()\n {\n }", "public function map()\n {\n $this->adminGroup(function () {\n $this->mapAdminRoutes();\n });\n }", "public function getRoutes();" ]
[ "0.8344216", "0.8318764", "0.8281106", "0.8273684", "0.8250957", "0.8250957", "0.8250957", "0.8250957", "0.8250957", "0.8250957", "0.8250957", "0.8250957", "0.8224787", "0.82123375", "0.8181593", "0.81058913", "0.8104666", "0.8092215", "0.80752784", "0.80752784", "0.80461186", "0.8007509", "0.7997891", "0.7893923", "0.7884567", "0.7759259", "0.77034056", "0.76599544", "0.7617443", "0.7537764", "0.74999046", "0.7452304", "0.74444824", "0.7409105", "0.73652214", "0.7364473", "0.73389", "0.73356164", "0.7332636", "0.73304856", "0.7315522", "0.7315522", "0.7315522", "0.7315522", "0.7315522", "0.7315522", "0.7315522", "0.7315522", "0.7315522", "0.7315522", "0.7315522", "0.7315522", "0.7315522", "0.7315522", "0.7315522", "0.7315522", "0.7315522", "0.7315522", "0.7315522", "0.7315522", "0.7315522", "0.7315522", "0.7315522", "0.7315522", "0.7315522", "0.7315522", "0.7315522", "0.7315522", "0.7315522", "0.7315522", "0.7315522", "0.7315522", "0.7313364", "0.7305369", "0.7251378", "0.72083503", "0.71661776", "0.7143309", "0.71267444", "0.7114203", "0.70343006", "0.7012058", "0.70033246", "0.6999755", "0.6997885", "0.6995835", "0.6984644", "0.6970445", "0.6958047", "0.6958047", "0.6948777", "0.69431716", "0.69431716", "0.69055814", "0.6904591", "0.6869156", "0.686488", "0.68544304", "0.68505263", "0.68399775", "0.68146855" ]
0.0
-1
Register the route bindings.
public function bindings(PermissionsRepository $repo): void { $this->bind(self::PERMISSION_WILDCARD, function (string $uuid) use ($repo) { return $repo->firstOrFailWhereUuid($uuid); }); static::bindRouteClasses([ Permissions\RolesRoutes::class, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function registerRouteBindings()\n {\n //\n }", "private function registerBindings()\n {\n foreach($this->bindings as $key => $val)\n {\n $this->app->bind($key, $val);\n }\n }", "private function register_routes() {\n\t\t$routes = $this->get_routes();\n\t\tforeach ( $routes as $route ) {\n\t\t\t$route->register();\n\t\t}\n\t}", "public function register()\n {\n foreach ($this->simpleBindings as $contract => $service) {\n $this->app->bind($contract, $service);\n }\n }", "protected function registerBindings()\n {\n // bind the manager class.\n $this->app->bind(Contracts\\Token\\Manager::class, Manager::class);\n\n // bind the guard class.\n $this->app->bind(Contracts\\Auth\\Guard::class, Guard::class);\n }", "public function register()\n {\n foreach ($this->bindings as $abstract => $concrete) {\n $this->app->bind($abstract, $concrete);\n }\n }", "public function register()\n {\n foreach ($this->getBindings() as $interface => $class) {\n $this->app->bind($interface, $class);\n }\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes() {\n\n\t\t\\add_filter( 'do_parse_request', array( $this, 'handle_routing' ) );\n\n\t}", "protected function registerBindings()\n {\n $this->app->bind(\n \\LaravelFlare\\Flare\\Contracts\\Permissions\\Permissionable::class,\n \\Flare::config('permissions')\n );\n }", "protected function registerRoutes() {\n\n $this->get('/crossword', 'getCrossword');\n $this->post('/crossword', 'saveUserState');\n //not used\n //$this->get('/crossword', 'getCrossword');\n //$this->get('/wordData', 'getWordData');\n //);\n }", "public function register()\n {\n $contracts = config(\"api.contracts\");\n $bindings = config('api.bindings');\n foreach($contracts as $contract)\n {\n $this->app->bind($contract, function($app) use ($contract, $bindings)\n {\n $version = Request::segment(2);\n return $app[$bindings[$version][$contract]];\n });\n }\n }", "private function registerRoutes(){\n $appRouter = require_once __DIR__.'/../../routes/app.php';\n $this->registerApplicationRoutes($appRouter);\n $this->registerApplicationRoutes($appRouter, false);\n $this->registerAuthenticationRoutes();\n }", "public function registerRoutes() {\n $this->addRoute('default');\n }", "protected function registerRoutes()\n {\n $this->registerWebRoutes();\n $this->registerApiRoutes();\n }", "public function register()\n {\n // register route middleware.\n foreach ($this->routeMiddleware as $key => $middleware) {\n app('router')->aliasMiddleware($key, $middleware);\n }\n }", "public function register()\n {\n $this->registerBindings($this->app);\n }", "protected function registerRoutes()\n {\n $middleware = ['exposable.signature', 'exposable.expire', 'exposable.guard'];\n\n if (! empty(config('exposable.middleware'))) {\n $middleware = array_merge($middleware, (array) config('exposable.middleware'));\n }\n\n $uri = config('exposable.url-prefix').'/{exposable}/{id}';\n\n $this->app['router']->get($uri, 'ArjanWestdorp\\Exposable\\Http\\Controllers\\ExposableController@show')->middleware($middleware)->name('exposable.show');\n }", "public function registerRoutes()\n\t{\n\t\t$this->app->booted(function ($app) {\n\n\t\t\t# Manager\n\t\t\t$app['router']->get(\n\t\t\t\t'/',\n\t\t\t\t[\n\t\t\t\t\t'as' => 'manager.index',\n\t\t\t\t\t'uses' => 'ManagerController@index'\n\t\t\t\t]\n\t\t\t);\n\n\t\t});\n\t}", "private function bindRoute(): void\n {\n if (isset($this->route)) {\n return;\n }\n $this->route = new SymfonyRoute('');\n }", "protected static function registerRoutes()\n {\n parent::routes(function ($router) {\n /* @var \\Illuminate\\Routing\\Router $router */\n $router->resource('useradmin/member', 'GG\\Admin\\Member\\Controllers\\MemberController');\n $router->resource('useradmin/permissions', 'GG\\Admin\\Member\\Controllers\\PermissionController');\n $router->resource('useradmin/roles', 'GG\\Admin\\Member\\Controllers\\RoleController');\n $router->resource('useradmin/menu', 'GG\\Admin\\Member\\Controllers\\MenuController');\n\n });\n }", "protected function defineRoutes()\n {\n $this->register(ImageServiceProvider::class);\n if (! $this->app->routesAreCached()) {\n $router = app('router');\n $router->group([\n 'namespace' => 'Socieboy\\Jupiter\\Http\\Controllers',\n 'middleware' => 'web',\n ], function ($router) {\n require __DIR__.'/../Http/routes.php';\n });\n }\n }", "private function registerRoutes()\n {\n Route::group($this->routeConfiguration(), function () {\n $this->loadRoutesFrom(__DIR__.'/Http/routes.php');\n });\n }", "private function registerRoutes()\n {\n Route::group($this->routeConfiguration(), function () {\n $this->loadRoutesFrom(__DIR__.'/Http/routes.php');\n });\n }", "private function registerRoutes()\n {\n Route::group($this->routeConfiguration(), function () {\n $this->loadRoutesFrom(__DIR__.'/Http/routes.php');\n });\n }", "private function registerBinding()\n {\n /**\n * bind Tax Repository to its Eloquent implementation\n */\n $this->app->bind(\n \\Innovate\\Repositories\\Tax\\TaxContract::class,\n \\Innovate\\Repositories\\Tax\\EloquentTaxRepository::class\n );\n /**\n * bind BankTransferInfoContract to its elquent implementation EloquentBankTransferInfoRepository\n */\n $this->app->bind(\n \\Innovate\\Repositories\\StaticPages\\BankTransferInfo\\BankTransferInfoContract::class,\n \\Innovate\\Repositories\\StaticPages\\BankTransferInfo\\EloquentBankTransferInfoRepository::class\n );\n\n /**\n *\n */\n $this->app->bind(\n \\Innovate\\Repositories\\StaticPages\\CheckOutAgreement\\CheckOutAgreementContract::class,\n \\Innovate\\Repositories\\StaticPages\\CheckOutAgreement\\EloquentCheckOutAgreementRepository::class\n );\n\n $this->eavAttributeBindings();\n $this->eavAttributeCategoryBindings();\n }", "protected function registerRouteMiddleware()\n {\n // register route middleware.\n foreach ($this->routeMiddleware as $key => $middleware) {\n app('router')->aliasMiddleware($key, $middleware);\n }\n }", "protected function registerRouteMiddleware()\n {\n // register route middleware.\n foreach ($this->routeMiddleware as $key => $middleware) {\n app('router')->aliasMiddleware($key, $middleware);\n }\n }", "protected function registerRoutes()\n {\n if (TwilioVerify::$registersRoutes) {\n Route::group([\n 'prefix' => config('twilio-verify.path'),\n 'namespace' => 'IvanSotelo\\TwilioVerify\\Http\\Controllers',\n 'as' => 'twilio-verify.',\n ], function () {\n $this->loadRoutesFrom(__DIR__.'/../routes/web.php');\n });\n }\n }", "public function register()\n {\n $this->registerBindings();\n }", "public function register()\n {\n $this->registerBindings();\n }", "public function register()\n {\n $this->registerBindings();\n }", "public function register()\n {\n $this->registerBindings();\n }", "public function register()\n {\n $this->registerBindings();\n }", "protected function registerRoutes()\n {\n $this->loadRoutesFrom(__DIR__ . '/../routes/api.php');\n }", "protected function registerRoutes(): void\n {\n Route::group([\n 'prefix' => 'fairqueue',\n 'namespace' => 'Aloware\\FairQueue\\Http\\Controllers',\n 'middleware' => config('fair-queue.middleware', 'web'),\n ], function () {\n $this->loadRoutesFrom(__DIR__ . '/../routes/web.php');\n });\n }", "protected function registerRoutes()\n {\n Route::group([\n 'prefix' => config('paystacksubscription.webhook_path'),\n 'namespace' => 'Digikraaft\\PaystackSubscription\\Http\\Controllers',\n 'as' => 'paystack.',\n ], function () {\n $this->loadRoutesFrom(__DIR__.'/../routes/web.php');\n });\n }", "public function register(): void\n {\n /**\n * @var \\Illuminate\\Config\\Repository $config\n * @var \\Illuminate\\Routing\\Router $router\n */\n [$config, $router] = $this->getDependencies();\n\n $this->resolveRouteFromConfig($config);\n\n foreach ($this->groups() as $group) {\n $this->map($router, $group);\n }\n }", "protected function registerRoutes(): void\n {\n Route::group([\n 'domain' => $this->app['config']['support-chat.domain'] ?? null,\n 'prefix' => $this->app['config']['support-chat.path'] ?? null,\n 'name' => 'support-chat.',\n 'namespace' => 'TTBooking\\\\SupportChat\\\\Http\\\\Controllers',\n 'middleware' => $this->app['config']['support-chat.middleware'] ?? 'web',\n ], function () {\n $this->loadRoutesFrom(__DIR__.'/../routes/web.php');\n });\n\n require __DIR__.'/../routes/channels.php';\n }", "public function register_routes( Collection $routes );", "public function register_routes() {\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/' . $this->rest_base,\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t\t'callback' => array( $this, 'parse_url_details' ),\n\t\t\t\t\t'args' => array(\n\t\t\t\t\t\t'url' => array(\n\t\t\t\t\t\t\t'required' => true,\n\t\t\t\t\t\t\t'description' => __( 'The URL to process.' ),\n\t\t\t\t\t\t\t'validate_callback' => 'wp_http_validate_url',\n\t\t\t\t\t\t\t'sanitize_callback' => 'sanitize_url',\n\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t'format' => 'uri',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'permission_callback' => array( $this, 'permissions_check' ),\n\t\t\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\t}", "protected function registerRoutes()\n {\n Route::group($this->routeConfiguration(), function () {\n $this->loadRoutesFrom(__DIR__ . '/../routes/api.php');\n });\n }", "protected function registerRoutes()\n {\n Route::group($this->routeConfiguration(), function () {\n $this->loadRoutesFrom(__DIR__ . '/../routes/api.php');\n });\n }", "protected function registerBaseBindings()\n {\n $this->container->bind(\n \\Lib\\Contracts\\Http\\Kernel::class,\n \\Lib\\Http\\Kernel::class\n );\n\n $this->container->bind(\n \\Lib\\Contracts\\Support\\Config::class,\n \\Lib\\Support\\Config::class\n );\n }", "public function registerBindings() {\n $this->app->bind(\n 'App\\Repositories\\Backend\\Course\\CourseContract',\n 'App\\Repositories\\Backend\\Course\\EloquentCourseRepository'\n );\n $this->app->bind(\n 'App\\Repositories\\Frontend\\Course\\CourseContract',\n 'App\\Repositories\\Frontend\\Course\\EloquentCourseRepository'\n );\n\n $this->app->bind(\n 'App\\Repositories\\Backend\\CourseContent\\CourseContentContract',\n 'App\\Repositories\\Backend\\CourseContent\\EloquentCourseContentRepository'\n );\n }", "public function registerRoutes()\n {\n $namespace = $this->getNameSpace();\n\n register_rest_route($namespace, '/' . self::ROUTE_UPDATE_CALLBACK, [\n 'methods' => WP_REST_Server::EDITABLE,\n 'callback' => array( $this, 'updateTrapp' ),\n 'permission_callback' => array( $this, 'updateTrappPermissions' ),\n ]);\n }", "public function register()\n {\n\n $this->registerBindings();\n\n }", "public function registerBindings() {\n $this->app->bind(\n 'App\\Repositories\\Backend\\Slider\\SliderContract',\n 'App\\Repositories\\Backend\\Slider\\EloquentSliderRepository'\n );\n $this->app->bind(\n 'App\\Repositories\\Frontend\\Slider\\SliderContract',\n 'App\\Repositories\\Frontend\\Slider\\EloquentSliderRepository'\n );\n }", "protected function registerRoutes()\n {\n Route::group([\n 'prefix' => config('dashkit.path'),\n 'middleware' => config('dashkit.middleware', 'web'),\n ], function () {\n $this->loadRoutesFrom(__DIR__ . '/../routes/web.php');\n });\n }", "protected function registerRouteMiddleware()\n {\n // register route middleware.\n foreach ($this->routeMiddleware as $key => $middleware) {\n app('router')->aliasMiddleware($key, $middleware);\n }\n // register middleware group.\n foreach ($this->middlewareGroups as $key => $middleware) {\n app('router')->middlewareGroup($key, $middleware);\n }\n }", "protected function registerRouteMiddleware()\n {\n // register route middleware.\n foreach ($this->routeMiddleware as $key => $middleware) {\n app('router')->aliasMiddleware($key, $middleware);\n }\n // register middleware group.\n foreach ($this->middlewareGroups as $key => $middleware) {\n app('router')->middlewareGroup($key, $middleware);\n }\n }", "public function register()\n {\n // register routes\n $this->registerConfigurations();\n\n // https://github.com/laravolt/indonesia\n $this->app->bind('linebot', function() {\n return new LineBotManager(\"ko\");\n });\n \n // $this->app->bind('linebot', function($app){\n \n // $config = $this->app['config']->get('services.linebot', []);\n // // dd($config);\n // $client = new Client(Arr::get($config, 'guzzle', []));\n \n // return new LineBotManager(\"Kiw\");\n // });\n }", "public function register_routes() {\n # GET/POST /products\n $routes[$this->base] = array(\n array( array( $this, 'get_products' ), WC_API_Server::READABLE ),\n array( array( $this, 'create_product' ), WC_API_SERVER::CREATABLE | WC_API_Server::ACCEPT_DATA ),\n );\n }", "protected function registerRouteMiddleware()\n {\n // register route middleware.\n foreach ($this->routeMiddleware as $key => $middleware) {\n app('router')->middleware($key, $middleware);\n }\n\n // register middleware group.\n foreach ($this->middlewareGroups as $key => $middleware) {\n app('router')->middlewareGroup($key, $middleware);\n }\n }", "protected function bindings()\n\t{\n\t\t$this->app->singleton('anodyne', function ($app) {\n\t\t\treturn new \\App\\Anodyne;\n\t\t});\n\n\t\t// Bind the avatar class into the container\n\t\t$this->app->bind('avatar', function ($app) {\n\t\t\treturn new \\App\\Avatar;\n\t\t});\n\n\t\t// Bind the flash notifier class into the container\n\t\t$this->app->bind('flash', function ($app) {\n\t\t\treturn new \\App\\FlashNotifier;\n\t\t});\n\t}", "public function register_routes() {\n\n\t\t// Get current user per the JWT token. Depends on JWT plugin.\n\t\tregister_rest_route(\n\t\t\t'wpcampus',\n\t\t\t'/auth/user/',\n\t\t\t[\n\t\t\t\t'methods' => 'GET',\n\t\t\t\t'callback' => [ $this, 'get_current_user' ],\n\t\t\t]\n\t\t);\n\t}", "public function register()\n {\n $this->app->register(RouteServiceProvider::class);\n }", "public function register()\n {\n $this->app->register(RouteServiceProvider::class);\n }", "public function register()\n {\n $this->app->register(RouteServiceProvider::class);\n }", "public function register()\n {\n $this->app->register(RouteServiceProvider::class);\n }", "public function register()\n {\n parent::register();\n\n $this->app->register(RouteServiceProvider::class);\n }", "public function register_routes() {\n\t\tregister_rest_route( $this->namespace, '/' . $this->rest_base, array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_item' ),\n\t\t\t\t'args' => array(),\n\t\t\t\t'permission_callback' => array( $this, 'get_item_permissions_check' ),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t'callback' => array( $this, 'update_item' ),\n\t\t\t\t'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ),\n\t\t\t\t'permission_callback' => array( $this, 'get_item_permissions_check' ),\n\t\t\t),\n\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t) );\n\t}", "public function register()\n {\n $this->app->bind(TelescopeRouteServiceContract::class, TelescopeRouteService::class);\n }", "public function register_api_endpoints() {\n\n\t\tregister_rest_route( 'nock/v1', '/messages', array(\n\t\t\t'methods' => array( 'POST' ),\n\t\t\t'callback' => array( $this, 'send_message' ),\n\t\t) );\n\n\t\tregister_rest_route( 'nock/v1', '/accounts', array(\n\t\t\t'methods' => array( 'GET' ),\n\t\t\t'callback' => array( $this, 'get_accounts' ),\n\t\t) );\n\n\t\tregister_rest_route( 'nock/v1', '/groups', array(\n\t\t\t'methods' => array( 'GET' ),\n\t\t\t'callback' => array( $this, 'get_groups' ),\n\t\t) );\n\n\t\tregister_rest_route( 'nock/v1', '/sms', array(\n\t\t\t'methods' => array( 'GET', 'POST' ),\n\t\t\t'callback' => array( $this, 'capture_sms' ),\n\t\t) );\n\n\t}", "public function registerInterfaceBindings()\n {\n $this->app->bind('League\\OAuth2\\Server\\Storage\\ClientInterface', 'LucaDegasperi\\OAuth2Server\\Repositories\\FluentClient');\n $this->app->bind('League\\OAuth2\\Server\\Storage\\ScopeInterface', 'LucaDegasperi\\OAuth2Server\\Repositories\\FluentScope');\n $this->app->bind('League\\OAuth2\\Server\\Storage\\SessionInterface', 'LucaDegasperi\\OAuth2Server\\Repositories\\FluentSession');\n $this->app->bind('League\\OAuth2\\Server\\Storage\\AccessTokenInterface', 'LucaDegasperi\\OAuth2Server\\Repositories\\FluentAccessToken');\n $this->app->bind('League\\OAuth2\\Server\\Storage\\RefreshTokenInterface', 'LucaDegasperi\\OAuth2Server\\Repositories\\FluentRefreshToken');\n }", "protected function registerRoutes()\n {\n if (EfaasProvider::$registersRoutes) {\n Route::group([\n 'as' => 'efaas.',\n 'namespace' => '\\Javaabu\\EfaasSocialite\\Http\\Controllers',\n ], function () {\n $this->loadRoutesFrom(__DIR__.'/../../routes/web.php');\n });\n }\n }", "public function register_routes() {\n\t\tregister_rest_route( $this->namespace, $this->route, [\n\t\t\t[\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => [$this, 'get_options']\n\t\t\t],\n\t\t\t[\n\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t'callback' => [$this, 'update_options'],\n\t\t\t\t'permission_callback' => [$this, 'update_option_permissions_check']\n\t\t\t],\n\t\t\t[\n\t\t\t\t'methods' => WP_REST_Server::DELETABLE,\n\t\t\t\t'callback' => [$this, 'delete_options'],\n\t\t\t\t'permission_callback' => [$this, 'delete_option_permissions_check']\n\t\t\t]\n\t\t] );\n\n\t\tregister_rest_route( $this->namespace, $this->route . '/(?P<slug>.+)', [\n\t\t\t[\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => [$this, 'get_option']\n\t\t\t],\n\t\t\t[\n\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t'callback' => [$this, 'update_option'],\n\t\t\t\t'permission_callback' => [$this, 'update_option_permissions_check']\n\t\t\t],\n\t\t\t[\n\t\t\t\t'methods' => WP_REST_Server::DELETABLE,\n\t\t\t\t'callback' => [$this, 'delete_option'],\n\t\t\t\t'permission_callback' => [$this, 'delete_option_permissions_check']\n\t\t\t]\n\t\t] );\n\t}", "public function register_routes() {\n\n\t\tregister_rest_route( $this->namespace, '/' . $this->rest_base, array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_items' ),\n\t\t\t\t'permission_callback' => array( $this, 'get_items_permissions_check' ),\n\t\t\t\t'args' => array(),\n\t\t\t)\n\t\t) );\n }", "protected function registerDefaultBindings() {\n\n\t\t// Add the instance of this application.\n\t\t$this->instance( 'app', $this );\n\n\t\t// Adds the directory path for the framework.\n\t//\t$this->instance( 'path', untrailingslashit( plugin_dir_path( __DIR__ ) ) );\n\t//\t$this->instance( 'uri', untrailingslashit( plugin_dir_url( __DIR__ ) ) );\n\n\t\t// Add the version for the framework.\n\t\t$this->instance( 'version', static::VERSION );\n\t}" ]
[ "0.8681723", "0.72117376", "0.7130416", "0.7029659", "0.6996472", "0.69905025", "0.69762516", "0.69298965", "0.69285136", "0.69285136", "0.69285136", "0.69285136", "0.69285136", "0.69285136", "0.69285136", "0.69285136", "0.69285136", "0.69285136", "0.69285136", "0.69285136", "0.69285136", "0.69285136", "0.69285136", "0.69285136", "0.69285136", "0.69285136", "0.69285136", "0.69285136", "0.69285136", "0.69285136", "0.69285136", "0.69285136", "0.69285136", "0.69285136", "0.69285136", "0.69285136", "0.69285136", "0.69285136", "0.69285136", "0.69285136", "0.6914125", "0.69058764", "0.6869909", "0.68257904", "0.67745954", "0.6766832", "0.6666467", "0.66520315", "0.6636035", "0.66259164", "0.6624243", "0.6616026", "0.6561241", "0.65584147", "0.65364504", "0.65364504", "0.65364504", "0.6527256", "0.6525835", "0.6525835", "0.6506629", "0.6505994", "0.6505994", "0.6505994", "0.6505994", "0.6505994", "0.6494989", "0.64941", "0.6490412", "0.64586616", "0.644779", "0.6446019", "0.64387435", "0.6434597", "0.6434597", "0.64117056", "0.6404281", "0.635495", "0.63429135", "0.6342606", "0.63299966", "0.63298494", "0.63298494", "0.6303548", "0.6302839", "0.6289337", "0.62878484", "0.6274166", "0.6271804", "0.6271804", "0.6271804", "0.6271804", "0.6269637", "0.6256772", "0.62537223", "0.6241809", "0.62404954", "0.6228976", "0.62274873", "0.62253416", "0.6219388" ]
0.0
-1
Create a new controller instance.
public function __construct() { $this->middleware('auth'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createController()\n {\n $this->createClass('controller');\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->getNameInput()));\n\n $modelName = $this->qualifyClass('Models/'.$this->getNameInput());\n\n $this->call('make:controller', array_filter([\n 'name' => \"{$controller}Controller\",\n '--model' => $modelName,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n $model_name = $this->qualifyClass($this->getNameInput());\n $name = Str::contains($model_name, ['\\\\']) ? Str::afterLast($model_name, '\\\\') : $model_name;\n\n $this->call('make:controller', [\n 'name' => \"{$controller}Controller\",\n '--model' => $model_name,\n ]);\n\n $path = base_path() . \"/app/Http/Controllers/{$controller}Controller.php\";\n $this->cleanupDummy($path, $name);\n }", "private function makeInitiatedController()\n\t{\n\t\t$controller = new TestEntityCRUDController();\n\n\t\t$controller->setLoggerWrapper(Logger::create());\n\n\t\treturn $controller;\n\t}", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n\n $modelName = $this->qualifyClass($this->getNameInput());\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n ]));\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"Api/{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $name = str_replace(\"Service\",\"\",$this->argument('name'));\n\n $this->call('make:controller', [\n 'name' => \"{$name}Controller\"\n ]);\n }", "protected function createController()\n {\n $params = [\n 'name' => $this->argument('name'),\n ];\n\n if ($this->option('api')) {\n $params['--api'] = true;\n }\n\n $this->call('wizard:controller', $params);\n }", "public function generateController () {\r\n $controllerParam = \\app\\lib\\router::getPath();\r\n $controllerName = \"app\\controller\\\\\" . end($controllerParam);\r\n $this->controller = new $controllerName;\r\n }", "public static function newController($controller)\n\t{\n\t\t$objController = \"App\\\\Controllers\\\\\".$controller;\n\t\treturn new $objController;\n\t}", "public function createController()\n\t{\n\t\tif(class_exists($this->controller))\n\t\t{\n\t\t\t// get the parent class he extends\n\t\t\t$parents = class_parents($this->controller);\n\n\t\t\t// $parents = class_implements($this->controller); used if our Controller was just an interface not a class\n\n\t\t\t// check if the class implements our Controller Class\n\t\t\tif(in_array(\"Controller\", $parents))\n\t\t\t{\n\t\t\t\t// check if the action in the request exists in that class\n\t\t\t\tif(method_exists($this->controller, $this->action))\n\t\t\t\t{\n\t\t\t\t\treturn new $this->controller($this->action, $this->request);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Action is not exist\n\t\t\t\t\techo 'Method '. $this->action .' doesn\\'t exist in '. $this->controller;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The controller doesn't extends our Controller Class\n\t\t\t\techo $this->controller.' doesn\\'t extends our Controller Class';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Controller Doesn't exist\n\t\t\techo $this->controller.' doesn\\'t exist';\n\t\t}\n\t}", "public function createController( ezcMvcRequest $request );", "public function createController() {\n //check our requested controller's class file exists and require it if so\n /*if (file_exists(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\")) {\n require(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\");\n } else {\n throw new Exception('Route does not exist');\n }*/\n\n try {\n require_once __DIR__ . '/../Controllers/' . $this->controllerName . '.php';\n } catch (Exception $e) {\n return $e;\n }\n \n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n \n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\",$parents)) { \n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->endpoint)) {\n return new $this->controllerClass($this->args, $this->endpoint, $this->domain);\n } else {\n throw new Exception('Action does not exist');\n }\n } else {\n throw new Exception('Class does not inherit correctly.');\n }\n } else {\n throw new Exception('Controller does not exist.');\n }\n }", "public static function create()\n\t{\n\t\t//check, if a JobController instance already exists\n\t\tif(JobController::$jobController == null)\n\t\t{\n\t\t\tJobController::$jobController = new JobController();\n\t\t}\n\n\t\treturn JobController::$jobController;\n\t}", "private function controller()\n {\n $location = $this->args[\"location\"] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n $relative_location = $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n\n if (!empty($this->args['subdirectories']))\n {\n $location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n $relative_location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n }\n\n if (!is_dir($location))\n {\n mkdir($location, 0755, TRUE);\n }\n\n $relative_location .= $this->args['filename'];\n $filename = $location . $this->args['filename'];\n\n $args = array(\n \"class_name\" => ApplicationHelpers::camelize($this->args['name']),\n \"filename\" => $this->args['filename'],\n \"application_folder\" => $this->args['application_folder'],\n \"parent_class\" => (isset($this->args['parent'])) ? $this->args['parent'] : $this->args['parent_controller'],\n \"extra\" => $this->extra,\n 'relative_location' => $relative_location,\n 'helper_name' => strtolower($this->args['name']) . '_helper',\n );\n\n $template = new TemplateScanner(\"controller\", $args);\n $controller = $template->parse();\n\n $message = \"\\t\";\n if (file_exists($filename))\n {\n $message .= 'Controller already exists : ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue');\n }\n $message .= $relative_location;\n }\n elseif (file_put_contents($filename, $controller))\n {\n $message .= 'Created controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green');\n }\n $message .= $relative_location;\n }\n else\n {\n $message .= 'Unable to create controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red');\n }\n $message .= $relative_location;\n }\n\n // The controller has been generated, output the confirmation message\n fwrite(STDOUT, $message . PHP_EOL);\n\n // Create the helper files.\n $this->helpers();\n\n $this->assets();\n\n // Create the view files.\n $this->views();\n\n return;\n }", "public function createController( $controllerName ) {\r\n\t\t$refController \t\t= $this->instanceOfController( $controllerName );\r\n\t\t$refConstructor \t= $refController->getConstructor();\r\n\t\tif ( ! $refConstructor ) return $refController->newInstance();\r\n\t\t$initParameter \t\t= $this->setParameter( $refConstructor );\r\n\t\treturn $refController->newInstanceArgs( $initParameter ); \r\n\t}", "public function create($controllerName) {\r\n\t\tif (!$controllerName)\r\n\t\t\t$controllerName = $this->defaultController;\r\n\r\n\t\t$controllerName = ucfirst(strtolower($controllerName)).'Controller';\r\n\t\t$controllerFilename = $this->searchDir.'/'.$controllerName.'.php';\r\n\r\n\t\tif (preg_match('/[^a-zA-Z0-9]/', $controllerName))\r\n\t\t\tthrow new Exception('Invalid controller name', 404);\r\n\r\n\t\tif (!file_exists($controllerFilename)) {\r\n\t\t\tthrow new Exception('Controller not found \"'.$controllerName.'\"', 404);\r\n\t\t}\r\n\r\n\t\trequire_once $controllerFilename;\r\n\r\n\t\tif (!class_exists($controllerName) || !is_subclass_of($controllerName, 'Controller'))\r\n\t\t\tthrow new Exception('Unknown controller \"'.$controllerName.'\"', 404);\r\n\r\n\t\t$this->controller = new $controllerName();\r\n\t\treturn $this;\r\n\t}", "private function createController($controllerName)\n {\n $className = ucfirst($controllerName) . 'Controller';\n ${$this->lcf($controllerName) . 'Controller'} = new $className();\n return ${$this->lcf($controllerName) . 'Controller'};\n }", "public function createControllerObject(string $controller)\n {\n $this->checkControllerExists($controller);\n $controller = $this->ctlrStrSrc.$controller;\n $controller = new $controller();\n return $controller;\n }", "public function create_controller($controller, $action){\n\t $creado = false;\n\t\t$controllers_dir = Kumbia::$active_controllers_dir;\n\t\t$file = strtolower($controller).\"_controller.php\";\n\t\tif(file_exists(\"$controllers_dir/$file\")){\n\t\t\tFlash::error(\"Error: El controlador '$controller' ya existe\\n\");\n\t\t} else {\n\t\t\tif($this->post(\"kind\")==\"applicationcontroller\"){\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends ApplicationController {\\n\\n\\t\\tfunction $action(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tif(@file_put_contents(\"$controllers_dir/$file\", $filec)){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends StandardForm {\\n\\n\\t\\tpublic \\$scaffold = true;\\n\\n\\t\\tpublic function __construct(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tfile_put_contents(\"$controllers_dir/$file\", $filec);\n\t\t\t\tif($this->create_model($controller, $controller, \"index\")){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($creado){\n\t\t\t Flash::success(\"Se cre&oacute; correctamente el controlador '$controller' en '$controllers_dir/$file'\");\n\t\t\t}else {\n\t\t\t Flash::error(\"Error: No se pudo escribir en el directorio, verifique los permisos sobre el directorio\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t$this->route_to(\"controller: $controller\", \"action: $action\");\n\t}", "private function instanceController( string $controller_class ): Controller {\n\t\treturn new $controller_class( $this->request, $this->site );\n\t}", "public function makeController($controller_name)\n\t{\n\t\t$model\t= $this->_makeModel($controller_name, $this->_storage_type);\n\t\t$view\t= $this->_makeView($controller_name);\n\t\t\n\t\treturn new $controller_name($model, $view);\n\t}", "public function create()\n {\n $output = new \\Symfony\\Component\\Console\\Output\\ConsoleOutput();\n $output->writeln(\"<info>Controller Create</info>\");\n }", "protected function createDefaultController() {\n Octopus::requireOnce($this->app->getOption('OCTOPUS_DIR') . 'controllers/Default.php');\n return new DefaultController();\n }", "private function createControllerDefinition()\n {\n $id = $this->getServiceId('controller');\n if (!$this->container->has($id)) {\n $definition = new Definition($this->getServiceClass('controller'));\n $definition\n ->addMethodCall('setConfiguration', [new Reference($this->getServiceId('configuration'))])\n ->addMethodCall('setContainer', [new Reference('service_container')])\n ;\n $this->container->setDefinition($id, $definition);\n }\n }", "public function createController( $ctrlName, $action ) {\n $args['action'] = $action;\n $args['path'] = $this->path . '/modules/' . $ctrlName;\n $ctrlFile = $args['path'] . '/Controller.php';\n // $args['moduleName'] = $ctrlName;\n if ( file_exists( $ctrlFile ) ) {\n $ctrlPath = str_replace( CITRUS_PATH, '', $args['path'] );\n $ctrlPath = str_replace( '/', '\\\\', $ctrlPath ) . '\\Controller';\n try { \n $r = new \\ReflectionClass( $ctrlPath ); \n $inst = $r->newInstanceArgs( $args ? $args : array() );\n\n $this->controller = Citrus::apply( $inst, Array( \n 'name' => $ctrlName, \n ) );\n if ( $this->controller->is_protected == null ) {\n $this->controller->is_protected = $this->is_protected;\n }\n return $this->controller;\n } catch ( \\Exception $e ) {\n prr($e, true);\n }\n } else {\n return false;\n }\n }", "protected function createTestController() {\n\t\t$controller = new CController('test');\n\n\t\t$action = $this->getMock('CAction', array('run'), array($controller, 'test'));\n\t\t$controller->action = $action;\n\n\t\tYii::app()->controller = $controller;\n\t\treturn $controller;\n\t}", "public static function newController($controllerName, $params = [], $request = null) {\n\n\t\t$controller = \"App\\\\Controllers\\\\\".$controllerName;\n\n\t\treturn new $controller($params, $request);\n\n\t}", "private function loadController() : void\n\t{\n\t\t$this->controller = new $this->controllerName($this->request);\n\t}", "public function createController($pi, array $params)\n {\n $class = $pi . '_Controller_' . ucfirst($params['page']);\n\n return new $class();\n }", "public function createController() {\n //check our requested controller's class file exists and require it if so\n \n if (file_exists(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\" ) && $this->controllerName != 'error') {\n require(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\");\n \n } else {\n \n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n\n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\", $parents)) {\n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->action)) { \n return new $this->controllerClass($this->action, $this->urlValues);\n \n } else {\n //bad action/method error\n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badview\", $this->urlValues);\n }\n } else {\n $this->urlValues['controller'] = \"error\";\n //bad controller error\n echo \"hjh\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"b\", $this->urlValues);\n }\n } else {\n \n //bad controller error\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n }", "protected static function createController($name) {\n $result = null;\n\n $name = self::$_namespace . ($name ? $name : self::$defaultController) . 'Controller';\n if(class_exists($name)) {\n $controllerClass = new \\ReflectionClass($name);\n if($controllerClass->hasMethod('run')) {\n $result = new $name();\n }\n }\n\n return $result;\n }", "public function createController(): void\n {\n $minimum_buffer_min = 3;\n $token_ok = $this->routerService->ds_token_ok($minimum_buffer_min);\n if ($token_ok) {\n # 2. Call the worker method\n # More data validation would be a good idea here\n # Strip anything other than characters listed\n $results = $this->worker($this->args);\n\n if ($results) {\n # Redirect the user to the NDSE view\n # Don't use an iFrame!\n # State can be stored/recovered using the framework's session or a\n # query parameter on the returnUrl\n header('Location: ' . $results[\"redirect_url\"]);\n exit;\n }\n } else {\n $this->clientService->needToReAuth($this->eg);\n }\n }", "protected function createController($controllerClass)\n {\n $cls = new ReflectionClass($controllerClass);\n return $cls->newInstance($this->environment);\n }", "protected function createController($name)\n {\n $controllerClass = 'controller\\\\'.ucfirst($name).'Controller';\n\n if(!class_exists($controllerClass)) {\n throw new \\Exception('Controller class '.$controllerClass.' not exists!');\n }\n\n return new $controllerClass();\n }", "protected function initController() {\n\t\tif (!isset($_GET['controller'])) {\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$controllerClass = $_GET['controller'].\"Controller\";\n\t\tif (!class_exists($controllerClass)) {\n\t\t\t//Console::error(@$_GET['controller'].\" doesn't exist\");\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$this->controller = new $controllerClass();\n\t}", "public function makeTestController(TestController $controller)\r\n\t{\r\n\t}", "static function factory($GET=array(), $POST=array(), $FILES=array()) {\n $type = (isset($GET['type'])) ? $GET['type'] : '';\n $objectController = $type.'_Controller';\n $addLocation = $type.'/'.$objectController.'.php';\n foreach ($_ENV['locations'] as $location) {\n if (is_file($location.$addLocation)) {\n return new $objectController($GET, $POST, $FILES);\n } \n }\n throw new Exception('The controller \"'.$type.'\" does not exist.');\n }", "public function create()\n {\n $general = new ModeloController();\n\n return $general->create();\n }", "public function makeController($controllerNamespace, $controllerName, Log $log, $session, Request $request, Response $response)\r\n\t{\r\n\t\t$fullControllerName = '\\\\Application\\\\Controller\\\\' . (!empty($controllerNamespace) ? $controllerNamespace . '\\\\' : '') . $controllerName;\r\n\t\t$controller = new $fullControllerName();\r\n\t\t$controller->setConfig($this->config);\r\n\t\t$controller->setRequest($request);\r\n\t\t$controller->setResponse($response);\r\n\t\t$controller->setLog($log);\r\n\t\tif (isset($session))\r\n\t\t{\r\n\t\t\t$controller->setSession($session);\r\n\t\t}\r\n\r\n\t\t// Execute additional factory method, if available (exists in \\Application\\Controller\\Factory)\r\n\t\t$method = 'make' . $controllerName;\r\n\t\tif (is_callable(array($this, $method)))\r\n\t\t{\r\n\t\t\t$this->$method($controller);\r\n\t\t}\r\n\r\n\t\t// If the controller has an init() method, call it now\r\n\t\tif (is_callable(array($controller, 'init')))\r\n\t\t{\r\n\t\t\t$controller->init();\r\n\t\t}\r\n\r\n\t\treturn $controller;\r\n\t}", "public static function create()\n\t{\n\t\t//check, if an AccessGroupController instance already exists\n\t\tif(AccessGroupController::$accessGroupController == null)\n\t\t{\n\t\t\tAccessGroupController::$accessGroupController = new AccessGroupController();\n\t\t}\n\n\t\treturn AccessGroupController::$accessGroupController;\n\t}", "public static function buildController()\n\t{\n\t\t$file = CONTROLLER_PATH . 'indexController.class.php';\n\n\t\tif(!file_exists($file))\n\t\t{\n\t\t\tif(\\RCPHP\\Util\\Check::isClient())\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \"Welcome RcPHP!\\n\";\n }\n}';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \\'<style type=\"text/css\">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: \"微软雅黑\"; color: #333;} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px }</style><div style=\"padding: 24px 48px;\"> <h1>:)</h1><p>Welcome <b>RcPHP</b>!</p></div>\\';\n }\n}';\n\t\t\t}\n\t\t\tfile_put_contents($file, $controller);\n\t\t}\n\t}", "public function getController( );", "public static function getInstance() : Controller {\n if ( null === self::$instance ) {\n self::$instance = new self();\n self::$instance->options = new Options(\n self::OPTIONS_KEY\n );\n }\n\n return self::$instance;\n }", "static function appCreateController($entityName, $prefijo = '') {\n\n $controller = ControllerBuilder::getController($entityName, $prefijo);\n $entityFile = ucfirst(str_replace($prefijo, \"\", $entityName));\n $fileController = \"../../modules/{$entityFile}/{$entityFile}Controller.class.php\";\n\n $result = array();\n $ok = self::createArchive($fileController, $controller);\n ($ok) ? array_push($result, \"Ok, {$fileController} created\") : array_push($result, \"ERROR creating {$fileController}\");\n\n return $result;\n }", "public static function newInstance($path = \\simpleChat\\Utility\\ROOT_PATH)\n {\n $request = new Request();\n \n \n if ($request->isAjax())\n {\n return new AjaxController();\n }\n else if ($request->jsCode())\n {\n return new JsController();\n }\n else\n {\n return new StandardController($path);\n }\n }", "private function createInstance()\n {\n $objectManager = new \\Magento\\Framework\\TestFramework\\Unit\\Helper\\ObjectManager($this);\n $this->controller = $objectManager->getObject(\n \\Magento\\NegotiableQuote\\Controller\\Adminhtml\\Quote\\RemoveFailedSku::class,\n [\n 'context' => $this->context,\n 'logger' => $this->logger,\n 'messageManager' => $this->messageManager,\n 'cart' => $this->cart,\n 'resultRawFactory' => $this->resultRawFactory\n ]\n );\n }", "function loadController(){\n $name = ucfirst($this->request->controller).'Controller' ;\n $file = ROOT.DS.'Controller'.DS.$name.'.php' ;\n /*if(!file_exists($file)){\n $this->error(\"Le controleur \".$this->request->controller.\" n'existe pas\") ;\n }*/\n require_once $file;\n $controller = new $name($this->request);\n return $controller ;\n }", "public function __construct(){\r\n $app = Application::getInstance();\r\n $this->_controller = $app->getController();\r\n }", "public static function & instance()\n {\n if (self::$instance === null) {\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Include the Controller file\n require Router::$controller_path;\n\n try {\n // Start validation of the controller\n $class = new ReflectionClass(ucfirst(Router::$controller).'_Controller');\n } catch (ReflectionException $e) {\n // Controller does not exist\n Event::run('system.404');\n }\n\n if ($class->isAbstract() or (IN_PRODUCTION and $class->getConstant('ALLOW_PRODUCTION') == false)) {\n // Controller is not allowed to run in production\n Event::run('system.404');\n }\n\n // Run system.pre_controller\n Event::run('system.pre_controller');\n\n // Create a new controller instance\n $controller = $class->newInstance();\n\n // Controller constructor has been executed\n Event::run('system.post_controller_constructor');\n\n try {\n // Load the controller method\n $method = $class->getMethod(Router::$method);\n\n // Method exists\n if (Router::$method[0] === '_') {\n // Do not allow access to hidden methods\n Event::run('system.404');\n }\n\n if ($method->isProtected() or $method->isPrivate()) {\n // Do not attempt to invoke protected methods\n throw new ReflectionException('protected controller method');\n }\n\n // Default arguments\n $arguments = Router::$arguments;\n } catch (ReflectionException $e) {\n // Use __call instead\n $method = $class->getMethod('__call');\n\n // Use arguments in __call format\n $arguments = array(Router::$method, Router::$arguments);\n }\n\n // Stop the controller setup benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Start the controller execution benchmark\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_execution');\n\n // Execute the controller method\n $method->invokeArgs($controller, $arguments);\n\n // Controller method has been executed\n Event::run('system.post_controller');\n\n // Stop the controller execution benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_execution');\n }\n\n return self::$instance;\n }", "protected function instantiateController($class)\n {\n $controller = new $class();\n\n if ($controller instanceof Controller) {\n $controller->setContainer($this->container);\n }\n\n return $controller;\n }", "public function __construct (){\n $this->AdminController = new AdminController();\n $this->ArticleController = new ArticleController();\n $this->AuditoriaController = new AuditoriaController();\n $this->CommentController = new CommentController();\n $this->CourseController = new CourseController();\n $this->InscriptionsController = new InscriptionsController();\n $this->ModuleController = new ModuleController();\n $this->PlanController = new PlanController();\n $this->ProfileController = new ProfileController();\n $this->SpecialtyController = new SpecialtyController();\n $this->SubscriptionController = new SubscriptionController();\n $this->TeacherController = new TeacherController();\n $this->UserController = new UserController();\n $this->WebinarController = new WebinarController();\n }", "protected function makeController($prefix)\n {\n new MakeController($this, $this->files, $prefix);\n }", "public function createController($route)\n {\n $controller = parent::createController('gymv/' . $route);\n return $controller === false\n ? parent::createController($route)\n : $controller;\n }", "public static function createFrontController()\n {\n return self::createInjectorWithBindings(self::extractArgs(func_get_args()))\n ->getInstance('net::stubbles::websites::stubFrontController');\n }", "public static function controller($name)\n {\n $name = ucfirst(strtolower($name));\n \n $directory = 'controller';\n $filename = $name;\n $tracker = 'controller';\n $init = (boolean) $init;\n $namespace = 'controller';\n $class_name = $name;\n \n return self::_load($directory, $filename, $tracker, $init, $namespace, $class_name);\n }", "protected static function instantiateMockController()\n {\n /** @var Event $oEvent */\n $oEvent = Factory::service('Event');\n\n if (!$oEvent->hasBeenTriggered(Events::SYSTEM_STARTING)) {\n\n require_once BASEPATH . 'core/Controller.php';\n\n load_class('Output', 'core');\n load_class('Security', 'core');\n load_class('Input', 'core');\n load_class('Lang', 'core');\n\n new NailsMockController();\n }\n }", "private static function controller()\n {\n $files = ['Controller'];\n $folder = static::$root.'MVC'.'/';\n\n self::call($files, $folder);\n }", "public function createController()\n\t{\n\t\t$originalFile = app_path('Http/Controllers/Reports/SampleReport.php');\n\t\t$newFile = dirname($originalFile) . DIRECTORY_SEPARATOR . $this->class . $this->sufix . '.php';\n\n\t\t// Read original file\n\t\tif( ! $content = file_get_contents($originalFile))\n\t\t\treturn false;\n\n\t\t// Replace class name\n\t\t$content = str_replace('SampleReport', $this->class . $this->sufix, $content);\n\n\t\t// Write new file\n\t\treturn (bool) file_put_contents($newFile, $content);\n\t}", "public function runController() {\n // Check for a router\n if (is_null($this->getRouter())) {\n \t // Set the method to load\n \t $sController = ucwords(\"{$this->getController()}Controller\");\n } else {\n\n // Set the controller with the router\n $sController = ucwords(\"{$this->getController()}\".ucfirst($this->getRouter()).\"Controller\");\n }\n \t// Check for class\n \tif (class_exists($sController, true)) {\n \t\t// Set a new instance of Page\n \t\t$this->setPage(new Page());\n \t\t// The class exists, load it\n \t\t$oController = new $sController();\n\t\t\t\t// Now check for the proper method \n\t\t\t\t// inside of the controller class\n\t\t\t\tif (method_exists($oController, $this->loadConfigVar('systemSettings', 'controllerLoadMethod'))) {\n\t\t\t\t\t// We have a valid controller, \n\t\t\t\t\t// execute the initializer\n\t\t\t\t\t$oController->init($this);\n\t\t\t\t\t// Set the variable scope\n\t \t\t$this->setViewScope($oController);\n\t \t\t// Render the layout\n\t \t\t$this->renderLayout();\n\t\t\t\t} else {\n\t\t\t\t\t// The initializer does not exist, \n\t\t\t\t\t// which means an invalid controller, \n\t\t\t\t\t// so now we let the caller know\n\t\t\t\t\t$this->setError($this->loadConfigVar('errorMessages', 'invalidController'));\n\t\t\t\t\t// Run the error\n\t\t\t\t\t// $this->runError();\n\t\t\t\t}\n \t// The class does not exist\n \t} else {\n\t\t\t\t// Set the system error\n\t \t\t$this->setError(\n\t\t\t\t\tstr_replace(\n\t\t\t\t\t\t':controllerName', \n\t\t\t\t\t\t$sController, \n\t\t\t\t\t\t$this->loadConfigVar(\n\t\t\t\t\t\t\t'errorMessages', \n\t\t\t\t\t\t\t'controllerDoesNotExist'\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n \t\t// Run the error\n\t\t\t\t// $this->runError();\n \t}\n \t// Return instance\n \treturn $this;\n }", "public function controller()\n\t{\n\t\n\t}", "protected function buildController()\n {\n $columns = collect($this->columns)->pluck('column')->implode('|');\n\n $permissions = [\n 'create:'.$this->module->createPermission->name,\n 'edit:'.$this->module->editPermission->name,\n 'delete:'.$this->module->deletePermission->name,\n ];\n\n $this->controller = [\n 'name' => $this->class,\n '--model' => $this->class,\n '--request' => $this->class.'Request',\n '--permissions' => implode('|', $permissions),\n '--view-folder' => snake_case($this->module->name),\n '--fields' => $columns,\n '--module' => $this->module->id,\n ];\n }", "function getController(){\n\treturn getFactory()->getBean( 'Controller' );\n}", "protected function getController()\n {\n $uri = WingedLib::clearPath(static::$parentUri);\n if (!$uri) {\n $uri = './';\n $explodedUri = ['index', 'index'];\n } else {\n $explodedUri = explode('/', $uri);\n if (count($explodedUri) == 1) {\n $uri = './' . $explodedUri[0] . '/';\n } else {\n $uri = './' . $explodedUri[0] . '/' . $explodedUri[1] . '/';\n }\n }\n\n $indexUri = WingedLib::clearPath(\\WingedConfig::$config->INDEX_ALIAS_URI);\n if ($indexUri) {\n $indexUri = explode('/', $indexUri);\n }\n\n if ($indexUri) {\n if ($explodedUri[0] === 'index' && isset($indexUri[0])) {\n static::$controllerName = Formater::camelCaseClass($indexUri[0]) . 'Controller';\n $uri = './' . $indexUri[0] . '/';\n }\n if (isset($explodedUri[1]) && isset($indexUri[1])) {\n if ($explodedUri[1] === 'index') {\n static::$controllerAction = 'action' . Formater::camelCaseMethod($indexUri[1]);\n $uri .= $indexUri[1] . '/';\n }\n } else {\n $uri .= 'index/';\n }\n }\n\n $controllerDirectory = new Directory(static::$parent . 'controllers/', false);\n if ($controllerDirectory->exists()) {\n $controllerFile = new File($controllerDirectory->folder . static::$controllerName . '.php', false);\n if ($controllerFile->exists()) {\n include_once $controllerFile->file_path;\n if (class_exists(static::$controllerName)) {\n $controller = new static::$controllerName();\n if (method_exists($controller, static::$controllerAction)) {\n try {\n $reflectionMethod = new \\ReflectionMethod(static::$controllerName, static::$controllerAction);\n $pararms = [];\n foreach ($reflectionMethod->getParameters() as $parameter) {\n $pararms[$parameter->getName()] = $parameter->isOptional();\n }\n } catch (\\Exception $exception) {\n $pararms = [];\n }\n return [\n 'uri' => $uri,\n 'params' => $pararms,\n ];\n }\n }\n }\n }\n return false;\n }", "public function __construct()\n {\n $this->controller = new DHTController();\n }", "public function createController($controllers) {\n\t\tforeach($controllers as $module=>$controllers) {\n\t\t\tforeach($controllers as $key=>$controller) {\n\t\t\t\tif(!file_exists(APPLICATION_PATH.\"/modules/$module/controllers/\".ucfirst($controller).\"Controller.php\")) {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",\"Create '\".ucfirst($controller).\"' controller in $module\");\t\t\t\t\n\t\t\t\t\texec(\"zf create controller $controller index-action-included=0 $module\");\t\t\t\t\t\n\t\t\t\t}\telse {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",ucfirst($controller).\"' controller in $module already exists\");\t\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t}", "protected function instantiateController($class)\n {\n return new $class($this->routesMaker);\n }", "private function createController($table){\n\n // Filtering file name\n $fileName = $this::cleanToName($table[\"name\"]) . 'Controller.php';\n\n // Prepare the Class scheme inside the controller\n $contents = '<?php '.$fileName.' ?>';\n\n\n // Return a boolean to process completed\n return Storage::disk('controllers')->put($this->appNamePath.'/'.$fileName, $contents);\n\n }", "public function GetController()\n\t{\n\t\t$params = $this->QueryVarArrayToParameterArray($_GET);\n\t\tif (!empty($_POST)) {\n\t\t\t$params = array_merge($params, $this->QueryVarArrayToParameterArray($_POST));\n\t\t}\n\n\t\tif (!empty($_GET['q'])) {\n\t\t\t$restparams = GitPHP_Router::ReadCleanUrl($_SERVER['REQUEST_URI']);\n\t\t\tif (count($restparams) > 0)\n\t\t\t\t$params = array_merge($params, $restparams);\n\t\t}\n\n\t\t$controller = null;\n\n\t\t$action = null;\n\t\tif (!empty($params['action']))\n\t\t\t$action = $params['action'];\n\n\t\tswitch ($action) {\n\n\n\t\t\tcase 'search':\n\t\t\t\t$controller = new GitPHP_Controller_Search();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commitdiff':\n\t\t\tcase 'commitdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Commitdiff();\n\t\t\t\tif ($action === 'commitdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blobdiff':\n\t\t\tcase 'blobdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Blobdiff();\n\t\t\t\tif ($action === 'blobdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'history':\n\t\t\t\t$controller = new GitPHP_Controller_History();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'shortlog':\n\t\t\tcase 'log':\n\t\t\t\t$controller = new GitPHP_Controller_Log();\n\t\t\t\tif ($action === 'shortlog')\n\t\t\t\t\t$controller->SetParam('short', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'snapshot':\n\t\t\t\t$controller = new GitPHP_Controller_Snapshot();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tree':\n\t\t\tcase 'trees':\n\t\t\t\t$controller = new GitPHP_Controller_Tree();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tags':\n\t\t\t\tif (empty($params['tag'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Tags();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tcase 'tag':\n\t\t\t\t$controller = new GitPHP_Controller_Tag();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'heads':\n\t\t\t\t$controller = new GitPHP_Controller_Heads();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blame':\n\t\t\t\t$controller = new GitPHP_Controller_Blame();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blob':\n\t\t\tcase 'blobs':\n\t\t\tcase 'blob_plain':\t\n\t\t\t\t$controller = new GitPHP_Controller_Blob();\n\t\t\t\tif ($action === 'blob_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'atom':\n\t\t\tcase 'rss':\n\t\t\t\t$controller = new GitPHP_Controller_Feed();\n\t\t\t\tif ($action == 'rss')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::RssFormat);\n\t\t\t\telse if ($action == 'atom')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::AtomFormat);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commit':\n\t\t\tcase 'commits':\n\t\t\t\t$controller = new GitPHP_Controller_Commit();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'summary':\n\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'project_index':\n\t\t\tcase 'projectindex':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('txt', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'opml':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('opml', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'login':\n\t\t\t\t$controller = new GitPHP_Controller_Login();\n\t\t\t\tif (!empty($_POST['username']))\n\t\t\t\t\t$controller->SetParam('username', $_POST['username']);\n\t\t\t\tif (!empty($_POST['password']))\n\t\t\t\t\t$controller->SetParam('password', $_POST['password']);\n\t\t\t\tbreak;\n\n\t\t\tcase 'logout':\n\t\t\t\t$controller = new GitPHP_Controller_Logout();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'graph':\n\t\t\tcase 'graphs':\n\t\t\t\t//$controller = new GitPHP_Controller_Graph();\n\t\t\t\t//break;\n\t\t\tcase 'graphdata':\n\t\t\t\t//$controller = new GitPHP_Controller_GraphData();\n\t\t\t\t//break;\n\t\t\tdefault:\n\t\t\t\tif (!empty($params['project'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\t} else {\n\t\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t}\n\t\t}\n\n\t\tforeach ($params as $paramname => $paramval) {\n\t\t\tif ($paramname !== 'action')\n\t\t\t\t$controller->SetParam($paramname, $paramval);\n\t\t}\n\n\t\t$controller->SetRouter($this);\n\n\t\treturn $controller;\n\t}", "public function testCreateTheControllerClass()\n {\n $controller = new Game21Controller();\n $this->assertInstanceOf(\"\\App\\Http\\Controllers\\Game21Controller\", $controller);\n }", "public static function createController( MShop_Context_Item_Interface $context, $name = null );", "public function __construct()\n {\n\n $url = $this->splitURL();\n // echo $url[0];\n\n // check class file exists\n if (file_exists(\"../app/controllers/\" . strtolower($url[0]) . \".php\")) {\n $this->controller = strtolower($url[0]);\n unset($url[0]);\n }\n\n // echo $this->controller;\n\n require \"../app/controllers/\" . $this->controller . \".php\";\n\n // create Instance(object)\n $this->controller = new $this->controller(); // $this->controller is an object from now on\n if (isset($url[1])) {\n if (method_exists($this->controller, $url[1])) {\n $this->method = $url[1];\n unset($url[1]);\n }\n }\n\n // run the class and method\n $this->params = array_values($url); // array_values 값들인 인자 0 부터 다시 배치\n call_user_func_array([$this->controller, $this->method], $this->params);\n }", "public function getController();", "public function getController();", "public function getController();", "public function createController($pageType, $template)\n {\n $controller = null;\n\n // Use factories first\n if (isset($this->controllerFactories[$pageType])) {\n $callable = $this->controllerFactories[$pageType];\n $controller = $callable($this, 'templates/'.$template);\n\n if ($controller) {\n return $controller;\n }\n }\n\n // See if a default controller exists in the theme namespace\n $class = null;\n if ($pageType == 'posts') {\n $class = $this->namespace.'\\\\Controllers\\\\PostsController';\n } elseif ($pageType == 'post') {\n $class = $this->namespace.'\\\\Controllers\\\\PostController';\n } elseif ($pageType == 'page') {\n $class = $this->namespace.'\\\\Controllers\\\\PageController';\n } elseif ($pageType == 'term') {\n $class = $this->namespace.'\\\\Controllers\\\\TermController';\n }\n\n if (class_exists($class)) {\n $controller = new $class($this, 'templates/'.$template);\n\n return $controller;\n }\n\n // Create a default controller from the stem namespace\n if ($pageType == 'posts') {\n $controller = new PostsController($this, 'templates/'.$template);\n } elseif ($pageType == 'post') {\n $controller = new PostController($this, 'templates/'.$template);\n } elseif ($pageType == 'page') {\n $controller = new PageController($this, 'templates/'.$template);\n } elseif ($pageType == 'search') {\n $controller = new SearchController($this, 'templates/'.$template);\n } elseif ($pageType == 'term') {\n $controller = new TermController($this, 'templates/'.$template);\n }\n\n return $controller;\n }", "private function loadController($controller)\r\n {\r\n $className = $controller.'Controller';\r\n \r\n $class = new $className($this);\r\n \r\n $class->init();\r\n \r\n return $class;\r\n }", "public static function newInstance ($class)\n {\n try\n {\n // the class exists\n $object = new $class();\n\n if (!($object instanceof sfController))\n {\n // the class name is of the wrong type\n $error = 'Class \"%s\" is not of the type sfController';\n $error = sprintf($error, $class);\n\n throw new sfFactoryException($error);\n }\n\n return $object;\n }\n catch (sfException $e)\n {\n $e->printStackTrace();\n }\n }", "public function create()\n {\n //TODO frontEndDeveloper \n //load admin.classes.create view\n\n\n return view('admin.classes.create');\n }", "private function generateControllerClass()\n {\n $dir = $this->bundle->getPath();\n\n $parts = explode('\\\\', $this->entity);\n $entityClass = array_pop($parts);\n $entityNamespace = implode('\\\\', $parts);\n\n $target = sprintf(\n '%s/Controller/%s/%sController.php',\n $dir,\n str_replace('\\\\', '/', $entityNamespace),\n $entityClass\n );\n\n if (file_exists($target)) {\n throw new \\RuntimeException('Unable to generate the controller as it already exists.');\n }\n\n $this->renderFile($this->skeletonDir, 'controller.php', $target, array(\n 'actions' => $this->actions,\n 'route_prefix' => $this->routePrefix,\n 'route_name_prefix' => $this->routeNamePrefix,\n 'dir' => $this->skeletonDir,\n 'bundle' => $this->bundle->getName(),\n 'entity' => $this->entity,\n 'entity_class' => $entityClass,\n 'namespace' => $this->bundle->getNamespace(),\n 'entity_namespace' => $entityNamespace,\n 'format' => $this->format,\n ));\n }", "static public function Instance()\t\t// Static so we use classname itself to create object i.e. Controller::Instance()\r\n {\r\n // Only one object of this class is required\r\n // so we only create if it hasn't already\r\n // been created.\r\n if(!isset(self::$_instance))\r\n {\r\n self::$_instance = new self();\t// Make new instance of the Controler class\r\n self::$_instance->_commandResolver = new CommandResolver();\r\n\r\n ApplicationController::LoadViewMap();\r\n }\r\n return self::$_instance;\r\n }", "private function create_mock_controller() {\n eval('class TestController extends cyclone\\request\\SkeletonController {\n function before() {\n DispatcherTest::$beforeCalled = TRUE;\n DispatcherTest::$route = $this->_request->route;\n }\n\n function after() {\n DispatcherTest::$afterCalled = TRUE;\n }\n\n function action_act() {\n DispatcherTest::$actionCalled = TRUE;\n }\n}');\n }", "public function AController() {\r\n\t}", "protected function initializeController() {}", "public function dispatch()\n { \n $controller = $this->formatController();\n $controller = new $controller($this);\n if (!$controller instanceof ControllerAbstract) {\n throw new Exception(\n 'Class ' . get_class($controller) . ' is not a valid controller instance. Controller classes must '\n . 'derive from \\Europa\\ControllerAbstract.'\n );\n }\n $controller->action();\n return $controller;\n }", "public function controller()\n {\n $method = $_SERVER['REQUEST_METHOD'];\n if ($method == 'GET') {\n $this->getController();\n };\n if ($method == 'POST') {\n check_csrf();\n $this->createController();\n };\n }", "private function addController($controller)\n {\n $object = new $controller($this->app);\n $this->controllers[$controller] = $object;\n }", "function Controller($ControllerName = Web\\Application\\DefaultController) {\n return Application()->Controller($ControllerName);\n }", "public function getController($controllerName) {\r\n\t\tif(!isset(self::$instances[$controllerName])) {\r\n\t\t $package = $this->getPackage(Nomenclature::getVendorAndPackage($controllerName));\r\n\t\t if(!$package) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t return $controller;\r\n\t\t //return false;\r\n\t\t }\r\n\r\n\t\t if(!$package || !$package->controllerExists($controllerName)) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t $package->addController($controller);\r\n\t\t } else {\r\n\t\t $controller = $package->getController($controllerName);\r\n\t\t }\r\n\t\t} else {\r\n\t\t $controller = self::$instances[$controllerName];\r\n\t\t}\r\n\t\treturn $controller;\r\n\t}", "public function testInstantiateSessionController()\n {\n $controller = new SessionController();\n\n $this->assertInstanceOf(\"App\\Http\\Controllers\\SessionController\", $controller);\n }", "private static function loadController($str) {\n\t\t$str = self::formatAsController($str);\n\t\t$app_controller = file_exists(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t$lib_controller = file_exists(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\n\t\tif ( $app_controller || $lib_controller ) {\n\t\t\tif ($app_controller) {\n\t\t\t\trequire_once(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\t\telse {\n\t\t\t\trequire_once(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\n\t\t\t$controller = new $str();\n\t\t\t\n\t\t\tif (!$controller instanceof Controller) {\n\t\t\t\tthrow new IsNotControllerException();\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn $controller;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthrow new ControllerNotExistsException($str);\n\t\t}\n\t}", "public function __construct()\n {\n // and $url[1] is a controller method\n if ($_GET['url'] == NULL) {\n $url = explode('/', env('defaultRoute'));\n } else {\n $url = explode('/', rtrim($_GET['url'],'/'));\n }\n\n $file = 'controllers/' . $url[0] . '.php';\n if (file_exists($file)) {\n require $file;\n $controller = new $url[0];\n\n if (isset($url[1])) {\n $controller->{$url[1]}();\n }\n } else {\n echo \"404 not found\";\n }\n }", "protected function _controllers()\n {\n $this['watchController'] = $this->factory(static function ($c) {\n return new Controller\\WatchController($c['app'], $c['searcher']);\n });\n\n $this['runController'] = $this->factory(static function ($c) {\n return new Controller\\RunController($c['app'], $c['searcher']);\n });\n\n $this['customController'] = $this->factory(static function ($c) {\n return new Controller\\CustomController($c['app'], $c['searcher']);\n });\n\n $this['waterfallController'] = $this->factory(static function ($c) {\n return new Controller\\WaterfallController($c['app'], $c['searcher']);\n });\n\n $this['importController'] = $this->factory(static function ($c) {\n return new Controller\\ImportController($c['app'], $c['saver'], $c['config']['upload.token']);\n });\n\n $this['metricsController'] = $this->factory(static function ($c) {\n return new Controller\\MetricsController($c['app'], $c['searcher']);\n });\n }", "public function __construct() {\r\n $this->controllerLogin = new ControllerLogin();\r\n $this->controllerGame = new ControllerGame();\r\n $this->controllerRegister = new ControllerRegister();\r\n }", "public function controller ($post = array())\n\t{\n\n\t\t$name = $post['controller_name'];\n\n\t\tif (is_file(APPPATH.'controllers/'.$name.'.php')) {\n\n\t\t\t$message = sprintf(lang('Controller_s_is_existed'), APPPATH.'controllers/'.$name.'.php');\n\n\t\t\t$this->msg[] = $message;\n\n\t\t\treturn $this->result(false, $this->msg[0]);\n\n\t\t}\n\n\t\t$extends = null;\n\n\t\tif (isset($post['crud'])) {\n\n\t\t\t$crud = true;\n\t\t\t\n\t\t}\n\t\telse{\n\n\t\t\t$crud = false;\n\n\t\t}\n\n\t\t$file = $this->_create_folders_from_name($name, 'controllers');\n\n\t\t$data = '';\n\n\t\t$data .= $this->_class_open($file['file'], __METHOD__, $extends);\n\n\t\t$crud === FALSE || $data .= $this->_crud_methods_contraller($post);\n\n\t\t$data .= $this->_class_close();\n\n\t\t$path = APPPATH . 'controllers/' . $file['path'] . strtolower($file['file']) . '.php';\n\n\t\twrite_file($path, $data);\n\n\t\t$this->msg[] = sprintf(lang('Created_controller_s'), $path);\n\n\t\t//echo $this->_messages();\n\t\treturn $this->result(true, $this->msg[0]);\n\n\t}", "protected function getController(Request $request) {\n try {\n $controller = $this->objectFactory->create($request->getControllerName(), self::INTERFACE_CONTROLLER);\n } catch (ZiboException $exception) {\n throw new ZiboException('Could not create controller ' . $request->getControllerName(), 0, $exception);\n }\n\n return $controller;\n }", "public function create() {}", "public function __construct()\n {\n $this->dataController = new DataController;\n }", "function __contrruct(){ //construdor do controller, nele é possivel carregar as librari, helpers, models que serão utilizados nesse controller\n\t\tparent::__contrruct();//Chamando o construtor da classe pai\n\t}", "public function __construct() {\n\n // Get the URL elements.\n $url = $this->_parseUrl();\n\n // Checks if the first URL element is set / not empty, and replaces the\n // default controller class string if the given class exists.\n if (isset($url[0]) and ! empty($url[0])) {\n $controllerClass = CONTROLLER_PATH . ucfirst(strtolower($url[0]));\n unset($url[0]);\n if (class_exists($controllerClass)) {\n $this->_controllerClass = $controllerClass;\n }\n }\n\n // Replace the controller class string with a new instance of the it.\n $this->_controllerClass = new $this->_controllerClass;\n\n // Checks if the second URL element is set / not empty, and replaces the\n // default controller action string if the given action is a valid class\n // method.\n if (isset($url[1]) and ! empty($url[1])) {\n if (method_exists($this->_controllerClass, $url[1])) {\n $this->_controllerAction = $url[1];\n unset($url[1]);\n }\n }\n\n // Check if the URL has any remaining elements, setting the controller\n // parameters as a rebase of it if true or an empty array if false.\n $this->_controllerParams = $url ? array_values($url) : [];\n\n // Call the controller and action with parameters.\n call_user_func_array([$this->_controllerClass, $this->_controllerAction], $this->_controllerParams);\n }", "private function setUpController()\n {\n $this->controller = new TestObject(new SharedControllerTestController);\n\n $this->controller->dbal = DBAL::getDBAL('testDB', $this->getDBH());\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }" ]
[ "0.82668066", "0.8173394", "0.78115296", "0.77052677", "0.7681875", "0.7659338", "0.74860525", "0.74064577", "0.7297601", "0.7252339", "0.7195181", "0.7174191", "0.70150065", "0.6989306", "0.69835985", "0.69732994", "0.6963521", "0.6935819", "0.68973273", "0.68920785", "0.6877748", "0.68702674", "0.68622285", "0.6839049", "0.6779292", "0.6703522", "0.66688496", "0.66600126", "0.6650373", "0.66436416", "0.6615505", "0.66144013", "0.6588728", "0.64483404", "0.64439476", "0.6429303", "0.6426485", "0.6303757", "0.6298291", "0.6293319", "0.62811387", "0.6258778", "0.62542456", "0.616827", "0.6162314", "0.61610043", "0.6139887", "0.613725", "0.61334985", "0.6132223", "0.6128982", "0.61092585", "0.6094611", "0.60889256", "0.6074893", "0.60660255", "0.6059098", "0.60565156", "0.6044235", "0.60288006", "0.6024102", "0.60225666", "0.6018304", "0.60134345", "0.60124683", "0.6010913", "0.6009284", "0.6001683", "0.5997471", "0.5997012", "0.59942573", "0.5985074", "0.5985074", "0.5985074", "0.5967613", "0.5952533", "0.5949068", "0.5942203", "0.5925731", "0.5914304", "0.5914013", "0.59119135", "0.5910308", "0.5910285", "0.59013796", "0.59003943", "0.5897524", "0.58964556", "0.58952993", "0.58918965", "0.5888943", "0.5875413", "0.5869938", "0.58627135", "0.58594996", "0.5853714", "0.5839484", "0.5832913", "0.582425", "0.58161044", "0.5815566" ]
0.0
-1
Display a listing of the resource.
public function index() { $eventos = evento::paginate(5); return view('system-mgmt/evento/index', ['eventos' => $eventos]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { return view('system-mgmt/evento/create'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { $this->validateInput($request); evento::create([ 'name' => $request['name'], 'infoEv' => $request['infoEv'], 'fechaEv' => $request['fechaEv'], 'fechaFEv' => $request['fechaFEv'] ]); return redirect()->intended('system-management/evento'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { $evento = evento::find($id); // Redirect to evento list if updating evento wasn't existed if ($evento == null || count($evento) == 0) { return redirect()->intended('/system-management/evento'); } return view('system-mgmt/evento/edit', ['evento' => $evento]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { $evento = evento::findOrFail($id); $this->validateInput($request); $input = [ 'name' => $request['name'], 'fechaEv' => $request['fechaEv'] ]; evento::where('id', $id) ->update($input); return redirect()->intended('system-management/evento'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { evento::where('id', $id)->delete(); return redirect()->intended('system-management/evento'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Search evento from database base on some specific constraints
public function search(Request $request) { $constraints = [ 'name' => $request['name'] ]; $eventos = $this->doSearchingQuery($constraints); return view('system-mgmt/evento/index', ['eventos' => $eventos, 'searchingVals' => $constraints]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function selectEventSpecific($name, $start, $end)\n{\n require_once(\"model/database.php\");\n $query = \"SELECT * FROM events WHERE name LIKE :name AND start LIKE :start AND end LIKE :end LIMIT 1\";\n return executeQuerySelect($query, createBinds([[\":name\", $name], [\":start\", $start], [\":end\", $end]]))[0] ?? null;\n}", "public function search($category)\n {\n // but if the criteria title is specified, we use it\n \n $boolQuery = new \\Elastica\\Query\\Bool();\n /*Fetch only VALIDATED place*/\n $queryStatus = new \\Elastica\\Query\\Match();\n $queryStatus->setFieldQuery('event.status', StatusType::VALIDATED);\n $boolQuery->addMust($queryStatus);\n \n if($category !== null){\n $queryCategory = new \\Elastica\\Query\\Match();\n $queryCategory->setFieldQuery('event.categories.slug', $category);\n $boolQuery->addMust($queryCategory);\n } \n \n// if($placeSearch->getBirthdayDiscount() != null && $placeSearch->getBirthdayDiscount() > 0 ){\n// $queryRange = new \\Elastica\\Query\\Range();\n// $queryRange->setParam('place.birthdayDiscount', ['gte' => 1]);\n// $boolQuery->addMust($queryRange);\n// }\n// \n// if(($placeSearch->getName() != null || $placeSearch->getCategories() != null ) && $placeSearch != null){\n// \n// if($placeSearch->getName() != null){\n// $query = new \\Elastica\\Query\\Match();\n// $query->setFieldQuery('place.name', $placeSearch->getName());\n// $query->setFieldFuzziness('place.name', 1);\n// $query->setFieldMinimumShouldMatch('place.name', '10%');\n// $boolQuery->addMust($query);\n// }\n// \n// if($placeSearch->getCategories() != null){ \n// foreach ($placeSearch->getCategories() as $cat){ \n// $categories[] = $cat->getName(); \n// }\n// $queryCategories = new \\Elastica\\Query\\Terms();\n// $queryCategories->setTerms('place.categories', $categories);\n// $boolQuery->addShould($queryCategories);\n// }\n// \n //} \n else {\n $query = new \\Elastica\\Query\\MatchAll();\n }\n $baseQuery = $boolQuery; \n\n // then we create filters depending on the chosen criterias\n $boolFilter = new \\Elastica\\Filter\\Bool();\n\n /*\n Dates filter\n We add this filter only the getIspublished filter is not at \"false\"\n */\n// if(\"false\" != $articleSearch->getIsPublished()\n// && null !== $articleSearch->getDateFrom()\n// && null !== $articleSearch->getDateTo())\n// {\n// $boolFilter->addMust(new \\Elastica\\Filter\\Range('publishedAt',\n// array(\n// 'gte' => \\Elastica\\Util::convertDate($articleSearch->getDateFrom()->getTimestamp()),\n// 'lte' => \\Elastica\\Util::convertDate($articleSearch->getDateTo()->getTimestamp())\n// )\n// ));\n// }\n//\n // Published or not filter\n// if($placeSearch->getIs24h() !== null && $placeSearch->getIs24h()){\n// //var_dump($placeSearch->getIs24h());die();\n// $boolFilter->addMust(\n// new \\Elastica\\Filter\\Term(['is24h' => $placeSearch->getIs24h()])\n// //new \\Elastica\\Filter\\Term(['isWifi' => $placeSearch->getIsWifi()]) \n// ); \n// \n// //$boolFilter->addMust('is24h', $placeSearch->getIs24h());\n// }\n// \n// if($placeSearch->getIsWifi() !== null && $placeSearch->getIsWifi()){\n// $boolFilter->addMust( \n// new \\Elastica\\Filter\\Term(['isWifi' => $placeSearch->getIsWifi()]) \n// );\n// }\n// \n// if($placeSearch->getIsDelivery() !== null && $placeSearch->getIsDelivery()){\n// $boolFilter->addMust( \n// new \\Elastica\\Filter\\Term(['isDelivery' => $placeSearch->getIsDelivery()]) \n// );\n// } \n\n $filtered = new \\Elastica\\Query\\Filtered($baseQuery, $boolFilter);\n\n $query = \\Elastica\\Query::create($filtered);\n\n return $this->find($query);\n }", "public function searchWithCriteria(){\n\n\n //change default message for required rule\n $this->unsetSessionData();\n $this->setSessionData();\n\n\n if(isset($_SESSION['searchKeyword']) && isset($_SESSION['timecon'])){\n $this->searchByLocationAndDay();\n }else if(isset($_SESSION['searchKeyword']) && isset($_SESSION['timecon'])==FALSE){\n $this->searchByLocation();\n }else if(isset($_SESSION['searchKeyword'])==FALSE && isset($_SESSION['timecon'])){\n $this->searchByCalendar();\n }\n }", "public function index(Request $request){\n \n $event = Event::with(['get_users','get_venue'])->when($request->keyword, function ($query) use ($request) {\n $query->where('nama_event', 'like', \"%{$request->keyword}%\");\n })->get();\n return view('admin.event.dataEvent',compact('event'));\n }", "function theme_intranet_haarlem_search_events($options = array()){\n\t$defaults = array(\t'past_events' \t\t=> false,\n\t\t\t\t\t\t'count' \t\t\t=> false,\n\t\t\t\t\t\t'offset' \t\t\t=> 0,\n\t\t\t\t\t\t'limit'\t\t\t\t=> EVENT_MANAGER_SEARCH_LIST_LIMIT,\n\t\t\t\t\t\t'container_guid'\t=> null,\n\t\t\t\t\t\t'query'\t\t\t\t=> false,\n\t\t\t\t\t\t'meattending'\t\t=> false,\n\t\t\t\t\t\t'owning'\t\t\t=> false,\n\t\t\t\t\t\t'friendsattending' \t=> false,\n\t\t\t\t\t\t'region'\t\t\t=> null,\n\t\t\t\t\t\t'latitude'\t\t\t=> null,\n\t\t\t\t\t\t'longitude'\t\t\t=> null,\n\t\t\t\t\t\t'distance'\t\t\t=> null,\n\t\t\t\t\t\t'event_type'\t\t=> false,\n\t\t\t\t\t\t'past_events'\t\t=> false,\n\t\t\t\t\t\t'search_type'\t\t=> \"list\"\n\t\t\t\t\t\t\n\t);\n\t\n\t$options = array_merge($defaults, $options);\n\t\n\t$entities_options = array(\n\t\t'type' \t\t\t=> 'object',\n\t\t'subtype' \t\t=> 'event',\n\t\t'offset' \t\t=> $options['offset'],\n\t\t'limit' \t\t=> $options['limit'],\n\t\t'joins' => array(),\n\t\t'wheres' => array(),\n\t\t'order_by_metadata' => array(\"name\" => 'start_day', \"direction\" => 'ASC', \"as\" => \"integer\")\n\t);\n\t\n\tif (isset($options['entities_options'])) {\n\t\t$entities_options = array_merge($entities_options, $options['entities_options']);\n\t}\n\t\n\tif($options[\"container_guid\"]){\n\t\t// limit for a group\n\t\t$entities_options['container_guid'] = $options['container_guid'];\n\t}\n\t\n\tif($options['query']) {\n\t\t$entities_options[\"joins\"][] = \"JOIN \" . elgg_get_config(\"dbprefix\") . \"objects_entity oe ON e.guid = oe.guid\";\n\t\t$entities_options['wheres'][] = event_manager_search_get_where_sql('oe', array('title', 'description'), $options, false);\n\t}\n\t\t\t\t\n\tif(!empty($options['start_day'])) {\n\t\t$entities_options['metadata_name_value_pairs'][] = array('name' => 'start_day', 'value' => $options['start_day'], 'operand' => '>=');\n\t}\n\t\n\tif(!empty($options['end_day'])) {\n\t\t$entities_options['metadata_name_value_pairs'][] = array('name' => 'start_day', 'value' => $options['end_day'], 'operand' => '<=');\n\t}\n\t\n\tif(!$options['past_events']) {\n\t\t// only show from current day or newer\n\t\t$entities_options['metadata_name_value_pairs'][] = array('name' => 'start_day', 'value' => mktime(0, 0, 1), 'operand' => '>=');\n\t}\n\t\n\tif($options['meattending']) {\n\t\t$entities_options['joins'][] = \"JOIN \" . elgg_get_config(\"dbprefix\") . \"entity_relationships e_r ON e.guid = e_r.guid_one\";\n\t\t\n\t\t$entities_options['wheres'][] = \"e_r.guid_two = \" . elgg_get_logged_in_user_guid();\n\t\t$entities_options['wheres'][] = \"e_r.relationship = '\" . EVENT_MANAGER_RELATION_ATTENDING . \"'\";\n\t}\n\t\n\tif($options['owning']) {\n\t\t$entities_options['owner_guids'] = array(elgg_get_logged_in_user_guid());\n\t}\n\t\n\tif($options[\"region\"]){\n\t\t$entities_options['metadata_name_value_pairs'][] = array('name' => 'region', 'value' => $options[\"region\"]);\n\t}\n\t\n\tif($options[\"event_type\"]){\n\t\t$entities_options['metadata_name_value_pairs'][] = array('name' => 'event_type', 'value' => $options[\"event_type\"]);\n\t}\n\t\n\tif($options['friendsattending']){\n\t\t$friends_guids = array();\n\t\t\n\t\tif($friends = elgg_get_logged_in_user_entity()->getFriends(\"\", false)) {\n\t\t\tforeach($friends as $user) {\n\t\t\t\t$friends_guids[] = $user->getGUID();\n\t\t\t}\n\t\t\t$entities_options['joins'][] = \"JOIN \" . elgg_get_config(\"dbprefix\") . \"entity_relationships e_ra ON e.guid = e_ra.guid_one\";\n\t\t\t$entities_options['wheres'][] = \"(e_ra.guid_two IN (\" . implode(\", \", $friends_guids) . \"))\";\n\t\t} else\t{\n\t\t\t// return no result\n\t\t\t$entities_options['joins'] = array();\n\t\t\t$entities_options['wheres'] = array(\"(1=0)\");\n\t\t}\n\t}\n\t\n\tif(($options[\"search_type\"] == \"onthemap\") && !empty($options['latitude']) && !empty($options['longitude']) && !empty($options['distance'])){\n\t\t$entities_options[\"latitude\"] = $options['latitude'];\n\t\t$entities_options[\"longitude\"] = $options['longitude'];\n\t\t$entities_options[\"distance\"] = $options['distance'];\n\t\t$entities = elgg_get_entities_from_location($entities_options);\n\t\t\t\n\t\t$entities_options['count'] = true;\n\t\t$count_entities = elgg_get_entities_from_location($entities_options);\n\t\t\n\t} else {\n\t\t\n\t\t$entities = elgg_get_entities_from_metadata($entities_options);\n\t\t\n\t\t$entities_options['count'] = true;\n\t\t$count_entities = elgg_get_entities_from_metadata($entities_options);\n\t}\n\t\n\t$result = array(\n\t\t\"entities\" \t=> $entities,\n\t\t\"count\" \t=> $count_entities\n\t\t);\n\t\t\n\treturn $result;\n}", "public function getSearch()\n {\n $keyword= Input::get('q');\n $keywords = Explode(' ',$keyword);\n $query= DB::table('events')\n ->leftJoin('organizations', 'organizations.id', '=', 'events.org_id');\n foreach ($keywords as $key => $value) {\n $query ->orWhere('organizations.name', 'like', DB::raw(\"'%$value%'\"));\n $query ->orWhere('events.name', 'like', DB::raw(\"'%$value%'\"));\n }\n\n //search that event in Database\n $events= $query->get();\n // var_dump($events);\n\n //return display search result to user by using a view\n return View::make('event')->with('event', $events);\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('t.codtituloagrupamento', $this->codtituloagrupamento, false);\n\t\tif ($emissao_de = DateTime::createFromFormat(\"d/m/y\",$this->emissao_de))\n\t\t{\n\t\t\t$criteria->addCondition('t.emissao >= :emissao_de');\n\t\t\t$criteria->params = array_merge($criteria->params, array(':emissao_de' => $emissao_de->format('Y-m-d').' 00:00:00.0'));\n\t\t}\n\t\tif ($emissao_ate = DateTime::createFromFormat(\"d/m/y\",$this->emissao_ate))\n\t\t{\n\t\t\t$criteria->addCondition('t.emissao <= :emissao_ate');\n\t\t\t$criteria->params = array_merge($criteria->params, array(':emissao_ate' => $emissao_ate->format('Y-m-d').' 23:59:59.9'));\n\t\t}\n\t\tif ($criacao_de = DateTime::createFromFormat(\"d/m/y\",$this->criacao_de))\n\t\t{\n\t\t\t$criteria->addCondition('t.criacao >= :criacao_de');\n\t\t\t$criteria->params = array_merge($criteria->params, array(':criacao_de' => $criacao_de->format('Y-m-d').' 00:00:00.0'));\n\t\t}\n\t\tif ($criacao_ate = DateTime::createFromFormat(\"d/m/y\",$this->criacao_ate))\n\t\t{\n\t\t\t$criteria->addCondition('t.criacao <= :criacao_ate');\n\t\t\t$criteria->params = array_merge($criteria->params, array(':criacao_ate' => $criacao_ate->format('Y-m-d').' 23:59:59.9'));\n\t\t}\n\n\t\t$criteria->compare('t.codpessoa', $this->codpessoa, false);\n\n\t\t$criteria->with = array(\n\t\t\t'Pessoa' => array(\n\t\t\t\t'select' => 'fantasia'\n\t\t\t)\n\t\t);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t\t'sort'=>array('defaultOrder'=>'t.emissao DESC, t.criacao DESC, \"Pessoa\".fantasia ASC'),\n\t\t\t'pagination'=>array('pageSize'=>20)\n\t\t));\n\t}", "public function findByFilter($filter) {\n $query = $this->createQuery();\n //$query->getQuerySettings()->setRespectEnableFields(false);\n $query->getQuerySettings()->setEnableFieldsToBeIgnored(array());\n $query->getQuerySettings()->setIncludeDeleted(false);\n $query->getQuerySettings()->setRespectStoragePage(false);\n \n\n $constraints = array();\n if($filter->keyword) {\n $keywordConstraints = array();\n $keywordConstraints[] = $query->like('title', '%'.$filter->keyword.'%');\n $keywordConstraints[] = $query->like('abstract', '%'.$filter->keyword.'%');\n $keywordConstraints[] = $query->like('bodytext', '%'.$filter->keyword.'%');\n $constraints[] = $query->logicalOr($keywordConstraints);\n }\n if($filter->area) {\n $constraints[] = $query->contains('areas', $filter->area);\n }\n if($filter->industry) {\n $constraints[] = $query->contains('industries', $filter->industry);\n }\n if($filter->technology) {\n $constraints[] = $query->contains('technologies', $filter->technology);\n }\n if($filter->theme) {\n $constraints[] = $query->contains('themes', $filter->theme);\n }\n if($filter->year) {\n $minDate = mktime(0, 0, 0, 1, 1, $filter->year);\n $maxDate = mktime(23, 59, 59, 12, 31, $filter->year);\n $constraints[] = $query->greaterThanOrEqual('article_date', $minDate);\n $constraints[] = $query->lessThanOrEqual('article_date', $maxDate);\n }\n\n if(count($constraints)) {\n \n $query->matching(\n $query->logicalAnd($constraints)\n );\n \n \n \n//$queryParser = $this->objectManager->get(\\TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Storage\\Typo3DbQueryParser::class);\n//\\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump($queryParser->convertQueryToDoctrineQueryBuilder($query)->getSQL());\n//\n//\\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump($queryParser->convertQueryToDoctrineQueryBuilder($query)->getParameters());\n\n\n\n return $query->matching(\n $query->logicalAnd($constraints)\n )\n ->execute();\n \n }\n else {\n return $this->findAll();\n }\n }", "public function search($campo,$concepto){\n $sql=\"SELECT Id,Proveedor, Concepto, FORMAT(Monto, 2) AS Monto, Revisado, DATE_FORMAT(FechaSolicitud,'%d/%m/%Y') AS FechaSolicitud, AutorizadoPago, DATE_FORMAT(FechaAutorizado,'%d/%m/%Y') AS FechaAutorizado, estado, Comentario, ComentarioCapt, DATE_FORMAT(FechaPago,'%d/%m/%Y') AS FechaPago FROM \".self::$tablename.\" where $campo like'%{$concepto}%' ORDER BY Id DESC\";\n return Executor::doit($sql);\n }", "public function search(){}", "public function onSearch()\n {\n // get the search form data\n $data = $this->form->getData();\n $filters = [];\n\n TSession::setValue(__CLASS__.'_filter_data', NULL);\n TSession::setValue(__CLASS__.'_filters', NULL);\n\n if (isset($data->exemplar_id) AND ( (is_scalar($data->exemplar_id) AND $data->exemplar_id !== '') OR (is_array($data->exemplar_id) AND (!empty($data->exemplar_id)) )) )\n {\n\n $filters[] = new TFilter('exemplar_id', '=', $data->exemplar_id);// create the filter \n }\n\n if (isset($data->leitor_id) AND ( (is_scalar($data->leitor_id) AND $data->leitor_id !== '') OR (is_array($data->leitor_id) AND (!empty($data->leitor_id)) )) )\n {\n\n $filters[] = new TFilter('leitor_id', '=', $data->leitor_id);// create the filter \n }\n\n if (isset($data->dt_emprestimo) AND ( (is_scalar($data->dt_emprestimo) AND $data->dt_emprestimo !== '') OR (is_array($data->dt_emprestimo) AND (!empty($data->dt_emprestimo)) )) )\n {\n\n $filters[] = new TFilter('dt_emprestimo', '>=', $data->dt_emprestimo);// create the filter \n }\n\n if (isset($data->dt_emprestimo_final) AND ( (is_scalar($data->dt_emprestimo_final) AND $data->dt_emprestimo_final !== '') OR (is_array($data->dt_emprestimo_final) AND (!empty($data->dt_emprestimo_final)) )) )\n {\n\n $filters[] = new TFilter('dt_emprestimo', '<=', $data->dt_emprestimo_final);// create the filter \n }\n\n if (isset($data->dt_previsao) AND ( (is_scalar($data->dt_previsao) AND $data->dt_previsao !== '') OR (is_array($data->dt_previsao) AND (!empty($data->dt_previsao)) )) )\n {\n\n $filters[] = new TFilter('dt_previsao', '>=', $data->dt_previsao);// create the filter \n }\n\n if (isset($data->dt_prevista_final) AND ( (is_scalar($data->dt_prevista_final) AND $data->dt_prevista_final !== '') OR (is_array($data->dt_prevista_final) AND (!empty($data->dt_prevista_final)) )) )\n {\n\n $filters[] = new TFilter('dt_previsao', '<=', $data->dt_prevista_final);// create the filter \n }\n\n if (isset($data->dt_devolucao) AND ( (is_scalar($data->dt_devolucao) AND $data->dt_devolucao !== '') OR (is_array($data->dt_devolucao) AND (!empty($data->dt_devolucao)) )) )\n {\n\n $filters[] = new TFilter('dt_devolucao', '>=', $data->dt_devolucao);// create the filter \n }\n\n if (isset($data->dt_devolucao_final) AND ( (is_scalar($data->dt_devolucao_final) AND $data->dt_devolucao_final !== '') OR (is_array($data->dt_devolucao_final) AND (!empty($data->dt_devolucao_final)) )) )\n {\n\n $filters[] = new TFilter('dt_devolucao', '<=', $data->dt_devolucao_final);// create the filter \n }\n\n $param = array();\n $param['offset'] = 0;\n $param['first_page'] = 1;\n\n // fill the form with data again\n $this->form->setData($data);\n\n // keep the search data in the session\n TSession::setValue(__CLASS__.'_filter_data', $data);\n TSession::setValue(__CLASS__.'_filters', $filters);\n\n $this->onReload($param);\n }", "public function onSearch()\n {\n // get the search form data\n $data = $this->form->getData();\n $filters = [];\n\n TSession::setValue(__CLASS__.'_filter_data', NULL);\n TSession::setValue(__CLASS__.'_filters', NULL);\n\n if (isset($data->inscricao_evento_id) AND ( (is_scalar($data->inscricao_evento_id) AND $data->inscricao_evento_id !== '') OR (is_array($data->inscricao_evento_id) AND (!empty($data->inscricao_evento_id)) )) )\n {\n\n $filters[] = new TFilter('inscricao_id', 'in', \"(SELECT id FROM inscricao WHERE evento_id = '{$data->inscricao_evento_id}')\");// create the filter \n }\n\n // fill the form with data again\n $this->form->setData($data);\n\n // keep the search data in the session\n TSession::setValue(__CLASS__.'_filter_data', $data);\n TSession::setValue(__CLASS__.'_filters', $filters);\n }", "function searchTableStatique() {\n include_once('./lib/config.php');\n $table = $_POST['table'];\n $tableStatique = Doctrine_Core::getTable($table);\n $columnNames = $tableStatique->getColumnNames();\n $req = '';\n $param = array();\n $premierPassage = true;\n foreach ($columnNames as $columnName) {\n if ($columnName != 'id') {\n $req .= $premierPassage ? $columnName.' like ? ' : 'and '.$columnName.' like ? ';\n $param[] = $_POST[$columnName].'%';\n $premierPassage = false;\n }\n }\n $search = $tableStatique->findByDql($req, $param);\n echo generateContenuTableStatiqueEntab($table, $tableStatique, $search);\n}", "public function search()\n {\n $criteria = new CDbCriteria();\n\n if ($this->scenario == 'search_global') {\n $criteria->addColumnCondition(array('isGlobal' => 1));\n if ($this->relaxId == '1') {\n $criteria->addCondition('relaxId IS NOT NULL AND status = \"'.self::STATUS_APPROVED.'\"');\n } elseif ($this->relaxId == '0') {\n $criteria->addCondition('relaxId IS NULL AND status = \"'.self::STATUS_APPROVED.'\"');\n }\n } elseif ($this->scenario == 'search_users') {\n $criteria->addCondition('userId IS NOT NULL AND isGlobal = 0 AND (status = \"'.self::STATUS_APPROVED.'\" OR status = \"'.self::STATUS_DECLINED.'\")');\n } elseif ($this->scenario == 'search_on_validation') {\n $criteria->addCondition('userId IS NOT NULL AND isGlobal = 0 AND status = \"'.self::STATUS_WAITING.'\"');\n } elseif($this->scenario == 'search_from_relax') {\n $criteria->addCondition('relaxId IS NOT NULL AND isGlobal = 1 AND status = \"'.self::STATUS_WAITING.'\"');\n }\n\n $criteria->compare('eventId', $this->eventId, true);\n $criteria->compare('category', $this->category, true);\n $criteria->compare('publisherName', $this->publisherName, true);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('cityObject.name', $this->searchCityObject->name, true);\n $criteria->compare('dateStart', strtotime($this->dateStart), true);\n $criteria->compare('timeStart', $this->timeStart, true);\n $criteria->compare('dateCreated', strtotime($this->dateCreated), true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'sort'=>array(\n 'defaultOrder'=>'dateCreated DESC',\n )\n ));\n }", "public function Search($objeto);", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n \n // Ensure search is only on user's records\n $criteria->addColumnCondition(array('userId' => Yii::app()->user->id));\n\n\t\t$criteria->compare('uuid',$this->uuid,true);\n\t\t$criteria->compare('pt_age',$this->pt_age);\n\t\t$criteria->compare('pt_sex',$this->pt_sex,true);\n\t\t$criteria->compare('pt_postcode',$this->pt_postcode,true);\n\t\t$criteria->compare('asmt_date',$this->asmt_date,true);\n\t\t$criteria->compare('asmt_date_vision_loss',$this->asmt_date_vision_loss,true);\n\t\t$criteria->compare('asmt_eye',$this->asmt_eye,true);\n\t\t$criteria->compare('asmt_refraction',$this->asmt_refraction,true);\n\t\t$criteria->compare('asmt_acuity',$this->asmt_acuity);\n\t\t$criteria->compare('asmt_lens',$this->asmt_lens,true);\n\t\t$criteria->compare('asmt_iop',$this->asmt_iop);\n\t\t$criteria->compare('asmt_previous_op_date',$this->asmt_previous_op_date,true);\n\t\t$criteria->compare('asmt_vitreous',$this->asmt_vitreous,true);\n\t\t$criteria->compare('asmt_vithaem',$this->asmt_vithaem,true);\n\t\t$criteria->compare('fe_refraction',$this->fe_refraction,true);\n\t\t$criteria->compare('fe_acuity',$this->fe_acuity);\n\t\t$criteria->compare('fe_vitreous',$this->fe_vitreous,true);\n\t\t$criteria->compare('fe_retinal_detachment',$this->fe_retinal_detachment);\n\t\t$criteria->compare('op_date',$this->op_date,true);\n\t\t$criteria->compare('op_surgeon_grade',$this->op_surgeon_grade,true);\n\t\t$criteria->compare('op_cause_of_failure',$this->op_cause_of_failure,true);\n\t\t$criteria->compare('op_foveal_attachment',$this->op_foveal_attachment,true);\n\t\t$criteria->compare('op_extent_st',$this->op_extent_st,true);\n\t\t$criteria->compare('op_extent_sn',$this->op_extent_sn,true);\n\t\t$criteria->compare('op_extent_in',$this->op_extent_in,true);\n\t\t$criteria->compare('op_extent_it',$this->op_extent_it,true);\n\t\t$criteria->compare('op_chronic',$this->op_chronic);\n\t\t$criteria->compare('op_pvr_type',$this->op_pvr_type,true);\n\t\t$criteria->compare('op_pvr_cp',$this->op_pvr_cp,true);\n\t\t$criteria->compare('op_pvr_ca',$this->op_pvr_ca,true);\n\t\t$criteria->compare('op_subretinal_bands',$this->op_subretinal_bands);\n\t\t$criteria->compare('op_choroidals',$this->op_choroidals);\n\t\t$criteria->compare('op_breaks_detached',$this->op_breaks_detached);\n\t\t$criteria->compare('op_breaks_attached',$this->op_breaks_attached);\n\t\t$criteria->compare('op_largest_break_type',$this->op_largest_break_type,true);\n\t\t$criteria->compare('op_largest_break_size',$this->op_largest_break_size,true);\n\t\t$criteria->compare('op_lowest_break_position',$this->op_lowest_break_position,true);\n\t\t$criteria->compare('op_positioning',$this->op_positioning,true);\n\t\t$criteria->compare('as_lens_surgery',$this->as_lens_surgery,true);\n\t\t$criteria->compare('pr_volume',$this->pr_volume,true);\n\t\t$criteria->compare('roo_route',$this->roo_route,true);\n\t\t$criteria->compare('vity_gauge',$this->vity_gauge,true);\n\t\t$criteria->compare('vity_pvd_induced',$this->vity_pvd_induced);\n\t\t$criteria->compare('vity_peel',$this->vity_peel);\n\t\t$criteria->compare('vity_rr',$this->vity_rr);\n\t\t$criteria->compare('sb_drainage',$this->sb_drainage,true);\n\t\t$criteria->compare('rp_cryo',$this->rp_cryo);\n\t\t$criteria->compare('rp_endolaser',$this->rp_endolaser);\n\t\t$criteria->compare('rp_indirect',$this->rp_indirect);\n\t\t$criteria->compare('rp_transcleral_diode',$this->rp_transcleral_diode);\n\t\t$criteria->compare('rp_360',$this->rp_360);\n\t\t$criteria->compare('tamp_type',$this->tamp_type,true);\n\t\t$criteria->compare('tamp_percent',$this->tamp_percent);\n\t\t$criteria->compare('comps_choroidal',$this->comps_choroidal);\n\t\t$criteria->compare('comps_lens_touch',$this->comps_lens_touch);\n\t\t$criteria->compare('comps_esb',$this->comps_esb);\n\t\t$criteria->compare('comps_other_breaks',$this->comps_other_breaks);\n\t\t$criteria->compare('comps_deep_suture',$this->comps_deep_suture);\n\t\t$criteria->compare('comps_drain_haem',$this->comps_drain_haem);\n\t\t$criteria->compare('comps_incarceration',$this->comps_incarceration);\n\t\t$criteria->compare('fu_date',$this->fu_date,true);\n\t\t$criteria->compare('fu_type',$this->fu_type,true);\n\t\t$criteria->compare('fu_man_complete',$this->fu_man_complete);\n\t\t$criteria->compare('fu_readmission',$this->fu_readmission);\n\t\t$criteria->compare('fu_number_ops',$this->fu_number_ops);\n\t\t$criteria->compare('fu_attached',$this->fu_attached);\n\t\t$criteria->compare('fu_oil',$this->fu_oil);\n\t\t$criteria->compare('fu_acuity',$this->fu_acuity);\n\t\t$criteria->compare('fu_lens',$this->fu_lens,true);\n\t\t$criteria->compare('fu_iop_problem',$this->fu_iop_problem);\n\t\t$criteria->compare('fu_foveal_attachment',$this->fu_foveal_attachment,true);\n\t\t$criteria->compare('fu_erm',$this->fu_erm);\n\t\t$criteria->compare('fu_macular_hole',$this->fu_macular_hole);\n\t\t$criteria->compare('fu_macular_fold',$this->fu_macular_fold);\n\t\t$criteria->compare('fu_hypotony',$this->fu_hypotony);\n\t\t$criteria->compare('fu_primary_success',$this->fu_primary_success);\n\t\t\n\t\t// Following sort array returns cases in descending order of op_date (ie most recent cases first)\n\t\treturn new CActiveDataProvider(get_class($this), array(\n\t\t\t'criteria'=>$criteria,\n\t\t\t'sort'=>array(\n\t\t\t\t'defaultOrder'=>'op_date DESC'\n\t\t\t\t),\n\t\t));\n\t}", "public function Search($request,$responce)\n {\n $arr = [];\n\n //Select db and get all data from collection\n $db = $this->mongo->selectDB(\"test\");\n\n $collection = $db->test;\n $cursor = $collection->find();\n if(!empty($cursor)) {\n $array = iterator_to_array($cursor);\n foreach ($array as $value) {\n $params[\"index\"] = \"test\";\n $params[\"type\"] = \"test_type\";\n $params[\"id\"] = $value[\"_id\"];\n $arr[] = $this->elastic->get($params);\n }\n\n }\n\n //Create users zakaz data\n $userdata = [];\n $data = [];\n foreach ($arr as $value)\n {\n $userdata[] = [\n \"data\" => $value[\"_source\"],\n \"id\" => $value[\"_id\"],\n ];\n $udata[] = $value[\"_source\"];\n }\n\n //Compare user zakaz data and search string\n // put result in array and show it\n $search = [];\n $time_start = $request->getParam(\"year\").\"-\".$request->getParam(\"month\").\"-\".$request->getParam(\"day\").\" 00:00:00\";\n $time_end = $request->getParam(\"year\").\"-\".$request->getParam(\"month\").\"-\".$request->getParam(\"day\").\" 23:59:59\";\n foreach ($userdata as $data)\n {\n if(strcasecmp($request->getParam(\"search\"), $data[\"id\"]) == 0 ||\n stripos($request->getParam(\"search\"),$data[\"data\"][\"name\"]) !==false ||\n stripos($request->getParam(\"search\"),$data[\"data\"][\"surname\"]) !==false ||\n stripos($request->getParam(\"search\"),$data[\"data\"][\"email\"]) !==false ||\n $request->getParam(\"price_from\")<=$data[\"data\"][\"price\"] && $data[\"data\"][\"price\"]<=$request->getParam(\"price_to\") ||\n strtotime($time_start)<=strtotime($data[\"data\"][\"date\"]) && strtotime($data[\"data\"][\"date\"])<=strtotime($time_end)\n )\n {\n $search[] = $data[\"data\"];\n }\n\n\n }\n\n\n return $this->view->render($responce,\"app.twig\",[\"search\" => $search,\"zakaz\" => $udata]);\n\n }", "public function search();", "public function search();", "public function search($params)\n {\n $query = Evento::find();\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n 'pagination' => [\n 'pageSize' => 10,\n ],\n ]);\n\n $dataProvider->setSort([\n 'attributes' => [\n 'nombreEvento',\n 'nombreCortoEvento',\n 'lugar',\n 'fechaCreacionEvento',\n 'fechaInicioEvento',\n 'fechaFinEvento',\n 'capacidad',\n 'avalado',\n 'preInscripcion',\n 'nombreUsuario' => [\n 'asc' => ['usuario.nombre' => SORT_ASC],\n 'desc' => ['usuario.nombre' => SORT_DESC],\n ],\n ]\n ]);\n\n if (!($this->load($params) && $this->validate())) {\n return $dataProvider;\n }\n\n if ($this->nombreUsuario != null && $this->nombreUsuario != '') {\n $query->joinWith(['idUsuario0']);\n }\n\n $query->joinWith(['idAval0']);\n\n //busca capacidad evento\n if ($this->capacidad != null && $this->capacidad != '') {\n $query->andFilterWhere([\n 'capacidad' => $this->capacidad,\n ]);\n }\n //busca fecha inicio evento\n if ($this->fechaInicioEvento != null && $this->fechaInicioEvento != '') {\n $query->andFilterWhere([\n 'fechaInicioEvento' => date(\"Y-m-d\", strtotime($this->fechaInicioEvento)),\n ]);\n }\n //busca fecha fin evento\n if ($this->fechaFinEvento != null && $this->fechaFinEvento != '') {\n $query->andFilterWhere([\n 'fechaFinEvento' => date(\"Y-m-d\", strtotime($this->fechaFinEvento)),\n ]);\n }\n //busca fecha creacion evento\n if ($this->fechaCreacionEvento != null && $this->fechaCreacionEvento != '') {\n $query->andFilterWhere([\n 'fechaCreacionEvento' => date(\"Y-m-d\", strtotime($this->fechaCreacionEvento)),\n ]);\n }\n //busca nombre evento\n if ($this->nombreEvento != null && $this->nombreEvento != '') {\n $query->andFilterWhere(['like', 'nombreEvento', $this->nombreEvento]);\n }\n //busca lugar evento\n if ($this->lugar != null && $this->lugar != '') {\n $query->andFilterWhere(['like', 'lugar', $this->lugar]);\n }\n //busca nombre organizador\n if ($this->nombreUsuario != null && $this->nombreUsuario != '') {\n $query->andFilterWhere(['like', 'CONCAT(usuario.nombre,\" \",usuario.apellido)', $this->nombreUsuario]);\n }\n\n return $dataProvider;\n }", "public function findMatchesWithAnEvent($event){\n $qb = $this->createQueryBuilder('m');\n $qb->andWhere('m.event = :event')\n ->setParameter('event', $event);\n\n return $qb->getQuery()->execute();\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n $solicitante=Yii::app()->user->getState(\"rut\");\n \n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('fecha_ingreso',$this->fecha_ingreso,true);\n\t\t$criteria->compare('fecha_cambio_estado',$this->fecha_cambio_estado,true);\n\t\t$criteria->compare('rut_empresa',$this->rut_empresa,true);\n\t\t$criteria->compare('nombre_empresa',$this->nombre_empresa,true);\n\t\t$criteria->compare('nombre_contacto_emp',$this->nombre_contacto_emp,true);\n\t\t$criteria->compare('telefono_contacto_emp',$this->telefono_contacto_emp,true);\n\t\t$criteria->compare('cantidad_trabajadores',$this->cantidad_trabajadores);\n\t\t$criteria->compare('fecha_solicitud',$this->fecha_solicitud,true);\n\t\t$criteria->compare('origen_emp',$this->origen_emp,true);\n\t\t$criteria->compare('nombre_ejecutivo',$this->nombre_ejecutivo,true);\n\t\t$criteria->compare('rut_ejecutivo',$this->rut_ejecutivo,true);\n\t\t$criteria->compare('rut_solicitante',$this->rut_solicitante,true);\n\t\t$criteria->compare('estado',$this->estado,true);\n\t\t$criteria->compare('comentario',$this->comentario,true);\n $criteria->compare('rut_jv',$this->rut_jv,true);\n $criteria->compare('nombre_jv',$this->nombre_jv,true);\n $criteria->compare('rut_sup',$this->rut_sup,true);\n $criteria->compare('nombre_sup',$this->nombre_sup,true);\n $criteria->compare('comentario',$this->vigencia,true);\n\t\t$criteria->compare('cantidad_rechazada',$this->cantidad_rechazada);\n $criteria->compare('nro_memo',$this->nro_memo);\n $criteria->compare('codigo_actividad',$this->codigo_actividad);\n $criteria->compare('tipo_contrato',$this->tipo_contrato);\n $criteria->compare('comentario_fech_vali',$this->comentario_fech_vali);\n $criteria->compare('mes_produccion',$this->mes_produccion);\n $criteria->compare('empresa_relacionada',$this->empresa_relacionada);\n \n $criteria->order = 'id desc';\n \n// if(Yii::app()->user->getState(\"tipo\")!=\"administrador\"){\n// $criteria->condition='rut_solicitante=:rut_solicitante';\n// $criteria->params=array(':rut_solicitante'=>$solicitante);\n //}\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function searchEvents($searchString)\n {\n $qb = $this->entityManager->getRepository(Event::class)->createQueryBuilder('e');\n $orX = $qb->expr()->orX();\n $orX->add($qb->expr()->like('e.title', $qb->expr()->literal(\"%$searchString%\")));\n $orX->add($qb->expr()->like('e.labelText', $qb->expr()->literal(\"%$searchString%\")));\n $orX->add($qb->expr()->like('e.text', $qb->expr()->literal(\"%$searchString%\")));\n $qb->where($orX);\n $qb->orderBy('e.eventStartDate', 'DESC');\n return $qb->getQuery();\n }", "public function searchIPC($campo,$campo2,$campo3,$concepto){\n $sql=\"SELECT Id,Proveedor, Concepto, FORMAT(Monto, 2) AS Monto, Revisado, DATE_FORMAT(FechaSolicitud,'%d/%m/%Y') AS FechaSolicitud, AutorizadoPago, DATE_FORMAT(FechaAutorizado,'%d/%m/%Y') AS FechaAutorizado, estado, Comentario, ComentarioCapt, DATE_FORMAT(FechaPago,'%d/%m/%Y') AS FechaPago FROM \".self::$tablename.\" where $campo like'%{$concepto}%' OR $campo2 like'%{$concepto}%' OR $campo3 like'%{$concepto}%' ORDER BY Id DESC\";\n return Executor::doit($sql);\n }", "public function search()\n {\n $criteria=new CDbCriteria;\n\n $criteria->compare('id',$this->id,true);\n $criteria->compare('name',$this->name,true);\n $criteria->compare('title',$this->title,true);\n $criteria->compare('identifier',$this->identifier,true);\n $criteria->compare('langue_id',$this->langue_id,true);\n $criteria->compare('tax',$this->tax,true);\n $criteria->compare('taux',$this->taux,true);\n $criteria->compare('show_langs',$this->show_langs);\n $criteria->compare('env',$this->env,true);\n $criteria->compare('gmaps_key',$this->gmaps_key,true);\n $criteria->compare('jetlag',$this->jetlag);\n $criteria->compare('issuetickets',$this->issuetickets);\n $criteria->compare('sendmailtickets',$this->sendmailtickets);\n $criteria->compare('smsactivitation',$this->smsactivitation,true);\n $criteria->compare('smsreservation',$this->smsreservation,true);\n $criteria->compare('openingdays',$this->openingdays,true);\n $criteria->compare('openinghours',$this->openinghours,true);\n $criteria->compare('closinghours',$this->closinghours,true);\n $criteria->compare('fashion',$this->fashion);\n $criteria->compare('adminip',$this->adminip,true);\n $criteria->compare('wsuser',$this->wsuser,true);\n $criteria->compare('wspass',$this->wspass,true);\n $criteria->compare('theme',$this->theme,true);\n $criteria->compare('display_phone',$this->display_phone);\n $criteria->compare('phonecallcenter',$this->phonecallcenter,true);\n $criteria->compare('sav_portable',$this->sav_portable,true);\n $criteria->compare('email',$this->email,true);\n $criteria->compare('logo',$this->logo,true);\n $criteria->compare('pos_h',$this->pos_h);\n $criteria->compare('down',$this->down);\n $criteria->compare('decalage',$this->decalage);\n $criteria->compare('currency',$this->currency,true);\n $criteria->compare('symbole',$this->symbole,true);\n $criteria->compare('show_journey',$this->show_journey);\n $criteria->compare('application_type_id',$this->application_type_id,true);\n $criteria->compare('google_analytics',$this->google_analytics,true);\n $criteria->compare('escales',$this->escales);\n $criteria->compare('session_resa',$this->session_resa);\n $criteria->compare('meta_title',$this->meta_title,true);\n $criteria->compare('meta_description',$this->meta_description,true);\n $criteria->compare('meta_keywords',$this->meta_keywords,true);\n $criteria->compare('service',$this->service,true);\n $criteria->compare('account_id',$this->account_id,true);\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n \n \n\t\t$criteria->compare('ESUB_ID',$this->ESUB_ID);\n\t\t$criteria->compare('ESUB_EMP_ID',$this->ESUB_EMP_ID);\n//\t\t$criteria->compare('ESUB_SUBSCRS_ID',$this->ESUB_SUBSCRS_ID);\n// $criteria->together=true;\n\t\t\n//\t\t$criteria->compare('ESUB_PAYMENT_ID',$this->ESUB_PAYMENT_ID);\n $criteria->with = array( 'eSUBSUBSCRS' );\n $criteria->compare('eSUBSUBSCRS.SUBSCR_RATE', $this->ESUB_PAYMENT_ID,true);\n $criteria->compare('eSUBSUBSCRS.SUBSCR_DESC', $this->ESUB_SUBSCRS_ID,true);\n\t\t$criteria->compare('ESUB_STATUS',$this->ESUB_STATUS,true);\n $criteria->compare('ESUB_PURCHASE_DATE',$this->ESUB_PURCHASE_DATE,true);\n\t\t$criteria->compare('ESUB_EXPIRY_DATE',$this->ESUB_EXPIRY_DATE,true);\n\t\t$criteria->compare('ESUB_UTILIZED_COUNT',$this->ESUB_UTILIZED_COUNT,true);\n\t\t$criteria->compare('ESUB_REMAIN_COUNT',$this->ESUB_REMAIN_COUNT,true);\n// $criteria->compare('date(ESUB_PURCHASE_DATE)',$this->ESUB_PURCHASE_DATE,true);\n////\n// $criteria->compare('date(ESUB_EXPIRY_DATE)',$this->ESUB_EXPIRY_DATE,true);\n// $criteria->compare(\"DATE_FORMAT(date,'%yy-%mm-%dd')\",$this->ESUB_PURCHASE_DATE,true);\n// $criteria->compare(\"DATE_FORMAT(date,'%yy-%mm-%dd')\",$this->ESUB_EXPIRY_DATE,true);\n// if($this->ESUB_SUBSCRS_ID)\n// {\n// $criteria->together = true;\n// $criteria->with = ( 'eSUBSUBSCRS' );\n// $criteria->compare('eSUBSUBSCRS.SUBSCR_DESC', $model->ESUB_SUBSCRS_ID,true);\n// }\n// if(strlen($this->ESUB_PURCHASE_DATE) && strlen($this->ESUB_EXPIRY_DATE)) {\n// $criteria->params[':ESUB_PURCHASE_DATE'] = date('Y-m-d', strtotime($this->ESUB_PURCHASE_DATE));\n// \n// $criteria->params[':ESUB_EXPIRY_DATE'] = date('Y-m-d', strtotime($this->ESUB_EXPIRY_DATE));\n//// (strlen($this->ESUB_EXPIRY_DATE)) ? date('Y-m-d', strtotime($this->ESUB_EXPIRY_DATE)) : $criteria->params[':post_date'];\n// $criteria->addCondition('DATE(ESUB_PURCHASE_DATE) BETWEEN :ESUB_PURCHASE_DATE AND :ESUB_EXPIRY_DATE');\n// }\n \n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n \n\t\t));\n\t}", "public function indexAction(Request $request) {\n if (empty($request->getSession()->get('token'))) {\n return $this->redirectToRoute('check_path');\n }\n $events = new Events();\n $em = $this->getDoctrine()->getManager();\n $dql = \"SELECT a FROM DroidInfotechDroidBundle:Events a \";\n $form = $this->createForm('DroidInfotech\\DroidBundle\\Form\\EventsType', $events);\n $form->handleRequest($request);\n if ($request->isMethod('POST')) {\n\n $dqls = array();\n if ($events->getTitle()) {\n $dqls[] = \" a.title like '\" . $events->getTitle() . \"%'\";\n }\n if ($events->getLocation()) {\n $dqls[] = \" a.location like '\" . $events->getLocation() . \"%'\";\n }\n if (!empty($dqls)) {\n $dql .= \" where \" . implode(\" AND \", $dqls);\n }\n }\n // echo $dql;\n $query = $em->createQuery($dql);\n $paginator = $this->get('knp_paginator');\n $pagination = $paginator->paginate(\n $query, /* query NOT result */ $request->query->getInt('page', 1)/* page number */, 10/* limit per page */\n );\n\n return $this->render('events/index.html.twig', array(\n 'pagination' => $pagination,\n 'form' => $form->createView()\n ));\n }", "private function eventDateOcuppied(Event $event) {\n $select = new Select();\n $select->from( $this->_events );\n // Create betweens\n $betweenStartAt = new Expression(\"BETWEEN ({$event->getStartAt()}+1) AND ({$event->getFinishAt()}-1) \"); \n $betweenNewStartAt = new Expression(\"BETWEEN start_at AND finish_at \");\n $select->where( [\n 'id != ?' => (integer)$event->getId(),\n 'room_id = ?' => (integer)$event->getRoomId(),\n '(start_at ? ' => $betweenStartAt, // Notice! open parenthesis \n ]);\n // Build date range \n $select->where( [ \"finish_at ? \" => $betweenStartAt, ], Predicate::OP_OR );\n $select->where( [ \"(\".$event->getStartAt().\"+1) ? )\" => $betweenNewStartAt, ], Predicate::OP_OR );// Notice! closing parenthesis\n \n $exists = new RecordExists( $select );\n// DEBUG ONLY\n //$sql = new Sql( $this->db );\n //$statement = $sql->prepareStatementForSqlObject($select); \n //echo $sql->buildSqlString( $select ); die();\n// DEBUG ONLY\n \n // We still need to set our database adapter\n $exists->setAdapter( $this->db );\n return $exists->isValid( $event->getId() ); \n }", "function searchAllByCriteria($db,$criteria,$search)\n{\n $request = \"SELECT game.name game_name,game.year game_year,game.note game_note,categorie.content categorie_name,editor.name editor_name FROM game,categorie,game_editor,editor WHERE game.id_categorie = categorie.id AND game.id = game_editor.id_game AND editor.id = game_editor.id_editor AND $criteria = $search ORDER BY game.name ASC\";\n return mysqli_query($db,$request);\n}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n$criteria->compare('hidturno',$this->hidturno);\n\t\t$criteria->compare('codocu',$this->codocu,true);\n\t\t$criteria->compare('codestado',$this->codestado,true);\n\t\t$criteria->compare('codigo',$this->codigo,true);\n\t\t$criteria->compare('numero',$this->numero,true);\n\t\t$criteria->compare('dispo',$this->dispo,true);\n\t\t$criteria->compare('util',$this->util,true);\n\t\t$criteria->compare('descripcion',$this->descripcion);\n\t\t$criteria->compare('np',$this->np);\n\t\t$criteria->compare('ns',$this->ns);\n\t\t$criteria->compare('htt',$this->htt,true);\n\t\t$criteria->compare('ntt',$this->ntt);\n\t\t$criteria->compare('textocorto',$this->textocorto,true);\n\t\t$criteria->compare('codcen',$this->codcen,true);\n\t\t$criteria->compare('codtipo',$this->codtipo,true);\n\t\t$criteria->compare('ap',$this->ap,true);\n\t\t$criteria->compare('nombres',$this->nombres,true);\n\t\t$criteria->compare('nombreobjeto',$this->nombreobjeto,true);\n\n\t\tif(isset($_SESSION['sesion_Trabajadores'])) {\n\t\t\t$criteria->addInCondition('codresponsable', $_SESSION['sesion_Trabajadores'], 'OR');\n\t\t} ELSE {\n\t\t\t$criteria->compare('codresponsable',$this->codresponsable,true);\n\t\t}\n if(isset($_SESSION['sesion_Ot'])) {\n\t\t\t$criteria->addInCondition('codproyecto', $_SESSION['sesion_Ot'], 'AND');\n\t\t} ELSE {\n\t\t\t$criteria->compare('codproyecto',$this->codproyecto,true);\n\t\t}\n if(isset($_SESSION['sesion_Inventario'])) {\n\t\t\t$criteria->addInCondition('codigoaf', $_SESSION['sesion_Inventario'], 'AND');\n\t\t} ELSE {\n\t\t\t$criteria->compare('codigoaf',$this->codigoaf,true);\n\t\t}\n \n \n \n\t\tif((isset($this->fecha) && trim($this->fecha) != \"\") && (isset($this->fecha1) && trim($this->fecha1) != \"\")) {\n\t\t\t\t$criteria->addBetweenCondition('fecha', ''.$this->fecha.'', ''.$this->fecha1.'');\n\t\t}\n \n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "function selectEventsWithName($name)\n{\n require_once(\"model/database.php\");\n $query = \"SELECT * FROM events WHERE events.name LIKE :name ;\";\n return executeQuerySelect($query, createBinds([[\":name\", $name]]));\n}", "public function onSearch()\n {\n // get the search form data\n $data = $this->form->getData();\n $filters = [];\n\n if (count($data->relatorio_id) == 0)\n { \n TTransaction::open('bedevops');\n $conn = TTransaction::get();\n $result = $conn->query('SELECT * FROM relatorio WHERE user_id = '.TSession::getValue(\"userid\").' ORDER BY id DESC LIMIT 4');\n $objects = $result->fetchAll(PDO::FETCH_CLASS, \"stdClass\");\n foreach ($objects as $value) {\n array_push($data->relatorio_id,$value->id);\n }\n TTransaction::close();\n } \n\n TSession::setValue(__CLASS__.'_filter_data', NULL);\n TSession::setValue(__CLASS__.'_filters', NULL);\n\n if (isset($data->categoria_id) AND ( (is_scalar($data->categoria_id) AND $data->categoria_id !== '') OR (is_array($data->categoria_id) AND (!empty($data->categoria_id)) )) )\n {\n\n $filters[] = new TFilter('categoria_id', '=', $data->categoria_id);// create the filter \n }\n\n if (count($data->relatorio_id) <= 4)\n {\n if (isset($data->relatorio_id) AND ( (is_scalar($data->relatorio_id) AND $data->relatorio_id !== '') OR (is_array($data->relatorio_id) AND (!empty($data->relatorio_id)) )) )\n {\n\n $filters[] = new TFilter('relatorio_id', 'in', $data->relatorio_id);// create the filter \n }\n } else {\n throw new Exception('Selecione no máximo 4 relatórios!');\n }\n\n // fill the form with data again\n $this->form->setData($data);\n\n // keep the search data in the session\n TSession::setValue(__CLASS__.'_filter_data', $data);\n TSession::setValue(__CLASS__.'_filters', $filters);\n }", "function index($page=1){\n \n $per = new Eventointernacional();\n //$this->arrPersona = array();\n $consulta=null;\n $busqueda = Input::post(\"busqueda\");\n if(!empty($busqueda)){\n \n if(Input::post(\"comboBusqueda\")==\"0\"){\n $consulta=\"nombreevento like '%\".Input::post(\"busqueda\").\"%'\";\n }\n }\n \n $this->arrEventos = $per->paginar($consulta,$page);\n \n }", "public function search(array $data)\n {\n// $this->searchWhere($data);\n// ver($this->entity, d);\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('idEstudiante',$this->idEstudiante);\n\t\t$criteria->compare('nomEstudiante',$this->nomEstudiante,true);\n\t\t$criteria->compare('apellEstudiante',$this->apellEstudiante,true);\n\t\t$criteria->compare('secApellEstudante',$this->secApellEstudante,true);\n\t\t$criteria->compare('ciEstudiante',$this->ciEstudiante,true);\n\t\t$criteria->compare('idTutor',$this->idTutor);\n\t\t$criteria->compare('sexEstudiante',$this->sexEstudiante);\n\t\t$criteria->compare('nacEstudiante',$this->nacEstudiante,true);\n\t\t$criteria->compare('cursoEstudiante',$this->cursoEstudiante,true);\n\t\t$criteria->compare('etapaEstudiante',$this->etapaEstudiante,true);\n\t\t$criteria->compare('numCasaEstudiante',$this->numCasaEstudiante,true);\n\t\t$criteria->compare('pisoEstudiante',$this->pisoEstudiante,true);\n\t\t$criteria->compare('provinciaEstudiante',$this->provinciaEstudiante,true);\n\t\t$criteria->compare('LocalidadEst',$this->LocalidadEst,true);\n\t\t$criteria->compare('calleEstudiante',$this->calleEstudiante,true);\n\t\t$criteria->compare('codPostalEst',$this->codPostalEst);\n\t\t$criteria->compare('paisEst',$this->paisEst,true);\n\t\t$criteria->compare('idCentroEst',$this->idCentroEst);\n\t\t$criteria->compare('telEstudiante',$this->telEstudiante);\n\t\t$criteria->compare('emailEstudiante',$this->emailEstudiante,true);\n\t\t$criteria->compare('nroCuentaEst',$this->nroCuentaEst);\n\t\t$criteria->compare('dietaEstudiante',$this->dietaEstudiante,true);\n\t\t$criteria->compare('nutricionEst',$this->nutricionEst,true);\n\t\t$criteria->compare('tel2Estudiante',$this->tel2Estudiante);\n\t\t$criteria->compare('menuEst',$this->menuEst);\n\t\t$criteria->compare('comidaEst',$this->comidaEst);\n\t\t$criteria->compare('desayunoEst',$this->desayunoEst);\n\t\t$criteria->compare('becaEst',$this->becaEst);\n\t\t$criteria->compare('descuentoEst',$this->descuentoEst);\n\t\t$criteria->compare('diasEstudiante',$this->diasEstudiante,true);\n\t\t$criteria->compare('diasEstComida',$this->diasEstudiante,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function getByFilter(object $params): array\n\t{\n\t\t$sql = \"SELECT\n\t\t\t\t\te.id,\n\t\t\t\t\te.event_name,\n\t\t\t\t\te.frequency,\n\t\t\t\t\te.start_date,\n\t\t\t\t\te.end_date,\n\t\t\t\t\te.duration\n\t\t\t\tFROM events e\n\t\t\t\tLEFT JOIN event_invitees ei\n\t\t\t\t\tON e.id = ei.event_id\n\t\t\t\tWHERE 1 = 1\n\t\t\t\tAND e.duration is not null\n\t\t\t\tAND (\n\t\t\t\t\t\t(\n\t\t\t\t\t\tfrequency != 'Once-Off' \n\t\t\t\t\t\tAND (\n\t\t\t\t\t\t\t\t(e.start_date BETWEEN :startDateTime AND :endDateTime) \n\t\t\t\t\t\t\t\tOR (e.end_date BETWEEN :startDateTime2 AND :endDateTime2) \n\t\t\t\t\t\t\t\tOR (e.start_date <= :startDateTime3 AND (e.end_date >= :endDateTime3 OR end_date IS NULL))\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\tOR (\n\t\t\t\t\t\tfrequency = 'Once-Off' \n\t\t\t\t\t\tAND e.start_date BETWEEN :startDateTime4 AND :endDateTime4\n\t\t\t\t\t)\n\t\t\t\t)\";\n\t\t\n\t\tif ($params->invitees) {\n\t\t\t$sql .= \" AND ei.user_id in (\". $params->invitees .\") GROUP BY e.id\";\n\t\t} else {\n\t\t\t$sql .= \" GROUP BY e.id\";\n\t\t}\n\t\t\t\t\n\t\t$params = [\n 'startDateTime' => $params->from,\n 'endDateTime' => $params->to,\n 'startDateTime2' => $params->from,\n 'endDateTime2' => $params->to,\n 'startDateTime3' => $params->from,\n 'endDateTime3' => $params->to,\n 'startDateTime4' => $params->from,\n 'endDateTime4' => $params->to,\n ];\n\n return DB::select($sql, $params);\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->bride,true,'OR');\n\t\t$criteria->compare('bride',$this->bride,true,'OR');\n\t\t$criteria->compare('bride_phone',$this->bride_phone,true,'OR');\n\t\t$criteria->compare('phone',$this->bride_phone,true,'OR');\n\t\t// $criteria->compare('bride_phone',$this->bride_phone,true);\n\t\t$criteria->compare('type',$this->type);\n\t\t$criteria->compare('contact',$this->contact,true);\n\t\t$criteria->compare('address',$this->address,true);\n\t\t$criteria->compare('tel',$this->tel,true);\n\t\t// $criteria->compare('phone',$this->phone,true);\n\t\t$criteria->compare('email',$this->email,true);\n\t\t$criteria->compare('qq',$this->qq,true);\n\t\t$criteria->compare('status',$this->status);\n\t\t if(empty($this->update_time)){\n\t\t \t$criteria->compare('update_time',$this->update_time);\n\t\t }else{\n\t\t \t$start =$this->update_time.' 00:00:00';\n\t\t \t$stop =$this->update_time.' 23:59:59';\n\t\t \t$start=strtotime($start);\n\t\t \t$stop=strtotime($stop);\n\t\t \t$criteria->addBetweenCondition('update_time', $start, $stop);\n\t\t }\n\t\t\n\t\t$criteria->compare('usiness',$this->usiness);\n\t\t$criteria->compare('situation',$this->situation);\n\t\t$criteria->compare('province',$this->province);\n\t\t$criteria->compare('zip',$this->zip);\n\t\t$criteria->compare('eserve_time',$this->eserve_time);\n\t\t$criteria->compare('remarks',$this->remarks,true);\n\t\t$criteria->compare('entry',$this->entry);\n\t\t$criteria->compare('create_time',$this->create_time);\n\t\t$criteria->compare('oid',$this->oid);\n\t\t$criteria->compare('source',$this->source);\n\t\t$criteria->compare('site_id',$this->site_id);\n\t\t$criteria->compare('remind_time',$this->remind_time);\n\t\t$criteria->compare('remind_status',$this->remind_status);\n\t\t$criteria->compare('marry_date',$this->marry_date,true);\n\t\t$criteria->compare('budget',$this->budget,true);\n\t\t$criteria->compare('order_status',$this->order_status);\n\t\t$criteria->compare('prcie_total',$this->prcie_total);\n\t\t$criteria->compare('deposit',$this->deposit);\n\t\t$criteria->compare('deposit_time',$this->deposit_time);\n\t\t$criteria->compare('sign_user',$this->sign_user,true);\n\t\t$criteria->compare('executor',$this->executor,true);\n\t\t$criteria->compare('photo_date',$this->photo_date,true);\n\t\t$criteria->compare('choose_date',$this->choose_date,true);\n\t\t$criteria->compare('photographer',$this->photographer,true);\n\t\t$criteria->compare('makeupartist',$this->makeupartist,true);\n\t\t$criteria->compare('design_date',$this->design_date,true);\n\t\t$criteria->compare('taketablets_date',$this->taketablets_date,true);\n\t\t$criteria->compare('looksite_date',$this->looksite_date,true);\n\t\t$criteria->compare('style_date',$this->style_date,true);\n\t\t$criteria->compare('scheme_date',$this->scheme_date,true);\n\t\t$criteria->compare('makeup_date',$this->makeup_date,true);\n\t\t$criteria->compare('compere_date',$this->compere_date,true);\n\t\t$criteria->compare('rehearsal_date',$this->rehearsal_date,true);\n\t\t$criteria->compare('dep_id',$this->dep_id,true);\t\n\t\t$criteria->compare('entry_status',$this->entry_status);\t\n\t\t$criteria->compare('xsituation',$this->xsituation);\t\n\t\t$criteria->compare('wx',$this->wx,true);\n\t\t$criteria->compare('wangwang',$this->wangwang,true);\n\t\t$criteria->compare('dangqian',$this->dangqian,true);\n\t\t$criteria->order = 'remind_status DESC,status DESC,update_time desc';\n\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t\t'pagination'=>array(\n\t\t\t 'pageSize'=>30,\n\t\t\t),\n\t\t));\n\t}", "public function search()\n \t{\n \t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n \t\t$criteria = new CDbCriteria();\n\n \t\t$criteria->compare('id', $this->id);\n \t\t$criteria->compare('code', $this->code, true);\n \t\t$criteria->compare('slug', $this->slug, true);\n \t\t$criteria->compare('title', $this->title, true);\n \t\t$criteria->compare('text_oneliner', $this->text_oneliner, true);\n \t\t$criteria->compare('text_short_description', $this->text_short_description, true);\n \t\t$criteria->compare('image_logo', $this->image_logo, true);\n \t\tif (!empty($this->sdate_started) && !empty($this->edate_started)) {\n \t\t\t$sTimestamp = strtotime($this->sdate_started);\n \t\t\t$eTimestamp = strtotime(\"{$this->edate_started} +1 day\");\n \t\t\t$criteria->addCondition(sprintf('date_started >= %s AND date_started < %s', $sTimestamp, $eTimestamp));\n \t\t}\n \t\tif (!empty($this->sdate_ended) && !empty($this->edate_ended)) {\n \t\t\t$sTimestamp = strtotime($this->sdate_ended);\n \t\t\t$eTimestamp = strtotime(\"{$this->edate_ended} +1 day\");\n \t\t\t$criteria->addCondition(sprintf('date_ended >= %s AND date_ended < %s', $sTimestamp, $eTimestamp));\n \t\t}\n \t\t$criteria->compare('is_active', $this->is_active);\n \t\t$criteria->compare('is_highlight', $this->is_highlight);\n \t\t$criteria->compare('json_extra', $this->json_extra, true);\n \t\tif (!empty($this->sdate_added) && !empty($this->edate_added)) {\n \t\t\t$sTimestamp = strtotime($this->sdate_added);\n \t\t\t$eTimestamp = strtotime(\"{$this->edate_added} +1 day\");\n \t\t\t$criteria->addCondition(sprintf('date_added >= %s AND date_added < %s', $sTimestamp, $eTimestamp));\n \t\t}\n \t\tif (!empty($this->sdate_modified) && !empty($this->edate_modified)) {\n \t\t\t$sTimestamp = strtotime($this->sdate_modified);\n \t\t\t$eTimestamp = strtotime(\"{$this->edate_modified} +1 day\");\n \t\t\t$criteria->addCondition(sprintf('date_modified >= %s AND date_modified < %s', $sTimestamp, $eTimestamp));\n \t\t}\n\n \t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria' => $criteria,\n\t\t\t'sort' => array('defaultOrder' => 't.date_started DESC'),\n\t\t));\n \t}", "function fetch_user_events_by_email ($pass_email=NULL, $sdate_time=MIN_DATE_TIME, $edate_time=MAX_DATE_TIME,\n \t\t $privacy=NULL, $role_ids=NULL, $tag_name=NULL) {\n \tglobal $cxn;\n \t// Initialize variables\n \t$ret_events=NULL;\n \t// Check and replace start date time and end date time\n \tif ($sdate_time == NULL ) {\n \t\t$sdate_time = MIN_DATE_TIME;\n \t} \n \tif ($edate_time == NULL ) {\n \t\t$edate_time = MAX_DATE_TIME;\n \t}\n\n \t$errArr=init_errArr(__FUNCTION__);\n \ttry\n\t{\n\t\t// initialize variables\n\t\t$where = ZERO_LENGTH_STRING;\n\t\t$param_types = ZERO_LENGTH_STRING;\n\t\t$param_values = array();\n\t\t$sql_and = \" \";\n\t\t// Set email selection\n\t\tif ($pass_email != NULL) {\n\t\t\t$where = $where . $sql_and . \" email = ? \";\n\t\t\t$sql_and = \" AND \"; // set up \"AND\" value tobe used in following settings\n\t\t\t$param_types = $param_types . \"s\" ; // add parameter type\n\t\t\t$param_values [] = $pass_email; // add parameter value\n\t\t}\n\t\t// Set up date and time selection\n\t\tif ($sdate_time != MIN_DATE_TIME OR $edate_time != MAX_DATE_TIME) {\n\t\t\t$where = $where . $sql_and .\n\t\t\t \" (sdate_time BETWEEN ? AND ? ) \";\n\t\t\t$sql_and = \" AND \"; // set up \"AND\" value tobe used in following settings\n\t\t\t// Initialize parameter types and parameter values\n\t\t\t$param_types = $param_types . \"ss\";\n\t\t\tarray_push($param_values, $sdate_time, $edate_time);\n\t\t}\n\t\t// set up privacy\n\t\tif ($privacy != NULL) {\n\t\t\t$where = $where . $sql_and . \" privacy = ?\";\n\t\t\t$sql_and = \" AND \"; // set up \"AND\" value tobe used in following settings\n\t\t\t$param_types = $param_types . \"s\"; // add parameter type\n\t\t\t$param_values [] = $privacy; // add parameter value\n\t\t}\n\t\t// set up Role selection\n\t\tif ($role_ids != NULL and count($role_ids) > 0) {\n\t\t\t$where = $where . $sql_and . \" role_id IN (\";\n\t\t\t$first_element=TRUE;\n\t\t\tforeach ($role_ids as $rid) {\n\t\t\t\tif ($first_element) {\n\t\t\t\t\t$first_element = FALSE;\n\t\t\t\t\t$comma = \"\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$comma = \",\";\n\t\t\t\t}\n\t\t\t\t$where = $where . $comma . \"?\";\n\t\t\t\t$param_types = $param_types . \"i\"; // add parameter type\n\t\t\t\t$param_values [] = $rid; // add parameter value\n\t\t\t}\n\t\t\t$where = $where . \")\";\n\t\t\t$sql_and = \" AND \"; // set up \"AND\" value tobe used in following settings\n\t\t}\n\t\t//\n\t\tif ($tag_name != NULL) {\n\t\t\t$where = $where . $sql_and . \" ( tag_1=? OR tag_2=? OR tag_3=? OR tag_4=? OR tag_5=? OR tag_6=? ) \";\n\t\t\t$sql_and = \" AND \"; // set up \"AND\" value tobe used in following settings\n\t\t\t$i = 0;\n\t\t\tdo {\n\t\t\t\t$param_types = $param_types . \"s\" ; // add parameter type\n\t\t\t\t$param_values [] = $tag_name; // add parameter value\n\t\t\t\t$i++;\n\t\t\t} while ($i < 6);\n\t\t}\n\t\t// Add WHERE keyword\t\t\n\t\tif (trim($where) !== ZERO_LENGTH_STRING) {\n\t\t\t$where = \" WHERE \" . $where;\n\t\t}\n\n\t\t// SQL String\n\t\t$sqlString = \"SELECT * \"\n\t\t\t \t. \" FROM users_events_dtl_v \"\n\t\t\t \t. $where . \n\t\t\t \t\" ORDER BY sdate_time, eID\";\t\t\n\t\t\t \t\n \t$stmt = $cxn->prepare($sqlString);\n\t\t// bind parameters \n\t\t// Create array of types and their values\n\t\t$params=array_merge( array($param_types), $param_values);\n\t\t\t\t\n\t if (count($param_values) > 0) {\n\t\t\tcall_user_func_array ( array($stmt, \"bind_param\"), ref_values($params) );\n\t\t}\n\t\t$stmt->execute();\n\t\t// Store result\n\t\t/* Bind results to variables */\n\t\tbind_array($stmt, $row);\n\t\twhile ($stmt->fetch()) {\n\t\t\t$ret_events[]=cvt_to_key_values($row);\n\t\t}\n\t}\n\tcatch (mysqli_sql_exception\t$err)\n\t{\n\t\t// Error settings\n\t\t$err_code = 1;\n\t\t$err_descr = \"Error selecting user events for the email: \" . $pass_email . \" \" .\n\t\t\t\t$sdate_time . \" \" . $edate_time . \" \" .\n \t\t $privacy . \" \" . $role_ids . \" \" . $tag_name;\n\t\tset_errArr($err, $err_code, $err_descr, $errArr);\n\t}\n\t// Return Error code\n\t$errArr[ERR_AFFECTED_ROWS] = $cxn->affected_rows;\n\t$errArr[ERR_SQLSTATE] = $cxn->sqlstate;\n\t$errArr[ERR_SQLSTATE_MSG] = $cxn->error;\n\treturn array($errArr, $ret_events);\n}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('idinmueble',$this->idinmueble);\n\t\t$criteria->compare('fechaPublicacion',$this->fechaPublicacion,true);\n\t\t//$criteria->compare('gastosComunes',$this->gastosComunes,true);\n\t\t$criteria->compare('superEdif',$this->superEdif,true);\n\t\t//$criteria->compare('anioConst',$this->anioConst);\n\t\t$criteria->compare('dormitorios',$this->dormitorios);\n\t\t$criteria->compare('banios',$this->banios);\n\t\t//$criteria->compare('cocina',$this->cocina);\n\t\t//$criteria->compare('living',$this->living);\n\t\t//$criteria->compare('comedor',$this->comedor);\n\t\t$criteria->compare('terraza',$this->terraza);\n\t\t//$criteria->compare('piso',$this->piso);\n\t\t$criteria->compare('equipado',$this->equipado);\n\t\t//$criteria->compare('padron',$this->padron);\n\t\t//$criteria->compare('mejoras',$this->mejoras);\n\t\t//$criteria->compare('nivelado',$this->nivelado);\n\t\t//$criteria->compare('agreste',$this->agreste);\n\t\t$criteria->compare('tipo',$this->tipo,true);\n //$criteria->compare('foto',$this->foto,true);\n\t\t//$criteria->compare('foto2',$this->foto2,true);\n\t\t//$criteria->compare('foto3',$this->foto3,true);\n\t\t//$criteria->compare('foto4',$this->foto4,true);\n\t\t//$criteria->compare('foto5',$this->foto5,true);\n $criteria->compare('departamento',$this->departamento,true);\n\t\t$criteria->compare('ciudad',$this->ciudad,true);\n\t\t$criteria->compare('barrio',$this->barrio,true);\n\t\t//$criteria->compare('calle',$this->calle,true);\n\t\t//$criteria->compare('numero',$this->numero);\n\t\t//$criteria->compare('apto',$this->apto);\n\t\t//$criteria->compare('descripcion',$this->descripcion,true);\n\t\t//$criteria->compare('latitud',$this->latitud);\n\t\t//$criteria->compare('longitud',$this->longitud);\n $criteria->compare('precio',$this->precio);\n\t\t$criteria->compare('destacado',$this->destacado);\n\t\t//$criteria->compare('moneda',$this->moneda);\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "function search() {}", "private function getEvents () \n\n\t\t{\n\t\t\t $dbs = new DB ( $this->config['database'] );\n $c = $dbs->query (\"SELECT * FROM tbl_events_record WHERE org_id = '\" . $this->c . \"'\");\n\t\t\t if ( count ( $c ) ) {\n\t\t\t\t$this->result['data']['id'] = trim ( $this->c );\n\t\t\t\t$this->result['data']['events'] = $c[0]['events'];\n\t\t\t\t$this->result['data']['date'] = $c[0]['date_rec'];\n\t\t\t } else \n\t\t\t\t$this->result['data']['result'] = \"Not found [error code:100:101]\";\n\n\t\t\t $dbs->CloseConnection ();\n\t\t\t\n\t\t \treturn;\n\t\t}", "public function search()\r\n \t{\r\n \t\t// @todo Please modify the following code to remove attributes that should not be searched.\r\n\r\n \t\t$criteria = new CDbCriteria;\r\n\r\n \t\t$criteria->compare('id', $this->id);\r\n \t\t$criteria->compare('code', $this->code, true);\r\n \t\t$criteria->compare('slug', $this->slug, true);\r\n \t\tif (!empty($this->sdate_open) && !empty($this->edate_open)) {\r\n \t\t\t$sTimestamp = strtotime($this->sdate_open);\r\n \t\t\t$eTimestamp = strtotime(\"{$this->edate_open} +1 day\");\r\n \t\t\t$criteria->addCondition(sprintf('date_open >= %s AND date_open < %s', $sTimestamp, $eTimestamp));\r\n \t\t}\r\n \t\tif (!empty($this->sdate_close) && !empty($this->edate_close)) {\r\n \t\t\t$sTimestamp = strtotime($this->sdate_close);\r\n \t\t\t$eTimestamp = strtotime(\"{$this->edate_close} +1 day\");\r\n \t\t\t$criteria->addCondition(sprintf('date_close >= %s AND date_close < %s', $sTimestamp, $eTimestamp));\r\n \t\t}\r\n \t\t$criteria->compare('json_structure', $this->json_structure, true);\r\n \t\t$criteria->compare('json_stage', $this->json_stage, true);\r\n \t\t$criteria->compare('is_multiple', $this->is_multiple);\r\n \t\t$criteria->compare('is_login_required', $this->is_login_required);\r\n \t\t$criteria->compare('title', $this->title, true);\r\n \t\t$criteria->compare('text_short_description', $this->text_short_description, true);\r\n \t\t$criteria->compare('is_active', $this->is_active);\r\n \t\t$criteria->compare('timezone', $this->timezone, true);\r\n \t\tif (!empty($this->sdate_added) && !empty($this->edate_added)) {\r\n \t\t\t$sTimestamp = strtotime($this->sdate_added);\r\n \t\t\t$eTimestamp = strtotime(\"{$this->edate_added} +1 day\");\r\n \t\t\t$criteria->addCondition(sprintf('date_added >= %s AND date_added < %s', $sTimestamp, $eTimestamp));\r\n \t\t}\r\n \t\tif (!empty($this->sdate_modified) && !empty($this->edate_modified)) {\r\n \t\t\t$sTimestamp = strtotime($this->sdate_modified);\r\n \t\t\t$eTimestamp = strtotime(\"{$this->edate_modified} +1 day\");\r\n \t\t\t$criteria->addCondition(sprintf('date_modified >= %s AND date_modified < %s', $sTimestamp, $eTimestamp));\r\n \t\t}\r\n \t\t$criteria->compare('type', $this->type);\r\n \t\t$criteria->compare('text_note', $this->text_note, true);\r\n \t\t$criteria->compare('json_event_mapping', $this->json_event_mapping, true);\r\n \t\t$criteria->compare('json_extra', $this->json_extra, true);\r\n\r\n \t\treturn new CActiveDataProvider($this, array(\r\n\t\t\t'criteria' => $criteria,\r\n\t\t\t'sort' => array('defaultOrder' => 't.id DESC'),\r\n\t\t));\r\n \t}", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n $aJoin = array();\n\n $criteria->compare('id', $this->id);\n $criteria->compare('nota_fiscal', $this->nota_fiscal, true);\n $criteria->compare('preco', $this->preco, true);\n $criteria->compare('observacao', $this->observacao, true);\n $criteria->compare('quantidade', $this->quantidade);\n $criteria->compare('data_hora', $this->data_hora, true);\n $criteria->compare('excluido', $this->excluido);\n \n if (!empty($this->data_hora_inicial) && !empty($this->data_hora_final)) {\n $this->data_hora_inicial_grid = $this->data_hora_inicial;\n $this->data_hora_final_grid = $this->data_hora_final;\n $criteria->addBetweenCondition('date(data_hora)', $this->data_hora_inicial, $this->data_hora_final);\n } else if (!empty($this->data_hora_inicial_grid) && !empty($this->data_hora_final_grid)) {\n $this->data_hora_inicial = $this->data_hora_inicial_grid;\n $this->data_hora_final = $this->data_hora_final_grid;\n $criteria->addBetweenCondition('date(data_hora)', $this->data_hora_inicial, $this->data_hora_final);\n }\n if (!empty($this->produto_id)) {\n $aJoin[] = 'JOIN produtos produto ON produto.id = t.produto_id';\n $criteria->addCondition(\"produto.titulo like '%\" . $this->produto_id . \"%'\");\n }\n if (!empty($this->usuario_id)) {\n $aJoin[] = 'JOIN usuarios usuario ON usuario.id = t.usuario_id';\n $criteria->addCondition(\"usuario.nome like '%\" . $this->usuario_id . \"%'\");\n }\n if (!empty($aJoin)) {\n $criteria->join = implode(' ', $aJoin);\n }\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "function get( $args = array() ){\r\n\t\tglobal $wpdb;\r\n\t\t$events_table = $wpdb->prefix . EM_EVENTS_TABLE;\r\n\t\t$locations_table = $wpdb->prefix . EM_LOCATIONS_TABLE;\r\n\t\t\r\n\t\t//Quick version, we can accept an array of IDs, which is easy to retrieve\r\n\t\tif( self::array_is_numeric($args) && count() ){ //Array of numbers, assume they are event IDs to retreive\r\n\t\t\t//We can just get all the events here and return them\r\n\t\t\t$sql = \"SELECT * FROM $locations_table WHERE location_id=\".implode(\" OR location_id=\", $args);\r\n\t\t\t$results = $wpdb->get_results($sql);\r\n\t\t\t$events = array();\r\n\t\t\tforeach($results as $result){\r\n\t\t\t\t$locations[$result['location_id']] = new EM_Location($result);\r\n\t\t\t}\r\n\t\t\treturn $locations; //We return all the events matched as an EM_Event array. \r\n\t\t}\r\n\t\t\r\n\r\n\t\t//We assume it's either an empty array or array of search arguments to merge with defaults\t\t\t\r\n\t\t$args = self::get_default_search($args);\r\n\t\t$limit = ( $args['limit'] && is_numeric($args['limit'])) ? \"LIMIT {$args['limit']}\" : '';\r\n\t\t$offset = ( $limit != \"\" && is_numeric($args['offset']) ) ? \"OFFSET {$args['offset']}\" : '';\r\n\t\t\r\n\t\t//Get the default conditions\r\n\t\t$conditions = self::build_sql_conditions($args);\r\n\t\t\r\n\t\t//Put it all together\r\n\t\t$EM_Location = new EM_Location(0); //Empty class for strict message avoidance\r\n\t\t$fields = $locations_table .\".\". implode(\", {$locations_table}.\", array_keys($EM_Location->fields));\r\n\t\t$where = ( count($conditions) > 0 ) ? \" WHERE \" . implode ( \" AND \", $conditions ):'';\r\n\t\t\r\n\t\t//Get ordering instructions\r\n\t\t$EM_Event = new EM_Event(); //blank event for below\r\n\t\t$accepted_fields = $EM_Location->get_fields(true);\r\n\t\t$accepted_fields = array_merge($EM_Event->get_fields(true),$accepted_fields);\r\n\t\t$orderby = self::build_sql_orderby($args, $accepted_fields, get_option('dbem_events_default_order'));\r\n\t\t//Now, build orderby sql\r\n\t\t$orderby_sql = ( count($orderby) > 0 ) ? 'ORDER BY '. implode(', ', $orderby) : '';\r\n\t\t\r\n\t\t\r\n\t\t//Create the SQL statement and execute\r\n\t\t$sql = \"\r\n\t\t\tSELECT $fields FROM $locations_table\r\n\t\t\tLEFT JOIN $events_table ON {$locations_table}.location_id={$events_table}.location_id\r\n\t\t\t$where\r\n\t\t\tGROUP BY location_id\r\n\t\t\t$orderby_sql\r\n\t\t\t$limit $offset\r\n\t\t\";\r\n\t\r\n\t\t$results = $wpdb->get_results($sql, ARRAY_A);\r\n\t\t\r\n\t\t//If we want results directly in an array, why not have a shortcut here?\r\n\t\tif( $args['array'] == true ){\r\n\t\t\treturn $results;\r\n\t\t}\r\n\t\t\r\n\t\t$locations = array();\r\n\t\tforeach ($results as $location){\r\n\t\t\t$locations[] = new EM_Location($location);\r\n\t\t}\r\n\t\treturn $locations;\r\n\t}", "public function search(Request $request) {\n //dd($request->all());\n if(($request->date_start != null) || ($request->date_end != null)) {\n $messages = [\n 'date_start.required' => 'La fecha inicio es obligatoria',\n 'date_end.required' => 'La fecha fin es obligatoria',\n 'date_end.after_or_equal' => 'La fecha fin debe ser una fecha posterior o igual a fecha inicio',\n 'date_start.before_or_equal' => 'La fecha inicio debe ser una fecha anterior o igual a fecha fin',\n 'date_start.date' => 'La fecha inicio no es una fecha válida',\n 'date_end.date' => 'La fecha fin no es una fecha válida',\n 'date_start.date_format' => 'La fecha inicio no corresponde al formato AAAA-MM-DD',\n 'date_end.date_format' => 'La fecha fin no corresponde al formato AAAA-MM-DD',\n 'uar.required' => 'La Unidad Administrativa Responsable es obligatoria',\n ];\n $request->validate([\n 'date_start' => 'required|date|date_format:Y-m-d|before_or_equal:date_end',\n 'date_end' => 'required|date|date_format:Y-m-d|after_or_equal:date_start',\n 'uar' => 'required',\n ], $messages);\n $results = Result::with(['goals' => function ($query) use($request) {\n $query->where([\n ['date_start', '<=', $request->date_start],\n ['date_end', '>=', $request->date_start],\n ])->orWhere([\n ['date_start', '<=', $request->date_end],\n ['date_end', '>=', $request->date_end],\n ])->orWhere([\n ['date_start', '>=', $request->date_start],\n ['date_end', '<=', $request->date_end],\n ]);\n }])->where('rol_id', $request->uar)->get()->sortBy('theme_result');\n } else {\n $messages = [\n 'uar.required' => 'La Unidad Administrativa Responsable es obligatoria',\n ];\n $request->validate([\n 'uar' => 'required',\n ], $messages);\n $results = Result::where('rol_id', $request->uar)->get()->sortBy('theme_result');\n }\n\n $roles = Role::all()->sortBy('name')->except([1, 3, 5, 7, 9, 11]);\n $reports = [];\n $role_id = $request->uar;\n $date_start = $request->date_start;\n $date_end = $request->date_end;\n\n foreach ($results as $result) {\n $report = [];\n $report['id'] = $result->id;\n $report['role'] = $result->rol->name;\n $report['theme_result'] = $result->theme_result;\n\n foreach ($result->formulas as $formula) {\n if($result->goals->count() > 0) {\n $goals = [];\n\n foreach ($result->goals as $goal) {\n $valus = [];\n $each_goal = [];\n $reports_ids = Report::select('id')->where([\n ['rol_id', $result->rol_id],\n ['date_start', '<=', $goal->date_start],\n ['date_end', '>=', $goal->date_start]\n ])->orWhere([\n ['rol_id', $result->rol_id],\n ['date_start', '<=', $goal->date_end],\n ['date_end', '>=', $goal->date_end]\n ])->orWhere([\n ['rol_id', $result->rol_id],\n ['date_start', '>=', $goal->date_start],\n ['date_end', '<=', $goal->date_end]\n ])->get()->toArray();\n\n foreach($formula->variables as $variable) {\n $valus[] = ItemValueReport::where([\n ['item_rol_id', $variable->itemrol_id],\n ['item_col_id', $variable->itemstructure_id]\n ])->whereIn('report_id', $reports_ids)->sum('valore');\n }\n\n $total_value = array_sum($valus);\n $each_goal['total_value'] = number_format($total_value);\n $dividendo = floatval($goal->goal_unit);\n $each_goal['goal_txt'] = $goal->goal_txt;\n $each_goal['goal_unit'] = number_format($goal->goal_unit);\n $percent = ($total_value / $dividendo) * 100;\n $each_goal['percent'] = number_format(round($percent, 2)) .' %';\n $goals[] = $each_goal;\n }\n\n $report['goals'] = $goals;\n } else {\n $valus = [];\n\n foreach($formula->variables as $variable) {\n $valus[] = ItemValueReport::where([\n ['item_rol_id', $variable->itemrol_id],\n ['item_col_id', $variable->itemstructure_id]\n ])->sum('valore');\n }\n\n $report['total_value'] = number_format(array_sum($valus));\n }\n }\n\n $reports[] = $report;\n }\n\n return view('results.index', compact('reports', 'roles', 'role_id', 'date_start', 'date_end'));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ID',$this->ID,true);\n\t\t$criteria->compare('FINANCIAL_YEAR_ID_FK',$this->FINANCIAL_YEAR_ID_FK,true);\n\t\t$criteria->compare('EMPLOYEE_ID',$this->EMPLOYEE_ID,true);\n\t\t$criteria->compare('HRA',$this->HRA,true);\n\t\t$criteria->compare('MEDICAL_INSURANCE',$this->MEDICAL_INSURANCE,true);\n\t\t$criteria->compare('DONATION',$this->DONATION,true);\n\t\t$criteria->compare('DISABILITY_MED_EXP',$this->DISABILITY_MED_EXP,true);\n\t\t$criteria->compare('EDU_LOAD_INT',$this->EDU_LOAD_INT,true);\n\t\t$criteria->compare('SELF_DISABILITY',$this->SELF_DISABILITY,true);\n\t\t$criteria->compare('HOME_LOAN_INT',$this->HOME_LOAN_INT,true);\n\t\t$criteria->compare('HOME_LOAD_EXCESS_2013_14',$this->HOME_LOAD_EXCESS_2013_14,true);\n\t\t$criteria->compare('INSURANCE_LIC_OTHER',$this->INSURANCE_LIC_OTHER,true);\n\t\t$criteria->compare('TUITION_FESS_EXEMPTION',$this->TUITION_FESS_EXEMPTION,true);\n\t\t$criteria->compare('PPF_NSC',$this->PPF_NSC,true);\n\t\t$criteria->compare('HOME_LOAN_PR',$this->HOME_LOAN_PR,true);\n\t\t$criteria->compare('PLI_ULIP',$this->PLI_ULIP,true);\n\t\t$criteria->compare('TERM_DEPOSIT_ABOVE_5',$this->TERM_DEPOSIT_ABOVE_5,true);\n\t\t$criteria->compare('MUTUAL_FUND',$this->MUTUAL_FUND,true);\n\t\t$criteria->compare('PENSION_FUND',$this->PENSION_FUND,true);\n\t\t$criteria->compare('CPF',$this->CPF,true);\n\t\t$criteria->compare('REGISTRY_STAMP',$this->REGISTRY_STAMP,true);\n\t\t$criteria->compare('DA_TA_ARREAR',$this->DA_TA_ARREAR,true);\n\t\t$criteria->compare('OTA_HONORANIUM',$this->OTA_HONORANIUM,true);\n\t\t$criteria->compare('UNIFORM',$this->UNIFORM,true);\n\t\t$criteria->compare('DA_TA_ARREAR_CPF',$this->DA_TA_ARREAR_CPF,true);\n\t\t$criteria->compare('EL_ENCASH',$this->DA_TA_ARREAR_CPF,true);\n\t\t$criteria->compare('LTC_HTC',$this->DA_TA_ARREAR_CPF,true);\n\t\t$criteria->compare('CEA_TUITION',$this->CEA_TUITION,true);\n\t\t$criteria->compare('BONUS',$this->BONUS,true);\n\t\t$criteria->compare('OTHER_INCOME',$this->OTHER_INCOME,true);\n\t\t$criteria->compare('HOUSE_INCOME',$this->HOUSE_INCOME,true);\n\t\t$criteria->compare('NPS_UNDER_80CCD_1B',$this->NPS_UNDER_80CCD_1B,true);\n\t\t$criteria->compare('BANK_INTEREST_DED_80TTA',$this->BANK_INTEREST_DED_80TTA,true);\n\t\t$criteria->compare('MEDICAL_INSURANCE_PARENTS',$this->MEDICAL_INSURANCE_PARENTS,true);\n\t\t$criteria->compare('LOAN_YEAR',$this->LOAN_YEAR,true);\n\t\t\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search_index_events($keyword,$limit,$offset)\n {\n $query = $this->db->select('a.id_event, a.judul_event, a.user_id, a.thumbnail, b.id_user, a.lokasi_event, a.meta_descriptions, a.updated_at, a.slug, b.nama_user')\n ->from('tbl_events a')\n ->join('tbl_users b','a.user_id = b.id_user')\n ->limit($limit,$offset)\n ->like('a.judul_event',$keyword)\n ->or_like('b.nama_user',$keyword)\n ->limit($limit,$offset)\n ->order_by('a.id_event','DESC')\n ->get();\n\n if($query->num_rows() > 0)\n {\n return $query;\n }\n else\n {\n return NULL;\n }\n }", "public function search()\n\t{\n\t\t\n\t}", "function get_occurs_within_where_clause($table_name, $rel_table, $start_ts_obj, $end_ts_obj, $field_name='date_start', $view){\n\t\tglobal $timedate;\n\t\n\t\t$start = clone $start_ts_obj;\n\t\t$end = clone $end_ts_obj;\n\n\t\t$field_date = $table_name.'.'.$field_name;\n\t\t$start_day = $GLOBALS['db']->convert(\"'{$start->asDb()}'\",'datetime');\n\t\t$end_day = $GLOBALS['db']->convert(\"'{$end->asDb()}'\",'datetime');\n\n\t\t$where = \"($field_date >= $start_day AND $field_date < $end_day\";\n\t\tif($rel_table != ''){\n\t\t\t$where .= \" AND $rel_table.accept_status != 'decline'\";\n\t\t}\n\n\t\t$where .= \")\";\n\t\treturn $where;\n\t}", "public function search($params)\n {\n $query = A2Liquidaciones::find();\n\n //$query->joinWith('operacionInmobiliaria',false, 'INNER JOIN');\n\n $query->joinWith(['operacionInmobiliaria' => function ($q) {\n $q->joinWith(['inmueble', 'cliente']);\n //$q->joinWith('cliente');\n }], false, 'INNER JOIN');\n if (isset($params['A2LiquidacionesSearch']['tipo_filtro']) && $params['A2LiquidacionesSearch']['tipo_filtro'] == 'sin_vencer') {\n $query->where(\"a2_operaciones_inmobiliarias.estado='ACTIVO' AND DATEDIFF(NOW(),CONCAT(a2_liquidaciones.liq_anio,'-',\n a2_liquidaciones.liq_mes,'-',`a2_operaciones_inmobiliarias`.`dia_venc_mensual`))<0\");\n }\n\n if (isset($params['A2LiquidacionesSearch']['tipo_filtro']) && $params['A2LiquidacionesSearch']['tipo_filtro'] == 'por_vencer') {\n $query->where(\"a2_operaciones_inmobiliarias.estado='ACTIVO' AND DATEDIFF(NOW(),CONCAT(`a2_operaciones_inmobiliarias`.`hasta_anio`,'-',\n `a2_operaciones_inmobiliarias`.`hasta_mes`,'-',`a2_operaciones_inmobiliarias`.`dia_venc_mensual`))>=-70\");\n }\n\n //VENCIDAS\n if (isset($params['A2LiquidacionesSearch']['tipo_filtro']) && $params['A2LiquidacionesSearch']['tipo_filtro'] == 'vencidas') {\n $query->where(\"a2_operaciones_inmobiliarias.estado='ACTIVO' AND (DATEDIFF(NOW(),CONCAT(a2_liquidaciones.liq_anio,'-',\n a2_liquidaciones.liq_mes,'-',`a2_operaciones_inmobiliarias`.`dia_venc_mensual`))>0 AND \n DATEDIFF(NOW(),CONCAT(a2_liquidaciones.liq_anio,'-',\n a2_liquidaciones.liq_mes,'-',`a2_operaciones_inmobiliarias`.`dia_venc_mensual`))<=30) \");\n }\n\n //VENCIDAS MAS DE UN MES\n if (isset($params['A2LiquidacionesSearch']['tipo_filtro']) && $params['A2LiquidacionesSearch']['tipo_filtro'] == 'vencidas_mas_mes') {\n $query->where(\"a2_operaciones_inmobiliarias.estado='ACTIVO' AND DATEDIFF(NOW(),CONCAT(a2_liquidaciones.liq_anio,'-',\n a2_liquidaciones.liq_mes,'-',`a2_operaciones_inmobiliarias`.`dia_venc_mensual`))>30 \");\n }\n\n // add conditions that should always apply here\n if ($params['A2LiquidacionesSearch']['estado'] == 'ACTIVO') {\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n 'sort' => [\n 'defaultOrder' => [\n 'liq_anio' => SORT_DESC,\n 'liq_mes' => SORT_DESC,\n ]\n ],\n ]);\n } else {\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n 'sort' => [\n 'defaultOrder' => [\n 'fecha_pago' => SORT_DESC,\n ]\n ],\n ]);\n }\n\n $this->load($params);\n\n if (!$this->validate()) {\n // uncomment the following line if you do not want to return any records when validation fails\n // $query->where('0=1');\n return $dataProvider;\n }\n\n if (!empty($this->periodo)) {\n $arreglo_periodo = explode(\"/\", $this->periodo);\n $this->liq_mes = $arreglo_periodo[0];\n $this->liq_anio = $arreglo_periodo[1];\n }\n\n // grid filtering conditions\n $query->andFilterWhere([\n 'id_liquidacion' => $this->id_liquidacion,\n 'id_operacion' => $this->id_operacion,\n 'liq_anio' => $this->liq_anio,\n 'liq_mes' => $this->liq_mes,\n 'fecha_pago' => $this->fecha_pago,\n 'monto_pagado' => $this->monto_pagado,\n 'monto_intereses' => $this->monto_intereses,\n 'timestamp' => $this->timestamp,\n ]);\n\n\n $query->andFilterWhere(['like', 'usuario', $this->usuario])\n ->andFilterWhere(['like', 'a2_liquidaciones.estado', $this->estado])\n ->andFilterWhere(['like', 'a2_noticias.direccion', $this->direccion])\n ->andFilterWhere(['like', 'a2_clientes.nombre', $this->cliente]);\n\n\n return $dataProvider;\n }", "public function searchWhere(array $data)\n {\n $this->populateEntity($data);\n\n $where = array();\n\n foreach($data as $key => $value){\n if(strripos($key , '_begin')){\n $dateColumn = str_replace('_begin' , '', $key);\n $dateBegin = $key;\n } else if(strripos($key , '_end')) {\n $dateEnd = $key;\n }\n }\n\n if($dateBegin && $dateEnd && !empty($data[$dateBegin]) && !empty($data[$dateEnd])){\n $dataWhere[] = \" ({$dateColumn} BETWEEN TO_DATE('{$data[$dateBegin]}' , 'DD/MM/YYYY') AND TO_DATE('{$data[$dateEnd]}' , 'DD/MM/YYYY'))\";\n }\n\n foreach($this->entity as $nameColumn => $entity){\n if(!empty($entity['value']) ){\n if($entity['type'] == 'integer' || $entity['type'] == 'numeric'){\n $dataWhere[] = \"{$nameColumn} = '{$entity['value']}'\";\n } else if ($entity['type'] == 'date' || $entity['type'] == 'timestamp with time zone'){\n $dataWhere[] = \"TO_CHAR({$nameColumn} , 'DD/MM/YYYY') = '{$entity['value']}'\";\n } else {\n $dataWhere[] = \"{$nameColumn} ILIKE '%{$entity['value']}%'\";\n }\n }\n }\n\n if( $dataWhere && count($dataWhere) > 0 ) {\n $where = implode(' AND ' , $dataWhere );\n } else {\n $where = '';\n }\n\n $this->clearEntity();\n\n return $where;\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('eps',$this->eps,true);\n\t\t$criteria->compare('lugar',$this->lugar,true);\n\t\t$criteria->compare('sr',$this->sr);\n\t\t$criteria->compare('clg',$this->clg);\n\t\t$criteria->compare('clg_fecha',$this->clg_fecha,true);\n\t\t$criteria->compare('clg_volante',$this->clg_volante,true);\n\t\t$criteria->compare('sap',$this->sap);\n\t\t$criteria->compare('sap_fecha',$this->sap_fecha,true);\n\t\t$criteria->compare('sap_volante',$this->sap_volante,true);\n\t\t$criteria->compare('itd',$this->itd,true);\n\t\t$criteria->compare('notas',$this->notas,true);\n\t\t$criteria->compare('apendice',$this->apendice);\n\t\t$criteria->compare('declaranot',$this->declaranot);\n\t\t$criteria->compare('legajo',$this->legajo);\n\t\t$criteria->compare('rpp',$this->rpp,true);\n\t\t$criteria->compare('rpp_volante',$this->rpp_volante,true);\n\t\t$criteria->compare('delegacion',$this->delegacion,true);\n\t\t$criteria->compare('nc',$this->nc);\n\t\t$criteria->compare('r_rpp',$this->r_rpp,true);\n\t\t$criteria->compare('sr_salida',$this->sr_salida);\n\t\t$criteria->compare('clg_salida',$this->clg_salida);\n\t\t$criteria->compare('clg_salida_fecha',$this->clg_salida_fecha,true);\n\t\t$criteria->compare('clg_salida_volante',$this->clg_salida_volante,true);\n\t\t$criteria->compare('entregada',$this->entregada,true);\n\t\t$criteria->compare('status',$this->status,true);\n\t\t$criteria->compare('terminada',$this->terminada);\n\t\t$criteria->compare('tipo',$this->tipo);\n\t\t$criteria->with = array('ep0');\n\t\t$criteria->compare('ep0.expediente_DBA', $this->expediente_DBA_search, true);\n\t\t$criteria->compare('ep0.libro', $this->libro_search, true);\n\t\t$criteria->compare('ep0.folio_ini', $this->folio_ini_search, true);\n\t\t$criteria->compare('ep0.folio_fin', $this->folio_fin_search, true);\n\t\t$criteria->compare('ep0.fecha', $this->fecha_search, true);\n\t\t$criteria->compare('ep0.enajenante', $this->enajenante_search, true);\n\t\t$criteria->compare('ep0.adquirente', $this->adquirente_search, true);\n\t\t$criteria->compare('ep0.acto', $this->acto_search, true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t\t'sort' => array(\n\t\t\t\t\t'attributes' => array(\n\t\t\t\t\t\t'expediente_DBA_search' => array(\n\t\t\t\t\t\t\t'asc' => 'ep0.expediente_DBA',\n\t\t\t\t\t\t\t'desc' => 'ep0.expediente_DBA DESC',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'libro_search' => array(\n\t\t\t\t\t\t\t'asc' => 'ep0.libro',\n\t\t\t\t\t\t\t'desc' => 'ep0.libro DESC',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'folio_ini_search' => array(\n\t\t\t\t\t\t\t'asc' => 'ep0.folio_ini',\n\t\t\t\t\t\t\t'desc' => 'ep0.folio_ini DESC',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'folio_fin_search' => array(\n\t\t\t\t\t\t\t'asc' => 'ep0.folio_fin',\n\t\t\t\t\t\t\t'desc' => 'ep0.folio_fin DESC',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'fecha_search' => array(\n\t\t\t\t\t\t\t'asc' => 'ep0.fecha',\n\t\t\t\t\t\t\t'desc' => 'ep0.fecha DESC',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'enajenante_search' => array(\n\t\t\t\t\t\t\t'asc' => 'ep0.enajenante',\n\t\t\t\t\t\t\t'desc' => 'ep0.enajenante DESC',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'adquirente_search' => array(\n\t\t\t\t\t\t\t'asc' => 'ep0.adquirente',\n\t\t\t\t\t\t\t'desc' => 'ep0.adquirente DESC',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'acto_search' => array(\n\t\t\t\t\t\t\t'asc' => 'ep0.acto',\n\t\t\t\t\t\t\t'desc' => 'ep0.acto DESC',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'*',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t));\n\t}", "public function search() {\n\t\tif(!isset($_REQUEST['searchType']) || $_REQUEST['searchType'] != \"AND\") $_REQUEST['searchType'] = \"OR\";\n\t\t$searchType = $_REQUEST['searchType'];\n\t\tif(!isset($_REQUEST['start']) || !is_numeric($_REQUEST['start']) || (int)$_REQUEST['start'] < 1) $_REQUEST['start'] = 0;\n\t\t$SQL_start = (int)$_REQUEST['start'];\n\t\tunset($_REQUEST['start']);\n\t\tif(!isset($_REQUEST['limit']) || !is_numeric($_REQUEST['limit']) || (int)$_REQUEST['limit'] < 1) $_REQUEST['limit'] = 20;\n\t\t$SQL_limit = (int)$_REQUEST['limit'];\n\t\tunset($_REQUEST['limit']);\n\t\tif(!isset($_REQUEST['startDate'])) $_REQUEST['startDate'] = null;\n\t\t$startDate = $_REQUEST['startDate'];\n\t\tif(!isset($_REQUEST['endDate'])) $_REQUEST['endDate'] = null;\n\t\t$endDate = $_REQUEST['endDate'];\n\t\tif(!isset($_REQUEST['columns'])) $_REQUEST['columns'] = null;\n\t\t$Columns = $_REQUEST['columns'];\n\t\tif(!isset($_REQUEST['query'])) $_REQUEST['query'] = null;\n\t\t$metadata = isset($_REQUEST['meta']) ? true : false;\n\t\t$columnModel = isset($_REQUEST['columnModel']) ? true : false;\n\t\t$treeModel = isset($_REQUEST['treeModel']) ? true : true; //Hack for the old modules, fix when upgraded.\n\t\t$QueryData = $_REQUEST['query'];\n\t\t$extraParams = isset($_REQUEST['extraParams']) ? explode(',',$_REQUEST['extraParams']) : array();\t\t\n\t\t$sudoParams = array();\n\t\t$columnModelParams = isset($_REQUEST['columnModelParams']) ? explode(',',$_REQUEST['columnModelParams']) : array();\n\t\t$Object = $this->urlParams['ID'];\n\t\tif(!isset($_REQUEST['orderBy'])) $_REQUEST['orderBy'] = null;\n\t\tif(!isset($_REQUEST['orderByDirection'])) $_REQUEST['orderByDirection'] = 'DESC';\n\t\tif(count(explode('.',$_REQUEST['orderBy']))>1){\n\t\t\t$OrderByTmpArr = explode('.',$_REQUEST['orderBy']);\n\t\t\t$OrderByTmp = $OrderByTmpArr[0].'ID';\n\t\t} else {\n\t\t\t$OrderByTmp = $_REQUEST['orderBy'];\n\t\t}\n\t\t$OrderBy = $_REQUEST['orderBy'] ? \"{$Object}.{$OrderByTmp} {$_REQUEST['orderByDirection']}\" : \"{$Object}.ID DESC\";\n\t\t$Query = '';\n\t\t$Join = '';\n\t\tif($Columns != null && $QueryData != null) {\n\t\t\t$Columns = explode(',', $Columns);\t\n\t\t\t$subObjArray = array();\n\t\t\tforeach ($Columns as $Column) {\n\t\t\t\tif($Column == 'ID') {\n\t\t\t\t\t$ID = (int)$QueryData;\n\t\t\t\t\t$Query .= \"$Object.ID='{$ID}' {$searchType} \";\n\t\t\t\t} else {\n\t\t\t\t\tif(count(explode('.',$Column))>1){\n\t\t\t\t\t\t$relation = explode('.',$Column);\n\t\t\t\t\t\t$tmpObj = Object::create($Object);\n\t\t\t\t\t\t$has_one = $tmpObj->has_one();\n\t\t\t\t\t\t$subObj = '';\n\t\t\t\t\t\tforeach($has_one as $key=>$value) {\n\t\t\t\t\t\t\tif($key == $relation[0]) {\n\t\t\t\t\t\t\t\t$subObj = $value;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!in_array($subObj, $subObjArray)) {\n\t\t\t\t\t\t\t$Join .= \"LEFT JOIN $subObj ON $subObj.ID = $Object.{$relation[0]}ID \";\n\t\t\t\t\t\t\t$subObjArray[] = $subObj;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$Query .= \"$subObj.{$relation[1]} LIKE '%$QueryData%' {$searchType} \";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$parentClass = get_parent_class($Object);\n\t\t\t\t\t\tif($parentClass != 'Object' && $parentClass != 'DataObject') {\n\t\t\t\t\t\t\t//$Join .= \"LEFT JOIN {$parentClass} ON {$parentClass}.ID = {$Object}.ID \";\n\t\t\t\t\t\t\t$pTmpObj = Object::create($parentClass);\n\t\t\t\t\t\t\t$arr = $pTmpObj->stat('db');\n\t\t\t\t\t\t\tif(isset($arr[$Column])) {\n\t\t\t\t\t\t\t\t$Query .= \"$parentClass.$Column LIKE '%$QueryData%' {$searchType} \";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$tmpObj = Object::create($Object);\n\t\t\t\t\t\t$arr = $tmpObj->stat('db');\n\t\t\t\t\t\t//print_r($arr);\n\t\t\t\t\t\tif(isset($arr[$Column])) {\n\t\t\t\t\t\t\t$Query .= \"$Object.$Column LIKE '%$QueryData%' {$searchType} \";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$Query = ($searchType == \"AND\") ? substr($Query, 0, strlen($Query)-5) : substr($Query, 0, strlen($Query)-4);\n\t\t\tif($startDate != null && $endDate != null) {\n\t\t\t\t$Query .= \" AND (DATE(TreeObject.Created) >= DATE('$startDate') AND DATE(TreeObject.Created) <= DATE('$endDate'))\";\n\t\t\t}\n\t\t} elseif ($startDate != null && $endDate != null) {\n\t\t\t$Query .= \"(DATE(TreeObject.Created) >= DATE('$startDate') AND DATE(TreeObject.Created) <= DATE('$endDate'))\";\n\t\t}\n\t\tif (count($extraParams) > 0) {\n\t\t\tforeach ($extraParams as $param) {\n\t\t\t\t$split = explode(':',$param);\n\t\t\t\tif (count($split) == 2) {\n\t\t\t\t\tif (strpos($split[0], \"[sudo]\") === false) {\n\t\t\t\t\t\tif ($Query == null || $Query == \"\") {\n\t\t\t\t\t\t\t$Query .= \"(`{$split[0]}` = '{$split[1]}')\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$Query .= \" AND (`{$split[0]}` = '{$split[1]}')\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$split[0] = substr($split[0], 6);\n\t\t\t\t\t\t$sudoParams[] = $split;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//echo $Query;\n\t\tif($results = DataObject::get($Object, $Query, $OrderBy, $Join, \"{$SQL_start},{$SQL_limit}\")) {\n\t\t\tif (count($sudoParams) > 0) {\n\t\t\t\tforeach ($sudoParams as $sudo) {\n\t\t\t\t\tforeach($results as $result) {\n\t\t\t\t\t\tif ($result->$sudo[0] != $sudo[1]) $results->remove($result);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$f = new JSONDataFormatter(); \n\t\t\tif($metadata == true) {\n\t\t\t\t$json = $f->convertDataObjectSet($results, null, $this->generateMetaData($Object));\n\t\t\t} else {\n\t\t\t\t$json = $f->convertDataObjectSet($results, null, '');\n\t\t\t}\n\t\t\tif($treeModel == true){\n\t\t\t\t$json = $this->update_with_tree_data($results, $json);\n\t\t\t}\n\t\t\tif($columnModel == true) {\n\t\t\t\t$json = $this->update_with_column_model($Object, $json, $columnModelParams);\n\t\t\t}\n\t\t\treturn $json;\n\t\t} else {\n\t\t\treturn $this->update_with_column_model($Object, '{\"results\": 0, \"rows\":[], \"query\":\"'.$Query.'\", \"join\":\"'.$Join.'\", '.$this->generateMetaData($Object).' \"tree\":[] }', $columnModelParams);\n\t\t}\n\t}", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('idventa', $this->idventa);\n $criteria->compare('idboleto', $this->idboleto);\n $criteria->compare('fecha', $this->fecha, true);\n $criteria->compare('hora', $this->hora, true);\n $criteria->compare('cantidad', $this->cantidad, true);\n $criteria->compare('total', $this->total);\n $criteria->compare('estado','activo');\n $criteria->compare('nombre', $this->nombre, true);\n\n $criteria->compare('cedula', $this->cedula, true);\n\n $criteria->compare('idcajero', Yii::app()->session['id']);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria=new CDbCriteria;\n\n $criteria->compare('id',$this->id);\n $criteria->compare('data',$this->data,true);\n $criteria->compare('signature',$this->signature,true);\n $criteria->compare('create_time',$this->create_time,true);\n $criteria->compare('err_code',$this->err_code,true);\n $criteria->compare('err_description',$this->err_description,true);\n $criteria->compare('version',$this->version);\n $criteria->compare('status',$this->status,true);\n $criteria->compare('type',$this->type,true);\n $criteria->compare('err_erc',$this->err_erc,true);\n $criteria->compare('redirect_to',$this->redirect_to,true);\n $criteria->compare('token',$this->token,true);\n $criteria->compare('card_token',$this->card_token,true);\n $criteria->compare('payment_id',$this->payment_id);\n $criteria->compare('public_key',$this->public_key,true);\n $criteria->compare('acq_id',$this->acq_id);\n $criteria->compare('order_id',$this->order_id,true);\n $criteria->compare('liqpay_order_id',$this->liqpay_order_id,true);\n $criteria->compare('description',$this->description,true);\n $criteria->compare('sender_phone',$this->sender_phone,true);\n $criteria->compare('sender_card_mask2',$this->sender_card_mask2,true);\n $criteria->compare('sender_card_bank',$this->sender_card_bank,true);\n $criteria->compare('sender_card_country',$this->sender_card_country,true);\n $criteria->compare('ip',$this->ip,true);\n $criteria->compare('info',$this->info,true);\n $criteria->compare('customer',$this->customer,true);\n $criteria->compare('amount',$this->amount);\n $criteria->compare('currency',$this->currency,true);\n $criteria->compare('sender_commission',$this->sender_commission,true);\n $criteria->compare('receiver_commission',$this->receiver_commission,true);\n $criteria->compare('agent_commission',$this->agent_commission,true);\n $criteria->compare('completion_date',$this->completion_date,true);\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search() {\n // should not be searched.\n \n $nombre = \"\";\n $apellido = \"\";\n $nombres = explode(\" \",$this->cliente_nombre);\n if(count($nombres) == 1){\n $nombre = $this->cliente_nombre;\n $apellido = $this->cliente_nombre;\n }\n elseif(count($nombres) == 2){\n $nombre = $nombres[0];\n $apellido = $nombres[1];\n }\n \n $criteria = new CDbCriteria;\n $criteria->with = array('departamento', 'tipoContrato', 'cliente');\n $criteria->join .= 'join departamento as d on d.id = t.departamento_id '\n . ' join propiedad as p on p.id = d.propiedad_id'\n . ' join tipo_contrato as tipo on tipo.id = t.tipo_contrato_id '\n . ' join cliente as c on c.id = t.cliente_id '\n . ' join usuario as u on u.id = c.usuario_id ';\n \n $arreglo = explode(\" \",$this->cliente_nombre);\n $nombreApellido = array();\n foreach($arreglo as $palabra){\n if(trim($palabra)!= ''){\n $nombreApellido[]=$palabra;\n }\n }\n $criteriaNombreUser1 = new CDbCriteria();\n $palabras = count($nombreApellido);\n if($palabras == 1){\n $busqueda = $nombreApellido[0];\n if(trim($busqueda) != ''){\n $criteriaNombreUser1->compare('u.nombre',$busqueda,true);\n $criteriaNombreUser1->compare('u.apellido',$busqueda,true,'OR');\n }\n }\n\n if($palabras == 2){\n $nombre = $nombreApellido[0];\n $apellido = $nombreApellido[1];\n $criteriaNombreUser1->compare('u.nombre',$nombre,true);\n $criteriaNombreUser1->compare('u.apellido',$apellido,true);\n }\n\n $criteria->compare('folio', $this->folio);\n $criteria->mergeWith($criteriaNombreUser1,'AND');\n \n $criteria->compare('fecha_inicio', Tools::fixFecha($this->fecha_inicio), true);\n $criteria->compare('p.nombre', $this->propiedad_nombre, true);\n $criteria->compare('d.numero', $this->depto_nombre, true);\n $criteria->compare('c.rut', $this->cliente_rut, true);\n $criteria->compare('t.vigente', 1);\n \n if(Yii::app()->user->rol == 'cliente'){\n $cliente = Cliente::model()->findByAttributes(array('usuario_id'=>Yii::app()->user->id));\n if($cliente!=null){\n $criteria->compare('t.cliente_id',$cliente->id);\n }\n else{\n $criteria->compare('t.cliente_id',-1);\n }\n }\n \n if(Yii::app()->user->rol == 'propietario'){\n $criteriaPropietario = new CDbCriteria();\n $contratos = Contrato::model()->relacionadosConPropietario(Yii::app()->user->id);\n foreach($contratos as $contrato_id){\n $criteriaPropietario->compare('t.id', $contrato_id, false,'OR'); \n }\n $criteria->mergeWith($criteriaPropietario,'AND');\n }\n \n \n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'sort' => array(\n 'attributes' => array(\n 'depto_nombre' => array(\n 'asc' => 'd.numero',\n 'desc' => 'd.numero DESC',\n ),\n 'tipo_nombre' => array(\n 'asc' => 'tipo.nombre',\n 'desc' => 'tipo.nombre DESC',\n ),\n 'cliente_rut' => array(\n 'asc' => 'c.rut',\n 'desc' => 'c.rut DESC',\n ),\n 'cliente_nombre' => array(\n 'asc' => 'u.apellido,u.nombre',\n 'desc' => 'u.apellido DESC,u.nombre DESC',\n ),\n 'propiedad_nombre' => array(\n 'asc' => 'p.nombre',\n 'desc' => 'p.nombre DESC',\n ),\n '*',\n ),\n ),\n ));\n }", "public function search()\n {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria=new CDbCriteria;\n\n $criteria->compare('id',$this->id);\n $criteria->compare('pid',$this->pid);\n $criteria->compare('article',$this->article,true);\n $criteria->compare('group_1',$this->group_1,true);\n $criteria->compare('key_group_1',$this->key_group_1);\n $criteria->compare('group_2',$this->group_2,true);\n $criteria->compare('key_group_2',$this->key_group_2);\n $criteria->compare('group_3',$this->group_3,true);\n $criteria->compare('key_group_3',$this->key_group_3);\n $criteria->compare('f_brand',$this->f_brand,true);\n $criteria->compare('f_s_brand',$this->f_s_brand);\n $criteria->compare('f_country',$this->f_country,true);\n $criteria->compare('f_s_country',$this->f_s_country);\n $criteria->compare('f_region',$this->f_region,true);\n $criteria->compare('f_s_region',$this->f_s_region);\n $criteria->compare('f_alcohol',$this->f_alcohol,true);\n $criteria->compare('f_s_alcohol',$this->f_s_alcohol);\n $criteria->compare('f_taste',$this->f_taste,true);\n $criteria->compare('f_s_taste',$this->f_s_taste);\n $criteria->compare('f_sugar',$this->f_sugar,true);\n $criteria->compare('f_s_sugar',$this->f_s_sugar);\n $criteria->compare('f_grape_sort',$this->f_grape_sort,true);\n $criteria->compare('f_s_grape_sort',$this->f_s_grape_sort);\n $criteria->compare('f_vintage_year',$this->f_vintage_year,true);\n $criteria->compare('f_s_vintage_year',$this->f_s_vintage_year);\n $criteria->compare('f_color',$this->f_color,true);\n $criteria->compare('f_s_color',$this->f_s_color);\n $criteria->compare('f_excerpt',$this->f_excerpt,true);\n $criteria->compare('f_s_excerpt',$this->f_s_excerpt);\n $criteria->compare('f_fortress',$this->f_fortress);\n $criteria->compare('f_volume',$this->f_volume,true);\n $criteria->compare('f_packaging',$this->f_packaging,true);\n $criteria->compare('i_name_sku',$this->i_name_sku,true);\n $criteria->compare('i_availability',$this->i_availability);\n $criteria->compare('i_popular',$this->i_popular);\n $criteria->compare('i_limitedly',$this->i_limitedly);\n $criteria->compare('i_old_price',$this->i_old_price,true);\n $criteria->compare('i_price',$this->i_price,true);\n $criteria->compare('i_manufacturer_importer',$this->i_manufacturer_importer,true);\n $criteria->compare('i_supplier',$this->i_supplier,true);\n $criteria->compare('d_desc_product',$this->d_desc_product,true);\n $criteria->compare('d_photo_small',$this->d_photo_small,true);\n $criteria->compare('d_photo_middle',$this->d_photo_middle,true);\n $criteria->compare('d_photo_high',$this->d_photo_high,true);\n $criteria->compare('d_link_manuf',$this->d_link_manuf,true);\n $criteria->compare('d_logo_manuf',$this->d_logo_manuf,true);\n $criteria->compare('t_url',$this->t_url,true);\n $criteria->compare('t_meta_title',$this->t_meta_title,true);\n $criteria->compare('t_meta_keyword',$this->t_meta_keyword,true);\n $criteria->compare('t_meta_description',$this->t_meta_description,true);\n \n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n 'pagination'=>array(\n 'pageSize' => 50,\n )));\n }", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n\n $criteria->compare('created_at', $this->created_at, true);\n\n $criteria->compare('updated_at', $this->updated_at, true);\n\n $criteria->compare('employee_no', $this->employee_no, true);\n\n $criteria->compare('firstname', $this->firstname, true);\n\n $criteria->compare('middlename', $this->middlename, true);\n\n $criteria->compare('lastname', $this->lastname, true);\n\n $criteria->compare('mobile', $this->mobile, true);\n\n $criteria->compare('phone', $this->phone, true);\n\n $criteria->compare('email', $this->email, true);\n\n $criteria->compare('birthdate', $this->birthdate, true);\n\n $criteria->compare('civil_status_id', $this->civil_status_id);\n\n $criteria->compare('address1', $this->address1, true);\n\n $criteria->compare('address2', $this->address2, true);\n\n $criteria->compare('region_id', $this->region_id);\n\n $criteria->compare('province_id', $this->province_id);\n\n $criteria->compare('municipality_id', $this->municipality_id);\n\n $criteria->compare('barangay_id', $this->barangay_id);\n\n $criteria->compare('office_id', $this->office_id);\n\n $criteria->compare('citizenship_id', $this->citizenship_id);\n\n $criteria->compare('branch_id', $this->branch_id);\n\n $criteria->compare('contact_person_id', $this->contact_person_id);\n\n $criteria->compare('occupation_id', $this->occupation_id);\n\n $criteria->compare('department_id', $this->department_id);\n\n $criteria->compare('manager_id', $this->manager_id);\n\n $criteria->compare('location_id', $this->location_id);\n\n $criteria->compare('is_agent', $this->is_agent);\n\n $criteria->compare('is_active', $this->is_active);\n\n $criteria->compare('is_deleted', $this->is_deleted);\n\n $criteria->order = 't.created_at DESC';\n\n return new CActiveDataProvider('Employees', array(\n 'criteria' => $criteria,\n 'pagination' => array(\n 'pageSize' => 15,\n )\n ));\n }", "public function searchRoom()\n {\n $o_response = new \\stdclass();\n $from = Input::get('from');\n $to = Input::get('to');\n $arrEvent = $this->checkEvent($from,$to);\n $room = DB::table('rooms')->select('*')->get();\n\n $result = array();\n foreach($room as $key => $value){\n $result[] = $value->r_name;\n }\n $searchroom = array();\n foreach($arrEvent as $key => $value){\n $searchroom[] = $value->r_name;\n }\n foreach ($result as $key => $value) {\n if(in_array($value, $searchroom)){\n unset($result[$key]);\n }\n }\n if($result){\n $o_response->status = 'ok';\n $o_response->message = $result;\n }else{\n $o_response->status = 'error';\n }\n echo json_encode($o_response);\n }", "function fetch_events($event_id=SELECT_ALL_EVENTS, $sdate_time=MIN_DATE_TIME, $edate_time=MAX_DATE_TIME,\n\t\t$date_time_option=SELECT_DT_BOTH, $privacy=PRIVACY_ALL, $tag_name=NULL) {\n\tglobal $cxn;\n\t// Initialize variables\n\t$ret_events= NULL;\n\t\n\t$errArr=init_errArr(__FUNCTION__);\n\ttry {\n\t\t// initialize variables\n\t\t$where = ZERO_LENGTH_STRING;\n\t\t$param_types = ZERO_LENGTH_STRING;\n\t\t$param_values = array();\n\t\t$sql_and = \" \"; \n\t\t// Set up event id selection\n\t\tif ($event_id != NULL AND $event_id != SELECT_ALL_EVENTS) {\n\t\t\t$where = $where . $sql_and . \" eID = ? \";\n\t\t\t$sql_and = \" AND \"; // set up \"AND\" value tobe used in following settings\n\t\t\t$param_types = $param_types . \"i\"; // add parameter type\n\t\t\t$param_values [] = $event_id; // add parameter value\n\t\t}\n\t\t// Set up date and time selection\n\t\tif (($sdate_time != NULL AND $sdate_time != MIN_DATE_TIME) OR\n\t\t\t\t($edate_time != NULL AND $edate_time != MAX_DATE_TIME)) {\n\t\t\t// Check and set up if need to compare both (start and end time) or just start or end time\n\t\t\t// Set up Start date\n\t\t\tif ($date_time_option == SELECT_DT_START) {\n\t\t\t\t$where = $where . $sql_and .\n\t\t\t\t\" (sdate_time BETWEEN ? AND ? ) \";\n\t\t\t\t$param_types = $param_types . \"ss\"; // add parameter type\n\t\t\t\tarray_push($param_values, $sdate_time, $edate_time); // add parameter value\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Set up end date\n\t\t\t\tif ($date_time_option == SELECT_DT_END) {\n\t\t\t\t\t$where = $where . $sql_and .\n\t\t\t\t\t\" (edate_time BETWEEN ? AND ? ) \";\n\t\t\t\t\t$param_types = $param_types . \"ss\"; // add parameter type\n\t\t\t\t\tarray_push($param_values, $sdate_time, $edate_time); // add parameter value\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$where = $where . $sql_and .\n\t\t\t\t\t\" ( (sdate_time BETWEEN ? AND ? )\"\n\t\t\t\t\t\t\t. \" OR \" .\n\t\t\t\t\t\t\t\" (edate_time BETWEEN ? AND ? ) )\";\n\t\t\t\t\t$param_types = $param_types . \"ssss\"; // add parameter type\n\t\t\t\t\tarray_push($param_values,$sdate_time, $edate_time, $sdate_time, $edate_time); // add parameter value\n\t\t\t\t}\n\t\t\t}\n\t\t\t$sql_and = \" AND \"; // set up \"AND\" value tobe used in following settings\n\t\t}\n\t\t\n\t\t// Set up privacy \n\t\tif ($privacy != NULL AND $privacy != PRIVACY_ALL) {\n\t\t\t$where = $where . $sql_and . \" privacy = ? \";\n\t\t\t$sql_and = \" AND \"; // set up \"AND\" value tobe used in following settings\n\t\t\t$param_types = $param_types . \"s\"; // add parameter type\n\t\t\t$param_values [] = $privacy; // add parameter value\n\t\t}\n\t\t//\n\t\t//\n\t\tif ($tag_name != NULL) {\n\t\t\t$where = $where . $sql_and . \" ( tag_1=? OR tag_2=? OR tag_3=? OR tag_4=? OR tag_5=? OR tag_6=? ) \";\n\t\t\t$sql_and = \" AND \"; // set up \"AND\" value tobe used in following settings\n\t\t\t$i = 0;\n\t\t\tdo {\n\t\t\t\t$param_types = $param_types . \"s\" ; // add parameter type\n\t\t\t\t$param_values [] = $tag_name; // add parameter value\n\t\t\t\t$i++;\n\t\t\t} while ($i < 6);\n\t\t}\n\t\t// Add WHERE keyword\n\t\tif (trim($where) !== ZERO_LENGTH_STRING) {\n\t\t\t$where = \" WHERE \" . $where;\n\t\t}\n\t\t// build sqlstring \n\t\t$sqlString = \n\t\t \"SELECT * FROM events_all_v \"\n\t\t \t\t. $where .\n\t\t \" ORDER BY sdate_time, edate_time, eID\";\n\t\t// prepare statement\n\t\t$stmt = $cxn->prepare($sqlString);\n\t\t\t\t\n\t\t// bind parameters\n\t\t// Create array of types and their values\n\t\t$params=array_merge( array($param_types), $param_values);\n\t\t\n\t\tif (count($param_values) > 0) {\n\t\t\tcall_user_func_array ( array($stmt, \"bind_param\"), ref_values($params) );\n\t\t}\n\t\t// execute statement\n\t\t$stmt->execute();\n\t\t// Store result\n\t\t/* Bind results to variables */\n\t\tbind_array($stmt, $row);\n\t\twhile ($stmt->fetch()) {\n\t\t\t$ret_events[]=cvt_to_key_values($row);\n\t\t}\n\t}\n\tcatch (mysqli_sql_exception\t$err)\n\t{\n\t\t// Error settings\n\t\t$err_code=1;\n\t\t$err_descr=\"Error selecting events, event id: \" . $event_id .\n\t\t\" Date time: \" . $start_date_time . \" \" . $end_date_time .\n\t\t\" Date time option: \" . $date_time_option . \" privacy: \" . $privacy;\n\t\tset_errArr($err, $err_code, $err_descr, $errArr);\n\t}\n\t// Return Error code\n\t$errArr[ERR_AFFECTED_ROWS] = $cxn->affected_rows;\n\t$errArr[ERR_SQLSTATE] = $cxn->sqlstate;\n\t$errArr[ERR_SQLSTATE_MSG] = $cxn->error;\n\treturn array($errArr, $ret_events);\n}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\t\t\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('nu_Contrato',$this->nu_Contrato,true);\n\t\t$criteria->compare('vl_Contrato',$this->vl_Contrato,true);\n\t\t$criteria->compare('date_format(dt_AssinaturaContrato,\"%d/%m/%Y\")',$this->dt_AssinaturaContrato,true);\n\t\t$criteria->compare('de_ObjetivoContrato',$this->de_ObjetivoContrato,true);\n\t\t$criteria->compare('nu_ProcessoLicitatorio',$this->nu_ProcessoLicitatorio,true);\n\t\t$criteria->compare('cd_Moeda',$this->cd_Moeda);\n\t\t$criteria->compare('tp_PessoaContratado',$this->tp_PessoaContratado);\n\t\t$criteria->compare('cd_CicContratado',$this->cd_CicContratado,true);\n\t\t$criteria->compare('nm_Contratado',$this->nm_Contratado,true);\n\t\t$criteria->compare('date_format(dt_VencimentoContrato,\"%d/%m/%Y\")',$this->dt_VencimentoContrato,true);\n\t\t$criteria->compare('nu_DiarioOficial',$this->nu_DiarioOficial,true);\n\t\t$criteria->compare('date_format(dt_Publicacao,\"%d/%m/%Y\")',$this->dt_Publicacao,true);\n\t\t$criteria->compare('st_RecebeValor',$this->st_RecebeValor);\n\t\t$criteria->compare('nu_CertidaoINSS',$this->nu_CertidaoINSS,true);\n\t\t$criteria->compare('date_format(dt_CertidaoINSS,\"%d/%m/%Y\")',$this->dt_CertidaoINSS,true);\n\t\t$criteria->compare('date_format(dt_ValidadeINSS,\"%d/%m/%Y\")',$this->dt_ValidadeINSS,true);\n\t\t$criteria->compare('nu_CertidaoFGTS',$this->nu_CertidaoFGTS,true);\n\t\t$criteria->compare('date_format(dt_CertidaoFGTS,\"%d/%m/%Y\")',$this->dt_CertidaoFGTS,true);\n\t\t$criteria->compare('date_format(dt_ValidadeFGTS,\"%d/%m/%Y\")',$this->dt_ValidadeFGTS,true);\n\t\t$criteria->compare('nu_CertidaoFazendaEstadual',$this->nu_CertidaoFazendaEstadual,true);\n\t\t$criteria->compare('date_format(dt_CertidaoFazendaEstadual,\"%d/%m/%Y\")', $this->dt_CertidaoFazendaEstadual,true);\n\t\t$criteria->compare('date_format(dt_ValidadeFazendaEstadual,\"%d/%m/%Y\")', $this->dt_ValidadeFazendaEstadual,true);\n\t\t$criteria->compare('nu_CertidaoFazendaMunicipal',$this->nu_CertidaoFazendaMunicipal,true);\n\t\t$criteria->compare('date_format(dt_CertidaoFazendaMunicipal,\"%d/%m/%Y\")',$this->dt_CertidaoFazendaMunicipal,true);\n\t\t$criteria->compare('date_format(dt_ValidadeFazendaMunicipal,\"%d/%m/%Y\")',$this->dt_ValidadeFazendaMunicipal,true);\n\t\t$criteria->compare('nu_CertidaoFazendaFederal',$this->nu_CertidaoFazendaFederal,true);\n\t\t$criteria->compare('date_format(dt_CertidaoFazendaFederal,\"%d/%m/%Y\")',$this->dt_CertidaoFazendaFederal,true);\n\t\t$criteria->compare('date_format(dt_ValidadeFazendaFederal,\"%d/%m/%Y\")',$this->dt_ValidadeFazendaFederal,true);\n\t\t$criteria->compare('nu_CertidaoOutras',$this->nu_CertidaoOutras,true);\n\t\t$criteria->compare('date_format(dt_CertidaoOutras,\"%d/%m/%Y\")',$this->dt_CertidaoOutras,true);\n\t\t$criteria->compare('date_format(dt_ValidadeCertidaoOutras,\"%d/%m/%Y\")',$this->dt_ValidadeCertidaoOutras,true);\n\t\t$criteria->compare('tp_Contrato',$this->tp_Contrato);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n $arreglo = explode(\" \",$this->cliente_nombre);\n $nombreApellido = array();\n foreach($arreglo as $palabra){\n if(trim($palabra)!= ''){\n $nombreApellido[]=$palabra;\n }\n }\n $criteriaNombreUser1 = new CDbCriteria();\n $palabras = count($nombreApellido);\n if($palabras == 1){\n $busqueda = $nombreApellido[0];\n if(trim($busqueda) != ''){\n $criteriaNombreUser1->compare('u.nombre',$busqueda,true);\n $criteriaNombreUser1->compare('u.apellido',$busqueda,true,'OR');\n }\n }\n\n if($palabras == 2){\n $nombre = $nombreApellido[0];\n $apellido = $nombreApellido[1];\n $criteriaNombreUser1->compare('u.nombre',$nombre,true);\n $criteriaNombreUser1->compare('u.apellido',$apellido,true);\n }\n\n $criteria->compare('id',$this->id);\n $criteria->mergeWith($criteriaNombreUser1,'AND');\n\n\t\t\n\t\t$criteria->compare('rol',$this->rol,true);\n\t\t$criteria->compare('causa',$this->causa,true);\n\t\t$criteria->compare('contrato_id',$this->contrato_id);\n $criteria->compare('f.nombre',$this->formato,true);\n $criteria->join = \n ' join contrato on contrato.id = t.contrato_id'\n . ' join cliente as c on c.id = contrato.cliente_id '\n . ' join usuario as u on u.id = c.usuario_id '\n . ' join formato_demanda as f on f.id = t.formato_demanda_id';\n $criteria->compare('contrato.folio',$this->folio);\n \n if(Yii::app()->user->rol == 'propietario'){\n $criteriaPropietario = new CDbCriteria();\n $contratos = Contrato::model()->relacionadosConPropietario(Yii::app()->user->id);\n foreach($contratos as $contrato_id){\n $criteriaPropietario->compare('contrato.id', $contrato_id, false,'OR'); \n }\n $criteria->mergeWith($criteriaPropietario,'AND');\n }\n \n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n 'sort'=>array(\n\t\t 'attributes'=>array(\n\t\t 'folio'=>array(\n\t\t 'asc'=>'contrato.folio',\n\t\t 'desc'=>'contrato.folio DESC',\n\t\t ),\n 'cliente_rut'=>array(\n\t\t 'asc'=>'c.rut',\n\t\t 'desc'=>'c.rut DESC',\n\t\t ),\n 'cliente_nombre'=>array(\n\t\t 'asc'=>'u.apellido,u.nombre',\n\t\t 'desc'=>'u.apellido DESC,u.nombre DESC',\n\t\t ),\n 'formato'=>array(\n\t\t 'asc'=>'f.nombre',\n\t\t 'desc'=>'f.nombre DESC',\n\t\t ),\n\t\t '*',\n\t\t ),\n\t\t ),\n\t\t));\n\t}", "function get_events($start, $event_limit, $cond=array())\r\n\t{\r\n\t\t$c_filter = '';\r\n\t\tif (is_domain_user() == true) {\r\n\t\t\t$c_filter .= ' AND TL.domain_origin = '.get_domain_auth_id();\r\n\t\t}\r\n\t\tif (valid_array($cond)) {\r\n\t\t\t$c_filter .= $this->CI->custom_db->get_custom_condition($cond);\r\n\t\t}\r\n\t\tif (is_app_user()) {\r\n\t\t\t$c_filter .= ' AND TL.created_by_id = '.intval($this->CI->entity_user_id);\r\n\t\t}\r\n\t\t$query = 'select TL.*, TLE.event_title, TLE.event_icon \r\n\t\t\t\tfrom timeline TL \r\n\t\t\t\tJOIN timeline_master_event TLE \r\n\t\t\t\twhere TL.event_origin=TLE.origin '.$c_filter.' order by TL.origin desc limit '.$start.','.$event_limit;\r\n\t\treturn $this->CI->db->query($query)->result_array();\r\n\t}", "public function search($pagination = array( 'pageSize'=>100))\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('pedido',$this->pedido,true);\n\t\t$criteria->compare('documento_cliente',$this->documento_cliente,true);\n\t\t$criteria->compare('producto0.producto',$this->producto,true);\n\t\t$criteria->compare('fecha_cerrado',$this->fecha_cerrado,true);\n\t\t$criteria->compare('tecnico.tecnico_id',$this->tecnico_id,true);\n\t\t$criteria->compare('revisor0.revisor',$this->revisor,true);\n\t\t$criteria->compare('plaza0.plaza',$this->plaza,true);\n\t\t$criteria->compare('diagnosticoTecnico.diagnostico_tecnico',$this->diagnostico_tecnico,true);\n\t\t$criteria->compare('hallazgos0.hallazgos',$this->hallazgos,true);\n\t\t$criteria->compare('motivoOutlier.motivo_outlier',$this->motivo_outlier,true);\n\t\t$criteria->compare('solucion0.solucion',$this->solucion,true);\n\t\t$criteria->compare('acciondemejora',$this->acciondemejora,true);\n\t\t$criteria->compare('observaciones',$this->observaciones,true);\n\t\t$criteria->compare('responsableDano.responsable_dano',$this->responsable_dano,true);\n\t\t$criteria->compare('descuento',$this->descuento,true);\n\t\t$criteria->compare('rere',$this->rere,true);\n\t\t$criteria->compare('liderDePlaza.lider_de_plaza',$this->lider_de_plaza,true);\n\t\t$criteria->compare('historico_pedido',$this->historico_pedido,true);\n\t\t$criteria->compare('creadopor',$this->creadopor,true);\n\t\t$criteria->compare('modificadopor',$this->modificadopor,true);\n\t\t$criteria->compare('fechamodificacion',$this->fechamodificacion,true);\n\t\t$criteria->compare('fechacreacion',$this->fechacreacion,true);\n /*$criteria->with = array( \t\t\t'solucion0'=>array('select'=>'id'), \t\t\t'diagnosticoTecnico'=>array('select'=>'id'), \t\t\t'hallazgos0'=>array('select'=>'id'), \t\t\t'liderDePlaza'=>array('select'=>'id'), \t\t\t'plaza0'=>array('select'=>'id'), \t\t\t'producto0'=>array('select'=>'id'), \t\t\t'responsableDano'=>array('select'=>'id'), \t\t\t'revisor0'=>array('select'=>'id'), \t\t\t'tecnico'=>array('select'=>'id'), \t\t\t'motivoOutlier'=>array('select'=>'id'), \t\t\t'evidenciasxdiagnosticotecnicos'=>array('select'=>'id'), \t\t\t'evidenciasxhallazgoses'=>array('select'=>'id'), \t\t\t'evidenciasxmotivos'=>array('select'=>'id'), \t\t\t'evidenciasxsolucions'=>array('select'=>'id'), \t\t\t'imagenesAntes'=>array('select'=>'id'), \t\t\t'imagenesDespues'=>array('select'=>'id'), \n );*/\n $sort = new CSort();\n $sort->attributes = array('id');\n $sort->defaultOrder = array('id' => 'DESC');\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n 'pagination'=>$pagination,\n 'sort' => $sort,\n\t\t));\n\t\t\t\n\t}", "public function search($config, $data, $srs, $extent)\n {\n // First, get DBAL connection service, either given one or default one\n $connection = $config['class_options']['connection'] ? : 'default';\n $connection = $this->container->get('doctrine.dbal.' . $connection . '_connection');\n $qb = $connection->createQueryBuilder();\n\n // Build SELECT\n $select = implode(', ', array_map(function($attribute)\n {\n return 't.' . $attribute;\n }, $config['class_options']['attributes']));\n // Add geometry to SELECT\n // // @todo: Platform independency (ST_AsGeoJSON)\n $select .= ', ST_AsGeoJSON(' . $config['class_options']['geometry_attribute'] . ') as geom';\n\n $qb->select($select);\n // Add FROM\n $qb->from($config['class_options']['relation'], 't');\n\n // Build WHERE condition\n $cond = $qb->expr()->andx();\n $params = array();\n\n // This function switches by compare configuration (exact, like, ilike, ...)\n $createExpr = function($key, $value) use ($cond, $config, $connection, &$params, $qb) {\n if (array_key_exists($key, $config['form'])) {\n $cfg = $config['form'][$key];\n } else {\n $cfg = $config['form']['\"' . $key . '\"'];\n }\n\n $compare = array_key_exists('compare', $cfg) ? $cfg['compare'] : null;\n switch($compare) {\n case 'exact':\n $cond->add($qb->expr()->eq('t.' . $key, ':' . $key));\n $params[$key] = $value;\n break;\n case 'iexact':\n $cond->add($qb->expr()->eq('LOWER(t.' . $key . ')', 'LOWER(:' .$key . ')'));\n $params[$key] = $value;\n break;\n\n\n case 'like':\n case 'like-left':\n case 'like-right':\n $cond->add($qb->expr()->like('t.' . $key, ':' . $key));\n\n // First, asume two-sided search\n $prefix = '%';\n $suffix = '%';\n $op = explode('-', $compare);\n if(2 === count($op) && 'left' === $op[1]) {\n // For left-sided search remove suffix\n $suffix = '';\n }\n if(2 === count($op) && 'right' === $op[1]) {\n // For right-sided search remove prefix\n $prefix = '';\n }\n $params[$key] = $prefix . $value . $suffix;\n break;\n case 'ilike':\n case 'ilike-left':\n case 'ilike-right':\n default:\n // First, asume two-sided search\n $prefix = '%';\n $suffix = '%';\n if(is_string($compare)) {\n $op = explode('-', $compare);\n if(2 === count($op) && 'left' === $op[1]) {\n // For left-sided search remove suffix\n $suffix = '';\n }\n if(2 === count($op) && 'right' === $op[1]) {\n // For right-sided search remove prefix\n $prefix = '';\n }\n }\n\n if($connection->getDatabasePlatform() instanceof PostgreSqlPlatform) {\n $cond->add($qb->expr()->comparison('t.' . $key, 'ILIKE', ':' . $key));\n } else {\n $cond->add($qb->expr()->like('LOWER(t.' . $key . ')', 'LOWER(:' . $key . ')'));\n }\n\n $params[$key] = $prefix . $value . $suffix;\n }\n };\n\n foreach($data['form'] as $key => $value)\n {\n if(null === $value) {\n continue;\n }\n\n if (!array_key_exists($key, $config['form'])) {\n $cfg = $config['form']['\"' . $key . '\"'];\n } else {\n $cfg = $config['form'][$key];\n }\n if(array_key_exists($key, $data['autocomplete_keys']))\n {\n // Autocomplete value given, match to configured attribute\n $cond->add($qb->expr()->eq(\n 't.' . $cfg['autocomplete-key'], $data['autocomplete_keys'][$key]));\n } elseif (array_key_exists('split', $cfg)) {\n // Split\n $keys = $cfg['split'];\n $values = explode(' ', $value);\n for($i = 0; $i < count($keys); $i++)\n {\n $createExpr($keys[$i], $value);\n }\n } else {\n $createExpr($key, $value);\n }\n }\n $qb->where($cond);\n\n // Create prepared statement and execute\n $stmt = $connection->executeQuery($qb->getSql(), $params);\n $rows = $stmt->fetchAll();\n\n // Rewrite rows as GeoJSON features\n array_walk($rows, function(&$row)\n {\n $feature = array(\n 'type' => 'Feature',\n 'properties' => $row,\n 'geometry' => json_decode($row['geom'])\n );\n unset($feature['properties']['geom']);\n $row = $feature;\n });\n\n return $rows;\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n if($this->pesquisar == ''){\n \t\t$criteria->compare('id',$this->id,true);\n\n\t\t$criteria->compare('tipo_frete',$this->tipo_frete,true);\n\n\t\t$criteria->compare('valor_frete',$this->valor_frete,true);\n\n\t\t$criteria->compare('data_transacao',$this->data_transacao,true);\n\n\t\t$criteria->compare('anotacao',$this->anotacao,true);\n\n\t\t$criteria->compare('id_transaction',$this->id_transaction,true);\n\n\t\t$criteria->compare('taxas_extras',$this->taxas_extras,true);\n\n\t\t$criteria->compare('tipo_pagamento',$this->tipo_pagamento,true);\n\n\t\t$criteria->compare('status_transacao',$this->status_transacao,true);\n\n\t\t$criteria->compare('parcelas',$this->parcelas);\n\n\t\t$criteria->compare('usuarios_id',$this->usuarios_id,true);\n\n }else{\n \n \t\t$criteria->compare('id',$this->pesquisar,true,'OR');\n\n\t\t$criteria->compare('tipo_frete',$this->pesquisar,true,'OR');\n\n\t\t$criteria->compare('valor_frete',$this->pesquisar,true,'OR');\n\n\t\t$criteria->compare('data_transacao',$this->pesquisar,true,'OR');\n\n\t\t$criteria->compare('anotacao',$this->pesquisar,true,'OR');\n\n\t\t$criteria->compare('id_transaction',$this->pesquisar,true,'OR');\n\n\t\t$criteria->compare('taxas_extras',$this->pesquisar,true,'OR');\n\n\t\t$criteria->compare('tipo_pagamento',$this->pesquisar,true,'OR');\n\n\t\t$criteria->compare('status_transacao',$this->pesquisar,true,'OR');\n\n\t\t$criteria->compare('parcelas',$this->pesquisar,true,'OR');\n\n\t\t$criteria->compare('usuarios_id',$this->pesquisar,true,'OR');\n\n }\n\n\t\treturn new CActiveDataProvider(get_class($this), array(\n\t\t\t'criteria'=>$criteria,\n 'pagination'=>array(\n 'pageSize'=>Yii::app()->params['PageSize'],\n ),\n\t\t));\n\t}", "public function searchFiniquitados() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n \n $criteria = new CDbCriteria;\n $criteria->with = array('departamento', 'tipoContrato', 'cliente');\n $criteria->join .= 'join departamento as d on d.id = t.departamento_id '\n . ' join propiedad as p on p.id = d.propiedad_id'\n . ' join tipo_contrato as tipo on tipo.id = t.tipo_contrato_id '\n . ' join cliente as c on c.id = t.cliente_id '\n . ' join usuario as u on u.id = c.usuario_id ';\n \n $arreglo = explode(\" \",$this->cliente_nombre);\n $nombreApellido = array();\n foreach($arreglo as $palabra){\n if(trim($palabra)!= ''){\n $nombreApellido[]=$palabra;\n }\n }\n $criteriaNombreUser1 = new CDbCriteria();\n $palabras = count($nombreApellido);\n if($palabras == 1){\n $busqueda = $nombreApellido[0];\n if(trim($busqueda) != ''){\n $criteriaNombreUser1->compare('u.nombre',$busqueda,true);\n $criteriaNombreUser1->compare('u.apellido',$busqueda,true,'OR');\n }\n }\n\n if($palabras == 2){\n $nombre = $nombreApellido[0];\n $apellido = $nombreApellido[1];\n $criteriaNombreUser1->compare('u.nombre',$nombre,true);\n $criteriaNombreUser1->compare('u.apellido',$apellido,true);\n }\n\n $criteria->compare('folio', $this->folio);\n $criteria->mergeWith($criteriaNombreUser1,'AND');\n \n $criteria->compare('fecha_inicio', Tools::fixFecha($this->fecha_inicio), true);\n $criteria->compare('p.nombre', $this->propiedad_nombre, true);\n $criteria->compare('d.numero', $this->depto_nombre, true);\n $criteria->compare('c.rut', $this->cliente_rut, true);\n $criteria->compare('t.vigente', 0);\n $criteria->compare('t.fecha_finiquito', $this->fecha_finiquito,true);\n \n if(Yii::app()->user->rol == 'cliente'){\n $cliente = Cliente::model()->findByAttributes(array('usuario_id'=>Yii::app()->user->id));\n if($cliente!=null){\n $criteria->compare('t.cliente_id',$cliente->id);\n }\n else{\n $criteria->compare('t.cliente_id',-1);\n }\n }\n \n if(Yii::app()->user->rol == 'propietario'){\n $criteriaPropietario = new CDbCriteria();\n $contratos = Contrato::model()->relacionadosConPropietario(Yii::app()->user->id);\n foreach($contratos as $contrato_id){\n $criteriaPropietario->compare('t.id', $contrato_id, false,'OR'); \n }\n $criteria->mergeWith($criteriaPropietario,'AND');\n }\n \n \n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'sort' => array(\n 'attributes' => array(\n 'depto_nombre' => array(\n 'asc' => 'd.numero',\n 'desc' => 'd.numero DESC',\n ),\n 'tipo_nombre' => array(\n 'asc' => 'tipo.nombre',\n 'desc' => 'tipo.nombre DESC',\n ),\n 'cliente_rut' => array(\n 'asc' => 'c.rut',\n 'desc' => 'c.rut DESC',\n ),\n 'cliente_nombre' => array(\n 'asc' => 'u.apellido,u.nombre',\n 'desc' => 'u.apellido DESC,u.nombre DESC',\n ),\n 'propiedad_nombre' => array(\n 'asc' => 'p.nombre',\n 'desc' => 'p.nombre DESC',\n ),\n '*',\n ),\n ),\n ));\n }", "public function searchAvisos() {\n // should not be searched.\n \n $nombre = \"\";\n $apellido = \"\";\n $nombres = explode(\" \",$this->cliente_nombre);\n if(count($nombres) == 1){\n $nombre = $this->cliente_nombre;\n $apellido = $this->cliente_nombre;\n }\n elseif(count($nombres) == 2){\n $nombre = $nombres[0];\n $apellido = $nombres[1];\n }\n \n $criteria = new CDbCriteria;\n $criteria->with = array('departamento', 'tipoContrato', 'cliente');\n $criteria->join .= 'join departamento as d on d.id = t.departamento_id '\n . ' join propiedad as p on p.id = d.propiedad_id'\n . ' join tipo_contrato as tipo on tipo.id = t.tipo_contrato_id '\n . ' join cliente as c on c.id = t.cliente_id '\n . ' join usuario as u on u.id = c.usuario_id ';\n \n $arreglo = explode(\" \",$this->cliente_nombre);\n $nombreApellido = array();\n foreach($arreglo as $palabra){\n if(trim($palabra)!= ''){\n $nombreApellido[]=$palabra;\n }\n }\n $criteriaNombreUser1 = new CDbCriteria();\n $palabras = count($nombreApellido);\n if($palabras == 1){\n $busqueda = $nombreApellido[0];\n if(trim($busqueda) != ''){\n $criteriaNombreUser1->compare('u.nombre',$busqueda,true);\n $criteriaNombreUser1->compare('u.apellido',$busqueda,true,'OR');\n }\n }\n\n if($palabras == 2){\n $nombre = $nombreApellido[0];\n $apellido = $nombreApellido[1];\n $criteriaNombreUser1->compare('u.nombre',$nombre,true);\n $criteriaNombreUser1->compare('u.apellido',$apellido,true);\n }\n\n $criteria->compare('folio', $this->folio);\n $criteria->mergeWith($criteriaNombreUser1,'AND');\n \n $criteria->compare('fecha_inicio', Tools::fixFecha($this->fecha_inicio), true);\n $criteria->compare('p.nombre', $this->propiedad_nombre, true);\n $criteria->compare('d.numero', $this->depto_nombre, true);\n $criteria->compare('c.rut', $this->cliente_rut, true);\n $criteria->compare('t.vigente', 1);\n \n \n if(Yii::app()->user->rol == 'cliente'){\n $cliente = Cliente::model()->findByAttributes(array('usuario_id'=>Yii::app()->user->id));\n if($cliente!=null){\n $criteria->compare('t.cliente_id',$cliente->id);\n }\n else{\n $criteria->compare('t.cliente_id',-1);\n }\n }\n \n if(Yii::app()->user->rol == 'propietario'){\n $criteriaPropietario = new CDbCriteria();\n $contratos = Contrato::model()->relacionadosConPropietario(Yii::app()->user->id);\n foreach($contratos as $contrato_id){\n $criteriaPropietario->compare('t.id', $contrato_id, false,'OR'); \n }\n $criteria->mergeWith($criteriaPropietario,'AND');\n }\n \n \n \n \n \n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'sort' => array(\n 'attributes' => array(\n 'depto_nombre' => array(\n 'asc' => 'd.numero',\n 'desc' => 'd.numero DESC',\n ),\n 'tipo_nombre' => array(\n 'asc' => 'tipo.nombre',\n 'desc' => 'tipo.nombre DESC',\n ),\n 'cliente_rut' => array(\n 'asc' => 'c.rut',\n 'desc' => 'c.rut DESC',\n ),\n 'cliente_nombre' => array(\n 'asc' => 'u.apellido,u.nombre',\n 'desc' => 'u.apellido DESC,u.nombre DESC',\n ),\n 'propiedad_nombre' => array(\n 'asc' => 'p.nombre',\n 'desc' => 'p.nombre DESC',\n ),\n '*',\n ),\n ),\n ));\n }", "public function search($query);", "public function buscarDados($ev){\n\n try {\n\n /* primeiro vai se fazer a busca do id da sala na propria tabela evento*/\n\n parent::setTabela('evento');\n parent::setValorPesquisa('evento.idEvento=(:idEvento) ORDER BY idEvento ASC');\n $selecionaTudo_ComCondicao = parent::selecionaTudo_ComCondicao();\n $selecionaTudo_ComCondicao ->bindParam('idEvento', $ev, PDO::PARAM_INT);\n $selecionaTudo_ComCondicao ->execute();\n\n $resultado = $selecionaTudo_ComCondicao ->fetch(PDO::FETCH_OBJ);\n\n unset( $selecionaTudo_ComCondicao );\n } catch (Exception $exc) {\n return $exc->getMessage();\n }\n\n return $resultado;\n }", "public function indexResultsAction()\n {\n $datatable = $this->get('pixeloid_app.datatable.eventregistration');\n $datatable->buildDatatable();\n\n $query = $this->get('sg_datatables.query')->getQueryFrom($datatable);\n\n $function = function($qb)\n {\n // $qb->andWhere(\"post.title = :p\");\n $qb->andWhere(\"eventregistration.created > :date\");\n $qb->setParameter('date', new \\DateTime($this->container->getParameter('start_date')));\n };\n\n // $query->addWhereAll($function);\n\n // return $query->getResponse();\n $query->addWhereAll($function);\n\n // // Or add the callback function as WhereAll\n // //$query->addWhereAll($function);\n\n // // Or to the actual query\n // $query->buildQuery();\n // $qb = $query->getQuery();\n\n // //$qb->addSelect(\"eventregistration.email\");\n // //$qb->andWhere(\"moviecategories.shortlist = 1\");\n\n // // var_dump($qb->getQuery()->getSQL());\n // // exit;\n\n // $query->setQuery($qb);\n return $query->getResponse();\n\n }", "public function Search($criteria);", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t//$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('femision',$this->femision,true);\n\t\t$criteria->compare('fvencimiento',$this->fvencimiento,true);\n\t\t$criteria->compare('tipo',$this->tipo,true);\n\t\t//$criteria->compare('codaduana',$this->codaduana,true);\n\t\t//$criteria->compare('annodua',$this->annodua,true);\n\t\t$criteria->compare('numerocomprobante',$this->numerocomprobante,true);\n\t\t$criteria->compare('tipodocid',$this->tipodocid,true);\n\t\t$criteria->compare('numerodocid',$this->numerodocid,true);\n\t\t$criteria->compare('razpronombre',$this->razpronombre,true);\n\t\t/*$criteria->compare('expobaseimpgrav',$this->expobaseimpgrav);\n\t\t$criteria->compare('expigvgrav',$this->expigvgrav);\n\t\t$criteria->compare('expbaseimpnograv',$this->expbaseimpnograv);\n\t\t$criteria->compare('expigvnograv',$this->expigvnograv);\n\t\t$criteria->compare('baseimpnograv',$this->baseimpnograv);\n\t\t$criteria->compare('igvnograv',$this->igvnograv);\n\t\t$criteria->compare('isc',$this->isc);\n\t\t$criteria->compare('otrostributos',$this->otrostributos);\n\t\t$criteria->compare('importetotal',$this->importetotal);\n\t\t$criteria->compare('numerodocnodomiciliado',$this->numerodocnodomiciliado,true);\n\t\t$criteria->compare('numconstdetraccion',$this->numconstdetraccion,true);\n\t\t$criteria->compare('fechaemidetra',$this->fechaemidetra,true);\n\t\t$criteria->compare('tipocambio',$this->tipocambio);\n\t\t$criteria->compare('reffechaorigen',$this->reffechaorigen,true);\n\t\t$criteria->compare('reftipo',$this->reftipo,true);\n\t\t$criteria->compare('refserie',$this->refserie,true);\n\t\t$criteria->compare('refnumero',$this->refnumero,true);\n\t\t$criteria->compare('fechacre',$this->fechacre,true);\n\t\t$criteria->compare('socio',$this->socio,true);\n\t\t$criteria->compare('hidperiodo',$this->hidperiodo);\n*/\n if((isset($this->femision) && trim($this->femision) != \"\") && (isset($this->femision1) && trim($this->femision1) != \"\")) {\n\t\t // $limite1=date(\"Y-m-d\",strotime($this->d_fectra)-24*60*60); //UN DIA MENOS \n\t\t\t\t\t // $limite2=date(\"Y-m-d\",strotime($this->d_fectra)+24*60*60); //UN DIA mas \n\t\t \n $criteria->addBetweenCondition('femision', ''.$this->femision.'', ''.$this->femision1.'');\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "abstract public function findBy($criteria);", "public function getCriteria();", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id_persona',$this->id_persona);\n\t\t$criteria->compare('id_evaluacion',$this->id_evaluacion);\n\t\t$criteria->compare('periodo_desde',$this->periodo_desde,true);\n\t\t$criteria->compare('periodo_hasta',$this->periodo_hasta,true);\n\t\t$criteria->compare('apellidos',$this->apellidos,true);\n\t\t$criteria->compare('nombres',$this->nombres,true);\n\t\t$criteria->compare('nacionalidad',$this->nacionalidad,true);\n\t\t$criteria->compare('cedula',$this->cedula);\n\t\t$criteria->compare('sexo',$this->sexo,true);\n\t\t$criteria->compare('cod_nomina',$this->cod_nomina);\n\t\t$criteria->compare('cargo',$this->cargo,true);\n\t\t$criteria->compare('unidad_admtiva',$this->unidad_admtiva,true);\n\t\t$criteria->compare('telef_oficina',$this->telef_oficina,true);\n\t\t$criteria->compare('obj_funcional',$this->obj_funcional,true);\n\t\t$criteria->compare('id_evaluado',$this->id_evaluado);\n\t\t$criteria->compare('apellidos_evaluado',$this->apellidos_evaluado,true);\n\t\t$criteria->compare('nombres_evaluado',$this->nombres_evaluado,true);\n\t\t$criteria->compare('nacionalidad_evaluado',$this->nacionalidad_evaluado,true);\n\t\t$criteria->compare('cedula_evaluado',$this->cedula_evaluado);\n\t\t$criteria->compare('sexo_evaluado',$this->sexo_evaluado,true);\n\t\t$criteria->compare('cod_nomina_evaluado',$this->cod_nomina_evaluado);\n\t\t$criteria->compare('cargo_evaluado',$this->cargo_evaluado,true);\n\t\t$criteria->compare('dep_evaluado',$this->dep_evaluado,true);\n\t\t$criteria->compare('oficina_evaluado',$this->oficina_evaluado,true);\n\t\t$criteria->compare('telefono_evaluado',$this->telefono_evaluado,true);\n\t\t$criteria->compare('dependencia',$this->dependencia);\n\t\t$criteria->compare('fk_entidad',$this->fk_entidad);\n\t\t$criteria->compare('fk_estatus_evaluacion',$this->fk_estatus_evaluacion);\n\t\t$criteria->compare('estatus',$this->estatus,true);\n\t\t$criteria->compare('id_comentario',$this->id_comentario);\n\t\t$criteria->compare('comentario',$this->comentario,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function listAllQuery() {\n \n $dql = \"select e\n from Vibby\\Bundle\\BookingBundle\\Entity\\Event e\n order by e.date_from\n \";\n\n return $this->getEntityManager()->createQuery($dql);\n \n }", "function getEvents($event) {\n $event_criteria = new CDbCriteria;\n $episode_id = $event->episode->id;\n $event_criteria->compare('episode_id', $episode_id);\n return Event::model()->findAll($event_criteria);\n }", "public function listAction()\r\n\t{\r\n\t\t$viewer = Engine_Api::_() -> user() -> getViewer();\r\n\t\t$this -> view -> business = $business = Engine_Api::_() -> core() -> getSubject();\r\n\t\t$this -> view -> form = $form = new Ynbusinesspages_Form_Event_Search;\r\n\t\t$val = $this -> _getAllParams();\r\n\t\t// Populate form data\r\n\t\tif (!$form -> isValid($val))\r\n\t\t{\r\n\t\t\t$form -> populate($defaultValues);\r\n\t\t\t$this -> view -> formValues = $values = array();\r\n\t\t\t$this -> view -> message = \"The search value is not valid !\";\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$values = $form -> getValues();\r\n\t\t$values['business_id'] = $business -> getIdentity();\r\n\t\t// Prepare data\r\n\t\t$this -> view -> formValues = $values = array_merge($values, $_GET);\r\n\t\t\r\n\t\t// Check create event authorization\r\n\t\t$this -> view -> canCreate = $business -> isAllowed('event_create');\r\n\t\t//Get data\r\n\t\t$this -> view -> paginator = $paginator = Engine_Api::_()->getDbTable('mappings', 'ynbusinesspages') -> getEventsPaginator($values);\r\n\t\t$paginator -> setCurrentPageNumber($this -> _getParam('page'));\r\n\t}", "public function test_database_events_check()\n {\n $this->seeInDatabase('events', ['event_name' => 'Test Event1']);\n }", "abstract public function query();", "public function findBy(array $where = []);", "public function search($criteria='')\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\t\tif($criteria ===''){\n\t\t\t$criteria=new CDbCriteria;\n\t\t\t$criteria->compare('status','<>-1');\n\t\t\tif($this->search_time_type != '' && isset($this->__search_time_type[$this->search_time_type]))\n\t\t\t{\n\t\t\t\tif($this->search_start_time !='' && $this->search_end_time !='')\n\t\t\t\t\t$criteria->addBetweenCondition($this->__search_time_type[$this->search_time_type],strtotime($this->search_start_time),strtotime($this->search_end_time)+3600*24-1);\n\t\t\t\telseif($this->search_start_time !='' && $this->search_end_time =='')\n\t\t\t\t\t$criteria->compare($this->__search_time_type[$this->search_time_type],'>='.strtotime($this->search_start_time));\n\t\t\t\telseif($this->search_start_time =='' && $this->search_end_time !='')\n\t\t\t\t\t$criteria->compare($this->__search_time_type[$this->search_time_type],'<=' . (strtotime($this->search_end_time)+3600*24-1));\n\t\t\t}\t\t\t\n\t\t\t$criteria->compare('id',$this->id,true);\n\t\t\t$criteria->compare('phone',$this->phone,true);\n\t\t\t$criteria->compare('sms_id',$this->sms_id,true);\n\t\t\t$criteria->compare('sms_type',$this->sms_type,true);\n\t\t\t$criteria->compare('role_id',$this->role_id,true);\n\t\t\t$criteria->compare('role_type',$this->role_type,true);\n\t\t\t$criteria->compare('sms_use',$this->sms_use,true);\n\t\t\t$criteria->compare('code',$this->code,true);\n\t\t\t$criteria->compare('sms_content',$this->sms_content,true);\n\t\t\t$criteria->compare('sms_source',$this->sms_source,true);\n\t\t\t$criteria->compare('sms_ip',$this->sms_ip,true);\n\t\t\t$criteria->compare('login_address',$this->login_address,true);\n\t\t\t$criteria->compare('error_count',$this->error_count,true);\n\t\t\t$criteria->compare('sms_error',$this->sms_error,true);\n\t\t\tif($this->end_time != '')\n\t\t\t\t$criteria->addBetweenCondition('end_time',strtotime($this->end_time),(strtotime($this->end_time)+3600*24-1));\n\t\t\tif($this->add_time != '')\n\t\t\t\t$criteria->addBetweenCondition('add_time',strtotime($this->add_time),(strtotime($this->add_time)+3600*24-1));\n\n\t\t\t$criteria->compare('is_code',$this->is_code);\n\t\t\t$criteria->compare('status',$this->status);\n\t\t}\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t\t'pagination'=>array(\n\t\t\t\t\t'pageSize'=>Yii::app()->params['admin_pageSize'],\n\t\t\t),\n\t\t\t'sort'=>array(\n\t\t\t\t\t'defaultOrder'=>'t.add_time desc', //设置默认排序\n\t\t\t),\n\t\t));\n\t}", "function getEventsArray($from,$to,$exc_entries){\n\t\t$select_fields = \t'tx_tdcalendar_events.*';\n\t\t$select_fields .=\t', tx_tdcalendar_categories.title as category';\n\t\t$select_fields .= \t', tx_tdcalendar_categories.color as catcolor';\n\t\t$select_fields .= \t', tx_tdcalendar_locations.location as location_name';\n\t\t$select_fields .= \t', tx_tdcalendar_organizer.name as organizer_name';\n\n\t\t$from_table =\t\t'((tx_tdcalendar_events'; \n\t\t$from_table .= \t\t' INNER JOIN tx_tdcalendar_categories';\n $from_table .= \t\t' ON tx_tdcalendar_events.category = tx_tdcalendar_categories.uid)';\n\t\t$from_table .= \t\t' LEFT JOIN tx_tdcalendar_locations';\n\t\t$from_table .= \t\t' ON tx_tdcalendar_events.location_id = tx_tdcalendar_locations.uid)';\n\t\t$from_table .= \t\t' LEFT JOIN tx_tdcalendar_organizer';\n\t\t$from_table .= \t\t' ON tx_tdcalendar_events.organizer_id = tx_tdcalendar_organizer.uid';\n\n\t\t$where_clause = \t\"((tx_tdcalendar_events.begin < '\".$from.\"' AND tx_tdcalendar_events.end >= '\".$from.\"')\";\n\t\t$where_clause .= \t\" OR (tx_tdcalendar_events.begin >= '\".$from.\"' AND tx_tdcalendar_events.begin < '\".$to.\"')\";\n\n\t\t$where_clause.= \t\" OR(event_type > 0 AND event_type < 5 AND ((begin < '\".$from.\"' AND rec_end_date = 0) OR (begin < '\".$from.\"' AND rec_end_date >= '\".$from.\"') )))\";\n\n\t\t$where_clause .= \t$this->enableFieldsCategories;\n\t\t$where_clause .=\t$this->enableFieldsEvents;\n\n\t\tif ($this->conf['currCat'] AND !$this->conf['hideCategorySelection'])\n\t\t\t$where_clause .= ' AND tx_tdcalendar_events.category = '.$this->conf['currCat'];\n\t\telse\n\t\t\t$where_clause .= \t$this->getCategoryQuery('tx_tdcalendar_events.category');\n\n\t\t$where_clause .=\t$this->getPagesQuery();\n\n\t\t$orderBy =\t\t\t'tx_tdcalendar_events.begin, tx_tdcalendar_events.uid';\n\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t$select_fields,\n\t\t\t$from_table,\n\t\t\t$where_clause,\n\t\t\t$groupBy='',\n\t\t\t$orderBy,\n\t\t\t$limit=''\n\t\t);\n\n\t\treturn $this->makeArray($res, $from, $to, $exc_entries);\n\t}", "function generateSQL($event){\n\t$sqlhead=\"SELECT * FROM te_events WHERE \";\n\t$sqltail=\"\";\n\t$showError=false;\n\t$isTailEmpty = empty($sqltail);\n\t// if any field is not empty \n\t// means it is filled\n\t// do something with the data\n\tif(!(empty($event['title']))){\n\t\t$str1 = \"eventTitle LIKE \\\"%\" . $event['title'] . \"%\\\" \";\n\t\t$str2 = \"AND eventTitle LIKE \\\"%\" . $event['title'] . \"%\\\" \";\n\t\t$sqltail .= (empty($sqltail)) ? $str1 : $str2;\n\t}\n\t// from strcmp to is empty because array_filter //!(strcmp($event['venue'], \"0\")==0)\n\tif(!(empty($event['venue']))){\n\t\t$str1 = \"venueID = \\\"\" . $event['venue'] . \"\\\" \";\n\t\t$str2 = \"AND venueID = \\\"\" . $event['venue'] . \"\\\" \";\n\t\t$sqltail .= (empty($sqltail)) ? $str1 : $str2;\n\t}\n\tif(!(empty($event['category']))){\n\t\t$str1 = \"catID = \\\"\" . $event['category'] . \"\\\" \";\n\t\t$str2 = \"AND catID = \\\"\" . $event['category'] . \"\\\" \";\n\t\t$sqltail .= (empty($sqltail)) ? $str1 : $str2;\n\t}\n\tif(!(empty($event['startTime']))){\n\t\t$str1 = \"eventStartDate = \\\"\" . $event['startTime'] . \"\\\" \";\n\t\t$str2 = \"AND eventStartDate = \\\"\" . $event['startTime'] . \"\\\" \";\n\t\t$sqltail .= (empty($sqltail)) ? $str1 : $str2;\n\t}\n\tif(!(empty($event['endTime']))){\n\t\t$str1 = \"eventEndDate = \\\"\" . $event['endTime'] . \"\\\" \";\n\t\t$str2 = \"AND eventEndDate = \\\"\" . $event['endTime'] . \"\\\" \";\n\t\t$sqltail .= (empty($sqltail)) ? $str1 : $str2;\n\t}\n\tif(!(empty($event['price']))){\n\t\t$str1 = \"eventPrice = \\\"\" . $event['price'] . \"\\\" \";\n\t\t$str2 = \"AND eventPrice = \\\"\" . $event['price'] . \"\\\" \";\n\t\t$sqltail .= (empty($sqltail)) ? $str1 : $str2;\n\t}\n\treturn $sqlhead . $sqltail . \"ORDER BY eventTitle ASC\";\n}", "public function search_()\n\t{\n\t\t\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ptopartida',$this->ptopartida,true);\n\t\t$criteria->compare('distpartida',$this->distpartida,true);\n\t\t$criteria->compare('provpartida',$this->provpartida,true);\n\t\t$criteria->compare('dptopartida',$this->dptopartida,true);\n\t\t$criteria->compare('ptollegada',$this->ptollegada,true);\n\t\t$criteria->compare('distllegada',$this->distllegada,true);\n\t\t$criteria->compare('provllegada',$this->provllegada,true);\n\t\t$criteria->compare('dptollegada',$this->dptollegada,true);\n\t\t$criteria->compare('direccionformaldes',$this->direccionformaldes,true);\n\t\t$criteria->compare('direcciontransportista',$this->direcciontransportista,true);\n\t\t$criteria->compare('c_numgui',$this->c_numgui,true);\n\t\t$criteria->compare('c_coclig',$this->c_coclig,true);\n\t\t$criteria->compare('d_fecgui',$this->d_fecgui,true);\n\t\t$criteria->compare('c_estgui',$this->c_estgui,true);\n\t\t$criteria->compare('c_rsguia',$this->c_rsguia,true);\n\t\t$criteria->compare('c_codtra',$this->c_codtra,true);\n\t\t$criteria->compare('c_trans',$this->c_trans,true);\n\t\t$criteria->compare('c_motivo',$this->c_motivo,true);\n\t\t$criteria->compare('c_placa',$this->c_placa,true);\n\t\t$criteria->compare('c_licon',$this->c_licon,true);\n\t//\t$criteria->compare('d_fectra',$this->d_fectra,true);\n\t\t//$criteria->compare('c_descri',$this->c_descri,true);\n\n\t\t$criteria->compare('n_guia',$this->n_guia,true);\n\t\t$criteria->compare('c_texto',$this->c_texto,true);\n\t\t$criteria->compare('c_dirsoc',$this->c_dirsoc,true);\n\t\t$criteria->compare('c_serie',$this->c_serie,true);\n\t\t//$criteria->compare('c_salida',$this->c_salida,true);\n\t\t$criteria->compare('razondestinatario',$this->razondestinatario,true);\n\t\t$criteria->compare('rucdestinatario',$this->rucdestinatario,true);\n\t\t$criteria->compare('ructrans',$this->ructrans,true);\n\t\t$criteria->compare('razontransportista',$this->razontransportista,true);\n\t\t$criteria->compare('c_estado',$this->c_estado,true);\n\t\t$criteria->compare('n_direc',$this->n_direc);\n\t\t$criteria->compare('n_direcformaldes',$this->n_direcformaldes);\n\t\t$criteria->compare('n_directran',$this->n_directran);\n\t\t$criteria->compare('n_dirsoc',$this->n_dirsoc);\n\t\t$criteria->compare('creadopor',$this->creadopor,true);\n\t\t$criteria->compare('modificadopor',$this->modificadopor,true);\n\t\t$criteria->compare('creadoel',$this->creadoel,true);\n\t\t$criteria->compare('modificadoel',$this->modificadoel,true);\n\t\t$criteria->compare('rucsoc',$this->rucsoc,true);\n\t\t$criteria->compare('estado',$this->estado,true);\n\t\t$criteria->compare('n_hguia',$this->n_hguia,true);\n\t\t$criteria->compare('c_itguia',$this->c_itguia,true);\n\t\t$criteria->compare('n_cangui',$this->n_cangui);\n\t\t$criteria->compare('c_codgui',$this->c_codgui,true);\n\t\t$criteria->compare('c_edgui',$this->c_edgui,true);\n\t\t$criteria->compare('c_descri',$this->c_descri,true);\n\t\t$criteria->compare('m_obs',$this->m_obs,true);\n\t\t$criteria->compare('c_codactivo',$this->c_codactivo,true);\n\t\t$criteria->compare('c_um',$this->c_um,true);\n\t\t$criteria->compare('c_codep',$this->c_codep,true);\n\t\t$criteria->compare('n_detgui',$this->n_detgui,true);\n\t\t$criteria->compare('l_libre',$this->l_libre,true);\n\t\t$criteria->compare('nomep',$this->nomep,true);\n\t\t$criteria->compare('motivo',$this->motivo,true);\n\t\t$criteria->compare('estadodetalle',$this->estadodetalle,true);\n\t\t$criteria->compare('c_af',$this->c_af,true);\n\t\t$criteria->compare('cod_cen',$this->cod_cen,true);\n\t\t$criteria->compare('c_codsap',$this->c_codsap,true);\n\t\t$criteria->compare('hidref',$this->hidref,true);\n\t\t$criteria->compare('docref',$this->docref,true);\n\t\t$criteria->compare('codocu',$this->codocu,true);\n\t\t$case=$this->d_fectra;\n\t\t//$criteria->compare('d_fectra',trim(\" \".$case.\" \"),false);\n\t\t$case2=$this->d_fectra1;\n\t\t\n\t\t//$criteria->compare('d_fectra1',trim(\" \".$case2.\" \"),false);\n\t\t$criteria->compare('codocu',$this->codocu,true);\n\t\t if((isset($this->d_fectra) && trim($this->d_fectra) != \"\") && (isset($this->d_fectra1) && trim($this->d_fectra1) != \"\")) {\n\t\t // $limite1=date(\"Y-m-d\",strotime($this->d_fectra)-24*60*60); //UN DIA MENOS \n\t\t\t\t\t // $limite2=date(\"Y-m-d\",strotime($this->d_fectra)+24*60*60); //UN DIA mas \n\t\t \n $criteria->addBetweenCondition('d_fectra', ''.$this->d_fectra.'', ''.$this->d_fectra1.''); \n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\n\t\t//$fechaactual = date(\"Y-m-d\");\n\t\t//$criteria->addCondition(\"d_fectra = '\".$fechaactual.\"'\");\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('keyPA',$this->keyPA,true);\n\t\t$criteria->compare('codigo',$this->codigo,true);\n\t\t$criteria->compare('descripcion',$this->descripcion,true);\n\t\t$criteria->compare('descripcion1',$this->descripcion1,true);\n\t\t$criteria->compare('um',$this->um,true);\n\t\t$criteria->compare('gpoProducto',$this->gpoProducto,true);\n\t\t$criteria->compare('activo',$this->activo,true);\n\t\t$criteria->compare('cbarra',$this->cbarra,true);\n\t\t$criteria->compare('usuario',$this->usuario,true);\n\t\t$criteria->compare('fecha',$this->fecha,true);\n\t\t$criteria->compare('laboratorio',$this->laboratorio,true);\n\t\t$criteria->compare('umVentas',$this->umVentas,true);\n\t\t$criteria->compare('ventaPieza',$this->ventaPieza,true);\n\t\t$criteria->compare('sustancia',$this->sustancia,true);\n\t\t$criteria->compare('observaciones',$this->observaciones,true);\n\t\t$criteria->compare('fechaActualizacion',$this->fechaActualizacion,true);\n\t\t$criteria->compare('cajaCon',$this->cajaCon);\n\t\t$criteria->compare('hora',$this->hora,true);\n\t\t$criteria->compare('referido',$this->referido,true);\n\t\t$criteria->compare('laboratorioReferido',$this->laboratorioReferido,true);\n\t\t$criteria->compare('medico',$this->medico,true);\n\t\t$criteria->compare('entidad',$this->entidad,true);\n\t\t$criteria->compare('cargoAuto',$this->cargoAuto,true);\n\t\t$criteria->compare('horaAuto',$this->horaAuto,true);\n\t\t$criteria->compare('generico',$this->generico,true);\n\t\t$criteria->compare('id_cuarto',$this->id_cuarto,true);\n\t\t$criteria->compare('servicio',$this->servicio,true);\n\t\t$criteria->compare('paquete',$this->paquete,true);\n\t\t$criteria->compare('cargosDirectos',$this->cargosDirectos,true);\n\t\t$criteria->compare('especialidad',$this->especialidad,true);\n\t\t$criteria->compare('subEspecialidad',$this->subEspecialidad,true);\n\t\t$criteria->compare('random',$this->random,true);\n\t\t$criteria->compare('departamento',$this->departamento,true);\n\t\t$criteria->compare('procedimiento',$this->procedimiento,true);\n\t\t$criteria->compare('caducidad',$this->caducidad,true);\n\t\t$criteria->compare('antibiotico',$this->antibiotico,true);\n\t\t$criteria->compare('maquilado',$this->maquilado,true);\n\t\t$criteria->compare('etiqueta',$this->etiqueta);\n\t\t$criteria->compare('grupo',$this->grupo,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search_open_activ($params, $pe)\n {\n $this->load($params);\n\n// ddd($pe);\n\n $query = mts_crm::find()\n ->select([\n 'id',\n 'id_ap',\n 'id_pe',\n 'mts_id',\n 'sprwhelement_ap.name',\n 'sprwhelement_pe.name',\n 'sprwhelement_mts.name',\n 'dt_create_timestamp',\n 'dt_update_timestamp', ///\n\n 'job_fin',\n 'job_fin_timestamp',\n 'zakaz_fin',\n 'zakaz_fin_timestamp',\n ])\n ->with('sprwhelement_mts', 'sprwhelement_ap', 'sprwhelement_pe')\n ->where(['AND',\n ['<>', 'job_fin', (int)1],\n ['==', 'id_pe', (int)$pe]\n ]\n );\n\n //ddd($query);\n\n\n $dataProvider = new ActiveDataProvider(\n [\n 'query' => $query,\n 'pagination' => ['pageSize' => 10],\n ]\n );\n\n\n if (!$this->validate()) {\n return $dataProvider;\n }\n\n\n $now_time = strtotime('now');\n $now_start_day = strtotime('today');\n $now_end_day = strtotime('today +24 hours');\n\n\n if (isset($params['posttz']['three'])) {\n\n if (isset($params['posttz']['three']) && $params['posttz']['three'] == 1) { //Просрочено\n $query\n //->andFilterWhere( [ '<=', 'dt_deadline', $now_end_day ] );\n ->andFilterWhere(['<=', 'dt_deadline_timestamp', (int)$now_end_day]);\n\n } elseif (isset($params['posttz']['three']) && $params['posttz']['three'] == 2) { /// Сегодня\n $query\n ->andFilterWhere(['>=', 'dt_deadline_timestamp', (int)$now_start_day])\n ->andFilterWhere(['<=', 'dt_deadline_timestamp', (int)$now_end_day]);\n\n } elseif (isset($params['posttz']['three']) && $params['posttz']['three'] == 3) { // Еще зеленое\n $query->andFilterWhere(['>=', 'dt_deadline_timestamp', (int)$now_time]);\n }\n\n }\n\n\n /// ID\n if (isset($this->id) && $this->id > 0) {\n $query->andFilterWhere(['=', 'id', (int)$this->id]);\n }\n\n\n return $dataProvider;\n }", "function SEARCH(){\n\t\t$sql = \"SELECT * FROM RESERVA\n\t\t\t\tWHERE FECHA BETWEEN '$this->hoy' AND '$this->hoy_mas6'\n\t\t\t\tORDER BY FECHA\";\n\n if (!($resultado = $this->mysqli->query($sql))){\n $this->mensaje['mensaje'] = 'ERROR: Fallo en la consulta sobre la base de datos';\n return $this->mensaje;\n }\n else{ // si la busqueda es correcta devolvemos el recordset resultado\n return $resultado;\n }\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('codalm',$this->codalm,true);\n\t\t$criteria->compare('creadopor',$this->creadopor,true);\n\t\t$criteria->compare('creadoel',$this->creadoel,true);\n\t\t$criteria->compare('modificadopor',$this->modificadopor,true);\n\t\t$criteria->compare('modificadoel',$this->modificadoel,true);\n\t\t$criteria->compare('fechainicio',$this->fechainicio,true);\n\t\t$criteria->compare('fechafin',$this->fechafin,true);\n\t\t$criteria->compare('periodocontable',$this->periodocontable,true);\n\t\t$criteria->compare('codresponsable',$this->codresponsable,true);\n\t\t//$criteria->compare('codart',$this->codart,true);\n\t\t$criteria->compare('codcen',$this->codcen,true);\n\t\t$criteria->compare('um',$this->um,true);\n\t\t$criteria->compare('cantlibre',$this->cantlibre);\n\t\t//$criteria->compare('descripcion',$this->descripcion,TRUE);\n\t\t$criteria->compare('canttran',$this->canttran);\n\t\t$criteria->compare('cantres',$this->cantres);\n\t\t$criteria->compare('ubicacion',$this->ubicacion,true);\n\t\t$criteria->compare('lote',$this->lote,true);\n\t\t$criteria->compare('siid',$this->siid,true);\n\t\t$criteria->compare('ssiduser',$this->ssiduser,true);\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->addcondition(\" descripcion like '%\".MiFactoria::cleanInput($this->descripcion).\"%' \");\n\t\tif($this->haystock=='1')\n\t\t$criteria->addCondition(\"cantlibre > 0 \");\n\t\tif($this->hayreserva=='1')\n\t\t\t$criteria->addCondition(\"cantres > 0 \");\n\t\tif($this->haytransito=='1')\n\t\t\t$criteria->addCondition(\"canttran > 0 \");\n // $criteria->addCondition(\"cantlibre > 0 or cantres >0 or canttran > 0\");\n\t\t if(isset($_SESSION['sesion_Maestrocompo'])) {\n\t\t\t\t\t$criteria->addInCondition('codart', $_SESSION['sesion_Maestrocompo'], 'AND');\n\t\t\t\t\t\t\t\t\t\t\t\t\t \t } ELSE {\n\t\t\t\t\t\t$criteria->compare('codart',$this->codart,true);\n\t\t\t\t\t\t\t\t\t\t\t\t\t \t }\n\t\t//$criteria->addSearchCondition('descripcion',$this->descripcion,FALSE,'and','LIKE');\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t\t'pagination' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t'pageSize' => 100,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t));\n\t}", "public function search() {\n $criteria = new CDbCriteria;\n\n $criteria->compare('sample_id', $this->sample_id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('case_id', $this->case_id);\n $criteria->compare('date_rec', $this->date_rec, true);\n $criteria->compare('ext_inst_id', $this->ext_inst_id);\n $criteria->compare('ext_label', $this->ext_label, true);\n if (strlen($this->sample_preserve) > 1) {\n // Because we add \"\" to the top of the ENUM pulldown (see ZHTML.php)\n // We need to only add criteria when a pulldown value is selected\n $criteria->compare('sample_preserve', $this->sample_preserve, true);\n }\n if (strlen($this->status) > 1) {\n // Because we add \"\" to the top of the ENUM pulldown (see ZHTML.php)\n // We need to only add criteria when a pulldown value is selected\n $criteria->compare('status', $this->status, true);\n }\n if ($this->researcher) {\n $criteria->compare('researcher', $this->researcher, true);\n }\n if (strlen($this->sample_type) > 1) {\n // Because we add \"\" to the top of the ENUM pulldown (see ZHTML.php)\n // We need to only add criteria when a pulldown value is selected\n $criteria->compare('sample_type', $this->sample_type, true);\n }\n $criteria->compare('tissue_mion', $this->tissue_mion);\n $criteria->compare('tissue_loc_mion', $this->tissue_loc_mion);\n if (strlen($this->exp_design_sdb) > 1) {\n // Because we add \"\" to the top of the ENUM pulldown (see ZHTML.php)\n // We need to only add criteria when a pulldown value is selected\n $criteria->compare('exp_design_sdb', $this->exp_design_sdb, true);\n }\n $criteria->compare('tissue_sdb', $this->tissue_sdb, true);\n $criteria->compare('lib_id_sdb', $this->lib_id_sdb, true);\n if (strlen($this->sample_use) > 1) {\n // Because we add \"\" to the top of the ENUM pulldown (see ZHTML.php)\n // We need to only add criteria when a pulldown value is selected\n $criteria->compare('sample_use', $this->sample_use, true);\n }\n $criteria->compare('note', $this->note, true);\n $criteria->compare('status_sdb', $this->status_sdb, true);\n $criteria->compare('antibody', $this->antibody, true);\n $criteria->compare('treatment', $this->treatment, true);\n $criteria->compare('knockdown', $this->knockdown, true);\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => array(\n 'pageSize' => 25,\n ),\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('introduction',$this->introduction,true);\n\t\t$criteria->compare('service_general',$this->service_general,true);\n\t\t$criteria->compare('service_share',$this->service_share,true);\n\t\t$criteria->compare('service_business',$this->service_business,true);\n\t\t$criteria->compare('status',$this->status,true);\n\t\t$criteria->compare('create_time',$this->create_time,true);\n\t\t$criteria->compare('update_time',$this->update_time,true);\n\t\t$criteria->compare('create_user_id',$this->create_user_id);\n\t\t$criteria->compare('update_user_id',$this->update_user_id);\n\t\t$criteria->compare('image_header_1',$this->image_header_1,true);\n\t\t$criteria->compare('image_header_2',$this->image_header_2,true);\n\t\t$criteria->compare('image_header_3',$this->image_header_3,true);\n\t\t$criteria->compare('image_header_4',$this->image_header_4,true);\n\t\t$criteria->compare('image_header_5',$this->image_header_5,true);\n\t\t$criteria->compare('products_on_sales',$this->products_on_sales,true);\n\t\t$criteria->compare('less_than_1000',$this->less_than_1000,true);\n\t\t$criteria->compare('for_rent',$this->for_rent,true);\n\t\t$criteria->compare('for_options',$this->for_options,true);\n\t\t$criteria->compare('baby_products',$this->baby_products,true);\n\t\t$criteria->compare('groceries',$this->groceries,true);\n\t\t$criteria->compare('fashion_and_beauty',$this->fashion_and_beauty,true);\n\t\t$criteria->compare('office_products',$this->office_products,true);\n\t\t$criteria->compare('books_and_learning',$this->books_and_learning,true);\n\t\t$criteria->compare('smartphones',$this->smartphones,true);\n\t\t$criteria->compare('computers',$this->computers,true);\n\t\t$criteria->compare('wholesales_and_commodity',$this->wholesales_and_commodity,true);\n\t\t$criteria->compare('home_services',$this->home_services,true);\n\t\t$criteria->compare('advert_mini_header',$this->advert_mini_header,true);\n\t\t$criteria->compare('primary_books_and_learning',$this->primary_books_and_learning,true);\n\t\t$criteria->compare('secondary_books_and_learning',$this->secondary_books_and_learning,true);\n\t\t$criteria->compare('tertiary_books_and_learning',$this->tertiary_books_and_learning,true);\n\t\t$criteria->compare('professional_books_and_learning',$this->professional_books_and_learning,true);\n\t\t$criteria->compare('other_books_and_learning',$this->other_books_and_learning,true);\n\t\t$criteria->compare('learning_tools_and_learning',$this->learning_tools_and_learning,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('donante_id',$this->donante_id);\n\t\t$criteria->compare('cedula',$this->cedula,true);\n\t\t$criteria->compare('apellido1',$this->apellido1,true);\n\t\t$criteria->compare('apellido2',$this->apellido2,true);\n\t\t$criteria->compare('nombre1',$this->nombre1,true);\n\t\t$criteria->compare('nombre2',$this->nombre2,true);\n\t\t$criteria->compare('fecha_nacimiento',$this->fecha_nacimiento,true);\n\t\t$criteria->compare('causa_muerte',$this->causa_muerte,true);\n\t\t$criteria->compare('fecha_muerte',$this->fecha_muerte,true);\n\t\t$criteria->compare('tipo_donante_id',$this->tipo_donante_id);\n\t\t$criteria->compare('centro_id',$this->centro_id);\n\t\t$criteria->compare('nacionalidad',$this->nacionalidad,true);\n\t\t$criteria->compare('peso',$this->peso,true);\n\t\t$criteria->compare('talla',$this->talla,true);\n\t\t$criteria->compare('genero',$this->genero,true);\n\t\t$criteria->compare('diagnostico',$this->diagnostico,true);\n\t\t$criteria->compare('antecedentes_personales_patologicos',$this->antecedentes_personales_patologicos,true);\n\t\t$criteria->compare('antecedentes_epidemiologicos',$this->antecedentes_epidemiologicos,true);\n\t\t$criteria->compare('examen_fisico',$this->examen_fisico,true);\n\t\t$criteria->compare('hemodinamia',$this->hemodinamia,true);\n\t\t$criteria->compare('diuresis',$this->diuresis,true);\n\t\t$criteria->compare('proceso_infeccioso',$this->proceso_infeccioso,true);\n\t\t$criteria->compare('tratamiento_antibiotico',$this->tratamiento_antibiotico,true);\n\t\t$criteria->compare('sangre_id',$this->sangre_id);\n\t\t$criteria->compare('perfil_renal',$this->perfil_renal,true);\n\t\t$criteria->compare('perfil_hepatico',$this->perfil_hepatico,true);\n\t\t$criteria->compare('hematies',$this->hematies,true);\n\t\t$criteria->compare('hemoglobina',$this->hemoglobina,true);\n\t\t$criteria->compare('hematocrito',$this->hematocrito,true);\n\t\t$criteria->compare('vcm',$this->vcm,true);\n\t\t$criteria->compare('hcm',$this->hcm,true);\n\t\t$criteria->compare('chcm',$this->chcm,true);\n\t\t$criteria->compare('leucocitos',$this->leucocitos,true);\n\t\t$criteria->compare('plaquetas',$this->plaquetas,true);\n\t\t$criteria->compare('cultivos',$this->cultivos,true);\n\t\t$criteria->compare('serologia',$this->serologia,true);\n\t\t$criteria->compare('drogas_vasoactivas',$this->drogas_vasoactivas,true);\n\t\t$criteria->compare('estatus_id',$this->estatus_id,false);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function findMatchesWithAnEventAndPoule($event, $poule){\n $qb = $this->createQueryBuilder('m');\n $qb->andWhere('m.event = :event')\n ->setParameter('event', $event)\n ->andWhere('p1.poule = :poule')\n ->setParameter('poule', $poule);\n $qb->leftJoin('m.participation1', 'p1');\n return $qb->getQuery()->execute();\n }", "public function search(Request $request)\n {\n $input = $request->all();\n $query = [['isvalid','=',1]];\n $textsearch=\"\";\n\n if($this->app_name=='gyertekel.hu') {\n $input['parent_id']=4;\n }\n if(isset($input['category']) && $input['category']!=\"\") {\n array_push($query, [\"categories_id\",\"=\",$input['category']]);\n }\n if(isset($input['when']) && $input['when']!=\"\") {\n array_push($query, ['startdate','<=',$input['when']]);\n array_push($query, ['enddate','>=',$input['when']]);\n }\n if(isset($input['textsearch']) && $input['textsearch']!=\"\") {\n $textsearch=$input['textsearch'];\n }\n //http://laravel.io/forum/09-18-2014-orm-query-where-clause-on-related-table\n //https://github.com/jarektkaczyk/eloquence\n $ads = Ads::with('city','category','tag', 'company','rooms')\n ->where($query)\n ->where(function ($query) use ($textsearch) {\n $query->where(\"title\",\"LIKE\",\"%\".$textsearch.\"%\")\n ->orWhere(\"description\",\"LIKE\",\"%\".$textsearch.\"%\")\n ->orWhere(function($q) use ($textsearch) {\n $q->whereHas('tag', function($cq) use ($textsearch) {\n $cq->where([['name', $textsearch],\n ['container_type', 'ad']\n ]);\n });\n })\n ->orWhere(function($q) use ($textsearch) {\n $q->whereHas('company', function($cq) use ($textsearch) {\n $cq->where('name',\"LIKE\",\"%\".$textsearch.\"%\");\n });\n })\n ->orWhere(function($q) use ($textsearch) {\n $q->whereHas('rooms', function($cq) use ($textsearch) {\n $cq->where('assets',\"LIKE\",\"%\".$textsearch.\"%\");\n });\n })\n ;\n })\n ->where(function($q) use ($input) {\n if(isset($input['citysearch']) && $input['citysearch']!=\"\") {\n $q->whereHas('city', function($cq) use ($input) {\n $cq->where('name', $input[\"citysearch\"]);\n });\n }\n })\n ->where(function($q) use ($input){\n if(isset($input['parent_id']) && $input['parent_id']!=\"\") {\n $q->whereHas('category', function($cq) use ($input) {\n $cq->where('parent_id', $input[\"parent_id\"]);\n });\n }\n })\n ->paginate(env('PAGINATION_SIZE'));\n return view('models.ads.index')->with('ads', $ads);\n }", "function resourcesSearch($args)\n {\n if(!array_key_exists('search', $args))\n {\n throw new Exception('Parameter search is not defined', MIDAS_INVALID_PARAMETER);\n }\n $userDao = $this->_getUser($args);\n\n $order = 'view';\n if(isset($args['order']))\n {\n $order = $args['order'];\n }\n return $this->Component->Search->searchAll($userDao, $args['search'], $order);\n }", "function searchEmployeeData( Request $request )\n\t\t\t{\n\t\t\t\t$result = Employee::leftJoin( 'employee_metas', 'employees.id', '=', 'employee_metas.employee_id' )->where( 'employees.username', 'like', '%' . $request->search_query . '%' )->\n\t\t\t\torWhere( 'employees.name', 'like', '%' . $request->search_query . '%' )->orWhere( 'employee_metas.address', 'like', '%' . $request->search_query . '%' )->orWhere( 'employee_metas.contact', 'like', '%' . $request->search_query . '%' )->select( 'employees.name' )->get();\n\n\t\t\t\tif ( ! empty( $result ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->finalResponse( 'success', 'Records found!', 'Following are the results', [ 'emp_names' => $result ] );\n\t\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->finalResponse( 'error', 'No records found!', 'No matching employee records found for ' );\n\t\t\t\t\t}\n\t\t\t}", "public function createDefaultSearchQuery()\n {\n $qB = SearchEngine::getElasticaQueryBuilder();\n\n $keyword = Utility::convertArrayToString($this->searchEvent->getKeyword());\n $where = $this->searchEvent->getWhere();\n\n $keywordQuery = null;\n $whereQuery = null;\n $content = 0;\n if ($where) {\n if ($geoDistance = $this->container->get(\"nearby.handler\")->getGeoDistanceInfoByWhere()) {\n $whereQuery = $qB->query()->bool();\n $whereQuery->addShould(\n $qB->query()->match()->setFieldQuery(\"searchInfo.location\",$where)\n ->setFieldType(\"searchInfo.location\", \"phrase\")\n ->setFieldBoost(\"searchInfo.location\", 2)\n ->setFieldParam('searchInfo.location', 'slop', 30)\n );\n $whereQuery->addShould(\n $qB->query()->geo_distance(\n 'geoLocation',\n [\n 'lat' => $geoDistance['latitude'],\n 'lon' => $geoDistance['longitude'],\n ],\n $geoDistance['radius'])\n );\n $content |= 1;\n } else {\n $whereQuery = $qB->query()->match()->setFieldQuery('searchInfo.location',$where)\n ->setFieldType('searchInfo.location', 'phrase')\n ->setFieldParam('searchInfo.location', 'slop', 30);\n $content |= 1;\n }\n }\n\n if ($keyword) {\n $keywordQuery = $qB->query()->multi_match();\n\n $keywordQuery->setQuery($keyword)\n ->setTieBreaker(0.3)\n ->setOperator(\"and\")\n ->setFields([\n 'friendlyUrl^500',\n 'title.raw^200',\n 'title.analyzed^10',\n 'description^5',\n 'searchInfo.keyword^1',\n 'searchInfo.location^1',\n ]);\n\n $content |= 2;\n }\n\n /* ModStores Hooks */\n HookFire(\"baseconfiguration_before_setup_query\", [\n \"content\" => &$content,\n \"whereQuery\" => &$whereQuery,\n \"keywordQuery\" => &$keywordQuery\n ]);\n\n switch ($content) {\n case 1:\n $query = $whereQuery;\n break;\n case 2:\n $query = $keywordQuery;\n break;\n case 3:\n $query = $qB->query()->bool();\n $query->addMust($keywordQuery);\n $query->addMust($whereQuery);\n break;\n default:\n $query = $qB->query()->match_all();\n break;\n }\n\n /* ModStores Hooks */\n HookFire(\"baseconfiguration_before_return_query\", [\n \"query\" => &$query,\n ]);\n\n return $query;\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('user_id',$this->user_id);\n\t\t$criteria->compare('forma_de_org',$this->forma_de_org);\n\t\t$criteria->compare('denumire',$this->denumire,true);\n\t\t$criteria->compare('cui',$this->cui,true);\n\t\t$criteria->compare('nr_reg_cc',$this->nr_reg_cc,true);\n\t\t$criteria->compare('data_reg_cc',$this->data_reg_cc,true);\n\t\t$criteria->compare('nr_inreg_cm',$this->nr_inreg_cm,true);\n\t\t$criteria->compare('cod_caen',$this->cod_caen,true);\n\t\t$criteria->compare('valoare_capital_s',$this->valoare_capital_s,true);\n\t\t$criteria->compare('categoria_de_venit',$this->categoria_de_venit);\n\t\t$criteria->compare('det_venit_net',$this->det_venit_net);\n\t\t$criteria->compare('nume',$this->nume,true);\n\t\t$criteria->compare('initiala_nume',$this->initiala_nume,true);\n\t\t$criteria->compare('prenume',$this->prenume,true);\n\t\t$criteria->compare('cod_postal',$this->cod_postal,true);\n\t\t$criteria->compare('adresa',$this->adresa,true);\n\t\t$criteria->compare('telefon',$this->telefon,true);\n\t\t$criteria->compare('fax',$this->fax,true);\n\t\t$criteria->compare('email',$this->email,true);\n\t\t$criteria->compare('cod_banca',$this->cod_banca);\n\t\t$criteria->compare('cod_iban',$this->cod_iban,true);\n\t\t$criteria->compare('create_time',$this->create_time,true);\n\t\t$criteria->compare('create_user_id',$this->create_user_id);\n\t\t$criteria->compare('update_time',$this->update_time,true);\n\t\t$criteria->compare('update_user_id',$this->update_user_id);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}" ]
[ "0.62401915", "0.60871834", "0.6029596", "0.60023415", "0.59613615", "0.5913642", "0.5882849", "0.58380216", "0.58275706", "0.5788153", "0.5749139", "0.5735222", "0.573481", "0.5734255", "0.5688685", "0.5683262", "0.56727004", "0.5651959", "0.5651959", "0.5630301", "0.5609851", "0.5600501", "0.55957353", "0.5593662", "0.5580147", "0.5579814", "0.5573759", "0.55735767", "0.55688345", "0.5551366", "0.55438626", "0.55339015", "0.55142725", "0.55091375", "0.5502367", "0.5482796", "0.5481262", "0.54795444", "0.54775214", "0.5475628", "0.546487", "0.5454585", "0.54536784", "0.54313606", "0.5429556", "0.5422299", "0.54067796", "0.54041374", "0.5394749", "0.5389138", "0.5385545", "0.53854626", "0.5381953", "0.5373137", "0.53515404", "0.5341743", "0.53325653", "0.5327203", "0.532678", "0.5317191", "0.53138906", "0.531322", "0.53130776", "0.5308478", "0.5297349", "0.5295426", "0.5292193", "0.52865237", "0.52849495", "0.5284895", "0.52815044", "0.52804697", "0.5280222", "0.5278987", "0.5278191", "0.527784", "0.5273801", "0.5272925", "0.5267473", "0.5266196", "0.5262232", "0.52587813", "0.52582645", "0.52535045", "0.5251057", "0.5250601", "0.524911", "0.5246802", "0.524657", "0.52448916", "0.52444255", "0.5240917", "0.52400994", "0.5229289", "0.5228359", "0.5228168", "0.5226475", "0.52260023", "0.52202773", "0.52193207" ]
0.5744267
11
Display a listing of the resource.
public function get(Request $request) { // $entidades = Entidad::orderBy('orden')->with('atributos')->paginate(5); return $entidades->toJson(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { if ($request->id == 0) { $entidad = new Entidad; } else { $entidad = Entidad::findOrFail($request->id); } $entidad->fill($request->all()); $entidad->save(); $entidades = Entidad::orderBy('orden')->with('atributos')->paginate(5); return $entidades->toJson(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Store a newly created resource in storage.
public function store_atributo(Request $request) { if ($request->id == 0) { $atributo = new Atributo; } else { $atributo = Atributo::findOrFail($request->id); } $atributo->fill($request->all()); $atributo->save(); $atributos = Atributo::orderBy('orden')->where('entidad_id',$atributo->entidad_id)->with('atributo_padre')->with('atributo_padre.entidad')->paginate(5); return $atributos->toJson(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Remove the specified resource from storage.
public function destroy(Request $request) { $entidad = Entidad::findOrFail($request->id); $entidad->delete(); $entidades = Entidad::orderBy('orden')->with('atributos')->paginate(5); return $entidades->toJson(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Remove the specified resource from storage.
public function destroy_atributo(Request $request) { $atributo = Atributo::findOrFail($request->id); $entidad_id = $atributo->entidad_id; $atributo->delete(); $atributos = Atributo::orderBy('orden')->where('entidad_id',$entidad_id)->with('atributo_padre')->with('atributo_padre.entidad')->paginate(5); return $atributos->toJson(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Take two or more Expression as parameters.
public function __construct(string $expression, ...$children) { $this->expression = $expression; $this->children = $children; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gte($x, $y, $and=null, ...$args)\n {\n $expression = array();\n array_push($expression, $x, GTE, $y, $and, ...$args);\n return $expression;\n }", "function gte($x, $y, $and=null, ...$args)\n {\n $expression = array();\n array_push($expression, $x, GTE, $y, $and, ...$args);\n return $expression;\n }", "public function testArityMultiplePlainValues(): void\n {\n $f = new $this->expressionClass('MyFunction', ['foo', 'bar']);\n $binder = new ValueBinder();\n $this->assertSame('MyFunction(:param0, :param1)', $f->sql($binder));\n\n $this->assertSame('foo', $binder->bindings()[':param0']['value']);\n $this->assertSame('bar', $binder->bindings()[':param1']['value']);\n\n $binder = new ValueBinder();\n $f = new $this->expressionClass('MyFunction', ['bar']);\n $this->assertSame('MyFunction(:param0)', $f->sql($binder));\n $this->assertSame('bar', $binder->bindings()[':param0']['value']);\n }", "public function expressionFunction();", "function lte($x, $y, $and=null, ...$args)\n {\n $expression = array();\n array_push($expression, $x, LTE, $y, $and, ...$args);\n return $expression;\n }", "function lte($x, $y, $and=null, ...$args)\n {\n $expression = array();\n array_push($expression, $x, LTE, $y, $and, ...$args);\n return $expression;\n }", "public function testTupleWithExpressionFields(): void\n {\n $field1 = new QueryExpression(['a' => 1]);\n $f = new TupleComparison([$field1, 'field2'], [4, 5], ['integer', 'integer'], '>');\n $binder = new ValueBinder();\n $this->assertSame('(a = :c0, field2) > (:tuple1, :tuple2)', $f->sql($binder));\n $this->assertSame(1, $binder->bindings()[':c0']['value']);\n $this->assertSame(4, $binder->bindings()[':tuple1']['value']);\n $this->assertSame(5, $binder->bindings()[':tuple2']['value']);\n }", "public function testTupleWithExpressionValues(): void\n {\n $value1 = new QueryExpression(['a' => 1]);\n $f = new TupleComparison(['field1', 'field2'], [$value1, 2], ['integer', 'integer'], '=');\n $binder = new ValueBinder();\n $this->assertSame('(field1, field2) = (a = :c0, :tuple1)', $f->sql($binder));\n $this->assertSame(1, $binder->bindings()[':c0']['value']);\n $this->assertSame(2, $binder->bindings()[':tuple1']['value']);\n }", "function between($x, $y, $y2, ...$args)\n {\n $expression = array();\n array_push($expression, $x, _BETWEEN,$y, $y2, ...$args);\n return $expression;\n }", "function between($x, $y, $y2, ...$args)\n {\n $expression = array();\n array_push($expression, $x, _BETWEEN,$y, $y2, ...$args);\n return $expression;\n }", "function orB($lhs = null, $rhs = null)\n{\n return call_user_func_array(__PRIVATE__::$instance[orB], func_get_args());\n}", "abstract protected function createExpression();", "public function addExpression($expression, $alias = NULL, $arguments = []);", "public static function expr(string $exp, $parameters = []) : Expression\n {\n return new Expression($exp, $parameters);\n }", "function gt($x, $y, $and=null, ...$args)\n {\n $expression = array();\n array_push($expression, $x, GT, $y, $and, ...$args);\n return $expression;\n }", "function gt($x, $y, $and=null, ...$args)\n {\n $expression = array();\n array_push($expression, $x, GT, $y, $and, ...$args);\n return $expression;\n }", "public function &getExpressions();", "public function getExpression();", "protected static function logicalOR(){\n\t\t$values = func_get_args();\n\t\tif(is_array($values[0])){\n\t\t\t$values = $values[0];\n\t\t}\n\t\treturn self::junction('OR', $values);\n\t}", "function neq($x, $y, $and=null, ...$args)\n {\n $expression = array();\n array_push($expression, $x, NEQ, $y, $and, ...$args);\n return $expression;\n }", "function neq($x, $y, $and=null, ...$args)\n {\n $expression = array();\n array_push($expression, $x, NEQ, $y, $and, ...$args);\n return $expression;\n }", "public function find($expression1, $expression2 = null){\n $ors = func_get_args();\n $objects = $this->items;\n foreach($this->items as $index => $item){\n $remove = true;\n $c = 0;\n foreach($ors as $val){\n foreach($val as $path => $value){\n if($value != parent::_find($path, $item)){\n break;\n }elseif($c == count($ors) - 1){\n $remove = false;\n break 2;\n }\n $c++;\n }\n }\n if($remove){\n unset($objects[$index]);\n }\n }\n return (new ArrayList($this->type))->set($objects);\n }", "public function multipleCalculate(array $operands): float;", "public function __invoke(...$operands)\n\t{\n\t\t$operands = $this->generate( $operands );\n\t\t\n\t\t$ret = $operands->current();\n\t\tif( $operands->valid() )\n\t\t\t$ret = $ret->operate( $this );\n\t\treturn $ret;\n\t}", "function ne($x, $y, $and=null, ...$args)\n {\n $expression = array();\n array_push($expression, $x, NE, $y, $and, ...$args);\n return $expression;\n }", "function ne($x, $y, $and=null, ...$args)\n {\n $expression = array();\n array_push($expression, $x, NE, $y, $and, ...$args);\n return $expression;\n }", "protected function parseExpression()\n {\n $entities = array();\n while ($e = $this->matchFuncs(array('parseAddition', 'parseEntity'))) {\n $entities[] = $e;\n // operations do not allow keyword \"/\" dimension (e.g. small/20px) so we support that here\n if (!$this->peekReg('/\\\\G\\/[\\/*]/') && ($delim = $this->matchChar('/'))) {\n $entities[] = new ILess_Node_Anonymous($delim);\n }\n }\n if (count($entities) > 0) {\n return new ILess_Node_Expression($entities);\n }\n }", "public function cartesianProduct(?callable $operation = null, ?callable $filter = null);", "public function where() {\r\n\t\t$args = func_get_args();\r\n\t\t$expr = array_shift($args);\r\n\t\tarray_push($this->_wheres, '(' . $this->_parameterize($expr, $args) . ')');\r\n\t\t$this->_dirty = true;\r\n\t}", "function addTwoValues($x, $y) {\n return $x + $y;\n}", "public function testBuildWhereWithTwoArguments()\n {\n $query = $this->getQuery()\n ->where('param1', 'value1')\n ->where('param2', 'in', ['value2', 'value3'])\n ;\n\n $this->assertSame(\n \"WHERE param1 = 'value1' AND param2 IN ('value2', 'value3')\",\n $query->buildWhere()\n );\n }", "protected function parseEntitiesArguments()\n {\n $args = array();\n while ($arg = $this->matchFuncs(array('parseEntitiesAssignment', 'parseExpression'))) {\n $args[] = $arg;\n if (!$this->matchChar(',')) {\n break;\n }\n }\n\n return $args;\n }", "function _expr_token_parse_params($expr)\n {\n $params = array();\n $cpos = 0;\n $instring = FALSE;\n $instring_delim = '';\n $bnl = 0;\n $size = strlen($expr);\n $param = '';\n while ($cpos <= $size)\n {\n if ($cpos == $size) {$params[] = $this->_expr_token($param); break;}\n $char = $expr[$cpos];\n if (!$instring)\n {\n if ($char == '\"' or $char == '\\'') {$instring = TRUE; $instring_delim = $char;}\n elseif ($char == '(') {$bnl++;}\n elseif ($char == ')') {$bnl--;}\n }\n else\n {\n if ($char == $instring_delim and $expr[$cpos-1] != '\\\\') {$instring = FALSE;}\n }\n if (!$instring and $bnl == 0 and $char == ',') {$params[] = $this->_expr_token($param); $param = '';}\n else {$param .= $char;}\n $cpos++;\n }\n return $params;\n }", "public function compose(array $parameters);", "static function evalExpression(\n\t $expression,\n\t $params = array())\n\t{\n\t\tif (is_array($params)) {\n\t\t\textract($params);\n\t\t}\n\t\teval('$value = ' . $expression . ';');\n\t\treturn $value;\n\t}", "static function _OR($params1, $params2){\n /* del parametro 1 separa el campo del valor */\n $params_1 = explode('=', $params1);\n $campo1 = trim($params_1[0]);\n $var1 = trim($params_1[1]);\n\n /* del parametro 2 separa el campo del valor */\n $params_2 = explode('=', $params2);\n $campo2 = trim($params_2[0]);\n $var2 = trim($params_2[1]);\n\n if($campo1 != $campo2)\n throw new \\Exception('Unexpected error creating OR clause. The fields involved should be the same.');\n\n /* busca si existe el campo en el modelo en cuestion */\n if(aModels::findFieldModel($campo1) == 'STRING'){\n return \"(\". $campo1 . \"= '\" .(strip_tags($var1)). \"' {or} \". $campo2 . \"= '\" .(strip_tags($var2)) .\"')\";\n }else\n return '('. $params1 . ' {or} '. $params2 .')';\n }", "public function __invoke(...$operands)\n\t{\n\t\t$operands = $this->generate( $operands );\n\n\t\t$ret = $operands->current();\n\t\tfor( $operands->next(); $operands->valid(); $operands->next() )\n\t\t\t$ret = $ret->operate( $this, $operands->current() );\n\t\treturn $ret;\n\t}", "public function conditions_for($arg1 = null, $arg2 = null) {\n switch (func_num_args()) {\n case 0:\n return '';\n case 1:\n if (is_array($arg1)) {\n $values = array();\n foreach ($this->auto_quote_array($arg1) as $k => $v) $values[] = \"$k = $v\";\n return implode(' AND ', $values);\n } else {\n return $arg1;\n }\n case 2:\n if (is_array($arg2)) {\n return $this->auto_quote_query($arg1, $arg2);\n } else {\n list($type, $name) = $this->resolve_field_type_and_name($arg1);\n if ($type !== null) {\n $quoter = self::$quote_methods[$type];\n $arg2 = $this->$quoter($arg2);\n }\n return \"$name = $arg2\";\n }\n default:\n throw new GDBException;\n }\n }", "function notBetween($x, $y, $y2, ...$args)\n {\n $expression = array();\n array_push($expression, $x, _notBETWEEN, $y, $y2, ...$args);\n return $expression;\n }", "function notBetween($x, $y, $y2, ...$args)\n {\n $expression = array();\n array_push($expression, $x, _notBETWEEN, $y, $y2, ...$args);\n return $expression;\n }", "protected function validateExpressions()\n {\n if ( $this->expression_starts != $this->expression_ends ) {\n throw new \\Exception( \"Number of expression 'starts' and 'ends' does not match. starts = {$this->expression_starts}; ends = {$this->expression_ends}\" );\n }\n }", "public function orWhereIn()\n {\n list($field, $value) = $this->extractQueryToFieldAndValue(func_get_args());\n if (!is_array($value)) {\n $value = [$value];\n }\n return $this->addOrWhereStack([$field => [self::OPERATORS['in'] => $value]]); \n }", "public function getExpressions();", "function in($x, $y, $and=null, ...$args)\n {\n $expression = array();\n array_push($expression, $x, _IN, $y, $and, ...$args);\n return $expression;\n }", "function in($x, $y, $and=null, ...$args)\n {\n $expression = array();\n array_push($expression, $x, _IN, $y, $and, ...$args);\n return $expression;\n }", "public function on($column1,$column2,$operator = \"=\");", "function OrWhereClause() {\n\t\t$this->clauses = func_get_args();\n\t}", "public static function buildByConcat($closure1, $closure2)\n {\n $closures = static::prepareClosuresList(func_get_args());\n\n if (2 > count($closures)) {\n throw new \\InvalidArgumentException('Closures list must be length 2 or bigger');\n }\n\n $func = function() use ($closures) {\n $args = func_get_args();\n foreach ($closures as $closure) {\n $args = call_user_func_array($closure, $args);\n }\n\n return $args;\n };\n\n return new static($func);\n }", "function e($expr) \n {\n //call the core evaluation method\n return $this->evaluate($expr);\n }", "public function addExpression( $expression ) {\n if ( !$expression ) {\n return;\n }\n else if ( is_array( $expression ) ) {\n $this->expression = array_merge( $this->getExpression(), $expression );\n }\n else {\n $this->expression[] = $expression;\n }\n }", "public function condition()\n {\n $op = $this->getDefaultOperator();\n $params = func_get_args();\n \n switch (count($params)) {\n case 1:\n if (is_string($params[0])) {\n $this->addCondition('literal', [$params[0]]);\n } elseif (is_array($params[0])) {\n $combination = $this->getDefaultOperator();\n \n /**\n * The code within the foreach is an extraction of Zend\\Db\\Sql\\Select::where()\n */\n foreach ($params[0] as $pkey => $pvalue) {\n if (is_string($pkey) && strpos($pkey, '?') !== false) {\n # ['id = ?' => 1]\n # ['id IN (?, ?, ?)' => [1, 3, 4]]\n $predicate = new ZfPredicate\\Expression($pkey, $pvalue);\n } elseif (is_string($pkey)) {\n if ($pvalue === null) {\n # ['name' => null] -> \"ISNULL(name)\"\n $predicate = new ZfPredicate\\IsNull($pkey, $pvalue);\n } elseif (is_array($pvalue)) {\n # ['id' => [1, 2, 3]] -> \"id IN (1, 2, 3)\"\n $predicate = new ZfPredicate\\In($pkey, $pvalue);\n } else {\n # ['id' => $id] -> \"id = 15\"\n $predicate = new ZfPredicate\\Operator($pkey, ZfPredicate\\Operator::OP_EQ, $pvalue);\n }\n } elseif ($pvalue instanceof ZfPredicate\\PredicateInterface) {\n $predicate = $pvalue;\n } else {\n # ['id = ?'] -> \"id = ''\"\n # ['id = 1'] -> literal.\n $predicate = (strpos($pvalue, Expression::PLACEHOLDER) !== false)\n ? new ZfPredicate\\Expression($pvalue) : new ZfPredicate\\Literal($pvalue);\n }\n $this->getCurrentPredicate()->addPredicate($predicate, $combination);\n }\n }\n break;\n \n case 2:\n # $rel->where('foo = ? AND id IN (?) AND bar = ?', [true, [1, 2, 3], false]);\n # If passing a non-array value:\n # $rel->where('foo = ?', 1);\n # But if an array is to be passed, must be inside another array\n # $rel->where('id IN (?)', [[1, 2, 3]]);\n if (!is_array($params[1])) {\n $params[1] = [$params[1]];\n }\n $this->expandPlaceholders($params[0], $params[1]);\n $this->addCondition('expression', [$params[0], $params[1]]);\n break;\n \n case 3:\n # $rel->where('id', '>', 2);\n $this->getCurrentPredicate()->addPredicate(\n new ZfPredicate\\Operator($params[0], $params[1], $params[2])\n );\n break;\n \n default:\n throw new Exception\\BadMethodCallException(\n sprintf(\n \"One to three arguments are expected, %s passed\",\n count($params)\n )\n );\n }\n \n return $this;\n }", "public function expressionListWithNotInIsConcatenatedWithAnd() {}", "protected function formatArgsForExpression(array $arguments): string\n {\n $mapping = [];\n foreach ($arguments as $argument) {\n $mapping[] = sprintf('%s: \"%s\"', $argument->getName(), $argument->getType());\n }\n\n return sprintf('arguments({%s}, args)', implode(', ', $mapping));\n }", "public function createFilterArguments($expressions)\n {\n $filter = [];\n\n /**\n * @var Expression $expression\n */\n foreach ($expressions as $expression) {\n $logicOperator = $this->normalizeLogicOperation($expression->getLogicOperator());\n $compareOperator = $this->normalizeOperation($expression->getOperation());\n\n $expr = [\n $expression->getField() => [\n $compareOperator => $expression->getValue()\n ]\n ];\n\n $filter[$logicOperator][] = $expr;\n }\n return $filter;\n }", "public function __invoke(...$operands)\n\t{\n\t\t$operands = $this->generate($operands);\n\t\t$operand = $operands->current();\n\t\tif( $operand )\n\t\t{\n\t\t\tyield $operand;\n\t\t\tyield $operand;\n\t\t}\n\t}", "public static function JSONContains(array $params) : Expression\n {\n $count_params = count($params);\n\n if ($count_params === 2) {\n $field = ArrayHelper::getValue($params, 0);\n\n $field_params = static::parseFieldParam($field);\n $field_name = ArrayHelper::getValue($field_params, 'field_name');\n $path = ArrayHelper::getValue($field_params, 'path');\n\n $value = ArrayHelper::getValue($params, 1);\n\n if (is_array($value)) {\n return static::createOrJsonContainsExpression($field_name, $value, $path);\n } else {\n return static::createJsonContainsExpression($field_name, $value, $path);\n }\n }\n\n if ($count_params === 3) {\n $mode = strtoupper(ArrayHelper::getValue($params, 0));\n\n if (!in_array($mode, static::MODES)) {\n throw new InvalidArgumentException('JSONContains first param must be either \"AND\" or \"OR\"');\n }\n\n $values = ArrayHelper::getValue($params, 2);\n\n if (!is_array($values)) {\n throw new InvalidArgumentException('JSONContains third param must be an array');\n }\n\n $field = ArrayHelper::getValue($params, 1);\n $field_params = static::parseFieldParam($field);\n $field_name = ArrayHelper::getValue($field_params, 'field_name');\n $path = ArrayHelper::getValue($field_params, 'path');\n\n if ($mode === static::MODE_AND) {\n return static::createAndJsonContainsExpression($field_name, $values, $path);\n }\n\n if ($mode === static::MODE_OR) {\n return static::createOrJsonContainsExpression($field_name, $values, $path);\n }\n }\n\n throw new InvalidArgumentException('JSONContains params array must contain only 2 or 3 elements');\n }", "function e(array $a = [1, 2, 3, 4], $b = \"hi\") {}", "public function orWhere()\n {\n list($field, $value) = $this->extractQueryToFieldAndValue(func_get_args());\n return $this->addOrWhereStack([$field => $value]);\n }", "public function testBuildWhereWithTwoArgumentsAndAlias()\n {\n $query = $this->getQuery()\n ->alias('alias')\n ->where('param1', 'value1')\n ->where('param2', 'in', ['value2', 'value3'])\n ;\n\n $this->assertSame(\n \"WHERE alias.param1 = 'value1' AND alias.param2 IN ('value2', 'value3')\",\n $query->buildWhere()\n );\n }", "public function expr()/*# : ExpressionInterface */;", "private function comparison(Token $op, &$args) {\n\t\tif (count($args) < 2) {\n\t\t\tthrow new \\Exception(\"Illegal number (\".count($args).\") of operands for \" . $op);\n\t\t}\n\t\t$arg2 = array_pop($args);\n\t\t$arg1 = array_pop($args);\n\t\tif ($arg1->isVariable() || $arg2->isVariable()) {\n\t\t\t$result = new Token(Token::T_UNDEFINED, array($arg1, $arg2));\n\t\t} elseif ($op->type != Token::T_CONTAINS && ! $this->compatible($arg1, $arg2)) { \n\t\t\tthrow new \\Exception(\"operand types for '\" . $op. \"' are not identical\");\n\t\t} elseif ($op->type == Token::T_CONTAINS && $arg1->type != Token::T_ARRAY) { \n\t\t\tthrow new \\Exception(\"first operand type for '\" . $op. \"' is not an array\");\n\t\t} else {\n\t\t\t$result = new Token(Token::T_BOOLEAN, false);\n\t\t\tswitch ($op->type) {\n\t\t\t\tcase Token::T_EQUAL:\n\t\t\t\t\t$result->value = ($arg1->value == $arg2->value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase Token::T_NOT_EQUAL:\n\t\t\t\t\t$result->value = ($arg1->value != $arg2->value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase Token::T_LESS_THAN:\n\t\t\t\t\t$result->value = ($arg1->value < $arg2->value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase Token::T_LESS_OR_EQUAL:\n\t\t\t\t\t$result->value = ($arg1->value <= $arg2->value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase Token::T_GREATER_THAN:\n\t\t\t\t\t$result->value = ($arg1->value > $arg2->value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase Token::T_GREATER_OR_EQUAL:\n\t\t\t\t\t$result->value = ($arg1->value >= $arg2->value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase Token::T_CONTAINS:\n\t\t\t\t\t$result->value = is_array($arg1->value) && in_array($arg2->value, $arg1->value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase Token::T_NOT_CONTAINS:\n\t\t\t\t\t$result->value = ! is_array($arg1->value) || ! in_array($arg2->value, $arg1->value);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "public function combineAndValidator(...$args) : Closure\n {\n foreach ($args as $func) {\n if (!is_callable($func)) {\n throw NoCallableArgumentException(\"{$func} is not callable\");\n }\n }\n return function ($value) {\n return array_reduce(\n $args,\n function ($acc, $func) use ($value) {\n $check = call_user_func($func, $value);\n return array_merge(\n [\n 'result' => $acc['result'] && $check['result']\n ],\n $check['result']\n ? []\n : [\n 'message' => $acc['result']\n ? \"{$check['message']}\"\n : \"{$acc['message']}, {$check['message']}\"\n ]\n );\n },\n ['result' => true]\n );\n };\n }", "protected function operatorExpression(Operator $node): void\n {\n $driver = $this->entitySet->getDriver();\n $left = $node->getLeftNode();\n $right = $node->getRightNode();\n\n switch (true) {\n case $node instanceof Not_:\n $this->pushStatement('(');\n $this->pushStatement('NOT');\n $this->evaluate($left);\n $this->pushStatement(')');\n return;\n\n case $node instanceof In:\n $this->evaluate($left);\n $this->pushStatement('IN');\n $this->pushStatement('(');\n $this->addCommaSeparatedArguments($node);\n $this->pushStatement(')');\n return;\n }\n\n if ($driver === SQLEntitySet::PostgreSQL && ($node instanceof Div || $node instanceof Mod)) {\n switch (true) {\n case $node instanceof Div:\n $this->pushStatement('DIV(');\n break;\n\n case $node instanceof Mod:\n $this->pushStatement('MOD(');\n break;\n }\n\n $this->pushStatement('CAST(');\n $this->evaluate($left);\n $this->pushStatement('AS NUMERIC )');\n $this->pushComma();\n $this->pushStatement('CAST(');\n $this->evaluate($right);\n $this->pushStatement('AS NUMERIC )');\n $this->pushStatement(')');\n return;\n }\n\n $this->pushStatement('(');\n $this->evaluate($left);\n\n if (\n !$node instanceof Comparison\n && (\n $left instanceof StartsWith\n || $left instanceof EndsWith\n || $left instanceof Contains\n || $right instanceof StartsWith\n || $right instanceof EndsWith\n || $right instanceof Contains\n )\n ) {\n if (!($node instanceof Equal && $right instanceof Boolean && $right->getValue()->get() === true)) {\n throw new BadRequestException(\n 'This entity set does not support expression operators with startswith, endswith, contains other than x eq true'\n );\n }\n\n $this->pushStatement(')');\n return;\n }\n\n switch (true) {\n case $node instanceof Div:\n switch ($driver) {\n case SQLEntitySet::MySQL:\n $this->pushStatement('DIV');\n break;\n\n default:\n $node->notImplemented();\n }\n break;\n\n case $node instanceof Add:\n $this->pushStatement('+');\n break;\n\n case $node instanceof DivBy:\n $this->pushStatement('/');\n break;\n\n case $node instanceof Mod:\n switch ($driver) {\n case SQLEntitySet::SQLServer:\n $node->notImplemented();\n\n default:\n $this->pushStatement('%');\n break;\n }\n break;\n\n case $node instanceof Mul:\n $this->pushStatement('*');\n break;\n\n case $node instanceof Sub:\n $this->pushStatement('-');\n break;\n\n case $node instanceof And_:\n $this->pushStatement('AND');\n break;\n\n case $node instanceof Or_:\n $this->pushStatement('OR');\n break;\n\n case $node instanceof Equal:\n if ($right instanceof Literal && $right->getValue() === null) {\n $this->pushStatement('IS NULL )');\n return;\n }\n\n $this->pushStatement('=');\n break;\n\n case $node instanceof GreaterThan:\n $this->pushStatement('>');\n break;\n\n case $node instanceof GreaterThanOrEqual:\n $this->pushStatement('>=');\n break;\n\n case $node instanceof LessThan:\n $this->pushStatement('<');\n break;\n\n case $node instanceof LessThanOrEqual:\n $this->pushStatement('<=');\n break;\n\n case $node instanceof NotEqual:\n if ($right instanceof Literal && $right->getValue() === null) {\n $this->pushStatement('IS NOT NULL )');\n return;\n }\n\n $this->pushStatement('!=');\n break;\n\n case $node instanceof Has:\n $enum = $right->getValue();\n if ($enum instanceof Type\\Enum && $enum->isFlags()) {\n $this->pushStatement('&');\n $this->evaluate($right);\n }\n\n $this->pushStatement('=');\n $this->evaluate($right);\n $this->pushStatement(')');\n return;\n\n default:\n $node->notImplemented();\n }\n\n $this->evaluate($right);\n $this->pushStatement(')');\n }", "public function traverseExpressions(callable $callback);", "public function Values(array $Values, array ...$Multiple): IInsert;", "protected static function logicalAND(){\n\t\t$values = func_get_args();\n\t\tif(is_array($values[0])){\n\t\t\t$values = $values[0];\n\t\t}\n\t\treturn self::junction('AND', $values);\n\t}", "public static function multiple() {\n $params = func_get_args();\n\n // Null if no arguments passed\n if (count($params) == 0) {\n return new qti_variable('multiple', 'identifier');\n } else {\n $result = new qti_variable('multiple', 'identifier', array('value' => array()));\n }\n \n // Allow a single array as well as a parameter list\n if (count($params) == 1 && is_array($params[0])) {\n $params = $params[0];\n }\n \n $allnull = true;\n foreach ($params as $param) {\n if (is_null($param->value)) {\n continue;\n } else {\n $allnull = false;\n $result->type = $param->type;\n if (is_array($param->value)) {\r\n $result->value = array_merge($result->value, $param->value);\n } else {\n $result->value[] = $param->value;\n }\n }\n }\n if ($allnull) {\n $result->value = null;\n }\n \n return $result;\n }", "public function lOr(\n ComponentSpecification $specification1,\n ComponentSpecification $specification2\n ) : Specification\\OrSpecification {\n $args = func_get_args();\n $andSpec = new \\ReflectionClass('\\\\ElementTree\\\\Specification\\\\OrSpecification');\n\n return $andSpec->newInstanceArgs($args);\n }", "function disj($f1, $f2) {\n return function ($x) use ($f1, $f2) {\n return append($f1($x), $f2($x));\n };\n}", "protected function functionExpression(Func $node): void\n {\n $driver = $this->entitySet->getDriver();\n $node->validateArguments();\n\n switch (true) {\n case $node instanceof Ceiling:\n $this->pushStatement('CEILING(');\n break;\n\n case $node instanceof Floor:\n $this->pushStatement('FLOOR(');\n break;\n\n case $node instanceof Round:\n $this->pushStatement('ROUND(');\n\n switch ($driver) {\n case SQLEntitySet::SQLServer:\n $this->evaluate($node->getArgument());\n $this->pushComma();\n $this->pushStatement('0 )');\n return;\n }\n break;\n\n case $node instanceof Func\\Type\\Cast:\n $arguments = $node->getArguments();\n list($arg1, $arg2) = $arguments;\n $targetType = null;\n\n switch ($arg2->getValue()) {\n case Type\\Binary::identifier:\n switch ($this->entitySet->getDriver()) {\n case SQLEntitySet::SQLite:\n $targetType = 'TEXT';\n break;\n\n case SQLEntitySet::PostgreSQL:\n $targetType = 'bytea';\n break;\n\n default:\n $targetType = 'BINARY';\n break;\n }\n break;\n\n case Type\\UInt16::identifier:\n switch ($this->entitySet->getDriver()) {\n case SQLEntitySet::SQLite:\n $targetType = 'INTEGER';\n break;\n\n case SQLEntitySet::SQLServer:\n case SQLEntitySet::PostgreSQL:\n $targetType = 'SMALLINT';\n break;\n\n case SQLEntitySet::MySQL:\n $targetType = 'UNSIGNED INTEGER';\n break;\n }\n break;\n\n case Type\\UInt32::identifier:\n switch ($this->entitySet->getDriver()) {\n case SQLEntitySet::PostgreSQL:\n case SQLEntitySet::SQLite:\n case SQLEntitySet::SQLServer:\n $targetType = 'INTEGER';\n break;\n\n case SQLEntitySet::MySQL:\n $targetType = 'UNSIGNED INTEGER';\n break;\n }\n break;\n\n case Type\\UInt64::identifier:\n switch ($this->entitySet->getDriver()) {\n case SQLEntitySet::SQLite:\n $targetType = 'INTEGER';\n break;\n\n case SQLEntitySet::SQLServer:\n case SQLEntitySet::PostgreSQL:\n $targetType = 'BIGINT';\n break;\n\n case SQLEntitySet::MySQL:\n $targetType = 'UNSIGNED INTEGER';\n break;\n }\n break;\n\n case Type\\Boolean::identifier:\n switch ($this->entitySet->getDriver()) {\n case SQLEntitySet::SQLite:\n $targetType = 'INTEGER';\n break;\n\n case SQLEntitySet::MySQL:\n $targetType = 'UNSIGNED INTEGER';\n break;\n\n case SQLEntitySet::SQLServer:\n $targetType = 'BIT';\n break;\n\n case SQLEntitySet::PostgreSQL:\n $targetType = 'BOOLEAN';\n break;\n\n }\n break;\n\n case Type\\Date::identifier:\n switch ($this->entitySet->getDriver()) {\n case SQLEntitySet::SQLite:\n $targetType = 'TEXT';\n break;\n\n case SQLEntitySet::MySQL:\n case SQLEntitySet::PostgreSQL:\n case SQLEntitySet::SQLServer:\n $targetType = 'DATE';\n break;\n }\n break;\n\n case Type\\DateTimeOffset::identifier:\n switch ($this->entitySet->getDriver()) {\n case SQLEntitySet::SQLite:\n $targetType = 'TEXT';\n break;\n\n case SQLEntitySet::PostgreSQL:\n $targetType = 'TIMESTAMP(3)';\n break;\n\n case SQLEntitySet::SQLServer:\n $targetType = 'DATETIMEOFFSET';\n break;\n\n case SQLEntitySet::MySQL:\n $targetType = 'DATETIME(3)';\n break;\n }\n break;\n\n case Type\\Decimal::identifier:\n switch ($this->entitySet->getDriver()) {\n case SQLEntitySet::SQLite:\n $targetType = 'REAL';\n break;\n\n case SQLEntitySet::MySQL:\n case SQLEntitySet::PostgreSQL:\n case SQLEntitySet::SQLServer:\n $targetType = 'DECIMAL(10,10)';\n break;\n }\n break;\n\n case Type\\Double::identifier:\n switch ($this->entitySet->getDriver()) {\n case SQLEntitySet::SQLite:\n $targetType = 'REAL';\n break;\n\n case SQLEntitySet::SQLServer:\n case SQLEntitySet::PostgreSQL:\n $targetType = 'DOUBLE PRECISION';\n break;\n\n case SQLEntitySet::MySQL:\n $targetType = 'DOUBLE';\n break;\n }\n break;\n\n case Type\\Int16::identifier:\n switch ($this->entitySet->getDriver()) {\n case SQLEntitySet::SQLite:\n $targetType = 'INTEGER';\n break;\n\n case SQLEntitySet::MySQL:\n $targetType = 'SIGNED INTEGER';\n break;\n\n case SQLEntitySet::SQLServer:\n case SQLEntitySet::PostgreSQL:\n $targetType = 'SMALLINT';\n break;\n }\n break;\n\n case Type\\Int32::identifier:\n switch ($this->entitySet->getDriver()) {\n case SQLEntitySet::SQLServer:\n case SQLEntitySet::PostgreSQL:\n case SQLEntitySet::SQLite:\n $targetType = 'INTEGER';\n break;\n\n case SQLEntitySet::MySQL:\n $targetType = 'SIGNED INTEGER';\n break;\n }\n break;\n\n case Type\\Int64::identifier:\n switch ($this->entitySet->getDriver()) {\n case SQLEntitySet::SQLite:\n $targetType = 'INTEGER';\n break;\n\n case SQLEntitySet::MySQL:\n $targetType = 'SIGNED INTEGER';\n break;\n\n case SQLEntitySet::SQLServer:\n case SQLEntitySet::PostgreSQL:\n $targetType = 'BIGINT';\n break;\n }\n break;\n\n case Type\\SByte::identifier:\n switch ($this->entitySet->getDriver()) {\n case SQLEntitySet::SQLite:\n $targetType = 'INTEGER';\n break;\n\n case SQLEntitySet::MySQL:\n $targetType = 'SIGNED INTEGER';\n break;\n\n case SQLEntitySet::PostgreSQL:\n $targetType = 'SMALLINT';\n break;\n\n case SQLEntitySet::SQLServer:\n $targetType = 'TINYINT';\n break;\n }\n break;\n\n case Type\\Single::identifier:\n switch ($this->entitySet->getDriver()) {\n case SQLEntitySet::SQLite:\n case SQLEntitySet::PostgreSQL:\n $targetType = 'REAL';\n break;\n\n case SQLEntitySet::MySQL:\n case SQLEntitySet::SQLServer:\n $targetType = 'FLOAT';\n break;\n }\n break;\n\n case Type\\String_::identifier:\n switch ($this->entitySet->getDriver()) {\n case SQLEntitySet::SQLite:\n $targetType = 'TEXT';\n break;\n\n case SQLEntitySet::PostgreSQL:\n case SQLEntitySet::SQLServer:\n $targetType = 'VARCHAR';\n break;\n\n case SQLEntitySet::MySQL:\n $targetType = 'CHAR';\n break;\n }\n break;\n\n case Type\\TimeOfDay::identifier:\n switch ($this->entitySet->getDriver()) {\n case SQLEntitySet::SQLite:\n $targetType = 'TEXT';\n break;\n\n case SQLEntitySet::PostgreSQL:\n case SQLEntitySet::SQLServer:\n case SQLEntitySet::MySQL:\n $targetType = 'TIME(3)';\n break;\n }\n break;\n\n default:\n $node->notImplemented();\n }\n\n switch ($this->entitySet->getDriver()) {\n case SQLEntitySet::SQLServer:\n $this->pushStatement('CONVERT(');\n $this->pushStatement($targetType);\n $this->pushComma();\n $this->evaluate($arg1);\n $this->pushComma();\n // https://learn.microsoft.com/en-us/sql/t-sql/functions/cast-and-convert-transact-sql#date-and-time-styles\n $this->pushStatement('120');\n $this->pushStatement(')');\n break;\n\n case SQLEntitySet::PostgreSQL:\n case SQLEntitySet::SQLite:\n $this->pushStatement('CAST(');\n $this->evaluate($arg1);\n $this->pushStatement('AS');\n $this->pushStatement($targetType);\n $this->pushStatement(')');\n break;\n\n case SQLEntitySet::MySQL:\n $this->pushStatement('CONVERT(');\n $this->evaluate($arg1);\n $this->pushComma();\n $this->pushStatement($targetType);\n $this->pushStatement(')');\n break;\n }\n return;\n\n case $node instanceof Node\\Func\\DateTime\\Date:\n switch ($driver) {\n case SQLEntitySet::MySQL:\n $this->pushStatement('DATE(');\n break;\n\n case SQLEntitySet::SQLite:\n $this->pushStatement(\"STRFTIME( '%Y-%m-%d',\");\n break;\n\n case SQLEntitySet::PostgreSQL:\n $this->pushStatement('(');\n $this->evaluate($node->getArgument());\n $this->pushStatement(')::date');\n return;\n\n case SQLEntitySet::SQLServer:\n $this->pushStatement('FORMAT(');\n $this->evaluate($node->getArgument());\n $this->pushStatement(\", 'yyyy-MM-dd')\");\n return;\n\n default:\n $node->notImplemented();\n }\n break;\n\n case $node instanceof Day:\n switch ($driver) {\n case SQLEntitySet::SQLServer:\n $this->pushStatement('DATEPART( day,');\n break;\n\n case SQLEntitySet::PostgreSQL:\n $this->pushStatement(\"DATE_PART( 'DAY',\");\n $this->evaluate($node->getArgument());\n $this->pushStatement('::timestamp)::integer');\n return;\n\n case SQLEntitySet::MySQL:\n $this->pushStatement('DAY(');\n break;\n\n case SQLEntitySet::SQLite:\n $this->pushStatement(\"CAST( STRFTIME( '%d',\");\n $this->evaluate($node->getArgument());\n $this->pushStatement(') AS NUMERIC )');\n return;\n\n default:\n $node->notImplemented();\n }\n break;\n\n case $node instanceof Hour:\n switch ($driver) {\n case SQLEntitySet::MySQL:\n $this->pushStatement('HOUR(');\n break;\n\n case SQLEntitySet::SQLServer:\n $this->pushStatement('DATEPART( hour,');\n break;\n\n case SQLEntitySet::PostgreSQL:\n $this->pushStatement(\"DATE_PART( 'HOUR',\");\n $this->evaluate($node->getArgument());\n $this->pushStatement('::timestamp)::integer');\n return;\n\n case SQLEntitySet::SQLite:\n $this->pushStatement(\"CAST( STRFTIME( '%H',\");\n $this->evaluate($node->getArgument());\n $this->pushStatement(') AS NUMERIC )');\n return;\n\n default:\n $node->notImplemented();\n }\n break;\n\n case $node instanceof Minute:\n switch ($driver) {\n case SQLEntitySet::SQLServer:\n $this->pushStatement('DATEPART( minute,');\n break;\n\n case SQLEntitySet::PostgreSQL:\n $this->pushStatement(\"DATE_PART( 'MINUTE',\");\n $this->evaluate($node->getArgument());\n $this->pushStatement('::timestamp)::integer');\n return;\n\n case SQLEntitySet::MySQL:\n $this->pushStatement('MINUTE(');\n break;\n\n case SQLEntitySet::SQLite:\n $this->pushStatement(\"CAST( STRFTIME( '%M',\");\n $this->evaluate($node->getArgument());\n $this->pushStatement(') AS NUMERIC )');\n return;\n\n default:\n $node->notImplemented();\n }\n break;\n\n case $node instanceof Month:\n switch ($driver) {\n case SQLEntitySet::MySQL:\n $this->pushStatement('MONTH(');\n break;\n\n case SQLEntitySet::SQLServer:\n $this->pushStatement('DATEPART( month,');\n break;\n\n case SQLEntitySet::PostgreSQL:\n $this->pushStatement(\"DATE_PART( 'MONTH',\");\n $this->evaluate($node->getArgument());\n $this->pushStatement('::timestamp)::integer');\n return;\n\n case SQLEntitySet::SQLite:\n $this->pushStatement(\"CAST( STRFTIME( '%m',\");\n $this->evaluate($node->getArgument());\n $this->pushStatement(') AS NUMERIC )');\n return;\n\n default:\n $node->notImplemented();\n }\n break;\n\n case $node instanceof Now:\n switch ($driver) {\n case SQLEntitySet::MySQL:\n case SQLEntitySet::PostgreSQL:\n $this->pushStatement('NOW(');\n break;\n\n case SQLEntitySet::SQLServer:\n $this->pushStatement('CURRENT_TIMESTAMP(');\n break;\n\n case SQLEntitySet::SQLite:\n $this->pushStatement(\"DATETIME( 'now'\");\n break;\n\n default:\n $node->notImplemented();\n }\n break;\n\n case $node instanceof Second:\n switch ($driver) {\n case SQLEntitySet::MySQL:\n $this->pushStatement('SECOND(');\n break;\n\n case SQLEntitySet::SQLServer:\n $this->pushStatement('DATEPART( second,');\n break;\n\n case SQLEntitySet::PostgreSQL:\n $this->pushStatement(\"DATE_PART( 'SECOND',\");\n $this->evaluate($node->getArgument());\n $this->pushStatement('::timestamp)::integer');\n return;\n\n case SQLEntitySet::SQLite:\n $this->pushStatement(\"CAST( STRFTIME( '%S',\");\n $this->evaluate($node->getArgument());\n $this->pushStatement(') AS NUMERIC )');\n return;\n\n default:\n $node->notImplemented();\n }\n break;\n\n case $node instanceof Time:\n switch ($driver) {\n case SQLEntitySet::MySQL:\n $this->pushStatement('TIME(');\n break;\n\n case SQLEntitySet::SQLite:\n $this->pushStatement(\"STRFTIME( '%H:%M:%S',\");\n break;\n\n case SQLEntitySet::PostgreSQL:\n $this->pushStatement('(');\n $this->evaluate($node->getArgument());\n $this->pushStatement(')::time');\n return;\n\n case SQLEntitySet::SQLServer:\n $this->pushStatement('FORMAT(');\n $this->evaluate($node->getArgument());\n $this->pushStatement(\", 'HH:mm:ss')\");\n return;\n\n default:\n $node->notImplemented();\n }\n break;\n\n case $node instanceof Year:\n switch ($driver) {\n case SQLEntitySet::MySQL:\n $this->pushStatement('YEAR(');\n break;\n\n case SQLEntitySet::SQLServer:\n $this->pushStatement('DATEPART( year,');\n break;\n\n case SQLEntitySet::PostgreSQL:\n $this->pushStatement(\"DATE_PART( 'YEAR', \");\n $this->evaluate($node->getArgument());\n $this->pushStatement('::timestamp)::integer');\n return;\n\n case SQLEntitySet::SQLite:\n $this->pushStatement(\"CAST( STRFTIME( '%Y',\");\n $this->evaluate($node->getArgument());\n $this->pushStatement(') AS NUMERIC )');\n return;\n\n default:\n $node->notImplemented();\n }\n break;\n\n case $node instanceof MatchesPattern:\n switch ($driver) {\n case SQLEntitySet::MySQL:\n $this->pushStatement('REGEXP_LIKE(');\n break;\n\n case SQLEntitySet::PostgreSQL:\n $arguments = $node->getArguments();\n list($arg1, $arg2) = $arguments;\n $this->evaluate($arg1);\n $this->pushStatement('~');\n $this->evaluate($arg2);\n return;\n\n default:\n $node->notImplemented();\n }\n break;\n\n case $node instanceof ToLower:\n $this->pushStatement('LOWER(');\n break;\n\n case $node instanceof ToUpper:\n $this->pushStatement('UPPER(');\n break;\n\n case $node instanceof Trim:\n $this->pushStatement('TRIM(');\n break;\n\n case $node instanceof Concat:\n switch ($driver) {\n case SQLEntitySet::PostgreSQL:\n $arguments = $node->getArguments();\n\n if (!$arguments) {\n return;\n }\n\n $this->pushStatement('CONCAT(');\n while ($arguments) {\n $argument = array_shift($arguments);\n $this->pushStatement('CAST(');\n $this->evaluate($argument);\n $this->pushStatement('AS TEXT )');\n\n if ($arguments) {\n $this->pushComma();\n }\n }\n\n $this->pushStatement(')');\n return;\n\n case SQLEntitySet::MySQL:\n case SQLEntitySet::SQLServer:\n $this->pushStatement('CONCAT(');\n break;\n\n case SQLEntitySet::SQLite:\n $arguments = $node->getArguments();\n\n if (!$arguments) {\n return;\n }\n\n $this->pushStatement('(');\n\n while ($arguments) {\n $argument = array_shift($arguments);\n $this->evaluate($argument);\n\n if ($arguments) {\n $this->pushStatement('||');\n }\n }\n\n $this->pushStatement(')');\n return;\n\n default:\n $node->notImplemented();\n }\n break;\n\n case $node instanceof IndexOf:\n $arguments = $node->getArguments();\n list($arg1, $arg2) = $arguments;\n\n switch ($driver) {\n case SQLEntitySet::MySQL:\n case SQLEntitySet::SQLite:\n $this->pushStatement('INSTR(');\n break;\n\n case SQLEntitySet::SQLServer:\n $this->pushStatement('CHARINDEX(');\n list($arg2, $arg1) = $arguments;\n break;\n\n case SQLEntitySet::PostgreSQL:\n $this->pushStatement('STRPOS(');\n break;\n\n default:\n $node->notImplemented();\n }\n\n $this->evaluate($arg1);\n $this->pushComma();\n $this->evaluate($arg2);\n $this->pushStatement(')');\n $this->pushStatement('-1');\n return;\n\n case $node instanceof Length:\n switch ($driver) {\n case SQLEntitySet::SQLite:\n case SQLEntitySet::MySQL:\n case SQLEntitySet::PostgreSQL:\n $this->pushStatement('LENGTH(');\n break;\n\n case SQLEntitySet::SQLServer:\n $this->pushStatement('LEN(');\n break;\n\n default:\n $node->notImplemented();\n }\n break;\n\n case $node instanceof Substring:\n switch ($driver) {\n case SQLEntitySet::MySQL:\n case SQLEntitySet::SQLite:\n case SQLEntitySet::SQLServer:\n $this->pushStatement('SUBSTRING(');\n break;\n\n case SQLEntitySet::PostgreSQL:\n $this->pushStatement('SUBSTR(');\n break;\n\n default:\n $node->notImplemented();\n }\n\n list($arg1, $arg2, $arg3) = array_pad($node->getArguments(), 3, null);\n\n $this->evaluate($arg1);\n $this->pushComma();\n $this->pushStatement('(');\n $this->evaluate($arg2);\n $this->pushStatement('+ 1 )');\n $this->pushComma();\n\n if ($arg3) {\n $this->evaluate($arg3);\n } else {\n $this->pushStatement('2147483647');\n }\n\n $this->pushStatement(')');\n return;\n\n case $node instanceof Contains:\n case $node instanceof EndsWith:\n case $node instanceof StartsWith:\n $arguments = $node->getArguments();\n list($arg1, $arg2) = $arguments;\n\n $this->evaluate($arg1);\n $this->pushStatement('LIKE');\n $value = $arg2->getValue();\n\n if ($node instanceof StartsWith || $node instanceof Contains) {\n $value .= '%';\n }\n\n if ($node instanceof EndsWith || $node instanceof Contains) {\n $value = '%'.$value;\n }\n\n $arg2->setValue($value);\n $this->evaluate($arg2);\n return;\n\n default:\n $node->notImplemented();\n }\n\n $this->addCommaSeparatedArguments($node);\n $this->pushStatement(')');\n }", "protected function parse_twoVT_fun()\n {\n $this->check_param_num(2);\n\n $this->generate_instruction();\n\n $this->get_token();\n $this->check_var();\n $this->generate_arg(\"1\", \"var\");\n\n $this->get_token();\n $this->check_type();\n $this->generate_arg(\"2\", \"type\");\n\n $this->xml->endElement();\n }", "public function testFunctionNesting(): void\n {\n $binder = new ValueBinder();\n $f = new $this->expressionClass('MyFunction', ['foo', 'bar']);\n $g = new $this->expressionClass('Wrapper', ['bar' => 'literal', $f]);\n $this->assertSame('Wrapper(bar, MyFunction(:param0, :param1))', $g->sql($binder));\n }", "public static function splitBladeParameters($expression)\n {\n $expCleaned = str_replace(['(', ')', ' '], '', $expression);\n $parms = explode(',', $expCleaned);\n return $parms;\n }", "public function combineOrValidator(...$args) : Closure\n {\n foreach ($args as $func) {\n if (!is_callable($func)) {\n throw NoCallableArgumentException(\"{$func} is not callable\");\n }\n }\n return function ($value) use ($args) {\n return array_reduce(\n $args,\n function ($acc, $func) use ($value) {\n $check = $func($value);\n return array_merge(\n [\n 'result' => $acc['result'] || $check['result']\n ],\n $check['result']\n ? []\n : [\n 'message' => $acc['result']\n ? \"{$check['message']}\"\n : \"{$acc['message']}, {$check['message']}\"\n ]\n );\n },\n ['result' => true]\n );\n };\n }", "protected function _arguments($source, $expression)\n {\n $args = $this->_array([$expression]);\n $tags = $args[\"tags\"];\n $arguments = [];\n $sanitised = StringMethods::sanitise($expression, \"()[],.<>*$@\");\n\n foreach ($tags as $i => $tag) {\n $sanitised = str_replace($tag, \"(.*)\", $sanitised);\n $tags[$i] = str_replace([\"{\", \"}\"], \"\", $tag);\n }\n\n if (preg_match(\"#{$sanitised}#\", $source, $matches)) {\n $tags = array_values($tags);\n foreach ($tags as $i => $tag) {\n $arguments[$tag] = $matches[$i + 1];\n }\n }\n\n return $arguments;\n }", "private function normalizeFunctions(array $args): array\n\t{\n\t\tif (isset($args[0])) {\n\t\t\treturn $args;\n\t\t}\n\n\t\t$processedArgs = [];\n\t\tforeach ($args as $argName => $argValue) {\n\t\t\t[$argName, $operator] = ConditionParserHelper::parsePropertyOperator($argName);\n\t\t\t$processedArgs[] = [CompareFunction::class, $argName, $operator, $argValue];\n\t\t}\n\t\treturn $processedArgs;\n\t}", "function multi($x, $y = 2)\n{\n\treturn $x * $y;\n}", "public function testFunctionNestingQueryExpression(): void\n {\n $binder = new ValueBinder();\n $q = new QueryExpression('a');\n $f = new $this->expressionClass('MyFunction', [$q]);\n $this->assertSame('MyFunction(a)', $f->sql($binder));\n }", "function test($param1, $e)\n{\n // ...\n}", "public function getExpressions(): array;", "static public function calculate($operand1, $operation, $operand2)\n {\n $arguments = func_get_args();\n $argumentsCount = func_num_args();\n\n $operand1 = $arguments[0];\n for ($i = 1; $i < $argumentsCount; $i += 2) {\n $operation = $arguments[$i];\n $operand2 = $arguments[$i + 1];\n\n switch ($operation) {\n case self::ADD:\n $operand1 = static::add($operand1, $operand2, false);\n break;\n\n case self::SUBTRACT:\n $operand1 = static::subtract($operand1, $operand2, false);\n break;\n\n case self::MULTIPLY:\n $operand1 = static::multiply($operand1, $operand2, false);\n break;\n\n case self::DIVIDE:\n $operand1 = static::divide($operand1, $operand2, false);\n break;\n\n default:\n throw new \\UnexpectedValueException('Invalid operation ' . $operation, 1406299265);\n }\n }\n\n return $operand1;\n }", "function calculate($num1, $num2) { // Args are just like python, no specification -> must check\n return $num1 + $num2;\n}", "private function wrapExpression( $from, callable $expr, array $types ) {\n\t\tlist( $fn, $pos ) = explode( ':', $from );\n\t\t$from = \"The expression return value of argument {$pos} of {$fn}\";\n\n\t\treturn function ( $value ) use ( $from, $expr, $types ) {\n\t\t\t$value = $expr( $value );\n\t\t\t$this->validateType( $from, $value, $types );\n\n\t\t\treturn $value;\n\t\t};\n\t}", "protected function expandPlaceholders(&$expression, array &$params)\n {\n if (!$params || false === strpos($expression, '?')) {\n return;\n }\n \n $convert = false;\n \n foreach ($params as $param) {\n if (is_array($param)) {\n $convert = true;\n break;\n }\n }\n \n if (!$convert) {\n return;\n }\n \n $flatParams = [];\n $parts = explode('?', $expression);\n \n foreach ($parts as $i => &$part) {\n if (isset($params[$i])) {\n if (is_array($params[$i])) {\n $part .= implode(\n ', ',\n array_fill(0, count($params[$i]), '?')\n );\n $flatParams = array_merge($flatParams, $params[$i]);\n } else {\n $part .= '?';\n $flatParams[] = $params[$i];\n }\n }\n }\n \n $expression = implode('', $parts);\n $params = $flatParams;\n }", "function filter($exprs=array(), $gexprs=array())\n\t{\n\t\t$where = array('sql'=>array(), 'args'=>array());\n\t\t$having = array('sql'=>array(), 'args'=>array());\n\t\tforeach($_REQUEST as $k=>$v) {\n\t\t\t$args = array();\n\t\t\t$sql = array();\n\n\t\t\tif($v === '') continue;\n\t\t\tif(!preg_match('|^f_[dts]_|', $k)) continue;\n\t\t\t$t = substr($k, 2, 1);\n\t\t\t$k = substr($k, 4);\n\t\t\t// only alphanumerics allowed\n\t\t\tif(!preg_match('|^[A-z0-9_-]+$|', $k)) continue;\n\t\t\tswitch($t) {\n\t\t\t\tcase 'd': $coltype = 'date'; break;\n\t\t\t\tcase 's': $coltype = 'select'; break;\n\t\t\t\tcase 't':\n\t\t\t\tdefault: $coltype = 'text';\n\t\t\t}\n\n\t\t\t// look for an expression passed to the function first -- this is\n\t\t\t// used for trickier SQL expressions, eg, functions\n\t\t\tif(isset($exprs[$k])) {\n\t\t\t\t$s = $exprs[$k];\n\t\t\t\t$t = 'where';\n\t\t\t} else if(isset($gexprs[$k])) {\n\t\t\t\t$s = $gexprs[$k];\n\t\t\t\t$t = 'having';\n\t\t\t} else {\n\t\t\t\t// use the literal column name\n\t\t\t\t$s = \"\\\"$k\\\"\";\n\t\t\t\t$t = 'where';\n\t\t\t}\n\n\t\t\t$range = explode('<>', $v);\n\t\t\tif(count($range) == 2) {\n\t\t\t\t// double-bounded range\n\t\t\t\t$sql[] = \"($s>='%s' AND $s<='%s')\";\n\t\t\t\t$args[] = $range[0];\n\t\t\t\t$args[] = $range[1];\n\t\t\t} else if(strlen($v) == 1) {\n\t\t\t\t// no range (explicit)\n\t\t\t\t// FYI: this check is needed, as the \"else\" block assumes\n\t\t\t\t// a string length of at least 2\n\t\t\t\t$sql[] = is_numeric($v) ? \"$s='%s'\" : \"$s LIKE '%%s%'\";\n\t\t\t\t$args[] = $v;\n\t\t\t} else {\n\t\t\t\t// everything else: single-bounded range, eq, neq, like, not like\n\t\t\t\t$chop = 0;\n\t\t\t\t$like = false;\n\t\t\t\tswitch(substr($v, 0, 1)) {\n\t\t\t\t\tcase '=': // exactly equals to\n\t\t\t\t\t\t$s .= '=';\n\t\t\t\t\t\t$chop = 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '>': // greater than\n\t\t\t\t\t\tif(substr($v, 1, 1) == '=') {\n\t\t\t\t\t\t\t$s .= '>=';\n\t\t\t\t\t\t\t$chop = 2;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$s .= '>';\n\t\t\t\t\t\t\t$chop = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '<': // less than\n\t\t\t\t\t\tif(substr($v, 1, 1) == '=') { \n\t\t\t\t\t\t\t$s .= '<=';\n\t\t\t\t\t\t\t$chop = 2;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$s .= '<';\n\t\t\t\t\t\t\t$chop = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '!': // does not contain\n\t\t\t\t\t\tif(substr($v, 1, 1) == '=') {\n\t\t\t\t\t\t\t$s .= '!=';\n\t\t\t\t\t\t\t$chop = 2;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$s .= ' NOT LIKE ';\n\t\t\t\t\t\t\t$chop = 1;\n\t\t\t\t\t\t\t$like = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault: // contains\n\t\t\t\t\t\t$s .= ' LIKE ';\n\t\t\t\t\t\t$like = true;\n\t\t\t\t}\n\t\t\t\t$v = substr($v, $chop);\n\t\t\t\tif($like) {\n\t\t\t\t\t$s .= \"'%%s%'\";\n\t\t\t\t} else {\n\t\t\t\t\t$s .= \"'%s'\";\n\t\t\t\t}\n\t\t\t\t$sql[] = $s;\n\t\t\t\t$args[] = $v;\n\n\t\t\t\t// special handling for various filter types\n\t\t\t\tif($coltype == 'date' && $chop) {\n\t\t\t\t\t// don't include the default '0000-00-00' fields in ranged selections\n\t\t\t\t\t$s = isset($exprs[$k]) ? $exprs[$k] : \"\\\"$k\\\"\";\n\t\t\t\t\t$s .= \"!='0000-00-00'\";\n\t\t\t\t\t$sql[] = $s;\n\t\t\t\t}\n\t\t\t}\n\t\t\tswitch($t) {\n\t\t\t\tcase 'where':\n\t\t\t\t\t$where['sql'] = array_merge($where['sql'], $sql);\n\t\t\t\t\t$where['args'] = array_merge($where['args'], $args);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'having':\n\t\t\t\t\t$having['sql'] = array_merge($having['sql'], $sql);\n\t\t\t\t\t$having['args'] = array_merge($having['args'], $args);\n\t\t\t}\n\t\t}\n\n\t\t// ensure the WHERE clause always has something in it\n\t\t$where['sql'][] = '1=1';\n\n\t\t$final = array(implode(' AND ', $where['sql']), $where['args']);\n\t\tif(!empty($having['sql'])) {\n\t\t\t$final[] = implode(' AND ', $having['sql']);\n\t\t\t$final[] = $having['args'];\n\t\t}\n\n\t\treturn $final;\n\t}", "public function __construct(string $expression, array $parameterKeys)\n {\n $this->expression = $expression;\n $this->parameterKeys = $parameterKeys;\n }", "public function expr($template = [], array $arguments = []): Expression\n {\n $class = $this->expressionClass;\n $e = new $class($template, $arguments);\n $e->connection = $this;\n\n return $e;\n }", "function __construct($operand, $number1, $number2) {\n\n $this->operand = $operand;\n $this->number1 = $number1;\n $this->number2 = $number2;\n }", "function isNotNull($x, $y='null', $and=null, ...$args)\n {\n $expression = array();\n array_push($expression, $x, _notNULL, $y, $and, ...$args);\n return $expression;\n }", "function isNotNull($x, $y='null', $and=null, ...$args)\n {\n $expression = array();\n array_push($expression, $x, _notNULL, $y, $and, ...$args);\n return $expression;\n }", "function AndWhereClause() {\n\t\t$this->clauses = func_get_args();\n\t}", "function perform_query_two_param($query, $types, $paramOne, $paramTwo) {\n //If the query is null we throw and exeption\n if ($query == null) {\n throw new Exception(\"Error query null\");\n }\n $stmt = mysqli_prepare($this->database_manager, $query);\n if ($stmt) {\n $stmt->bind_param($types, $paramOne, $paramTwo);\n $stmt->execute();\n $results = $stmt->get_result();\n $stmt->free_result();\n $stmt->close();\n return $results;\n }\n else {\n throw new Exception(mysqli_error($this->database_manager));\n }\n }", "function isNull($x, $y='null', $and=null, ...$args)\n {\n $expression = array();\n array_push($expression, $x, _isNULL, $y, $and, ...$args);\n return $expression;\n }", "function isNull($x, $y='null', $and=null, ...$args)\n {\n $expression = array();\n array_push($expression, $x, _isNULL, $y, $and, ...$args);\n return $expression;\n }", "protected function computeCommaSeparatedArguments(): void\n {\n $arguments = $this->getArguments();\n\n while ($arguments) {\n $arg = array_shift($arguments);\n $arg->compute();\n\n if ($arguments) {\n $this->emit(new Group\\Separator($this->parser));\n }\n }\n }", "public function operators();", "function consecutive(callable ...$predicates)\n{\n return function (...$arguments) use ($predicates) {\n foreach ($arguments as $index => $value) {\n if(!$predicates[$index]($value)) {\n return false;\n }\n }\n\n return true;\n };\n}", "public function testBuildOrderByWithTwoArguments()\n {\n $query = $this->getQuery()\n ->orderBy('param1', '+')\n ->orderBy('param2', '-')\n ;\n\n $this->assertSame(\n 'ORDER BY param1 ASC, param2 DESC',\n $query->buildOrderBy()\n );\n }", "public function append($expression = null);", "public function mergeArguments(array $arguments);" ]
[ "0.5601777", "0.5601777", "0.55221015", "0.5407853", "0.536109", "0.536109", "0.5326942", "0.5310643", "0.5283706", "0.5283706", "0.5261599", "0.5211051", "0.5202876", "0.50970376", "0.5094211", "0.5094211", "0.5084554", "0.50622165", "0.505334", "0.5037285", "0.5037285", "0.5028903", "0.50258577", "0.5025687", "0.5002812", "0.5002812", "0.49899372", "0.49891827", "0.49736348", "0.49605715", "0.49556464", "0.49549168", "0.49191397", "0.4918602", "0.49163938", "0.48771727", "0.48767698", "0.48554137", "0.48072702", "0.48072702", "0.48011035", "0.4785243", "0.4778131", "0.47751087", "0.47751087", "0.47578493", "0.4733771", "0.47264984", "0.4695901", "0.4683971", "0.46726054", "0.4666413", "0.46602157", "0.46546686", "0.46534008", "0.46358386", "0.46271884", "0.46158126", "0.4607292", "0.46055597", "0.4599486", "0.459508", "0.45834106", "0.45818081", "0.45799917", "0.45687217", "0.456315", "0.4559295", "0.4558476", "0.45541444", "0.45532876", "0.4547911", "0.45253107", "0.45202455", "0.45114166", "0.448633", "0.44785967", "0.44711986", "0.4468417", "0.44668755", "0.44603717", "0.44581926", "0.44513538", "0.44499096", "0.44455293", "0.44440252", "0.44431338", "0.44356078", "0.44330108", "0.44330108", "0.44315106", "0.44294593", "0.44274378", "0.44274378", "0.4423021", "0.4421443", "0.4417735", "0.44140476", "0.44074714", "0.44063577" ]
0.48242807
38
Add another child to this logic tree.
protected function append($child): void { $this->children[] = $child; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function add($child) {\n $this->children[] = $child;\n }", "public function addChild(self $child): void\n\t{\n\t\tif (!$this->children->contains($child)) {\n\t\t\t// ...and assign it to collection\n\t\t\t$this->children->add($child);\n\t\t}\n\t}", "public function add_child($child) {\n\t\t$this->children[] = $child;\n\t}", "public function addChild(Node $child);", "public function addChild(self $child): self\n {\n $this->children[] = $child;\n\n return $this;\n }", "public function add($child, $type = null, array $options = array());", "public function add($child)\r\n {\r\n if ($child instanceof tag) {\r\n if ($child->id && array_key_exists($child->id,$this->ref)) {\r\n return $this->ref[$child->id]; \r\n }\r\n $child->tagdep = abs($this->tagdep) + 1;\r\n $this->tagdep = abs($this->tagdep) * -1;\r\n }\r\n //Append child to childs repo\r\n $this->childs[] = $child;\r\n //If child isn't object return $this tag\r\n if (!is_object($child)) {\r\n return $this;\r\n }\r\n if ($child->id) {\r\n $this->ref[$child->id] =& $child;\r\n }\r\n $child->parent =& $this;\r\n return $child;\r\n }", "public function addChild($child)\r\n\t{\r\n\t\t$this->last = $child->last;\r\n\r\n\t\t$this->entries []= $child;\r\n\t}", "public function addChild(CategoryTreeNodeInterface $child);", "function add_child( $child ) {\n\t\tif( $child instanceof ModularPost ) {\n\t\t\t$this->children[] = $child;\n\t\t}\n\t}", "public function orX($child): void\n {\n $this->append($child);\n }", "public function addChild(Node $child)\n {\n $this->children[] = $child;\n }", "public function add_child(SBBCodeParser_Node $child)\r\n\t{\r\n\t\t$this->children[] = $child;\r\n\t\t$child->set_parent($this);\r\n\t}", "public function add($child, $name = false) {\n\t\tif( $name ) {\n\t\t\t$this->childs[$name] = $child;\n\t\t} else {\n\t\t\t$this->childs[] = $child;\n\t\t}\n\t\treturn $this;\n\t}", "abstract public function insert ( \\Hoa\\Tree\\Generic $child );", "public function addChild(object $child): self\n {\n $this->children->add($child);\n\n return $this;\n }", "public function add_child(\\WP_Comment $child)\n {\n }", "public function addChild($child)\n\t{\n\t\tif ($child instanceof ElseNode) {\n\t\t\tif (!$this->getLastChild() instanceof IfNode) {\n\t\t\t\tthrow new \\PHPSass\\Exception('@else(if) directive must come after @(else)if', $child);\n\t\t\t\t}\n\t\t\t$this->getLastChild()->addElse($child);\n\t\t\t}\n\t\telse {\n\t\t\t$this->children[]=$child;\n\t\t\t$child->parent=$this;\n\t\t\t$child->setRoot($this->root);\n\t\t\t}\n\t}", "public function addChild(pdoMap_Core_XML_Node $child) {\n $this->__childs[] = $child;\n // echo 'Add child '.$this->getName().'.'.$child->getName().'<br />';\n }", "function addChild($key, IBabylonModel $child) : IBabylonModel;", "public function addChildNode(\\F3\\Fluid\\Core\\Parser\\SyntaxTree\\NodeInterface $childNode);", "public function addChildNode( SimpleXMLElement $oChild ) \n\t\t{\n\t\t\t$oParentDOM = dom_import_simplexml( $this );\n\t\t\t$oChildDOM = dom_import_simplexml( $oChild );\n\t\t\t$oNewParentDOM = $oParentDOM->ownerDocument->importNode( $oChildDOM, true );\n\t\t\t$oParentDOM->appendChild( $oNewParentDOM );\n\t\t\n\t\t}", "public function addChild(EntityInterface $child, $position = null);", "public function addChild(ModelInterface $child, $placeholder = null, $append = false);", "public function addChild(Node $child) {\n return $this->root->addChild($child);\n }", "final public function addChild ()\n {\n throw new ChildException('Trying to add child to self closing HTML element');\n }", "public function appendChild($child, array $options = array()) \n {\n $this->children[] = $child;\n\n return $child;\n }", "protected function addChildIfMissing(NodeInterface $child)\n {\n $this->addChild($child);\n }", "public function AddChildElement(IElement $child)\r\n {\r\n $this->Children[] = $child->Render();\r\n }", "function add_node($child_id, tree_node $tt) {\n $this->triples[$child_id] = $tt;\n $this->children[$tt->parent_id][$child_id] = true;\n }", "function addChild(T_CompositeLeaf $child,$key=null)\n {\n if (isset($key)) {\n $this->children[$key] = $child;\n } else {\n $this->children[] = $child;\n }\n return $this;\n }", "public function testAddChild_Modification()\n\t{\n\t\t$this->object->AddChild($this->child);\n\t\t$this->child->attribute = \"changed att\";\n\t\t$this->assertEquals(\"changed att\", $this->object->childList[0]->attribute);\n\t}", "abstract public function addItemChild($itemName, $childName);", "function addChild($name) {\n\t\tarray_push($this->childrens, $name);\n\t}", "function addChild( $ni )\n\t\t{\n\t\t$this->childs[] = $ni ;\n\t\t}", "public function __add($other) {\n return $this->add($other);\n }", "protected function addChild(NodeInterface $child)\n {\n $context = new ExceptionContext(\n 'exception.propimmutable',\n 'Read only'\n );\n\n throw new PropImmutableException($context);\n }", "public function addChild(BlockInterface $child, $key = null)\n {\n if (null !== $key) {\n $this->children->set($key, $child);\n\n return true;\n }\n\n return $this->children->add($child);\n }", "public function setChild($child)\n {\n $this->child = $child;\n }", "public function AddChild(string $childHTML)\r\n {\r\n $this->Children[] = $childHTML;\r\n }", "public function addOption(Child $option)\n {\n $this->addChild($option);\n return $this;\n }", "function addChild( $node )\n\t\t{\n\t\t$this->childs[] = $node ;\n\t\t}", "public function testAddChild_Simple()\n\t{\n\t\t$this->object->AddChild($this->child);\n\t\t$this->assertType(\"child\", $this->object->childList[0]);\n\t\t$this->assertEquals(1, sizeof($this->object->childList));\n\t}", "public function addChild(ThemeMenuItem $child)\n {\n }", "public function testAddChild_Duplicate()\n\t{\n\t\t$this->child->Save();\n\t\t$this->object->AddChild($this->child);\n\t\t$this->object->AddChild($this->child);\n\t\t$this->assertEquals(1, sizeof($this->object->childList));\n\t}", "public function addChild(ExecutableInterface $newChildNode)\r\n\t{\r\n\t\tif (count($this->childrenNodes)>0)\r\n\t\t{\r\n\t\t\t$this->childrenNodes[] = $newChildNode;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this->childrenNodes = array($newChildNode);\r\n\t\t}\r\n\t\treturn $this->childrenNodes;\r\n\t}", "public function add($child, $type, array $execOptions = array(), array $initOptions = array())\n {\n if (!is_string($child) && !is_int($child)) {\n throw new \\InvalidArgumentException(sprintf('child name should be string or, integer'));\n }\n\n if (null !== $type && !is_string($type) && !$type instanceof JobTypeinterface) {\n throw new \\InvalidArgumentException('type should be string or JobTypeinterface');\n }\n\n $this->children[$child] = null; // to keep order\n $this->unresolvedChildren[$child] = array(\n 'type' => $type,\n 'init_options' => $initOptions,\n 'exec_options' => $execOptions\n );\n\n return $this;\n }", "function add ($other) {\n $this->getTool();\n return ($this->tool->add(&$this, $other));\n }", "private function injectChildCommand($childCommandId, $parentCommandId, ContainerBuilder $container)\n {\n $container->getDefinition($parentCommandId)->addMethodCall('addChildCommand', [new Reference($childCommandId)]);\n }", "public function insertChildBeforeSibling(CategoryTreeNodeInterface $child, $nextSiblingId);", "public function addChild(CustomDefAbstract $def)\n\t{\n\t\t$this->children->add($def);\n\t\t$def['parent'] = $this;\n\t\t$this->_onPropertyChanged('children', $this->children, $this->children);\n\t}", "public function addChildItem(BasketItem $item)\n {\n // add child item price\n $priceData = $this->getPrice()->toArray();\n $priceData['real_price'] += $item->getPrice()->getPrice();\n $this->price = new Price($priceData);\n\n $this->children[] = $item;\n }", "public function add($title, $description, $parentId = null);", "public function set($child) {\n\t\t$this->childs = array($child);\n\t}", "public function addSibling(EntityInterface $sibling, $position = null);", "public function appendChild($childNode)\r\n {\r\n $this->_childNodes[$childNode->id] = $childNode;\r\n $childNode->setParentNode($this);\r\n }", "final public function addIf($condition = false, CtkBuildable $node) {\n\t\tthrow new CakeException(sprintf('Cannot add children to %s', get_class($this)));\n\t}", "public function addChildDocument(SolrInputDocument $child) {}", "public function add(string $name): ToAliasOrParent;", "function addChild(&$abstractframe)\n {\n $this->m_childs[] = &$abstractframe;\n }", "public static function addLinkParentChild($parent, $child)\r\n {\r\n // Do not add child if allready a parent\r\n if(!ParentChildLinked::isParentChildLinked($child,$parent)\r\n && !$parent->getChilds()->contains($child)) {\r\n\r\n $parent->getChilds()->add($child);\r\n $child->getParents()->add($parent);\r\n }\r\n }", "function add_parent($childid,$ar){\n\t\t//get the child and parent nodes\n\t\t$childnode=$this->nodes[$childid];\n\t\t$node=$this->nodes[$childnode->parent];\n\n\t\t//add the parent to the array\n\t\tif(array_key_exists($childnode->parent,$ar)){\n\t\t\t//if the parent is already there add child beside sibling and remove from the end of the array\n\t\t\t$this->repos_children($childnode,$ar);\n\t\t}else{\n\n\t\t\t//add the parent ahead of the child in the array\n\t\t\t$keyindex=array_search($childid,array_keys($ar));\n\t\t\t$copy=$ar;\n\t\t\t$ar=array_splice($ar,0,$keyindex)+array($node->id=>$node)+array_splice($copy,$keyindex);\n\t\t}\n\t\t//add parent if it's not already in the array\n\t\tif($node->parent!=-1){\n\t\t\t$ar=$this->add_parent($node->id,$ar);\n\t\t}\n\t\treturn $ar;\n\t}", "private function insertNode($child, $parent)\n {\n $this->db->beginTransaction();\n $sql = \"UPDATE \" . $this->table . \" SET rgt = rgt + 2 WHERE rgt >= ?\";\n $this->modify($sql, [$parent->rgt]);\n\n $sql = \"UPDATE \" . $this->table . \" SET lft = lft + 2 WHERE lft > ?\";\n $this->modify($sql, [$parent->rgt]);\n\n $sql = \"UPDATE \" . $this->table . \" SET lft = ?, rgt = ?, parent_id = ?, lvl = ? WHERE id = ?\";\n $level = $parent->lvl+1;\n $this->modify($sql, [$parent->rgt, $parent->rgt+1, $parent->id, $level, $child]);\n\n return $this->db->commit();\n }", "public function offsetSet(mixed $name, mixed $child): void\n {\n $this->add($child);\n }", "public function addChild($itemID){\n $child = new FPNode($itemID,1,$this);\n array_push($this->children, $child);\n return $child;\n }", "public function newChild($parent_task, $child_task){\n $team_code = $this->Task->getLeadCodeByTask($child_task);\n $task_sd = $this->Task->getShortDescByTask($child_task);\n\n $data = array(\n 'task_id'=>$parent_task,\n 'change_type_id'=>301,\n );\n\n if($child_task){\n $data['new_val'] = $child_task;\n } \n if($team_code){\n $data['var1'] = $team_code;\n }\n if($task_sd){\n $data['var2'] = $task_sd;\n }\n if(CakeSession::read('Auth.User.id')){\n $data['user_id']= CakeSession::read('Auth.User.id');\n }\n\n $this->create();\n if($this->save($data)){\n return true;\n }\n else{\n return false; \n }\n }", "public function attach(&$parent, &$child, $rel_name) {\n\t$parent->save();\n\t$child->save();\n\n\t$rels = $parent->getRelationships($rel_name);\n\t$insert = true;\n\tforeach ($rels as $rel) {\n\t $node = $rel->getEndNode();\n\t if ($node->getProperty('name') == $child->getProperty('name')) {\n\t\t$insert = false;\n\t }\n\t}\n\tif ($insert) {\n\t $parent->relateTo($child, $rel_name)->save();\n\t}\n }", "public function addProgramChild($program){\n $this->programChildArrayList[] = $program;\n }", "final public function add(CtkBuildable $node) {\n\t\tthrow new CakeException('Cannot add children to node');\n\t}", "public function addChild(Doctrine_Record $record);", "public function testExistedNodeSiblingsMoveAppendTo()\n {\n $model8 = Animal::findOne(8);\n \n $this->assertTrue($model8->appendTo($model8->parent()));\n $this->assertEquals(3, $model8->weight);\n }", "public function insertChildNode($child, $parent)\n {\n $parent = $this->getNode($parent);\n return $this->insertNode($child, $parent);\n }", "function add($parentname, $something) {\n $parent =& $this->locate($parentname);\n if (is_null($parent)) {\n debugging('parent does not exist!');\n return false;\n }\n\n if (is_a($something, 'part_of_admin_tree')) {\n if (!is_a($parent, 'parentable_part_of_admin_tree')) {\n debugging('error - parts of tree can be inserted only into parentable parts');\n return false;\n }\n $parent->children[] = $something;\n return true;\n\n } else {\n debugging('error - can not add this element');\n return false;\n }\n\n }", "public function appendChild($child = NULL)\n\t{\n\t\tif ($child instanceof DOMNode) {\n\t\t\tparent::appendChild($child);\n\t\t}\n\t\treturn $this;\n\t}", "function add($n)\n\t{\n\t\tif (is_array($n))\n\t\t{\n\t\t\tfor($i = 0; $i < count($n); ++$i)\n\t\t\t{\n\t\t\t\t$this->children[] = $n[$i];\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->children[] = $n;\n\t\t}\n\t}", "function add($n)\n\t{\n\t\tif (is_array($n))\n\t\t{\n\t\t\tfor($i = 0; $i < count($n); ++$i)\n\t\t\t{\n\t\t\t\t$this->children[] = $n[$i];\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->children[] = $n;\n\t\t}\n\t}", "public function addChild(PlaceholderInterface $child);", "public function addLine($line) {\n\t\t$this->children[] = $line;\n\t\treturn $this;\n\t}", "function group_add_group($parent,$child){\n\n //find the parent group's dn\n $parent_group=$this->group_info($parent,array(\"cn\"));\n if ($parent_group[0][\"dn\"]==NULL){ return (false); }\n $parent_dn=$parent_group[0][\"dn\"];\n \n //find the child group's dn\n $child_group=$this->group_info($child,array(\"cn\"));\n if ($child_group[0][\"dn\"]==NULL){ return (false); }\n $child_dn=$child_group[0][\"dn\"];\n \n $add=array();\n $add[\"member\"] = $child_dn;\n \n $result=@ldap_mod_add($this->_conn,$parent_dn,$add);\n if ($result==false){ return (false); }\n return (true);\n }", "public function child($childName, $joinType = 'LEFT', $additionalCols = Array(), $matching = '=')\n {\n $this->addChild($childName, $joinType, $additionalCols, $matching);\n }", "public function addChild(HierarchyInterface $child)\n {\n if (null === $this->children) {\n $this->children = new ArrayCollection();\n }\n\n $this->children->add($child);\n\n return $this;\n }", "public function addMorphClass($owningClass, $childClass)\n {\n $this->morphClasses[$childClass][] = $owningClass;\n }", "public function appendChild(Registry $child) {\n\t\t$this->children[] = $child;\n\t\t$child->setParent($this);\n\n\t\treturn $child;\n\t}", "public function addToChild(\\Sabre\\UpdateReservation\\StructType\\AssociationChild $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\Sabre\\UpdateReservation\\StructType\\AssociationChild) {\n throw new \\InvalidArgumentException(sprintf('The Child property can only contain items of \\Sabre\\UpdateReservation\\StructType\\AssociationChild, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->Child[] = $item;\n return $this;\n }", "public function combine_child(){\n\t\t\t\techo 'Child begin-> '.parent::combine_parent().' <-Child end. ';\n\t\t\t}", "public function save(Application_Model_Child $child) \n {\n }", "public function appendTo($target,$runValidation=true,$attributes=null)\n\t{\n\t\t$owner=$this->getOwner();\n\n\t\tif(!$owner->getIsNewRecord())\n\t\t\tthrow new CDbException(Yii::t('yiiext','The node cannot be inserted because it is not new.'));\n\n\t\tif($owner->equals($target))\n\t\t\tthrow new CException(Yii::t('yiiext','The target node should not be self.'));\n\n\t\tif($runValidation && !$owner->validate())\n\t\t\treturn false;\n\n\t\tif($this->hasManyRoots)\n\t\t\t$owner->{$this->rootAttribute}=$target->{$this->rootAttribute};\n\n\t\t$owner->{$this->levelAttribute}=$target->{$this->levelAttribute}+1;\n\t\t$key=$target->{$this->rightAttribute};\n\n\t\treturn $this->addNode($key,$attributes);\n\t}", "#[\\ReturnTypeWillChange]\n\tfunction addChild($name, $value = null, $namespace = null):CX {/** @var CX $r */\n\t\ttry {$r = parent::addChild($this->k($name), $value, $namespace);}\n\t\tcatch (Th $th) {df_error(\"Tag <{$name}>. Value: «{$value}». Error: «%s».\", df_xts($th));}\n\t\treturn $r;\n\t}", "public function saveChild($id_child = 0)\n {\n $user_child = new UserChild();\n $user_child->user_id = Yii::app()->user->id;\n $user_child->user_child_id = $id_child;\n $user_child->save();\n }", "public function group_add_group($parent,$child){\n\n // Find the parent group's dn\n $parent_group=$this->group_info($parent,array(\"cn\"));\n if ($parent_group[0][\"dn\"]===NULL){ return (false); }\n $parent_dn=$parent_group[0][\"dn\"];\n \n // Find the child group's dn\n $child_group=$this->group_info($child,array(\"cn\"));\n if ($child_group[0][\"dn\"]===NULL){ return (false); }\n $child_dn=$child_group[0][\"dn\"];\n \n $add=array();\n $add[\"member\"] = $child_dn;\n \n $result=@ldap_mod_add($this->_conn,$parent_dn,$add);\n if ($result==false){ return (false); }\n return (true);\n }", "function add($parent_id, $child_num = 0, $misc_data = false)\n\t{\n\t\tglobal $DBPrefix, $db;\n\t\tif(!is_numeric($parent_id) || $parent_id < 0)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif($parent_id != 0)\n\t\t{\n\t\t\t$query = \"SELECT left_id, right_id, level FROM \" . $DBPrefix . \"categories WHERE cat_id = :parent_id\";\n\t\t\t$params = array();\n\t\t\t$params[] = array(':parent_id', $parent_id, 'int');\n\t\t\t$db->query($query, $params);\n\t\t\tif($db->numrows() != 1)\n\t\t\t{ // Row must exist.\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$parent = $db->result();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Virtual root element as parent.\n\t\t\t$parent = $this->get_virtual_root();\n\t\t}\n\t\t$children = $this->get_children($parent['left_id'], $parent['right_id'], $parent['level']);\n\n\t\tif(count($children) == 0)\n\t\t{\n\t\t\t$child_num = 0;\n\t\t}\n\t\tif($child_num == 0 || (count($children) - $child_num) <= 0 || (count($children) + $child_num + 1) < 0)\n\t\t{\n\t\t\t$boundry = array('left_id', 'right_id', $parent['left_id']);\n\t\t}\n\t\telseif($child_num != 0)\n\t\t{\n\t\t\t// Some other child.\n\t\t\tif($child_num < 0)\n\t\t\t{\n\t\t\t\t$child_num = count($children) + $child_num + 1;\n\t\t\t}\n\t\t\tif($child_num > count($children))\n\t\t\t{\n\t\t\t\t$child_num = count($children);\n\t\t\t}\n\t\t\t$boundry = array('right_id', 'left_id', $children[$child_num - 1]['right_id']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Make a hole for the new element.\n\t\t$query = \"UPDATE \" . $DBPrefix . \"categories SET left_id = left_id + 2 WHERE \" . $boundry[0] . \" > \" . $boundry[2] . \" AND \" . $boundry[1] . \" > \" . $boundry[2];\n\t\t$db->direct_query($query);\n\t\t$query = \"UPDATE \" . $DBPrefix . \"categories SET right_id = right_id + 2 WHERE \" . $boundry[1] . \" > \" . $boundry[2];\n\t\t$db->direct_query($query);\n\n\t\t// Insert the new element.\n\t\t$data = array(\n\t\t\t'left_id' => $boundry[2] + 1,\n\t\t\t'right_id' => $boundry[2] + 2,\n\t\t\t'level' => $parent['level'] + 1,\n\t\t\t'parent_id' => $parent_id\n\t\t);\n\t\tif($misc_data && is_array($misc_data))\n\t\t{\n\t\t\t$data = array_merge($misc_data, $data);\n\t\t}\n\n\t\t$query = \"INSERT INTO \" . $DBPrefix . \"categories (parent_id, left_id, right_id, level, cat_name, cat_colour, cat_image)\n\t\t\t\tVALUES (:parent, :left, :right, :level, :name, :colour, :image)\";\n\t\t$params = array();\n\t\t$params[] = array(':parent', $data['parent_id'], 'str');\n\t\t$params[] = array(':left', $data['left_id'], 'str');\n\t\t$params[] = array(':right', $data['right_id'], 'str');\n\t\t$params[] = array(':level', $data['level'], 'str');\n\t\t$params[] = array(':name', $data['cat_name'], 'str');\n\t\t$params[] = array(':colour', $data['cat_colour'], 'str');\n\t\t$params[] = array(':image', $data['cat_image'], 'str');\n\t\t$db->query($query, $params);\n\n\t\tif(!$misc_data)\n\t\t{\n\t\t\treturn $db->lastInsertId();\n\t\t}\n\t\treturn true;\n\t}", "public function append($obj) {\r\n\t\t$obj->pzkParentId = @$this->id;\r\n\t\t$this->children[] = $obj;\r\n\t}", "public function addChild(HTMLElement $el) {\n\t\tparent::addChild($el);\n\t\t/* Add pointer to last child, and its children */\n\t\t$this->rAddPointers($this->getChild($this->getNoOfChildren()-1));\n\t}", "public function addChild(MenuPresenceInterface $presence): void\n {\n $children = $this->children ?: [];\n\n if ($children instanceof Collection) {\n $children->push($presence);\n } else {\n $children[] = $presence;\n }\n\n $this->children = $children;\n }", "public function setCurrentChild(bool $currentChild): void;", "public function appendTo(Element $parent, Element $child)\n {\n $this->contentManager->appendTo($parent, $child);\n\n return $this;\n }", "public function insert($value)\n {\n if ($this->value <= $value) {\n // Insert in right subtree.\n if ($this->right) {\n // If right child already exists then pass the value to it.\n $this->right->insert($value);\n } else {\n // If not then create a new right child.\n $this->right = new BinaryTreeNode($value);\n }\n } elseif ($this->value > $value) {\n // Insert in left subtree.\n if ($this->left) {\n // If left child already exists then pass the value to it.\n $this->left->insert($value);\n } else {\n // If not then create a new left child.\n $this->left = new BinaryTreeNode($value);\n }\n }\n }", "function appendChild(&$treeItem, $parentItem) {\n\t\t$this->trackItem($treeItem);\n\n\t\tif ($parentItem == null) {\n\t//\t\t$parentItem =& $this->_rootNode;\n\t\t\t$this->rootItem->children[] = $treeItem->getId();\n\t\t} else {\n\t\t\t//get the global reference\n\t\t\t$parentItem =& $this->getItem($parentItem);\n\t\t\tif ($treeItem->_expanded) {\n\t\t\t\t$this->expandBranch($parentItem);\n\t\t\t}\n\t//\t\t$parentItem->appendChild($treeItem);\n\t\t\t$parentItem->children[] = $treeItem->getId();\n\t\t\t$treeItem->_parentPointer = $parentItem->getId();\n\t\t}\n\t}", "public function addChildren(array $children);", "function add_child($dom, $base, $name, $value) {\n\tif ($value) {\n\t\t// Stupid DOMDocument functions don't escape ampersands (&)\n\t\t$value = str_replace('&', '&amp;', $value);\n\t\t$child = $base->appendChild($dom->createElement($name, $value));\n\t} else {\n\t\t$child = $base->appendChild($dom->createElement($name));\n\t}\n\treturn $child;\n}" ]
[ "0.747512", "0.71916425", "0.7164295", "0.70444554", "0.68772393", "0.6856629", "0.67549723", "0.673313", "0.6708482", "0.6641429", "0.6590783", "0.6582649", "0.6567679", "0.6499725", "0.6483271", "0.6346304", "0.6285663", "0.6283745", "0.6265231", "0.6120967", "0.6025529", "0.60118604", "0.59951836", "0.5993475", "0.59597063", "0.59389687", "0.5901808", "0.585815", "0.58562005", "0.5755683", "0.5748713", "0.5743425", "0.57243", "0.5722391", "0.5709946", "0.57047105", "0.56939334", "0.56843144", "0.56738436", "0.5672251", "0.56681204", "0.56655705", "0.56512725", "0.56309044", "0.56259704", "0.5598672", "0.557904", "0.5560924", "0.550534", "0.54937524", "0.5471082", "0.54563916", "0.54507697", "0.5423108", "0.5384983", "0.53808945", "0.5367422", "0.53582585", "0.53411067", "0.53086466", "0.52913636", "0.52854604", "0.52806264", "0.5275297", "0.5270866", "0.5242787", "0.52410865", "0.52303034", "0.52288747", "0.52225035", "0.5210638", "0.520641", "0.5197193", "0.51778036", "0.51651937", "0.51651937", "0.5163379", "0.51478565", "0.5121001", "0.5105524", "0.50669163", "0.506578", "0.5063021", "0.5049153", "0.504075", "0.50120074", "0.5004178", "0.5003565", "0.49968448", "0.49867037", "0.4983879", "0.49792314", "0.4963277", "0.49611798", "0.49475634", "0.4945365", "0.49433416", "0.49387732", "0.4937803", "0.49333176" ]
0.68560356
6
Make a grid builder.
protected function grid() { return Admin::grid(ThreeTotalRecord::class, function (Grid $grid) { $grid->session_id('期数')->sortable(); $grid->award_pattern('开奖牌型')->display( function($award_pattern){ switch ($award_pattern) { case 1:return '单牌';break; case 2:return '对子';break; case 3:return '顺子';break; case 4:return '金花';break; case 5:return '顺金';break; case 6:return '豹子';break; case 7:return '特殊';break; case 8:return 'AAA';break; } })->label(); $grid->totol_bet_num('押注总人数'); $grid->totol_bet_gold('押注总金额'); $grid->totol_award_num('中奖总人数'); $grid->totol_award_gold('中奖总金额'); $grid->award_date('开奖时间'); $grid->disableActions(); $grid->disableCreation(); $grid->tools->disableBatchActions(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function grid()\n {\n $grid = new Grid(new Formulario());\n\n $grid->disableExport();\n\n $grid->column('name', __('Nombre'));\n $grid->column('description', __('Descripción'));\n $grid->column('go_to_formulario', 'Continuar a formulario')->display(function ($formId) {\n if ($formId) {\n $form = Formulario::find($formId);\n return \"<span>{$form['name']}</span>\";\n }\n });\n\n $grid->model()->orderBy('id', 'asc');\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Direction());\n\n $grid->column('id', __('Id'));\n $grid->column('name', __(trans('hhx.name')));\n $grid->column('intro', __(trans('hhx.intro')));\n $grid->column('Img', __(trans('hhx.img')))->image();\n $grid->column('status', __(trans('hhx.status')))->using(config('hhx.status'));\n $grid->column('order_num', __(trans('hhx.order_num')));\n $grid->column('all_num', __(trans('hhx.all_num')));\n $grid->column('this_year', __(trans('hhx.this_year')));\n $grid->column('stock', __(trans('hhx.stock')));\n $grid->column('created_at', __(trans('hhx.created_at')));\n $grid->column('updated_at', __(trans('hhx.updated_at')));\n\n return $grid;\n }", "public function getGridBuilder($name);", "protected function grid()\n {\n $grid = new Grid(new Good);\n $grid->column('id', __('Id'))->sortable();\n $grid->column('name', __('名称'));\n $grid->column('unit', __('单位'));\n //$grid->column('list_img', __('商品图片'))->image()->width(10);\n $grid->column('amount', __('价格'));\n $grid->column('created_at', __('创建时间'));\n $grid->disableExport();\n $grid->disableRowSelector();\n $grid->disableFilter();\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Activity());\n\n $grid->column('id', __('Id'));\n $grid->column('name', __('Name'));\n $grid->column('image', __('Image'));\n $grid->column('user_roles', __('User roles'));\n $grid->column('intro', __('Intro'));\n $grid->column('details', __('Details'));\n $grid->column('start_at', __('Start at'));\n $grid->column('end_at', __('End at'));\n $grid->column('created_at', __('Created at'));\n $grid->column('location', __('Location'));\n $grid->column('fee', __('Fee'));\n $grid->column('involves', __('Involves'));\n $grid->column('involves_min', __('Involves min'));\n $grid->column('involves_max', __('Involves max'));\n $grid->column('status', __('Status'));\n $grid->column('organizers', __('Organizers'));\n $grid->column('views', __('Views'));\n $grid->column('collectors_num', __('Collectors num'));\n $grid->column('is_stick', __('Is stick'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new NewEnergy());\n\n $grid->column('user_id', __('用户'));\n $grid->column('car_id', __('车辆ID'));\n $grid->column('start_mileage', __('开始里程'));\n $grid->column('end_mileage', __('结束里程'));\n $grid->column('mileage', __('里程'));\n $grid->column('type', __('车辆类型'));\n $grid->column('status', __('状态'));\n $grid->column('remark', __('备注'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new MachinesStyle());\n\n $grid->model()->latest();\n \n $grid->column('id', __('索引'))->sortable();\n\n $grid->column('style_name', __('型号名称'))->help('机具的型号名称');\n\n $grid->column('machines_fact.factory_name', __('所属厂商'))->help('机具型号所属的厂商');\n\n // $grid->column('machines_fact.machines_types.name', __('所属类型'))->help('机具型号所属的类型');\n\n $grid->column('created_at', __('创建时间'))->date('Y-m-d H:i:s')->help('机具型号的创建时间');\n\n $grid->column('updated_at', __('修改时间'))->date('Y-m-d H:i:s')->help('机具型号的最后修改时间');\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Enseignant());\n\n $grid->column('id', __('Id'));\n $grid->column('matricule', __('Matricule'));\n $grid->column('nom', __('Nom'));\n $grid->column('postnom', __('Postnom'));\n $grid->column('prenom', __('Prenom'));\n $grid->column('sexe', __('Sexe'));\n $grid->column('grade', __('Grade'));\n $grid->column('fonction', __('Fonction'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new LotteryCode());\n $grid->model()->orderBy('prizes_time', 'desc');\n $grid->id('Id');\n $grid->code('抽奖码');\n $grid->batch_num('批次号');\n $grid->prizes_name('奖品');\n $grid->valid_period('有效期');\n $grid->prizes_time('抽奖时间');\n $grid->award_status('发奖状态')->editable('select', [0 => '未发放', 1 => '已发放']);\n $grid->disableCreateButton();\n $grid->disableActions();\n $grid->filter(function($filter){\n // 去掉默认的id过滤器\n $filter->disableIdFilter();\n // 在这里添加字段过滤器\n $filter->like('code', '抽奖码');\n $filter->like('batch_num', '批次号');\n $filter->between('prizes_time', '抽奖时间')->datetime();\n });\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Boarding());\n\n $grid->column('id', __('Id'));\n $grid->column('pet.name', __('Pet Name'));\n $grid->column('reservation.date', __('Reservation Date'));\n $grid->column('cage_id', __('Cage Number'));\n $grid->column('end_date', __('End date'));\n $grid->column('created_at', __('Created at'));\n $grid->column('updated_at', __('Updated at'));\n\n $grid->filter(function($filter){\n\n $filter->disableIdFilter();\n $filter->like('pet.name', 'Pet Name');\n \n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Engine());\n\n $grid->column('id', __('#'));\n $grid->column('power_station_id', __('Power station'))\n ->display(function ($userId) {\n $u = PowerStation::find($userId);\n if (!$u)\n return \"-\";\n return $u->name;\n })\n ->sortable();\n $grid->column('name', __('Tank Name'));\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new gameLog());\n\n $grid->column('onlyId', ___('OnlyId'));\n $grid->column('bigBlindIndex', ___('BigBlindIndex'));\n $grid->column('gameNums', ___('GameNums'));\n $grid->column('smallBlindIndex', ___('SmallBlindIndex'));\n $grid->column('tableCards', ___('TableCards'));\n $grid->column('tableId', ___('TableId'));\n $grid->column('tableSeat1Str1', ___('TableSeat1Str1'));\n $grid->column('tableSeat1Str2', ___('TableSeat1Str2'));\n $grid->column('tableSeat1Str3', ___('TableSeat1Str3'));\n $grid->column('tableSeat1Str4', ___('TableSeat1Str4'));\n $grid->column('tableSeat1Str5', ___('TableSeat1Str5'));\n $grid->column('tableSeat1Str6', ___('TableSeat1Str6'));\n $grid->column('tableSeat1Str7', ___('TableSeat1Str7'));\n $grid->column('time', ___('Time'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Work);\n\n $grid->id('Id')->sortable();;\n $grid->name(trans('Название'))->sortable();;\n $grid->description(trans('Описание'))->sortable();;\n $grid->order_id(trans('Порядок'))->sortable();;\n\n $grid->paginate(20);\n\n $grid->filter(function($filter){\n $filter->disableIdFilter();\n $filter->like('name', trans('Название'));\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Cate());\n\n $grid->column('id', __('Id'));\n $grid->column('name', __('Name'));\n $grid->column('link', __('Link'));\n $grid->column('thumb', __('Thumb'));\n $grid->column('status', __('Status'));\n $grid->column('sort', __('Sort'));\n $grid->column('createtime', __('Createtime'));\n $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new BrandCooperation);\n\n $grid->sort('排序')->editable()->sortable();\n $grid->name('品牌名称');\n $grid->is_show('是否显示')->editable('select', [1 => '显示', 0 => '隐藏']);\n $grid->created_at('添加时间')->sortable();\n\n// $grid->actions(function ($actions) {\n// $actions->disableView(); // 禁用查看\n// });\n\n $grid->tools(function ($tools) {\n // 禁用批量删除按钮\n $tools->batch(function ($batch) {\n $batch->disableDelete();\n });\n });\n\n // 查询\n $grid->filter(function($filter){\n\n // 去掉默认的id过滤器\n $filter->disableIdFilter();\n\n $filter->like('name', '品牌名称');\n $filter->equal('is_show', '显隐')->radio([1 => '显示', 0 => '隐藏']);\n });\n\n return $grid;\n }", "public function buildGrid() {\n // Processing Grids\n if ($this->getContext('container.grids')) {\n $grids = new VTCore_Bootstrap_Grid_Column($this->getContext('container.grids'));\n $this->addClass($grids->getClass(), 'grids');\n }\n\n return $this;\n }", "protected function grid()\n {\n $grid = new Grid(new Category);\n\n $grid->id('ID');\n $grid->name('Название');\n //$grid->intro_img('Превью');\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Activity);\n\n $grid->id('Id');\n $grid->log_name('Log name');\n $grid->description('Description');\n $grid->subject_id('Subject id');\n $grid->subject_type('Subject type');\n $grid->causer_id('Causer id');\n $grid->causer_type('Causer type');\n $grid->properties('Properties');\n $grid->created_at('Created at');\n $grid->updated_at('Updated at');\n\n $grid->disableCreateButton();\n\n $grid->actions(function ($actions) {\n $actions->disableEdit();\n $actions->disableView();\n });\n\n $grid->filter(function ($filter) {\n $filter->disableIdFilter();\n\n $filter->between('created_at', '创建时间')->datetime();\n });\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Banner);\n\n $grid->id('Id');\n $grid->title('Title');\n $grid->image('Image')->display(function($image) {\n return '<img width=\"30\" src=\"' . (env('APP_URL') . '/storage/' . ($image ?: 'images/default.png')) . '\"\"/>';\n });\n $grid->status('Status');\n $grid->created_at('Created at');\n $grid->updated_at('Updated at');\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new $this->currentModel);\n\n $grid->id('ID')->sortable();\n\n $grid->company_id('公司名称')->display(function ($company_id) {\n $company = Company::find($company_id);\n if ($company) {\n return $company->company_name;\n }\n return $company_id;\n });\n $grid->project_name('项目名称')->sortable();\n $grid->link_url('项目链接');\n $grid->display('公开度')->display(function ($display) {\n return $display == 0 ? '公开' : '私密';\n });\n $grid->created_at('添加时间')->sortable();\n\n return $grid;\n }", "protected function constructGrid()\n {\n // jquery script for loading first page of grid\n $table = \"\n <script type=\\\"text/javascript\\\">\n // load first page\n WschangeModelPagination(\n '$this->_id',\n '$this->_action',\n '$this->_modelName',\n '$this->noDataText',\n $this->itemsPerPage,\n $this->showEdit,\n '$this->_order',\n '$this->_formId',\n 0,\n '$this->_id'+'_0',\n '$this->_edit_action',\n '$this->_delete_action'\n );\n </script>\n \";\n\n // container for edit dialog\n if ($this->showEdit) {\n $table .= '<div class=\"uk-modal\" id=\"'.$this->_formId.'\"></div>';\n $table .= '<div class=\"uk-modal\" id=\"'.$this->_formId.'_new\"></div>';\n }\n\n // title\n $table .= '<div class=\"uk-grid\">';\n $table .= '<div class=\"uk-width-small-1-1 uk-width-medium-1-1\">';\n $table .= '<h1>'.$this->_model->metaName.'</h1>';\n $table .= '</div>';\n $table .= '</div>';\n\n // add and search controls\n $table .= '<div class=\"uk-grid\">';\n $table .= '<div class=\"uk-width-small-1-1 uk-width-medium-1-2\">';\n $table .= '<form class=\"uk-form uk-form-horizontal\">';\n $table .= '<fieldset data-uk-margin>';\n // new item button\n if ($this->showEdit) {\n $table .= '<button class=\"uk-button uk-button-success\"'\n .' data-uk-modal=\"{target:\\'#'.$this->_formId\n .'_new\\', center:true}\"'\n .' id=\"btn_create_'.$this->_id.'\"'\n .' type=\"button\" onclick=\"WseditModelID('\n .'\\''.$this->_formId.'_new\\', '\n .'\\''.$this->_modelName.'\\', '\n .'0, \\''.$this->_edit_action.'\\')\">';\n $table .= '<i class=\"uk-icon-plus\"></i>';\n $table .= '</button>';\n }\n // search control\n $table .= '<input';\n $table .= ' type=\"text\" id=\"search_'.$this->_id.'\"';\n $table .= '/>';\n $table .= '<button class=\"uk-button\"'\n .' id=\"btn_search_'.$this->_id\n .'\" type=\"button\" onclick=\"WschangeModelPagination('\n .'\\''.$this->_id.'\\', '\n .'\\''.$this->_action.'\\', '\n .'\\''.$this->_modelName.'\\', '\n .'\\''.$this->noDataText.'\\', '\n .$this->itemsPerPage.', '\n .$this->showEdit.', '\n .'\\''.$this->_order.'\\', '\n .'\\''.$this->_formId.'\\', '\n .'0, \\''.$this->_id.'\\'+\\'_0\\', '\n .'\\''.$this->_edit_action.'\\', '\n .'\\''.$this->_delete_action.'\\')\">';\n $table .= '<i class=\"uk-icon-search\"></i>';\n $table .= '</button>';\n\n $table .= '</fieldset>';\n $table .= '</form>';\n $table .= '</div>';\n $table .= '</div>';\n\n // Grid View table\n $table .= '<div class=\"uk-grid\">';\n $table .= '<div class=\"uk-width-1-1\">';\n $table .= '<div class=\"uk-overflow-container\">';\n $table .= '<table class=\"uk-table uk-table-hover uk-table-striped\">';\n $table .= '<thead>';\n $table .= '<tr>';\n foreach ($this->_model->columns as $column) {\n if (!in_array($column, $this->_model->hiddenColumns)) {\n if (isset($this->_model->columnHeaders[$column])) {\n $table .= '<th>'\n .$this->_model->columnHeaders[$column];\n $table .= '</th>';\n } else {\n $table .= '<th>'.$column.'</th>';\n }\n }\n }\n if ($this->showEdit) {\n $table .= '<th></th>';\n }\n $table .= '</tr>';\n $table .= '</thead>';\n\n // container of table data loaded from AJAX request\n $table .= '<tbody id=\"'.$this->_id.'\"></tbody>';\n\n // end of grid table\n $table .= '</table>';\n $table .= '</div>';\n $table .= '</div>';\n $table .= '</div>';\n\n // get number ow rows from query so that we can make pager\n $db = new WsDatabase();\n $countQuery = 'SELECT COUNT(*) AS nrows FROM '.$this->_model->tableName;\n $result = $db->query($countQuery);\n $this->nRows = intval($result[0]['nrows']);\n $db->close();\n\n // number of items in pager\n $nPages = $this->getPagination($this->nRows);\n\n // construct pager\n $table .= '<ul class=\"uk-pagination uk-pagination-left\">';\n // links to pages\n for ($i = 0; $i < $nPages; $i++) {\n $table .= '<li>';\n $table .= '\n <a id=\"'.$this->_id.'_'.$i.'\"\n href=\"javascript:void(0)\"\n onclick=\"WschangeModelPagination('\n .'\\''.$this->_id.'\\', '\n .'\\''.$this->_action.'\\', '\n .'\\''.$this->_modelName.'\\', '\n .'\\''.$this->noDataText.'\\', '\n .$this->itemsPerPage.', '\n .$this->showEdit.', '\n .'\\''.$this->_order.'\\', '\n .'\\''.$this->_formId.'\\', '\n .$i.',\\''.$this->_id.'_'.$i.'\\', '\n .'\\''.$this->_edit_action.'\\', '\n .'\\''.$this->_delete_action.'\\')\"/>'\n .($i+1).'</a>';\n $table .= '</li>';\n }\n // end of pager\n $table .= '</ul>';\n\n // end of master div element\n $table .= '<br/>';\n\n $table .= '<script type=\"text/javascript\">'\n .'$(\"#search_'.$this->_id.'\").keydown(function(event) {'\n .' if(event.keyCode == 13) {'\n .' event.preventDefault();'\n .' $(\"#btn_search_'.$this->_id.'\").click();'\n .' }'\n .'});'\n .'</script>';\n\n unset($i, $nPages, $db, $result, $countQuery);\n return $table;\n }", "protected function grid()\n {\n $grid = new Grid(new Clinic());\n\n $grid->column('id', __('Id'))->filter();\n $grid->column('image', __('Image'))->image();\n $grid->column('name', __('Name'))->filter();\n $grid->column('type', __('Type'))->using(['1' => 'Clinic', '2' => 'Hospital'])->filter();\n $grid->column('email', __('Email'))->filter();\n $grid->column('phone', __('Phone'))->filter();\n $grid->column('address', __('Address'))->filter();\n $grid->column('website_url', __('Website url'))->link()->filter();\n $grid->column('profile_finish', __('Profile finish'))->bool()->filter();\n $grid->column('status', __('Status'))->bool()->filter();\n $grid->column('created_at', __('Created at'))->filter();\n $grid->column('updated_at', __('Updated at'))->filter();\n\n $grid->actions(function ($actions) {\n $actions->disableView();\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Information);\n\n $grid->model()->where('adminuser_id', '=', Admin::user()->id);\n $grid->disableCreateButton();\n\n $grid->column('id', __('Id'));\n $grid->column('name', __('项目名称'));\n $grid->column('content', __('项目简介'))->limit(30);\n $grid->column('industry', __('行业类别'));\n $grid->column('investment', __('投资金额')); \n $grid->column('cont_name', __('资方联系人'));\n $grid->column('cont_phone', __('资方联系方式'));\n $grid->column('staff_name', __('工作人员姓名'));\n $grid->column('staff_phone', __('工作人员电话'));\n $grid->column('created_at', __('上报时间'));\n $grid->column('updated_at', __('更新时间'));\n $grid->filter(function($filter){\n\n // 去掉默认的id过滤器\n $filter->disableIdFilter();\n\n // 在这里添加字段过滤器\n $filter->like('name', '项目名称');\n $filter->like('cont_name', '资方联系人');\n $filter->like('content', '项目情况');\n });\n\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Order);\n\n $grid->column('id', __('Id'));\n $grid->column('currency', __('Currency'));\n $grid->column('amount', __('Amount'));\n $grid->column('state', __('State'));\n $grid->column('game_id', __('Game id'));\n $grid->column('user_id', __('User id'));\n $grid->column('product_id', __('Product id'));\n $grid->column('product_name', __('Product name'));\n $grid->column('cp_order_id', __('Cp order id'));\n $grid->column('callback_url', __('Callback url'));\n $grid->column('callback_info', __('Callback info'));\n $grid->column('created_at', __('Created at'));\n $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Dictionary());\n $grid->disableRowSelector();\n $grid->disableExport();\n\n $grid->column('id', __('Id'));\n $grid->column('type', __('Type'))->display(function () {\n return $this->type ? Dictionary::TYPES[$this->type] : null;\n })->label();\n $grid->column('option', __('Option'));\n $grid->column('slug', __('Slug'));\n $grid->column('alternative', __('Alternative'));\n $grid->column('approved', __('Approved'))->switch();\n $grid->column('sort', __('Sort'));\n\n $grid->filter(function ($filter) {\n $filter->disableIdFilter();\n $filter->expand();\n $filter->where(function ($query) {\n $query->where('dictionaries.type', '=', $this->input);\n }, __('Фильтровать по типу'))->select(Dictionary::TYPES);\n });\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new SpecificationTemplate());\n\n $grid->column('id', __('Id'));\n $grid->column('name', __('Name'));\n $grid->column('keys', __('Keys'))->display(function ($keys) {\n return implode(',', $keys);\n });\n $grid->column('content', __('Content'))->display(function ($content) {\n return implode('<br/>', array_map(fn($values) => implode(',', $values), $content));\n });\n $grid->column('sort', __('Sort'))->editable();\n $grid->column('is_display', __('Is display'))->switch();\n $grid->column('created_at', __('Created at'));\n $grid->column('updated_at', __('Updated at'));\n\n $grid->actions(function (Grid\\Displayers\\Actions $actions) {\n $actions->disableView();\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Order);\n\n\n //only display paid order\n $grid->model()->whereNotNull('paid_at')->orderBy('paid_at', 'desc');\n\n $grid->no('order number');\n $grid->column('user.name', 'Buyer');\n $grid->total_amount('Total Amount')->sortable();\n $grid->paid_at('Paid Time')->sortable();\n $grid->ship_status('Shipment')->display(function($value) {\n return Order::$shipStatusMap[$value];\n });\n $grid->refund_status('Refund Status')->display(function($value) {\n return Order::$refundStatusMap[$value];\n });\n $grid->disableCreateButton();\n $grid->actions(function ($actions) {\n $actions->disableDelete();\n $actions->disableEdit();\n });\n $grid->tools(function ($tools) {\n $tools->batch(function ($batch) {\n $batch->disableDelete();\n });\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Book());\n\n $grid->column('id', __('Id'));\n $grid->author()->display(function($v) {\n return $v['name'];\n });\n $grid->column('title', __('Title'));\n $grid->column('description', __('Description'));\n $grid->column('year', __('Year'));\n $grid->column('created_at', __('Created at'));\n $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Blog());\n\n $grid->column('id', __('Id'));\n $grid->column('title', __('Title'));\n $grid->column('sub_title', __('Sub title'));\n $grid->column('tag', __('Tag'));\n $grid->column('body', __('Body'));\n $grid->column('posted_by', __('Posted by'));\n $grid->column('posted_at', __('Posted at'));\n $grid->column('created_at', __('Created at'));\n $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new PointMachine());\n\n $grid->column('id', __('Id'));\n $grid->column('name', __('Name'));\n $grid->column('point.name', __('Point name'));\n $grid->column('machine_no', __('Machine no'));\n // 1-自助型 2-全自动型\n $grid->column('type', __('Type'))->display(function ($type) {\n return $type == 1 ? '自助型 ' : '全自动型';\n });\n $grid->column('cost', __('Cost'));\n $grid->column('cost_at', __('Cost at'));\n $grid->column('build_at', __('Build at'));\n $grid->column('remark', __('Remark'));\n $grid->column('created_at', __('Created at'));\n $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new City());\n\n $grid->column('id', __('Id'));\n $grid->column('sort', __('Sort'));\n $grid->column('name', __('Name'));\n $grid->column('slug', __('Slug'));\n $grid->column('description', __('field.description'))->display(function ($item) {\n return mb_strimwidth($item, 0, 500, '...');\n });\n $grid->column('files', __('field.images'))->display(function () {\n $images = array();\n foreach ($this->files as $file) {\n array_push($images, preg_replace(\"/images\\//\", \"images/small.\", $file->file));\n }\n return $images;\n })->carousel(150, 100);\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Talent);\n\n $grid->column('talents_id', 'ID');\n $grid->column('name', '姓名')->filter('like');\n $grid->column('sex', '性别')->filter('like');\n $grid->column('jobtitle', '工作单位及职务')->filter('like');\n $grid->column('education', '学历学位')->filter('like');\n $grid->column('university', '毕业院校与专业')->filter('like');\n $grid->column('major', '目前的专业/技术特长')->filter('like');\n $grid->column('linkphone', '联系电话')->filter('like');\n $grid->exporter(new TalentExporter());\n $grid->actions(function ($actions) {\n // 去掉查看\n $actions->disableView();\n });\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Resources);\n\n $grid->id('ID');\n $grid->type('类型')->using(Resources::TYPE)->filter(Resources::TYPE);\n $grid->name('名称');\n $grid->url('图片')->image();\n $grid->sort_num('排序')->editable()->sortable();\n $grid->memo('备注');\n\n $grid->disableExport();\n $grid->disableFilter();\n\n $grid->actions(function ($actions) {\n $actions->disableView();\n $actions->disableDelete();\n });\n $grid->tools(function ($tools) {\n // 禁用批量删除按钮\n $tools->batch(function ($batch) {\n $batch->disableDelete();\n });\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new SiteHelp);\n\n $grid->model()->latest();\n\n $grid->filter(function ($filter) {\n\n // 去掉默认的id过滤器\n $filter->disableIdFilter();\n\n $filter->equal('site_help_category_id', __('site-help::help.site_help_category_id'))\n ->select(SiteHelpCategory::pluck('name', 'id'));\n $filter->like('title', __('site-help::help.title'));\n $filter->equal('status', __('site-help::help.status.label'))\n ->select(__('site-help::help.status.value'));\n });\n\n $grid->column('thumbnail', __('site-help::help.thumbnail'))->image('', 66);\n $grid->column('id', __('site-help::help.id'));\n $grid->column('category.name', __('site-help::help.site_help_category_id'));\n $grid->column('title', __('site-help::help.title'));\n $grid->column('useful', __('site-help::help.useful'));\n $grid->column('status', __('site-help::help.status.label'))\n ->using(__('site-help::help.status.value'));\n $grid->column('created_at', __('admin.created_at'));\n $grid->column('updated_at', __('admin.updated_at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Platform());\n\n $grid->column('platform_number', __('Platform number'));\n $grid->column('platform_name', __('Platform name'))->label()\n ->expand(function ($model){\n $shops = $model->shops()->get()->map(function ($shop){\n return $shop->only(['shop_number', 'shop_name']);\n });\n\n return new Table([__('Platform number'), __('Platform name')], $shops->toArray());\n });\n $grid->column('created_at', __('Created at'));\n $grid->column('updated_at', __('Updated at'));\n\n $grid->filter(function ($filter){\n $filter->disableIdFilter();\n $filter->equal('platform_number', __('Platform number'));\n $filter->like('platform_name', __('Platform name'));\n });\n\n $grid->paginate(10);\n\n $grid->disableRowSelector();\n\n $grid->actions(function ($actions){\n $actions->disableView();\n $actions->disableDelete();\n });\n\n return $grid;\n }", "public function getDatagridViewBuilder();", "protected function grid()\n {\n $grid = new Grid(new Barang());\n\n $grid->filter(function($filter){\n $filter->disableIdFilter();\n $filter->like('nama', 'Nama');\n });\n $grid->column('id', __('Id'));\n $grid->column('nama', __('Nama'));\n $grid->column('harga', __('Harga Beli'));\n $grid->column('harga_jual', __('Harga Jual'));\n $grid->column('satuan_id', __('Satuan id'))->display(function($satuan) {\n return Satuan::find($satuan)->nama;\n });\n $grid->column('jumlah_unit', __('Jumlah Unit'));\n $grid->column('parent_id', 'Parent')->display(function($id) {\n if($id) {\n return Barang::find($id)->nama;\n }\n else {\n return null;\n }\n });\n $grid->column('b_pengiriman', __('Pengiriman'));\n $grid->column('b_keamanan', __('Keamanan'));\n // $grid->column('created_at', __('Created at'));\n // $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Collect());\n $grid->disableActions();\n $grid->disableCreateButton();\n $grid->column('name','姓名');\n $grid->column('phone','手机号');\n $grid->column('address','地址');\n $grid->column('time','时间');\n $grid->column('message','备注');\n\n $postsExporter = new ColectExport();\n $postsExporter->fileName = date('Y-m-d H:i:s').'.xlsx';\n $grid->exporter($postsExporter);\n $url = url()->current();\n $url .= \"?_export_=all\";\n $grid->tools(function ($tools)use($grid,$url){\n $tools->append(new Export($grid,$url));\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Customer);\n $grid->model()->where('is_delete',0)->orderBy('id','desc');\n $grid->id('ID')->sortable();\n $grid->code('客户编号');\n $grid->name('客户名称');\n $grid->contactor('联系人');\n $grid->tel('联系电话');\n $grid->email('邮箱');\n $grid->address('地址');\n $grid->receivables('应收账款数字');\n\n $grid->create_time('创建时间')->display(function ($create_time) {\n return date('Y-m-d H:i',$create_time);\n })->sortable();\n\n // 查询过滤\n $grid->filter(function($filter){\n $filter->column(1/2, function ($filter) {\n $filter->like('code', '客户编号');\n $filter->like('name', '客户名称');\n });\n $filter->column(1/2, function ($filter) {\n $filter->like('contactor', '联系人');\n $filter->like('tel', '联系电话');\n $filter->use(new TimestampBetween('create_time','创建时间'))->datetime();\n });\n\n\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Setting());\n\n $grid->column('id', __('Id'));\n $grid->column('member_fee', __('Member fee'));\n $grid->column('task_rate', __('Task rate'));\n $grid->column('created_at', __('Created at'));\n $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new HhxEquip());\n\n $grid->column('id', __('Id'));\n $grid->column('name', __(trans('hhx.name')));\n $grid->column('hhx_travel_id', __(trans('hhx.hhx_travel_id')))->display(function ($hhx_travel_id){\n return self::getTravelService()->getNameByTravelId($hhx_travel_id);\n });\n $grid->column('status', __(trans('hhx.status')))->select(config('hhx.equip_status'));\n $grid->column('created_at', __(trans('hhx.created_at')));\n $grid->column('updated_at', __(trans('hhx.updated_at')));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Sections());\n\n $grid->column('id', __('ID'))->editable() -> sortable();\n $grid->column('name', __('Nazwa'))->editable() -> sortable();\n $grid->column('pageId', __('ID sekcji (w sensie HTML)'))->editable() -> sortable();\n $grid->column('content', __('Zawartość'))->editable() -> sortable();\n $grid->column('style', __('Style(CSS)'))->editable() -> sortable();\n $grid->column('created_at', __('Utworzono')) -> sortable();\n $grid->column('updated_at', __('Zauktalizowano')) -> sortable() ;\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new MethodPrice);\n\n $grid->id('ID');\n $grid->entity('Сущность')->select(Pest::all()->pluck('name','id'));\n $grid->method('Сущность')->select(Method::all()->pluck('name','id'));\n $grid->chemical('Сущность')->select(Chemical::all()->pluck('name','id'));\n $grid->square_1('Сущность')->select(Chemical::all()->pluck('name','id'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Feedback);\n $grid->column('id', 'ID');\n $grid->column('content', '内容');\n $grid->column('member', '用户')->display(function(){\n return $this->member->nickname;\n });\n $grid->column('created_at', '时间');\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Site());\n\n $grid->id('ID');\n $grid->category()->title('分类');\n $grid->title('标题');\n $grid->thumb('图标')->gallery(['width' => 50, 'height' => 50]);\n $grid->describe('描述')->limit(40);\n $grid->url('地址');\n\n $grid->disableFilter();\n $grid->disableExport();\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Goods);\n\n $grid->id('Id');\n $grid->title(trans('admin.title'));\n $grid->slogan(trans('admin.slogan'));\n $grid->name(trans('admin.name'));\n $grid->price(trans('admin.price'))->editable();\n $grid->created_at(trans('admin.created_at'));\n $grid->updated_at(trans('admin.updated_at'));\n $grid->actions(function ($actions) {\n $actions->disableView();\n });\n $grid->disableExport();\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Activity());\n $grid->model()->orderBy('created_at','desc');\n\n $grid->column('id', __('Id'));\n $grid->column('log_name', __('Log name'))->using($this->log_name);\n $grid->column('description', __('Description'))->limit(10);\n $grid->column('subject_id', __('Subject id'));\n $grid->column('subject_type', __('Subject type'));\n $grid->column('causer_id', __('Causer id'));\n $grid->column('causer_type', __('Causer type'));\n $grid->column('properties', __('Properties'))->display(function ($properties) {\n $properties = [\n '详情' => isset($properties['description']) ? $properties['description'] : '',\n '备注' => isset($properties['remark']) ? $properties['remark'] : '',\n ];\n return new Table([], $properties);\n });\n $grid->column('created_at', __('Created at'))->sortable();\n $grid->column('updated_at', __('Updated at'));\n\n $grid->filter(function ($filter) {\n\n $filter->equal('log_name', __('Log name'))->select($this->log_name);\n\n });\n\n #禁用创建按钮\n $grid->disableCreateButton();\n\n $grid->actions(function ($actions) {\n $actions->disableDelete();\n $actions->disableView();\n $actions->disableEdit();\n });\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Usertype());\n\n $grid->column('id', 'ID');\n $grid->column('usertype', '分类名称');\n $grid->column('created_at', '创建时间');\n $grid->column('updated_at', '修改时间');\n $grid->disableFilter();\n $grid->disableExport();\n $grid->disableRowSelector();\n $grid->disableColumnSelector();\n $grid->disableActions();\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Regional());\n\n $grid->column('id', 'ID');\n $grid->column('logo', 'Logo')->image('', '50', '50');\n $grid->column('name', 'Nama');\n $grid->column('address', 'Alamat');\n $grid->column('created_at', 'Dibuat')->date('d-m-Y');\n $grid->column('updated_at', 'Diubah')->date('d-m-Y');\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Plan);\n $grid->model()->whereHas('category');\n\n $grid->column('category.name', __('Категория'));\n $grid->column('count', __('План'))->editable()->sortable();\n $grid->column('month_name', __('Месяц'));\n $grid->column('year', __('Год'))->sortable();\n// $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Order());\n\n $grid->column('id', __('Id'));\n $grid->column('trip', __('Trip'))->display(function () {\n return $this->trip->name;\n });\n $grid->column('user', __('User'))->display(function () {\n return $this->user->name . ' ' . $this->user->surname . \" ({$this->user->email})\";\n });\n $grid->column('paid', __('Paid'))->bool()->filter([\n 0 => 'No',\n 1 => 'Yes',\n ]);\n $grid->column('reservation_expires', __('Reservation expires'))->sortable();\n $grid->column('price', __('Price'));\n\n $grid->disableFilter();\n $grid->disableExport();\n $grid->disableCreateButton();\n $grid->actions(function ($actions) {\n $actions->disableView();\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Terrace());\n\n $grid->column('id', __('Id'))->sortable()->style('text-align:center');\n $grid->column('image', __('平台图片'))->style('text-align:center')->image();\n $grid->column('name', __('平台名称'))->style('text-align:center');\n $grid->column('path', __('外链'))->style('text-align:center');\n $grid->column('notice_info', __('提示语'))->style('text-align:center');\n $grid->column('status', __('状态'))->display(function($status){\n return $status == 1 ? '未推荐' : '已推荐';\n })->style('text-align:center');\n $grid->column('created_at', __('创建时间'))->style('text-align:center');\n $grid->disableExport();\n\n $grid->actions(function ($actions) {\n $actions->disableDelete();\n $actions->add(new Terracedel());\n });\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new WechatUser);\n\n $grid->column('id', __('ID'));\n $grid->column('nick_name', __('昵称'));\n $grid->column('name', __('用户名'));\n $grid->column('password', __('密码'));\n $grid->column('mobile', __('手机号'));\n $grid->column('mini_program_open_id', __('OpenId'));\n $grid->column('created_at', __('创建时间'));\n $grid->column('updated_at', __('更新时间'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Code());\n\n\n \n $grid->filter(function ($filter) {\n $filter->disableIdFilter();\n\n $filter->column(1 / 2, function ($filter) {\n $filter->like('phone', '手机号');\n $filter->like('ip', 'IP');\n });\n\n $filter->column(1 / 2, function ($filter) {\n $filter->between('created_at', '时间范围')->datetime();\n });\n\n\n });\n\n\n // $grid->column('id', __('Id'));\n $grid->column('phone', __('手机号'))->filter('like');\n $grid->column('code', __('验证码'));\n $grid->column('created_at', __('发送时间'));\n $grid->column('used_at', __('使用时间'));\n $grid->column('ip', __('IP'));\n $grid->model()->latest();\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Purchase());\n\n $grid->column('id', \"编号\");\n $grid->column('consumer_name', \"客户\")->display(function () {\n return $this->consumer->full_name;\n });\n $grid->column('house_readable_name', \"房源\")->display(function () {\n return $this->house->readable_name;\n });\n $grid->column('started_at', \"生效日期\");\n $grid->column('ended_at', \"结束日期\");\n $grid->column('sell_type', \"出售方式\")->display(function ($sell_type) {\n return Purchase::$type[$sell_type];\n });\n $grid->column('price', \"成交价格\")->display(function ($price) {\n return \"¥$price\";\n });\n $grid->column('created_at', \"创建日期\");\n $grid->column('updated_at', \"更新日期\");\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Specialization);\n\n $grid->id('Id');\n $grid->full_name('Полное найменование');\n $grid->short_name('Краткое найменование');\n $grid->code('Код специальности');\n $grid->cathedra_id('Кафедра')->using(Cathedra::all()->pluck('abbreviation', 'id')->toArray());\n $grid->created_at('Создано');\n $grid->updated_at('Обновлено');\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Gys);\n\n $grid->id('Id');\n $grid->name('公司名称');\n $grid->tel('联系人电话');\n $grid->file('营业执照')->display(function ($v){\n $str = '';\n foreach (explode(',',$v) as $item){\n $str.= '<a target=\"_blank\" href=\"'.env('APP_URL').$item.'\"><img src=\"'.env('APP_URL').$item.'\" width=\"100\" style=\"padding:10px;border:solid #eee 1px;border-radius:3px;margin-right:3px\"/></a>';\n }\n return $str;\n });\n $grid->hyzz('资质证书')->display(function ($v){\n $str = '';\n foreach (explode(',',$v) as $item){\n $str.= '<a target=\"_blank\" href=\"'.env('APP_URL').$item.'\"><img src=\"'.env('APP_URL').$item.'\" width=\"100\" style=\"padding:10px;border:solid #eee 1px;border-radius:3px;margin-right:3px\"/></a>';\n }\n return $str;\n });\n $grid->type('类型');\n $grid->username('用户名称');\n $grid->password('密码');\n $grid->created_at('创建时间');\n $grid->updated_at('更新时间');\n $grid->status('账户状态')->radio([\n 0=> '审核中',\n 1=> '审核通过',\n 2=> '冻结账户'\n ]);\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new City());\n\n// $grid->column('id', __('Id'));\n $grid->column('date', __('Дата'));\n $grid->column('name', __('Город'))->display(function () {\n return '<a href=\"/admin/city-users?set='.$this->id.'\">'.$this->name.'</a>';\n });\n $grid->column('image', 'Картинка')->display(function () {\n $str = $this->image!='' ? '<img src=\"/uploads/images/'.$this->image.'\" height=\"100\"/>' : '';\n return $str;\n });\n// $grid->column('text', __('Text'));\n $grid->column('show', 'Активен')->display(function () {\n return $this->show ? 'да' : 'нет';\n });\n// $grid->column('orders', __('Orders'));\n// $grid->column('created_at', __('Created at'));\n// $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Category);\n\n $grid->id('Id');\n $grid->parent_id('父ID');\n $grid->name('名称');\n $grid->order('排序');\n $grid->image('图片');\n $grid->index_template('首页模版');\n $grid->detail_template('详情模版');\n $grid->status('Status')->display(function ($status){\n return $status ? '<p class=\"text-success\">启用</p>' : '<p class=\"text-muted\">禁用</p>';\n });\n $grid->created_at('创建时间');\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Member());\n\n $grid->column('id', 'id')->sortable();\n $grid->column('username','用户名');\n $grid->column('phone', '手机号')->display(function() {\n return substr($this->phone, 0, 3).'****'.substr($this->phone, 7);\n });\n $grid->column('avatar', '头像')->image('', 50, 50);\n $grid->column('created_at', '注册时间')->sortable();\n $grid->disableCreateButton();\n $grid->disableExport();\n $grid->disableActions();\n $grid->filter(function ($filter) {\n\n // 设置created_at字段的范围查询\n $filter->between('created_at', '创建时间')->datetime();\n });\n\n return $grid;\n }", "protected function grid() {\n\t\t$grid = new Grid(new Payment);\n\t\t$grid->disableCreateButton();\n\t\t$grid->column('id', __('Id'));\n\t\t$grid->column('user_id', __('用户'));\n\t\t// $grid->column('app_id', __('App id'));\n\t\t$grid->column('price', __('金额'));\n\t\t$grid->column('transaction_id', __('三方订单号'));\n\t\t$grid->column('out_trade_no', __('平台订单号'));\n\t\t$grid->column('type', __('订单类型'))->using(['20' => '商城订单']);\n\t\t$grid->column('status', __('状态'))->using(['0' => '未支付', '1' => '已支付', '2' => '未支付']);\n\t\t// $grid->column('other', __('Other'));\n\t\t$grid->column('payment_at', __('支付时间'));\n\t\t$grid->column('created_at', __('创建时间'));\n\t\t$grid->column('updated_at', __('更新时间'));\n\n\t\treturn $grid;\n\t}", "protected function grid()\n {\n $grid = new Grid(new Product);\n\n $grid->id('Id');\n $grid->name('商品名');\n $grid->column('category.name', '品类');\n $grid->fabric('Fabric');\n $grid->gsm('Gsm');\n $grid->material('Material');\n $grid->attach('Attach');\n $grid->head_image('商品图')->image('http://yujiaknit.test/images/', 100, 100);\n $grid->created_at('Created at');\n $grid->updated_at('Updated at');\n\n $grid->filter(function ($filter) {\n // 去掉默认的id过滤器\n $filter->disableIdFilter();\n\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Feed());\n\n $grid->column('id', __('Id'));\n $grid->column('url', __('url'));\n $grid->column('id_author', __('Id author'));\n $grid->column('created_at', __('Created at'));\n $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Withdrawal());\n\n $grid->filter(function($filter){\n // 去掉默认的id过滤器\n $filter->disableIdFilter();\n $filter->like('name', __('分区名称'));\n });\n\n $grid->column('id', __('Id'))->sortable();\n $grid->column('uid', __('用户昵称(UID)'))->display(function ($uid) {\n return UsersInfo::where('id',$uid)->value('nickname').\"({$uid})\";\n });\n $grid->column('real_name', __('实名姓名'));\n $grid->column('id_card', __('身份证号码'));\n $grid->column('mobile', __('联系电话'));\n $grid->column('amount', __('提现数量'));\n $grid->column('status', __('状态'))->display(function ($status) {\n return Withdrawal::$status[$status];\n });\n $grid->column('created_at', __('创建时间'));\n $grid->column('updated_at', __('修改时间'));\n\n $grid->disableActions();\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new StationBannerImage());\n\n $grid->column('id', __('Id'));\n $grid->column('station.station_name', __('測站'));\n $grid->column('image', __('輪播圖'))->image('', '50');\n $grid->column('url', __('連結'))->link();\n $grid->column('order', __('排序'));\n $grid->column('valid_at', __('有效日期'));\n $grid->column('mod_user', __('異動人員'));\n $grid->column('updated_at', __('異動時間'));\n\n if (Admin::user()->username != 'admin') {\n $grid->model()->where('station_id', '=', Admin::user()->station_id);\n }\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new KuponGroup);\n\n $grid->column('id', __('ID'))->sortable();\n $grid->column('name',__('Nama'));\n $grid->column('total',__('Jumlah Kupon'));\n $grid->column('amount_per_kupon',__('Nilai Per Kupon'));\n $grid->column('expired',__('Kedaluwarsa'));\n $grid->column('created_at', __('Created at'));\n $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n return Admin::grid(Classroom::class, function (Grid $grid) {\n\n $grid->id('ID')->sortable();\n\n // $grid->column();\n\n $grid->column('number', '编号');\n $grid->column('name', '名称');\n $grid->column('location', '地点');\n $grid->column('square', '面积');\n $grid->column('floor', '楼层');\n $grid->column('is_free', '是否空闲');\n $grid->column('building_name', '建筑物名称');\n\n $grid->created_at();\n $grid->updated_at();\n });\n }", "protected function grid()\n {\n $grid = new Grid(new Milestone);\n\n $grid->column('id', __('Id'))->sortable();\n $grid->column('type', __('Type'))->select(Milestone::TYPE_MAP);\n $grid->column('version', __('Version'));\n $grid->column('content', __('Content'));\n $grid->column('detail', __('Detail'));\n $grid->column('created_at', __('Created at'))->sortable()->hide();\n $grid->column('updated_at', __('Updated at'))->sortable()->hide();\n\n $grid->model()->orderBy('id', 'desc');\n\n $grid->filter(function ($filter) {\n $filter->equal('version', '版本');\n $filter->like('content', '内容');\n $filter->equal('type', '类型')->select(Milestone::TYPE_MAP);\n $filter->between('created_at', '创建时间')->datetime();\n $filter->between('updated_at', '更新时间')->datetime();\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Test());\n\n $grid->id('编号');\n $grid->name('教师姓名');\n $grid->work_point('教学分数');\n $grid->science_point('科研分数');\n $grid->disableCreateButton();\n $grid->disableFilter();\n $grid->disableActions();\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new UserHealth());\n\n $grid->column('id', __('Id'))->filter();\n $grid->column('height', __('Height'))->filter();\n $grid->column('weight', __('Weight'))->filter();\n $grid->column('blood_pressure', __('Blood pressure'))->filter();\n $grid->column('sugar_level', __('Sugar level'))->filter();\n $grid->column('blood_type', __('Blood type'))->filter();\n $grid->column('muscle_mass', __('Muscle mass'))->filter();\n $grid->column('metabolism', __('Metabolism'))->filter();\n $grid->column('genetic_history', __('Genetic history'))->filter();\n $grid->column('illness_history', __('Illness history'))->filter();\n $grid->column('allergies', __('Allergies'))->filter();\n $grid->column('prescription', __('Prescription'))->filter();\n $grid->column('operations', __('Operations'))->filter();\n $grid->column('user_id', __('User id'))->filter();\n $grid->column('created_at', __('Created at'))->filter();\n $grid->column('updated_at', __('Updated at'))->filter();\n\n return $grid;\n }", "protected function grid()\n { \n \n $grid = new Grid(new Blog);\n\n $grid->id('Id')->sortable();\n $grid->title('标题');\n // $grid->content('内容');\n $grid->logo('图片')->display(function ($value) {\n return \"<img width='50' src='/upload/$value'>\";\n });\n $grid->discuss('评论');\n $grid->display('浏览');\n \n $grid->lab_id('标签')->display(function ($value) {\n $lab_name = Lab::select('lab_name')->where('id',$value)->get();\n \n return $lab_name[0]->lab_name;\n });\n\n $grid->cat_id('分类')->display(function ($value) {\n $cat_name = Cat::select('cat_name')->where('id',$value)->get();\n return $cat_name[0]->cat_name;\n });\n \n\n\n $grid->created_at('添加时间');\n \n $grid->actions(function ($actions){\n $actions->disableView();\n });\n\n $grid->filter(function($filter){\n $filter->like('title', '标题');\n $filter->like('content', '内容');\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new User());\n\n $grid->column('id', __('Id'));\n $grid->column('name', __('Name'));\n $grid->column('surname', __('Surname'));\n $grid->column('email', __('Email'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Category());\n $grid->model()->small();\n \n $grid->quickCreate(function (Grid\\Tools\\QuickCreate $create) {\n $create->text('erp_id', 'ERP ID');\n $create->text('name', '小分類名稱');\n $create->select('parent_id', __('中分類'))->options(\n Category::Mid()->pluck('name', 'id')\n );\n $create->text('type','分級(不需改)')->default(3);\n });\n\n $grid->column('erp_id', __('ERP Id'));\n $grid->column('name', __('小分類名稱'));\n $grid->column('parent_id', __('中分類'))->display(function($userId) {\n return Category::find($userId)->name;\n });\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new WechatEvent);\n\n $grid->id('Id');\n $grid->title('事件标题');\n $grid->key('Key');\n $grid->event('事件类型')->using(WechatEvent::EVENTLIST);\n $grid->method('执行方法');\n $grid->column('message.title', '消息标题');\n $grid->created_at('创建时间');\n $grid->updated_at('修改时间');\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Station());\n\n $grid->column('id', __('Id'));\n $grid->column('area.area_name', __(trans('admin.area_name')));\n $grid->column('station_code', __(trans('admin.station_code')));\n $grid->column('station_name', __(trans('admin.station_name')));\n $grid->column('telno', __(trans('admin.telno')));\n $grid->column('order', __(trans('admin.order')));\n $grid->column('valid_at', __(trans('admin.valid_at')));\n $grid->column('mod_user', __(trans('admin.mod_user')));\n $grid->column('updated_at', __(trans('admin.updated_at')));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new GithubRepositories());\n\n $grid->column('id', __('Id'))->sortable();\n $grid->column('name', __('项目名'))->limit(20);\n $grid->column('full_name', __('项目全名'))->limit(40);\n $grid->column('description', __('简介'))->limit(60);\n// $grid->column('owner', __('作者资料'));\n $grid->column('html_url', __('网页地址'))->link();\n// $grid->column('original_data', __('原始数据'));\n $grid->column('created_at', __('创建时间'));\n// $grid->column('updated_at', __('更新时间'));\n\n //快捷搜索\n $grid->quickSearch('name', 'full_name', 'description');\n\n //倒叙\n $grid->model()->orderBy('id', 'desc');\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Product);\n\n $grid->column('id', __('Id'));\n $grid->column('type.name', __('分类名称'));\n $grid->column('recommend.name', __('推荐名称'));\n $grid->column('name', __('产品名称'));\n $grid->column('description', __('产品描述'));\n $states = [\n 'off' => ['value' => 0, 'text' => '否', 'color' => 'danger'],\n 'on' => ['value' => 1, 'text' => '是', 'color' => 'success'],\n ];\n $grid->column('pop', __('推荐'))->switch($states);\n $grid->column('logo','logo图')->display(function (){\n if ($this->logo){\n return '<div class=\"pop\"><img src='.env('APP_URl').'/uploads/'.$this->logo.' style=\"width:100px;height:100px;\"></div>';\n }else{\n return ;\n }\n });\n $grid->column('price', __('价格'));\n $grid->column('updated_at', __('更新时间'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Student);\n\n $grid->id('Id');\n $grid->surname('Фамилия');\n $grid->name('Имя');\n $grid->family_name('Отчество');\n $grid->telegram_id('Telegram-id');\n $grid->email('Email');\n $grid->number('Контактный телефон');\n $grid->groups_id('Группа')->using(Group::all()->pluck('name', 'id')->toArray());\n $grid->created_at('Создание записи');\n $grid->updated_at('Редактирование записи');\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Goods);\n $grid->id('ID')->sortable();\n $grid->name('名称');\n $grid->type('分类')->display(function($status) {\n $arr = (new AdminModel('goods_type'))->getAll('',['type','id']);\n foreach ($arr as $key => $value) {\n if($status==$value['id']) return $value['type']; \n }\n \n });\n $grid->cover('商品大图')->image('',70, 70);\n $grid->image('详情图')->image('',70, 70);\n $grid->stock('库存');\n $grid->price('积分价格');\n $grid->status('状态')->display(function($status) {\n if($status==1) return \"上架中\";\n if($status==0) return \"已下架\"; \n });\n $grid->disableExport();//禁用导出数据按钮\n $grid->filter(function ($filter) {\n $filter->disableIdFilter();//禁用查询过滤器\n });\n \n \n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new $this->currentModel);\n\n $grid->filter(function($filter){\n\n // 去掉默认的id过滤器\n //$filter->disableIdFilter();\n\n // 在这里添加字段过滤器\n $filter->like('title_designer_cn', '标题(设计师)');\n $filter->like('title_name_cn', '标题(项目名称)');\n $filter->like('title_intro_cn', '标题(项目介绍)');\n\n });\n\n $grid->id('ID')->sortable();\n $grid->title_designer_cn('标题(中)')->display(function () {\n return CurrentModel::formatTitle($this, 'cn');\n });\n $grid->title_designer_en('标题(英)')->display(function () {\n return CurrentModel::formatTitle($this, 'en');\n });\n $grid->article_status('状态')->display(function ($article_status) {\n switch ($article_status) {\n case '0' :\n $article_status = '草稿';\n break;\n case '1' :\n $article_status = '审核中';\n break;\n case '2' :\n $article_status = '已发布';\n break;\n }\n return $article_status;\n });\n $grid->release_time('发布时间')->sortable();\n \n // $grid->column('created_at', __('发布时间'));\n $grid->created_at('添加时间')->sortable();\n // $grid->column('updated_at', __('添加时间'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new WechatMessage);\n\n $grid->id('Id');\n $grid->msg_type('消息类型');\n $grid->media_id('素材id');\n $grid->title('标题');\n $grid->created_at('创建时间');\n $grid->updated_at('修改时间');\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new User());\n\n $grid->column('id', __('field.id'));\n $grid->column('name', __('Name'));\n $grid->column('email', __('Email'));\n $grid->column('email_verified_at', __('Email verified at'));\n $grid->column('password', __('Password'));\n $grid->column('remember_token', __('Remember token'));\n $grid->column('point', __('Point'));\n $grid->column('status', __('field.status'));\n $grid->column('created_at', __('field.created_at'));\n $grid->column('updated_at', __('field.updated_at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Product);\n $grid->model()->where('type',$this->getProductType())->orderBy('id','desc');\n //调用自定义的Grid\n\n $this->customGird($grid);\n $grid->actions(function ($actions) {\n $actions->disableView();\n $actions->disableDelete();\n });\n $grid->tools(function ($tools) {\n // 禁用批量删除按钮\n $tools->batch(function ($batch) {\n $batch->disableDelete();\n });\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new News);\n\n $grid->id('Id');\n $grid->title('题目');\n $grid->category_id('分类ID');\n // $grid->content('内容');\n $grid->thumbnail('封面图');\n $grid->status('状态');\n $grid->read_count('阅读数量');\n $grid->created_at('创建时间');\n $grid->updated_at('更新时间');\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new DbTop());\n $grid->header(function ($query) {\n $alread = DbTop::whereStatus(1)->count();\n $notyet = DbTop::whereStatus(0)->count();\n $notok = DbTop::whereStatus(2)->count();\n $pan = DbTop::where('pan_url', '<>', '')->count();\n $x = '已看:' . $alread . '<br />未看:' . $notyet . '<br />不感兴趣:' . $notok . '<br />资源:' . $pan;\n return '<div class=\"alert alert-success\" role=\"alert\">' . $x . '</div>';\n });\n $grid->column('no', __(trans('hhx.no')))->display(function ($no) {\n return 'No.' . $no;\n });\n $grid->column('img', __(trans('hhx.img')))->image();\n $grid->column('c_title', __(trans('hhx.c_title')))->display(function () {\n return $this->c_title . ' ' . $this->year;\n });\n $grid->column('rating_num', __(trans('hhx.rating_num')));\n $grid->column('inq', __(trans('hhx.inq')));\n $grid->column('actor', __(trans('hhx.actor')));\n $grid->column('type', __(trans('hhx.type')));\n $grid->column('status', __(trans('hhx.status')))->select(config('hhx.db_status'));\n $grid->filter(function ($filter) {\n $filter->like('c_title', '中文名');\n $filter->like('year', '年');\n $filter->like('status', trans('hhx.status'))->select(config('hhx.db_status'));\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Drug);\n\n $grid->id('ID');\n $grid->street_name('«Уличное» название');\n $grid->city('Город');\n $grid->column('photo_drug','Фотография наркотика')->display(function () {\n $photo = Photo::whereDrugId($this->id)->where('type', 0)->first();\n\n if ($photo) {\n return $photo->photo;\n } else {\n return '';\n }\n })->image();\n\n $grid->column('confirm', 'Подтверждение')->display(function ($confirm) {\n if ($confirm) {\n return '✅Подтверждено';\n } else {\n return '❌Не подтверждено';\n }\n });\n $grid->updated_at('Дата изменения');\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Profile());\n\n $grid->column('id', __('ID'))->sortable();\n $grid->column('name', __('ID'))->sortable();\n $grid->column('surname', __('ID'))->sortable();\n $grid->column('created_at', __('Created at'));\n $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new ProductSku);\n\n $grid->column('id', 'ID');\n $grid->column('name', 'sku名称')->editable();\n $grid->column('sku_number', 'sku编号')->editable();\n // $grid->column('description', 'sku描述');\n $grid->product(\"所属商品\")->display(function ($product) {\n return $product['name'];\n });\n $grid->column('price', '原价')->editable();\n $grid->column('stock', '库存量')->editable();\n $grid->column('is_on_sale', '是否上架')->using([0 => '否', 1 => '是']);\n $grid->column('primary_picture', '商品主图');\n $grid->column('retail_price', '零售价格')->editable();\n $grid->column('is_promotion', '是否促销')->using([0 => '否', 1 => '是']);\n $grid->column('promotion_price', '促销价格')->editable();\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Leavetime());\n $grid->filter(function ($filter) {\n $filter->like('designer.name', '设计师');\n $filter->between('created_at','创建时间')->datetime();\n });\n $grid->column('id', __('Id'));\n $grid->column('designer.name', __('设计师'));\n $grid->column('type', __('请假类型'))->display(function ($value) {\n return $value ? '半天' : '全天';\n });\n $grid->column('date', __('请假日期'));\n $grid->column('time', __('时间段'))->display(function ($time) {\n $html = '';\n foreach ($time as $k => $value){\n $work = Worktime::where('id','=',$value)->first();\n if($work){\n $html .= \"<span class='label label-success' style='margin-left: 10px'>{$work['time']}</span>\";\n }else{\n $html = '';\n }\n\n }\n return $html;\n });\n $grid->column('created_at', __('创建日期'));\n $grid->actions(function ($actions) {\n $actions->disableView();\n //$actions->disableDelete();\n });\n $grid->tools(function ($tools) {\n // 禁用批量删除按钮\n $tools->batch(function ($batch) {\n $batch->disableDelete();\n });\n });\n $grid->model()->orderBy('id', 'desc');\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new ProductSku());\n\n $grid->column('id', __('Id'));\n $grid->column('product', __('产品'))->display(function ($product){\n return $product['title'];\n });\n $grid->column('title', __('Title'));\n $grid->column('description', __('Description'));\n $grid->column('price', __('Price'));\n $grid->column('stock', __('Stock'));\n $grid->column('options', __('sku规格'))->display(function ($options){\n if (count($options) > 0){\n $strOption = '';\n foreach ($options as $option) {\n $strOption .= \"<p>{$option['product_property_name']}:{$option['product_property_value']}</p>\";\n }\n return $strOption;\n }\n return '';\n });\n\n $grid->column('created_at', __('Created at'));\n $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Order);\n // 只展示已支付的订单,并且默认按支付时间倒序排序\n $grid->model()->whereNotNull('paid_at')->orderBy('paid_at', 'desc');\n\n $grid->no('订单流水号');\n //展示关联关系的字段时,使用column方法\n $grid->column('user.name','买家');\n $grid->total_amount('总金额')->sortable();\n $grid->paid_at('支付时间')->sortable();\n $grid->ship_status('物流')->display(function($value) {\n return Order::$shipStatusMap[$value];\n });\n $grid->refund_status('退款状态')->display(function($value) {\n return Order::$refundStatusMap[$value];\n });\n // 禁用创建按钮,后台不需要创建订单\n $grid->disableCreateButton();\n $grid->actions(function ($actions) {\n // 禁用删除和编辑按钮\n $actions->disableDelete();\n $actions->disableEdit();\n });\n $grid->tools(function ($tools) {\n // 禁用批量删除按钮\n $tools->batch(function ($batch) {\n $batch->disableDelete();\n });\n });\n// return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new SkuModel);\n\n $grid->column('s_id', __('skuid'));\n $grid->column('sku_num', __('编号'));\n $grid->column('goods_id', __('商品id'));\n $grid->column('sku_name', __('sku名称'));\n $grid->column('sku_price', __('Sku价格'));\n $grid->column('sku_goods_repertory', __('库存'));\n $grid->column('sku_goods_img', __('照片'))->image();\n $grid->column('created_at', __('添加时间'));\n $grid->column('updated_at', __('修改时间'));\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new StockProduct);\n\n $grid->column('id', __('Id'));\n // $grid->column('product_id', __('Product id'))->modal('Product Name', function($model){\n // $products = $model->product()->get()->map(function($product) {\n // return $product->only('id','product_name');\n // });\n // return new Table(['ID', 'Product Name'], $products->toArray());\n // });\n $grid->column('product.product_name', __('Name'));\n $grid->column('moq', __('Moq'));\n $grid->column('quantity', __('Quantity'));\n $grid->column('price', __('Price'));\n $grid->column('note', __('Note'));\n $grid->column('created_at', __('Created at'));\n $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Project());\n $grid->model()->orderBy('id', 'desc');\n $grid->id('ID')->sortable();\n $grid->name('项目名称')->editable();\n $grid->url('项目地址')->link();\n $grid->username('账号');\n $grid->password('密码');\n $status = [\n 'on' => ['value' => 1, 'text' => '启用', 'color' => 'success'],\n 'off' => ['value' => 0, 'text' => '禁用', 'color' => 'danger'],\n ];\n $grid->status('状态')->switch($status);\n $grid->created_at('创建时间');\n $grid->actions(function ($actions) {\n $actions->disableView();\n });\n $grid->disableFilter();\n $grid->disableExport();\n $grid->disableRowSelector();\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Subscribe());\n $grid->column('number', __('商品编号'));\n $grid->column('name', __('商品名称'));\n $grid->column('subtitle', __('商品副标题'));\n $grid->column('price', __('单价'));\n $grid->column('quantity', __('库存'));\n $grid->column('type', __('分类'));\n $grid->column('status', __('状态'));\n $grid->column('recommend', __('推荐'));\n $grid->column('sold', __('总售量'));\n $grid->column('integral', __('返还碳积分'));\n $grid->column('emission', __('返还碳减排'));\n $grid->column('place', __('地点'));\n $grid->column('maintenance', __('养护'));\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new GroupTask());\n $grid->column('name', __('messages.name'));\n $grid->column('active', __('messages.active'))->switch();\n $grid->column('sort', __('messages.sort'))->editable();\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new HotRank());\n\n// $grid->column('id', __('Id'));\n $grid->column('sort', __('排序'))->editable();\n $grid->column('nickname', __('昵称'));\n $grid->column('avatar', __('头像'))->image();\n $grid->column('gender', __('性别'))->using([\n 1 => '男',\n 2 => '女'\n ]);\n// $grid->column('role', __('Role'));\n// $grid->column('intro', __('Intro'));\n $grid->column('fans', __('粉丝数'));\n $grid->column('red_book_link', __('小红书链接'));\n $grid->column('red_book_fans', __('小红书粉丝'));\n $grid->column('douyin_link', __('抖音链接'));\n $grid->column('douyin_fans', __('抖音粉丝'));\n $grid->column('created_at', __('创建时间'));\n $grid->actions(function ($actions) use ($grid) {\n // 去掉删除\n// $actions->disableDelete();\n// // 去掉编辑\n// $actions->disableEdit();\n // 去掉查看\n $actions->disableView();\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new TaskOrder);\n $grid->model()->orderBy('id', 'desc');\n $grid->filter(function($filter){\n $filter->disableIdFilter();\n $filter->equal('eid','快递单号')->integer();\n $filter->equal('store','快递网点')->select(storedatas(1));\n $filter->equal('etype','快递公司')->select(edatas());\n $filter->equal('sname','客服名称');\n $filter->between('created_at', '导入时间')->datetime();\n });\n $grid->id('ID');\n $grid->eid('快递单号');\n $grid->sname('客服名称');\n $grid->store('快递网点');\n $grid->etype('快递公司');\n\n $grid->created_at('分配时间');\n //$grid->updated_at('分配时间');\n $excel = new ExcelExpoter();\n $excel->setAttr([ '快递单号','快递网点','快递公司','负责客服','导入时间'], ['eid','store','etype','sname','created_at']);\n $grid->exporter($excel);\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new AnswerList);\n\n $grid->column('id', __('Id'))->sortable();\n $grid->column('title', trans('admin.title_answer'))->width(500);\n $grid->column('A', trans('admin.A'))->width(150);\n $grid->column('B', trans('admin.B'))->width(150);\n $grid->column('C', trans('admin.C'))->width(150);\n $grid->column('D', trans('admin.D'))->width(150);\n $grid->column('correct', trans('admin.correct'))->width(100);\n $grid->column('status', trans('admin.status'))->using(AnswerList::STATUSES)->label(['warning', 'primary']);\n $grid->column('created_at', trans('admin.created_at'));\n $grid->column('updated_at', trans('admin.updated_at'));\n\n $grid->filter(function ($filter){\n $filter->disableIdFilter();\n $filter->column(1 / 2, function ($filter) {\n $filter->equal('id', __('Id'));\n });\n $filter->column(1 / 2, function ($filter) {\n $filter->like('title', trans('admin.title'));\n });\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new userWhitelist());\n $grid->filter(function ($filter) {\n $filter->disableIdFilter();\n $filter->like('accountName', ___('accountName'));\n });\n $grid->column('id', ___('Id'));\n $grid->column('accountId', ___('AccountId'));\n $grid->column('accountName', ___('AccountName'));\n $grid->column('nickName', ___('NickName'));\n\n return $grid;\n }", "protected function grid()\n {\n $Adv=new Adv();\n $grid = new Grid($Adv);\n\n $platform= $Adv->platform;\n $type= $Adv->type;\n $status= $Adv->status;\n\n $list_array=[\n array(\"field\"=>\"title\",\"title\"=>\"标题\",\"type\"=>\"value\"),\n array(\"field\"=>\"platform\",\"title\"=>\"平台\",\"type\"=>\"array\",\"array\"=>$platform),\n array(\"field\"=>\"type\",\"title\"=>\"类型\",\"type\"=>\"array\",\"array\"=>$type),\n array(\"field\"=>\"image\",\"title\"=>\"图片\",\"type\"=>\"image\"),\n array(\"field\"=>\"start_time\",\"title\"=>\"活动开始时间\",\"type\"=>\"value\"),\n array(\"field\"=>\"end_time\",\"title\"=>\"活动结束时间\",\"type\"=>\"value\"),\n array(\"field\"=>\"status\",\"title\"=>\"状态\",\"type\"=>\"array\",\"array\"=>$status),\n array(\"field\"=>\"created_at\",\"title\"=>\"创建时间\",\"type\"=>\"value\")\n ];\n BaseControllers::setlist_show($grid,$list_array);\n\n $grid->filter(function($filter) use($platform,$type){\n // 去掉默认的id过滤器\n $filter->disableIdFilter();\n\n $filter->in('platform', \"平台\")->multipleSelect($platform);\n $filter->in('type', \"类型\")->multipleSelect($type);\n });\n return $grid;\n }" ]
[ "0.72541326", "0.7218252", "0.7064843", "0.70040804", "0.6995721", "0.69847125", "0.695367", "0.6928443", "0.6927314", "0.69256824", "0.6923453", "0.69233567", "0.6922796", "0.6907988", "0.6889554", "0.6888196", "0.6878719", "0.6845261", "0.68254143", "0.6818076", "0.6810526", "0.6801908", "0.68007404", "0.6792371", "0.67900723", "0.6785066", "0.67814827", "0.67809147", "0.6773841", "0.67679495", "0.6767842", "0.67664576", "0.67600983", "0.6759144", "0.6747873", "0.67451704", "0.6735288", "0.6732706", "0.6727944", "0.6718374", "0.6718129", "0.67142314", "0.6713679", "0.67077774", "0.66969377", "0.66829485", "0.6681708", "0.66795236", "0.66743", "0.6665543", "0.66581196", "0.6655195", "0.6648576", "0.6647211", "0.6639091", "0.6634314", "0.66231555", "0.6622456", "0.6605076", "0.6601071", "0.6595906", "0.6595102", "0.6593814", "0.65931946", "0.6590833", "0.65907514", "0.65832734", "0.657433", "0.6573453", "0.65642095", "0.65639156", "0.655778", "0.65577185", "0.6556319", "0.6553949", "0.6552593", "0.6549884", "0.6542962", "0.65393496", "0.65337956", "0.6528965", "0.6526889", "0.65218806", "0.650997", "0.6508564", "0.65050364", "0.6498207", "0.6491189", "0.647587", "0.6474169", "0.6469046", "0.6464774", "0.6463954", "0.64510244", "0.6450445", "0.6450348", "0.64481837", "0.64450586", "0.6444865", "0.6443929", "0.64308834" ]
0.0
-1
Make a form builder.
protected function form() { return Admin::form(ThreeTotalRecord::class, function (Form $form) { $form->display('id', 'ID'); $form->display('created_at', 'Created At'); $form->display('updated_at', 'Updated At'); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function form_builder()\n {\n // ToDo run checks when form is being created, please.\n// if(!empty($this->check())):\n// throw new ValidationError(checks_html_output($this->check()));\n//\n// endif;\n\n return new form\\ModelForm($this, $this->_field_values());\n }", "private function createForm()\n\t{\n\t\t$builder = $this->getService('form')->create();\n\t\t$builder->setValidatorService($this->getService('validator'));\n\t\t$builder->setFormatter(new BasicFormFormatter());\n\t\t$builder->setDesigner(new DoctrineDesigner($this->getDoctrine(), 'Entity\\User',array('location')));\n\n\t\t$builder->getField('location')->setRequired(true);\n\t\t$builder->submit($this->getRequest());\n\n\t\treturn $builder;\n\t}", "public function setFormFieldBuilder(FormFieldBuilder $form_field_builder): Form;", "public function setFormBuilder(FormBuilder $form_builder): Form;", "public function getFormFieldBuilder(): FormFieldBuilder;", "protected function form()\n {\n $form = new Form(new Banner);\n\n $form->text('title', 'Title');\n $form->image('image', 'Image')->rules('required')->move('images/banners');\n $form->switch('status', 'Published')->default(1);\n\n $form->footer(function ($footer) {\n // disable `View` checkbox\n $footer->disableViewCheck();\n\n // disable `Continue editing` checkbox\n $footer->disableEditingCheck();\n\n // disable `Continue Creating` checkbox\n $footer->disableCreatingCheck();\n\n });\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Activity());\n\n $form->text('name', __('Name'));\n $form->image('image', __('Image'));\n $form->text('intro', __('Intro'));\n $form->UEditor('details', __('Details'));\n $form->datetime('start_at', __('Start at'))->default(date('Y-m-d H:i:s'));\n $form->datetime('end_at', __('End at'))->default(date('Y-m-d H:i:s'));\n $form->text('location', __('Location'));\n $form->decimal('fee', __('Fee'))->default(0.00);\n $form->number('involves', __('Involves'));\n $form->number('involves_min', __('Involves min'));\n $form->number('involves_max', __('Involves max'));\n $form->switch('status', __('Status'));\n $form->text('organizers', __('Organizers'));\n $form->number('views', __('Views'));\n $form->switch('is_stick', __('Is stick'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Activity);\n\n $form->text('log_name', 'Log name');\n $form->textarea('description', 'Description');\n $form->number('subject_id', 'Subject id');\n $form->text('subject_type', 'Subject type');\n $form->number('causer_id', 'Causer id');\n $form->text('causer_type', 'Causer type');\n $form->text('properties', 'Properties');\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Activity());\n\n $form->text('log_name', __('Log name'));\n $form->text('description', __('Description'));\n $form->number('subject_id', __('Subject id'));\n $form->text('subject_type', __('Subject type'));\n $form->number('causer_id', __('Causer id'));\n $form->text('causer_type', __('Causer type'));\n $form->textarea('properties', __('Properties'));\n\n return $form;\n }", "public function getFormBuilder()\n {\n $this->formOptions['data_class'] = $this->getClass();\n\n $this->formOptions['allow_extra_fields'] = true;\n $this->formOptions['validation_groups'] = false;\n $this->formOptions['error_bubbling'] = false;\n\n $formBuilder = $this->getFormContractor()->getFormBuilder(\n $this->getUniqid(),\n $this->formOptions\n );\n\n $this->defineFormBuilder($formBuilder);\n\n return $formBuilder;\n }", "protected function form()\n {\n $form = new Form(new Book());\n\n $form->select('author_id', __('Author id'))\n ->options(collect(Author::all())->mapWithKeys(function ($v){\n return [$v->id => $v->name];\n }));\n\n $form->text('title', __('Title'));\n $form->textarea('description', __('Description'));\n $form->text('year', __('Year'));\n\n return $form;\n }", "function store_form($model = null, $prefix = null)\n {\n return new FormBuilder($model, $prefix);\n }", "protected function form()\n {\n $form = new Form(new Resources);\n\n $form->text('name', '名称')->rules('required',['required' => '请输入 配置项的名称']);\n\n $form->radio('type', '类型')->options(Resources::TYPE);\n\n $form->cropper('url','图片');\n\n $form->number('sort_num','排序');\n\n $form->textarea('memo','备注');\n\n $form->tools(function (Form\\Tools $tools) {\n // 去掉`删除`按钮\n $tools->disableDelete();\n\n // 去掉`查看`按钮\n $tools->disableView();\n });\n $form->footer(function ($footer) {\n // 去掉`查看`checkbox\n $footer->disableViewCheck();\n\n // 去掉`继续编辑`checkbox\n $footer->disableEditingCheck();\n\n // 去掉`继续创建`checkbox\n $footer->disableCreatingCheck();\n\n });\n\n return $form;\n }", "public function create() {\r\n\t\r\n\t$form = new Form();\r\n\t$form->setTranslator($this->translator);\r\n\treturn $form;\r\n }", "protected function form()\n {\n $form = new Form(new GuestBook);\n\n $form->textarea('body', __('Body'));\n $form->number('user_id', __('User id'));\n $form->number('guest_id', __('Guest id'));\n $form->number('guest_book_id', __('Guest book id'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new BorrowComment);\n\n $form->text('shared_book_name', __('Shared book name'));\n $form->text('student_name', __('Student name'));\n $form->image('student_avatar', __('Student avatar'));\n $form->textarea('content', __('Content'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Gys);\n\n $form->text('name', 'Name');\n $form->text('tel', 'Tel');\n $form->textarea('file', 'File');\n $form->number('type', 'Type');\n $form->text('username', 'Username');\n $form->password('password', 'Password');\n $form->number('status', 'Status');\n // 在表单提交前调用\n $form->saving(function (Form $form) {\n if ($form->password && $form->model()->password != $form->password) {\n $form->password = bcrypt($form->password);\n }\n });\n return $form;\n }", "protected function form()\n {\n $form = new Form(new LotteryCode());\n\n $form->text('code', __('Code'));\n $form->number('batch_num', __('Batch num'));\n $form->text('prizes_name', __('Prizes name'));\n $form->datetime('valid_period', __('Valid period'))->default(date('Y-m-d H:i:s'));\n $form->datetime('prizes_time', __('Prizes time'))->default(date('Y-m-d H:i:s'));\n $form->text('operator', __('Operator'));\n $form->switch('award_status', __('Award status'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new BoxOrder);\n\n\n return $form;\n }", "protected function createForm()\n {\n if (!$this->form) {\n $this->form = new \\Gems_Form(array('class' => 'form-horizontal', 'role' => 'form'));\n $this->mailElements->setForm($this->form);\n }\n return $this->form;\n }", "protected function form()\n {\n $form = new Form(new Goodss);\n $form->switch('is_enable','状态')->options([\n 'on' => ['value' => 1, 'text' => '正常', 'color' => 'primary'],\n 'off' => ['value' => 0, 'text' => '禁止', 'color' => 'default'],\n ]);\n $form->tools(function (Form\\Tools $tools) {\n // 去掉`删除`按钮\n $tools->disableDelete();\n // 去掉`查看`按钮\n $tools->disableView();\n });\n $form->footer(function ($footer) {\n\n // 去掉`重置`按钮\n //$footer->disableReset();\n\n // 去掉`提交`按钮\n //$footer->disableSubmit();\n\n // 去掉`查看`checkbox\n $footer->disableViewCheck();\n\n // 去掉`继续编辑`checkbox\n $footer->disableEditingCheck();\n\n // 去掉`继续创建`checkbox\n $footer->disableCreatingCheck();\n\n });\n return $form;\n }", "public function builder(FormInterface $form)\n {\n return $this->dispatch(new GetStandardFormBuilder($form));\n }", "protected function form()\n {\n $form = new Form(new Blog());\n\n $form->text('title', __('Title'));\n $form->text('sub_title', __('Sub title'));\n $form->text('tag', __('Tag'));\n $form->textarea('body', __('Body'));\n $form->text('posted_by', __('Posted by'));\n $form->datetime('posted_at', __('Posted at'))->default(date('Y-m-d H:i:s'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Cate());\n\n $form->text('name', __('Name'));\n $form->url('link', __('Link'));\n $form->text('thumb', __('Thumb'));\n $form->switch('status', __('Status'));\n $form->number('sort', __('Sort'));\n $form->datetime('createtime', __('Createtime'))->default(date('Y-m-d H:i:s'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Barang());\n\n $form->text('nama', __('Nama'));\n $form->currency('harga', __('Harga Beli'))->symbol('Rp');\n $form->currency('harga_jual', __('Harga Jual'))->symbol('Rp');\n $form->select('satuan_id', __('Satuan id'))->options(\n Satuan::get()->pluck('nama', 'id')\n );\n $form->number('jumlah_unit', __('Jumlah Unit'));\n $form->select('parent_id', 'Parent Barang')->options(\n Barang::where('satuan_id', 1)->get()->pluck('nama', 'id')\n );\n $form->currency('b_pengiriman', __('Pengiriman'))->symbol('Rp');\n $form->currency('b_keamanan', __('Keamanan'))->symbol('Rp');\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Formulario());\n\n $form->text('name', 'Nombre')\n ->required()\n ->creationRules(['required', \"unique:formularios\"])\n ->updateRules(['required', \"unique:formularios,name,{{id}}\"]);\n $form->text('description', 'Descripción');\n\n $fields = Field::all()->pluck('name', 'id')->toArray();\n $form->multipleSelect('fields', 'Campos')->options($fields);\n\n $forms = Formulario::all()->pluck('name', 'id')->toArray();\n $form->select('go_to_formulario', 'Continuar a formulario')->options($forms);\n\n $form->divider('Quiénes tienen acceso a este Formulario?');\n\n $permissions = Permission::all()->pluck('name', 'id')->toArray();\n $form->multipleSelect('permissions', 'Permisos')->options($permissions);\n\n $roles = Role::all()->pluck('name', 'id')->toArray();\n $form->multipleSelect('roles', 'Roles')->options($roles);\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Config);\n\n $form->text('key', '配置项')->readOnly();\n\n $form->text('value', '值');\n\n $form->text('desc', '描述');\n\n $form->tools(function(Form\\Tools $tools) {\n $tools->disableView();\n });\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new User());\n\n $form->mobile('phone', __('手机号'));\n $form->text('uname', __('姓名'));\n $form->text('wechat', __('微信号'));\n $form->text('phonenumber', __('联系电话'));\n $form->text('position', __('岗位'));\n $form->text('company', __('公司'));\n $form->switch('role', __('角色'));\n $form->switch('state', __('核实状态'));\n $form->datetime('create_date', __('创建时间'))->default(date('Y-m-d H:i:s'));\n // $form->text('openid', __('Openid'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new CompanyCulture());\n\n $form->text('name', '企业名称')->rules('required');\n $form->text('en_name', '企业名称(en)')->rules('required');\n $form->image('image_url', '图片')->rules('required|image');\n $form->editor('content', '内容')->rules('required');\n\n $form->tools(function (Form\\Tools $tools) {\n // 去掉`列表`按钮\n $tools->disableList();\n // 去掉`删除`按钮\n $tools->disableDelete();\n // 去掉`查看`按钮\n $tools->disableView();\n });\n\n\n $form->footer(function ($footer) {\n // 去掉`查看`checkbox\n $footer->disableViewCheck();\n // 去掉`继续编辑`checkbox\n $footer->disableEditingCheck();\n // 去掉`继续创建`checkbox\n $footer->disableCreatingCheck();\n });\n\n return $form;\n }", "private function makeform() {\n\tglobal $qqi;\n\t\n\t$form=new llform($this,'form');\n\t$form->addFieldset('d','');\n\t$form->addControl('d',new ll_listbox($form,'users','Users'));\n\t$form->addControl('d',new ll_button($form,'allusers','Select All','button'));\n\t$form->addControl('d',new ll_listbox($form,'functions','Functions'));\n\t$form->addControl('d',new ll_button($form,'allfunctions','Select All','button'));\n\t$rg=new ll_radiogroup($form,'showby');\n\t\t$rg->addOption('byusers','Rows of Users');\n\t\t$rg->addOption('byfunctions','Rows of Functions');\n\t\t$rg->setValue('byfunctions');\n\t$form->addControl('d',$rg);\t\n\t$form->addControl('d',new ll_button($form,'update','Update Display','button'));\n\treturn $form;\n}", "public static function builder() {\n\t\treturn new Builder();\n\t}", "protected function form()\n {\n $form = new Form(new SiteHelp);\n\n $form->select('site_help_category_id', __('site-help::help.site_help_category_id'))\n ->options(SiteHelpCategory::pluck('name', 'id'));\n $form->text('title', __('site-help::help.title'));\n $form->number('useful', __('site-help::help.useful'))->default(0);\n $form->textarea('desc', __('site-help::help.desc'));\n $form->image('thumbnail', __('site-help::help.thumbnail'))\n ->removable()\n ->uniqueName()\n ->move('site-help');\n $form->UEditor('content', __('site-help::help.content'));\n $form->select('status', __('site-help::help.status.label'))\n ->default(1)\n ->options(__('site-help::help.status.value'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Site);\n\n $form->select('category_id', '分类')->options(SiteCategory::selectOptions(null, ''))->rules('required');\n $form->text('title', '标题')->attribute('autocomplete', 'off')->rules('required|max:50');\n $form->image('thumb', '图标')->resize(120, 120)->uniqueName();\n $form->text('describe', '描述')->attribute('autocomplete', 'off')->rules('required|max:300');\n $form->url('url', '地址')->attribute('autocomplete', 'off')->rules('required|max:250');\n $this->disableFormFooter($form);\n return $form;\n }", "public function builder()\n\t{\n\t\t$builder = new Builder($this->request);\n\t\treturn $builder;\n\t}", "protected function form()\n {\n $form = new Form(new Code());\n\n $form->mobile('phone', __('Phone'));\n $form->number('code', __('Code'));\n $form->ip('ip', __('IP'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Terrace());\n\n $form->image('image', __('平台图片'))->rules('required', ['required' => '平台图片不能为空']);\n $form->text('name', __('平台名称'))->rules('required', ['required' => '平台名称不能为空']);\n $form->text('path', __('外链'))->rules('required', ['required' => '平台外链不能为空']);\n $form->text('notice_info', __('提示语'))->rules('required', ['required' => '平台提示语不能为空']);\n $form->radio('status','状态')->options(['1' => '未推荐', '2'=> '已推荐'])->default(1);\n\n return $form;\n }", "public function buildForm()\n {\n }", "protected function form()\n {\n $this->opt();\n $form = new Form(new ComDep);\n\n $form->text('alias', 'Alias');\n $form->text('name', 'Name');\n $form->select('company_id', 'Company')->options($this->optcom);\n $form->select('id_com_dep_admin', 'Company department admin')->options($this->optcomdep);\n $form->select('service_type_id', 'Service type')->options($this->optsertype);\n $form->textarea('info', 'Info');\n $form->textarea('info_for_vp_admin', 'Info for vp admin');\n $form->text('address', 'Address');\n $form->textarea('info_station', 'Info station');\n $form->text('telephone', 'Telephone');\n $form->text('e_mail', 'E mail');\n $form->text('class', 'Class');$form->saving(function (Form $form) {\n $form->model()->id_admin_add=Admin::user()->id;\n });\n\n return $form;\n }", "abstract function builder_form(): string;", "public function toForm(){\n return $this->form_builder()->form();\n }", "public function build() { $this->form_built = TRUE; return $this; }", "public function getFormBuilder()\n {\n return $this['form.factory'];\n }", "public static function builder();", "protected function form()\n {\n $form = new Form(new Order);\n\n\n\n return $form;\n }", "protected function buildForm()\n {\n $this->form = Yii::createObject(array_merge([\n 'scenario' => $this->scenario,\n 'parent_id' => $this->parent_id,\n 'parentTariff' => $this->parentTariff,\n 'tariff' => $this->tariff,\n ], $this->getFormOptions()));\n }", "protected function form()\n {\n $form = new Form(new Cases);\n\n $form->select('cate_id', '分类')->options('/admin/api/getcasecate');\n $form->select('algw_id', '顾问')->options('/admin/api/getgw');\n $form->text('title', '标题');\n $form->text('keywords', 'SEO关键字');\n $form->text('description', 'SEO描述');\n $form->text('desc', '副标题');\n $form->text('author', '来源');\n $form->radio('is_tj', '推荐')->options([0=>'否',1=>'是']);\n $form->image('thumb', '缩略图')->uniqueName();\n $form->editor('data', '详情');\n\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new WechatUser);\n\n $form->text('nick_name', __('昵称'));\n $form->text('name', __('用户名'));\n $form->password('password', __('密码'));\n $form->mobile('mobile', __('手机号'));\n $form->text('mini_program_open_id', __('OpenId'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Goods);\n\n $form->text('title', trans('admin.title'))->required()->rules('required');\n $form->text('slogan', trans('admin.slogan'))->required()->rules('required');\n $form->text('name', trans('admin.name'))->required()->rules('required');\n $form->decimal('price', trans('admin.price'))->required()->rules('required');\n $form->display('created_at', trans('admin.created_at'));\n $form->display('updated_at', trans('admin.updated_at'));\n return $form;\n }", "public function createForm();", "public function createForm();", "protected function form()\n {\n $form = new Form(new BuSong);\n\n// $form->number('serialid', __('Serialid'));\n $form->text('svrkey', __('svrkey'));\n $form->text('songname', __('歌名'));\n $form->text('singer', __('歌星'));\n $form->select('langtype', __('语种'))->options([0=>'国语',1=>'粤语',2=>'英语',3=>'台语',4=>'日语',5=>'韩语',6=>'不详']);\n $form->text('remarks', __('备注'));\n $form->datetime('createdate', __('创建时间'))->default(date('Y-m-d H:i:s'));\n $form->select('ischeck', __('是否检查'))->options([0=>'否',1=>'是']);\n $form->select('buState', __('状态'))->options([0=>'新增',1=>'处理中',2=>'完成',3=>'歌曲信息出错',4=>'取消无法处理',5=>'已上传',6=>'彻底删除']);\n $form->text('musicdbpk', __('musicdbpk'));\n $form->text('optionRemarks', __('操作日志'));\n\n return $form;\n }", "protected function form()\n {\n return Form::make(new Liuchengku(), function (Form $form) {\n\t\t\t$form->display('id');\n\t\t\t$form->text('brand','品牌名称')->required();\n\t\t\t$form->tab('加盟流程', function (Form $form) {\n\t\t\t\t $form->textarea('jmlc','加盟流程')->rows(12);\n\t\t\t\t /* $form->editor('jmlc','加盟流程')->options([\n\t\t\t\t\t//'toolbar' => ['undo redo | styleselect | bold italic | link image',],\n\t\t\t\t\t'toolbar' => [],\n\t\t\t\t]); */\n\t\t\t\t})->tab('加盟支持', function (Form $form) {\n\t\t\t\t $form->editor('jmzc','加盟支持');\n\t\t\t\t})->tab('加盟优势', function (Form $form) {\n\t\t\t\t $form->editor('jmys','加盟优势');\n\t\t\t\t});\n //$form->text('type');\n //$form->text('retype');\n\t\t\t//$form->text('is_make');\n\t\t\t//$form->text('user_id');\n $form->hidden('user_id');\n\t\t\t$form->hidden('is_make');\n\t\t\t$form->display('created_at');\n $form->display('updated_at');\n $form->saving(function (Form $form) {\n if ($form->isCreating()) {\n $form->user_id=Admin::user()->id;\n\t\t\t\t\t$form->is_make=1;\n\t\t\t\t\t}\n });\n });\n }", "abstract public function createForm();", "abstract public function createForm();", "protected function form()\n {\n $form = new Form(new Direction());\n\n $form->text('name', __(trans('hhx.name')));\n $form->text('intro', __(trans('hhx.intro')));\n $form->image('Img', __(trans('hhx.img')))->move('daily/direction')->uniqueName();\n $form->select('status', __(trans('hhx.status')))->options(config('hhx.status'));;\n $form->number('order_num', __(trans('hhx.order_num')));\n $form->hidden('all_num', __(trans('hhx.all_num')))->default(0.00);\n $form->decimal('stock', __(trans('hhx.stock')));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Engine());\n\n $form->text('name', __('Name'))\n ->required();\n $form->select('power_station_id', __('Power station'))\n ->options(PowerStation::all()->pluck('name', 'id'))\n ->required();\n $form->image('photo', __('Photo'));\n $form->textarea('details', __('Details'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Dictionary());\n $form->disableViewCheck();\n $form->disableEditingCheck();\n $form->disableCreatingCheck();\n\n\n $form->select('type', __('Type'))->options(Dictionary::TYPES);\n $form->text('option', __('Title'))->required();\n $form->text('slug', __('Slug'))->rules('nullable|regex:/(\\w\\d\\_)*/', [\n 'regex' => 'Только латинские буквы и знаки подчеркивания',\n ]);\n $form->text('alternative', __('Alternative'));\n $form->switch('approved', __('Approved'))->default(1);\n $form->number('sort', __('Sort'));\n\n $form->saving(function (Form $form) {\n if ($form->slug === null) {\n $form->slug = Str::slug($form->option);\n }\n });\n return $form;\n }", "protected function buildForm()\n {\n $this->formBuilder\n ->add('host', 'text', array(\n 'data' => ElasticProduct::getConfigValue('host'),\n 'required' => false,\n 'attr' => ['placeholder' => 'localhost'],\n 'label' => Translator::getInstance()->trans('Host', array(), ElasticProduct::DOMAIN_NAME),\n 'label_attr' => array(\n 'for' => 'host'\n )\n ))\n ->add('port', 'text', array(\n 'data' => ElasticProduct::getConfigValue('port'),\n 'required' => false,\n 'attr' => ['placeholder' => '9200'],\n 'label' => Translator::getInstance()->trans('Port', array(), ElasticProduct::DOMAIN_NAME),\n 'label_attr' => array(\n 'for' => 'port'\n )\n ))\n ->add('username', 'text', array(\n 'data' => ElasticProduct::getConfigValue('username'),\n 'required' => false,\n 'label' => Translator::getInstance()->trans('Username', array(), ElasticProduct::DOMAIN_NAME),\n 'label_attr' => array(\n 'for' => 'username'\n )\n ))\n ->add('password', PasswordType::class, array(\n 'data' => ElasticProduct::getConfigValue('password'),\n 'required' => false,\n 'label' => Translator::getInstance()->trans('Password', array(), ElasticProduct::DOMAIN_NAME),\n 'label_attr' => array(\n 'for' => 'password'\n )\n ))\n ->add('index_prefix', 'text', array(\n 'data' => ElasticProduct::getConfigValue('index_prefix'),\n 'required' => false,\n 'attr' => ['placeholder' => 'my_website_name'],\n 'label' => Translator::getInstance()->trans('Index prefix', array(), ElasticProduct::DOMAIN_NAME),\n 'label_attr' => array(\n 'for' => 'index_prefix'\n )\n ));\n }", "protected function form()\n {\n $form = new Form(new Usertype());\n\n $form->text('usertype', '类型名称')->rules('required|max:10');\n $form->tools(function (Form\\Tools $tools) {\n $tools->disableList();\n $tools->disableDelete();\n $tools->disableView();\n });\n $form->footer(function ($footer) {\n $footer->disableReset();\n $footer->disableViewCheck();\n $footer->disableEditingCheck();\n $footer->disableCreatingCheck();\n });\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Category);\n\n $form->text('name', 'Имя');\n\n $form->textarea('text');\n\n $form->switch('status', 'Статус')->states([\n 'on' => ['value' => '1', 'text' => 'Публиковать', 'color' => 'success'],\n 'off' => ['value' => '0', 'text' => 'Не публиковать', 'color' => 'danger'],\n ]);\n\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Member);\n\n $form->text('open_id', 'Open id');\n $form->text('wx_open_id', 'Wx open id');\n $form->text('access_token', 'Access token');\n $form->number('expires', 'Expires');\n $form->text('refresh_token', 'Refresh token');\n $form->text('unionid', 'Unionid');\n $form->text('nickname', 'Nickname');\n $form->switch('subscribe', 'Subscribe');\n $form->switch('sex', 'Sex');\n $form->text('headimgurl', 'Headimgurl');\n $form->switch('disablle', 'Disablle');\n $form->number('time', 'Time');\n $form->mobile('phone', 'Phone');\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Enseignant());\n\n $form->text('matricule', __('Matricule'));\n $form->text('nom', __('Nom'));\n $form->text('postnom', __('Postnom'));\n $form->text('prenom', __('Prenom'));\n $form->text('sexe', __('Sexe'));\n $form->text('grade', __('Grade'));\n $form->text('fonction', __('Fonction'));\n\n return $form;\n }", "public function createBuilder();", "protected function form()\n {\n $form = new Form(new News);\n\n $form->text('title', '题目');\n // $form->number('category_id', '分类');\n $form->select('category_id','分类')->options('/api/admin_categories');\n // $form->textarea('content', 'Content');\n $form->ueditor('content','新闻内容')->rules('required');\n // $form->text('thumbnail', '封面图');\n $form->image('thumbnail', '封面图')->move('public/uploads/thunbnails');\n $form->number('status', '状态');\n $form->number('read_count', '阅读次数');\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Good);\n $form->text('name', __('名称'))->rules('required');\n $form->decimal('amount', __('价格'))->default(0.00)->rules('required');\n $form->text('unit', __('单位'))->rules('required');\n $form->image('list_img', __('缩略图(320*320)'))->creationRules('required');\n $form->hasMany('goodsimgs', __('轮播图(640*640)'),function(Form\\NestedForm $form){\n $form->image('img',__('轮播图'))->creationRules('required');\n });\n $form->kindeditor('describe', __('描述'));\n // 去掉`查看`checkbox\n $form->disableViewCheck();\n // 去掉`继续编辑`checkbox\n $form->disableEditingCheck();\n // 去掉`继续创建`checkbox\n $form->disableCreatingCheck();\n return $form;\n }", "static public function builder(): Builder\n {\n return new Builder;\n }", "protected function form()\n {\n $form = new Form(new Order());\n\n $form->switch('paid', __('Paid'));\n $form->datetime('reservation_expires', __('Reservation expires'))->default(date('Y-m-d H:i:s'));\n $form->decimal('price', __('Price'));\n\n $form->tools(function (Form\\Tools $tools) {\n $tools->disableView();\n });\n\n\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Customer);\n\n $form->text('code', '客户编号');\n $form->text('name', '客户名称');\n// $form->text('openid', '客户openid');\n $form->text('contactor', '联系人');\n $form->text('tel', '联系电话');\n $form->email('email', '邮箱');\n $form->text('address', '地址');\n $form->decimal('receivables', '应收账款数字')->default(0.00);\n $form->text('fax', '传真');\n $form->switch('is_delete', '是否删除');\n\n return $form;\n }", "protected function makeFormCreator()\n {\n if ($this->isTestMode()) {\n return null;\n }\n\n if (empty($this->formConfiguration)) {\n throw new BadMethodCallException(\n 'Please define the form configuration to use via $this->setFormConfiguration().', 1333293139\n );\n }\n\n \\tx_rnbase::load(\\tx_mkforms_forms_Factory::class);\n $form = \\tx_mkforms_forms_Factory::createForm(null);\n\n /**\n * Configuration instance for plugin data. Necessary for LABEL translation.\n *\n * @var \\tx_rnbase_configurations $pluginConfiguration\n */\n $pluginConfiguration = \\tx_rnbase::makeInstance(tx_rnbase_configurations::class);\n $pluginConfiguration->init($this->conf, $this->cObj, 'mkforms', 'mkforms');\n\n // Initialize the form from TypoScript data and provide configuration for the plugin.\n $form->initFromTs(\n $this, $this->formConfiguration,\n ($this->getObjectUid() > 0) ? $this->getObjectUid() : false,\n $pluginConfiguration, 'form.'\n );\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Specialization);\n\n $form->text('full_name', 'Полное найменование')->rules('required|max:255');\n $form->text('short_name', 'Краткое найменование')->rules('required|max:255');\n $form->text('code', 'Код специальности')->rules('nullable|max:100');\n $form->select('cathedra_id', 'Кафедра')->options(Cathedra::all()->pluck('name', 'id'))\n ->rules('required|numeric|exists:cathedras,id');\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Good);\n\n $form->hidden('group_id')->value(session('group_id'));\n $form->text('name', __('Наименование'));\n $form->text('size', __('Объем/кол-во'));\n $form->decimal('price', __('Цена'))->default(0);\n $form->image('file', 'Фото');\n\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Project());\n $form->text('name', '项目名称')->rules('required')->required();\n $form->url('url', '项目地址')->rules('required')->required();\n $form->text('username', '账号');\n $form->text('password', '密码');\n $status = [\n 'on' => ['value' => 1, 'text' => '启用', 'color' => 'success'],\n 'off' => ['value' => 2, 'text' => '禁用', 'color' => 'danger'],\n ];\n $form->switch('status', '状态')->states($status)->default(1);\n $form->tools(function (Form\\Tools $tools) {\n $tools->disableDelete();\n $tools->disableView();\n });\n $form->footer(function ($footer) {\n $footer->disableReset();\n $footer->disableViewCheck();\n $footer->disableEditingCheck();\n $footer->disableCreatingCheck();\n });\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Sections());\n\n $form->text('name', __('Nazwa'));\n $form->text('pageId', __('ID sekcji (w sensie HTML)'));\n $form->textarea('content', __('Zawartość'));\n $form->textarea('style', __('Style(CSS'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Order);\n\n $form->text('no', 'No');\n $form->number('user_id', 'User id');\n $form->textarea('address', 'Address');\n $form->decimal('total_amount', 'Total amount');\n $form->textarea('remark', 'Remark');\n $form->datetime('paid_at', 'Paid at')->default(date('Y-m-d H:i:s'));\n $form->text('payment_method', 'Payment method');\n $form->text('payment_no', 'Payment no');\n $form->text('refund_status', 'Refund status')->default('pending');\n $form->text('refund_no', 'Refund no');\n $form->switch('closed', 'Closed');\n $form->switch('reviewed', 'Reviewed');\n $form->text('ship_status', 'Ship status')->default('pending');\n $form->textarea('ship_data', 'Ship data');\n $form->textarea('extra', 'Extra');\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new TagModel);\n\n $form->text('tag_name', 'Tag name');\n $form->number('tag_id', 'Tag id');\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new GoodsModel);\n\n $form->select('cid', __('分类'))->options(CategoryModel::selectOptions());\n $form->text('goods_name', __('Goods name'));\n $form->image('goods_img', __('Goods img'));\n $form->textarea('content', __('Content'));\n $form->number('goods_pricing', __('Goods pricing'));\n $form->number('goods_price', __('Goods price'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Boarding()); \n \n $form->select('pet_id',__('Pet Name'))->options(Pet::all()->pluck('name','id'))->rules('required');\n $form->select('reservation_id',__('Reservation'))->options(Reservation::all()->pluck('date','id'))->rules('required');\n $form->select('cage_id',__('Available Cages'))->options(Cage::get()->where(\"availability\",\"Available\")->pluck('id','id'))->rules('required');\n $form->datetime('end_date', __('End date'))->default(date('Y-m-d H:i:s'))->rules('required');\n \n return $form; \n }", "protected function form()\n {\n $form = new Form(new UsersOpenclose);\n\n $form->text('srvkey', __('srvkey'));\n $form->text('KtvBoxid', __('机器码'));\n $form->datetime('opendate', __('开房时间'))->default(date('Y-m-d H:i:s'));\n $form->datetime('closedate', __('关房时间'))->default(date('Y-m-d H:i:s'));\n $form->select('feesmode', __('收费模式'))->options([0=>'非扫码收费',1=>'扫码收费']);\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Member());\n\n $form->text('open_id', __('微信openid'));\n $form->image('head', __('头像'));\n $form->text('nickname', __('昵称'));\n $form->mobile('mobile', __('手机号码'));\n $form->text('email', __('邮箱'));\n $form->text('name', __('姓名'));\n $form->text('weixin', __('微信号'));\n $form->text('qq', __('qq'));\n $form->text('city', __('所在城市'));\n $form->text('yidudian', __('易读点'));\n $form->text('integral', __('积分'));\n $form->text('balance', __('余额'));\n $states = [\n 'on' => ['value' => 1, 'text' => '正常', 'color' => 'success'],\n 'off' => ['value' => 0, 'text' => '冻结', 'color' => 'danger'],\n ];\n $form->switch('status', '是否使用')->states($states);\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Movie());\n\n $form->text('title', __('名字'));\n $form->number('director', __('导演'));\n $form->text('describe', __('简介'));\n $form->number('rate', __('评价'));\n $form->switch('released', __('是否上映'));\n $form->datetime('release_at', __('发行时间'))->default(date('Y-m-d H:i:s'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new RequestForConfirmation());\n\n $form->switch('status', __('Status'));\n $form->text('comment', __('Comment'));\n $form->select('user_id', __('User id'))->options(User::all()->pluck('name', 'id'))->required();\n $form->select('project_id', __('Project id'))->options(Project::all()->pluck('project_name', 'id'))->required();\n\n\n return $form;\n }", "public function create(): Form\n {\n $form = new Form();\n \n return $form;\n }", "protected function form()\n {\n $form = new Form(new $this->currentModel);\n \n $form->display('id', 'ID');\n $form->select('company_id', '公司名称')->options(Company::getSelectOptions());\n $form->text('project_name', '项目名称');\n $form->image('project_photo', '项目图片')->uniqueName()->move('public/photo/images/custom_thum/');\n $form->url('link_url', '项目链接');\n $form->radio('display', '公开度')->options(['0' => '公开', '-1'=> '保密'])->default('0');\n //$form->display('created_at', 'Created At');\n //$form->display('updated_at', 'Updated At');\n\n return $form;\n }", "public function buildForm()\n {\n $this\n ->add(\n 'new_organization_group',\n 'collection',\n [\n 'type' => 'form',\n 'options' => [\n 'class' => 'App\\SuperAdmin\\Forms\\OrganizationGroupInformation',\n 'label' => false,\n ]\n ]\n )\n ->add(\n 'group_admin_information',\n 'collection',\n [\n 'type' => 'form',\n 'options' => [\n 'class' => 'App\\SuperAdmin\\Forms\\GroupAdmin',\n 'label' => false,\n ]\n ]\n )\n ->addSaveButton();\n }", "protected function form()\n {\n $form = new Form(new Platform());\n\n $form->text('platform_number', __('Platform number'))\n ->creationRules(['required', 'max:30', 'unique:platforms'])\n ->updateRules(['required', 'max:30']);\n $form->text('platform_name', __('Platform name'))\n ->creationRules(['required', 'max:30', 'unique:platforms'])\n ->updateRules(['required', 'max:30']);\n\n $form->footer(function ($footer){\n $footer->disableEditingCheck();\n });\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new User);\n\n// $form->number('role_id', 'Role id');\n $form->text('name', 'Name');\n// $form->email('email', 'Email');\n// $form->image('avatar', 'Avatar')->default('users/default.png');\n// $form->password('password', 'Password');\n// $form->text('remember_token', 'Remember token');\n// $form->textarea('settings', 'Settings');\n $form->text('username', 'Username');\n// $form->text('access_token', 'Access token');\n// $form->text('no_hp', 'No hp');\n// $form->number('location_id', 'Location id');\n// $form->switch('gender', 'Gender')->default(1);\n\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Carousel);\n\n $form->select('carousel_category_id', __('carousel::carousel.carousel_category_id'))\n ->options(CarouselCategory::all()->pluck('name', 'id'));\n $form->text('title', __('carousel::carousel.title'));\n $form->text('url', __('carousel::carousel.url'));\n $form->image('img_src', __('carousel::carousel.img_src'))\n ->removable()\n ->uniqueName()\n ->move('carousel');\n $form->text('alt', __('carousel::carousel.alt'));\n $form->textarea('remark', __('carousel::carousel.remark'));\n $form->select('status', __('carousel::carousel.status.label'))\n ->default(1)\n ->options(__('carousel::carousel.status.value'));\n $form->datetime('start_time', __('carousel::carousel.start_time'))\n ->default(date('Y-m-d H:i:s'));\n $form->datetime('end_time', __('carousel::carousel.end_time'))\n ->default(date('Y-m-d H:i:s'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Setting());\n\n $form->decimal('member_fee', __('会员年费'))->required();\n $form->decimal('task_rate', __('任务佣金抽成比例'))->required()->help('将扣除对应比例,比例范围0-1');\n $form->tools(function (Form\\Tools $tools) {\n\n // 去掉`列表`按钮\n $tools->disableList();\n\n // 去掉`删除`按钮\n $tools->disableDelete();\n\n // 去掉`查看`按钮\n $tools->disableView();\n });\n\n $form->footer(function ($footer) {\n\n // 去掉`重置`按钮\n $footer->disableReset();\n\n // 去掉`查看`checkbox\n $footer->disableViewCheck();\n\n // 去掉`继续编辑`checkbox\n $footer->disableEditingCheck();\n\n // 去掉`继续创建`checkbox\n $footer->disableCreatingCheck();\n\n });\n\n //保存后回调\n $form->saved(function (Form $form) {\n $success = new MessageBag([\n 'title' => '提示',\n 'message' => '保存成功',\n ]);\n\n return back()->with(compact('success'));\n });\n return $form;\n }", "protected function form()\n {\n return new Form(new Attention);\n }", "protected function form()\n {\n $form = new Form(new Purchase());\n if ($form->isCreating()) {\n $form->select('consumer_id', \"客户\")->options(Consumer::all()->pluck('full_name', 'id'))->required();\n $form->select('house_id', \"购买房源\")->options(House::purchasable()->pluck('readable_name', 'id'))->required();\n }\n $form->datetime('started_at', \"生效日期\");\n $form->datetime('ended_at', \"结束日期\");\n $form->select('sell_type', \"出售方式\")->options(Purchase::$type)->required();\n $form->currency('price', \"成交价格\")->symbol('¥')->required();\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Drug);\n\n $form->text('street_name', '«Уличное» название');\n $form->text('city', 'Город');\n $form->text('active_substance', 'Активное вещество');\n $form->text('symbol', 'Символ');\n $form->text('state', 'Состояние');\n $form->text('color', 'Цвет');\n $form->text('inscription', 'Надпись');\n $form->text('shape', 'Форма');\n $form->text('weight', 'Вес таблетки');\n $form->text('weight_active', 'Вес действующего вещества');\n $form->text('description', 'Описание');\n $form->text('negative_effect', 'Негативный эффект');\n $form->switch('confirm', 'Подтверждение');\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Room);\n\n if ($form->isEditing())\n $form->display('id', 'ID');\n\n $form->text('name', 'Nama');\n $form->select('room_type_id', 'Tipe Ruangan')->options(function ($id) {\n return RoomType::all()->pluck('name', 'id');\n });\n $form->slider('max_people', 'Maksimal Orang')->options([\n 'min' => 1,\n 'max' => 100,\n 'from' => 20,\n 'postfix' => ' orang'\n ]);\n $form->radio('status', 'Status')->options(RoomStatus::asSelectArray())->stacked();\n $form->textarea('notes', 'Catatan');\n\n if ($form->isEditing()) {\n $form->display('created_at', trans('admin.created_at'));\n $form->display('updated_at', trans('admin.updated_at'));\n }\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new WechatEvent);\n\n $form->text('title', '事件标题')->help('起说明性作用');\n $form->text('key', 'Key')->default(md5(time()));\n $form->select('event', '事件类型')->options(WechatEvent::EVENTLIST);\n $form->text('method', '执行方法')->help('namespace\\\\class@method');\n $form->select('wechat_message_id', '消息')->options(WechatMessage::select('id', 'title')->pluck('title', 'id'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new User());\n\n $form->text('name', __('Name'));\n $form->email('email', __('Email'));\n $form->datetime('email_verified_at', __('Email verified at'))->default(date('Y-m-d H:i:s'));\n $form->password('password', __('Password'));\n $form->text('remember_token', __('Remember token'));\n $form->decimal('point', __('Point'))->default(0.000);\n $form->switch('status', __('field.status'));\n\n return $form;\n }", "public function builder()\n {\n return new Builder($this);\n }", "protected function form()\n {\n $form = new Form(new ThemePoster());\n\n $form->select('domain_id', __('domain_id'))->options(DomainConfig::getDomainMap())->rules('required');\n $form->radio('type', __('type'))->options(ThemePoster::getTypeMap())->when(1, function (Form $form){\n $form->select('type_id', __('type_id'))->options(array_merge(['0' => '总列表'], Product::getCategoryMap()->toArray()))->rules('required');\n\n })->when(2, function (Form $form){\n $form->select('type_id', __('type_id'))->options(array_merge(['0' => '总列表'], Article::getCategoryMap()))->rules('required');\n\n });\n $form->text('title', __('title'))->rules('required');\n $form->text('alt', __('alt'))->rules('required');\n $form->image('site', '图片尺寸 1600*300')\n ->uniqueName()\n ->rules('required|max:150')->resize(1600, 300);\n $form->url('link', __('link'));\n $form->switch('is_show', __('is_show'));\n\n return $form;\n }", "public function getBuilder();", "protected function form()\n {\n return Form::make(new Linkman(), function (Form $form) {\n $form->display('id');\n $form->text('name');\n $form->text('mobile')->saving(function ($value) {\n return (string) $value;\n });\n $form->text('gender');\n $form->text('birthday')->saving(function ($value) {\n return (string) $value;\n });\n $form->text('province_id');\n $form->text('city_id');\n $form->text('area_id');\n $form->text('address')->saving(function ($value) {\n return (string) $value;\n });\n $form->text('description');\n $form->text('nickname')->saving(function ($value) {\n return (string) $value;\n });\n \n $form->display('created_at');\n $form->display('updated_at');\n });\n }", "function buildForm(){\n\t\t# menampilkan form\n\t}", "protected function form()\n {\n\n $form = new Form(new Goods);\n\n //分类树形\n $cateTree = getTree(Category::all()->where('is_show',1)->toArray());\n $cate_map = [];\n foreach ($cateTree as $key => $value) {\n $cate_map[$value['id']] = str_repeat('&#12288;&#12288;',$value['level']).$value['title'];\n }\n\n $form->display('id', 'ID');\n $form->select('cate_id', '分类')->rules('required')->options($cate_map);\n $form->text('name', '商品')->rules('required')->attribute(['autocomplete' => 'off']);\n $form->textarea('remark', '备注');\n $states = [\n 'on' => ['value' => 1, 'text' => '是', 'color' => 'success'],\n 'off' => ['value' => 0, 'text' => '否', 'color' => 'danger'],\n ];\n $form->switch('is_valid',trans('admin.is_show'))->states($states)->default(1);\n $form->display('created_at', trans('admin.created_at'));\n $form->display('updated_at', trans('admin.updated_at'));\n $form->hidden('operated_admin_id')->value(Admin::user()->id);\n $form->hidden('hos_id')->value(session('hos_id'));\n\n\n $form->tools(function (Form\\Tools $tools) {\n // 去掉`删除`按钮\n $tools->disableDelete();\n // 去掉`查看`按钮\n $tools->disableView();\n });\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Posts);\n\n $form->text('title', 'Title');\n $form->text('content', 'Content');\n $form->text('video_url', 'Video url');\n $form->switch('status', '审核状态')->states( [ \n 'off' => ['value' => 0, 'text' => '禁止', 'color' => 'primary'],\n 'on' => ['value' => 1, 'text' => '通过', 'color' => 'default']\n ]);\n $form->number('content_type', 'Content type');\n $form->number('member_id', 'Member id');\n return $form;\n }" ]
[ "0.7876884", "0.7563207", "0.7518167", "0.7356229", "0.7287756", "0.7230112", "0.71921307", "0.7176219", "0.71556574", "0.71318495", "0.7072142", "0.70605636", "0.70538306", "0.70511967", "0.70281005", "0.70109546", "0.700963", "0.7000893", "0.699135", "0.6986861", "0.6979974", "0.6975677", "0.6967696", "0.69618577", "0.6958165", "0.6932718", "0.6931257", "0.69268525", "0.69261456", "0.6919133", "0.6898824", "0.6896308", "0.6895907", "0.68850464", "0.68820494", "0.68767923", "0.6873939", "0.6855952", "0.68555087", "0.684766", "0.6846724", "0.6843792", "0.683849", "0.6837029", "0.68360937", "0.6835654", "0.68338263", "0.68321586", "0.68261683", "0.68261683", "0.68253165", "0.6821316", "0.6811116", "0.6811116", "0.6809404", "0.68068945", "0.67969346", "0.6794034", "0.67930216", "0.67898595", "0.6786553", "0.6786533", "0.6780389", "0.6777887", "0.6768574", "0.6764771", "0.6762455", "0.6762416", "0.6759921", "0.6754496", "0.67458314", "0.6744613", "0.67419064", "0.6731701", "0.6729932", "0.6726232", "0.6722076", "0.6716024", "0.6714663", "0.6714286", "0.6714119", "0.6712684", "0.67061925", "0.67027384", "0.6702656", "0.66966575", "0.66858375", "0.6681371", "0.66798395", "0.6678209", "0.6674076", "0.6670792", "0.66697335", "0.6669309", "0.6668735", "0.66635114", "0.6654671", "0.6648014", "0.66414875", "0.6639264", "0.66366684" ]
0.0
-1
get id in module plus add questions
function get($id) { $data['module'] = $this->model_module->get_module('id', $id); $data['data_questions'] = $this->model_module->question_query($id); // response_json($data); $this->load->view('layouts/header'); $this->load->view('_partalis/navigation'); $this->load->view('modules/index', $data); $this->load->view('layouts/footer'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_id_question()\n\t{\n\t\treturn $this->id_question;\n\t}", "function questionID()\r\n {\r\n $ret = 0;\r\n\r\n if ( is_a( $this->Question, \"eZQuizQuestion\" ) )\r\n {\r\n $ret = $this->Question->id();\r\n }\r\n\r\n return $ret;\r\n }", "public function getQuestionId() {\n\t\treturn $this->questionId;\n\t}", "function target_add_poll_question($q)\n{\n\t$qid = db_qid('INSERT INTO '. $GLOBALS['DBHOST_TBL_PREFIX'] .'poll_opt (poll_id, name)\n\t\tVALUES('. (int)$q['id'] .', '. _esc($q['name']) .')');\n\treturn $qid;\n}", "public function getQuestionIds(){\n\t\treturn array('todo'); // This will be moved to QuestionTemplate\n\t}", "function ipal_show_current_question_id(){\r\n global $DB;\r\n global $ipal;\r\n if($DB->record_exists('ipal_active_questions', array('ipal_id'=>$ipal->id))){\r\n $question=$DB->get_record('ipal_active_questions', array('ipal_id'=>$ipal->id));\r\n\treturn($question->question_id);\r\n }\r\nelse{\r\nreturn(0);\r\n}\r\n}", "public function add_question($id)\n {\n $this->question_ids[] = $id;\n }", "function assign_questions($question){\n $this->db->insert('questions_project', $question);\n\n //Get the id of the project\n $insert_id = $this->db->insert_id();\n\n return $insert_id;\n }", "function addQuestion($question_id)\n\t{\n\t\tarray_push($this->questions, $question_id);\n\t}", "public function isRequiresQuestionId();", "private function myQid(){\r\n\t\t$this->db->where('uid', $this->uid);\r\n\t\t$this->db->select('id');\r\n\t\t$this->db->from('wen_answer');\r\n\t\t$tmp = $this->db->get()->result_array();\r\n\t\t$return = array();\r\n\t\tforeach($tmp as $r){\r\n\t\t\t$return[$r['id']] = 1;\r\n\t\t}\r\n\t\treturn $return;\r\n\t}", "function getQuestionId($questionId, $form){\r\n\r\n\tglobal $db;\r\n\tif(!$db) connectDb();\r\n\r\n\t$formId = getFormId($form);\r\n\tif($formId) {\r\n\t\t$sql = \"SELECT id FROM questions WHERE question ='$questionId' and form_id='$formId' \";\r\n\r\n\t\ttry {\r\n\t\t\t$result = $db->query($sql)->fetch(PDO::FETCH_OBJ);\r\n\t\t}\r\n\t\tcatch (PDOException $e) {\r\n\t\t\t$error = $e->getMessage();\r\n\t\t}\r\n\r\n\t\tif($result) \r\n\t\t\treturn $result->id;\r\n\t\telse\r\n\t\t\treturn null;\r\n\t}\r\n}", "function getQuestion($id) { \n\ttry {\n\t\t$question = ORM::for_table('questions')->where('id', $id)->find_one();\n\t\tif (!$question) { \n\t\t\treturn 0;\n\t\t} else {\n\t\t\t$theQuestion = array();\n\t\t\t$theQuestion['id'] = $question->id;\n\t\t\t$theQuestion['text'] = $question->text;\n\t\t\t$theQuestion['answer1'] = $question->answer1;\n\t\t\t$theQuestion['answer2'] = $question->answer2;\n\t\t\t$theQuestion['vote_answer1'] = $question->vote_answer1;\n\t\t\t$theQuestion['vote_answer2'] = $question->vote_answer2;\n\t\t\treturn $theQuestion;\n\t\t}\n\t} catch (Exception $e) { \n\t\treturn 0;\n\t}\n}", "public function PullNextQuestionID()\n {\n $questionID = 0;\n \n $foundNextQues = FALSE;\n $lvlQAs = $this->GetLvlQAs();\n \n for($index = 0; $index < count($lvlQAs) && !$foundNextQues; $index++)\n {\n $lvlQA = $lvlQAs[$index];\n \n if(!$lvlQA->IsAnswerIdSet())\n {\n $foundNextQues = TRUE;\n $questionID = $lvlQA->GetQuestionId();\n }\n }\n \n return $questionID;\n }", "public function appendCorrectQuestionId($questionId);", "public function getQuestionId()\r\n{\r\n $query_string = \"SELECT questionid FROM questions \";\r\n $query_string .= \"WHERE question = :question\";\r\n\r\n return $query_string;\r\n}", "private function getQuestion($id){\n $q = new Question();\n return $q->find($id);\n }", "function ipal_send_question(){\r\n\tglobal $ipal;\r\n\tglobal $DB;\r\n\tglobal $CFG;\r\n\t\r\n\t$ipal_course=$DB->get_record('ipal',array('id'=>$ipal->id));\r\n\t$record = new stdClass();\r\n\t$record->id = '';\r\n\t$record->course = $ipal_course->course;\r\n\t$record->ipal_id = $ipal->id;\r\n\t$record->quiz_id = $ipal->id;\r\n\t$record->question_id = $_POST['question'];\r\n\t$record->timemodified = time();\r\n\t if($DB->record_exists('ipal_active_questions', array('ipal_id'=>$ipal->id))){\r\n\t $mybool=$DB->delete_records('ipal_active_questions', array('ipal_id'=>$ipal->id));\r\n\t }\r\n\t$lastinsertid = $DB->insert_record('ipal_active_questions', $record);\r\n\r\n}", "static public function obtener_idpregunta_disponible()\n {\n return self::$conexion->autoID(\"pregunta\",\"id_pregunta\");\n }", "function deduce_question_id($question) {\n if(is_array($question))\n if(is_array($question['pytanie']))\n $question = isSet($question['pytanie']['id_pytania'])? \n $question['pytanie']['id_pytania'] : null;\n else\n $question = isSet($question['id_pytania']) ? $question['id_pytania'] : null;\n \n return $question;\n}", "function questionnaire_add_instance($questionnaire) {\n // (defined by the form in mod.html) this function\n // will create a new instance and return the id number\n // of the new instance.\n global $COURSE, $DB, $CFG;\n require_once($CFG->dirroot.'/mod/questionnaire/questionnaire.class.php');\n require_once($CFG->dirroot.'/mod/questionnaire/locallib.php');\n\n // Check the realm and set it to the survey if it's set.\n\n if (empty($questionnaire->sid)) {\n // Create a new survey.\n $cm = new Object();\n $qobject = new questionnaire(0, $questionnaire, $COURSE, $cm);\n\n if ($questionnaire->create == 'new-0') {\n $sdata = new Object();\n $sdata->name = $questionnaire->name;\n $sdata->realm = 'private';\n $sdata->title = $questionnaire->name;\n $sdata->subtitle = '';\n $sdata->info = '';\n $sdata->theme = ''; // Theme is deprecated.\n $sdata->thanks_page = '';\n $sdata->thank_head = '';\n $sdata->thank_body = '';\n $sdata->email = '';\n $sdata->owner = $COURSE->id;\n if (!($sid = $qobject->survey_update($sdata))) {\n print_error('couldnotcreatenewsurvey', 'questionnaire');\n }\n } else {\n $copyid = explode('-', $questionnaire->create);\n $copyrealm = $copyid[0];\n $copyid = $copyid[1];\n if (empty($qobject->survey)) {\n $qobject->add_survey($copyid);\n $qobject->add_questions($copyid);\n }\n // New questionnaires created as \"use public\" should not create a new survey instance.\n if ($copyrealm == 'public') {\n $sid = $copyid;\n } else {\n $sid = $qobject->sid = $qobject->survey_copy($COURSE->id);\n // All new questionnaires should be created as \"private\".\n // Even if they are *copies* of public or template questionnaires.\n $DB->set_field('questionnaire_survey', 'realm', 'private', array('id' => $sid));\n }\n }\n $questionnaire->sid = $sid;\n }\n\n $questionnaire->timemodified = time();\n\n // May have to add extra stuff in here.\n if (empty($questionnaire->useopendate)) {\n $questionnaire->opendate = 0;\n }\n if (empty($questionnaire->useclosedate)) {\n $questionnaire->closedate = 0;\n }\n\n if ($questionnaire->resume == '1') {\n $questionnaire->resume = 1;\n } else {\n $questionnaire->resume = 0;\n }\n\n // Field questionnaire->navigate used for branching questionnaires. Starting with version 2.5.5.\n /* if ($questionnaire->navigate == '1') {\n $questionnaire->navigate = 1;\n } else {\n $questionnaire->navigate = 0;\n } */\n\n if (!$questionnaire->id = $DB->insert_record(\"questionnaire\", $questionnaire)) {\n return false;\n }\n\n questionnaire_set_events($questionnaire);\n\n return $questionnaire->id;\n}", "public function getId(){\n\t\treturn $this->idModule;\n\t}", "public function getAnswerId( ) {\n\t\treturn $this->answer_id;\n\t}", "function ExtendedText_Question( $id ) {\n\t\t\n\t\tparent::Question( $id );\n\t}", "public function ask_add($author_id, $answer, $title = '', $id_quest=-1)\n\t{\n\t\t$sql = \"INSERT INTO \".$this->table_ask.\"(id_quest, title, text, date, author_id) VALUES(?, ?, ?, ?, ?)\";\n\t\t$data = array($id_quest, $title, $answer, time(), $author_id);\n\t\t$query = $this->db->query($sql, $data);\t\n\t}", "public function getQuestionById($id = false) {\n\t\t\t// Database Connection\n\t\t\t$db\t\t\t\t= $GLOBALS['db_q'];\n\t\t\t// Query set up\n\t\t\t$return\t\t\t= ($id) ? $db->getRow('tb_question', '*', \"id = {$id}\") : false;\n\t\t\t// Return\n\t\t\treturn $return;\n\t\t}", "public function createQuestion($data)\n\t{ \n\t\t$this->db->insert('pergunta', array(\n\t\t\t'texto' => $data->text,\n\t\t\t'id_jogo' => $_SESSION['jogoid']\n\t\t));\n\n\t\t$id = $this->db->lastInsertId();\n\t\treturn $id;\n\t}", "function getId();", "function get_by_id_question($id)\n {\n $this->db->where('tfselect_tfque_fk', $id);\n $query = $this->db->get('fis_dtraining_feedback_selections');\n return $query->result();\n }", "function adddelquestion($question_id=null)\r\n {\r\n if(!empty($question_id))\r\n $this->set('responses', $this->Response->findAll($conditions='question_id='.$question_id));\r\n\r\n $this->layout = 'ajax';\r\n }", "private function generateNextQuestion(){\n while(true) {\n $id = rand($this->minId, /*$this->maxId*/20);\n\n if (!in_array($id, $this->answeredQuestions)) {\n array_push($this->answeredQuestions,$id);\n return $id;\n }\n }\n }", "public function add_to_quiz_url($questionid) {\n global $CFG;\n $params = $this->baseurl->params();\n $params['addquestion'] = $questionid;\n $params['sesskey'] = sesskey();\n return new moodle_url('/mod/ipal/edit.php', $params);\n }", "function getSurveyId()\n\t{\n\t\treturn $this->survey_id;\n\t}", "public function addQuestionAndAnswers () {\n global $tpl, $ilTabs;\n $ilTabs->activateTab(\"editQuiz\");\n $this->initAddQuestionAndAnswersForm();\n }", "function show_question($id, $slug)\n\t{\n\t\t$this->form_validation->set_rules('id_questions', 'Id_Questions', 'required');\n\t\t$this->form_validation->set_rules('body', 'Body', 'required');\n\t\tif ($this->form_validation->run() == false) {\n\n\t\t\t$this->model_module->_set_viewers($id);\n\t\t\t$data['question'] = $this->model_module->questions_id('uuid_question', $id);\n\t\t\t$questions_id = $data['question']['id'];\n\t\t\t$data['module'] = $this->model_module->get_module($questions_id, $id);\n\t\t\t$queryGetquestion = \"SELECT `tb_questions` .*, `tbl_users`.`name`,`tbl_users`.`user_email`\n\t\t\t\t\tFROM `tb_questions` JOIN `tbl_users` \n\t\t\t\t\tON `tb_questions`.`id_user` = `tbl_users`. `user_id`\n\t\t\t\t\tlEFT JOIN `tb_sub_module` \n\t\t\t\t\tON `tb_questions`.`id_sub_module` = `tb_sub_module`.`id`\n\t\t\t\t\tWHERE `tb_questions`.`id` = $questions_id\n\t\t\t\";\n\t\t\t$query = $this->db->query($queryGetquestion)->row_array();\n\t\t\t$data['get_question'] = $query;\n\t\t\t$answerQuery = \"SELECT `tb_answers` .*, `tbl_users`.`name`,`tbl_users`.`user_email`\n\t\t\t\tFROM `tb_answers`\n\t\t\t\tJOIN `tb_questions` \n\t\t\t\tON `tb_answers`.`id_questions` = `tb_questions`.`id`\n\t\t\t\tJOIN `tbl_users`\n\t\t\t\tON `tb_answers`.`id_user` = `tbl_users`.`user_id`\n\t\t\t\tWHERE `tb_answers`.`id_questions` = $questions_id\n\t\t\t\tORDER BY `tb_answers`.`created_at` DESC\";\n\t\t\t$answer = $this->db->query($answerQuery)->result_array();\n\t\t\t$data['get_answer'] = $answer;\n\n\t\t\t// response_json($data);\n\t\t\t$this->load->view('layouts/header');\n\t\t\t$this->load->view('_partalis/navigation');\n\t\t\t$this->load->view('modules/show_questions', $data);\n\t\t\t$this->load->view('layouts/footer');\n\t\t} else {\n\t\t\t$this->model_module->addAnswers();\n\t\t\tredirect('user/module/show_question/' . $id . '/' . $slug);\n\t\t}\n\t}", "function qa_q_request($questionid, $title)\n{\n\tif (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }\n\n\trequire_once QA_INCLUDE_DIR . 'app/options.php';\n\trequire_once QA_INCLUDE_DIR . 'util/string.php';\n\n\t$title = qa_block_words_replace($title, qa_get_block_words_preg());\n\t$slug = qa_slugify($title, qa_opt('q_urls_remove_accents'), qa_opt('q_urls_title_length'));\n\n\treturn (int)$questionid . '/' . $slug;\n}", "public function testQuestionEditExistingID() {\n $response = $this->get('question/' . $this->question->id . '/edit');\n $this->assertEquals('200', $response->foundation->getStatusCode());\n $this->assertEquals('general.permission', $response->content->view);\n }", "public function initAddQuestionAndAnswersForm () {\n global $tpl, $ilCtrl;\n\n $my_tpl = new ilTemplate(\"tpl.question_and_answers.html\", true, true,\n \"Customizing/global/plugins/Services/Repository/RepositoryObject/MobileQuiz\");\n $rtokenFactory = new ilCtrl();\n $my_tpl->setVariable(\"ACTION_URL\",$this->ctrl->getFormAction($this));\n $my_tpl->setVariable(\"SUBMIT_BUTTON\", $this->txt(\"save\"));\n $my_tpl->setVariable(\"NEW_QUESTION\", $this->txt(\"question_add_head\"));\n $my_tpl->setVariable(\"QUESTION\", $this->txt(\"question_add_text\"));\n $my_tpl->setVariable(\"QUESTION_TYPE\", $this->txt(\"question_add_type\"));\n $my_tpl->setVariable(\"CHOICES\", $this->txt(\"choice_add_texts\"));\n $my_tpl->setVariable(\"VAR_1\", \"value1\");\n $my_tpl->setVariable(\"COMMAND\", \"cmd[createQuestionAndAnswers]\");\n $my_tpl->setVariable(\"MINIMUM\", $this->txt(\"choice_add_numeric_minimum\"));\n $my_tpl->setVariable(\"MAXIMUM\", $this->txt(\"choice_add_numeric_maximum\"));\n $my_tpl->setVariable(\"STEP\", $this->txt(\"choice_add_numeric_steprange\"));\n $my_tpl->setVariable(\"CORRECT_VALUE\", $this->txt(\"choice_add_numeric_correctvalue\"));\n $my_tpl->setVariable(\"TOLERANCE_RANGE\", $this->txt(\"choice_add_numeric_tolerenace_range\"));\n $my_tpl->setVariable(\"SELECTED_SINGLE\", 'selected=\"selected\"');\n\n $my_tpl->setVariable(\"HIDE_NUMERIC_BLOCK\", 'style=\"display:none;\"');\n $my_tpl->setVariable(\"HIDE_SINGLE_CHOICE_BLOCK\", 'style=\"display:none;\"');\n\n $html = $my_tpl->get();\n $tpl->setContent($html);\n }", "function addQuestionDB($insert_arr=array()) {\r\n $this->db->insert('dipp_question_master', $insert_arr);\r\n return $this->db->insert_id();\r\n\r\n\t}", "public function getAddQP()\n {\n return view('allwebviews.admin.documents.questionPapers.add');\n }", "public function get_id() {\n\t\treturn self::MODULE_ID;\n\t}", "public function addQuestionGet(){\n\n return View('admin.question');\n }", "public function show($id)\n\t{\n define( 'LS_BASEURL', 'http://192.168.10.1/limesurvey/index.php'); // adjust this one to your actual LimeSurvey URL\n define( 'LS_USER', 'admin' );\n define( 'LS_PASSWORD', 'qwerty' );\n\n //$client = new Client(LS_BASEURL);\n // the survey to process\n $survey_id=177998;\n\n // instanciate a new client\n $myJSONRPCClient = new \\org\\jsonrpcphp\\JsonRPCClient( LS_BASEURL.'/admin/remotecontrol' );\n\n // receive session key\n $sessionKey= $myJSONRPCClient->get_session_key( LS_USER, LS_PASSWORD );\n\n $questionInfo = $myJSONRPCClient->list_groups($sessionKey,$id);\n\n return $questionInfo;\n\t}", "function ipal_show_current_question(){\r\n\tglobal $DB;\r\n\tglobal $ipal;\r\n\t if($DB->record_exists('ipal_active_questions', array('ipal_id'=>$ipal->id))){\r\n\t $question=$DB->get_record('ipal_active_questions', array('ipal_id'=>$ipal->id));\r\n\t $questiontext=$DB->get_record('question',array('id'=>$question->question_id)); \r\n\techo \"The current question is -> \".strip_tags($questiontext->questiontext);\r\nreturn(1);\r\n\t }\r\n\telse\r\n\t {\r\n\t return(0);\r\n\t }\r\n}", "public function getQuestionById($id){\n\n $this->db->where('q_id', $id);\n $query = $this->db->get('question');\n return $query->row();\n }", "public function ajax_add_existing_question() {\n\t\t$challengeId = $this->input->post('challenge_id');\n $questionId = $this->input->post('question_id');\n\n\t\t$this->challenge_question_model->update_challenge_question_table($questionId, $challengeId, 0);\n $out = array('success' => true);\n $this->output->set_output(json_encode($out));\n\t}", "function upQuestion($id = null) {\n $this->autoRender = false; // turn off autoRender because there is no deleteQuestions view\n if($this->request->is('ajax')) {\n // only process ajax requests\n $tempArr = null;\n if ($this->Session->check('SurveyQuestion.new')) {\n //check for the session variable containing questions for this survey\n $tempArr = $this->Session->read('SurveyQuestion.new'); // get temp working copy of questions\n $swapone = $tempArr[$id];\n $swaptwo = $tempArr[$id-1];\n $tempArr[$id-1] = $swapone;\n $tempArr[$id] = $swaptwo;\n }\n $this->Session->write('SurveyQuestion.new',$tempArr); // write the new question array to the session\n $this->set('questions', $tempArr); // send the questions to the view\n $this->layout = 'ajax'; // use the blank ajax layout\n $this->render('/Elements/manage_questions'); // send the element to the receiving element in the view\n }\n }", "public static function getQuestionInfoById($question_id) {\n\t\tif($question_id > 0){\n\t\t\treturn self::find($question_id);\n\t\t}\n }", "public function addnewclaimquestion(){\n\tif(isset($this->getData['opertaors']) && !empty($this->getData['opertaors'])){\n\t $operators = commonfunction::implod_array($this->getData['opertaors']);\n\t}\n\telse{\n\t $operators = '';\n \t}\n\tif($this->getData['question_type']=='file'){\n\t $file_upload = 1;\n\t}else{\n\t $file_upload = 0;\n\t}\n\t$question_options ='';\n\tif($this->getData['question_type']=='select' || $this->getData['question_type']=='radio'){\n\t foreach($this->getData['questionoption'] as $key=>$que_option){\n\t\t$que_value = $this->getData['questionvalue'][$key];\n\t\t$question_options .= $que_option.'|'.$que_value.';';\n\t }\n\t}\n\tif(isset($this->getData['subquestion_a']) && $this->getData['subquestion_a']!=''){\n\t $sub_question = isset($this->getData['subquestion_a'])?$this->getData['subquestion_a']:'';\n\t $sub_que_option = isset($this->getData['subquestion_option_a'])?$this->getData['subquestion_option_a']:'';\n\t}else{\n\t $sub_question = isset($this->getData['subquestion'])?$this->getData['subquestion']:'';\n\t $sub_que_option = isset($this->getData['subquestion_option'])?$this->getData['subquestion_option']:'';\n\t}\n\t$lastinserted_id = $this->insertInToTable(CLAIM_QUESTIONS, array(array('sub_question'=>$sub_question,'sub_question_option'=>$sub_que_option,'question_type'=>$this->getData['question_type'],'question'=>$this->getData['question'],'question_options'=>$question_options,'operators'=>$operators,'file_upload'=>$file_upload,'status'=>$this->getData['claim_status'],'created_by'=>$this->Useconfig['user_id'],'created_ip'=>commonfunction::loggedinIP())));\n\treturn $lastinserted_id;\n }", "public function exam_form($id)\n {\n\n }", "function surveyQuestion($id = null) {\n $this->autoRender = false; // turn off autoRender because there is no view named surveyQuestion\n $this->layout = 'ajax'; // use the blank ajax layout\n if($this->request->is('ajax')) { // only proceed if this is an ajax request\n if (!$this->request->is('post')) {\n if ($id != null) { // existing question being edited so retrieve it from the session\n if ($this->Session->check('SurveyQuestion.new')) {\n $tempData = $this->Session->read('SurveyQuestion.new');\n $this->set('question_index', $id);\n $question = $tempData[$id];\n $question['Choice']['value'] = $this->Survey->Question->Choice->CombineChoices($question['Choice']);\n $this->request->data['Question'] = $question; // send the existing question to the view\n }\n }\n $this->render('/Elements/question_form');\n } else { // returning with data from the form here\n $tempArr = null;\n if ($this->Session->check('SurveyQuestion.new')) {\n $tempArr = $this->Session->read('SurveyQuestion.new');\n }\n $this->request->data['Question']['Choice'] = $this->Survey->Question->Choice->SplitChoices($this->request->data['Question']['Choice']['value']);\n $this->Survey->Question->set($this->request->data);\n $checkfieldsArr = $this->Survey->Question->schema();\n unset($checkfieldsArr['id']);\n unset($checkfieldsArr['survey_id']);\n unset($checkfieldsArr['order']);\n $checkfields = array_keys($checkfieldsArr);\n if ($this->Survey->Question->validates(array('fieldList' => $checkfields))) {\n if (is_null($id)) {\n $tempArr[] = $this->request->data['Question'];\n } else {\n $tempArr[$id] = $this->request->data['Question'];\n }\n $this->Session->write('SurveyQuestion.new',$tempArr);\n } else {\n $errors = $this->Survey->Question->invalidFields();\n $this->Session->setFlash('Invalid question: '.$errors['question'][0], true, null, 'error');\n }\n $this->set('questions', $tempArr);\n $this->layout = 'ajax';\n $this->render('/Elements/manage_questions');\n }\n }\n }", "public function testQuestionViewExistingID() {\n $response = $this->get('question/' . $this->question->id);\n $this->assertEquals('200', $response->foundation->getStatusCode());\n $this->assertEquals('general.permission', $response->content->view);\n }", "function set_up_question($question_ID)\r\n{\r\n\tglobal $mydb, $question, $answers, $correct_answer, $is_question, $is_random_question;\r\n\t\r\n\t// set the is question global variable\r\n\t$is_question = true;\r\n\r\n\tif (($question_ID == \"random\") || !$question_ID)\r\n\t{\r\n\t\t$is_random_question = true;\r\n\t\t$question = get_question_random();\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$is_random_question = false;\r\n\t\t$question = get_question_from_ID($question_ID);\r\n\r\n\t}\r\n\t\r\n\t// get random answers\r\n\t$answers = $question->get_Answers();\r\n\t\r\n\t// get the correct answer and remember it\r\n\tforeach ($answers as $answer)\r\n\t{\r\n\t\tif ($answer->is_correct())\r\n\t\t{\r\n\t\t\t$correct_answer = $answer;\r\n\t\t}\r\n\t}\r\n}", "public function addAction($id = null, $idFromQuestion = null) {\n\n if ($id == 'null') {\n $id = null;\n }\n\n /**\n * Create a comment object\n */\n $edit_comment = (object) [\n 'tags' => '',\n 'comment' => '',\n 'title' => '',\n ];\n\n if ($id) {\n /**\n * Get current version of the comment.\n */\n $edit_comment = $this->comments->find($id);\n\n /**\n * Check if user is authorized to edit this comment.\n */\n if ($edit_comment->userId != $_SESSION['authenticated']['user']->id) {\n die(\"Can only\");\n }\n\n /**\n * Copy over the original tags\n */\n foreach ($this->assignTags->find($id) as $key => $value) {\n $edit_comment->tags[] = $this->assignTags->getTagName($value->idTag)->name;\n }\n }\n\n /**\n * Get a simple array with all tags.\n */\n $tags_array = $this->createSimpleTags();\n\n /**\n * Create a form to edit the comment.\n */\n $form_setup = [\n 'comment' => [\n 'type' => 'textarea',\n 'label' => 'Comment: ',\n 'required' => true,\n 'validation' => ['not_empty'],\n 'value' => $edit_comment->comment,\n ],\n 'submit' => [\n 'type' => 'submit',\n 'callback' => function($form) {\n $form->saveInSession = true;\n return true;\n }\n ],\n ];\n\n /**\n * Check if the edited comment is a comment answer.\n */\n $is_answer = $this->commentanswer->isAnswer($id);\n\n /**\n * If the edited comment is not a answer add additional form information.\n */\n if (!isset($idFromQuestion) && ($is_answer == null)) {\n\n $form_setup_add['title'] = [\n 'type' => 'text',\n 'required' => true,\n 'validation' => ['not_empty'],\n 'value' => $edit_comment->title,\n ];\n $form_setup_add['tags'] = [\n 'type' => 'checkbox-multiple',\n 'values' => $tags_array,\n 'label' => 'Tags: ',\n 'required' => true,\n 'checked' => $edit_comment->tags,\n ];\n\n $form_setup = $form_setup_add + $form_setup;\n }\n\n /**\n * Create the form\n */\n $form = $this->form->create([], $form_setup);\n\n /**\n * Check the form status\n */\n $status = $form->check();\n\n if (!isset($idFromQuestion) && !isset($_SESSION['form-save']['tags']['values'])) {\n $status = false;\n }\n\n /**\n * If form submission has been sucessful procide with the following\n */\n if ($status === true) {\n\n\n\n /**\n * Get data from form storde them into $comment object and unset session variables\n */\n $comment['id'] = isset($id) ? $id : null;\n $comment['comment'] = $_SESSION['form-save']['comment']['value'];\n $comment['userId'] = $_SESSION['authenticated']['user']->id;\n $comment['timestamp'] = time();\n $comment['ip'] = $this->request->getServer('REMOTE_ADDR');\n $comment['title'] = !isset($idFromQuestion) ? $_SESSION['form-save']['title']['value'] : 'Reply: ' . $this->comments->find($idFromQuestion)->title;\n $tags = !isset($idFromQuestion) ? $_SESSION['form-save']['tags']['values'] : null;\n\n unset($_SESSION['form-save']);\n\n /**\n * Update the comment in the database.\n */\n $this->comments->save($comment);\n $row['idComment'] = isset($id) ? $id : $this->comments->findLastInsert();\n\n /**\n * Update the tags for the comment in the database.\n */\n if (!isset($idFromQuestion)) {\n if (isset($id)) {\n $this->assignTags->delete($id);\n }\n if ($is_answer == null) {\n foreach ($tags as $key => $value) {\n $row['idTag'] = array_search($value, $tags_array);\n $this->assignTags->save($row);\n }\n }\n }\n\n /**\n * Update the comment answer.\n */\n if ($idFromQuestion) {\n $data = [\n 'idQuestion' => $idFromQuestion,\n 'idAnswer' => $row['idComment'],\n ];\n $this->commentanswer->save($data);\n\n $url = $this->url->create('comment/answers/' . $idFromQuestion);\n } else {\n\n $url = $this->url->create('comment/view-questions');\n }\n\n /**\n * Route to appropriate view.\n */\n $this->response->redirect($url);\n } else if ($status === false) {\n\n /**\n * If form submission was unsuccessful inform the user.\n */\n $form->AddOutput(\"<p><i>Form submitted but did not checkout, make sure that u have inserted a title and selected at least on tag.</i></p>\");\n }\n\n /**\n * Generate the HTML-code for the form and prepare the view.\n */\n $this->views->add('comment/view-default', [\n 'title' => \"Discuss this topic\",\n 'main' => $form->getHTML(),\n ]);\n $this->theme->setVariable('title', \"Add Comment\");\n }", "public function getQuestionById($qid) {\r\n $questions=$this->getQuestions();\r\n if($questions) {\r\n foreach($questions as $q) {\r\n if($q->getId() == $qid) {\r\n return $q;\r\n } \r\n }\r\n } \r\n return false;\r\n }", "public function insert_question_info()\n {\n \t\t\t\t\t\t\t\t\n codeQuestions::create([\n 'content' =>request('content'),\n /* 'test_case1' =>request('test_case1'),\n 'test_case1_result' =>request('test_case1_result'), \n 'test_case2' =>request('test_case2'), \n 'test_case2_result' =>request('test_case2_result'),\n 'test_case3' =>request('test_case3'),\n 'test_case3_result' =>request('test_case3_result'),\n // 'student_answer' =>request('student_answer'),*/\n 'degree' =>request('degree'),\n 'language' =>request('language'),\n 'type' =>request('type'),\n 'id_exam' =>request('id_exam')\n ]);\n\n ////////////////to make exam id hidden////////////////////////////////////\n $allExams=exams::all();\n return view('exam_questions',['allExams'=>$allExams]); \n ///////////////////////////////////////\n // return redirect('exam_questions') ;\n \n }", "public function get_id();", "public function get_id();", "public function addForm($id = 0)\n {\n $question = new Question;\n if ($id > 0) {\n $question = Question::find($id);\n }\n return view('admincp::add-question', compact('question'));\n }", "public function getAddID() {\n //return the value addid\n return $this->AddID;\n }", "public function get_id()\n {\n }", "function getQuestion($id){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//internal data. Same as GetInfo()\r\n\t\t$query= \"SELECT * FROM `tbl_question` WHERE `question_id` = $id LIMIT 1 ;\";\r\n\t\t$result = $this->mdb2->query($query) or die('An unknown error occurred while checking the data');\r\n\t\tif(MDB2::isError($result)){\r\n\t\t\treturn \"SelectError\";\r\n\t\t}else{\r\n\t\t\t$native_result = $result->getResource();\r\n\t\t\treturn $native_result;\t\t\t\t\t\t//Returns the question text\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//as a Mysql native result type.\r\n\t\t}\r\n\t}", "function id():string {return $this->_p['_id'];}", "function getID();", "public function getQuestaoId($id){\n $this->db->where('idquestoes', $id);\n return $this->db->get('questoes_matriz')->row(0);\n }", "function add() {\r\n $sql = \"INSERT into student_researchers VALUES();\";\r\n global $db;\r\n if($db->Execute($sql) === false) {\r\n throw new Exception('SQL error. Unable to add a new researcher.');\r\n }\r\n $_REQUEST['id']=mysql_insert_id();\r\n\r\n edit();\r\n}", "function getQuestionid($quizid, $questionnumber) {\r\n\t\t$idquestion = - 1;\r\n\t\tif ($stmt = $this->dbconn->prepare ( \"SELECT idquestion FROM questions WHERE quizid=? AND questionnumber=?\" )) {\r\n\t\t\t$stmt->bind_param ( 'ii', $quizid, $questionnumber );\r\n\t\t\t$stmt->execute ();\r\n\t\t\t$stmt->bind_result ( $idquestion );\r\n\t\t\t$stmt->fetch ();\r\n\t\t\t$stmt->close ();\r\n\t\t}\r\n\t\t\r\n\t\treturn $idquestion;\r\n\t}", "public function question($id)\n {\n return $this->create($id);\n }", "abstract public function get_id();", "public function getQuestion($id){\r\n $conn = new DB();\r\n $connection = $conn->connect();\r\n\r\n $query = \"SELECT * FROM questions WHERE id = ? LIMIT 1\";\r\n if($stmt = $connection->prepare($query)){\r\n $stmt->bind_param(\"s\", $id);\r\n $stmt->execute();\r\n $stmt->bind_result($qid, $qquestion, $qanswers, $qcorrect_answer, $quiz_id);\r\n $stmt->fetch();\r\n $stmt->close();\r\n }\r\n return [\"id\" => $qid, \"question\" => $qquestion, \"answers\" => $qanswers, \"correct_answer\" => $qcorrect_answer, \"quiz_id\" => $quiz_id];\r\n }", "private function question()\n\t{\n\t\t$this->qns['questionnaire']['questionnairecategories_id'] = $this->allinputs['questioncat'];\n\t\t$this->qns['questionnaire']['questionnairesubcategories_id'] = $this->allinputs['questionsubcat'];\n\t\t$this->qns['questionnaire']['label'] = $this->allinputs['question_label'];\n\n\n\t\t$this->qns['questionnaire']['question'] = $this->allinputs['question'];\n\t\t$this->qns['questionnaire']['has_sub_question'] = $this->allinputs['subquestion'];\n\n\t\tif( $this->qns['questionnaire']['has_sub_question'] == 0 )\n\t\t{\n\t\t\t$this->qns['answers']['answer_type'] = $this->allinputs['optiontype'];\n\t\t}\n\n\t\t$this->qns['questionnaire']['active'] = 1;\n\n\t\tif( $this->qns['questionnaire']['has_sub_question'] == 0 ){\n\t\t\t//This code must be skipped if sub_question is 1\n\t\t\t$optionCounter = 0;\n\t\t\tforeach ($this->allinputs as $key => $value) {\n\n\t\t\t\tif( str_is('option_*', $key) ){\n\t\t\t\t\t$optionCounter++;\n\t\t\t\t\t$this->qns['answers'][$optionCounter] = ( $this->qns['answers']['answer_type'] == 'opentext' ) ? 'Offered answer text' : $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function action_nextquestion()\r\n\t{\r\n\tORM::factory('questionbank');\r\n\t$jsonret = Model_Questionbank::to_questionanswer_json( $this->request->query('quest_id'));\r\n\t\r\n\tprint $jsonret;\r\n\t return true;\r\n\t}", "public function addquest()\n\t{\n\t\tif(mayEditQuiz())\n\t\t{\n\t\t\tif(isset($_GET['text']) && isset($_GET['fp']) && isset($_GET['qid']))\n\t\t\t{\n\t\t\t\t$fp = (int)$_GET['fp'];\n\t\t\t\t$text = strip_tags($_GET['text']);\n\t\t\t\t$duration = (int)$_GET['duration'];\n\t\t\t\t\n\t\t\t\tif(!empty($text))\n\t\t\t\t{\n\t\t\t\t\tif($id = $this->model->addQuestion($_GET['qid'],$text,$fp,$duration))\n\t\t\t\t\t{\n\t\t\t\t\t\tfs_info('Frage wurde angelegt');\n\t\t\t\t\t\treturn array(\n\t\t\t\t\t\t\t'status' => 1,\n\t\t\t\t\t\t\t'script' => 'goTo(\"/?page=quiz&id='.(int)$_GET['qid'].'&fid='.(int)$id.'\");'\n\t\t\t\t\t\t);\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn array(\n\t\t\t\t\t\t'status' => 1,\n\t\t\t\t\t\t'script' => 'pulseError(\"Du solltest eine Frage angeben ;)\");'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}", "function get_id(){\n return $this -> id;\n }", "function get_id(){\n return $this -> id;\n }", "public function getQuestionData()\n {\n return $this->_coreRegistry->registry('current_question');\n }", "private function addQuestion() : void\n {\n $question = $this->console->ask(__('Type your question'));\n\n $this->console->info('Question successfully added ');\n\n $answer = $this->console->ask(__('Type your answer'));\n\n $this->console->info('Answer successfully added ');\n\n $this->questionRepository->create([\n 'question' => $question,\n 'valid_answer' => $answer,\n ]);\n }", "public function setRequiresQuestionId($requiresQuestionId);", "function getInfo($id){\r\n\t\t$this->getQuestion($id);\r\n\t}", "public function taskid()\n {\n return $this->hasOne(Task::class, 'id', 'moduleable_id')->pluck('id')->first();\n }", "function getQuestionGUI($questiontype, $question_id)\n\t{\n\t\tinclude_once \"./Modules/SurveyQuestionPool/classes/class.SurveyQuestionGUI.php\";\n\t\treturn SurveyQuestionGUI::_getQuestionGUI($questiontype, $question_id);\n\t}", "function getQuestionDetail($connection,$questionId){\n $query = \"SELECT * FROM forum_questions WHERE q_id='$questionId'\";\n $question = $connection->query($query);\n return $question;\n\n }", "public function get_question() {\n\t\t\treturn $this->question;\n\t\t}", "function addQuestion($question, $memberID){\n\t\trequire('quizrooDB.php');\n\t\t\n\t\t// check if is member\n\t\tif($this->isOwner($memberID)){\n\t\t\t// insert the question\n\t\t\t$insertSQL = sprintf(\"INSERT INTO q_questions(`question`, `fk_quiz_id`) VALUES (%s, %d)\",\n\t\t\t\t\t\t htmlentities(GetSQLValueString($question, \"text\")),\n\t\t\t\t\t\t GetSQLValueString($this->quiz_id, \"int\"));\n\t\t\tmysql_query($insertSQL, $quizroo) or die(mysql_error());\n\t\t\n\t\t\t// find the question id\n\t\t\t$querySQL = \"SELECT LAST_INSERT_ID() AS insertID\";\n\t\t\t$resultID = mysql_query($querySQL, $quizroo) or die(mysql_error());\n\t\t\t$row_resultID = mysql_fetch_assoc($resultID);\n\t\t\t$currentQuestionID = $row_resultID['insertID'];\n\t\t\tmysql_free_result($resultID);\n\t\t\t\n\t\t\treturn $row_resultID['insertID'];\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function add_question_form()\n\t{\t\n\t\t$CI =& get_instance();\n\t\t$CI->auth->check_operator_auth();\n\t\t$CI->load->library('loquestion');\n\t\t\n $content = $CI->loquestion->question_add_form();\n \n $sub_menu = array(\n\t\t\t\tarray('label'=> display('manage_question'), 'url' => 'operator/Oquestion'),\n\t\t\t\tarray('label'=> display('add_question'), 'url' => 'operator/Oquestion/add_question_form','class' =>'active')\n\t\t\t);\n\t\t$this->template->full_operator_html_view($content,$sub_menu);\n\t}", "function ipal_get_qtype($questionid){\r\n\tglobal $DB;\r\n\t$questiontype=$DB->get_record('question',array('id'=>$questionid));\r\n\treturn($questiontype->qtype); \r\n}", "function test_id(){\n\t\tif(isset($_GET['id'])){\n\t\t\trecuperation_info_id();\n\t\t\tglobal $id_defini;\n\t\t\t$id_defini = true;\n\t\t}\n\t}", "public function addAction()\n {\n /* Checking if user is signed in to be allowed to add new answer */\n $this->requireSignin();\n\n /* Getting Question by id */\n $question = Question::getById(intval($_POST['question_id']));\n\n if ($question) {\n\n /* Checking if question is not closed */\n if ($question->is_closed == 0 && $question->active == 1) {\n\n /* Creating new Answer's object */\n $answer = new Answer($_POST);\n\n /* Checking if answer is not empty */\n if (strlen($answer->answer) < 2) {\n\n /* Show error message and redirect to question's page */\n Flash::addMessage('You can not add emty answer', Flash::INFO);\n }\n\n /* Getting user's id and set it as question's user_id */\n $user = Auth::getUser();\n $answer->user_id = $user->id;\n\n $answerId = $answer->add();\n\n if ($answerId) {\n\n /* Send notification to question's author */\n Notification::add([\n 'to_user' => $question->user_id,\n 'question_id' => $question->id,\n 'answer_id' => $answerId,\n 'type' => 'na',\n 'from_user' => $answer->user_id,\n ]);\n\n /* Send notifications to users who are following question */\n $followers = FollowedQuestion::getFollowers($question->id);\n foreach ($followers as $follower) {\n\n Notification::add([\n 'to_user' => $follower['user_id'],\n 'question_id' => $question->id,\n 'answer_id' => $answerId,\n 'type' => 'na',\n 'from_user' => $answer->user_id,\n ]);\n }\n\n /* Send notifications to mentioned users */\n $mention_number = 0;\n preg_match_all('/(<span class=\"mention\" [^>]*value=\"([^\"]*)\"[^>]*)>(.*?)<\\/span><\\/span>/i', $answer->answer, $mentions);\n\n foreach($mentions[2] as $mention) {\n\n /* Allow max 10 mentions */\n if ($mention_number < 10) {\n\n /* Check if user exists */\n $this_user = User::getByUsername($mention);\n\n if ($this_user) {\n\n Notification::add([\n 'to_user' => $this_user->id,\n 'question_id' => $question->id,\n 'answer_id' => $answerId,\n 'type' => 'nm',\n 'from_user' => $answer->user_id,\n ]);\n }\n }\n }\n\n /* Redirect to question's page and show success message */\n Flash::addMessage('Answer added!', Flash::INFO);\n $this->redirect('/question/'.$question->url.'#answer_'.$answerId);\n\n } else {\n \n /* Redirect to question's page and show error messages */\n Flash::addMessage(\"Error: \".implode(\", \", $answer->errors), Flash::INFO);\n }\n\n } else {\n \n /* Redirect to question's page and show error message */\n Flash::addMessage('This question is closed for new answers.', Flash::INFO);\n }\n\n $this->redirect('/question/'.$question->url);\n\n } else {\n\n /* Redirect to stream page and show error messages */\n Flash::addMessage('This question is unavailable.', Flash::INFO);\n $this->redirect('/');\n }\n }", "public function getID(): string {\n\t\treturn 'talk';\n\t}", "function getQuestion()\n {\n $question = QnA_Question::staticGet('id', $this->question_id);\n if (empty($question)) {\n // TRANS: Exception thown when getting a question with a non-existing ID.\n // TRANS: %s is the non-existing question ID.\n throw new Exception(sprintf(_m('No question with ID %s'),$this->question_id));\n }\n return $question;\n }", "function getQuizResourceIDs ($Quiz_lesson_id, $tp_id) {\n\t\t$Quiz_sql = \"SELECT * FROM `tme_question` WHERE `LessonID` = '$Quiz_lesson_id' AND `tpname` = '$tp_id' ORDER BY `order` ASC \";\n\t\t$Q_res_rows = mysql_query($Quiz_sql);\n\t\treturn $Q_res_rows;\n\t}", "public function ask_get_quest($id)\n\t{\n\t\t$sql = \"SELECT *\n\t\t\t\tFROM \".$this->table_ask.\"\n\t\t\t\tWHERE id = ?\n\t\t\t\tAND id_quest = -1\n\t\t\t\tLIMIT 1\";\n\t\t$data = array($id);\n\t\t$query = $this->db->query($sql, $data);\n\t\tif( $query->row() != NULL )\n\t\t\treturn $query->row();\n\t\telse\n\t\t\treturn 0;\n\t}", "public function getQuestionById($id=null)\n {\n $qry = \"SELECT * FROM mvc_VQuestion\n WHERE id=?\";\n \n $all = $this->db->executeFetchAll($qry, array($id));\n\n $question = json_decode(json_encode($all[0]),TRUE);\n $tags = $question['tags'];\n $tagIdName = array();\n \n if (!empty($tags)) {\n $tagsSep = explode(\",\", $tags);\n \n foreach ($tagsSep as $key => $val) {\n $tag_id = $this->getTagIdAction($val);\n $tagIdName[] = array('id' => $tag_id, 'name' => $val);\n }\n }\n\n $question_data = array($question, $tagIdName);\n\n return $question_data;\n }", "function get_id() {\n\t\treturn $this->id;\n\t}", "function ipal_add_quiz_question($id, $quiz, $page = 0) {\n global $DB;\n $questions = explode(',', ipal_clean_layout($quiz->questions));\n if (in_array($id, $questions)) {\n return false;\n }\n\n if (!(ipal_acceptable_qtype($id) === true)) {\n $alertmessage = \"IPAL does not support \".ipal_acceptable_qtype($id).\" questions.\";\n echo \"<script language='javascript'>alert('$alertmessage')</script>\";\n return false;\n }\n // Remove ending page break if it is not needed.\n if ($breaks = array_keys($questions, 0)) {\n // Determine location of the last two page breaks.\n $end = end($breaks);\n $last = prev($breaks);\n $last = $last ? $last : -1;\n if (!$quiz->questionsperpage || (($end - $last - 1) < $quiz->questionsperpage)) {\n array_pop($questions);\n }\n }\n if (is_int($page) && $page >= 1) {\n $numofpages = substr_count(',' . $quiz->questions, ',0');\n if ($numofpages < $page) {\n // The page specified does not exist in quiz.\n $page = 0;\n } else {\n // Add ending page break - the following logic requires doing this at this point.\n $questions[] = 0;\n $currentpage = 1;\n $addnow = false;\n foreach ($questions as $question) {\n if ($question == 0) {\n $currentpage++;\n // The current page is the one after the one we want to add on.\n // So, we add the question before adding the current page.\n if ($currentpage == $page + 1) {\n $questionsnew[] = $id;\n }\n }\n $questionsnew[] = $question;\n }\n $questions = $questionsnew;\n }\n }\n if ($page == 0) {\n // Add question.\n $questions[] = $id;\n // Add ending page break.\n $questions[] = 0;\n }\n\n // Save new questionslist in database.\n $quiz->questions = implode(',', $questions);\n $DB->set_field('ipal', 'questions', $quiz->questions, array('id' => $quiz->id));\n\n}", "function questionAction() {\n // Get question parameter\n $id = $this->_getParam('id');\n if (! $id) {\n // Redirect back to stats when no ID is found\n $this->_redirect(\"/index/stats\");\n return;\n }\n\n // Fetch question\n $mapper = new Model_Question_Mapper();\n $question = $mapper->findByPk($id);\n if (! $question instanceof Model_Question_Entity) {\n $this->render(\"question/notfound\");\n return;\n }\n \n $this->view->question = $question;\n\n switch ($question->getStatus()) {\n case \"moderation\" :\n $this->render(\"question/moderation\");\n break;\n case \"pending\" :\n $this->render(\"question/pending\");\n break;\n case \"active\" :\n $this->render(\"question/active\");\n break;\n case \"done\" :\n $this->render(\"question/done\");\n break;\n default :\n $this->render(\"question/notfound\");\n break;\n }\n }", "function insert($id_question, $option_text)\r\n\t{\r\n\t\t$data = array(\r\n\t\t'option' => $option_text,\r\n\t\t'custom_questions_id' => $id_question\r\n\t\t\t\t);\r\n\r\n\t\treturn $this->db->insert($this->table, $data);\r\n\t}", "function get_id() {\n\t\treturn $this->get_data( 'id' );\n\t}", "function get_id()\r\n {\r\n return $this->id;\r\n }", "function selectQuestion($id_question)\n\t{\n\t\tglobal $dbh;\n\n\n\t\t$sql = \"SELECT \tQ.id_question,\n\t\t\t\t\t\tQ.title,\n\t\t\t\t\t\tQ.content,\n\t\t\t\t\t\tQ.dateCreated,\n\t\t\t\t\t\tQ.dateModified,\n\n\t\t\t\t\t\tU.id_user,\n\t\t\t\t\t\tU.user_pseudo,\n\t\t\t\t\t\tU.img_profile,\n\t\t\t\t\t\tU.score\n\n\t\t\t\tFROM users U, questions Q\t\t\t\t\n\t\t\t\tWHERE U.id_user = Q.id_user\n\t\t\t\tAND Q.id_question = :id_question\n\t\t\t\tORDER BY Q.dateModified DESC\";\n\n\t\t$stmt = $dbh->prepare($sql);\n\t\t$stmt->bindValue(\":id_question\", $id_question);\n\t\t$stmt->execute();\n\t\t\n\t\t//affiche\n\t\treturn $stmt->fetch();\n\t}", "public function getID();" ]
[ "0.6943603", "0.6625888", "0.6620147", "0.6485292", "0.646122", "0.64193916", "0.6412992", "0.63489366", "0.6264499", "0.6246965", "0.6167858", "0.61269164", "0.6101142", "0.6099936", "0.60713565", "0.60669065", "0.6066729", "0.60394335", "0.597819", "0.5964568", "0.5921454", "0.5907871", "0.58761525", "0.58550525", "0.5839333", "0.5820435", "0.5804715", "0.5798603", "0.5798308", "0.5788515", "0.5775299", "0.5711042", "0.5705273", "0.5685556", "0.5683126", "0.5682855", "0.56728125", "0.5666846", "0.5650931", "0.5649039", "0.5645688", "0.56434953", "0.5638965", "0.5638049", "0.5625188", "0.5616389", "0.5615568", "0.56090295", "0.5592987", "0.55908537", "0.5590177", "0.5580783", "0.55773413", "0.5573978", "0.55731475", "0.5571636", "0.55712676", "0.55712676", "0.55685747", "0.5561457", "0.5559673", "0.55574465", "0.55502814", "0.5546549", "0.5533447", "0.5530096", "0.5526836", "0.55243146", "0.55165726", "0.55152506", "0.5513203", "0.550535", "0.55034256", "0.55032897", "0.55032897", "0.5502363", "0.5502324", "0.5490884", "0.54901564", "0.5489648", "0.54872745", "0.54852223", "0.5484012", "0.5479433", "0.5474802", "0.5467004", "0.5464345", "0.54638916", "0.5457975", "0.5454507", "0.5447818", "0.54448175", "0.54438025", "0.54330254", "0.54310507", "0.5429377", "0.54241127", "0.54205805", "0.5419978", "0.541918", "0.54184383" ]
0.0
-1
get id in questions and add answers
function show_question($id, $slug) { $this->form_validation->set_rules('id_questions', 'Id_Questions', 'required'); $this->form_validation->set_rules('body', 'Body', 'required'); if ($this->form_validation->run() == false) { $this->model_module->_set_viewers($id); $data['question'] = $this->model_module->questions_id('uuid_question', $id); $questions_id = $data['question']['id']; $data['module'] = $this->model_module->get_module($questions_id, $id); $queryGetquestion = "SELECT `tb_questions` .*, `tbl_users`.`name`,`tbl_users`.`user_email` FROM `tb_questions` JOIN `tbl_users` ON `tb_questions`.`id_user` = `tbl_users`. `user_id` lEFT JOIN `tb_sub_module` ON `tb_questions`.`id_sub_module` = `tb_sub_module`.`id` WHERE `tb_questions`.`id` = $questions_id "; $query = $this->db->query($queryGetquestion)->row_array(); $data['get_question'] = $query; $answerQuery = "SELECT `tb_answers` .*, `tbl_users`.`name`,`tbl_users`.`user_email` FROM `tb_answers` JOIN `tb_questions` ON `tb_answers`.`id_questions` = `tb_questions`.`id` JOIN `tbl_users` ON `tb_answers`.`id_user` = `tbl_users`.`user_id` WHERE `tb_answers`.`id_questions` = $questions_id ORDER BY `tb_answers`.`created_at` DESC"; $answer = $this->db->query($answerQuery)->result_array(); $data['get_answer'] = $answer; // response_json($data); $this->load->view('layouts/header'); $this->load->view('_partalis/navigation'); $this->load->view('modules/show_questions', $data); $this->load->view('layouts/footer'); } else { $this->model_module->addAnswers(); redirect('user/module/show_question/' . $id . '/' . $slug); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function add_question($id)\n {\n $this->question_ids[] = $id;\n }", "function add_questions($formId, $q, $a, $qId, $qType){\n\n $questionsCount = count($qId);\n //Insert data in tables\n foreach ($q as $qkey => $qItem){\n $this->db->insert('questions', array(\n 'question_label' => $qItem,\n 'question_form' => $formId,\n 'question_type' => $qType[$qkey]\n ));\n\n $questId = $this->db->insert_id();\n\n for($i=0; $i<$questionsCount; $i++){\n if ($qId[$i]==$qkey){\n $this->db->insert('answers', array(\n 'ans_question' => $questId,\n 'ans_value' => $a[$i]\n ));\n }\n }\n }\n\n }", "function addQuestion($question_id)\n\t{\n\t\tarray_push($this->questions, $question_id);\n\t}", "public function addQuestionAndAnswers () {\n global $tpl, $ilTabs;\n $ilTabs->activateTab(\"editQuiz\");\n $this->initAddQuestionAndAnswersForm();\n }", "public function answersAction($id) {\n /**\n * Find all the comment answers to a comment in the commentanswer table.\n */\n $all_id = $this->commentanswer->find($id);\n\n /**\n * Save all id values of the comment answers in the $all vector.\n */\n $all = [];\n foreach ($all_id as $key => $value) {\n $all[] = $this->comments->find($value->idAnswer);\n }\n\n /**\n * Alter object by connecting comment tags, adding user information from the database and filtering markdown on the comment object.\n */\n $all = $this->doAll($all);\n\n /**\n * Get the original question.\n */\n $question[0] = $this->comments->find($id);\n\n /**\n * Alter object by connecting comment tags, adding user information from the database and filtering markdown on the comment object.\n */\n $question = $this->doAll($question);\n\n /**\n * Prepare the view.\n */\n $this->views->add('comment/commentsdb', [\n 'question' => $question,\n 'comments' => $all,\n 'title' => 'Question',\n 'content' => \"\",\n ]);\n }", "private function getAnswers($question){\n $answerModel = new Answer();\n $answers = $answerModel->where('id_qst',$question->id_qst)->findAll();\n $retMess = \"\";\n $this->answersId = [];\n foreach($answers as $answer){\n array_push($this->answersId,$answer->id_ans);\n $retMess .= \",\".$answer->text;\n }\n\n return $retMess;\n }", "public function getAnswersToQuestion($id)\n {\n $answers = new TestQuestion();\n $answers = $answers->find($id)->answers()->get();\n return $answers;\n }", "public function ask_add($author_id, $answer, $title = '', $id_quest=-1)\n\t{\n\t\t$sql = \"INSERT INTO \".$this->table_ask.\"(id_quest, title, text, date, author_id) VALUES(?, ?, ?, ?, ?)\";\n\t\t$data = array($id_quest, $title, $answer, time(), $author_id);\n\t\t$query = $this->db->query($sql, $data);\t\n\t}", "public function appendCorrectQuestionId($questionId);", "public function ask_get_answers($id)\n\t{\n\t\t$sql = \"SELECT *\n\t\t\t\tFROM \".$this->table_ask.\"\n\t\t\t\tWHERE id_quest = ?\";\n\t\t$data = array($id);\n\t\t$query = $this->db->query($sql, $data);\n\t\t$res = $query->result();\n\t\t$this->load->model('votes_model', 'votesManager');\n\t\tfor( $i=0; $i<count($res); $i++ ) {\n\t\t\t$val = $this->votesManager->votes_get_by_ask($res[$i]->id);\n\t\t\t$res[$i]->nb_votes = ($val) ? $val:0;\n\t\t}\n\n\t\t// The answers are sorted by number of votes\n\t\tusort($res, function($a, $b)\n\t\t{\n\t\t\tif($a->nb_votes == $b->nb_votes) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\treturn ($a->nb_votes < $b->nb_votes) ? 1 : -1;\n\t\t});\n\n\t\tif( $res )\n\t\t\treturn $res;\n\t\telse\n\t\t\treturn 0;\n\t}", "public function addAction()\n {\n /* Checking if user is signed in to be allowed to add new answer */\n $this->requireSignin();\n\n /* Getting Question by id */\n $question = Question::getById(intval($_POST['question_id']));\n\n if ($question) {\n\n /* Checking if question is not closed */\n if ($question->is_closed == 0 && $question->active == 1) {\n\n /* Creating new Answer's object */\n $answer = new Answer($_POST);\n\n /* Checking if answer is not empty */\n if (strlen($answer->answer) < 2) {\n\n /* Show error message and redirect to question's page */\n Flash::addMessage('You can not add emty answer', Flash::INFO);\n }\n\n /* Getting user's id and set it as question's user_id */\n $user = Auth::getUser();\n $answer->user_id = $user->id;\n\n $answerId = $answer->add();\n\n if ($answerId) {\n\n /* Send notification to question's author */\n Notification::add([\n 'to_user' => $question->user_id,\n 'question_id' => $question->id,\n 'answer_id' => $answerId,\n 'type' => 'na',\n 'from_user' => $answer->user_id,\n ]);\n\n /* Send notifications to users who are following question */\n $followers = FollowedQuestion::getFollowers($question->id);\n foreach ($followers as $follower) {\n\n Notification::add([\n 'to_user' => $follower['user_id'],\n 'question_id' => $question->id,\n 'answer_id' => $answerId,\n 'type' => 'na',\n 'from_user' => $answer->user_id,\n ]);\n }\n\n /* Send notifications to mentioned users */\n $mention_number = 0;\n preg_match_all('/(<span class=\"mention\" [^>]*value=\"([^\"]*)\"[^>]*)>(.*?)<\\/span><\\/span>/i', $answer->answer, $mentions);\n\n foreach($mentions[2] as $mention) {\n\n /* Allow max 10 mentions */\n if ($mention_number < 10) {\n\n /* Check if user exists */\n $this_user = User::getByUsername($mention);\n\n if ($this_user) {\n\n Notification::add([\n 'to_user' => $this_user->id,\n 'question_id' => $question->id,\n 'answer_id' => $answerId,\n 'type' => 'nm',\n 'from_user' => $answer->user_id,\n ]);\n }\n }\n }\n\n /* Redirect to question's page and show success message */\n Flash::addMessage('Answer added!', Flash::INFO);\n $this->redirect('/question/'.$question->url.'#answer_'.$answerId);\n\n } else {\n \n /* Redirect to question's page and show error messages */\n Flash::addMessage(\"Error: \".implode(\", \", $answer->errors), Flash::INFO);\n }\n\n } else {\n \n /* Redirect to question's page and show error message */\n Flash::addMessage('This question is closed for new answers.', Flash::INFO);\n }\n\n $this->redirect('/question/'.$question->url);\n\n } else {\n\n /* Redirect to stream page and show error messages */\n Flash::addMessage('This question is unavailable.', Flash::INFO);\n $this->redirect('/');\n }\n }", "public function getAnswersByQuestion($id){\n $question = $this::find()->with('answers')->where(['id' => $id])->one();\n $answers = '';\n $last_key = end(array_keys($question->answers));\n foreach ($question->answers as $key => $value) {\n if($value['dependent_question_id'] == null)\n $answers .= $value['answer_text'].' <a href='. Yii::$app->getUrlManager()->getBaseUrl().'/index.php?r=question/create&option_id='.$value['id'].'>Add Dependent Question</a> <br>';\n else\n $answers .= $value['answer_text'].' <a href='. Yii::$app->getUrlManager()->getBaseUrl().'/index.php?r=question/view&id='.$value['dependent_question_id'].'>See Dependent Question </a>, <a href='.Yii::$app->getUrlManager()->getBaseUrl().'/index.php?r=question/detach&option_id='.$value['id'].'> Detach Question</a><br>';\n }\n return $answers;\n }", "public function addanswersAction(Request $request, $poll_id) {\n $em = $this->getDoctrine()->getManager();\n $questions = $em->getRepository('PollPollBundle:QuestionImpl')->findBy(array('poll_id' => $poll_id));\n\n $form_data = $request->request->get('form');\n\n foreach($questions as $question) {\n $question_id = $question->getId();\n $question_type = $question->getQuestionType();\n $answer_text = $form_data[$question_id];\n if (in_array($question_type, array(\n ObjectFactory::TEXT_QUESTION,\n ObjectFactory::SINGLE_CHOICE_QUESTION))) {\n $answer = new AnswerImpl();\n $answer->setAnswerType($question->getQuestionType());\n $answer->setAnswerText($answer_text);\n $answer->setQuestionEntity($question);\n $answer->setPoll($question->getPollId());\n if ($question_type == ObjectFactory::SINGLE_CHOICE_QUESTION) {\n $option = $em->getRepository('PollPollBundle:Choice\\OptionImpl')->find($answer_text);\n $answer->addOption($option);\n }\n $em->persist($answer);\n } else if ($question_type == ObjectFactory::MULTIPLE_CHOICE_QUESTION) {\n foreach($answer_text as $ans) {\n $answer = new AnswerImpl();\n $answer->setAnswerType($question->getQuestionType());\n $answer->setAnswerText($ans);\n $answer->setQuestionEntity($question);\n $answer->setPoll($question->getPollId());\n $option = $em->getRepository('PollPollBundle:Choice\\OptionImpl')->find($ans);\n $answer->addOption($option);\n $em->persist($answer);\n }\n } else {\n throw new \\Exception(\"Invalid question type.\");\n }\n }\n\n $em->flush();\n return $this->redirect($this->generateUrl('poll_show_all'));\n }", "public function addansw()\n\t{\n\t\t\n\t\tif(mayEditQuiz())\n\t\t{\n\t\t\tif(isset($_GET['text']) && isset($_GET['right']) && isset($_GET['qid']))\n\t\t\t{\n\t\t\t\t$text = strip_tags($_GET['text']);\n\t\t\t\t$exp = strip_tags($_GET['explanation']);\n\t\t\t\t$right = (int)$_GET['right'];\n\t\t\n\t\t\t\tif(!empty($text) && ($right == 0 || $right == 1 || $right == 2))\n\t\t\t\t{\n\t\t\t\t\tif($id = $this->model->addAnswer($_GET['qid'],$text,$exp,$right))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn array(\n\t\t\t\t\t\t\t\t'status' => 1,\n\t\t\t\t\t\t\t\t'script' => 'pulseInfo(\"Antwort wurde angelegt\");$(\"#answerlist-'.(int)$_GET['qid'].'\").append(\\'<li class=\"right-'.(int)$right.'\">'.jsSafe(nl2br(strip_tags($text))).'</li>\\');$( \"#questions\" ).accordion( \"refresh\" );'\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn array(\n\t\t\t\t\t\t\t'status' => 1,\n\t\t\t\t\t\t\t'script' => 'pulseError(\"Du solltest einen Text angeben ;)\");'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public function store(ExamQuestionRequest $request, $id)\n {\n //\n try{\n\n $question = new Question();\n $question->exam_id = $id;\n $question->question = $request->question;\n $question->type = $request->q_type;\n $question->sol = $request->co;\n $question->save();\n $x = $request->q_type == 0 ? 4 : 2 ;\n for($i = 1 ; $i <= $x ; $i++){\n $answer = new Answer();\n $answer->answer = $request->a[$i - 1];\n $answer->true = $i == $request->co ? 1 : 0 ;\n $answer->question_id = $question->id;\n $answer->save();\n }\n\n } catch(Exception $e) {\n return redirect()->back()->with([\n 'alert'=>[\n 'icon'=>'error',\n 'title'=>__('site.alert_failed'),\n 'text'=>__('site.question_failed_add'),\n ]]);\n }\n return redirect('admin/exam/'.$id.'/questions')->with([\n 'alert'=>[\n 'icon'=>'success',\n 'title'=>__('site.done'),\n 'text'=>__('site.added successfully'),\n ]]);\n\n }", "function getQuestion($id) { \n\ttry {\n\t\t$question = ORM::for_table('questions')->where('id', $id)->find_one();\n\t\tif (!$question) { \n\t\t\treturn 0;\n\t\t} else {\n\t\t\t$theQuestion = array();\n\t\t\t$theQuestion['id'] = $question->id;\n\t\t\t$theQuestion['text'] = $question->text;\n\t\t\t$theQuestion['answer1'] = $question->answer1;\n\t\t\t$theQuestion['answer2'] = $question->answer2;\n\t\t\t$theQuestion['vote_answer1'] = $question->vote_answer1;\n\t\t\t$theQuestion['vote_answer2'] = $question->vote_answer2;\n\t\t\treturn $theQuestion;\n\t\t}\n\t} catch (Exception $e) { \n\t\treturn 0;\n\t}\n}", "function target_add_poll_question($q)\n{\n\t$qid = db_qid('INSERT INTO '. $GLOBALS['DBHOST_TBL_PREFIX'] .'poll_opt (poll_id, name)\n\t\tVALUES('. (int)$q['id'] .', '. _esc($q['name']) .')');\n\treturn $qid;\n}", "function ipal_get_answers($question_id){\r\n\tglobal $ipal;\r\n\tglobal $DB;\r\n\tglobal $CFG;\r\n\t$line=\"\";\r\n\t$answers=$DB->get_records('question_answers',array('question'=>$question_id));\r\n\t\t foreach($answers as $answers){\r\n\t\t\t $line .= $answers->answer;\r\n\t\t\t $line .= \"&nbsp;\";\r\n\t\t }\r\n\treturn($line);\r\n}", "function add_answer () {\n\t\t$_GET[\"id\"] = intval($_GET[\"id\"]);\n\t\t$OBJECT_ID\t\t= $_GET[\"id\"];\n\t\t$OBJECT_NAME\t= \"help\";\n\t\t// Try to get record info\n\t\t$ticket_info = db()->query_fetch(\"SELECT * FROM \".db('help_tickets').\" WHERE id=\".intval($_GET[\"id\"]));\n\t\tif (empty($ticket_info)) {\n\t\t\treturn _e(\"No such ticket\");\n\t\t}\n\t\t// Do add answer\n\t\tif (count($_POST) > 0) {\n\t\t\t// Check for errors\n\t\t\tif (!common()->_error_exists()) {\n\t\t\t\tif (empty($_POST[\"text\"])) {\n\t\t\t\t\t_re(\"answer text required\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Prepare ticket id\n\t\t\t$TICKET_ID = $ticket_info[\"ticket_key\"];\n\t\t\t// Do get current admin info\n\t\t\t$admin_info = db()->query_fetch(\"SELECT * FROM \".db('admin').\" WHERE id=\".intval($_SESSION[\"admin_id\"]));\n\t\t\t$admin_name = $admin_info[\"first_name\"].\" \".$admin_info[\"last_name\"];\n\t\t\t// Check for errors\n\t\t\tif (!common()->_error_exists()) {\n\t\t\t\t// Do insert record\n\t\t\t\tdb()->INSERT(\"comments\", array(\n\t\t\t\t\t\"object_name\"\t\t=> _es($OBJECT_NAME),\n\t\t\t\t\t\"object_id\"\t\t\t=> intval($OBJECT_ID),\n\t\t\t\t\t\"user_id\"\t\t\t=> 0,\n\t\t\t\t\t\"user_name\"\t\t\t=> _es(\"Admin: \".$admin_name),\n\t\t\t\t\t\"text\" \t\t\t\t=> _es($_POST[\"text\"]),\n\t\t\t\t\t\"add_date\"\t\t\t=> time(),\n\t\t\t\t\t\"active\"\t\t\t=> 1,\n\t\t\t\t));\n\t\t\t\t$RECORD_ID = db()->INSERT_ID();\n\t\t\t}\n\t\t\t// Add activity points for registered user if needed\n\t\t\tif (!common()->_error_exists()) {\n\t\t\t\tif (!empty($ticket_info[\"user_id\"]) && !empty($_POST[\"add_activity\"])) {\n\t\t\t\t\tcommon()->_add_activity_points($ticket_info[\"user_id\"], \"bug_report\", 1000, $RECORD_ID);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Try to send mail to user\n\t\t\tif (!common()->_error_exists()) {\n\t\t\t\t// Get first site info\n\t\t\t\tif (is_array(_class('sites_info')->info))\t{\n\t\t\t\t\t$FIRST_SITE_INFO = array_shift(_class('sites_info')->info);\n\t\t\t\t}\n\t\t\t\tif (!common()->_error_exists()) {\n\t\t\t\t\t$replace = array(\n\t\t\t\t\t\t\"name\"\t\t\t\t=> _prepare_html($ticket_info[\"name\"]),\n\t\t\t\t\t\t\"site_name\"\t\t\t=> _prepare_html($FIRST_SITE_INFO[\"name\"]),\n\t\t\t\t\t\t\"author_name\"\t\t=> _prepare_html($this->ADD_ADMIN_NAME ? SITE_ADVERT_NAME.\" Admin \".$admin_name : SITE_ADMIN_NAME),\n\t\t\t\t\t\t\"text\"\t\t\t\t=> _prepare_html($_POST[\"text\"]),\n\t\t\t\t\t\t\"ticket_id\"\t\t\t=> _prepare_html($TICKET_ID),\n\t\t\t\t\t\t\"ticket_url\"\t\t=> process_url(\"./?object=help&action=view_answers&id=\".$TICKET_ID, 1, $ticket_info[\"site_id\"]),\n\t\t\t\t\t\t\"request_subject\"\t=> _prepare_html($ticket_info[\"subject\"]),\n\t\t\t\t\t\t\"request_message\"\t=> _prepare_html($ticket_info[\"message\"]),\n\t\t\t\t\t);\n\t\t\t\t\t$text\t\t= tpl()->parse($_GET[\"object\"].\"/email_to_user\", $replace);\n\t\t\t\t\t$email_from\t= SITE_ADMIN_EMAIL;\n\t\t\t\t\t$name_from\t= $this->ADD_ADMIN_NAME ? SITE_ADVERT_NAME.\" Admin \".$admin_name : SITE_ADMIN_NAME;\n\t\t\t\t\t$email_to\t= $ticket_info[\"email\"];\n\t\t\t\t\t$name_to\t= _prepare_html($ticket_info[\"name\"]);\n\t\t\t\t\t$subject\t= \"Response to support ticket #\".$TICKET_ID;\n\t\t\t\t\t$result\t\t= common()->send_mail($email_from, $name_from, $email_to, $name_to, $subject, $text, nl2br($text));\n\t\t\t\t\t// Check if email is sent - else show error\n\t\t\t\t\tif (!$result) {\n\t\t\t\t\t\t//\n\t\t\t\t\t}\n\t\t\t\t\tif (defined(\"ADMIN_DUPLICATE_EMAIL\") && ADMIN_DUPLICATE_EMAIL) {\n\t\t\t\t\t\t$email_to\t= ADMIN_DUPLICATE_EMAIL;\n\t\t\t\t\t\t$subject\t= \"FWD: Response to support ticket #\".$TICKET_ID;\n\t\t\t\t\t\tcommon()->send_mail($email_from, $name_from, $email_to, $name_to, $subject, $text, nl2br($text));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!common()->_error_exists()) {\n\t\t\t\t// Do close ticket if needed\n\t\t\t\tif (!empty($_POST[\"close_ticket\"])) {\n\t\t\t\t\tdb()->UPDATE(\"help_tickets\", array(\"status\" => \"closed\"), \"id=\".intval($_GET[\"id\"]));\n\t\t\t\t\t// Return user to tickets list\n\t\t\t\t\treturn js_redirect(\"./?object=\".$_GET[\"object\"]);\n\t\t\t\t}\n\t\t\t\t// Return user back\n\t\t\t\treturn js_redirect(\"./?object=\".$_GET[\"object\"].\"&action=edit&id=\".$_GET[\"id\"]);\n\t\t\t}\n\t\t}\n\t\t$error_message = _e();\n\t\t// Display form\n\t\tif (empty($_POST[\"go\"]) || !empty($error_message)) {\n\t\t\t$replace = array(\n\t\t\t\t\"answer_form_action\"=> \"./?object=\".$_GET[\"object\"].\"&action=\".__FUNCTION__.\"&id=\".$_GET[\"id\"],\n\t\t\t\t\"error_message\"\t\t=> $error_message,\n\t\t\t\t\"text\"\t\t\t\t=> _prepare_html($_POST[\"text\"]),\n\t\t\t\t\"object_id\"\t\t\t=> intval($OBJECT_ID),\n\t\t\t\t\"bb_codes_block\"\t=> $this->USE_BB_CODES ? _class(\"bb_codes\")->_display_buttons(array(\"unique_id\" => \"text\")) : \"\",\n\t\t\t\t\"for_edit\"\t\t\t=> 0,\n\t\t\t);\n\t\t\t$body = tpl()->parse($_GET[\"object\"].\"/answers_edit_form\", $replace);\n\t\t}\n\t\treturn $body;\n\t}", "public static function insertSurvey()\n\t{\n\t\tif(isset($_POST['SurveyID']) && (is_numeric($_POST['SurveyID'])))\n\t\t{//insert response!\n\t\t\t$iConn = IDB::conn();\n\t\t\t// turn off auto-commit\n\t\t\tmysqli_autocommit($iConn, FALSE);\n\t\t\t//insert response\n\t\t\t$sql = sprintf(\"INSERT into \" . PREFIX . \"responses(SurveyID,DateAdded) VALUES ('%d',NOW())\",$_POST['SurveyID']);\n\t\t\t$result = @mysqli_query($iConn,$sql); //moved or die() below!\n\t\t\t\n\t\t\tif(!$result)\n\t\t\t{// if error, roll back transaction\n\t\t\t\tmysqli_rollback($iConn);\n\t\t\t\tdie(trigger_error(\"Error Entering Response: \" . mysqli_error($iConn), E_USER_ERROR));\n\t\t\t} \n\t\t\t\n\t\t\t//retrieve responseid\n\t\t\t$ResponseID = mysqli_insert_id($iConn); //get ID of last record inserted\n\t\t\t\n\t\t\tif(!$result)\n\t\t\t{// if error, roll back transaction\n\t\t\t\tmysqli_rollback($iConn);\n\t\t\t\tdie(trigger_error(\"Error Retrieving ResponseID: \" . mysqli_error($iConn), E_USER_ERROR));\n\t\t\t} \n\t\n\t\t\t//loop through and insert answers\n\t\t\tforeach($_POST as $varName=> $value)\n\t\t\t{//add objects to collection\n\t\t\t\t $qTest = substr($varName,0,2); //check for \"obj_\" added to numeric type\n\t\t\t\t if($qTest==\"q_\")\n\t\t\t\t {//add choice!\n\t\t\t\t \t$QuestionID = substr($varName,2); //identify question\n\t\t\t\t \t\n\t\t\t\t \tif(is_array($_POST[$varName]))\n\t\t\t\t \t{//checkboxes are arrays, and we need to loop through each checked item to insert\n\t\t\t\t\t \twhile (list ($key,$value) = @each($_POST[$varName])){\n\t\t\t\t\t\t \t$sql = \"insert into \" . PREFIX . \"responses_answers(ResponseID,QuestionID,AnswerID) values($ResponseID,$QuestionID,$value)\";\n\t\t\t\t\t \t\t$result = @mysqli_query($iConn,$sql);\n\t\t\t\t\t \t\tif(!$result)\n\t\t\t\t\t\t\t{// if error, roll back transaction\n\t\t\t\t\t\t\t\tmysqli_rollback($iConn);\n\t\t\t\t\t\t\t\tdie(trigger_error(\"Error Inserting Choice (array/checkbox): \" . mysqli_error($iConn), E_USER_ERROR));\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t}\n\t\t\t \t\t}else{//not an array, so likely radio or select\n\t\t\t\t \t\t$sql = \"insert into \" . PREFIX . \"responses_answers(ResponseID,QuestionID,AnswerID) values($ResponseID,$QuestionID,$value)\";\n\t\t\t\t \t $result = @mysqli_query($iConn,$sql);\n\t\t\t\t \t if(!$result)\n\t\t\t\t\t\t{// if error, roll back transaction\n\t\t\t\t\t\t\tmysqli_rollback($iConn);\n\t\t\t\t\t\t\tdie(trigger_error(\"Error Inserting Choice (single/radio): \" . mysqli_error($iConn), E_USER_ERROR));\n\t\t\t\t\t\t} \n\t\t\t \t\t}\n\t\t\t\t }\n\t\t\t}\n\t\t\t//we got this far, lets COMMIT!\n\t\t\tmysqli_commit($iConn);\n\t\t\t\n\t\t\t// our transaction is over, turn autocommit back on\n\t\t\tmysqli_autocommit($iConn, TRUE);\n\t\t\t\n\t\t\t//count total responses, update TotalResponses\n\t\t\tself::responseCount((int)$_POST['SurveyID']); //convert to int on way in!\n\t\t\treturn TRUE; #\n\t\t}else{\n\t\t\treturn FALSE;\t\n\t\t}\n\n\t}", "function ipal_get_answers_student($question_id){\r\n global $ipal;\r\n global $DB;\r\n global $CFG;\r\n\r\n\t$answerarray=array(); \r\n\t$line=\"\";\r\n\t$answers=$DB->get_records('question_answers',array('question'=>$question_id));\r\n\t\t\tforeach($answers as $answers){\r\n\t\t\t\t$answerarray[$answers->id]=$answers->answer; \r\n\t\t\t}\r\n\t\t\t\r\n\treturn($answerarray);\r\n}", "public function question($id)\n {\n return $this->create($id);\n }", "public function getAnswer($id)\n { \n $data['id'] = $id;\n $id = Crypt::decrypt($id);\n $this->answerObj = new Answers;\n $data['answers'] = $this->answerObj->getAnswers($id)->toArray();\n return view(\"Answers::add\",$data);\n }", "function add_form($params, $q, $a, $qId, $qType, $answersScore, $questionsScore)\n {\n// var_dump($scores);\n// die();\n $this->db->insert('forms',$params);\n $formId = $this->db->insert_id();\n\n $questionsCount = count($qId);\n //Insert data in tables\n foreach ($q as $qkey => $qItem){\n $this->db->insert('questions', array(\n 'question_label' => $qItem,\n 'question_form' => $formId,\n 'question_type' => $qType[$qkey],\n 'question_score' => $questionsScore[$qkey]\n ));\n\n $questId = $this->db->insert_id();\n\n for($i=0; $i<$questionsCount; $i++){\n if ($qId[$i]==$qkey){\n $this->db->insert('answers', array(\n 'ans_question' => $questId,\n 'ans_value' => $a[$i],\n 'ans_score' => $answersScore[$i]+1\n ));\n }\n }\n }\n\n return $formId;\n }", "function AddTesteeQuestions($testEntryID, $examQAs)\n {\n try\n {\n if (count($examQAs) < 1)\n {\n return;\n }\n \n $db = GetDBConnection();\n \n $qCount = 1;\n $questions = array();\n foreach ($examQAs as $qa)\n {\n $questionID = $qa->GetQuestionId();\n $question = GetQuestion($questionID);\n \n if ($question != FALSE)\n {\n $aCount = 1;\n $answers = GetQuestionAnswers($questionID);\n \n for ($i = 0; $i < count($answers); $i++)\n {\n $chosen = '0';\n $answer = $answers[$i];\n $answer['AnswerNo'] = $aCount;\n \n if ($answer[GetAnswerIdIdentifier()] == $qa->GetAnswerId())\n {\n $chosen = '1';\n }\n \n $answer['Chosen'] = $chosen;\n \n $answers[$i] = $answer;\n \n $aCount++;\n }\n \n $question['QuestionNo'] = $qCount;\n $question['Answers'] = $answers;\n \n $questions[] = $question;\n \n $qCount++;\n }\n }\n \n $qQuery = 'INSERT INTO ' . GetTesteeQuestionsIdentifier()\n . ' (' . GetTestIdIdentifier()\n . ', ' . 'QuestionNo'\n . ', ' . 'Level'\n . ', ' . 'Instructions'\n . ', ' . 'Question' . ') VALUES';\n \n $aQuery = 'INSERT INTO ' . GetTesteeAnswersIdentifier()\n . ' (' . GetTestIdIdentifier()\n . ', ' . 'QuestionNo'\n . ', ' . 'AnswerNo'\n . ', ' . 'Answer'\n . ', ' . 'Correct'\n . ', ' . 'Chosen' . ') VALUES';\n \n foreach($questions as $question)\n {\n $answers = $question['Answers'];\n $questionNo = $question['QuestionNo'];\n \n $qQuery .= ' (:' . GetTestIdIdentifier()\n . ', :' . 'QuestionNo' . $questionNo\n . ', :' . 'Level' . $questionNo\n . ', :' . 'Instructions' . $questionNo\n . ', :' . 'Question' . $questionNo . '),';\n \n foreach($answers as $answer)\n {\n $answerNo = $answer['AnswerNo'];\n \n $aQuery .= ' (:' . GetTestIdIdentifier()\n . ', :' . 'QuestionNo' . $questionNo . $answerNo\n . ', :' . 'AnswerNo' . $questionNo . $answerNo\n . ', :' . 'Answer' . $questionNo . $answerNo\n . ', :' . 'Correct' . $questionNo . $answerNo\n . ', :' . 'Chosen' . $questionNo . $answerNo . '),';\n }\n }\n \n $qQuery = rtrim($qQuery, ',') . ';';\n $aQuery = rtrim($aQuery, ',') . ';';\n \n $qStatement = $db->prepare($qQuery);\n $aStatement = $db->prepare($aQuery);\n \n foreach($questions as $question)\n {\n $answers = $question['Answers'];\n $questionNo = $question['QuestionNo'];\n \n foreach($answers as $answer)\n {\n $answerNo = $answer['AnswerNo'];\n \n $aStatement->bindValue(':' . GetTestIdIdentifier(), $testEntryID);\n $aStatement->bindValue(':' . 'QuestionNo' . $questionNo . $answerNo, $questionNo);\n $aStatement->bindValue(':' . 'AnswerNo' . $questionNo . $answerNo, $answerNo);\n $aStatement->bindValue(':' . 'Answer' . $questionNo . $answerNo, $answer[GetNameIdentifier()]);\n $aStatement->bindValue(':' . 'Chosen' . $questionNo . $answerNo, $answer['Chosen']);\n $aStatement->bindValue(':' . 'Correct' . $questionNo . $answerNo, $answer['Correct']);\n }\n \n $qStatement->bindValue(':' . GetTestIdIdentifier(), $testEntryID);\n $qStatement->bindValue(':' . 'QuestionNo' . $questionNo, $questionNo);\n $qStatement->bindValue(':' . 'Level' . $questionNo, $question['Level']);\n $qStatement->bindValue(':' . 'Instructions' . $questionNo, $question['Instructions']);\n $qStatement->bindValue(':' . 'Question' . $questionNo, $question[GetNameIdentifier()]);\n }\n \n $qStatement->execute();\n $qStatement->closeCursor();\n \n $aStatement->execute();\n $aStatement->closeCursor();\n }\n catch (PDOException $ex)\n {\n LogError($ex);\n }\n }", "public function getQuestionIds(){\n\t\treturn array('todo'); // This will be moved to QuestionTemplate\n\t}", "function post_answers($questions) {\n $id = $this->license_type;\n if (isset($id) && $id != 'none') {\n\n // required header\n $headers = array();\n $headers['Content-Type'] = 'application/x-www-form-urlencoded';\n\n // request\n $uri = 'http://api.creativecommons.org/rest/license/'.$id.'/issue';\n\n foreach ($questions as $q => $a)\n $answer_xml .= \"<$q>\".$a['selected'].\"</$q>\";\n $answer_xml = \"<answers><license-$id>$answer_xml</license-$id></answers>\";\n\n // post to cc api\n $post_data = 'answers='.urlencode($answer_xml).\"\\n\";\n $response = drupal_http_request($uri, $headers, 'POST', $post_data);\n if ($response->code == 200)\n return $response->data;\n }\n return;\n }", "function addAnswer($research_id,$UID,$question_id,$time,$answer){\r\n\t\t//Check correct query to add answer\r\n\t\t$q = new Question(0,$question_id);\r\n\t\t$query_id = $q->getOwner();\r\n\t\tif(isset($query_id)){\r\n\t\t\t$this->dbq->addAnswer($research_id,$UID,$query_id,$question_id,$time,$answer);\r\n\t\t}\r\n\t}", "public function run()\n {\n //answers for question1\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 1\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 1\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 1\n ]);\n //answers for question2\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 2\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 2\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 2\n ]);\n //answers for question3\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 3\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 3\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 3\n ]);\n //answers for question4\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 4\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 4\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 4\n ]);\n //answers for question5\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 5\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 5\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 5\n ]);\n //answers for question6\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 6\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 6\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 6\n ]);\n //answers for question7\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 7\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 7\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 7\n ]);\n //answers for question8\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 8\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 8\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 8\n ]);\n //answers for question9\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 9\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 9\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 9\n ]);\n //answers for question10\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 10\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 10\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 10\n ]);\n //answers for question11\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 11\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 11\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 11\n ]);\n //answers for question12\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 12\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 12\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 12\n ]);\n //answers for question13\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 13\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 13\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 13\n ]);\n //answers for question14\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 14\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 14\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 14\n ]);\n //answers for question15\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 15\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 15\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 15\n ]);\n //answers for question16\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 16\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 16\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 16\n ]);\n //answers for question17\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 17\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 17\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 17\n ]);\n //answers for question18\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 18\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 18\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 18\n ]);\n //answers for question19\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 19\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 19\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 19\n ]);\n //answers for question20\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 20\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 20\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 20\n ]);\n //answers for question21\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 21\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 21\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 21\n ]);\n //answers for question22\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 22\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 22\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 22\n ]);\n //answers for question23\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 23\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 23\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 23\n ]);\n //answers for question24\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 24\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 24\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 24\n ]);\n //answers for question25\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 25\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 25\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 25\n ]);\n //answers for question26\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 26\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 26\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 26\n ]);\n //answers for question27\n DB::table('answers')->insert([\n 'description' => 'Mal',\n 'question_id' => 27\n ]);\n DB::table('answers')->insert([\n 'description' => 'Regular',\n 'question_id' => 27\n ]);\n DB::table('answers')->insert([\n 'description' => 'Muy Bien',\n 'question_id' => 27\n ]);\n }", "public function getAnswers($id)\n {\n $Answer = new Answer();\n $answers = $Answer->where('idquestion', '=', $id)->orderBy('id','ASC')->get();\n $Question=new Question();\n $question = $Question->where('id', '=', $id)->first();\n return View::make(\"/questions\")->with(array('question'=>$question,'answers'=>$answers)); \n }", "function answers()\r\n {\r\n $returnArray = array();\r\n $db =& eZDB::globalDatabase();\r\n $db->array_query( $questionArray, \"SELECT ID FROM eZQuiz_Answer WHERE AlternativeID='$this->ID'\" );\r\n\r\n for ( $i = 0; $i < count( $questionArray ); $i++ )\r\n {\r\n $returnArray[$i] = new eZQuizAnswer( $questionArray[$i][$db->fieldName( \"ID\" )], true );\r\n }\r\n return $returnArray;\r\n }", "public function answers($id)\n {\n if(!(php_sapi_name() == 'cli-server'))\n return 403;\n\n $m = new SurveyMatcher();\n $p = $m->getParticipantById($id);\n\n if(sizeof($p) == 0) return 404;\n\n $ig = array('interested_0', 'interested_1', 'send_results');\n foreach($p as $k => $v) {\n if(in_array($k, $ig) && $v == 0)\n continue;\n $this->request->post[$k] = $v;\n }\n\n return $this->form(array('*' => 'This survey is read-only.'));\n }", "public function save(Request $request, $id = null)\n {\n $editing = $request->getMethod() == \"PUT\";\n\n if( !$editing && request('questions' ) && is_array(request('questions') ) ) {\n return $this->saveBundle( $request );\n }\n\n $question = $editing ? Question::find( $id ):new Question( );\n\n if( !$question )\n return $this->setAndGetResponse( 'message' , 'Quiz not found!');\n\n $uniqueQuestion = Rule::unique('questions' )->where(function ($query) {\n return $query->where( [ 'answer' => request('answer' ) ]);\n });\n\n if( $editing ) {\n $uniqueQuestion->ignore( $id );\n }\n\n $data = $request->validate([\n 'title' => ['required', $uniqueQuestion],\n 'hidden' => 'numeric',\n 'description' => 'max:800',\n 'categories' => 'required',\n 'option_sets' => 'array'\n ]);\n\n $question->title = $data[ 'title' ];\n $question->answer = request( 'answer' );\n $question->description = $data[ 'description' ];\n $question->user_id = $request->user()->id;\n $question->hidden = request( 'hidden' )?:0;\n\n $data_opt_sets = $data['option_sets'];\n\n\n //dd($question);\n\n $question->save( );\n\n $this->set( 'meta_message', '' );\n\n foreach( $data_opt_sets as $set ){\n $name = isset($set['meta_name']) ? $set['meta_name']:'';\n $option_string = isset($set['option_string']) ? $set['option_string']:'';\n\n try{\n \\GuzzleHttp\\json_decode($option_string);\n $question->save_meta( $name, $option_string, 'opts',\n isset($set['meta_id']) ? $set['meta_id']:0 );\n }catch ( GuzzleException $e ){\n $this->set( 'meta_message', 'Invalid question option set' );\n }\n }\n\n\n $catResult = Category::addRelation( request('categories'), $question->id, 'question-subject' );\n\n $this->set( 'message', $editing ? 'Question updated' : 'Question added' );\n $this->set( 'action', $editing ? 'updated' : 'added' );\n $this->set( 'success', true );\n $this->set( 'data', new QuestionResource($question) );\n $this->set( 'categories', $catResult );\n\n return $this->response();\n }", "function saveQuestionArray($questions, $project_id) {\n\n\t// Loop through questions array, do Insert query for each\n\t$questions_ids = array();\n\n\t$i = 0;\n\tforeach($questions as $question) {\n\t\t$i++;\n\n\t\tDB::insert('question', array(\n\t\t\t'question_project_id' => $project_id,\n\t\t\t'question_title' => $question,\n\t\t\t'question_number' => $i\n\t\t));\n\n // Get the inserted question ID, needed to insert questions\n $question_id = DB::insertId();\n\n // Get the inserted question_id and add to return array\n array_push($questions_ids, DB::insertId());\n\n // TODO do this on seperate question assign page\n // NOTE also insert questions_has_experts to simulate the assigning experts process\n DB::insert('question_has_experts', array(\n 'user_id' => 2,\n 'question_id' => $question_id\n ));\n\n\t}\n\n\t// Return the project ID\n\treturn $questions_ids;\n}", "function surveyQuestion($id = null) {\n $this->autoRender = false; // turn off autoRender because there is no view named surveyQuestion\n $this->layout = 'ajax'; // use the blank ajax layout\n if($this->request->is('ajax')) { // only proceed if this is an ajax request\n if (!$this->request->is('post')) {\n if ($id != null) { // existing question being edited so retrieve it from the session\n if ($this->Session->check('SurveyQuestion.new')) {\n $tempData = $this->Session->read('SurveyQuestion.new');\n $this->set('question_index', $id);\n $question = $tempData[$id];\n $question['Choice']['value'] = $this->Survey->Question->Choice->CombineChoices($question['Choice']);\n $this->request->data['Question'] = $question; // send the existing question to the view\n }\n }\n $this->render('/Elements/question_form');\n } else { // returning with data from the form here\n $tempArr = null;\n if ($this->Session->check('SurveyQuestion.new')) {\n $tempArr = $this->Session->read('SurveyQuestion.new');\n }\n $this->request->data['Question']['Choice'] = $this->Survey->Question->Choice->SplitChoices($this->request->data['Question']['Choice']['value']);\n $this->Survey->Question->set($this->request->data);\n $checkfieldsArr = $this->Survey->Question->schema();\n unset($checkfieldsArr['id']);\n unset($checkfieldsArr['survey_id']);\n unset($checkfieldsArr['order']);\n $checkfields = array_keys($checkfieldsArr);\n if ($this->Survey->Question->validates(array('fieldList' => $checkfields))) {\n if (is_null($id)) {\n $tempArr[] = $this->request->data['Question'];\n } else {\n $tempArr[$id] = $this->request->data['Question'];\n }\n $this->Session->write('SurveyQuestion.new',$tempArr);\n } else {\n $errors = $this->Survey->Question->invalidFields();\n $this->Session->setFlash('Invalid question: '.$errors['question'][0], true, null, 'error');\n }\n $this->set('questions', $tempArr);\n $this->layout = 'ajax';\n $this->render('/Elements/manage_questions');\n }\n }\n }", "function upQuestion($id = null) {\n $this->autoRender = false; // turn off autoRender because there is no deleteQuestions view\n if($this->request->is('ajax')) {\n // only process ajax requests\n $tempArr = null;\n if ($this->Session->check('SurveyQuestion.new')) {\n //check for the session variable containing questions for this survey\n $tempArr = $this->Session->read('SurveyQuestion.new'); // get temp working copy of questions\n $swapone = $tempArr[$id];\n $swaptwo = $tempArr[$id-1];\n $tempArr[$id-1] = $swapone;\n $tempArr[$id] = $swaptwo;\n }\n $this->Session->write('SurveyQuestion.new',$tempArr); // write the new question array to the session\n $this->set('questions', $tempArr); // send the questions to the view\n $this->layout = 'ajax'; // use the blank ajax layout\n $this->render('/Elements/manage_questions'); // send the element to the receiving element in the view\n }\n }", "public function changeQuestionAndAnswers () {\n global $ilUser, $tpl, $ilTabs, $ilCtrl;\n $ilTabs->activateTab(\"editQuiz\");\n\n // update database\n // create wizard object\n include_once('class.ilObjMobileQuizWizard.php');\n $wiz = new ilObjMobileQuizWizard();\n $wiz->changeQuestionAndAnswers($this->object);\n\n $_GET['question_id'] = $_POST['question_id'];\n $this->initQuestionAndAnswersEditForm();\n\n // load changed data and display them\n }", "public function run()\n {\n DB::table('answers')->insert([\n [\n 'question_id' => 1, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 1, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Cada mes o menos ',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 1, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '2 a 4 veces al mes',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 1, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '2 o más veces a la semana',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 1, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '4 o más veces a la semana ',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 2, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '1 a 2',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 2, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '3 a 4',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 2, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '5 a 6',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 2, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '7 a 9',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 2, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '10 o más',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 3, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 3, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Menos de una vez al mes',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 3, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Una vez al mes',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 3, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Una vez a la semana',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 3, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Diario o casi diario',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 4, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 4, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Menos de una vez al mes',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 4, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Una vez al mes',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 4, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Una vez a la semana',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 4, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Diario o casi diario',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 5, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 5, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Menos de una vez al mes',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 5, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Una vez al mes',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 5, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Una vez a la semana',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 5, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Diario o casi diario',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 6, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 6, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Menos de una vez al mes',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 6, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Una vez al mes',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 6, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Una vez a la semana',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 6, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Diario o casi diario',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 7, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 7, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Menos de una vez al mes',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 7, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Una vez al mes',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 7, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Una vez a la semana',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 7, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Diario o casi diario',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 8, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 8, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Menos de una vez al mes',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 8, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Una vez al mes',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 8, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Una vez a la semana',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 8, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Diario o casi diario',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 9, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 9, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Sí, pero no en el último año ',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 9, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Sí, durante el último año ',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 10, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 10, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Sí, pero no en el último año ',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 10, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Sí, durante el último año ',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 11, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 11, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 12, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 12, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '1 ó 2 veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 12, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Cada mes',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 12, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Cada semana',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 12, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Diario o casi diario',\n 'value' => 6,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 13, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 13, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '1 ó 2 veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 13, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Cada mes',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 13, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Cada semana',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 13, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Diario o casi diario',\n 'value' => 6,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 14, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 14, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '1 ó 2 veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 14, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Cada mes',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 14, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Cada semana',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 14, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Diario o casi diario',\n 'value' => 6,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 15, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 15, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '1 ó 2 veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 15, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Cada mes',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 15, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Cada semana',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 15, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Diario o casi diario',\n 'value' => 6,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 16, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 16, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si, pero no en los últimos 3 mese',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 16, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si, en los últimos 3',\n 'value' => 6,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 17, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 17, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si, pero no en los últimos 3 mese',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 17, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si, en los últimos 3',\n 'value' => 6,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 18, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 18, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si, pero no en los últimos 3 mese',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 18, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si, en los últimos 3',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 19, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'más de 60 minutos',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 19, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '31 - 60 minutos',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 19, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'entre 6 y 30 minutos',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 19, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'hasta 5 minutos',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 20, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 20, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 21, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Cualquier otro',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 21, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'El primero de la mañana',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 22, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '10 ó menos',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 22, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '11 - 20',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 22, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '21 - 30',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 22, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '31 o más',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 23, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 23, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 24, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 24, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 25, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nada',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 25, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Un poco',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 25, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Mucho',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 26, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nada',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 26, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Un poco',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 26, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Mucho',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 27, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nada',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 27, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Un poco',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 27, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Mucho',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 28, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nada',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 28, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Un poco',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 28, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Mucho',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 29, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nada',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 29, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Un poco',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 29, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Mucho',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 30, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nada',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 30, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Un poco',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 30, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Mucho',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 31, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nada',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 31, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Un poco',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 31, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Mucho',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 32, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nada',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 32, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Un poco',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 32, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Mucho',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 33, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nada',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 33, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Un poco',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 33, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Mucho',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 34, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca he jugado dinero',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 34, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Menos de 6 euros (menos de 20.496 pesos colombianos)',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 34, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Entre 6 y 30 euros (entre 20.496 y 102.480 pesos colombianos)',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 34, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Entre 30 y 60 euros (entre 102.480 y 204.960 pesos colombianos)',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 34, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Entre 60 y 300 euros (entre 204.960 y 1.024.800 pesos colombianos)',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 34, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Más de 300 euros (más de 1.024.800 pesos colombianos)',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 35, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Mis padres juegan o han jugado demasiado…',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 35, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Mi padre juega o ha jugado demasiado…',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 35, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Mi madre juega o ha jugado demasiado…',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 35, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ninguno de los dos juega o han jugado demasiado…',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 36, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca…',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 36, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces, pero menos de la mitad…',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 36, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayoría de las veces que pierdo…',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 36, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre que pierdo',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 37, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca…',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 37, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Sí, pero menos de la mitad de las veces que he perdido…',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 37, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayoría de las veces',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 38, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No…',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 38, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ahora no, pero en el pasado sí…',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 38, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ahora sí',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 39, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 39, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 40, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 40, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 41, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 41, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 42, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 42, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 43, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 43, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 44, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 44, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 45, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 45, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 46, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 46, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 47, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 47, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 48, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 48, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 49, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 49, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 50, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 50, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 51, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 51, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 52, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 52, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Rara vez',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 52, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 52, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Casi siempre',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 52, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 53, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 53, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Rara vez',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 53, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 53, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Casi siempre',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 53, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 54, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 54, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Rara vez',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 54, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 54, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Casi siempre',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 54, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 55, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 55, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Rara vez',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 55, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 55, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Casi siempre',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 55, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 56, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 56, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Rara vez',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 56, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 56, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Casi siempre',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 56, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 57, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 57, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Rara vez',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 57, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 57, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Casi siempre',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 57, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 58, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 58, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Rara vez',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 58, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 58, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Casi siempre',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 58, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 59, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 59, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Rara vez',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 59, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 59, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Casi siempre',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 59, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 60, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 60, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Rara vez',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 60, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 60, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Casi siempre',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 60, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 61, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 61, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Rara vez',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 61, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 61, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Casi siempre',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 61, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 62, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 62, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Rara vez',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 62, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 62, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Casi siempre',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 62, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 63, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 63, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Rara vez',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 63, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 63, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Casi siempre',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 63, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 64, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 64, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Rara vez',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 64, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 64, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Casi siempre',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 64, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 65, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 65, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Rara vez',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 65, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 65, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Casi siempre',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 65, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 66, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 66, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Rara vez',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 66, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 66, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Casi siempre',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 66, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 67, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 67, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Rara vez',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 67, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 67, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Casi siempre',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 67, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 68, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 68, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Rara vez',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 68, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 68, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Casi siempre',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 68, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 69, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 69, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Rara vez',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 69, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 69, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Casi siempre',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 69, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 70, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 70, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Rara vez',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 70, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 70, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Casi siempre',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 70, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 71, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 71, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Rara vez',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 71, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 71, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Casi siempre',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 71, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 72, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 72, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Raramente',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 72, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Un poco',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 72, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 72, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A menudo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 72, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 73, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 73, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Raramente',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 73, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Un poco',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 73, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 73, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A menudo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 73, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 74, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 74, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Raramente',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 74, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Un poco',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 74, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 74, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A menudo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 74, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 75, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 75, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Raramente',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 75, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Un poco',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 75, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 75, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A menudo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 75, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 76, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 76, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Raramente',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 76, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Un poco',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 76, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 76, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A menudo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 76, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 77, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 77, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Raramente',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 77, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Un poco',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 77, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 77, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A menudo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 77, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 78, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 78, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Raramente',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 78, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Un poco',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 78, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 78, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A menudo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 78, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 79, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 79, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Raramente',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 79, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Un poco',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 79, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 79, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A menudo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 79, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 80, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 80, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Raramente',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 80, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Un poco',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 80, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 80, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A menudo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 80, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 81, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 81, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Raramente',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 81, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Un poco',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 81, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 81, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A menudo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 81, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 82, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 82, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Raramente',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 82, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Un poco',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 82, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 82, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A menudo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 82, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 83, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 83, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Raramente',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 83, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Un poco',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 83, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 83, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A menudo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 83, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 84, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 84, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Raramente',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 84, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Un poco',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 84, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 84, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A menudo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 84, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 85, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 85, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Raramente',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 85, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Un poco',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 85, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 85, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A menudo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 85, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 86, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 86, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Raramente',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 86, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Un poco',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 86, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 86, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A menudo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 86, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 87, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 87, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Raramente',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 87, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Un poco',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 87, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 87, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A menudo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 87, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 88, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 88, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Raramente',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 88, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Un poco',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 88, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 88, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A menudo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 88, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 89, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 89, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Raramente',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 89, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Un poco',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 89, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 89, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A menudo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 89, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 90, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Completamente falso de mí',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 90, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte falso de mí',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 90, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ligeramente más verdadero que falso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 90, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Moderadamente verdadero de mí',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 90, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte verdadero de mí',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 90, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me describe perfectamente',\n 'value' => 6,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 91, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Completamente falso de mí',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 91, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte falso de mí',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 91, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ligeramente más verdadero que falso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 91, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Moderadamente verdadero de mí',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 91, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte verdadero de mí',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 91, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me describe perfectamente',\n 'value' => 6,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 92, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Completamente falso de mí',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 92, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte falso de mí',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 92, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ligeramente más verdadero que falso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 92, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Moderadamente verdadero de mí',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 92, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte verdadero de mí',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 92, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me describe perfectamente',\n 'value' => 6,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 93, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Completamente falso de mí',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 93, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte falso de mí',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 93, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ligeramente más verdadero que falso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 93, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Moderadamente verdadero de mí',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 93, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte verdadero de mí',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 93, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me describe perfectamente',\n 'value' => 6,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 94, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Completamente falso de mí',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 94, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte falso de mí',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 94, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ligeramente más verdadero que falso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 94, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Moderadamente verdadero de mí',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 94, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte verdadero de mí',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 94, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me describe perfectamente',\n 'value' => 6,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 95, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Completamente falso de mí',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 95, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte falso de mí',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 95, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ligeramente más verdadero que falso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 95, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Moderadamente verdadero de mí',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 95, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte verdadero de mí',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 95, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me describe perfectamente',\n 'value' => 6,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 96, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Completamente falso de mí',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 96, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte falso de mí',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 96, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ligeramente más verdadero que falso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 96, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Moderadamente verdadero de mí',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 96, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte verdadero de mí',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 96, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me describe perfectamente',\n 'value' => 6,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 97, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Completamente falso de mí',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 97, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte falso de mí',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 97, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ligeramente más verdadero que falso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 97, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Moderadamente verdadero de mí',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 97, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte verdadero de mí',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 97, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me describe perfectamente',\n 'value' => 6,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 98, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Completamente falso de mí',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 98, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte falso de mí',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 98, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ligeramente más verdadero que falso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 98, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Moderadamente verdadero de mí',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 98, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte verdadero de mí',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 98, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me describe perfectamente',\n 'value' => 6,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 99, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Completamente falso de mí',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 99, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte falso de mí',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 99, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ligeramente más verdadero que falso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 99, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Moderadamente verdadero de mí',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 99, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte verdadero de mí',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 99, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me describe perfectamente',\n 'value' => 6,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 100, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Completamente falso de mí',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 100, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte falso de mí',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 100, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ligeramente más verdadero que falso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 100, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Moderadamente verdadero de mí',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 100, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte verdadero de mí',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 100, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me describe perfectamente',\n 'value' => 6,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 101, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Completamente falso de mí',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 101, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte falso de mí',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 101, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ligeramente más verdadero que falso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 101, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Moderadamente verdadero de mí',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 101, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte verdadero de mí',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 101, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me describe perfectamente',\n 'value' => 6,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 102, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Completamente falso de mí',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 102, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte falso de mí',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 102, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ligeramente más verdadero que falso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 102, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Moderadamente verdadero de mí',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 102, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte verdadero de mí',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 102, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me describe perfectamente',\n 'value' => 6,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 103, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Completamente falso de mí',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 103, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte falso de mí',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 103, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ligeramente más verdadero que falso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 103, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Moderadamente verdadero de mí',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 103, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte verdadero de mí',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 103, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me describe perfectamente',\n 'value' => 6,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 104, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Completamente falso de mí',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 104, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte falso de mí',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 104, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ligeramente más verdadero que falso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 104, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Moderadamente verdadero de mí',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 104, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte verdadero de mí',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 104, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me describe perfectamente',\n 'value' => 6,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 105, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Completamente falso de mí',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 105, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte falso de mí',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 105, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ligeramente más verdadero que falso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 105, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Moderadamente verdadero de mí',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 105, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte verdadero de mí',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 105, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me describe perfectamente',\n 'value' => 6,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 106, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Completamente falso de mí',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 106, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte falso de mí',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 106, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ligeramente más verdadero que falso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 106, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Moderadamente verdadero de mí',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 106, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte verdadero de mí',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 106, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me describe perfectamente',\n 'value' => 6,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 107, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Completamente falso de mí',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 107, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte falso de mí',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 107, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ligeramente más verdadero que falso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 107, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Moderadamente verdadero de mí',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 107, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte verdadero de mí',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 107, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me describe perfectamente',\n 'value' => 6,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 108, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Completamente falso de mí',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 108, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte falso de mí',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 108, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ligeramente más verdadero que falso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 108, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Moderadamente verdadero de mí',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 108, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte verdadero de mí',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 108, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me describe perfectamente',\n 'value' => 6,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 109, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Completamente falso de mí',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 109, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte falso de mí',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 109, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ligeramente más verdadero que falso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 109, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Moderadamente verdadero de mí',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 109, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte verdadero de mí',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 109, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me describe perfectamente',\n 'value' => 6,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 110, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Completamente falso de mí',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 110, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte falso de mí',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 110, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ligeramente más verdadero que falso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 110, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Moderadamente verdadero de mí',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 110, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte verdadero de mí',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 110, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me describe perfectamente',\n 'value' => 6,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 111, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Completamente falso de mí',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 111, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte falso de mí',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 111, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ligeramente más verdadero que falso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 111, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Moderadamente verdadero de mí',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 111, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte verdadero de mí',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 111, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me describe perfectamente',\n 'value' => 6,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 112, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Completamente falso de mí',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 112, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte falso de mí',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 112, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ligeramente más verdadero que falso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 112, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Moderadamente verdadero de mí',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 112, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'La mayor parte verdadero de mí',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 112, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me describe perfectamente',\n 'value' => 6,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 113, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 113, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 114, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 114, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 115, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 115, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 116, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 116, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 117, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 117, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 118, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 118, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 119, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 119, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 120, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 120, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 121, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 121, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 122, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 122, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 123, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 123, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 124, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 124, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 125, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 125, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 126, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 126, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 127, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 127, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 128, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 128, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 129, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 129, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 130, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 130, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 131, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 131, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 132, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 132, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 133, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 133, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 134, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 134, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 135, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 135, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 136, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 136, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 137, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 137, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 138, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 138, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 139, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 139, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 140, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 140, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 141, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 141, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 142, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca o casi nunca',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 142, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 142, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Con frecuencia',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 142, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre o casi siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 143, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca o casi nunca',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 143, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 143, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Con frecuencia',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 143, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre o casi siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 144, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca o casi nunca',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 144, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 144, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Con frecuencia',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 144, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre o casi siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 145, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca o casi nunca',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 145, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 145, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Con frecuencia',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 145, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre o casi siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 146, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca o casi nunca',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 146, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 146, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Con frecuencia',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 146, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre o casi siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 147, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca o casi nunca',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 147, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 147, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Con frecuencia',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 147, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre o casi siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 148, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca o casi nunca',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 148, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 148, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Con frecuencia',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 148, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre o casi siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 149, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca o casi nunca',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 149, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 149, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Con frecuencia',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 149, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre o casi siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 150, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca o casi nunca',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 150, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 150, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Con frecuencia',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 150, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre o casi siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 151, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca o casi nunca',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 151, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 151, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Con frecuencia',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 151, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre o casi siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 152, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca o casi nunca',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 152, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 152, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Con frecuencia',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 152, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre o casi siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 153, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca o casi nunca',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 153, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 153, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Con frecuencia',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 153, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre o casi siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 154, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca o casi nunca',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 154, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 154, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Con frecuencia',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 154, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre o casi siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 155, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca o casi nunca',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 155, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 155, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Con frecuencia',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 155, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre o casi siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 156, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca o casi nunca',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 156, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 156, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Con frecuencia',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 156, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre o casi siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 157, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca o casi nunca',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 157, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 157, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Con frecuencia',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 157, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre o casi siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 158, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca o casi nunca',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 158, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 158, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Con frecuencia',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 158, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre o casi siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 159, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca o casi nunca',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 159, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 159, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Con frecuencia',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 159, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre o casi siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 160, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca o casi nunca',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 160, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 160, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Con frecuencia',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 160, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre o casi siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 161, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca o casi nunca',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 161, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 161, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Con frecuencia',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 161, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre o casi siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 162, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No me siento triste',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 162, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me siento triste',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 162, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me siento triste continuamente y no puedo dejar de estarlo',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 162, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me siento tan triste o tan desgraciado que no puedo soportarlo.',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 163, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No me siento especialmente desanimado respecto al futuro',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 163, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me siento desanimado respecto al futuro',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 163, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siento que no tengo que esperar nada',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 163, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siento que el futuro es desesperanzador y las cosas no mejorarán.',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 164, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No me siento fracasado',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 164, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Creo que he fracasado más que la mayoría de las personas',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 164, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Cuando miro hacia atrás, sólo veo fracaso tras fracaso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 164, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me siento una persona totalmente fracasada',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 165, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Las cosas me satisfacen tanto como antes',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 165, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No disfruto de las cosas tanto como antes',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 165, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ya no obtengo una satisfacción auténtica de las cosas',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 165, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Estoy insatisfecho o aburrido de todo',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 166, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No me siento especialmente culpable',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 166, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me siento culpable en bastantes ocasiones',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 166, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me siento culpable en la mayoría de las ocasiones',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 166, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me siento culpable constantemente',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 167, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No creo que esté siendo castigado',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 167, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me siento como si fuese a ser castigado',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 167, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Espero ser castigado',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 167, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siento que estoy siendo castigado',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 168, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No estoy decepcionado de mí mismo',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 168, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Estoy decepcionado de mí mismo',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 168, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me da vergüenza de mí mismo',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 168, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me detesto',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 169, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No me considero peor que cualquier otro',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 169, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me autocritico por mis debilidades o por mis errores',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 169, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Continuamente me culpo por mis faltas',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 169, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me culpo por todo lo malo que sucede',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 170, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No tengo ningún pensamiento de suicidio',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 170, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces pienso en suicidarme, pero no lo cometería',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 170, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Desearía suicidarme',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 170, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me suicidaría si tuviese la oportunidad',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 171, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No lloro más de lo que solía llorar',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 171, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ahora lloro más que antes',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 171, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Lloro continuamente',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 171, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Antes era capaz de llorar, pero ahora no puedo, incluso aunque quiera',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 172, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No estoy más irritado de lo normal en mí',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 172, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me molesto o irrito más fácilmente que antes',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 172, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me siento irritado continuamente',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 172, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No me irrito absolutamente nada por las cosas que antes solían irritarme',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 173, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No he perdido el interés por los demás',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 173, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Estoy menos interesado en los demás que antes',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 173, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'He perdido la mayor parte de mi interés por los demás',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 173, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'He perdido todo el interés por los demás',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 174, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Tomo decisiones más o menos como siempre he hecho',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 174, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Evito tomar decisiones más que antes',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 174, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Tomar decisiones me resulta mucho más difícil que antes',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 174, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ya me es imposible tomar decisiones',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 175, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No creo tener peor aspecto que antes',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 175, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me temo que ahora parezco más viejo o poco atractivo',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 175, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Creo que se han producido cambios permanentes en mi aspecto que me hacen parecer poco atractivo',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 175, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Creo que tengo un aspecto horrible',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 176, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Trabajo igual que antes',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 176, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me cuesta un esfuerzo extra comenzar a hacer algo',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 176, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Tengo que obligarme mucho para hacer algo',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 176, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No puedo hacer nada en absoluto',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 177, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Duermo tan bien como siempre',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 177, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No duermo tan bien como antes',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 177, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me despierto una o dos horas antes de lo habitual y me resulta difícil volver a dormir',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 177, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me despierto varias horas antes de lo habitual y no puedo volverme a dormir',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 178, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No me siento más cansado de lo normal',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 178, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me canso más fácilmente que antes',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 178, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me canso en cuanto hago cualquier cosa',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 178, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Estoy demasiado cansado para hacer nada',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 179, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Mi apetito no ha disminuido',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 179, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No tengo tan buen apetito como antes',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 179, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ahora tengo mucho menos apetito',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 179, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'He perdido completamente el apetito',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 180, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Últimamente he perdido poco peso o no he perdido nada',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 180, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'He perdido más de 2 kilos y medio',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 180, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'He perdido más de 4 kilos',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 180, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'He perdido más de 7 kilos',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 180, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Estoy a dieta para adelgazar',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 181, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No estoy preocupado por mi salud más de lo normal',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 181, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Estoy preocupado por problemas físicos como dolores, molestias, malestar de estómago o estreñimiento',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 181, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Estoy preocupado por mis problemas físicos y me resulta difícil pensar algo más',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 181, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Estoy tan preocupado por mis problemas físicos que soy incapaz de pensar en cualquier cosa',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 182, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca he fumado un cigarrillo entero',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 182, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '8 años o menos',\n 'value' => 6,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 182, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '9 o 10 años',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 182, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '11 o 12 años',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 182, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '13 o 14 años',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 182, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '15 o 16 años',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 182, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '17 años o más',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 183, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ningún día',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 183, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '1 o 2 días',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 183, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '3 a 5 días',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 183, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '6 a 9 días',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 183, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '10 a 19 días',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 183, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '20 a 29 días ',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 183, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Todos los 30 días',\n 'value' => 6,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 184, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No he fumado cigarrillos durante los últimos 30 días',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 184, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Menos de 1 cigarrillo al día',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 184, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '1 cigarrillo al día',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 184, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '2 a 5 cigarrillos al día',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 184, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '6 a 10 cigarrillos al día',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 184, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '11 a 20 cigarrillos al día',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 184, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Más de 20 cigarrillos al día ',\n 'value' => 6,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 185, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No he fumado cigarrillos en los últimos 30 días',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 185, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Los compro en una venta conocida o en el supermercado',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 185, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Los mando a comprar',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 185, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Se los pido a alguien',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 185, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Me los robo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 185, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Los consigo de otra forma',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 186, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ningún día',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 186, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '1 a 2 días',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 186, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '3 a 5 días',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 186, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '6 a 9 días',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 186, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '10 a 19 días',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 186, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '20 a 29 días',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 186, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Todos los 30 días',\n 'value' => 6,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 187, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si he intentado',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 187, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No he intentado',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 187, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca he fumado',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 188, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca he tomado un trago de bebidas alcohólicas',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 188, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '8 años o menos',\n 'value' => 6,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 188, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '9 o 10 años',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 188, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '11 o 12 años',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 188, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '13 o 14 años',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 188, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '15 o 16 años',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 188, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '17 años o más',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 189, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ningún día',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 189, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '1 o 2 días',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 189, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '3 a 9 días',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 189, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '10 a 19 días',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 189, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '20 a 39 días',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 189, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '40 a 99 días',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 189, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '100 días o más',\n 'value' => 6,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 190, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ningún día',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 190, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '1 a 2 días',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 190, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '3 a 5 días',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 190, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '6 a 9 días',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 190, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '10 a 19 días',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 190, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '20 a 29 días',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 190, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Todos los 30 días',\n 'value' => 6,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 191, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ningún día',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 191, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '1 a 2 días',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 191, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '3 a 5 días',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 191, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '6 a 9 días',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 191, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '10 a 19 días',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 191, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '20 a 29 días',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 191, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Todos los 30 días',\n 'value' => 6,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 192, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca he probado la Marihuana',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 192, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '8 años o menos',\n 'value' => 6,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 192, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '9 o 10 años',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 192, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '11 o 12 años',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 192, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '13 o 14 años',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 192, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '15 o 16 años',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 192, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '17 años o más',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 193, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ninguna vez',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 193, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '1 o 2 veces',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 193, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '3 a 9 veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 193, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '10 a 19 veces',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 193, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '20 a 39 veces',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 193, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '40 a 99 veces',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 193, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '100 veces o más',\n 'value' => 6,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 194, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ninguna vez',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 194, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '1 o 2 veces',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 194, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '3 a 9 veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 194, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '10 a 19 veces',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 194, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '20 a 39 veces',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 194, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '40 veces o más ',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 195, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca he probado Cocaína',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 195, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '8 años o menos',\n 'value' => 6,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 195, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '9 o 10 años',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 195, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '11 o 12 años',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 195, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '13 o 14 años',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 195, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '15 o 16 años',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 195, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '17 años o más',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 196, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ninguna vez',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 196, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '1 o 2 veces',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 196, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '3 a 9 veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 196, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '10 a 19 veces',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 196, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '20 a 39 veces',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 196, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => '40 veces o más ',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 197, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No es en absoluto mi caso',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 197, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces es mi caso',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 197, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Bastantes veces es mi caso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 197, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muchas veces es mi caso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 198, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No es en absoluto mi caso',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 198, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces es mi caso',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 198, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Bastantes veces es mi caso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 198, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muchas veces es mi caso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 199, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No es en absoluto mi caso',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 199, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces es mi caso',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 199, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Bastantes veces es mi caso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 199, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muchas veces es mi caso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 200, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No es en absoluto mi caso',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 200, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces es mi caso',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 200, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Bastantes veces es mi caso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 200, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muchas veces es mi caso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 201, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No es en absoluto mi caso',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 201, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces es mi caso',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 201, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Bastantes veces es mi caso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 201, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muchas veces es mi caso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 202, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No es en absoluto mi caso',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 202, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces es mi caso',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 202, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Bastantes veces es mi caso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 202, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muchas veces es mi caso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 203, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No es en absoluto mi caso',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 203, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces es mi caso',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 203, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Bastantes veces es mi caso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 203, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muchas veces es mi caso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 204, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No es en absoluto mi caso',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 204, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces es mi caso',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 204, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Bastantes veces es mi caso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 204, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muchas veces es mi caso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 205, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No es en absoluto mi caso',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 205, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces es mi caso',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 205, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Bastantes veces es mi caso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 205, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muchas veces es mi caso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 206, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No es en absoluto mi caso',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 206, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces es mi caso',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 206, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Bastantes veces es mi caso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 206, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muchas veces es mi caso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 207, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No es en absoluto mi caso',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 207, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces es mi caso',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 207, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Bastantes veces es mi caso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 207, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muchas veces es mi caso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 208, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No es en absoluto mi caso',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 208, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces es mi caso',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 208, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Bastantes veces es mi caso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 208, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muchas veces es mi caso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 209, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No es en absoluto mi caso',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 209, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces es mi caso',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 209, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Bastantes veces es mi caso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 209, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muchas veces es mi caso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 210, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No es en absoluto mi caso',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 210, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces es mi caso',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 210, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Bastantes veces es mi caso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 210, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muchas veces es mi caso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 211, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No es en absoluto mi caso',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 211, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces es mi caso',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 211, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Bastantes veces es mi caso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 211, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muchas veces es mi caso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 212, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No es en absoluto mi caso',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 212, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces es mi caso',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 212, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Bastantes veces es mi caso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 212, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muchas veces es mi caso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 213, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No es en absoluto mi caso',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 213, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces es mi caso',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 213, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Bastantes veces es mi caso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 213, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muchas veces es mi caso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 214, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No es en absoluto mi caso',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 214, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces es mi caso',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 214, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Bastantes veces es mi caso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 214, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muchas veces es mi caso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 215, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No es en absoluto mi caso',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 215, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces es mi caso',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 215, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Bastantes veces es mi caso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 215, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muchas veces es mi caso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 216, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No es en absoluto mi caso',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 216, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces es mi caso',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 216, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Bastantes veces es mi caso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 216, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muchas veces es mi caso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 217, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No es en absoluto mi caso',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 217, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces es mi caso',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 217, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Bastantes veces es mi caso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 217, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muchas veces es mi caso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 218, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No es en absoluto mi caso',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 218, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces es mi caso',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 218, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Bastantes veces es mi caso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 218, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muchas veces es mi caso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 219, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No es en absoluto mi caso',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 219, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces es mi caso',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 219, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Bastantes veces es mi caso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 219, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muchas veces es mi caso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 220, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No es en absoluto mi caso',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 220, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces es mi caso',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 220, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Bastantes veces es mi caso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 220, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muchas veces es mi caso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 221, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No es en absoluto mi caso',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 221, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces es mi caso',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 221, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Bastantes veces es mi caso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 221, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muchas veces es mi caso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 222, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No es en absoluto mi caso',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 222, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces es mi caso',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 222, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Bastantes veces es mi caso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 222, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muchas veces es mi caso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 223, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No es en absoluto mi caso',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 223, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces es mi caso',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 223, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Bastantes veces es mi caso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 223, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muchas veces es mi caso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 224, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy en desacuerdo',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 224, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'En desacuerdo',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 224, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ni de acuerdo ni en desacuerdo',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 224, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'De acuerdo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 224, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy de acuerdo',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 225, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy en desacuerdo',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 225, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'En desacuerdo',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 225, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ni de acuerdo ni en desacuerdo',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 225, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'De acuerdo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 225, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy de acuerdo',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 226, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy en desacuerdo',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 226, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'En desacuerdo',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 226, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ni de acuerdo ni en desacuerdo',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 226, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'De acuerdo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 226, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy de acuerdo',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 227, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy en desacuerdo',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 227, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'En desacuerdo',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 227, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ni de acuerdo ni en desacuerdo',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 227, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'De acuerdo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 227, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy de acuerdo',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 228, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy en desacuerdo',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 228, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'En desacuerdo',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 228, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ni de acuerdo ni en desacuerdo',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 228, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'De acuerdo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 228, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy de acuerdo',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 229, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy en desacuerdo',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 229, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'En desacuerdo',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 229, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ni de acuerdo ni en desacuerdo',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 229, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'De acuerdo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 229, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy de acuerdo',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 230, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy en desacuerdo',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 230, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'En desacuerdo',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 230, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ni de acuerdo ni en desacuerdo',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 230, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'De acuerdo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 230, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy de acuerdo',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 231, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy en desacuerdo',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 231, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'En desacuerdo',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 231, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ni de acuerdo ni en desacuerdo',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 231, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'De acuerdo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 231, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy de acuerdo',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 232, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy en desacuerdo',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 232, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'En desacuerdo',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 232, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ni de acuerdo ni en desacuerdo',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 232, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'De acuerdo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 232, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy de acuerdo',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 233, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy en desacuerdo',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 233, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'En desacuerdo',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 233, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ni de acuerdo ni en desacuerdo',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 233, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'De acuerdo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 233, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy de acuerdo',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 234, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy en desacuerdo',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 234, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'En desacuerdo',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 234, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ni de acuerdo ni en desacuerdo',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 234, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'De acuerdo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 234, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy de acuerdo',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 235, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy en desacuerdo',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 235, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'En desacuerdo',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 235, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ni de acuerdo ni en desacuerdo',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 235, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'De acuerdo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 235, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy de acuerdo',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 236, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy en desacuerdo',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 236, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'En desacuerdo',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 236, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ni de acuerdo ni en desacuerdo',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 236, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'De acuerdo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 236, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy de acuerdo',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 237, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy en desacuerdo',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 237, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'En desacuerdo',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 237, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ni de acuerdo ni en desacuerdo',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 237, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'De acuerdo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 237, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy de acuerdo',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 238, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy en desacuerdo',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 238, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'En desacuerdo',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 238, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ni de acuerdo ni en desacuerdo',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 238, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'De acuerdo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 238, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy de acuerdo',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 239, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy en desacuerdo',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 239, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'En desacuerdo',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 239, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ni de acuerdo ni en desacuerdo',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 239, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'De acuerdo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 239, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy de acuerdo',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 240, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy en desacuerdo',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 240, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'En desacuerdo',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 240, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ni de acuerdo ni en desacuerdo',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 240, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'De acuerdo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 240, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy de acuerdo',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 241, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy en desacuerdo',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 241, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'En desacuerdo',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 241, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ni de acuerdo ni en desacuerdo',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 241, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'De acuerdo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 241, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy de acuerdo',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 242, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy en desacuerdo',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 242, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'En desacuerdo',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 242, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ni de acuerdo ni en desacuerdo',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 242, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'De acuerdo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 242, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy de acuerdo',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 243, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy en desacuerdo',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 243, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'En desacuerdo',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 243, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ni de acuerdo ni en desacuerdo',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 243, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'De acuerdo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 243, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy de acuerdo',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 244, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy en desacuerdo',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 244, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'En desacuerdo',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 244, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ni de acuerdo ni en desacuerdo',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 244, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'De acuerdo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 244, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy de acuerdo',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 245, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy en desacuerdo',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 245, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'En desacuerdo',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 245, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ni de acuerdo ni en desacuerdo',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 245, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'De acuerdo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 245, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy de acuerdo',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 246, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 246, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 247, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 247, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 248, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 248, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 249, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 249, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 250, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 250, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 251, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Si',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 251, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 252, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nada',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 252, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Un poco',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 252, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Mucho',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 253, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 253, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Rara vez',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 253, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 253, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Casi siempre',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 253, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 254, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 254, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Rara vez',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 254, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 254, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Casi siempre',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 254, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 255, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 255, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Rara vez',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 255, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 255, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Casi siempre',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 255, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 256, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 256, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Rara vez',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 256, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 256, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Casi siempre',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 256, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 257, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 257, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Raramente',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 257, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Un poco',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 257, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 257, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A menudo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 257, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 258, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Nunca',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 258, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Raramente',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 258, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Un poco',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 258, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A veces',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 258, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'A menudo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 258, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Siempre',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 259, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No he observado ningún cambio reciente en mi interés sexual',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 259, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Estoy menos interesado por el sexo que antes.',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 259, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Estoy mucho menos interesado por el sexo',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 259, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'He perdido totalmente mi interés por el sexo',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 260, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No es en absoluto mi caso',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 260, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces es mi caso',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 260, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Bastantes veces es mi caso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 260, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muchas veces es mi caso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 261, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No es en absoluto mi caso',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 261, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces es mi caso',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 261, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Bastantes veces es mi caso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 261, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muchas veces es mi caso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 262, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No es en absoluto mi caso',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 262, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces es mi caso',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 262, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Bastantes veces es mi caso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 262, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muchas veces es mi caso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 263, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No es en absoluto mi caso',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 263, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces es mi caso',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 263, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Bastantes veces es mi caso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 263, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muchas veces es mi caso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 264, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No es en absoluto mi caso',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 264, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces es mi caso',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 264, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Bastantes veces es mi caso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 264, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muchas veces es mi caso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 265, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No es en absoluto mi caso',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 265, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces es mi caso',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 265, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Bastantes veces es mi caso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 265, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muchas veces es mi caso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 266, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No es en absoluto mi caso',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 266, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces es mi caso',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 266, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Bastantes veces es mi caso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 266, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muchas veces es mi caso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 267, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No es en absoluto mi caso',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 267, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces es mi caso',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 267, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Bastantes veces es mi caso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 267, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muchas veces es mi caso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 268, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No es en absoluto mi caso',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 268, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces es mi caso',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 268, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Bastantes veces es mi caso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 268, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muchas veces es mi caso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 269, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No es en absoluto mi caso',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 269, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces es mi caso',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 269, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Bastantes veces es mi caso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 269, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muchas veces es mi caso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 270, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No es en absoluto mi caso',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 270, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces es mi caso',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 270, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Bastantes veces es mi caso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 270, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muchas veces es mi caso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 271, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No es en absoluto mi caso',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 271, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces es mi caso',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 271, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Bastantes veces es mi caso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 271, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muchas veces es mi caso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 272, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'No es en absoluto mi caso',\n 'value' => 0,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 272, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Algunas veces es mi caso',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 272, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Bastantes veces es mi caso',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 272, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muchas veces es mi caso',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 273, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy en desacuerdo',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 273, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'En desacuerdo',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 273, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ni de acuerdo ni en desacuerdo',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 273, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'De acuerdo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 273, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy de acuerdo',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 274, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy en desacuerdo',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 274, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'En desacuerdo',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 274, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ni de acuerdo ni en desacuerdo',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 274, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'De acuerdo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 274, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy de acuerdo',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 275, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy en desacuerdo',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 275, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'En desacuerdo',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 275, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ni de acuerdo ni en desacuerdo',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 275, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'De acuerdo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 275, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy de acuerdo',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 276, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy en desacuerdo',\n 'value' => 1,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 276, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'En desacuerdo',\n 'value' => 2,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 276, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Ni de acuerdo ni en desacuerdo',\n 'value' => 3,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 276, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'De acuerdo',\n 'value' => 4,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n [\n 'question_id' => 276, \n 'answer_id' => NULL,\n 'lang' => 'es',\n 'answer' => 'Muy de acuerdo',\n 'value' => 5,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ],\n ]);\n }", "public function save($answers);", "public function addAction($id = null, $idFromQuestion = null) {\n\n if ($id == 'null') {\n $id = null;\n }\n\n /**\n * Create a comment object\n */\n $edit_comment = (object) [\n 'tags' => '',\n 'comment' => '',\n 'title' => '',\n ];\n\n if ($id) {\n /**\n * Get current version of the comment.\n */\n $edit_comment = $this->comments->find($id);\n\n /**\n * Check if user is authorized to edit this comment.\n */\n if ($edit_comment->userId != $_SESSION['authenticated']['user']->id) {\n die(\"Can only\");\n }\n\n /**\n * Copy over the original tags\n */\n foreach ($this->assignTags->find($id) as $key => $value) {\n $edit_comment->tags[] = $this->assignTags->getTagName($value->idTag)->name;\n }\n }\n\n /**\n * Get a simple array with all tags.\n */\n $tags_array = $this->createSimpleTags();\n\n /**\n * Create a form to edit the comment.\n */\n $form_setup = [\n 'comment' => [\n 'type' => 'textarea',\n 'label' => 'Comment: ',\n 'required' => true,\n 'validation' => ['not_empty'],\n 'value' => $edit_comment->comment,\n ],\n 'submit' => [\n 'type' => 'submit',\n 'callback' => function($form) {\n $form->saveInSession = true;\n return true;\n }\n ],\n ];\n\n /**\n * Check if the edited comment is a comment answer.\n */\n $is_answer = $this->commentanswer->isAnswer($id);\n\n /**\n * If the edited comment is not a answer add additional form information.\n */\n if (!isset($idFromQuestion) && ($is_answer == null)) {\n\n $form_setup_add['title'] = [\n 'type' => 'text',\n 'required' => true,\n 'validation' => ['not_empty'],\n 'value' => $edit_comment->title,\n ];\n $form_setup_add['tags'] = [\n 'type' => 'checkbox-multiple',\n 'values' => $tags_array,\n 'label' => 'Tags: ',\n 'required' => true,\n 'checked' => $edit_comment->tags,\n ];\n\n $form_setup = $form_setup_add + $form_setup;\n }\n\n /**\n * Create the form\n */\n $form = $this->form->create([], $form_setup);\n\n /**\n * Check the form status\n */\n $status = $form->check();\n\n if (!isset($idFromQuestion) && !isset($_SESSION['form-save']['tags']['values'])) {\n $status = false;\n }\n\n /**\n * If form submission has been sucessful procide with the following\n */\n if ($status === true) {\n\n\n\n /**\n * Get data from form storde them into $comment object and unset session variables\n */\n $comment['id'] = isset($id) ? $id : null;\n $comment['comment'] = $_SESSION['form-save']['comment']['value'];\n $comment['userId'] = $_SESSION['authenticated']['user']->id;\n $comment['timestamp'] = time();\n $comment['ip'] = $this->request->getServer('REMOTE_ADDR');\n $comment['title'] = !isset($idFromQuestion) ? $_SESSION['form-save']['title']['value'] : 'Reply: ' . $this->comments->find($idFromQuestion)->title;\n $tags = !isset($idFromQuestion) ? $_SESSION['form-save']['tags']['values'] : null;\n\n unset($_SESSION['form-save']);\n\n /**\n * Update the comment in the database.\n */\n $this->comments->save($comment);\n $row['idComment'] = isset($id) ? $id : $this->comments->findLastInsert();\n\n /**\n * Update the tags for the comment in the database.\n */\n if (!isset($idFromQuestion)) {\n if (isset($id)) {\n $this->assignTags->delete($id);\n }\n if ($is_answer == null) {\n foreach ($tags as $key => $value) {\n $row['idTag'] = array_search($value, $tags_array);\n $this->assignTags->save($row);\n }\n }\n }\n\n /**\n * Update the comment answer.\n */\n if ($idFromQuestion) {\n $data = [\n 'idQuestion' => $idFromQuestion,\n 'idAnswer' => $row['idComment'],\n ];\n $this->commentanswer->save($data);\n\n $url = $this->url->create('comment/answers/' . $idFromQuestion);\n } else {\n\n $url = $this->url->create('comment/view-questions');\n }\n\n /**\n * Route to appropriate view.\n */\n $this->response->redirect($url);\n } else if ($status === false) {\n\n /**\n * If form submission was unsuccessful inform the user.\n */\n $form->AddOutput(\"<p><i>Form submitted but did not checkout, make sure that u have inserted a title and selected at least on tag.</i></p>\");\n }\n\n /**\n * Generate the HTML-code for the form and prepare the view.\n */\n $this->views->add('comment/view-default', [\n 'title' => \"Discuss this topic\",\n 'main' => $form->getHTML(),\n ]);\n $this->theme->setVariable('title', \"Add Comment\");\n }", "public function getAnswersByQuestionId($id = false, $num_answers = 4) {\n\t\t\t// Database Connection\n\t\t\t$db\t\t\t\t= $GLOBALS['db_q'];\n\t\t\t// Query set up\n\t\t\t$num_answers\t= $num_answers - 1;\n\t\t\t$correct\t\t= ($id) ? $db->getAllRows_Arr('tb_answer', '*', \"id_question = {$id} AND boo_correct = 1\") : false;\n\t\t\t$incorrect\t\t= ($id) ? $db->getAllRows_Arr('tb_answer', '*', \"id_question = {$id} AND boo_correct = 0 LIMIT {$num_answers}\") : false;\n\t\t\t$return\t\t\t= (($correct) && ($incorrect)) ? array_merge($correct, $incorrect) : false;\n\t\t\t// Return\n\t\t\treturn $return;\n\t\t}", "private function myQid(){\r\n\t\t$this->db->where('uid', $this->uid);\r\n\t\t$this->db->select('id');\r\n\t\t$this->db->from('wen_answer');\r\n\t\t$tmp = $this->db->get()->result_array();\r\n\t\t$return = array();\r\n\t\tforeach($tmp as $r){\r\n\t\t\t$return[$r['id']] = 1;\r\n\t\t}\r\n\t\treturn $return;\r\n\t}", "public static function answers($q_id) {\n $ans = Database::select(\"SELECT a_id, a_text, a_correct FROM answers WHERE q_id = \\\"$q_id\\\"\");\n $answers = [];\n foreach ($ans as $an) {\n if(1 == $an['a_correct']) {\n $color = \"green\";\n }\n else {\n $color = \"red\";\n }\n $answers = array_merge($answers, [[\"a_id\" => $an['a_id'], 'a_text' => $an['a_text'], 'color' => $color]]);\n }\n return $answers;\n }", "function adddelquestion($question_id=null)\r\n {\r\n if(!empty($question_id))\r\n $this->set('responses', $this->Response->findAll($conditions='question_id='.$question_id));\r\n\r\n $this->layout = 'ajax';\r\n }", "public function update(ExamQuestionRequest $request, $id, $question_id)\n {\n //\n try{\n $question = Question::find($question_id);\n $question->question = $request->question;\n $question->type = $request->q_type;\n $question->sol = $request->co;\n $question->save();\n\n\n $x = $request->q_type == 0 ? 4 : 2 ;\n $answers = Answer::where('question_id',$question_id)->take($x)->get();\n foreach($answers as $i => $answer){\n $answer->answer = $request->a[$i];\n $answer->true = $i == $request->co ? 1 : 0 ;\n $answer->save();\n }\n\n } catch(Exception $e) {\n return redirect()->back()->with([\n 'alert'=>[\n 'icon'=>'error',\n 'title'=>__('site.alert_failed'),\n 'text'=>__('site.question_failed_updated'),\n ]]);\n }\n return redirect('admin/exam/'.$id.'/questions')->with([\n 'alert'=>[\n 'icon'=>'success',\n 'title'=>__('site.done'),\n 'text'=>__('site.updated successfully'),\n ]]);\n }", "function ipal_add_quiz_question($id, $quiz, $page = 0) {\n global $DB;\n $questions = explode(',', ipal_clean_layout($quiz->questions));\n if (in_array($id, $questions)) {\n return false;\n }\n\n if (!(ipal_acceptable_qtype($id) === true)) {\n $alertmessage = \"IPAL does not support \".ipal_acceptable_qtype($id).\" questions.\";\n echo \"<script language='javascript'>alert('$alertmessage')</script>\";\n return false;\n }\n // Remove ending page break if it is not needed.\n if ($breaks = array_keys($questions, 0)) {\n // Determine location of the last two page breaks.\n $end = end($breaks);\n $last = prev($breaks);\n $last = $last ? $last : -1;\n if (!$quiz->questionsperpage || (($end - $last - 1) < $quiz->questionsperpage)) {\n array_pop($questions);\n }\n }\n if (is_int($page) && $page >= 1) {\n $numofpages = substr_count(',' . $quiz->questions, ',0');\n if ($numofpages < $page) {\n // The page specified does not exist in quiz.\n $page = 0;\n } else {\n // Add ending page break - the following logic requires doing this at this point.\n $questions[] = 0;\n $currentpage = 1;\n $addnow = false;\n foreach ($questions as $question) {\n if ($question == 0) {\n $currentpage++;\n // The current page is the one after the one we want to add on.\n // So, we add the question before adding the current page.\n if ($currentpage == $page + 1) {\n $questionsnew[] = $id;\n }\n }\n $questionsnew[] = $question;\n }\n $questions = $questionsnew;\n }\n }\n if ($page == 0) {\n // Add question.\n $questions[] = $id;\n // Add ending page break.\n $questions[] = 0;\n }\n\n // Save new questionslist in database.\n $quiz->questions = implode(',', $questions);\n $DB->set_field('ipal', 'questions', $quiz->questions, array('id' => $quiz->id));\n\n}", "public function store($examId)\n {\n $exam = Exam::findOrFail($examId);\n $exam->questions_count++;\n $exam->save();\n\n $question = new Question;\n $question->question_name = NULL;\n $question->user_id = Auth::user()->user_id;\n $question->exam_id = $examId;\n $question->save();\n\n for ($i = 1; $i <= 4; $i++) {\n $answer = new Answer;\n $answer->answer_name = NULL;\n $answer->correct_answer = \"false\";\n $answer->question_id = $question->question_id;\n\n $answer->user_id = Auth::user()->user_id;\n $answer->exam_id = $exam->exam_id;\n $answer->save();\n }\n\n }", "function TestSave_getAnswers2(){\n \t$newAnswer = new Answer();\n \t$answerArray = array(array(\"elementId\" => 1, \"value\" => \"15\"), array(\"elementId\" => 2, \"value\" => \"0\"), array(\"elementId\" => 2, \"value\" => \"56\"), array(\"elementId\" => 2, \"value\" => \"29\"));\t\n \t$newAnswer->setAnswers($answerArray);\n \t$newAnswer->setRecipient(new User(1));\n \t$newAnswer->setFormId(4);\n \t$newAnswer->save();\n \t$newFormId = $newAnswer->getId();\n \t$newAnswer = new Answer($newFormId);\n \t$this->assertTrue($newAnswer->getAnswers() == $answerArray);\n }", "public function getQuestionById($id=null)\n {\n $qry = \"SELECT * FROM mvc_VQuestion\n WHERE id=?\";\n \n $all = $this->db->executeFetchAll($qry, array($id));\n\n $question = json_decode(json_encode($all[0]),TRUE);\n $tags = $question['tags'];\n $tagIdName = array();\n \n if (!empty($tags)) {\n $tagsSep = explode(\",\", $tags);\n \n foreach ($tagsSep as $key => $val) {\n $tag_id = $this->getTagIdAction($val);\n $tagIdName[] = array('id' => $tag_id, 'name' => $val);\n }\n }\n\n $question_data = array($question, $tagIdName);\n\n return $question_data;\n }", "function get_survey_answers($question_id) {\r\n // set connection var\r\n global $db;\r\n\r\n //query to get all associated survey answers\r\n $sql = \"SELECT id\r\n FROM answers\r\n WHERE is_active = '1' AND question = '$question_id';\";\r\n\r\n $answers_data = array();\r\n $answers = array();\r\n foreach ($db->query($sql) as $key => $value) {\r\n $answers_data[$key] = $value;\r\n foreach ($answers_data[$key] as $subkey => $subvalue) {\r\n if (is_int($subkey)) {\r\n $answers[] = $subvalue;\r\n }\r\n }\r\n }\r\n\r\n return $answers;\r\n}", "public function saveAnswerByQuestion($data)\n\t{\n\t\t$this->db->insert('pergunta_jogador', array(\n\t\t\t'id_pergunta' => $data['id_pergunta'],\n\t\t\t'id_resposta' => $data['id_resposta'],\n\t\t\t'id_usuario' => $data['id_usuario'],\n\t\t\t'id_jogo' => $data['id_jogo']\n\t\t));\n\t}", "function answerQuestions() {\n $this->layout = 'survey'; // use the more basic survey layout\n if (!$this->request->is('post')) {\n // if there is no data then show the initial view\n $survey = $this->Session->read('Survey.original'); // get the survey being used\n if (empty($survey['Question'])) { // if there are no questions then we don't need to show the question form at all\n $this->Session->write('Survey.progress', GDTA_ENTRY); // move progress forward and redirect to the runSurvey action\n $this->redirect(array('action' => 'runSurvey'));\n }\n $questions = $survey['Question'];\n $answers = ($this->Session->check('Survey.answers')) ? $this->Session->read('Survey.answers') : array(); // check to see if there are already answers in the session\n $choices = array(); // gather choices here keyed to each question id\n foreach ($questions as &$q) { // go through each question and look to see if there is an answer for it\n $checkId = $q['id'];\n $choices[$checkId] = array();\n if (isset($q['Choice'])) {\n foreach ($q['Choice'] as $choice) {\n $choices[$checkId][$choice['id']] = $choice['value'];\n }\n }\n foreach ($answers as $a) {\n if ($a['question_id'] == $checkId) {\n if ($q['type'] == MULTI_SELECT) {\n $q['answer'] = Set::extract('/id',$a['answer']);\n } else {\n $q['answer'] = $a['answer'];\n }\n break;\n }\n }\n }\n $this->set('questions', $questions); // send questions to the view\n $this->set('choices', $choices); // send choices for questions to the view, ordered for form elements\n } else { // we have form data so process it here\n if (isset($this->request->data['Answer'])) {\n // make sure we have answers in the data set\n $this->Session->write('Survey.answers', $this->request->data['Answer']); // write the answers to the session\n }\n $this->Session->write('Survey.progress', GDTA_ENTRY); // move progress forward and redirect to the runSurvey action\n $this->redirect(array('action' => 'runSurvey'));\n }\n }", "public function save_post( $post_id ) {\n\n\t\t/* If we're not working with a 'post' post type or the user doesn't have permission to save,\n\t\t * then we exit the function.\n\t\t */\n\t\tif ( ! $this->user_can_save( $post_id, 'q_and_a_nonce', 'q_and_a_save' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t/* \n\t\t * If there is no question there is no reason to save\n\t\t */\n\t\tif ( ! $this->value_exists( 'question' ) ) {\n\t\t\treturn;\t\n\t\t}\n\t\t/*\n\t\t * We get the old values and begin to get the new ones if they aren't empty\n\t\t * We count the amount of questions for a for loop\n\t\t */\n\t\t\t$old = get_post_meta($post_id, 'q-and-a-repeatables', true);\n\t\t\t$new = array();\n\t\t\t\n\t\t\t$question =\t( !empty( $_POST['question'] ) ) ? $_POST['question'] : \"\";\n\t\t\t$answer =\t( !empty( $_POST['answer'] ) ) ? $_POST['answer'] : \"\";\n\t\t\t\n\t\t\t$count = count( $question );\n\t\t/*\n\t\t * We loop through as long as $i is less than or equal to $count.\n\t\t * I don't understand this. I think it should only be less than. If count was 1\n\t\t * than it would loop twice. One loop with i being zero is less than count 1 and one \n\t\t * loop as i being one is equal to count as one\n\t\t */\n\t\t\tfor ( $i = 0; $i <= $count; $i++ ) {\n\t\t\t\tif ( ! empty($question[$i]) ) :\n\t\t\t\t\t$new[$i]['question'] = stripslashes( strip_tags( $question[$i] ) );\n\t\t\t\t\n\t\t\t\t\tif ( ! empty($answer[$i]) )\n\t\t\t\t\t\t$new[$i]['answer'] = stripslashes( strip_tags( $answer[$i] ) );\n\t\t\t\tendif;\n\t\t\t}\n\t\tif ( !empty( $new ) && $new != $old )\n\t\t\t$this->update_post_meta( \n\t\t\t\t$post_id, \n\t\t\t\t'q-and-a-repeatables', \n\t\t\t\t$new\n\t\t\t);\n\t\telseif ( empty($new) && $old )\n\t\t\t$this->delete_post_meta( \n\t\t\t\t$post_id, \n\t\t\t\t'q-and-a-repeatables', \n\t\t\t\t$old \n\t\t\t);\n\t\t\n\t}", "public function saveAnswerQuestionsAction($id)\n {\n $request = $this->getRequest();\n $em = $this->getDoctrine()->getManager();\n\n if ($request->isXmlHttpRequest()) {\n $closeDialog = false;\n $answerRepository = $em->getRepository('TeclliureQuestionBundle:Answer');\n\n $entity = $answerRepository->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Answer entity.');\n }\n\n $answerQuestionForm = $this->createForm(new AnswerQuestionsType(), $entity);\n\n if ($request->isMethod('post')) {\n $answerQuestionForm->bind($request);\n\n if ($answerQuestionForm->isValid()) {\n $em->persist($entity);\n $em->flush();\n\n $this->get('session')->setFlash('info',\n 'Answer questions saved correctly'\n );\n $closeDialog = true;\n }\n }\n\n return $this->render(':ajax:base_ajax.html.twig', array(\n 'template' => 'TeclliureQuestionBundle:Question:answerQuestions.html.twig',\n 'entity' => $entity,\n 'form' => $answerQuestionForm->createView(),\n 'closeDialog' => $closeDialog\n ));\n }\n else {\n return $this->render(':msg:error.html.twig', array(\n 'msg' => 'Error: Not ajax call'\n ));\n }\n }", "public function update(Request $request, $id)\n {\n $question = Question::findOrFail($id);\n $question->question = $request->get('question');\n $question->save();\n $question->answers()->delete();\n foreach($request->get('choice') as $key => $choice){\n $answer = new Answer();\n $answer->type=\"string\";\n $answer->textual= $choice;\n $answer->correct= in_array($key+1,$request->get('answer')) <=> 0;\n $answer->question()->associate($question);\n $answer->save();\n }\n return redirect()->to(route(\"paper.edit\",$question->paper->id));\n }", "public function insertQuizQuestions( $data,$contentId ){\n\t\t\n\t\tSWPLogManager::log(\"Insert quiz questions\",array(\"data\"=>$data, \"Content id\"=>$contentId),TLogger::INFO,$this,\"insertQuizQuestions\",\"SWP\");\n\t\t$questions = QuizRecord::finder()->findAll( 'parent_id = ?',$data['content_id'] );\n\t\t\n\t\tforeach( $questions as $question ) {\n\t\t\t\n\t\t\t$quizQuestionsRec = new QuizRecord();\n\t\t\t\n\t\t\t$quizQuestionsRec->is_enabled \t\t\t= \t\t$question->is_enabled;\n\t\t\t$quizQuestionsRec->name \t\t\t\t= \t\t$question->name;\n\t\t\t$quizQuestionsRec->short_description \t= \t\t$question->short_description;\n\t\t\t$quizQuestionsRec->description \t\t\t= \t\t$question->description;\n\t\t\t$quizQuestionsRec->seo_keywords \t\t= \t\t$question->seo_keywords;\n\t\t\t$quizQuestionsRec->date_created \t\t= \t\t$question->date_created;\n\t\t\t$quizQuestionsRec->date_updated \t\t= \t\t$question->date_updated;\n\t\t\t$quizQuestionsRec->url1 \t\t\t\t= \t\t$question->url1;\n\t\t\t$quizQuestionsRec->url2 \t\t\t\t= \t\t$question->url2;\n\t\t\t$quizQuestionsRec->qtype \t\t\t\t= \t\t$question->qtype;\n\t\t\t$quizQuestionsRec->hits \t\t\t\t= \t\t$question->hits;\n\t\t\t$quizQuestionsRec->ordering \t\t\t= \t\t$question->ordering;\n\t\t\t$quizQuestionsRec->images \t\t\t\t= \t\t$question->images;\n\t\t\t$quizQuestionsRec->author \t\t\t\t= \t\t$question->author;\n\t\t\t$quizQuestionsRec->from_date \t\t\t= \t\t$question->from_date;\n\t\t\t$quizQuestionsRec->to_date \t\t\t\t= \t\t$question->to_date;\n\t\t\t$quizQuestionsRec->category_id \t\t\t= \t\t$question->category_id;\n\t\t\t$quizQuestionsRec->parent_id \t\t\t= \t\t$contentId;\n\t\t\t$quizQuestionsRec->files \t\t\t\t= \t\t$question->files;\n\t\t\t$quizQuestionsRec->predefinedtask \t\t= \t\t$question->predefinedtask;\n\t\t\t\n\t\t\t$quizQuestionsRec->save();\n\t\t\tSWPLogManager::log(\"Creating quiz question object\",$quizQuestionsRec,TLogger::DEBUG,$this,\"insertQuizQuestions\",\"SWP\");\n\t\t\t$insertedQuestionId = $quizQuestionsRec->uid;\n\t\t\t\n\t\t\t$this->insertQuestionAnswers( $insertedQuestionId,$question->uid );\n\t\t}\n\t}", "public function detail($id)\n {\n $category = Cache::remember('exam_category_' . $id, config('const.cache_sec_questions'), function () use ($id) {\n return ExamCategory::where('id', '=', $id)->firstOrFail();\n });\n\n if (is_null($category)) {\n return $this->sendError('Category not found.');\n }\n\n $questions = Cache::remember('exam_questions_' . $id, config('const.cache_sec_questions'), function () use ($id) {\n $questions = ExamQuestion::where('category_id', '=', $id)->inRandomOrder()->get();\n $questions = $questions->map(function ($question) use ($questions) {\n return new ExamQuestion([\n 'id' => $question->id,\n 'is_active' => $question->is_active,\n 'question' => $question->question,\n 'info_link' => $question->info_link,\n 'category_id' => $question->category_id,\n 'class_id' => $question->class_id,\n 'answer_1_true' => $question->answer_1_true,\n 'answer_1' => $question->answer_1,\n 'answer_2_true' => $question->answer_2_true,\n 'answer_2' => $question->answer_2,\n 'answer_3_true' => $question->answer_3_true,\n 'answer_3' => $question->answer_3,\n 'answer_4_true' => $question->answer_4_true,\n 'answer_4' => $question->answer_4,\n ]);\n });\n return $questions;\n });\n\n return $this->sendResponse($questions, 'Questions retrieved successfully.');\n }", "static function saveAnswer ($form_data, $answer)\n {\n global $core;\n \n /* For now, the answers are serialized under a JSON format, to\n * reduce the amount of rows in the database, we will see later\n * if it is a good idea\n */\n \n $bundle = json_encode($answer);\n\t\t$id = 0;\n\t\t$db =& $core->con;\n\t\t$dataSet = $db->openCursor(DC_DBPREFIX . 'mj_storage');\n\t\t\n\t\t// Look for the last form ID\n\t\t$res = $db->select('SELECT MAX(answer_id) as lastid FROM ' . DC_DBPREFIX . self::$table_name .\n ' WHERE form_id = ' . ((int) $form_data->form_id) . ';');\n\n\t\tif (!$res->isEmpty()) {\n\t\t\t// We use the next id, which should be available\n\t\t\t$id = $res->lastid + 1;\n\t\t}\n\n\t\t$dataSet->form_id = $form_data->form_id;\n\t\t$dataSet->answer_id = $id;\n\t\t$dataSet->answer = $bundle;\n\t\treturn $dataSet->insert();\t\t\n }", "public function ask_get_user_questions($id)\n\t{\n\t\t$sql = \"SELECT *\n\t\t\t\tFROM \".$this->table_ask.\"\n\t\t\t\tWHERE id_quest = -1\n\t\t\t\tAND author_id = ?\n\t\t\t\tORDER BY date DESC\";\n\t\t$data = array($id);\n\t\t$query = $this->db->query($sql, $data);\n\t\t$res = $query->result();\n\t\tfor( $i=0; $i<count($res); $i++ ) {\n\t\t\t$res[$i]->nb_ans = $this->ask_get_nb_answers($res[$i]->id);\n\t\t\t$res[$i]->nb_views = $this->ask_get_nb_views($res[$i]->id);\n\t\t\t$val = $this->votesManager->votes_get_by_ask($res[$i]->id);\n\t\t\t$res[$i]->nb_votes = ($val) ? $val:0;\n\t\t}\n\t\tif( $query->result() != NULL )\n\t\t\treturn $query->result();\n\t\telse\n\t\t\treturn 0;\n\t}", "private function getQuestion($id){\n $q = new Question();\n return $q->find($id);\n }", "function AddQuestionData(&$formData, &$questionData, &$questionnaire)\n\t{\n\t\tforeach($formData as $id => $value)\n\t\t{\n\t\t\tif (!isset($questionnaire[$id]))\n\t\t\t\tcontinue;\n\t\t\t// get the type of the element with the same id as the form element from the questionnaire\n\t\t\t$type = $questionnaire[$id][0];\n\t\t\t// check if the element is a question on continue with the next one if that is not the case\n\t\t\tif ($type != \"Question\")\n\t\t\t\tcontinue;\n\t\t\t// if there is not field for the current element in the question dsta array, create a new\n\t\t\t// blank field containing the question and zeros for the number of times each answer was picked\n\t\t\tif (array_key_exists($id, $questionData) == false)\n\t\t\t\t$questionData[$id] = array($questionnaire[$id][1], 0, 0, 0, 0, 0, 0);\n\t\t\t// increment the answer that was selected in the formular by one\n\t\t\t$questionData[$id][(int)$value]++;\n\t\t}\n\t}", "function getAnswerById($answers, $id_business_quiz) {\n //Needs group by the same name.\n $AnswersById = [];\n foreach($answers as $key=>$value) {\n if($value['id_business_quiz'] === $id_business_quiz) {\n $AnswersById[] = $value;\n }\n }\n return $AnswersById;\n }", "public function questionAction($id, $idExam = null)\n {\n $exam = null;\n $answered = $showExam = $previous =$next = false;\n $explanation = true;\n $rev = false;\n $total =0;\n $count =0;\n \n $date =0;\n $time = false;\n \n $timer = 1;\n if($idExam != null)\n {\n $exam = $this->getDoctrine()\n ->getRepository('EntityBundle:Exam')\n ->findOneById($idExam); \n $answered = $exam->getFinished();\n $showExam = true; \n \n $timer = $exam->getTimer();\n \n $previous = $next = true;\n if($exam->getGroup())\n {\n $total = $exam->getExamType()->getGroupQuestions();\n }\n elseif($exam->getArea())\n {\n $total = $exam->getExamType()->getAreaQuestions();\n }\n else\n {\n $total = $exam->getExamType()->getTotalQuestions();\n }\n \n if(!$answered)\n {\n if($exam->getGroup() || $exam->getArea())\n {\n $explanation = true; \n }\n else\n {\n $explanation = false; \n }\n \n $time = true;\n // $timer = $timer * $total;\n $date = $exam->getCurrent()->getTimestamp()*1000 + $timer;\n \n \n }\n \n \n \n }\n \n $question = $this->getDoctrine()\n ->getRepository('EntityBundle:Question')\n ->findOneById($id);\n\n if (!$question) {\n return $this->render('MainBundle:Forms:question.html.twig', \n array(\n 'QuestionId' => -1,\n 'Time' => false,\n 'Date' => $date,));\n \n \n }\n \n $answers = $this->getDoctrine()\n ->getRepository('EntityBundle:Answer')\n ->findBy(array('question' => $question));\n \n if (!$answers) {\n return $this->render('MainBundle:Forms:question.html.twig', \n array(\n 'QuestionId' => -1,\n 'Time' => false,\n 'Date' => $date,));\n }\n \n $answers2 = $this->rasndomizeArray($answers);\n $option1 = $option2 = $option3 = $option4 = null;\n if (sizeof($answers) >=4)\n {\n $option1 = $answers2[0];\n $option2 = $answers2[1];\n $option3 = $answers2[2];\n $option4 = $answers2[3];\n }\n $option = -1;\n $prevId = $nextId = -1;\n $examQuestion = null;\n if($exam != null)\n {\n $examQuestion = $this->getDoctrine()\n ->getRepository('EntityBundle:ExamQuestion')\n ->findOneBy(array('exam' => $exam, 'question' => $question));\n $count = $examQuestion->getOrder(); \n if($examQuestion->getSolved())\n {\n if($examQuestion->getAnswer()->getId() == $option1->getId())\n {\n $option =1;\n }\n if($examQuestion->getAnswer()->getId() == $option2->getId())\n {\n $option =2;\n }\n if($examQuestion->getAnswer()->getId() == $option3->getId())\n {\n $option =3;\n }\n if($examQuestion->getAnswer()->getId() == $option4->getId())\n {\n $option =4;\n }\n }\n \n $questionsNumber =0;\n \n if($exam->getGroup())\n {\n $questionsNumber = $exam->getExamType()->getGroupQuestions();\n \n }\n elseif($exam->getArea())\n {\n $questionsNumber = $exam->getExamType()->getAreaQuestions();\n }\n else \n {\n $questionsNumber = $exam->getExamType()->getTotalQuestions();\n }\n \n if($examQuestion->getOrder() == 1)\n {\n $previous = true;\n //Get previous with number of questions\n $examQuestionPrev = $this->getDoctrine()\n ->getRepository('EntityBundle:ExamQuestion')\n ->findOneBy(array('exam' => $exam, 'order' => $questionsNumber));\n $prevId = $examQuestionPrev->getQuestion()->getId();\n $examQuestionNext = $this->getDoctrine()\n ->getRepository('EntityBundle:ExamQuestion')\n ->findOneBy(array('exam' => $exam, 'order' => $examQuestion->getOrder() + 1 ));\n $nextId = $examQuestionNext->getQuestion()->getId();\n }\n elseif($examQuestion->getOrder() == $questionsNumber)\n {\n $next = true;\n //Prev is question 1\n $examQuestionNext = $this->getDoctrine()\n ->getRepository('EntityBundle:ExamQuestion')\n ->findOneBy(array('exam' => $exam, 'order' => 1));\n $nextId = $examQuestionNext->getQuestion()->getId();\n $examQuestionPrev = $this->getDoctrine()\n ->getRepository('EntityBundle:ExamQuestion')\n ->findOneBy(array('exam' => $exam, 'order' => $examQuestion->getOrder() - 1));\n $prevId = $examQuestionPrev->getQuestion()->getId();\n }\n else\n {\n $examQuestionNext = $this->getDoctrine()\n ->getRepository('EntityBundle:ExamQuestion')\n ->findOneBy(array('exam' => $exam, 'order' => $examQuestion->getOrder() + 1 ));\n $nextId = $examQuestionNext->getQuestion()->getId();\n $examQuestionPrev = $this->getDoctrine()\n ->getRepository('EntityBundle:ExamQuestion')\n ->findOneBy(array('exam' => $exam, 'order' => $examQuestion->getOrder() - 1));\n $prevId = $examQuestionPrev->getQuestion()->getId();\n }\n \n $examQuestionNext = $this->getDoctrine()\n ->getRepository('EntityBundle:ExamQuestion')\n ->findOneBy(array('exam' => $exam, 'question' => $question));\n \n $examQuestionPrev = $this->getDoctrine()\n ->getRepository('EntityBundle:ExamQuestion')\n ->findOneBy(array('exam' => $exam, 'question' => $question));\n $rev = $examQuestion->getRevision();\n }\n \n $hasImage = empty($question->getImageName());\n $examtype = $question->getExamType()->getId();\n \n $imageName = $examtype.'/'.$question->getImageName().'.JPG';\n \n \n return $this->render('MainBundle:Forms:question.html.twig', \n array(\n 'Title' => $question->getTitle(),\n 'Option1' => $option1,\n 'Option2' => $option2,\n 'Option3' => $option3,\n 'Option4' => $option4,\n 'Explanation' => $question->getExplanation(),\n 'ShowExplanation' => $explanation,\n 'ShowPrevious' => $previous,\n 'ShowNext' => $next,\n 'ShowExam' => $showExam,\n 'exam' => $exam,\n 'prevId' => $prevId,\n 'nextId' => $nextId,\n 'Answered' => $answered,\n 'Answer' => $option,\n 'IdExam' => $idExam,\n 'Total' => $total,\n 'Count' => $count,\n 'Timer' => $timer,\n 'Date' => $date,\n 'Time' => $time,\n 'Image' => $hasImage,\n 'ImageName' =>$imageName,\n 'ExamQuestion' => $examQuestion,\n 'QuestionId' => $question->getNumber(),\n 'Revision' => $rev, \n ));\n }", "public function getAnswers();", "private function question()\n\t{\n\t\t$this->qns['questionnaire']['questionnairecategories_id'] = $this->allinputs['questioncat'];\n\t\t$this->qns['questionnaire']['questionnairesubcategories_id'] = $this->allinputs['questionsubcat'];\n\t\t$this->qns['questionnaire']['label'] = $this->allinputs['question_label'];\n\n\n\t\t$this->qns['questionnaire']['question'] = $this->allinputs['question'];\n\t\t$this->qns['questionnaire']['has_sub_question'] = $this->allinputs['subquestion'];\n\n\t\tif( $this->qns['questionnaire']['has_sub_question'] == 0 )\n\t\t{\n\t\t\t$this->qns['answers']['answer_type'] = $this->allinputs['optiontype'];\n\t\t}\n\n\t\t$this->qns['questionnaire']['active'] = 1;\n\n\t\tif( $this->qns['questionnaire']['has_sub_question'] == 0 ){\n\t\t\t//This code must be skipped if sub_question is 1\n\t\t\t$optionCounter = 0;\n\t\t\tforeach ($this->allinputs as $key => $value) {\n\n\t\t\t\tif( str_is('option_*', $key) ){\n\t\t\t\t\t$optionCounter++;\n\t\t\t\t\t$this->qns['answers'][$optionCounter] = ( $this->qns['answers']['answer_type'] == 'opentext' ) ? 'Offered answer text' : $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function avencer($questionnaire_id=null)\r\n {\r\n $questions=$this->Repense->find('all',array('conditions'=>array('Question.questionnaire_id'=>$questionnaire_id)));\r\n $this->set('questions',$questions);\r\n $this->set('questionnaire_id',$questionnaire_id);\r\n }", "public function get_question_answer_by_id($id)\n\t{\n\t\t$query = $this->db->get_where('question_answer', array('id' => $id));\n\t\treturn $query;\n\t}", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required',\n 'contents' => 'required',\n ]);\n\n $validator->after(function () {\n });\n\n if ($validator->fails()) {\n return response($validator->errors());\n }\n\n Question::where('id', $id)->update([\n 'title' => $request->title,\n 'contents' => $request->contents,\n ]);\n\n $question = Question::find($id);\n\n DB::table('category_question')\n ->where('question_id', $question->id)->get();\n\n $answers = Answer::where('question_id', $question->id)->get();\n\n foreach ($answers as $answer) {\n $answer->author = $answer->author->name;\n $comments = Comment::where('answer_id', $answer->id)->orderby('created_at')->get();\n foreach ($comments as $comment) {\n $comment->author = $comment->author->name;\n }\n $answer->comments = $comments;\n $answer->liked = $answer->liked();\n }\n\n $question->answers = $answers;\n $question->author = $question->author->name;\n\n $categories = DB::table('category_question')\n ->select('category_id')\n ->where('question_id', $question->id)\n ->get();\n\n $cate = '';\n\n foreach ($categories as $i => $category) {\n if ($i + 1 == count($categories)) {\n $cate = $cate . $category->category_id;\n } else {\n $cate = $cate . $category->category_id . ',';\n }\n }\n\n $question->categories = $cate;\n\n return response($question, 200);\n }", "public function questionedit($id, Request $request)\n {\n //\n $questions = Question::with(['answers'=>function($qr){\n $qr->orderBy(\"id\", \"ASC\");\n }])->where('video_id',$id)->orderBy(\"id\", \"ASC\")->get();\n if ($request->isMethod('post')) {\n // dd($request->all());\n foreach ($request->question_id as $kqid => $question_id) {\n if($question_id) {\n Question::find($question_id)->update([\"question\"=>$request->question[$kqid]]);\n }else{\n $question_id = Question::insertGetId([\n 'question'=>$request->question[$kqid],\n 'video_id'=>$id,\n ]);\n }\n for ($i=0; $i < 5 ; $i++) { \n if($request->answer_id[$kqid][$i]) {\n Answer::find($request->answer_id[$kqid][$i])->update(['answer'=>$request->answers[$kqid][$i]]);\n }else{\n Answer::insertGetId([\n 'answer'=>$request->answers[$kqid][$i],\n 'question_id'=>$question_id\n ]);\n }\n }\n }\n return redirect(route('push.videos.index'));\n }\n return view('Push::videos.questionedit', compact(['questions']));\n }", "public function getQuestion($id){\r\n $conn = new DB();\r\n $connection = $conn->connect();\r\n\r\n $query = \"SELECT * FROM questions WHERE id = ? LIMIT 1\";\r\n if($stmt = $connection->prepare($query)){\r\n $stmt->bind_param(\"s\", $id);\r\n $stmt->execute();\r\n $stmt->bind_result($qid, $qquestion, $qanswers, $qcorrect_answer, $quiz_id);\r\n $stmt->fetch();\r\n $stmt->close();\r\n }\r\n return [\"id\" => $qid, \"question\" => $qquestion, \"answers\" => $qanswers, \"correct_answer\" => $qcorrect_answer, \"quiz_id\" => $quiz_id];\r\n }", "public function get_answers_page_4()\n\t{\n\t\tif ($this->input->post(\"presence31\") != null) {\n\t\t $answer = new TblAnswers();\n\t\t\t$answer->answer = $this->input->post(\"presence31\");\n\t\t\t$answer->user_id = $this->session->get(\"user\");\n\t\t\t$answer->q_id = '31';\n\t\t\t$answer->save();\n\t\t}\n\t\tif ($this->input->post(\"presence32\") != null) {\n\t\t $answer = new TblAnswers();\n\t\t\t$answer->answer = $this->input->post(\"presence32\");\n\t\t\t$answer->user_id = $this->session->get(\"user\");\n\t\t\t$answer->q_id = '32';\n\t\t\t$answer->save();\n\t\t}\n\t\tif ($this->input->post(\"any33\") != null) {\n\t\t $answer = new TblAnswers();\n\t\t\t$answer->answer = $this->input->post(\"any33\");\n\t\t\t$answer->user_id = $this->session->get(\"user\");\n\t\t\t$answer->q_id = '33';\n\t\t\t$answer->save();\n\t\t}\n\t\t$this->session->set(\"message\", \"Your answers have been submitted.\");\n\t\turl::redirect('questionnaire_selection');\n\t}", "public function deleteAnswers($question_id)\n\t{\n\t}", "public function questionAction(int $id) : object\n {\n\n $page = $this->di->get(\"page\");\n $questions = new Questions();\n $questions->setDb($this->di->get(\"dbqb\"));\n $question = $questions->find(\"id\", $id);\n $answers = new Answers();\n $answers->setDb($this->di->get(\"dbqb\"));\n $form = new AnswerForm($this->di, $id);\n $form->check();\n $all_answers_to_question = $answers->findAllWhere(\"question_id = ?\", $id);\n $all_answers_with_comments = [];\n foreach ($all_answers_to_question as $comment) {\n $comments = new Comments();\n $comments->setDb($this->di->get(\"dbqb\"));\n $all_comments = $comments->findAllWhere(\"answer_id = ?\", $comment->rowid);\n array_push($all_answers_with_comments, $all_comments);\n }\n\n $page->add(\"questions/view-question\", [\n \"question\" => $question,\n \"answers\" => $answers->findAllWhere(\"question_id = ?\", $id),\n \"comments\" => $all_answers_with_comments,\n \"form\" => $form->getHTML(),\n ]);\n\n return $page->render([\n \"title\" => \"Update an item\",\n ]);\n }", "public function update(Request $request, $id)\n {\n // the form sends the request\n // the id indicates which question to update\n \n // store\n //echo $request;\n if($request->type == 'single' || $request->type == 'multi-value')\n {\n $question = Question::find($id);\n $question->prompt = $request->input('prompt'); // works! \n \n // what happens if we leave it unselected? \n // nice, doesn't change it if nothing selected\n // I think it has the previous selected\n $question->difficulty = $request->input('difficulty'); // works!\n $question->total_score = $request->input('total_score'); // works!\n \n $question->save();\n \n // detach all answers from the question\n // attach the newly created ones from the form; overwrites. \n \n $question->answers()->detach(); // detach all answers from question\n \n $a1 = new Answer;\n $a2 = new Answer;\n $a3 = new Answer;\n $a4 = new Answer;\n $a5 = new Answer;\n \n $a1->text = $request->choice1;\n $a2->text = $request->choice2;\n $a3->text = $request->choice3;\n $a4->text = $request->choice4;\n $a5->text = $request->choice5;\n\n $a1->save();\n $a2->save();\n $a3->save();\n $a4->save();\n $a5->save();\n\n $question->answers()->attach($a1->id, array('is_correct' => ($request->isCorrect1 != 1 ? 0 : 1)));\n $question->answers()->attach($a2->id, array('is_correct' => ($request->isCorrect2 != 1 ? 0 : 1)));\n $question->answers()->attach($a3->id, array('is_correct' => ($request->isCorrect3 != 1 ? 0 : 1)));\n $question->answers()->attach($a4->id, array('is_correct' => ($request->isCorrect4 != 1 ? 0 : 1)));\n $question->answers()->attach($a5->id, array('is_correct' => ($request->isCorrect5 != 1 ? 0 : 1)));\n \n // question now has the new answers attached to it. \n \n \n // need this line or else it redirects to the non-GET URL\n // it has a PUT request instead, so nothing displays\n // because there is no view associated with a PUT\n // YES IT WORKS\n // THAT IS WHAt I AM TALKING ABOUT\n }\n elseif($request->type == 'true-false')\n {\n $question = Question::find($id);\n $question->prompt = $request->input('prompt'); // works! \n $question->difficulty = $request->input('difficulty'); // works!\n $question->total_score = $request->input('total_score'); // works!\n $question->type = 'true-false';\n $question->save();\n \n // detach all answers from the question\n // attach the newly created ones from the form; overwrites. \n \n $question->answers()->detach(); // detach all answers from question\n \n $a1 = new Answer;\n $a2 = new Answer;\n \n $a1->text = $request->choice1;\n $a2->text = $request->choice2;\n \n $a1->save();\n $a2->save();\n \n $question->answers()->attach($a1->id, array('is_correct' => ($request->isCorrect1 != 1 ? 0 : 1)));\n $question->answers()->attach($a2->id, array('is_correct' => ($request->isCorrect2 != 1 ? 0 : 1)));\n }\n elseif($request->type == 'free-response')\n {\n $question = Question::find($id);\n $question->prompt = $request->prompt;\n $question->difficulty = $request->difficulty;\n $question->subject_id = 1;\n $question->type = 'free-response';\n $question->total_score = $request->total_score;\n $question->save();\n \n $question->answers()->detach();\n \n $a1 = new Answer;\n $a1->text = $request->choice1;\n $a1->save();\n $question->answers()->attach($a1->id, array('is_correct' => 0));\n }\n else\n {\n echo \"Nothing worked!\";\n }\n \n return view('question.show', ['question' => $question]);\n \n }", "public function get($id = null)\n {\n if (!empty($id)) {\n $question = $this->question->find($id);\n\n $question['answers'] = $question->answers()->getResults();\n\n return $question;\n }\n\n $questions = $this->question->get();\n foreach ($questions as &$question) {\n $question['answers'] = $question->answers()->getResults();\n }\n\n return $questions;\n }", "public function deleteQuestionAndAnswers () {\n global $ilUser, $tpl, $ilTabs, $ilCtrl;\n $ilTabs->activateTab(\"editQuiz\");\n\n if(isset($_GET['question_id']) && is_numeric($_GET['question_id'])){\n\n $question_id = $_GET['question_id'];\n\n $this->object->deleteQuestion($question_id);\n $ilTabs->activateTab(\"editQuiz\");\n\n ilUtil::sendSuccess($this->txt(\"successful_delete\"), true);\n // Forwarding\n $ilCtrl->redirect($this, \"editQuiz\");\n }\n }", "function fillQuestion($data)\r\n {\r\n\tfor( $i=0; $i<$data['count']; $i++ ){\r\n\t\t$data[$i]['Question'] = $this->findAll($conditions='id='.$data[$i]['SurveyQuestion']['question_id'], $fields=\"prompt, type\");\r\n\t\t$data[$i]['Question'] = $data[$i]['Question'][0]['Question'];\r\n\t\t$data[$i]['Question']['number'] = $data[$i]['SurveyQuestion']['number'];\r\n\t\t$data[$i]['Question']['id'] = $data[$i]['SurveyQuestion']['question_id'];\r\n\t\t$data[$i]['Question']['sq_id'] = $data[$i]['SurveyQuestion']['id'];\r\n\t\tunset($data[$i]['SurveyQuestion']);\r\n\t}\r\n\r\n\treturn $data;\r\n }", "public function addAnswer(AnswerInterface $answer);", "public function run() {\n $a = new \\App\\Models\\Answer();\n $a->text = 'Scripting Language';\n $a->is_correct = false;\n $a->question_id = 1;\n $a->save();\n\n $a = new \\App\\Models\\Answer();\n $a->text = 'Markup Language';\n $a->is_correct = true;\n $a->question_id = 1;\n $a->save();\n\n $a = new \\App\\Models\\Answer();\n $a->text = 'Programming Language';\n $a->is_correct = false;\n $a->question_id = 1;\n $a->save();\n\n $a = new \\App\\Models\\Answer();\n $a->text = 'Network Protocol';\n $a->is_correct = false;\n $a->question_id = 1;\n $a->save();\n\n $a = new \\App\\Models\\Answer();\n $a->text = '<html>';\n $a->is_correct = false;\n $a->question_id = 2;\n $a->save();\n\n $a = new \\App\\Models\\Answer();\n $a->text = '<!doctype html>';\n $a->is_correct = true;\n $a->question_id = 2;\n $a->save();\n\n $a = new \\App\\Models\\Answer();\n $a->text = '<title>';\n $a->is_correct = false;\n $a->question_id = 2;\n $a->save();\n\n $a = new \\App\\Models\\Answer();\n $a->text = '<head>';\n $a->is_correct = false;\n $a->question_id = 2;\n $a->save();\n\n $a = new \\App\\Models\\Answer();\n $a->text = 'Picture';\n $a->is_correct = false;\n $a->question_id = 3;\n $a->save();\n\n $a = new \\App\\Models\\Answer();\n $a->text = 'Image';\n $a->is_correct = false;\n $a->question_id = 3;\n $a->save();\n\n $a = new \\App\\Models\\Answer();\n $a->text = 'Src';\n $a->is_correct = false;\n $a->question_id = 3;\n $a->save();\n\n $a = new \\App\\Models\\Answer();\n $a->text = 'Img';\n $a->is_correct = true;\n $a->question_id = 3;\n $a->save();\n\n $a = new \\App\\Models\\Answer();\n $a->text = 'Compiler';\n $a->is_correct = false;\n $a->question_id = 4;\n $a->save();\n\n $a = new \\App\\Models\\Answer();\n $a->text = 'Interpreter';\n $a->is_correct = false;\n $a->question_id = 4;\n $a->save();\n\n $a = new \\App\\Models\\Answer();\n $a->text = 'Web Browser';\n $a->is_correct = true;\n $a->question_id = 4;\n $a->save();\n\n $a = new \\App\\Models\\Answer();\n $a->text = 'Server';\n $a->is_correct = false;\n $a->question_id = 4;\n $a->save();\n\n $a = new \\App\\Models\\Answer();\n $a->text = '<break />';\n $a->is_correct = false;\n $a->question_id = 5;\n $a->save();\n\n $a = new \\App\\Models\\Answer();\n $a->text = '<nbsp>';\n $a->is_correct = false;\n $a->question_id = 5;\n $a->save();\n\n $a = new \\App\\Models\\Answer();\n $a->text = '<lb />';\n $a->is_correct = false;\n $a->question_id = 5;\n $a->save();\n\n $a = new \\App\\Models\\Answer();\n $a->text = '<br />';\n $a->is_correct = true;\n $a->question_id = 5;\n $a->save();\n\n $a = new \\App\\Models\\Answer();\n $a->text = '<a href=\"http://example.com\">MCQ Sets Quiz</a>';\n $a->is_correct = true;\n $a->question_id = 6;\n $a->save();\n\n $a = new \\App\\Models\\Answer();\n $a->text = '<http://example.com</a>';\n $a->is_correct = false;\n $a->question_id = 6;\n $a->save();\n\n $a = new \\App\\Models\\Answer();\n $a->text = '<a name=\"http://example.com\">MCQ Sets Quiz</a>';\n $a->is_correct = false;\n $a->question_id = 6;\n $a->save();\n\n $a = new \\App\\Models\\Answer();\n $a->text = 'url=\"http://example.com\">MCQ Sets Quiz';\n $a->is_correct = false;\n $a->question_id = 6;\n $a->save();\n\n $a = new \\App\\Models\\Answer();\n $a->text = 'Special binary format';\n $a->is_correct = false;\n $a->question_id = 7;\n $a->save();\n\n $a = new \\App\\Models\\Answer();\n $a->text = 'Machine language codes';\n $a->is_correct = false;\n $a->question_id = 7;\n $a->save();\n\n $a = new \\App\\Models\\Answer();\n $a->text = 'ASCII text';\n $a->is_correct = true;\n $a->question_id = 7;\n $a->save();\n\n $a = new \\App\\Models\\Answer();\n $a->text = 'None of above';\n $a->is_correct = false;\n $a->question_id = 7;\n $a->save();\n\n $a = new \\App\\Models\\Answer();\n $a->text = '<checkbox>';\n $a->is_correct = false;\n $a->question_id = 8;\n $a->save();\n\n $a = new \\App\\Models\\Answer();\n $a->text = '<input checkbox>';\n $a->is_correct = false;\n $a->question_id = 8;\n $a->save();\n\n $a = new \\App\\Models\\Answer();\n $a->text = '<input=checkbox>';\n $a->is_correct = false;\n $a->question_id = 8;\n $a->save();\n\n $a = new \\App\\Models\\Answer();\n $a->text = '<input type=\"checkbox\">';\n $a->is_correct = true;\n $a->question_id = 8;\n $a->save();\n\n $a = new \\App\\Models\\Answer();\n $a->text = '<heading>';\n $a->is_correct = false;\n $a->question_id = 9;\n $a->save();\n\n $a = new \\App\\Models\\Answer();\n $a->text = '<head>';\n $a->is_correct = false;\n $a->question_id = 9;\n $a->save();\n\n $a = new \\App\\Models\\Answer();\n $a->text = '<h1>';\n $a->is_correct = false;\n $a->question_id = 9;\n $a->save();\n\n $a = new \\App\\Models\\Answer();\n $a->text = '<h6>';\n $a->is_correct = true;\n $a->question_id = 9;\n $a->save();\n\n $a = new \\App\\Models\\Answer();\n $a->text = '<video src \"URL\"></video>';\n $a->is_correct = false;\n $a->question_id = 10;\n $a->save();\n\n $a = new \\App\\Models\\Answer();\n $a->text = '<video src=\"URL\"></video>';\n $a->is_correct = true;\n $a->question_id = 10;\n $a->save();\n\n $a = new \\App\\Models\\Answer();\n $a->text = '<video></video>';\n $a->is_correct = false;\n $a->question_id = 10;\n $a->save();\n\n $a = new \\App\\Models\\Answer();\n $a->text = '<video src:\"URL\"></video>';\n $a->is_correct = false;\n $a->question_id = 10;\n $a->save();\n }", "public function run()\n {\n // Insertion dans la table CHOICES\n DB::table('questions')->insert([\n\n //QCM 1 : 15 questions : Niveau première\n [ \n 'content' => 'Isaac Newton était un savant anglais.',\n 'answer' => 'yes',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Isaac Newton était un homme politique américain.',\n 'answer' => 'no',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Isaac Newton était un musicien de jazz.',\n 'answer' => 'no',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Isaac Newton était un premier ministre israélien.',\n 'answer' => 'no',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Pendant ses deux septennats, François Mitterrand a nommé 3 premiers ministres.',\n 'answer' => 'no',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Pendant ses deux septennats, François Mitterrand a nommé 5 premiers ministres.',\n 'answer' => 'no',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Pendant ses deux septennats, François Mitterrand a nommé 7 premiers ministres.',\n 'answer' => 'yes',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Le 6 juin 1944 s\\'est produit : L\\'appel du général de Gaulle à ne pas capituler.',\n 'answer' => 'no',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Le 6 juin 1944 s\\'est produit : Le débarquement allié en Normandie.',\n 'answer' => 'yes',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Le 6 juin 1944 s\\'est produit : L\\'armistice de la Seconde Guerre mondiale.',\n 'answer' => 'no',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => '« C\\'est un petit pas pour l\\'homme, mais un bond de géant pour l\\' humanité ». Cette phrase célèbre a été prononcée en 1968 par John Kennedy.',\n 'answer' => 'no',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => '« C\\'est un petit pas pour l\\'homme, mais un bond de géant pour l\\' humanité ». Cette phrase célèbre a été prononcée en 1969 par Neil Amstrong.',\n 'answer' => 'yes',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => '« C\\'est un petit pas pour l\\'homme, mais un bond de géant pour l\\' humanité ». Cette phrase célèbre a été prononcée en 1971 par Martin Luther King.',\n 'answer' => 'no',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Le président des États-Unis John Kennedy a été mêlé à l\\'affaire dite du Watergate.',\n 'answer' => 'no',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Le président des États-Unis Richard Nixon a été mêlé à l\\'affaire dite du Watergate.',\n 'answer' => 'yes',\n 'qcm_id' => '1'\n ],\n //QCM 2 : 12 questions : Niveau première\n [ \n 'content' => 'La première République française a été proclamée en 1792.',\n 'answer' => 'yes',\n 'qcm_id' => '2'\n ],\n [ \n 'content' => 'La première République française a été proclamée en 1789.',\n 'answer' => 'no',\n 'qcm_id' => '2'\n ],\n [ \n 'content' => 'La première République française a été proclamée en 1794.',\n 'answer' => 'no',\n 'qcm_id' => '2'\n ],\n [ \n 'content' => 'Louis XVI s\\'est fait arrêter à Versailles par les sans-culotte.',\n 'answer' => 'no',\n 'qcm_id' => '2'\n ],\n [ \n 'content' => 'Sous la Quatrième République, le chef de l\\'État était élu par les députés et sénateurs.',\n 'answer' => 'yes',\n 'qcm_id' => '2'\n ],\n [ \n 'content' => 'Sous la Quatrième République, le chef de l\\'État était élu au suffrage universel.',\n 'answer' => 'no',\n 'qcm_id' => '2'\n ],\n [ \n 'content' => 'Sous la Quatrième République, le chef de l\\'État était nommé par le Conseil d\\'État.',\n 'answer' => 'no',\n 'qcm_id' => '2'\n ],\n [ \n 'content' => 'L\\'Académie française a été créée sous Louis XIII.',\n 'answer' => 'yes',\n 'qcm_id' => '2'\n ],\n [ \n 'content' => 'L\\'Académie française a été créée sous Louis XIV.',\n 'answer' => 'no',\n 'qcm_id' => '2'\n ],\n [ \n 'content' => 'L\\'Académie française a été créée sous Napoléon 1er.',\n 'answer' => 'no',\n 'qcm_id' => '2'\n ],\n [\n 'content' => 'Christophe Colomb a découvert l\\'Amérique en 1492.',\n 'answer' => 'yes',\n 'qcm_id' => '2'\n ],\n [ \n 'content' => 'Christophe Colomb a découvert l\\'Amérique en 1515.',\n 'answer' => 'no',\n 'qcm_id' => '2'\n ],\n //QCM 3 : 15 questions : Niveau terminale\n [ \n 'content' => 'Le procès de Nuremberg a eu lieu en 1945.',\n 'answer' => 'yes',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Le procès de Nuremberg a eu lieu en 1948.',\n 'answer' => 'no',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'La révocation de l\\'Édit de Nantes a instauré le rattachement de la Vendée à la France.',\n 'answer' => 'no',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'La révocation de l\\'Édit de Nantes a instauré l\\'interdiction du protestantisme.',\n 'answer' => 'yes',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Le conflit des Malouines a opposé le Royaume-Uni au Chili.',\n 'answer' => 'no',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Le conflit des Malouines a opposé le Royaume-Uni à l\\'Argentine.',\n 'answer' => 'yes',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Alexandrie, la ville fondée par Alexandre le Grand se trouvait en Macédoine.',\n 'answer' => 'no',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Alexandrie, la ville fondée par Alexandre le Grand se trouvait en Egypte.',\n 'answer' => 'yes',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Alexandrie, la ville fondée par Alexandre le Grand se trouvait en Grèce.',\n 'answer' => 'no',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Henri IV était issu de la famille des Bourbons.',\n 'answer' => 'yes',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Henri IV était issu de la famille des Artois.',\n 'answer' => 'no',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Mohandas Gandhi, était surnommé Mahatma. Ce surnom signifie \"L\\'éveillé\".',\n 'answer' => 'no',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Mohandas Gandhi, était surnommé Mahatma. Ce surnom signifie \"Grande âme\".',\n 'answer' => 'yes',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Mohandas Gandhi, était surnommé Mahatma. Ce surnom signifie \"Indépendant\".',\n 'answer' => 'no',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Mohandas Gandhi, était surnommé Mahatma. Ce surnom signifie \"Sage dans ses paroles\".',\n 'answer' => 'no',\n 'qcm_id' => '3'\n ],\n //QCM 4 : 12 questions : Niveau terminale\n [ \n 'content' => 'Louis XVI a été arrêté à Varennes alors qu\\'il tentait de fuir la France en 1791.',\n 'answer' => 'yes',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'Louis XVI a été arrêté à Varennes alors qu\\'il tentait de fuir la France en 1789.',\n 'answer' => 'no',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'Louis XVI a été arrêté à Varennes alors qu\\'il tentait de fuir la France en 1790.',\n 'answer' => 'no',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'L\\'État du Suriname se trouve en Afrique.',\n 'answer' => 'no',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'L\\'État du Suriname se trouve en Amérique du Sud.',\n 'answer' => 'yes',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'L\\'État du Suriname se trouve en Asie.',\n 'answer' => 'no',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'La bataille de Marignan s\\'est déroulé en 1515.',\n 'answer' => 'yes',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'La bataille de Marignan s\\'est déroulé en 1615.',\n 'answer' => 'no',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'La bataille de Marignan s\\'est déroulé en 1415.',\n 'answer' => 'no',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'La couleur du cheval Blanc d\\'henri IV était : Noir et Blanc.',\n 'answer' => 'no',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'La couleur du cheval Blanc d\\'henri IV était : Marron.',\n 'answer' => 'no',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'La couleur du cheval Blanc d\\'henri IV était : Blanc.',\n 'answer' => 'yes',\n 'qcm_id' => '4'\n ],\n \t]);\n }", "public function viewquestion($id='')\n {\n $this->middleware('auth');\n $prewere = [['id','=',$id],['status', '!=','2' ]];\n $data['questions']=Question_answers::getbyconditionall($prewere);\n foreach($data['questions'] as $key=> $d)\n {\n if(!empty($d['country']))\n { $gettagss = [['id', '=', $d['country']],['parent', '=', 0],['status', '=', '1']];\n $data['questions'][$key]['country']= country::getoptionmatchall2($gettagss);\n if(!empty($d['state']))\n { $gettagss2 = [['parent', '=', $d['country']],['id', '=', $d['state']],['status', '=', '1']];\n $data['questions'][$key]['state']= country::getoptionmatchall2($gettagss2);\n }else\n { \n $data['questions'][$key]['state']= 'Not Specified';\n }\n }else\n {\n $data['questions'][$key]['country']= 'Not Specified';\n $data['questions'][$key]['state']= 'Not Specified';\n }\n \n \n \n if(!empty($d['year']))\n { $were = array('status'=>'1','id'=>$d['year']);\n $data['questions'][$key]['year']= Years::getoptionmatchall2($were); \n }else\n { \n $data['questions'][$key]['year']= 'Not Specified';\n }\n \n if(!empty($d['grade']))\n { \n $were = array('id'=>$d['grade']);\n $data['questions'][$key]['grade']= Grades::getoptionmatchall2($were); \n }else\n {\n $data['questions'][$key]['grade']= 'Not Specified';\n }\n \n if(!empty($d['course']))\n {\n $gettagss2 = array('id'=>$d['course']);\n $data['questions'][$key]['course']=course::getoptionmatchall2($gettagss2);\n if(!empty($d['subject']))\n {\n $gettagssub22 = [['parent', '=', $d['course']],['id', '=', $d['subject']],['type', '=', '2']]; \n $data['questions'][$key]['subject']=course::getoptionmatchall2($gettagssub22); \n if(!empty($d['chapter']))\n {\n $gettagschap = [['parent', '=', $d['subject']],['id', '=', $d['chapter']],['type', '=', '3']];\n $data['questions'][$key]['chapter']=course::getoptionmatchall2($gettagschap);\n }else\n {\n $data['questions'][$key]['chapter']='Not Specified'; \n }\n }else\n {\n $data['questions'][$key]['subject']='Not Specified';\n $data['questions'][$key]['chapter']='Not Specified';\n }\n }else\n {\n $data['questions'][$key]['course']= 'Not Specified'; \n $data['questions'][$key]['subject']='Not Specified';\n $data['questions'][$key]['chapter']='Not Specified';\n }\n \n } \n \n $messags['message'] = \"Question data.\";\n $messags['status']= 1; \n $messags['data']= $data; \n echo json_encode($messags);\n die;\n }", "private function generateNextQuestion(){\n while(true) {\n $id = rand($this->minId, /*$this->maxId*/20);\n\n if (!in_array($id, $this->answeredQuestions)) {\n array_push($this->answeredQuestions,$id);\n return $id;\n }\n }\n }", "public function insert_question_info()\n {\n \t\t\t\t\t\t\t\t\n codeQuestions::create([\n 'content' =>request('content'),\n /* 'test_case1' =>request('test_case1'),\n 'test_case1_result' =>request('test_case1_result'), \n 'test_case2' =>request('test_case2'), \n 'test_case2_result' =>request('test_case2_result'),\n 'test_case3' =>request('test_case3'),\n 'test_case3_result' =>request('test_case3_result'),\n // 'student_answer' =>request('student_answer'),*/\n 'degree' =>request('degree'),\n 'language' =>request('language'),\n 'type' =>request('type'),\n 'id_exam' =>request('id_exam')\n ]);\n\n ////////////////to make exam id hidden////////////////////////////////////\n $allExams=exams::all();\n return view('exam_questions',['allExams'=>$allExams]); \n ///////////////////////////////////////\n // return redirect('exam_questions') ;\n \n }", "public function addAnswerToStoryQuestion($storyId, $questionID, $answerId)\n\t{\n\t\t//Accepts a story class\n\t\t//inserts a new story with the publish flag set to false\n\t\t//returns bool if the story was saved succesfully\n\t\ttry\n\t\t{\n\t\t\t// create a php timestamp for inserting into the created and updated date fields in the database \n\t\t\t//$timestamp = date('Y-m-d G:i:s');\n\t\t\t$statement = \"INSERT INTO story_has_answer_for_question (Story_StoryId, Answer_for_Question_Question_QuestionId, Answer_for_Question_Answer_AnswerId, DateCreated)\n\t\t\t\t\t\t VALUES(:StoryId, :Answer_for_Question_Question_QuestionId, :Answer_for_Question_Answer_AnswerId, :DateCreated)\";\n \n\t\t\t$parameters = array(\":StoryId\" => $storyId, \n\t\t\t\t\t\t\t\t\":Answer_for_Question_Question_QuestionId\" => $questionID,\n\t\t\t\t\t\t\t\t\":Answer_for_Question_Answer_AnswerId\" => $answerId, \n\t\t\t\t\t\t\t\t\":DateCreated\" => $this->getDateNow()\n\t\t\t\t\t\t\t\t);\n\n\t\t\treturn $this->fetch($statement, $parameters);\n\t\t}\n\t\tcatch(Exception $e) \n\t\t{\n\t\t\tthrow $ex;\n\t\t}\n\t}", "public function addSubmittedExercise() {\n\n\t\t//$answers_from_current_user = xaseAnswer::where(array('user_id' => $this->dic->user()->getId(), 'question_id' => $this->xase_question->getId()))->get();\n\n\n\t\t$all_items_assisted_exercise = xaseQuestion::where(array( 'assisted_exercise_id' => $this->assisted_exercise->getId() ))->get();\n\n\t\t$answers_from_current_user = xaseQuestionTableGUI::getAllUserAnswersFromAssistedExercise($all_items_assisted_exercise, $this->dic, $this->dic->user());\n\n\t\t/*\n\t\t * @var xaseAnswer $answers_from_current_user\n\t\t */\n\t\tforeach ($answers_from_current_user as $answer_from_current_user) {\n\t\t\tif (is_array($answers_from_current_user)) {\n\t\t\t\t$answer_from_current_user_object = xaseAnswer::where(array( 'id' => $answer_from_current_user['id'] ))->first();\n\t\t\t\t$answer_from_current_user_object->setAnswerStatus(xaseAnswer::ANSWER_STATUS_CAN_BE_VOTED);\n\t\t\t\t$answer_from_current_user_object->setSubmissionDate(date('Y-m-d H:i:s'));\n\t\t\t\t$answer_from_current_user_object->setIsAssessed(0);\n\t\t\t\t$answer_from_current_user_object->store();\n\t\t\t} else {\n\t\t\t\t$answer_from_current_user_object = xaseAnswer::where(array( 'id' => $answers_from_current_user['id'] ));\n\t\t\t\t$answer_from_current_user_object->setAnswerStatus(xaseAnswer::ANSWER_STATUS_CAN_BE_VOTED);\n\t\t\t\t$answer_from_current_user_object->setSubmissionDate(date('Y-m-d H:i:s'));\n\t\t\t\t$answer_from_current_user_object->setIsAssessed(0);\n\t\t\t\t$answer_from_current_user_object->store();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tilUtil::sendSuccess($this->obj_facade->getLanguageValue('success_message_exercise_submitted'), true);\n\t\t$this->obj_facade->getCtrl()->redirectByClass(xaseQuestionGUI::class, xaseQuestionGUI::CMD_INDEX);\n\t}", "function getanswers($assid, $studentid, $questionid){\n\t\t\t$strQuery=\"select solution from answers where assid='$assid' and questionid = '$questionid' and stid = '$studentid'\";\n\t\t\t$result = $this->query($strQuery);\n\t}", "function set_up_question($question_ID)\r\n{\r\n\tglobal $mydb, $question, $answers, $correct_answer, $is_question, $is_random_question;\r\n\t\r\n\t// set the is question global variable\r\n\t$is_question = true;\r\n\r\n\tif (($question_ID == \"random\") || !$question_ID)\r\n\t{\r\n\t\t$is_random_question = true;\r\n\t\t$question = get_question_random();\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$is_random_question = false;\r\n\t\t$question = get_question_from_ID($question_ID);\r\n\r\n\t}\r\n\t\r\n\t// get random answers\r\n\t$answers = $question->get_Answers();\r\n\t\r\n\t// get the correct answer and remember it\r\n\tforeach ($answers as $answer)\r\n\t{\r\n\t\tif ($answer->is_correct())\r\n\t\t{\r\n\t\t\t$correct_answer = $answer;\r\n\t\t}\r\n\t}\r\n}", "public function initAddQuestionAndAnswersForm () {\n global $tpl, $ilCtrl;\n\n $my_tpl = new ilTemplate(\"tpl.question_and_answers.html\", true, true,\n \"Customizing/global/plugins/Services/Repository/RepositoryObject/MobileQuiz\");\n $rtokenFactory = new ilCtrl();\n $my_tpl->setVariable(\"ACTION_URL\",$this->ctrl->getFormAction($this));\n $my_tpl->setVariable(\"SUBMIT_BUTTON\", $this->txt(\"save\"));\n $my_tpl->setVariable(\"NEW_QUESTION\", $this->txt(\"question_add_head\"));\n $my_tpl->setVariable(\"QUESTION\", $this->txt(\"question_add_text\"));\n $my_tpl->setVariable(\"QUESTION_TYPE\", $this->txt(\"question_add_type\"));\n $my_tpl->setVariable(\"CHOICES\", $this->txt(\"choice_add_texts\"));\n $my_tpl->setVariable(\"VAR_1\", \"value1\");\n $my_tpl->setVariable(\"COMMAND\", \"cmd[createQuestionAndAnswers]\");\n $my_tpl->setVariable(\"MINIMUM\", $this->txt(\"choice_add_numeric_minimum\"));\n $my_tpl->setVariable(\"MAXIMUM\", $this->txt(\"choice_add_numeric_maximum\"));\n $my_tpl->setVariable(\"STEP\", $this->txt(\"choice_add_numeric_steprange\"));\n $my_tpl->setVariable(\"CORRECT_VALUE\", $this->txt(\"choice_add_numeric_correctvalue\"));\n $my_tpl->setVariable(\"TOLERANCE_RANGE\", $this->txt(\"choice_add_numeric_tolerenace_range\"));\n $my_tpl->setVariable(\"SELECTED_SINGLE\", 'selected=\"selected\"');\n\n $my_tpl->setVariable(\"HIDE_NUMERIC_BLOCK\", 'style=\"display:none;\"');\n $my_tpl->setVariable(\"HIDE_SINGLE_CHOICE_BLOCK\", 'style=\"display:none;\"');\n\n $html = $my_tpl->get();\n $tpl->setContent($html);\n }", "public function run()\n {\n $questao = Question::where('id', 1)->first();\n\n $answer = new Answer();\n $answer->a = 'r1';\n $answer->b = 'r2';\n $answer->c = 'r3';\n $answer->is_correct = 'a';\n //$answer->questions()->attach($questao);\n $answer->save();\n $answer->questions()->attach($questao); \n \n }", "function create_mcq($question_set, $question_text, $answer_list, $answer_key) {\n $question = array();\n $question['type'] = '1';\n $question['answer_list'] = $answer_list;\n $question['answer_key'] = $answer_key;\n $question_set['el_set'][] = $question;\n return $question_set;\n}", "public function createQuestionAndAnswers () {\n global $tpl, $lng, $ilCtrl, $ilTabs;\n\n // create wizard object\n include_once('class.ilObjMobileQuizWizard.php');\n $wiz = new ilObjMobileQuizWizard();\n\n\n $ilTabs->activateTab(\"editQuiz\");\n\n\n if ($wiz->checkInput()){\n $wiz->createQuestionAndAnswers($this->object);\n ilUtil::sendSuccess($this->txt(\"question_obj_create\"), true);\n $ilCtrl->redirect($this, \"editQuiz\");\n }\n $this->initAddQuestionAndAnswersFormAfterError();\n //$tpl->setContent(\"Test\");\n }", "public function nextQuestion(){\n $curr = $this->request->getVar(\"currQuestion\");\n $selected = $this->request->getVar(\"selected\");\n\n if($curr != 1){\n $this->answeredQuestions = $this->session->get('questions');\n $this->answersId = $this->session->get('answers');\n $this->score = $this->session->get('score');\n }\n\n if($curr == 1) $this->resetAll();\n\n $selected -= 1;\n if($curr != 1){\n $this->addValues($selected);\n }\n\n if($curr != 6) {\n $id = $this->generateNextQuestion();\n $question = $this->getQuestion($id);\n $answers = $this->getAnswers($question);\n }\n\n if($curr == 6){\n $id = $this->findRecommendation();\n $this->session->remove('questions');\n $this->session->remove('answers');\n $this->session->remove('score');\n echo \"gotovo,\".$id;\n return;\n }\n\n $this->session->set('questions',$this->answeredQuestions );\n $this->session->set('answers',$this->answersId );\n $this->session->set('score',$this->score);\n\n\n echo $question->text.\"\".$answers;\n\n }", "public function run()\n {\n DB::table('answers')->insert([\n [\n 'answer_id' => '1',\n 'answers' => 'No, Mourinho deserves to go to a better club than spursy',\n 'question_id' => '1',\n 'id' => '2',\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s')\n ],\n [\n 'answer_id' => '2',\n 'answers' => 'Furthermore, he is a top manager aint he, he should go for national teams',\n 'question_id' => '1',\n 'id' => '2',\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s')\n ],\n [\n 'answer_id' => '3',\n 'answers' => 'They scammed, obviously',\n 'question_id' => '2',\n 'id' => '2',\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s')\n ],\n [\n 'answer_id' => '4',\n 'answers' => 'the man aint good enough to tell hes actually rich',\n 'question_id' => '2',\n 'id' => '2',\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]\n ]);\n }", "public function getAnswersByQuestion()\n {\n $question_id = request('question');\n\n $question = PollQuestion::where('id', $question_id)->first();\n $answers = Answer::where('question_id', $question_id)->get();\n\n $data['question'] = $question;\n $data['answers'] = $answers;\n\n return view('answer', ['data' => $data]);\n }", "private function extractQuestions(){\n $this->selectQuestions();\n $num=mysqli_num_rows($this->arrResultQuestions);\n for($i=0; $i<$num; $i++):\n $row=mysqli_fetch_object($this->arrResultQuestions);\n $misc=new misc();\n $fromWho=$misc->singleSelection('username', 'users', 'user_id', '=', $row->user_id);\n ?>\n <article class=\"homePageQuestions homePageArticle<?php echo $i; ?>\">\n <h3 class=\"homePageQuestionHeading\"><a href=\"?questionBody=<?php echo $row->post_id; ?>\"><?php echo $row->name; ?></a></h3>\n <span class=\"homePageQuestionAddFrom\"><span class=\"glyphicon glyphicon-user\"></span><a href=\"?user=<?php echo $row->user_id; ?>\"><?php echo $fromWho; ?></a></span>\n <span class=\"homePageQuestionAddTime\"><span class=\"glyphicon glyphicon-time\"></span><?php echo date('d.m.Y в H:i', $row->timeadded); ?></span>\n <span class=\"homePageQuestionAddTime\"><span class=\"glyphicon glyphicon-tag\"></span><?php echo $this->selectCategory($row->cat_id); ?></span>\n <span class=\"homePageQuestionVisits\"><?php echo $row->visits ?> Показвания</span>\n <?php\n $this->showingQuestionsFooter($row->lastanswered, $row->lastanswer, $row->post_id);\n ?>\n </article>\n <?php\n endfor;\n }", "public function ajax_question_details($question_id){\n $question_details = $this->challenge_question_model->get_question_by_id($question_id);\n\n $question_type = $this->challenge_questionlib->get_question_image_type($question_id);\n $out = array();\n $out['question_text'] = $question_details->getText();\n $out['question_type'] = $question_type;\n\n switch($question_type){\n case 'question_type_1':\n $question_choice = $this->challenge_question_model->get_choices_by_question_id($question_id);\n foreach($question_choice as $choice=>$val){\n $out['answers'][$choice]['text'] = $val->getText();\n if($val->getChoiceId() === $question_details->getCorrectChoiceId()){\n $out['answers'][$choice]['correct'] = true;\n }\n }\n break;\n case 'question_type_2':\n $question_choice = $this->challenge_question_model->get_choices_by_question_id($question_id);\n foreach($question_choice as $choice=>$val){\n $out['answers'][$choice]['text'] = $val->getText();\n if($val->getChoiceId() === $question_details->getCorrectChoiceId()){\n $out['answers'][$choice]['correct'] = true;\n }\n }\n break;\n case 'question_type_3':\n $out['question_image'] = $question_details->getQuestionId();\n $question_choice = $this->challenge_question_model->get_choices_by_question_id($question_id);\n foreach($question_choice as $choice=>$val){\n $out['answers'][$choice]['text'] = $val->getText();\n if($val->getChoiceId() === $question_details->getCorrectChoiceId()){\n $out['answers'][$choice]['correct'] = true;\n }\n }\n break;\n case 'question_type_4':\n $question_choice = $this->challenge_question_model->get_choices_by_question_id($question_id);\n foreach($question_choice as $choice=>$val){\n $out['answers'][$choice]['answer_image'] = $val->getChoiceId();\n if($val->getChoiceId() === $question_details->getCorrectChoiceId()){\n $out['answers'][$choice]['correct'] = true;\n }\n }\n break;\n case 'question_type_5':\n $out['question_image'] = $question_details->getQuestionId();\n $question_choice = $this->challenge_question_model->get_choices_by_question_id($question_id);\n foreach($question_choice as $choice=>$val){\n $out['answers'][$choice]['answer_image'] = $val->getChoiceId();\n if($val->getChoiceId() === $question_details->getCorrectChoiceId()){\n $out['answers'][$choice]['correct'] = true;\n }\n }\n break;\n case 'question_type_6':\n $question_choice = $this->challenge_question_model->get_choices_by_question_id($question_id);\n foreach($question_choice as $choice=>$val){\n $out['answers'][$choice]['text'] = $val->getText();\n if($val->getChoiceId() === $question_details->getCorrectChoiceId()){\n $out['answers'][$choice]['correct'] = true;\n }\n }\n break;\n case 'question_type_7':\n $out['correct_text'] = $question_details->getCorrectText();\n break;\n case 'question_type_8':\n $out['correct_text'] = $question_details->getCorrectText();\n $out['question_image'] = $question_details->getQuestionId();\n break;\n case 'question_type_9':\n $out['question_image'] = $question_details->getQuestionId();\n $question_choice = $this->challenge_question_model->get_choices_by_question_id($question_id);\n foreach($question_choice as $choice=>$val){\n $out['answers'][$choice]['text'] = $val->getText();\n }\n $out['correct_text'] = $question_details->getCorrectText();\n break;\n case 'question_type_10':\n $out['question_image'] = $question_details->getQuestionId();\n $question_choice = $this->challenge_question_model->get_choices_by_question_id($question_id);\n foreach($question_choice as $choice=>$val){\n $out['answers'][$choice]['text'] = $val->getText();\n if($val->getChoiceId() === $question_details->getCorrectChoiceId()){\n $out['answers'][$choice]['correct'] = true;\n }\n }\n break;\n case 'question_type_11':\n $out['question_image'] = $question_details->getQuestionId();\n $question_choice = $this->challenge_question_model->get_choices_by_question_id($question_id);\n foreach($question_choice as $choice=>$val){\n $out['answers'][$choice]['answer_image'] = $val->getChoiceId();\n if($val->getChoiceId() === $question_details->getCorrectChoiceId()){\n $out['answers'][$choice]['correct'] = true;\n }\n }\n break;\n case 'question_type_12':\n $question_choice = $this->challenge_question_model->get_choices_by_question_id($question_id);\n foreach($question_choice as $choice=>$val){\n $out['answers'][$choice]['answer_image'] = $val->getChoiceId();\n if($val->getChoiceId() === $question_details->getCorrectChoiceId()){\n $out['answers'][$choice]['correct'] = true;\n }\n }\n break;\n case 'question_type_13':\n $question_choice = $this->challenge_question_model->get_choices_by_question_id($question_id);\n foreach($question_choice as $choice=>$val){\n $out['answers'][$choice]['text'] = $val->getText();\n if($val->getChoiceId() === $question_details->getCorrectChoiceId()){\n $out['answers'][$choice]['correct'] = true;\n }\n }\n break;\n case 'question_type_14':\n $question_choice = $this->challenge_question_model->get_choices_by_question_id($question_id);\n foreach($question_choice as $choice=>$val){\n $out['answers'][$choice]['text'] = $val->getText();\n if($val->getChoiceId() === $question_details->getCorrectChoiceId()){\n $out['answers'][$choice]['correct'] = true;\n }\n }\n break;\n case 'question_type_15':\n $out['question_image'] = $question_details->getQuestionId();\n $question_choice = $this->challenge_question_model->get_choices_by_question_id($question_id);\n foreach($question_choice as $choice=>$val){\n $out['answers'][$choice]['text'] = $val->getText();\n }\n $out['correct_text'] = $question_details->getCorrectText();\n break;\n case 'question_type_16':\n $out['correct_text'] = $question_details->getCorrectText();\n $out['read_text'] = $question_details->getReadText();\n break;\n\n }\n\n $this->output->set_output(json_encode($out));\n }", "public function addquest()\n\t{\n\t\tif(mayEditQuiz())\n\t\t{\n\t\t\tif(isset($_GET['text']) && isset($_GET['fp']) && isset($_GET['qid']))\n\t\t\t{\n\t\t\t\t$fp = (int)$_GET['fp'];\n\t\t\t\t$text = strip_tags($_GET['text']);\n\t\t\t\t$duration = (int)$_GET['duration'];\n\t\t\t\t\n\t\t\t\tif(!empty($text))\n\t\t\t\t{\n\t\t\t\t\tif($id = $this->model->addQuestion($_GET['qid'],$text,$fp,$duration))\n\t\t\t\t\t{\n\t\t\t\t\t\tfs_info('Frage wurde angelegt');\n\t\t\t\t\t\treturn array(\n\t\t\t\t\t\t\t'status' => 1,\n\t\t\t\t\t\t\t'script' => 'goTo(\"/?page=quiz&id='.(int)$_GET['qid'].'&fid='.(int)$id.'\");'\n\t\t\t\t\t\t);\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn array(\n\t\t\t\t\t\t'status' => 1,\n\t\t\t\t\t\t'script' => 'pulseError(\"Du solltest eine Frage angeben ;)\");'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public function store(Request $request)\n {\n $question = new Question;\n $question->prompt = $request->prompt;\n $question->difficulty = $request->difficulty;\n $question->total_score = $request->total_score;\n $question->subject_id = 1;\n $question->save();\n\n $a1 = new Answer;\n $a2 = new Answer;\n $a3 = new Answer;\n $a4 = new Answer;\n $a5 = new Answer;\n \n $a1->text = $request->choice1;\n $a2->text = $request->choice2;\n $a3->text = $request->choice3;\n $a4->text = $request->choice4;\n $a5->text = $request->choice5;\n\n $a1->save();\n $a2->save();\n $a3->save();\n $a4->save();\n $a5->save();\n\n $question->answers()->attach($a1->id, array('is_correct' => ($request->isCorrect1 != 1 ? 0 : 1)));\n $question->answers()->attach($a2->id, array('is_correct' => ($request->isCorrect2 != 1 ? 0 : 1)));\n $question->answers()->attach($a3->id, array('is_correct' => ($request->isCorrect3 != 1 ? 0 : 1)));\n $question->answers()->attach($a4->id, array('is_correct' => ($request->isCorrect4 != 1 ? 0 : 1)));\n $question->answers()->attach($a5->id, array('is_correct' => ($request->isCorrect5 != 1 ? 0 : 1)));\n\n // return Redirect::back()->withMsg('Quiz Question Created');\n return redirect('/question');\n }", "function TestSave_getAnswers1(){\n \t$newAnswer = new Answer();\n \t$answerArray = array(array(\"elementId\" => 1, \"value\" => \"15\"), array(\"elementId\" => 2, \"value\" => \"0\"), array(\"elementId\" => 2, \"value\" => \"56\"), array(\"elementId\" => 2, \"value\" => \"29\"));\n \t\n \t$newAnswer->setAnswers($answerArray);\n \t$this->assertTrue($answerArray == $newAnswer->getAnswers());\n }", "public function post_enter_answer(Request $request, $id_exam)\n {\n try {\n $number_of_questions = $this->_db_exam->get_a_exam_file($id_exam)->number_of_questions;\n $list_answer = [];\n for ($index = 1; $index <= $number_of_questions; $index++) {\n $answer = $request[$index];\n if ($answer <= 4 && $answer >= 1) {\n $list_answer[] = [\n 'stt' => $index,\n 'answer' => $answer\n ];\n } else {\n return redirect()->back()\n ->with('message_notification', \"Nhập đáp án không đúng định dạng. Nhập lại\");\n }\n }\n $list_answer_json = json_encode($list_answer);\n $result = $this->_db_exam->save_answer($id_exam, $list_answer_json);\n if (is_numeric($result)) {\n return redirect('ctv/exam/have_answer/list=%20')\n ->with('message_success', \"Lưu đáp án thành công\");\n }\n return redirect()->back()->with('message_notification', \"Lưu đáp án thất bại\");\n } catch (\\Exception $ex) {\n return $ex;\n }\n }", "function ipal_get_questions_student($qid){\r\n\r\n global $ipal;\r\n global $DB;\r\n global $CFG;\r\n\t\t$q='';\r\n\t\t$pagearray2=array();\r\n\t\t\r\n $aquestions=$DB->get_record('question',array('id'=>$qid));\r\n\t\t\tif($aquestions->questiontext != \"\"){ \r\n\r\n\t$pagearray2[]=array('id'=>$qid, 'question'=>$aquestions->questiontext, 'answers'=>ipal_get_answers_student($qid));\r\n\t\t\t\t\t\t\t}\r\n return($pagearray2);\r\n}" ]
[ "0.6736297", "0.6589886", "0.65553516", "0.65109354", "0.64700896", "0.64549553", "0.64475566", "0.6443375", "0.6435434", "0.64196", "0.63883567", "0.63733613", "0.6357432", "0.62988913", "0.6266775", "0.6262349", "0.6237847", "0.62125045", "0.61880493", "0.6181687", "0.6176122", "0.6149333", "0.60998005", "0.6097686", "0.60866237", "0.6086409", "0.6077391", "0.6066321", "0.60334325", "0.6029569", "0.5990986", "0.5988314", "0.5986082", "0.5985778", "0.5985545", "0.59823424", "0.5949472", "0.5948793", "0.5946756", "0.5944443", "0.594131", "0.59385645", "0.59328514", "0.5926754", "0.5921367", "0.5912137", "0.5907834", "0.5903129", "0.5901244", "0.59005904", "0.5886903", "0.5874046", "0.5871578", "0.587094", "0.5864324", "0.5857387", "0.585702", "0.58493644", "0.5848069", "0.5832117", "0.58291745", "0.58227986", "0.58186436", "0.5818149", "0.5807371", "0.579667", "0.57926524", "0.578652", "0.57811487", "0.5779886", "0.5777283", "0.57708925", "0.57689047", "0.5763763", "0.5755346", "0.5746708", "0.57439035", "0.5727979", "0.57240146", "0.5720091", "0.57182574", "0.57125145", "0.5710033", "0.5701191", "0.56958854", "0.5693523", "0.56911814", "0.56850535", "0.5675597", "0.5664545", "0.5659482", "0.5650103", "0.5647037", "0.5643267", "0.5628409", "0.5619762", "0.56173116", "0.56124926", "0.5605847", "0.56055987", "0.56011444" ]
0.0
-1
Confirm by email (Config::TT()['CONFIRMEMAIL'] first contact)
public function signup() { $id = (int) Input::get("id"); $md5 = Input::get("secret"); if (!$id || !$md5) { Redirect::autolink(URLROOT, Lang::T("INVALID_ID")); } $row = Users::getPasswordSecretStatus($id); if (!$row) { $mgs = sprintf(Lang::T("CONFIRM_EXPIRE"), Config::TT()['SIGNUPTIMEOUT'] / 86400); Redirect::autolink(URLROOT, $mgs); } if ($row['status'] != "pending") { Redirect::autolink(URLROOT, Lang::T("ACCOUNT_ACTIVATED")); die; } if ($md5 != $row['secret']) { Redirect::autolink(URLROOT, Lang::T("SIGNUP_ACTIVATE_LINK")); } $secret = Helper::mksecret(); $upd = Users::updatesecret($secret, $id, $row['secret']); if ($upd == 0) { Redirect::autolink(URLROOT, Lang::T("SIGNUP_UNABLE")); } Redirect::autolink(URLROOT . '/login', Lang::T("ACCOUNT_ACTIVATED")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function confirm_account_email() {\n $model = \\Auth::$model;\n $user = $model::requested();\n\n if (!$user->nil()) {\n if ($user->validate()) {\n $code = confirm_account_email($user->email);\n\n if ($code === -1) {\n flash('Sua conta já está confirmada, basta acessá-la.', 'warning');\n } else if ($code == true)\n flash(\"Enviamos um e-mail para <small><b>$user->email</b></small> com as instruções para você confirmar sua conta.\");\n else\n flash('Não foi possível lhe enviar o e-mail. Por favor, tente novamente mais tarde.', 'error');\n\n go('/');\n } else {\n flash('Verifique os dados do formulário.', 'error');\n }\n }\n\n globals('user', $user);\n }", "public static function email_confirm_account() {\n\n if ($u = static::check_record_existence()) {\n\n $m = auth_model();\n $u = $m::first(array('where' => 'id = \\'' . $u->id . '\\''));\n\n # definindo conta como não confirmada.\n $u->hash_confirm_account = $u->hash_confirm_account ?: \\Security::random(32);\n\n if ($u->emailConfirmAccount())\n flash('Email com as instruções para Confirmação de conta para ' . $u->email . '.');\n else\n flash('Algo ocorreu errado. Tente novamente mais tarde.', 'error');\n }\n\n go_paginate();\n }", "public function confirmationEmail()\n {\n $email = new Email;\n $email->sendEmail('submitted', 'applicant', Auth::user()->email);\n }", "public function confirmEmail()\n {\n $this->mail_confirmed = Carbon::now();\n $this->mail_token = null;\n $this->save();\n }", "public function sendConfirmEmail()\n {\n\t\t$emailSettings = craft()->email->getSettings();\n\n //create the template params\n $templateParams = $this->data;\n $templateParams['toEmail'] = $this->toEmail;\n\n //instantiate email model\n $email = new EmailModel();\n\n //populate with all the things\n //for testing\n $email->fromEmail = $emailSettings['emailAddress'];\n\t\t$email->toEmail = $this->template->notifyEmailToAddress;\n\t\t$email->subject = $this->template->confirmEmailSubject;\n\t\t$email->body = $this->template->confirmEmailBody;\n\n //send that goodness\n\t\treturn craft()->email->sendEmail($email, $templateParams);\n\n }", "private function sendConfirmationEmail($email){\n $pdo = $this->pdo;\n $stmt = $pdo->prepare('SELECT confirm_code FROM users WHERE email = ? limit 1');\n $stmt->execute([$email]);\n $code = $stmt->fetch();\n\n $subject = 'Confirm your registration';\n $message = 'Please confirm you registration by pasting this code in the confirmation box: '.$code['confirm_code'];\n $headers = 'X-Mailer: PHP/' . phpversion();\n\n if(mail($email, $subject, $message, $headers)){\n return true;\n }else{\n return false;\n }\n }", "public function confirmEmail()\n {\n $this->email_confirmation_token = null;\n $this->is_email_verified = 1;\n return $this->save();\n }", "public function actionSendConfirmationEmail() {\n\n\t\t$userId = User::checkLogged();\n\t\t$confirmation = User::generateConfirmationCode($userId);\n\t\t$subject = \"Confirm your account on JustRegMe\";\n\t\t$bodyPath = ROOT . '/template/email/confirmation.php';\n\t\t$body = include($bodyPath); //loads HTML-body from template\n\t\t\n\t\techo User::sendEmail($userId, $subject, $body);\n\n\t}", "public function executeConfirmEmail($request)\r\n {\r\n \t$this->forward404Unless($request->isMethod('get'));\r\n \t\r\n \t$email = EmailPeer::getFromField(EmailPeer::CONFIRM_CODE,$this->getRequestParameter('confirm_code'));\r\n \tif($email)\r\n \t{\r\n \t\tif($email->getIsPrimary() && !$email->getActualEmail())\r\n \t\t{\r\n \t\t\t// if invited, send acceptance email and add to quick contact\r\n \t\t\t$user = $email->getUser();\r\n \t\t\tif($user->getInvitedBy())\r\n \t\t\t{\r\n \t\t\t\t// add to bookmark\r\n \t\t\t\t$b = new Bookmark();\r\n \t\t\t\t$b->setUser($user->getUserRelatedByInvitedBy());\r\n \t\t\t\t$b->setTag($user->retrievePrimaryJotag());\r\n \t\t\t\t$b->save();\r\n \t\t\t\t\r\n \t\t\t\t// give credit to the inviter\r\n \t\t\t\t$credits = $user->getUserRelatedByInvitedBy()->giveCredit(OptionPeer::retrieveOption('BONUS_ACCEPT_CREDIT'));\r\n\t\t \tMailer::sendEmail($user->getUserRelatedByInvitedBy()->getPrimaryEmail(),'inviteAccepted',array('owner'=>$user->getUserRelatedByInvitedBy(),'user'=>$user,'email'=>$email,'credits'=>$credits),$user->getUserRelatedByInvitedBy()->getPreferedLanguage());\r\n \t\t\t}\r\n \t\t\t// activate primary jotag\r\n \t\t\t$jotag = $email->getUser()->retrievePrimaryJotag();\r\n \t\t\t$jotag->setStatus(TagPeer::ST_ACTIVE);\r\n \t\t\t$jotag->save();\r\n \t\t\t\r\n \t\t\t$this->setMessage('ACCOUNT_CONFIRM','SUCCESS');\r\n \t\t}\r\n \t\telse $this->setMessage('EMAIL_CONFIRM','SUCCESS');\r\n \t\t \r\n \t\t$email->setIsConfirmed(true);\r\n \t\t$email->setConfirmCode(null);\r\n \t\t$email->setActualEmail(null);\r\n \t\t$email->save();\r\n \t}\r\n \telse $this->setMessage('EMAIL_CONFIRM_ERROR','ERROR');\r\n\r\n \t$this->redirect('@homepage');\r\n }", "public function resendConfirmationMailAction()\n {\n // @todo find a better way to fetch the data\n $result = GeneralUtility::_GP('tx_femanager_pi1');\n if (is_array($result)) {\n if (GeneralUtility::validEmail($result['user']['email'])) {\n $user = $this->userRepository->findFirstByEmail($result['user']['email']);\n if (is_a($user, User::class)) {\n $this->sendCreateUserConfirmationMail($user);\n $this->addFlashMessage(\n LocalizationUtility::translate('resendConfirmationMailSend'),\n '',\n AbstractMessage::INFO\n );\n $this->redirect('resendConfirmationDialogue');\n }\n }\n }\n $this->addFlashMessage(\n LocalizationUtility::translate('resendConfirmationMailFail'),\n LocalizationUtility::translate('validationError'),\n AbstractMessage::ERROR\n );\n $this->redirect('resendConfirmationDialogue');\n }", "public function confirmAction() {\n if (Zend_Auth::getInstance()->hasIdentity())\n $this->_redirect($this->getUrl());\n\n $errors = array();\n\n $action = $this->getRequest()->getParam('a');\n\n switch ($action) {\n case 'email':\n $id = $this->getRequest()->getParam('id');\n $key = $this->getRequest()->getParam('key');\n\n $result = $this->em->getRepository('Champs\\Entity\\User')->activateAccount($id, $key);\n\n if (!$result) {\n $errors['email'] = 'Error activating your account';\n }\n\n break;\n }\n\n $this->view->errors = $errors;\n $this->view->action = $action;\n }", "public function emailShouldBeSentToWithConfirmationCode($email)\n {\n $inbox = $this->fetchInbox();\n PHPUnit::assertCount(1, $inbox);\n\n $message = $inbox[0];\n PHPUnit::assertEquals($email, $message['to_email']);\n\n $user = User::whereEmail($email)->firstOrFail();\n PHPUnit::assertContains($user->getConfirmationCode(), $message['html_body']);\n\n // clear the inbox after we're done.\n $this->emptyInbox();\n }", "public function sendEmailVerificationNotification()\n { \n \n $this->notify(new ConfirmEmail); \n \n }", "public function sendConfirmation( ){\n\t\t$data = Request::only(['email']);\n\t\t$email = $data['email'];\n\t\t$token = str_random(30);\n\t\t$domain = substr(strrchr($email, \"@\"), 1);\n\n\t\tif( in_array( $domain, explode( ',', env('ACCEPTABLE_EMAIL_DOMAINS') ) ) ){\n\t\t\ttry {\n\t\t\t\t// Check if student exists already\n\t\t\t\tUser::where('email', $email)->firstOrFail();\n\n\t\t\t} catch (ModelNotFoundException $e) {\n\t\t\t\t// Send email verification if they are\n\t\t\t\tMail::send('emails.verification_code', ['email' => $email, 'confirmation_code' => $token], function ($m) use($email) {\n\t\t $m->from('admin@'.env('USER_DOMAIN'), env('SITE_TITLE') );\n\n\t\t $m->to($email)->subject('Verify Your Email For '.env('SITE_TITLE'));\n\t\t });\n\n\t\t VerificationCode::create([\n\t\t \t'email' => $email,\n\t\t \t'confirmation_code' => $token\n\t\t ]);\n\n\t\t return View::make('emails.thank_you');\n\t\t\t}\n\t\t} else{\n\t\t\treturn Redirect::back()->withErrors(['That email is not on our approved list of student emails']);\n\t\t}\n\t}", "public function action_confirm()\n {\n $hash = $this->request->param('hash');\n\n $model_auth = new Model_Auth();\n\n $id = $model_auth->getUserIdByHash($hash, Model_Auth::TYPE_EMAIL_CONFIRM);\n\n if (!$id) {\n $error_text = 'Ваш аккаунт уже подтвержден';\n $this->template->content = View::factory('templates/error', ['error_text' => $error_text]);\n\n return;\n }\n\n $model_auth->deleteHash($hash, Model_Auth::TYPE_EMAIL_CONFIRM);\n\n $user = new Model_User($id);\n\n if (!$user->id) {\n $error_text = 'Переданы некорректные данные';\n $this->template->content = View::factory('templates/error', ['error_text' => $error_text]);\n\n return;\n }\n\n $user->updateUser($user->id, ['isConfirmed' => 1]);\n\n $this->redirect('/user/' . $id . '?confirmed=1');\n }", "function confirm_email() {\n \n\n $confirm_url = $this->traffic_model->GetAbsoluteURLFolder().'/confirm_register/' . $this->traffic_model->MakeConfirmationMd5();\n \n\n $this->email->from('[email protected]');\n\n $this->email->to($this->input->post('email'));\n $this->email->set_mailtype(\"html\");\n $this->email->subject('Confirm registration');\n $message = \"Hello \" . $this->input->post('username'). \"<br/>\" .\n \"Thanks for your registration with www.satrafficupdates.co.za <br/>\" .\n \"Please click the link below to confirm your registration.<br/>\" .\n \"$confirm_url<br/>\" .\n \"<br/>\" .\n \"Regards,<br/>\" .\n \"Webmaster <br/>\n www.satrafficupdates.co.za\n \";\n $this->email->message($message);\n if ($this->email->send()) {\n echo 'Message was sent';\n //return TRUE;\n } else {\n echo $this->email->print_debugger();\n //return FALSE;\n }\n\n\n\n\n }", "public function confirmEmail($email = null) {\n\t\tif ((isset($this->data[$this->alias]['email']) && isset($email['confirm_email']))\n\t\t\t&& !empty($email['confirm_email'])\n\t\t\t&& (strtolower($this->data[$this->alias]['email']) === strtolower($email['confirm_email']))) {\n\t\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function emailconfirmation(){\n\t\t\trequire( dirname(__FILE__) . '/email-confirmation.php' );\n\t\t}", "private function sendConfirmationMail() {\n\t\t\t\t$subject = 'Confirmation Mail';\n\t\t\t\t$from = '[email protected]';\n\t\t\t\t$replyTo = '[email protected]';\n\t\t\t\t\n\t\t\t\t//include some fancy stuff here, token is md5 of email\n\t\t\t\t$message = \"<a href='http://www.momeen.com/eCommerce/register/confirmUser.php?token=$this->token'> Confirm</a>\";\n\n\t\t\t\t$headers = \"From: \".\"$from\".\"\\r\\n\";\n\t\t\t\t$headers .= \"Reply-To: \".\"$replyTo\".\"\\r\\n\";\n\t\t\t\t$headers .= \"MIME-Version:1.0\\r\\n\";\n\t\t\t\t$headers .= \"Content-Type:text/html; charset=ISO-8859-1\\r\\n\";\n\t\t\t\tif(!mail($this->email, $subject, $message, $headers)) {\n\t\t\t\t\t$this->response['status'] = 0;\n\t\t\t\t\t$this->response['message'] = 'Confirmation mail did not sent. Contact admin';\n\t\t\t\t}\n\t\t\t}", "function verifica_email ($email)\r\n{\r\n\t$retorno = true;\r\n\r\n\t/* Aqui estaria el codigo para verificar \r\n\tla direccion de correo */\r\n\r\n\treturn $retorno;\r\n}", "public function confirm_mail_test($confirm_email, $email) {\r\n\r\n $errors = 0;\r\n $error_msg = \"\";\r\n\r\n $confirm_email = trim($confirm_email);\r\n\r\n if($confirm_email != $email) {\r\n $errors++;\r\n $error_msg .= \"Vos adresses mail ne correspondent pas. <br />\";\r\n }\r\n\r\n return array(\r\n \"value\" => $confirm_email,\r\n \"error_msg\" => $error_msg,\r\n \"errors\" => $errors\r\n );\r\n }", "public function actionAccept($confirmation) {\n\n\t\tUser::confirmEmail($confirmation);\n\t}", "protected function confirmEmailToken( $code ) {\n\t\tglobal $wgConfirmAccountContact, $wgPasswordSender;\n\n\t\t$reqUser = $this->getUser();\n\t\t$out = $this->getOutput();\n\t\t# Confirm if this token is in the pending requests\n\t\t$name = ConfirmAccount::requestNameFromEmailToken( $code );\n\t\tif ( $name !== false ) {\n\t\t\t# Send confirmation email to prospective user\n\t\t\tConfirmAccount::confirmEmail( $name );\n\n\t\t\t$adminsNotify = ConfirmAccount::getAdminsToNotify();\n\t\t\t# Send an email to admin after email has been confirmed\n\t\t\tif ( $adminsNotify->count() || $wgConfirmAccountContact != '' ) {\n\t\t\t\t$title = SpecialPage::getTitleFor( 'ConfirmAccounts' );\n\t\t\t\t$subject = $this->msg(\n\t\t\t\t\t'requestaccount-email-subj-admin' )->inContentLanguage()->escaped();\n\t\t\t\t$body = $this->msg(\n\t\t\t\t\t'requestaccount-email-body-admin', $name )->params(\n\t\t\t\t\t\t$title->getCanonicalURL() )->inContentLanguage()->text();\n\t\t\t\t# Actually send the email...\n\t\t\t\tif ( $wgConfirmAccountContact != '' ) {\n\t\t\t\t\t$source = new MailAddress( $wgPasswordSender, wfMessage( 'emailsender' )->text() );\n\t\t\t\t\t$target = new MailAddress( $wgConfirmAccountContact );\n\t\t\t\t\t$result = UserMailer::send( $target, $source, $subject, $body );\n\t\t\t\t\tif ( !$result->isOK() ) {\n\t\t\t\t\t\twfDebug( \"Could not sent email to admin at $target\\n\" );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t# Send an email to all users with \"confirmaccount-notify\" rights\n\t\t\t\tforeach ( $adminsNotify as $adminNotify ) {\n\t\t\t\t\tif ( $adminNotify->canReceiveEmail() ) {\n\t\t\t\t\t\t$adminNotify->sendMail( $subject, $body );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$out->addWikiMsg( 'requestaccount-econf' );\n\t\t\t$out->returnToMain();\n\t\t} else {\n\t\t\t# Maybe the user confirmed after account was created...\n\t\t\t$user = User::newFromConfirmationCode( $code, User::READ_LATEST );\n\t\t\tif ( is_object( $user ) ) {\n\t\t\t\t$user->confirmEmail();\n\t\t\t\t$user->saveSettings();\n\t\t\t\t$message = $reqUser->isLoggedIn()\n\t\t\t\t\t? 'confirmemail_loggedin'\n\t\t\t\t\t: 'confirmemail_success';\n\t\t\t\t$out->addWikiMsg( $message );\n\t\t\t\tif ( !$reqUser->isLoggedIn() ) {\n\t\t\t\t\t$title = SpecialPage::getTitleFor( 'Userlogin' );\n\t\t\t\t\t$out->returnToMain( true, $title );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$out->addWikiMsg( 'confirmemail_invalid' );\n\t\t\t}\n\t\t}\n\t}", "public function confirmEmail($token){\n $user = User::find(Auth::user() -> id);\n if($user->payment_status == 0){\n return redirect()->route('register.payment');\n }else if($user->payment_status == 1){\n return redirect()->route('payment.verify');\n }else{\n $data = User::where('remember_token', $token) -> get() -> first();\n if($data->mail_activation_status === 'pending'){\n $data->mail_activation_status = 'active';\n $data->email_verified_at = Carbon::now();\n $data->update();\n return view('active', [\n 'status' => 'success'\n ]);\n }else{\n return view('active', [\n 'status' => 'error'\n ]);\n }\n }\n\n }", "public function confirm($email = '', $code = '') {\r\n\r\n $this->load->model('auth_model');\r\n\r\n $res = $this->auth_model->confirm_email($email, $code);\r\n\r\n if ($res == TRUE) {\r\n\r\n $this->session->set_flashdata('msg', '<div class=\"alert alert-success\">' . lang_key('email_confirmed') . '</div>');\r\n\r\n redirect(site_url('admin/auth'));\r\n } else {\r\n\r\n $this->session->set_flashdata('msg', '<div class=\"alert alert-danger\">' . lang_key('email_confirmed_failed') . '</div>');\r\n\r\n redirect(site_url('admin/auth'));\r\n }\r\n }", "private function _sendConfirmationEmail($email_to, $name_to, $confirmation_code){\n\t\t$mailer = new Bel_Mailer();\n\t\t$mailer->addTo ( $email_to );\n\t\t$mailer->setSubject('Reactivate your account');\n\t\t$this->view->assign('code',$confirmation_code);\n\t\t$this->view->assign('name',$name_to);\n\t\t$mailer->setBodyHtml ( $this->view->fetch('usermanagement/profile/confirmation_email.tpl') );\n\t\t$mailer->send ();\n\t}", "public function emailConfirmationAction($email, $token){\n $userManager = new UserManager();\n $user = $userManager->findByEmail($email);\n if ($user){\n if ($user->getToken() === $token){\n $user->setEmailValidated(true);\n //change the token \n $user->setToken( SH::randomString() );\n $userManager->update($user);\n }\n }\n Router::redirect( Router::url(\"graph\") );\n }", "private function sendActivationEmail($data) {\n\t$template_name = 'signup-confirmation';\n\t$template_content = array();\n\t$message = array(\n\t\t'subject' => 'Welcome! Please confirm your email address.',\n\t\t'from_email' => '[email protected]',\n\t\t'from_name' => 'Chefmes',\n\t\t'to' => array(\n\t\t\tarray(\n\t\t\t\t'email' => $data['email'],\n\t\t\t\t'name' => $data['fullname']\n\t\t\t)\n\t\t),\n\t\t'merge_language' => 'mailchimp',\n\t\t'merge_vars' => array(\n\t\t\tarray(\n\t\t\t\t'rcpt' => $data['email'],\n\t\t\t\t'vars' => array(\n\t\t\t\t\t[ 'name' => 'email', 'content' => $data['email']],\n\t\t\t\t\t[ 'name' => 'firstname', 'content' => $data['firstname']],\n\t\t\t\t\t[ 'name' => 'confirmlink', 'content' => $data['confirmlink']]\n\t\t\t\t)\n\t\t\t)\n\t\t)\n\t);\n\t\\Email::messages()->sendTemplate($template_name, $template_content, $message);\n\t//print_r($result);\n }", "function webform_confirm_email_email_delete($form, &$form_state) {\n\n $eid = $form_state['triggering_element']['#eid'];\n\n if ($form_state['triggering_element']['#email_type_form'] == 'confirmation_request') {\n if (_webform_confirm_email_verify_email_setup( $form['#node']->nid, 'delete_confirmation_request_email', $eid) == FALSE) {\n drupal_set_message(t('Deleting the only confirmation request email but still having some confirmation email(s) leads to unwanted behavior. Please delete all confirmation email(s) first.'), 'error');\n form_error($form['confirmation_request'][$eid]);\n\n return FALSE;\n }\n }\n\n $form_state['redirect'] = array(\n 'node/' . $form['#node']->nid . '/webform/' . $form_state['triggering_element']['#email_type_form'] . '/' . $eid . '/delete',\n );\n}", "public function sendEmailVerificationNotification();", "public function send_confirm_mail($userDetails = '') {\n //Send email to user\n }", "function sendEmailConfirmation($db, $email, $first_name) {\n\n\t# generate a unique confirmation code\n $confirmation_code = md5(uniqid(rand()));\n\n\t$db->bindMore(array(\"email\" => $email, \"confirmation_code\" => $confirmation_code));\n\t$insert = $db->query(\"INSERT INTO mtc_email_confirm (email, confirmation_code) VALUES (:email, :confirmation_code)\");\n\n\tif ($insert > 0) {\n\n\t\trequire \"../private/Email.class.php\";\n\n\t\t# send welcome email\n\t\t$welcomeEmail = new email();\n\t\treturn $welcomeEmail->sendWelcomeEmail($first_name, $email, $confirmation_code);\n\n\t}\n\n\treturn false;\n\n}", "public function getConfirm($token)\n\t{\n\t\tUser::whereToken($token)->firstOrFail()->confirmEmail();\n\n\t\t\\Session::flash('success.message', \"Thank You. Your email is confirmed.\");\n\n\t\treturn redirect('user/settings');\n\t}", "public function isConfirmEmail(){\n \tif(empty($this->data['User']['confirm_email'])){\n \t\treturn false;\n \t}\n \tif(!empty($this->data['User']['confirm_email']) && !empty($this->data['User']['email'])){\n \t\tif(trim($this->data['User']['confirm_email']) == trim($this->data['User']['email'])){\n \t\t\treturn true;\n \t\t}else{\n \t\t\treturn false;\n \t\t}\n \t}\n }", "public function post_confirm() {\n $fields = array(\n 'code' => Input::get('code'),\n 'email' => Input::get('email'),\n 'confirmation_code' => Input::get('confirmation_code'),\n );\n\n $account = Account::where_code(Input::get('code', 0))->first();\n $account_id = 0;\n if(!is_null($account)) {\n $account_id = $account->id;\n }\n \n $rules = array(\n 'code' => 'required|exists:accounts',\n 'email' => 'required|email|exists_in_account:users,email,'.$account_id,\n 'confirmation_code' => 'required',\n );\n \n $validation = Validator::make($fields, $rules);\n \n if( $validation->fails() ) {\n Input::flash();\n return Redirect::to_action('login@confirm')->with_errors($validation);\n } else {\n $user = User::where('account_id', '=', $account_id)\n ->where('email', '=', Input::get('email'))\n ->where('confirmation_code', '=', Input::get('confirmation_code'))\n ->first();\n \n if(is_null($user)) {\n Input::flash();\n return $this->get_confirm()->with('confirm_error', true);\n } else {\n return $this->get_confirm($user->id, $user->confirmation_code);\n }\n }\n }", "private function verificarEmail(){\n\t \n\t \t\t//Verifica se a requisição é via AJAX\n\t \t\tif(HelperFactory::getInstance()->isAjax()){\n\t \t\t\n\t \t\t\t //Solicita a verificação do E-mail\n\t\t\t\t $this->Delegator('ConcreteCadastro', 'verificarEmail',$this->getPost());\t \t\t\t \n\t \t\t}\t \n\t }", "public function askEmail()\n {\n $this->ask('What is your email?', function (Answer $answer) {\n $this->user->email = $answer->getText();\n\n $user = User::where('email', $this->user->email)->first();\n\n if (isset($user)) {\n $this->repeat('Sorry this email is already in use. Please enter a valid email.');\n } else {\n $this->askPassword();\n }\n });\n }", "public function emailConfirmation() {\n try {\n return $this->getEmailVerificationUtils()->verifyConfirmationRequest();\n } catch (\\Illuminate\\Database\\QueryException $ex) {\n return $this->getExceptionUtils()->storeException($ex);\n } catch (\\Exception $ex) {\n return $this->getExceptionUtils()->storeException($ex);\n }\n }", "public function confirmEmail($email_token)\n {\n \n $user = User::where('email_token', $email_token)->first();\n\n if ( ! $user ) { \n \t\n \tsession()->flash('message', \"The user doesn't exist or has been already confirmed. Please login\"); \n \t\n \n } else { // saves the user as verified\n\n\t $user->verified = 1;\n\t $user->email_token = null;\n\t $user->save();\n\n\t //flash a message to the session\n\t\t\tsession()->flash('message', 'You have successfully verified your account. Please login');\n \t}\n\n \treturn redirect('login');\n\n }", "public function EmailConfirm($code, $id){\n\t\t$restaurantGroup= Sentry::findGroupById(6);\n\t\t$activeUser\t\t= Sentry::findUserById($id);\n\n\t\t// $now\t\t\t= time();\n\t\t// need to create time limition\n\t\tif($activeUser->attemptActivation($code)){\n\t\t\t//activation is success\n\t\t\tLog::info('active the user : '.$id);\n\t\t\tif($activeUser->addGroup($restaurantGroup)){\n\t\t\t\tLog::info('add the user into the restaurant id : '.$id);\n\t\t\t\t$user = Sentry::login($activeUser, false);\n\t\t\t\tLog::info('success to login to the Food Order');\n\t\t\t\treturn Redirect::route('r.description.create');\n\t\t\t}else{\n\t\t\t\tLog::info('fail to add the user into the restaurant');\n\t\t\t}\n\t\t}else{\n\t\t\t//activation is fail\n\t\t\tLog::info('fail to active the user : '.$id);\n\t\t\treturn Response::view('fail to active the user', array(), 404);\n\t\t}\n\t}", "function webform_confirm_email_confirmation_email_add($form, &$form_state) {\n\n if (_webform_confirm_email_verify_email_setup($form['#node']->nid) == FALSE) {\n drupal_set_message(t('Adding a confirmation email without having at least one confirmation request email leads to unwanted behavior. Please create a confirmation request email first.'), 'error');\n\n return FALSE;\n }\n\n $form_state['redirect'] = array(\n 'node/' . $form['#node']->nid . '/webform/confirmation/new',\n );\n}", "public function confirmMail($emailadd, $confirmationCode)\n {\n $message = \\Swift_Message::newInstance()\n ->setSubject('Welcome to CloudPod - A Virtual Learning Environment')\n ->setFrom('[email protected]')\n ->setTo($emailadd)\n ->setBody('Click on this link to activate your account <strong>http://localhost/CloudPod/web/app_dev.php/confirmation/'.$confirmationCode.'</strong>', 'text/html');;\n //->addPart('Click on this link to activate your account http://localhost/CloudPod/web/app_dev.php/confirmation/'.$confirmationCode,'text/plain');;\n $this->get('mailer')->send($message);\n\n return new Response('Congratulations! Pls. confirm your email. And start using CLOUDPOD!');\n }", "public function verificarClienteEmail(ICliente $cliente);", "public function contactConfirm()\n {\n return view('contact.contactConfirm');\n }", "function verifyEmail($action = ''){\n\t\t//$url = ROOT_URI_UI.'validUser.php?k='.$this->secretKey($this->username).'&e='.$this->username;\n\n\t\t$url = $_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'].'?k='.$this->secretKey($this->username).'&e='.$this->username;\n\t\t\n\t\tif('recover' == $action){\n\t\t\t$msg = DICO_WORD_PASSWORD_RESTORE;\n\t\t}else{\n\t\t\t$msg = DICO_WORD_CONFIRM_EMAIL;\n\t\t}\n\t\t\n\t\t$body_message = DICO_MAIL_VALID_HEAD.'<br>'\n\t\t\t\t\t\t.'<a href=\"'.$url.'\">'.$msg.'</a><br><br>'\n\t\t\t\t\t\t.$url.'<br>'\n\t\t\t\t\t\t.DICO_MAIL_VALID_FOOT;\n\n\t\t\n\t\treturn send_mail(ROOT_EMAIL, $this->username, '', ROOT_EMAIL_NAME.' '.DICO_WORD_AUTH,$body_message);\n\t}", "function ConfirmUser(){\r\n if(empty($_GET['code'])||strlen($_GET['code'])<=10){\r\n $this->HandleError(\"Please provide the confirm code\");\r\n return false;\r\n }\r\n $user_rec = array();\r\n if(!$this->UpdateDBRecForConfirmation($user_rec)){\r\n return false;\r\n }\r\n \r\n $this->SendUserWelcomeEmail($user_rec);\r\n \r\n $this->SendAdminIntimationOnRegComplete($user_rec);\r\n \r\n return true;\r\n }", "function activate_account_via_email_link() {\r\n\t\t\tif ( isset($_REQUEST['act']) && $_REQUEST['act'] == 'activate_via_email' && isset($_REQUEST['hash']) && is_string($_REQUEST['hash']) && strlen($_REQUEST['hash']) == 40 &&\r\n\t\t\t isset($_REQUEST['user_id']) && is_numeric($_REQUEST['user_id']) ) { // valid token\r\n\r\n\t\t\t\t$user_id = absint( $_REQUEST['user_id'] );\r\n\t\t\t\tdelete_option( \"um_cache_userdata_{$user_id}\" );\r\n\r\n\t\t\t\tum_fetch_user( $user_id );\r\n\r\n\t\t\t\tif ( strtolower($_REQUEST['hash']) !== strtolower( um_user('account_secret_hash') ) )\r\n\t\t\t\t\twp_die( __( 'This activation link is expired or have already been used.','ultimate-member' ) );\r\n\r\n\t\t\t\tUM()->user()->approve();\r\n\t\t\t\t$redirect = ( um_user('url_email_activate') ) ? um_user('url_email_activate') : um_get_core_page('login', 'account_active');\r\n\t\t\t\t$login = (bool) um_user('login_email_activate');\r\n\r\n\t\t\t\t// log in automatically\r\n\t\t\t\tif ( ! is_user_logged_in() && $login ) {\r\n\t\t\t\t\t$user = get_userdata($user_id);\r\n\t\t\t\t\t$user_id = $user->ID;\r\n\r\n\t\t\t\t\t// update wp user\r\n\t\t\t\t\twp_set_current_user( $user_id, $user->user_login );\r\n\t\t\t\t\twp_set_auth_cookie( $user_id );\r\n\r\n\t\t\t\t\tob_start();\r\n\t\t\t\t\tdo_action( 'wp_login', $user->user_login, $user );\r\n\t\t\t\t\tob_end_clean();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tum_reset_user();\r\n\t\t\t\t/**\r\n\t\t\t\t * UM hook\r\n\t\t\t\t *\r\n\t\t\t\t * @type action\r\n\t\t\t\t * @title um_after_email_confirmation\r\n\t\t\t\t * @description Action on user activation\r\n\t\t\t\t * @input_vars\r\n\t\t\t\t * [{\"var\":\"$user_id\",\"type\":\"int\",\"desc\":\"User ID\"}]\r\n\t\t\t\t * @change_log\r\n\t\t\t\t * [\"Since: 2.0\"]\r\n\t\t\t\t * @usage add_action( 'um_after_email_confirmation', 'function_name', 10, 1 );\r\n\t\t\t\t * @example\r\n\t\t\t\t * <?php\r\n\t\t\t\t * add_action( 'um_after_email_confirmation', 'my_after_email_confirmation', 10, 1 );\r\n\t\t\t\t * function my_after_email_confirmation( $user_id ) {\r\n\t\t\t\t * // your code here\r\n\t\t\t\t * }\r\n\t\t\t\t * ?>\r\n\t\t\t\t */\r\n\t\t\t\tdo_action( 'um_after_email_confirmation', $user_id );\r\n\r\n\t\t\t\texit( wp_redirect( $redirect ) );\r\n\r\n\t\t\t}\r\n\r\n\t\t}", "function _webform_confirm_email_edit_confirmation_request_email_submit($form, &$form_state) {\n if ( isset($form_state['values']['eid']) == TRUE\n && isset($form['#node']->nid) == TRUE) {\n $obj['nid'] = $form['#node']->nid;\n $obj['email_type'] = WEBFORM_CONFIRM_EMAIL_CONFIRMATION_REQUEST;\n $obj['redirect_url'] = ($form_state['values']['redirect_url_option'] === 'custom') ? $form_state['values']['redirect_url_custom'] : NULL;\n\n if (empty($form['eid']['#value']) == TRUE) {\n //-> new email\n $obj['eid'] = $form_state['values']['eid'];\n drupal_write_record(\n 'webform_confirm_email',\n $obj\n );\n }\n else {\n $obj['eid'] = $form['eid']['#value'];\n drupal_write_record(\n 'webform_confirm_email',\n $obj,\n array('nid', 'eid')\n );\n }\n }\n}", "public function confirmChangeEmailLink(Request $request)\n\t{\n\t\t$class = instantiateAuthClass(request()->type);\n\n\t\t$request->validate(['email'=>['bail', 'required', 'email:rfc', Rule::unique($class->getTable())]]);\n\n\t\trequest()->user(request()->type)->email = $request->email;\n\n\t\trequest()->user(request()->type)->save();\n\n\t\t$message = \"Email address has been changed successfully.\";\n\n\t\treturn $request->wantsJson()\n ? request()->json($message, 202)\n : redirect(config('imela.home'))->with('status', $message);\n\t}", "public function verifyAction()\n {\n $email = Request::post('email', Filter::FILTER_EMAIL, false);\n\n if (!$email || !Validator_Email::validate($email)) {\n Response::jsonError($this->moduleLang->get('email_invalid'));\n }\n\n $model = Model::factory('User');\n\n $userIds = $model->getList(\n ['limit' => 1],\n [\n 'email' => $email,\n 'enabled'=> true\n ],\n ['id']\n );\n\n if (count($userIds) == 0) {\n Response::jsonError($this->moduleLang->get('email_user_unknown'));\n }\n\n $userId = $userIds[0]['id'];\n\n $user = Db_Object::factory('User', $userId);\n $authCode = Utils::hash(uniqid(time(),true));\n\n $confDate = new DateTime('now');\n $confDate = $confDate->add(new DateInterval('P1D'))->format('Y-m-d H:i:s');\n\n try{\n $user->setValues(array(\n 'confirmation_code' => $authCode,\n 'confirmation_expiried' => $confDate\n ));\n if(!$user->save())\n throw new Exception('Cannot update user info');\n }catch (Exception $e){\n Response::jsonError($this->_lang->get('CANT_EXEC'));\n }\n\n $this->sendEmail($user);\n\n Response::jsonSuccess(array(\n 'msg' => $this->moduleLang->get('pwd_success')\n ));\n }", "public function checkoutConfirmContact(Twig $twig): string\n {\n $mode = $this->request->get('type');\n $paymentId = $this->request->get('paymentId');\n return $twig->render('AfterPay::Contact', [\n 'data' => $this->sessionStorage->getSessionValue(SessionStorageService::AfterPay_RESPONSE),\n 'mode' => $mode,\n 'paymentId' => $paymentId\n ]);\n\n }", "protected static function getFacadeAccessor() { return 'email-confirmation'; }", "static function confirm_email($email, $key) {\n // update data base to email_confirmed = 1 if the key is correct\n \n global $con;\n $sql = \"SELECT COUNT(`id`) AS 'count' FROM `user` WHERE `email` = '\".$email.\"' AND `hash` = '\".$key.\"';\";\n $query = mysqli_query($con, $sql);\n $count = mysqli_fetch_object($query)->count;\n if ($count == 1) { // the given key exists\n $sql = \"UPDATE `user` SET `email_confirmed` = 1 WHERE `id` = \".self::email2id($email).\";\";\n $query = mysqli_query($con, $sql);\n return TRUE;\n }\n return FALSE;\n }", "function activate($correo){\n $campos = array('activa' => 1);\n \n return $this->db->updateParameters(self::TABLA, $campos, array('email' => $correo));\n }", "function upd_userconfirm($DBcon, $mail, $guid)\n {\n //create guid for user confirm\n require_once(C_P_CLASES.'utils/string.functions.php');\n $STR = new STRFN();\n\n $query = \"UPDATE \".$this->tableName.\" SET \".$this->arrDataNames['data4'].\" = '1' \n WHERE \".$this->arrDataNames['data1'].\" = '\".$mail.\"' \n AND \".$this->arrDataNames['data7'].\" = '\".$guid.\"'\n\t\t\t\t\t\";\n\n $stmt = $DBcon->prepare($query);\n $stmt->execute();\n\n // check for successfull registration\n if ( $stmt->execute() ) {\n $response['status'] = 'success';\n $response['message'] = $STR->setMsgStyle('&nbsp; Registro exitoso, Gracias! favor de iniciar sesion:');\n } else {\n $response['status'] = 'error'; // could not register\n $response['message'] = $STR->setMsgStyle('&nbsp; No se pudo registrar, favor de registrarse: <br/>http://www.jadecapitalflow.com/', 3);\n }\n\n return $response;\n }", "public function getConfirmUrl() {\n\t\treturn $this->getEmailActionLink('email/emailConfirm');\n\t}", "function webform_confirm_email_form_webform_emails_form_alter(&$form, &$form_state) {\n // ******** standard emails ********\n $eids = db_query(\n 'SELECT we.eid '.\n ' FROM {webform_emails} we ' .\n ' LEFT JOIN {webform_confirm_email} wce ' .\n ' ON we.nid = wce.nid ' .\n ' AND we.eid = wce.eid ' .\n ' WHERE we.nid = :nid ' .\n ' AND wce.eid IS NULL ' ,\n array(\n ':nid' => (int) $form['#node']->nid,\n )\n )->fetchCol();\n\n foreach($eids as $eid) {\n $form['emails'][$eid]['delete_button'] = array(\n '#type' => 'submit',\n '#name' => 'delete_emails_' . $eid,\n '#value' => t('Delete'),\n '#email_type_form' => 'emails',\n '#eid' => $eid,\n '#submit' => array('webform_confirm_email_email_delete'),\n );\n }\n unset($form['add']);\n $form['emails']['add_button'] = array(\n '#type' => 'submit',\n '#value' => t('Add standard email'),\n '#submit' => array('webform_emails_form_submit'),\n '#weight' => 45,\n );\n\n array_unshift($form['#validate'], 'webform_confirm_email_webform_emails_form_validate');\n\n // ******** confirmation request emails ********\n $query = db_query(\n 'SELECT eid, redirect_url '.\n ' FROM {webform_confirm_email} ' .\n ' WHERE nid = :nid ' .\n ' AND email_type = :type' ,\n array(\n ':nid' => (int) $form['#node']->nid,\n ':type' => WEBFORM_CONFIRM_EMAIL_CONFIRMATION_REQUEST,\n )\n )->fetchAllKeyed();\n\n $form['confirmation_request'] = array();\n foreach ($query as $eid => $redirect_url) {\n $form['confirmation_request'][$eid]['status'] = $form['emails'][$eid]['status'];\n $form['confirmation_request'][$eid]['email'] = $form['emails'][$eid]['email'];\n $form['confirmation_request'][$eid]['subject'] = $form['emails'][$eid]['subject'];\n $form['confirmation_request'][$eid]['from'] = $form['emails'][$eid]['from'];\n $form['confirmation_request'][$eid]['redirect_url'] = array('#markup' => ($redirect_url == NULL) ? 'default' : $redirect_url);\n\n $form['confirmation_request'][$eid]['delete_button'] = array(\n '#type' => 'submit',\n '#name' => 'delete_confirmation_request_' . $eid,\n '#value' => t('Delete'),\n '#email_type_form' => 'confirmation_request',\n '#eid' => $eid,\n '#submit' => array('webform_confirm_email_email_delete'),\n );\n\n unset($form['emails'][$eid]);\n }\n\n $form['confirmation_request']['add_button'] = array(\n '#type' => 'submit',\n '#value' => t('Add confirmation request mail'),\n '#submit' => array('webform_confirm_email_confirmation_request_email_add'),\n '#weight' => 45,\n );\n\n // ******** confirmation emails ********\n $eids = db_query(\n 'SELECT eid '.\n ' FROM {webform_confirm_email} ' .\n ' WHERE nid = :nid ' .\n ' AND email_type = :type ' ,\n array(\n ':nid' => (int) $form['#node']->nid,\n ':type' => WEBFORM_CONFIRM_EMAIL_CONFIRMATION,\n )\n )->fetchCol();\n\n $form['confirmation'] = array();\n\n foreach ($eids as $eid) {\n $form['confirmation'][$eid]['status'] = $form['emails'][$eid]['status'];\n $form['confirmation'][$eid]['email'] = $form['emails'][$eid]['email'];\n $form['confirmation'][$eid]['subject'] = $form['emails'][$eid]['subject'];\n $form['confirmation'][$eid]['from'] = $form['emails'][$eid]['from'];\n\n $form['confirmation'][$eid]['delete_button'] = array(\n '#type' => 'submit',\n '#name' => 'delete_confirmation_' . $eid,\n '#value' => t('Delete'),\n '#email_type_form' => 'confirmation',\n '#eid' => $eid,\n '#submit' => array('webform_confirm_email_email_delete'),\n );\n\n unset($form['emails'][$eid]);\n }\n\n $form['confirmation']['add_button'] = array(\n '#type' => 'submit',\n '#value' => t('Add confirmation mail'),\n '#submit' => array('webform_confirm_email_confirmation_email_add'),\n '#weight' => 45,\n );\n}", "public function checkemailconfirmed($email)\n {\n $this->db->query('SELECT * FROM user WHERE email = :email');\n $this->db->bind(':email', $email);\n $row = $this->db->single();\n $chek = $row->confirmed;\n if($chek == 1)\n {\n return true;\n }else{\n return false;\n }\n }", "public function sendConfirm()\n {\n $newPackage = \"\";\n $client = $this->clientEntity;\n $client->writeByte($newPackage, ClientEntity::HEAD_MAIL_SENT);\n $client->writeByte($newPackage, 1);\n $client->writeLong($newPackage, $this->messageEntity->time);\n $client->addPackageToBuffer($newPackage);\n $client->sendToClient();\n $client->addPackageToBuffer($newPackage);\n $client->sendToClient();\n }", "public function sendConfirmationEmail($user, $user_email = false)\n {\n // $email = $this->Cu->sendResetEmail($url, $user_email->toArray());\n return true;\n }", "function webform_confirm_email_confirmation_email_edit($node, $email = array()) {\n\n $form_state = array(\n 'build_info' => array(\n 'args' => array(\n $node,\n $email,\n ),\n ),\n 'submit_handlers' => array(\n 'webform_email_edit_form_submit',\n '_webform_confirm_email_edit_confirmation_email_submit',\n ),\n );\n $form = drupal_build_form(\n 'webform_email_edit_form',\n $form_state\n );\n\n $form['#theme'] = array('webform_email_edit_form');\n\n return $form;\n}", "function theme_webform_confirm_email_emails_form($variables) {\n $form = &$variables['form'];\n $node = &$form['#node'];\n $header = array(\n t('Send'),\n t('E-mail to'),\n t('Subject'),\n t('From'),\n array(\n 'data' => t('Operations'),\n 'colspan' => 2\n )\n );\n $header_confirmation_request = array(\n t('Send'),\n t('E-mail to'),\n t('Subject'),\n t('From'),\n t('Redirect URL'),\n array(\n 'data' => t('Operations'),\n 'colspan' => 2\n )\n );\n\n $output = '';\n $email_types = array(\n 'emails' => t('Emails (sent immediately after submission)'),\n 'confirmation_request' => t('Emails requesting confirmation (sent immediately after submission)'),\n 'confirmation' => t('Confirmation emails (sent after the first click on a confirmation link)'),\n );\n foreach ($email_types as $email_type => $title) {\n $rows = array();\n\n $eids = element_children($form[$email_type]);\n if (array_search('add_button', $eids) !== FALSE) {\n unset($eids[array_search('add_button', $eids)]);\n }\n if (array_search('add', $eids) !== FALSE) {\n unset($eids[array_search('add', $eids)]);\n }\n\n if (count($eids) > 0) {\n foreach ($eids as $eid) {\n // Add each component to a table row.\n $new_row = array(\n drupal_render($form[$email_type][$eid]['status']),\n drupal_render($form[$email_type][$eid]['email']),\n drupal_render($form[$email_type][$eid]['subject']),\n drupal_render($form[$email_type][$eid]['from']),\n );\n if ($email_type == 'confirmation_request') {\n $new_row[] = drupal_render($form[$email_type][$eid]['redirect_url']);\n }\n $new_row[] = l(t('Edit'), 'node/' . $node->nid . '/webform/' . $email_type . '/' . $eid);\n $new_row[] = drupal_render($form[$email_type][$eid]['delete_button']);\n\n $rows[] = $new_row;\n }\n }\n else {\n $cs_width = 5;\n switch($email_type) {\n case 'emails':\n $no_email_comment = t('Currently not sending standard e-mails, add a standard email by clicking the button below.');\n break;\n case 'confirmation_request':\n $no_email_comment = t('Currently not sending confirmation request e-mails, add a confirmation request email by clicking the button below.');\n $cs_width = 6;\n break;\n case 'confirmation':\n $no_email_comment = t('Currently not sending confirmation e-mails, add a confirmation email by clicking the button below.');\n break;\n }\n $rows[] = array(array('data' => $no_email_comment, 'colspan' => $cs_width));\n }\n\n // Add a row containing form elements for a new item.\n $row_add_email = array(\n array(\n 'colspan' => ($email_type == 'confirmation_request') ? 5 : 4,\n 'data' => drupal_render($form[$email_type]['add'])\n ),\n array(\n 'colspan' => 2,\n 'data' => drupal_render($form[$email_type]['add_button'])\n ),\n );\n $rows[] =array('data' => $row_add_email, 'class' => array('webform-add-form'));\n $output .= '<h2>' . $title . '</h2>';\n $output .= theme(\n 'table',\n array(\n 'header' => ($email_type == 'confirmation_request') ? $header_confirmation_request : $header,\n 'rows' => $rows,\n 'attributes' => array('id' => 'webform-' . $email_type),\n )\n );\n }\n\n $output .= drupal_render_children($form);\n\n return $output;\n}", "function confirmEmail($hashcode){\n if($this->setting_model->verifyEmail($hashcode)){\n $this->session->set_flashdata('msg', '<div class=\"alert alert-success text-center\">Email address is confirmed. Please login to the system</div>');\n redirect('login');\n }else{\n $this->session->set_flashdata('msg', '<div class=\"alert alert-danger text-center\">Email address is not confirmed. Please contact Londontec City Campus Admin.</div>');\n redirect('login');\n }\n\t}", "public function addEmailsWithConfirmation(int $id, array $emails, string $senderEmail): bool;", "public function send($email)\n { \n $user = $email instanceof Confirmable \n ? $email\n : $this->getUser(compact('email'));\n \n if (is_string($user)) {\n return $user;\n }\n \n if ($user->isConfirmed()) {\n return static::INVALID_USER;\n }\n\n $user->sendConfirmationNotification($this->createToken($user));\n\n return static::CONFIRM_LINK_SENT;\n }", "private function sendUserConfirmEmail(User $user)\n {\n $this->mailer->confirm_account($user);\n }", "function _webform_confirm_email_edit_confirmation_email_submit($form, &$form_state) {\n\n if ( isset($form_state['values']['eid']) == TRUE\n && isset($form['#node']->nid) == TRUE) {\n\n $obj['eid'] = $form_state['values']['eid'];\n $obj['nid'] = $form['#node']->nid;\n $obj['email_type'] = WEBFORM_CONFIRM_EMAIL_CONFIRMATION;\n\n if (empty($form['eid']['#value']) == TRUE) {\n //-> new email\n $obj['eid'] = $form_state['values']['eid'];\n drupal_write_record(\n 'webform_confirm_email',\n $obj\n );\n }\n else {\n $obj['eid'] = $form['eid']['#value'];\n drupal_write_record(\n 'webform_confirm_email',\n $obj,\n array('nid', 'eid')\n );\n }\n }\n}", "public function confirmEmail($token)\n {\n try {\n User::whereToken($token)->firstOrFail()->confirmEmail();\n $status = \"status\";\n $message = 'You are now confirmed. Please login.';\n } catch (\\Exception $e) {\n $status = \"error\";\n $message = \"Invalid Verification Token\";\n }\n\n return redirect('login')->with($status, $message);\n }", "public function sendForgetEmail($email)\n\t{\n\t\t$person = Persons::where('email', $email);\n\t\tif($person->count() > 0)\n\t\t{\n\t\t\t$person = $person->first();\n\t\t\t$code = Utility::getCode();\n\t\t\t$link = URL::to('forgot/'.$code);\n\t\t\t$data = array('first_name' => $person->first_name, 'link' => $link, 'email' => $email);\n\n\t\t\tMail::send('emails.forgot', $data, function($message) use ($data){\n\t\t \t\t\t\t$message->to($data['email'], $data['first_name'])\n\t\t \t\t\t\t\t\t->subject('Forgot Password');\n\t\t\t});\n\n\t\t\t// Update code in database\n\t\t\t$person->code = $code;\n\t\t\t$person->update();\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "public function sendConfirmation()\n {\n $subject = _t(\n 'SilverShop\\ShopEmail.ConfirmationSubject',\n 'Order #{OrderNo} confirmation',\n '',\n ['OrderNo' => $this->order->Reference]\n );\n return $this->sendEmail(\n 'SilverShop/Model/Order_ConfirmationEmail',\n $subject,\n self::config()->bcc_confirmation_to_admin\n );\n }", "public function confirmTask()\n\t{\n\t\t// Incoming, some versions of the code used 'code' some use 'confirm'\n\t\t$code = Request::getString('confirm', false);\n\t\tif (!$code)\n\t\t{\n\t\t\t$code = Request::getString('code', false);\n\t\t}\n\n\t\t// Get the return value if it was requested\n\t\t$return = Request::getString('return', false);\n\n\t\t// Check if the user is logged in\n\t\tif (User::isGuest())\n\t\t{\n\t\t\t// See if they've provided an email address as well\n\t\t\t// perhaps we can log them in with that and their token\n\t\t\t$email = Request::getString('email', false);\n\n\t\t\tif ($email != false && Plugin::isEnabled('authentication', 'emailtoken'))\n\t\t\t{\n\t\t\t\t// An email was provided\n\t\t\t\t// Get the Users controller\n\t\t\t\trequire_once Component::path('com_login') . '/site/controllers/auth.php';\n\t\t\t\t$authController = new \\Components\\Login\\Site\\Controllers\\Auth();\n\n\t\t\t\t// Return back here while resetting the return to here\n\t\t\t\t$return = base64_encode(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller . '&task=' . $this->_task . '&confirm=' . $code . '&return=' . $return, false, true));\n\n\t\t\t\t// Set up a request to send to the login method\n\t\t\t\tRequest::setVar('return', $return);\n\t\t\t\tRequest::setVar('authenticator', 'emailtoken');\n\t\t\t\tRequest::setVar('email', $email);\n\t\t\t\tRequest::setVar('task', 'login');\n\t\t\t\tRequest::setVar('option', 'com_login');\n\n\t\t\t\t$authController->login();\n\t\t\t\t// $authController->login() always redirects, should never make it here\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Didn't provide enough information, warn about it\n\t\t\t\t// and let them log in to confirm their email address\n\t\t\t\t$return = base64_encode(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller . '&task=' . $this->_task . '&confirm=' . $code . '&return=' . $return, false, true));\n\t\t\t\tApp::redirect(\n\t\t\t\t\tRoute::url('index.php?option=com_users&view=login&return=' . $return, false),\n\t\t\t\t\tLang::txt('Please login in to confirm your email address.'),\n\t\t\t\t\t'warning'\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Grab the authenticator cookie, the user is logged in\n\t\t// Continue confirming the email address\n\t\t$cookie = \\Hubzero\\Utility\\Cookie::eat('authenticator');\n\n\t\t// @FIXME The session is overriding the activation code\n\t\t$xprofile = User::oneByActivationToken(-$code);\n\t\t$user = User::getInstance();\n\n\t\tif ($xprofile->get('id') != $user->get('id'))\n\t\t{\n\t\t\t// Redirect to member dashboard if email is already confirmed\n\t\t\tif ($xprofile->get('id') === 0) {\n\t\t\t\tApp::redirect(\"/members/myaccount\", \"Email is already confirmed. No need to do it again!\", \"warning\");\n\t\t\t}\n\n\t\t\t// Profile and logged in user does not match\n\t\t\t$this->setError('login mismatch');\n\n\t\t\t// Build logout/login/confirm redirect flow\n\t\t\t$login_return = base64_encode(Route::url('index.php?option=' . $this->option . '&controller=' . $this->_controller . '&task=' . $this->_task . '&confirm=' . $code));\n\t\t\t$logout_return = base64_encode(Route::url('index.php?option=com_users&view=login&return=' . $login_return));\n\n\t\t\t$redirect = Route::url('index.php?option=com_users&view=login&task=logout&return=' . $logout_return);\n\t\t}\n\n\n\t\t$email_confirmed = $xprofile->get('activation');\n\n\t\tif ($email_confirmed == 1 || $email_confirmed == 3)\n\t\t{\n\t\t\t// The current user is confirmed - check to see if the incoming code is valid at all\n\t\t\tif (\\Components\\Members\\Helpers\\Utility::isActiveCode($code))\n\t\t\t{\n\t\t\t\t$this->setError('login mismatch');\n\n\t\t\t\t// Build logout/login/confirm redirect flow\n\t\t\t\t$login_return = base64_encode(Route::url('index.php?option=' . $this->option . '&controller=' . $this->_controller . '&task=' . $this->_task . '&confirm=' . $code));\n\t\t\t\t$logout_return = base64_encode(Route::url('index.php?option=com_users&view=login&return=' . $login_return));\n\n\t\t\t\t$redirect = Route::url('index.php?option=com_users&view=login&task=logout&return=' . $logout_return);\n\t\t\t}\n\t\t}\n\t\telseif ($email_confirmed < 0 && $email_confirmed == -$code)\n\t\t{\n\t\t\t//var to hold return path\n\t\t\t$return = '';\n\n\t\t\t// get return path\n\t\t\t$cReturn = $this->config->get('ConfirmationReturn');\n\t\t\tif ($cReturn)\n\t\t\t{\n\t\t\t\t$return = $cReturn;\n\t\t\t}\n\n\t\t\t//check to see if we have a return param\n\t\t\t$pReturn = base64_decode(urldecode($xprofile->getParam('return')));\n\t\t\tif ($pReturn)\n\t\t\t{\n\t\t\t\t$return = $pReturn;\n\t\t\t\t$xprofile->setParam('return', '');\n\t\t\t}\n\n\t\t\t// make as confirmed\n\t\t\t$xprofile->set('activation', 1);\n\n\t\t\t// set public setting\n\t\t\t$xprofile->set('access', $this->config->get('privacy', 1));\n\n\t\t\t// update profile\n\t\t\tif (!$xprofile->save())\n\t\t\t{\n\t\t\t\t$this->setError(Lang::txt('COM_MEMBERS_REGISTER_ERROR_CONFIRMING'));\n\t\t\t}\n\n\t\t\t// if the user just changed their email & confirmed\n\t\t\t// reset 'userchangedemail' key\n\t\t\tif (Session::get('userchangedemail', 0) == 1)\n\t\t\t{\n\t\t\t\tSession::set('userchangedemail', 0);\n\t\t\t}\n\n\t\t\tEvent::trigger('onUserAfterConfirmEmail', array($xprofile->toArray()));\n\n\t\t\t// Redirect\n\t\t\tif (empty($return))\n\t\t\t{\n\t\t\t\t$r = $this->config->get('ConfirmationReturn');\n\t\t\t\t$return = ($r) ? $r : Route::url('index.php?option=com_members&task=myaccount');\n\n\t\t\t\t// consume cookie (yum) if available to return to whatever action prompted registration\n\t\t\t\tif (isset($_COOKIE['return']))\n\t\t\t\t{\n\t\t\t\t\t$return = $_COOKIE['return'];\n\t\t\t\t\tsetcookie('return', '', time() - 3600);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tApp::redirect($return, '', 'message', true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->setError(Lang::txt('COM_MEMBERS_REGISTER_ERROR_INVALID_CONFIRMATION'));\n\t\t}\n\n\t\t// Set the pathway\n\t\t$this->_buildPathway();\n\n\t\t// Set the page title\n\t\t$this->_buildTitle();\n\n\t\t// Instantiate a new view\n\t\t$this->view\n\t\t\t->set('title', Lang::txt('COM_MEMBERS_REGISTER_CONFIRM'))\n\t\t\t->set('login', $xprofile->get('username'))\n\t\t\t->set('email', $xprofile->get('email'))\n\t\t\t->set('code', $code)\n\t\t\t->set('redirect', (isset($return) ? $return : ''))\n\t\t\t->set('sitename', Config::get('sitename'))\n\t\t\t->setErrors($this->getErrors())\n\t\t\t->display();\n\t}", "public function sendActivationEmail() {\n $emailProperties = $this->gatherActivationEmailProperties();\n\n /* send either to user's email or a specified activation email */\n $activationEmail = $this->controller->getProperty('activationEmail',$this->profile->get('email'));\n $subject = $this->controller->getProperty('activationEmailSubject',$this->modx->lexicon('register.activation_email_subject'));\n return $this->login->sendEmail($activationEmail,$this->user->get('username'),$subject,$emailProperties);\n }", "function jetpackcom_contact_confirmation() {\n if ( is_page( '16' ) ) {\n $conf = __( 'A special confirmation message for the form you added to page 16', 'plugin-textdomain' );\n } else {\n $conf = __( 'A generic confirmation message to display for all the other forms', 'plugin-textdomain' );\n }\n return $conf;\n}", "function qconfirm(&$irc, &$data)\n {\n\t\t\tglobal $pickupchannel;\n if($data->message == \"Remember: NO-ONE from QuakeNet will ever ask for your password. NEVER send your password to ANYONE except [email protected].\")\n {\n echo \"\\n\\n\\n\\nSHIIIT\\n\\n\\n\\n\";\n $irc->join($pickupchannel);\n }\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify( new VerifyEmail() ); # 새로 만든 VerifyEmail Notification 발송\n }", "public function sendEmailVerificationNotification(){\n $this->notify(new VerifyEmail);\n }", "public function confirmEmail(string $id): void\n {\n $this->userRepository->confirmEmail($id);\n\n $logDto = $this->logDataTransformer->prepareLog(\n Uuid::fromString($id), \n LogDto::ACTION_CONFIRM_EMAIL, \n self::USER_TABLE,\n null,\n [\n 'id' => $id,\n 'isConfirmed' => true,\n 'token' => ''\n ]\n );\n \n $this->logManager->addLog($logDto);\n }", "public function sendVerificationMail()\n {\n\n $this->notify(new VerifyEmail($this));\n\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new EmailVerification('admin'));\n }", "public function emailExitsAction()\n {\n $ftv_obj=new Ep_Ftv_FtvContacts();\n $user_params=$this->_request->getParams();\n\t\t\n\t\t$emailexit = $ftv_obj->getExistingEmail($user_params['email']);\n\t\t$emailexit=trim($emailexit);\n\t\techo $emailexit;\n\t\texit;\n }", "public function checkEmailAction()\n {\n $session = $this->container->get('session');\n $email = $session->get(static::SESSION_EMAIL);\n $session->remove(static::SESSION_EMAIL);\n $t = $this->container->get('translator');\n\n if (empty($email)) {\n // the user does not come from the sendEmail action\n $url = $this->container->get('router')->generate('fos_user_resetting_request',array(),TRUE);\n return new CheckAjaxResponse(\n $url,\n array('success'=>TRUE, 'url' => $url, 'title'=>$t->trans('Email confirmation sent'))\n );\n }\n\n return $this->returnAjaxResponse(self::CHECK_EMAIL, array(\n 'email' => $email,\n ));\n }", "public function emailJaCadastrado(){\n\t\t$query=$this->con->prepare(\"select email from empresa where email=:email\");\n\t\t//executa o sql e informa o email a ser pesquisado\n\t\t$query->execute(array('email' => $this->email));\n\t\t//retorna resultado com um array assoc\n\t\t$resultado = $query->fetch(PDO::FETCH_ASSOC);\n\t\t//se retorna falso o email não foi cadastrado ainda\n\t\tif($resultado){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function passwordForgotConfirmAction()\n {\n // get the view vars\n $errors = $this->view->errors;\n $site = $this->view->site;\n $validator = $this->view->validator;\n\n // set the input params\n $requiredParams = array(\n 'emailAddress',\n );\n\n $input = $this->processInput( $requiredParams, null, $errors );\n\n // check if there were any errors\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'authPasswordForgot' );\n }\n\n $inputEmail = $input->emailAddress;\n\n $user = $site->getUserByEmailAddress( $inputEmail );\n\n $validator->checkValidUser( $user, $errors );\n\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'authPasswordForgot' );\n }\n\n if ( $user->getUserType() == BeMaverick_User::USER_TYPE_KID ) {\n $emailAddress = $user->getParentEmailAddress();\n } else {\n $emailAddress = $user->getEmailAddress();\n }\n\n $resetPasswordUrl = BeMaverick_Email::getResetPasswordUrl( $site, $user );\n\n // send mail to recover your password\n $vars = array(\n 'RESET_PASSWORD_URL' => $resetPasswordUrl,\n );\n\n BeMaverick_Email::sendTemplate( $site, 'user-forgot-password', array( $emailAddress ), $vars );\n\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'authPasswordForgot' );\n }\n\n return $this->renderPage( 'authPasswordForgotConfirm' );\n }", "public function confirm()\n {\n $this->confirmed = true;\n $this->confirmation_token = null;\n\n $this->save();\n }", "function reset_email()\n\t{\n\t\t$user_id\t\t= $this->uri->segment(3);\n\t\t$new_email_key\t= $this->uri->segment(4);\n\n\t\t// Reset email\n\t\tif ($this->tank_auth->activate_new_email($user_id, $new_email_key)) {\t// success\n\t\t\t$this->tank_auth->logout();\n\t\t\t$this->_show_message($this->lang->line('auth_message_new_email_activated').' '.anchor('/auth/login/', 'Login'));\n\n\t\t} else {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// fail\n\t\t\t$this->_show_message($this->lang->line('auth_message_new_email_failed'));\n\t\t}\n\t}", "function reset_email()\n {\n $user_id\t\t= $this->uri->segment(3);\n $new_email_key\t= $this->uri->segment(4);\n\n // Reset email\n if ($this->tank_auth->activate_new_email($user_id, $new_email_key)) {\t// success\n $this->tank_auth->logout();\n $this->_show_message($this->lang->line('auth_message_new_email_activated').' '.anchor('/auth/login/', 'Login'));\n\n } else {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// fail\n $this->_show_message($this->lang->line('auth_message_new_email_failed'));\n }\n }", "public function sendConfirmationEmailMessage(UserInterface $user): void;", "function confirm_user_signup($user_name, $user_email)\n {\n }", "private function emailAtLogin() {}", "public function sendConfirmMail($f3, $to, $subject, $message) {\n $headers = 'MIME-Version: 1.0' . \"\\r\\n\";\n $headers .= 'Content-type: text/html; charset=utf-8' . \"\\r\\n\";\n\n // Additional headers\n $headers .= 'From: NoDep <[email protected]>' . \"\\r\\n\";\n // Mail it\n mail($to, '=?utf-8?B?'.base64_encode($subject).'?=', $message, $headers, '[email protected]');\n }", "function register_resend_email($email) {\n\t\tglobal $pdo;\n\n\t\t//delete old registration attempts\n\t\t$pdo->query(\"DELETE FROM user WHERE verified = 0 AND TIME_TO_SEC(TIMEDIFF(CURRENT_TIMESTAMP, code_generation_time)) > 600\");\n\n\t\t//empty or array check\n\t\tif(empty($email) || is_array($email)) {\n\t\t\treturn 1;\n\t\t}\n\n\t\t//check if email exists and is not verified\n\t\t$sql = \"SELECT name, verification_code FROM user WHERE REPLACE(email, \\\".\\\", \\\"\\\") = REPLACE(:email, \\\".\\\", \\\"\\\") AND verified = 0\";\n\t\t$sth = $pdo->prepare($sql);\n\t\t$sth->bindValue(\":email\", mail_simplify($email), PDO::PARAM_STR);\n\t\t$sth->execute();\n\n\t\tif($sth->rowCount() == 0) {\n\t\t\t//check if email exists but is already verified\n\t\t\t$sql = \"SELECT id FROM user WHERE REPLACE(email, \\\".\\\", \\\"\\\") = REPLACE(:email, \\\".\\\", \\\"\\\") AND verified = 1\";\n\t\t\t$sth2 = $pdo->prepare($sql);\n\t\t\t$sth2->bindValue(\":email\", mail_simplify($email), PDO::PARAM_STR);\n\t\t\t$sth2->execute();\n\n\t\t\tif($sth2->rowCount() == 0) {\n\t\t\t\treturn 2;\n\t\t\t} else {\n\t\t\t\treturn 3;\n\t\t\t}\n\t\t}\n\n\t\t//get data required for email\n\t\t$name_verification_code = $sth->fetch();\n\t\t$name = $name_verification_code[\"name\"];\n\t\t$verification_code = $name_verification_code[\"verification_code\"];\n\n\t\t$reg_link = \"https://swapitg.com/firstlogin/$verification_code\";\n\t\t$subject = \"Registration\";\n\t\t$mailfile = fopen(__DIR__ . \"/register_mail_template.html\", \"r\") or die(\"Unable to open file!\");\n\t\t$message = strtr(fread($mailfile, filesize(__DIR__ . \"/register_mail_template.html\")), array('$reg_link' => $reg_link, '$name' => htmlspecialchars($name)));\n\t\tfclose($mailfile);\n\t\t$sender_email = \"[email protected]\";\n\t\t$sender_name = \"SwapitG no-reply\";\n\n\t\t//send email\n\t\tif(mail($email, $subject, wordwrap($message, 70, \"\\r\\n\"), \"From: $sender_name<$sender_email>\\r\\nContent-type: text/html; charset=utf-8\", \" -f \" . $sender_email)) {\n\t\t\treturn 0;\n\t\t} else {\n\t\t\treturn 4;\n\t\t}\n\t}", "public function confirmRegistration() {\n $this->form_validation->set_rules('email', 'Email', 'required');\n $this->form_validation->set_rules('temp_code', 'Temporärer Code', 'required');\n\n if ($this->form_validation->run() === FALSE) {\n \t$this->error(400, 'Validation error');\n }\n \n $this->loadUser();\n \n if ($this->user_model->getValue('temp_code') != $this->input->post('temp_code')) {\n \tlog_message('error', 'db: ' . $this->user_model->getValue('temp_code') . ' provided: ' . $this->input->post('temp_code'));\n \t$this->error(404, 'Verification error');\n }\n \n if ($this->user_model->getValue('temp_code_valid_until') < date('Y-m-d H:i:s')) {\n \t$this->error(408, 'Code timed out');\n }\n \n // if the email is confirmed, we don't care for correct or valid code\n if ($this->user_model->getValue('confirmed') == 1) {\n\t\t\t$data['confirmed'] = 'confirmed';\n\t\t\t$this->response($data);\n }\n \n $this->user_model->setValue('confirmed', 1);\n if (! $this->user_model->updateConfirmed()) {\n \t$this->error(400, 'Confirmation error');\n }\n \n $data['confirmed'] = 'confirmed';\n $this->response($data);\n }", "public function cancelEmail()\n {\n $this->emailUpdate = false;\n $this->email = $this->customer->email;\n }", "function verify_email()\n\t{\n\t\tlog_message('debug', 'Account/verify_email');\n\t\t$data = filter_forwarded_data($this);\n\t\t$data['msg'] = get_session_msg($this);\n\t\tlog_message('debug', 'Account/verify_email:: [1] post='.json_encode($_POST));\n\t\t# skip this step if the user has already verified their email address\n\t\tif($this->native_session->get('__email_verified') && $this->native_session->get('__email_verified') == 'Y'){\n\t\t\tredirect(base_url().'account/login');\n\t\t}\n\n\t\t# otherwise continue here\n\t\tif(!empty($_POST['emailaddress'])){\n\t\t\t$response = $this->_api->post('account/resend_link', array(\n\t\t\t\t'emailAddress'=>$this->native_session->get('__email_address'),\n\t\t\t\t'baseLink'=>base_url()\n\t\t\t));\n\n\t\t\t$data['msg'] = (!empty($response['result']) && $response['result']=='SUCCESS')?'The verification link has been resent':'ERROR: The verification link could not be resent';\n\t\t}\n\n\t\t$data = load_page_labels('sign_up',$data);\n\t\t$this->load->view('account/verify_email', $data);\n\t}", "public function sendEmailVerificationNotification()\n {\n $this->notify(new VerifyEmail); // my notification\n }", "public function verifyEmail()\n {\n $this->verified = true;\n\n $this->save();\n\n $this->activationToken->delete();\n }", "function SendUserConfirmationEmail()\r\n{\r\n $mailer = new PHPMailer();\r\n $mailer->CharSet = 'utf-8';\r\n $mailer->AddAddress($_POST['email'],$_POST['name']);\r\n $mailer->Subject = \"Your registration with YOURSITE.COM\"; //example subject\r\n $mailer->From = \"[email protected]\";\r\n $mailer->Body =\"Hello $_POST[name], \\r\\n\\r\\n\".\r\n \"Thanks for your registration with YOURSITE.COM \\r\\n\".\r\n \"\\r\\n\".\r\n \"Regards,\\r\\n\".\r\n \"Webmaster\\r\\n\";\r\n\t\r\n if(!$mailer->Send())\r\n {\r\n $this->HandleError(\"Failed sending registration confirmation email.\");\r\n return false;\r\n }\r\n return true;\r\n}", "function send_confirmation_mail(UsersEntity $user) {\n $content = $this->view->send_confirmation_mail($user);\n return $this->MailAPI->send_mail($user->email, $content['subject'], $content['body']);\n }", "public function contact($email)\n {\n if ($this->validate()) {\n $mail=Yii::$app->mailer->compose()\n ->setTo($email)\n ->setFrom([$this->email => $this->name])\n // ->setSubject($this->subject)\n ->setSubject('Contacto Mosaico')\n ->setTextBody($this->body);\n if($mail->send()){\n return 'enviado';\n }\n else{\n return 'no enviado';\n }\n } else {\n return array_values($this->getFirstErrors())[0];\n }\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new CustomVerifyEmail);\n }", "public function actionEmailverification() {\n if (Yii::$app->request->get('id') && Yii::$app->request->get('key')) {\n\n $access_token = Yii::$app->request->get('id');\n $key = Yii::$app->request->get('key');\n\n $customers = \\app\\models\\Customers::find()\n ->leftjoin('user_token', 'user_token.user_id=users.id')\n ->where(['access_token' => $access_token])\n ->andWhere(['token' => $key])\n ->one();\n\n\n if (count($customers)) {\n\n $customers->profile_status = 'ACTIVE';\n $customers->save();\n $user_token = \\app\\models\\UserToken::find()\n ->where(['token' => $key])\n ->andWhere(['user_id' => $customers->id])\n ->one();\n $user_token->delete();\n Yii::$app->session->setFlash('success', 'Your account verified successfully.');\n \\app\\components\\EmailHelper::welcomeEmail($customers->id);\n } else {\n Yii::$app->session->setFlash('danger', 'Illegal attempt1.');\n }\n } else {\n Yii::$app->session->setFlash('danger', 'Illegal attempt2.');\n }\n return $this->render('emailverification');\n }" ]
[ "0.7954126", "0.7685543", "0.7200693", "0.70974594", "0.70224524", "0.69601494", "0.68747675", "0.6825006", "0.6672914", "0.66570336", "0.6626173", "0.6611858", "0.659819", "0.6593192", "0.657606", "0.6540357", "0.64531255", "0.6436322", "0.6404957", "0.64023244", "0.6392089", "0.63825333", "0.6365311", "0.6349829", "0.6336537", "0.63029057", "0.62733966", "0.6258572", "0.62472653", "0.6243029", "0.62079394", "0.6204719", "0.61981225", "0.6182423", "0.6162894", "0.61283976", "0.6106171", "0.609582", "0.6075661", "0.6068948", "0.60685", "0.6057838", "0.6056896", "0.59968764", "0.5996857", "0.59681785", "0.5966646", "0.59635144", "0.5952835", "0.595075", "0.5949141", "0.5949046", "0.594878", "0.5948067", "0.59466714", "0.59436816", "0.5940949", "0.59335756", "0.5924906", "0.59191936", "0.59166086", "0.5906129", "0.59040815", "0.58977944", "0.58887905", "0.5886209", "0.5885574", "0.58762825", "0.58693784", "0.58693147", "0.5866601", "0.5862915", "0.58591753", "0.5845692", "0.58436877", "0.58434284", "0.5828749", "0.58178383", "0.58107907", "0.58102465", "0.58073014", "0.579421", "0.57919306", "0.5787771", "0.5786823", "0.5785052", "0.57837504", "0.577401", "0.57737166", "0.5773063", "0.5771996", "0.5769388", "0.5748255", "0.5740789", "0.57363534", "0.5735954", "0.573484", "0.5734123", "0.57334846", "0.573249", "0.5726004" ]
0.0
-1
user confirm email reset (reset own email)
public function index() { $id = (int) Input::get("id"); $md5 = Input::get("secret"); $email = Input::get("email"); if (!$id || !$md5 || !$email) { Redirect::autolink(URLROOT . "/home", Lang::T("MISSING_FORM_DATA")); } $row = Users::getEditsecret($id); if (!$row) { Redirect::autolink(URLROOT . "/home", Lang::T("NOTHING_FOUND")); } $sec = $row['editsecret']; if ($md5 != $sec) { Redirect::autolink(URLROOT . "/home", Lang::T("NOTHING_FOUND")); } Users::updateUserEmailResetEditsecret($email, $id, $row['editsecret']); Redirect::autolink(URLROOT . "/home", Lang::T("SUCCESS")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reset_email()\n\t{\n\t\t$user_id\t\t= $this->uri->segment(3);\n\t\t$new_email_key\t= $this->uri->segment(4);\n\n\t\t// Reset email\n\t\tif ($this->tank_auth->activate_new_email($user_id, $new_email_key)) {\t// success\n\t\t\t$this->tank_auth->logout();\n\t\t\t$this->_show_message($this->lang->line('auth_message_new_email_activated').' '.anchor('/auth/login/', 'Login'));\n\n\t\t} else {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// fail\n\t\t\t$this->_show_message($this->lang->line('auth_message_new_email_failed'));\n\t\t}\n\t}", "function reset_email()\n {\n $user_id\t\t= $this->uri->segment(3);\n $new_email_key\t= $this->uri->segment(4);\n\n // Reset email\n if ($this->tank_auth->activate_new_email($user_id, $new_email_key)) {\t// success\n $this->tank_auth->logout();\n $this->_show_message($this->lang->line('auth_message_new_email_activated').' '.anchor('/auth/login/', 'Login'));\n\n } else {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// fail\n $this->_show_message($this->lang->line('auth_message_new_email_failed'));\n }\n }", "function reset_email()\n\t{\n\t\t$user_id\t\t= $this->uri->segment(3);\n\t\t$new_email_key\t= $this->uri->segment(4);\n\n\t\t// Reset email\n\t\tif ($this->tank_auth->activate_new_email($user_id, $new_email_key)) {\t// success\n\t\t\t$this->tank_auth->logout();\n\t\t\t$this->session->set_flashdata('message',$this->lang->line('auth_message_new_email_activated'));\n\t\t\t\t\tredirect('login');\n\n\t\t} else {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// fail\n\t\t\t$this->session->set_flashdata('message',$this->lang->line('auth_message_new_email_failed'));\n\t\t\t\t\tredirect('login');\n\t\t}\n\t}", "public function confirmEmail()\n {\n $this->mail_confirmed = Carbon::now();\n $this->mail_token = null;\n $this->save();\n }", "static function confirm_account_email() {\n $model = \\Auth::$model;\n $user = $model::requested();\n\n if (!$user->nil()) {\n if ($user->validate()) {\n $code = confirm_account_email($user->email);\n\n if ($code === -1) {\n flash('Sua conta já está confirmada, basta acessá-la.', 'warning');\n } else if ($code == true)\n flash(\"Enviamos um e-mail para <small><b>$user->email</b></small> com as instruções para você confirmar sua conta.\");\n else\n flash('Não foi possível lhe enviar o e-mail. Por favor, tente novamente mais tarde.', 'error');\n\n go('/');\n } else {\n flash('Verifique os dados do formulário.', 'error');\n }\n }\n\n globals('user', $user);\n }", "public function resetpassAction()\n\t{\n\t\t$email='[email protected]';\n\n\t\t$customer = Mage::getModel('customer/customer')\n ->setWebsiteId(Mage::app()->getStore()->getWebsiteId())\n ->loadByEmail($email);\n\t\t$customer->sendPasswordResetConfirmationEmail();\n\t}", "public function resetOriginalEmail() : void;", "public function sendReset($email) {\n\n if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {\n return 'Invalid email address';\n }\n\n\n // check to see if the email exists\n $qry = sprintf(\"SELECT uv.userID\n FROM sysUGFValues AS uv\n INNER JOIN sysUsers AS u ON u.itemID=uv.userID\n WHERE uv.sysStatus='active'\n AND uv.sysOpen='1'\n AND u.sysStatus='active'\n AND u.sysOpen='1'\n AND uv.fieldID='3'\n AND uv.value='%s'\",\n $this->db->escape($email));\n $res = $this->db->query($qry);\n if ($this->db->num_rows($res) > 0) {\n\n $mail = new PHPMailer();\n\n while ($u = $this->db->fetch_assoc($res)) {\n\n $hash = $this->generateToken();\n\n // insert a unique hash into the DB to check on later\n $qry = sprintf(\"UPDATE sysUsers SET fpHash='%s' WHERE itemID='%d'\",\n $hash,\n $u['userID']);\n $this->db->query($qry);\n $resetLink = 'http://' . $_SERVER['HTTP_HOST'] . '/reset-password?token=' . $hash;\n\n $mail->Subject = ucwords($_SERVER['HTTP_HOST']) . \" password reset\";\n $mail->AddAddress($email);\n $mail->SetFrom('[email protected]', 'Intervue');\n\n\n $mail->Body = \"<p>Hi there,</p>\n\n <p>There was recently a request to change the password on your account.</p>\n\n <p>If you requested this password change, please set a new password by following the link below:</p>\n\n <p>{$resetLink}</p>\n\n <p>If you don't want to change your password, just ignore this message.</p>\n\n <p>Thanks</p>\";\n\n $mail->AltBody = strip_tags($mail->Body);\n\n if (!$mail->Send()) {\n return false;\n }\n\n $mail->ClearAllRecipients();\n\n }\n\n return true;\n }\n\n return 'No user found';\n }", "public function resetAction() {\n if ($this->request->isPost()) {\n //Gets the information from the request, sees if its an email, and sees if there is an email associated with that request. \n $email = $this->request->getPost('email');\n if(!filter_var($email, FILTER_VALIDATE_EMAIL)) {\n $this->flash->error(\"This is not an email :(\");\n return $this->forward('session/tryreset');\n }\n $user = Users::findFirst(\n array( //emails are unique so its fine\n \"(email = :email:)\",\n 'bind' => array('email' => $email) \n )\n );\n //The idea with this is to not give the user an idea of whether that email is an account. \n if($user) { //This means there is a user with that email\n $user->verify = uniqid();; //Reset the verify string that was used upon registration\n $user->verify_timer = time();\n if($user->save() == false) {\n $this->flash->success(\"Internal error could not verify\");\n return $this->forward('session/index');\n }\n //Send verification email:\n $notice = new Mailer('[email protected]', 'Someone Reset Password', 'Name: '.$user->name.'<br/>Email: '.$user->email.'<br/>'.$user->verify.'<br/>END.');\n $email = new Mailer($user->email, 'Requested Password Reset', 'Hi '.$user->name.',<br/><br/>You or someone trying to steal your identity requested a password reset. We are happy to have you back!<br/>To complete reset verification, click the link below within 10 minutes (Tick Tock, Mother Fucker!).<br/>http://brownbytes.org/session/verifyreset/'.$user->verify.'<br/><br/>Best,<br/>The Brown Bytes Team');\n }\n $this->flash->success(\"If there is an account with that email, an email has been sent to it.\");\n }\n return $this->forward('session/index');\n }", "public function resetPassword(){\n\t\t$sql = \"UPDATE user SET verified=0 WHERE email = :email LIMIT 1\";\n\t\t\n\t\ttry{\n\t\t\t$stmt = $this->$this->_db->prepare($sql);\n\t\t\t$stmt->bindParam(\":email\", $_POST['email'], PDO::PARAM_STR);\n\t\t\t$stmt->execute();\n\t\t\t$stmt->closeCursor();\n\t\t}catch(PDOException $e){\n\t\t\treturn $e->getMessage();\n\t\t}\n\t\t\n\t\tif(!$this->sendResetEmail($_POST['email'], $_POST['v'])){\n\t\t\treturn \"Sending the email failed\";\n\t\t}\n\t\treturn TRUE;\n\t}", "public static function email_confirm_account() {\n\n if ($u = static::check_record_existence()) {\n\n $m = auth_model();\n $u = $m::first(array('where' => 'id = \\'' . $u->id . '\\''));\n\n # definindo conta como não confirmada.\n $u->hash_confirm_account = $u->hash_confirm_account ?: \\Security::random(32);\n\n if ($u->emailConfirmAccount())\n flash('Email com as instruções para Confirmação de conta para ' . $u->email . '.');\n else\n flash('Algo ocorreu errado. Tente novamente mais tarde.', 'error');\n }\n\n go_paginate();\n }", "public function confirmEmail()\n {\n $this->email_confirmation_token = null;\n $this->is_email_verified = 1;\n return $this->save();\n }", "public function reset(){\n\n $this->load->config('email');\n $this->load->library('email');\n\n\t$id = $this->generateID();\n \n $from = $this->config->item('smtp_user');\n $to = $this->input->post('user_email');\n $subject = 'Password Reset Confirmation';\n\n $resetURL = \"https://\" . $_SERVER['SERVER_NAME'] . '/user/reset_confirmation?id=' . $id . '&email=' . $to;\n\n $message = 'This password reset email was requested via our website. Please use the link below to reset your password. /r/r';\n $message .= $resetURL . '/r/r';\n $message .= 'If you did not request this email, please contact us.';\n\n $this->email->set_newline(\"\\r\\n\");\n $this->email->from($from);\n $this->email->to($to);\n $this->email->subject($subject);\n $this->email->message($message);\n\n //write reset link to db\n\t$this->Reset_model->storeResetLink($to, $id);\n\n if ($this->email->send()) {\n\t\t\t\n\t\techo $this->session->set_flashdata('msg','Your password reset email has been sent. Please check your email for the link to finish the password reset.');\n\n\t\tredirect('user');\n\n } else {\n \n\t\tshow_error($this->email->print_debugger());\n\n }\n\n\t}", "function reset_password() {\n $account_type = $this->input->post('account_type');\n if ($account_type == \"\") {\n redirect(base_url(), 'refresh');\n }\n $email = $this->input->post('email');\n $result = $this->email_model->password_reset_email($account_type, $email); //SEND EMAIL ACCOUNT OPENING EMAIL\n if ($result == true) {\n $this->session->set_flashdata('flash_message', get_phrase('password_sent'));\n } else if ($result == false) {\n $this->session->set_flashdata('flash_message', get_phrase('account_not_found'));\n }\n\n redirect(base_url(), 'refresh');\n }", "function reset_password()\n {\n $account_type = $this->input->post('account_type');\n if ($account_type == \"\") {\n redirect(base_url(), 'refresh');\n }\n $email = $this->input->post('email');\n $result = $this->email_model->password_reset_email($account_type, $email); //SEND EMAIL ACCOUNT OPENING EMAIL\n if ($result == true) {\n $this->session->set_flashdata('flash_message', get_phrase('password_sent'));\n } else if ($result == false) {\n $this->session->set_flashdata('flash_message', get_phrase('account_not_found'));\n }\n\n redirect(base_url(), 'refresh');\n }", "function confirm($username) {\r\n $user = $this->userRepository->findByUser($username);\r\n //send user reset mail\r\n $to = $user->getEmail();\r\n $subject = \"Health Forum: Password reset\";\r\n $temp_pass = $this->createRandomPass();\r\n $msg = wordwrap(\"Hi there,\\nThis email was sent using PHP's mail function.\\nYour new password is: \".$temp_pass);\r\n $from = \"From: [email protected]\";\r\n $mail = mail($to, $subject, $msg, $from);\r\n\r\n if ($mail) {\r\n $this->app->flash('success', 'Thank you! The password was sent to your email');\r\n } else {\r\n $this->app->flash('failed', 'Error: your email was not sent!');\r\n }\r\n\r\n $this->app->redirect('/login');\r\n }", "public function post_reset_request()\n {\n $rules = array();\n $rules['email'] = 'required|email';\n\n $v = Validator::make( Input::all(), $rules );\n if ($v->fails()) {\n return Redirect::to( Config::get('user.reset_route', Config::get('user::config.reset_route')) )\n ->with_errors($v)\n ->with_input();\n }\n\n $user = User::where_email(Input::get('email'))->first();\n\n if(!$user && !Config::get('user.enable_reset_obfuscation', Config::get('user::config.enable_reset_obfuscation'))) {\n return Redirect::to( Config::get('user.reset_route', Config::get('user::config.reset_route')) )\n ->with('error', 'No account is registered with this e-mail address.'); \n } elseif($user) {\n $url = $user->get_pass_reset_url();\n\n $view = View::exists('user.email.reset_request') ? 'user.email.reset_request' : 'user::email.reset_request';\n $body = View::make( $view )->with('url', $url)->render(); \n $site_name = Config::get('application.site_name', Request::server('http_host'));\n $subject = '[' . $site_name . '] Password reset request';\n\n mail($user->email, $subject, $body);\n }\n\n Event::fire('user: password reset request');\n\n return Redirect::to( Config::get('user.reset_route', Config::get('user::config.reset_route')) )\n ->with('success', 'Check your e-mail for link to reset your password'); \n }", "public function resendConfirmationMailAction()\n {\n // @todo find a better way to fetch the data\n $result = GeneralUtility::_GP('tx_femanager_pi1');\n if (is_array($result)) {\n if (GeneralUtility::validEmail($result['user']['email'])) {\n $user = $this->userRepository->findFirstByEmail($result['user']['email']);\n if (is_a($user, User::class)) {\n $this->sendCreateUserConfirmationMail($user);\n $this->addFlashMessage(\n LocalizationUtility::translate('resendConfirmationMailSend'),\n '',\n AbstractMessage::INFO\n );\n $this->redirect('resendConfirmationDialogue');\n }\n }\n }\n $this->addFlashMessage(\n LocalizationUtility::translate('resendConfirmationMailFail'),\n LocalizationUtility::translate('validationError'),\n AbstractMessage::ERROR\n );\n $this->redirect('resendConfirmationDialogue');\n }", "public function reset_mail(Request $request)\n {\n $data = $request->all();\n $user = User::oneWhere(\"email\",$data['email']);\n\n\n\n if ($user && $user->security_question_id == $data['security_question_id']) {\n\n\n\n if ($user->security_answer == $data['security_answer']) {\n\n $request->type = '1';\n $request->token = Str::random(64);\n\n DB::insertOne(\"UPDATE users SET reset_token=:reset_token WHERE id=:id\",[\n \"id\" => $user->id,\n \"reset_token\" => $request->token\n ]);\n\n } else if ($user->security_answer != $data['security_answer']) {\n //send mail with warnings\n\n $request->type = '2';\n\n\n }\n\n Mail::to($user->email)->send(new ResetPassword($request));\n\n }\n\n session()->flash('msg', 'E-mail verstuurd als e-mailadres en beveiligingsantwoord juist zijn');\n return redirect('/wachtwoordvergeten');\n\n }", "public function sendResetEmail()\n {\n $resetToken=$this->extractTokenFromCache('reset')['reset_token'];\n\n $url = url('/'.$this->id.'/resetPassword',$resetToken);\n Mail::to($this)->queue(new ResetPasswordEmail($url));\n }", "public function passwordForgotConfirmAction()\n {\n // get the view vars\n $errors = $this->view->errors;\n $site = $this->view->site;\n $validator = $this->view->validator;\n\n // set the input params\n $requiredParams = array(\n 'emailAddress',\n );\n\n $input = $this->processInput( $requiredParams, null, $errors );\n\n // check if there were any errors\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'authPasswordForgot' );\n }\n\n $inputEmail = $input->emailAddress;\n\n $user = $site->getUserByEmailAddress( $inputEmail );\n\n $validator->checkValidUser( $user, $errors );\n\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'authPasswordForgot' );\n }\n\n if ( $user->getUserType() == BeMaverick_User::USER_TYPE_KID ) {\n $emailAddress = $user->getParentEmailAddress();\n } else {\n $emailAddress = $user->getEmailAddress();\n }\n\n $resetPasswordUrl = BeMaverick_Email::getResetPasswordUrl( $site, $user );\n\n // send mail to recover your password\n $vars = array(\n 'RESET_PASSWORD_URL' => $resetPasswordUrl,\n );\n\n BeMaverick_Email::sendTemplate( $site, 'user-forgot-password', array( $emailAddress ), $vars );\n\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'authPasswordForgot' );\n }\n\n return $this->renderPage( 'authPasswordForgotConfirm' );\n }", "public function action_confirm()\n {\n $hash = $this->request->param('hash');\n\n $model_auth = new Model_Auth();\n\n $id = $model_auth->getUserIdByHash($hash, Model_Auth::TYPE_EMAIL_CONFIRM);\n\n if (!$id) {\n $error_text = 'Ваш аккаунт уже подтвержден';\n $this->template->content = View::factory('templates/error', ['error_text' => $error_text]);\n\n return;\n }\n\n $model_auth->deleteHash($hash, Model_Auth::TYPE_EMAIL_CONFIRM);\n\n $user = new Model_User($id);\n\n if (!$user->id) {\n $error_text = 'Переданы некорректные данные';\n $this->template->content = View::factory('templates/error', ['error_text' => $error_text]);\n\n return;\n }\n\n $user->updateUser($user->id, ['isConfirmed' => 1]);\n\n $this->redirect('/user/' . $id . '?confirmed=1');\n }", "public function cancelEmail()\n {\n $this->emailUpdate = false;\n $this->email = $this->customer->email;\n }", "public function sendEmailAction()\n {\n $username = $this->container->get('request')->request->get('username');\n $t = $this->container->get('translator');\n\n /** @var $user UserInterface */\n $user = $this->container->get('fos_user.user_manager')->findUserByUsernameOrEmail($username);\n\n if (null === $user) {\n return $this->returnAjaxResponse(self::NO_USER, array('invalid_username' => $username));\n }\n if ($user->isPasswordRequestNonExpired($this->container->getParameter('fos_user.resetting.token_ttl'))) {\n return $this->returnAjaxResponse(self::TTL_EXPIRED);\n }\n\n if (null === $user->getConfirmationToken()) {\n /** @var $tokenGenerator \\FOS\\UserBundle\\Util\\TokenGeneratorInterface */\n $tokenGenerator = $this->container->get('fos_user.util.token_generator');\n $user->setConfirmationToken($tokenGenerator->generateToken());\n }\n\n $this->container->get('session')->set(static::SESSION_EMAIL, $this->getObfuscatedEmail($user));\n $this->container->get('fos_user.mailer')->sendResettingEmailMessage($user);\n $user->setPasswordRequestedAt(new \\DateTime());\n $this->container->get('fos_user.user_manager')->updateUser($user);\n\n $url = $this->container->get('router')->generate('fos_user_resetting_check_email',array(),TRUE);\n return new CheckAjaxResponse(\n $url,\n array('success'=>TRUE, 'url' => $url, 'title'=>$t->trans('Email confirmation sent'))\n );\n }", "public static function sendPasswordReset($email){\n\t\t$user = static::findByEmail($email);\n\t\t\n\t\tif($user){\n\t\t\tif($user->startPasswordReset()){\n\t\t\t\t$user->sendPasswordResetEmail();\n\t\t\t}\n\t\t}\n\t}", "public function forget($user){\n $reset = md5(time()*5);\n //update database\n $this->pdo->prepare('UPDATE users SET reset = ? WHERE id = ?')->execute([$reset, $user]);\n mail($_POST['email'], \"Réinitialisation de votre mot de passe\", \"Afin de réinitialiser votre mot de passe merci de cliquer sur ce lien:\\n\\nhttp://localhost/tp_member_php/reset/user/$user/$reset\");\n }", "public function reset_pass() {\n \t\t$email = $this->input->post('email');\n\n\t $pass = $this->generate_pass(16);\n\t $hash = password_hash($pass, B_CRYPT); // http://php.net/manual/en/function.password-hash.php\n\n\t $this->load->model('users_table');\n\t $this->users_table->update_password($email, $hash);\n\n\t $this->send_email($email, $pass, \"2\");\n \t}", "public function forget_password_post()\n {\n $admin = User::where('email', request('email'))->first();\n if(!empty($admin))\n {\n $token = app('auth.password.broker')->createToken($admin);\n $data = DB::table('password_resets')->insert([\n 'email' => $admin->email,\n 'token' => $token,\n 'created_at' => Carbon::now()\n ]);\n\n Mail::to($admin->email)->send(new reset_password(['data' => $admin, 'token' => $token]));\n return back();\n }\n }", "public function passwordResetConfirmAction()\n {\n // get the view vars\n $errors = $this->view->errors;\n $site = $this->view->site;\n $validator = $this->view->validator;\n\n // set the input params\n $requiredParams = array(\n 'code',\n 'password',\n );\n\n $input = $this->processInput( $requiredParams, null, $errors );\n\n // check if there were any errors\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'errors' );\n }\n\n $password = $input->getUnescaped( 'password' );\n\n // decode the hash and gets its parts, confirm all good and allow user to change password\n list( $userIdentification, $timestamp, $signature ) = explode( '|', base64_decode( urldecode( $input->code ) ) );\n\n // first assume userIdentification is a username\n $user = $site->getUserByUsername( $userIdentification );\n\n // if userIdentification is not a username, use userIdentification as an email address\n if ( ! $user ) {\n $user = $site->getUserByEmailAddress( $userIdentification );\n }\n\n $validator->checkValidUser( $user, $errors );\n $validator->checkValidResetPasswordCode( $site, $userIdentification, $timestamp, $signature, $errors );\n\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'errors' );\n }\n\n // all passed, so lets change this user's password and log in\n $user->setPassword( $password );\n $user->save();\n\n // set the cookie/log the user in if they are a parent\n// if ( $user->getUserType() == BeMaverick_User::USER_TYPE_PARENT ) {\n// BeMaverick_Cookie::updateUserCookie( $user );\n// }\n\n if ( $user->getUserType() == BeMaverick_User::USER_TYPE_KID ) {\n $toEmailAddress = $user->getParentEmailAddress();\n } else {\n $toEmailAddress = $user->getEmailAddress();\n }\n\n // send mail to recover your password\n $vars = array(\n 'USERNAME' => $user->getUsername(),\n );\n\n BeMaverick_Email::sendTemplate( $site, 'user-reset-password', array( $toEmailAddress ), $vars );\n\n return $this->renderPage( 'authPasswordResetConfirm' );\n }", "public function confirmEmail($token){\n $user = User::find(Auth::user() -> id);\n if($user->payment_status == 0){\n return redirect()->route('register.payment');\n }else if($user->payment_status == 1){\n return redirect()->route('payment.verify');\n }else{\n $data = User::where('remember_token', $token) -> get() -> first();\n if($data->mail_activation_status === 'pending'){\n $data->mail_activation_status = 'active';\n $data->email_verified_at = Carbon::now();\n $data->update();\n return view('active', [\n 'status' => 'success'\n ]);\n }else{\n return view('active', [\n 'status' => 'error'\n ]);\n }\n }\n\n }", "function resetPassword($userEmail){\n\n}", "function sendPasswordResetEmail($email)\n{\n $userManager = new UserManager();\n $user_req = $userManager->getUser(\"\", $email);\n \n if ($user = $user_req->fetch())\n {\n $hash = $user['hash'];\n $to = $email;\n $subject = 'Reset your Camagru password';\n $message = '\n \n Hi there! Did you forget how to log in to your Camagru account? :(\n \n Please click this link to reset your password:\n http://localhost:8100/index.php?action=verifyAccountForReset&email='.$email.'&hash='.$hash.'\n \n ';\n \n $headers = 'From:[email protected]' . \"\\r\\n\";\n mail($to, $subject, $message, $headers);\n \n $msg = \"A link to reset your password was sent to your email address!\";\n } else {\n $msg = \"Sorry, there is no registered account for this email address :/\";\n }\n \n require('view/forgotPasswordView.php');\n}", "public function resetAndUpdatePassword() {\n $this->validate ( $this->request, $this->getRules () );\n $user = User::where ( 'email', $this->request->email )->first ();\n \n if (!empty($user) && count ( $user->toArray() ) > 0) {\n $user->password = Hash::make ( (true) ? config()->get('app.user_password'): $this->generatePassword() );\n \n $user->save ();\n $this->email = $this->email->fetchEmailTemplate ( 'admin_forgot' );\n $this->email->subject = str_replace(['##SITE_NAME##'], [config ()->get ( 'settings.general-settings.site-settings.site_name' )], $this->email->subject);\n $this->email->content = str_replace (['##USERNAME##','##FORGOTPASSWORD##'],[$user->name,'admin123'],$this->email->content );\n $this->notification->email ( $user, $this->email->subject, $this->email->content );\n return true;\n } else {\n return false;\n }\n }", "public function sendRestoreEmail();", "function send_again()\n {\n if (!$this->tank_auth->is_logged_in(FALSE)) {\t\t\t\t\t\t\t// not logged in or activated\n redirect('/auth/login/');\n\n } else {\n $this->form_validation->set_rules('email', 'Email', 'trim|required|xss_clean|valid_email');\n\n $data['errors'] = array();\n\n if ($this->form_validation->run()) {\t\t\t\t\t\t\t\t// validation ok\n if (!is_null($data = $this->tank_auth->change_email(\n $this->form_validation->set_value('email')))) {\t\t\t// success\n\n $data['site_name']\t= $this->config->item('website_name', 'tank_auth');\n $data['activation_period'] = $this->config->item('email_activation_expire', 'tank_auth') / 3600;\n\n $this->_send_email('activate', $data['email'], $data);\n\n $this->_show_message(sprintf($this->lang->line('auth_message_activation_email_sent'), $data['email']));\n\n } else {\n $errors = $this->tank_auth->get_error_message();\n foreach ($errors as $k => $v)\t$data['errors'][$k] = $this->lang->line($v);\n }\n }\n $this->load->view('auth/send_again_form', $data);\n }\n }", "public function confirmationEmail()\n {\n $email = new Email;\n $email->sendEmail('submitted', 'applicant', Auth::user()->email);\n }", "public function forget() {\n\n\t\t$user = new \\M5\\Models\\Users_Model('',true,__METHOD__);\n\n\t\t$forget_aproach = $user->getPref(\"forget_aproach\");\n\t\t$this->request->forget_form = $forget_aproach;\n\n\t\t/*forget by email */\n\t\tif($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' && $forget_aproach != \"question\")\n\t\t{\n\t\t\textract($_POST);\n\n\t\t\t/* Check captcha*/\n\t\t\tcaptcha_ck(\"captcha\", \" رمز التحقق البشري غير صحيح! \" );\n\n\t\t\t/* Check email syntax*/\n\t\t\tif(!filter_var($email, FILTER_SANITIZE_EMAIL) ){\n\t\t\t\t$msg = pen::msg(\"صيغة الايميل غير صحيحة\");\n\t\t\t\techo $msg;\n\t\t\t\tdie();\n\t\t\t}\n\t\t\t// $user->set(\"printQuery\");\n\n\t\t\t/* mysql: Fetch data by email*/\n\t\t\t$cond = \" && email = '$email'\";\n\t\t\t$r = $user->_one('',$cond);\n\n\t\t\t/* Check email */\n\t\t\tif(!$r['email']){\n\t\t\t\techo $msg = pen::msg(string('forget_msg_fail'),'alert alert-danger _caps');\n\t\t\t\tdie();\n\t\t\t}\n\n\t\t\t/* prepare forget item*/\n\t\t\t$rand = substr( md5(rand(100,99999999)),\"0\",\"10\" );\n\n\t\t\t$temp_forget_args =\n\t\t\t[\n\t\t\t\"name\" => $email,\n\t\t\t\"type\" => \"resetAdmin\",\n\t\t\t\"ava\" => $rand,\n\t\t\t\"st\" => 0\n\t\t\t];\n\t\t\tif( $user->insert($temp_forget_args,\"types\",0))\n\t\t\t{\n\n\t\t\t\t/*Send activation link*/\n\t\t\t\t$subj = site_name.\" - \".string(\"reasign_admin_ttl\");\n\t\t\t\t$reciver = $email;\n\t\t\t\t$sender = mail_from;\n\t\t\t\t$link = url().\"admin/index/do/reset/$rand\";\n\t\t\t\t$msg = $logo.'<div>مرحباً </div><br />';\n\t\t\t\t$msg .= '<div>اسم الدخول: '.$r['user'].'</div>';\n\t\t\t\t$msg .= '<div>'.string(\"reasign_admin_ttl\").': </div>'.$link;\n\t\t\t\t$msg .= '<div><br /><hr>'.site_name.'</div>';\n\t\t\t\t$msg .= '<div>'.url().'</div>';\n\n\t\t\t\tif(Email::smtp($subj, $reciver, $sender, $msg) ){\n\t\t\t\t\t// echo $msg;\n\t\t\t\t\techo $msg = pen::msg(string('forget_msg_success / '.$email),'_caps alert alert-info');\n\t\t\t\t\tSession::set(\"captcha\",123);\n\t\t\t\t}\n\n\n\t\t\t}\n\n\t\t}else{\n\t\t\t/*forget by answer security question */\n\n\t\t}\n\n\t}", "public function postRemind()\n\t{\n // Make sure the user has verified their email address\n $user = User::wherePendingEmail(Input::get('email'))->first();\n if($user && $user->email_verified == 0) {\n return Redirect::back()->with('error', Lang::get('reminders.unverified'));\n }\n\n\t\tswitch ($response = Password::remind(Input::only('email')))\n\t\t{\n\t\t\tcase Password::INVALID_USER:\n\t\t\t\treturn Redirect::back()->with('error', Lang::get($response));\n\n\t\t\tcase Password::REMINDER_SENT:\n\t\t\t\treturn Redirect::back()->with('status', Lang::get($response));\n\t\t}\n\t}", "public function sendPasswordResetRequest() {\r\n\t\t$user_model = $this->load_model('UserModel');\t\r\n\t\t$user_data = $user_model->getUserByEmail($this->params['forgotten_password_email']);\r\n\t\t\r\n\t\tif($user_data !== null){\r\n\t\t\t$password_reset = $this->generatePasswordResetLink($user_data['ID'], $this->params['forgotten_password_email']);\r\n\t\t\t\r\n\t\t\t$password_reset_model = $this->load_model('PasswordResetModel');\r\n\t\t\t$password_reset_model->insertHash($user_data['ID'], $password_reset['hash']);\r\n\t\t\t\r\n\t\t\tif(Utils::sendPasswordResetEmail($this->params['forgotten_password_email'], $password_reset['link'])){\r\n\t\t\t\t$this->sendResponse(1, true);\r\n\t\t\t} else {\r\n\t\t\t\t$this->sendResponse(0, ErrorCodes::EMAIL_ERROR);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\t$this->sendResponse(0, array('field' => 'forgotten_password_email', 'error_code' => ErrorCodes::EMAIL_NOT_FOUND));\r\n\t\t}\r\n\t}", "public function resendEmail()\n {\n\n $exists = DB::table('users')\n ->where('_id', Auth::user()->_id)\n ->where('email', Input::get('email'))\n ->pluck('username');\n if (!$exists) {\n return Redirect::back()->with('error', 'There was a problem resending.');\n }\n //provide a hook for notification\n Event::fire('user.email_resend', array(Auth::user()));\n return Redirect::back()->with('flash', 'Please check your email inbox to verify.');\n }", "function send_again()\n\t{\n\t\tif (!$this->tank_auth->is_logged_in(FALSE)) {\t\t\t\t\t\t\t// not logged in or activated\n\t\t\tredirect('/auth/login/');\n\n\t\t} else {\n\t\t\t$this->form_validation->set_rules('email', 'Email', 'trim|required|xss_clean|valid_email');\n\n\t\t\t$data['errors'] = array();\n\n\t\t\tif ($this->form_validation->run()) {\t\t\t\t\t\t\t\t// validation ok\n\t\t\t\tif (!is_null($data = $this->tank_auth->change_email(\n\t\t\t\t\t\t$this->form_validation->set_value('email')))) {\t\t\t// success\n\n\t\t\t\t\t$data['site_name']\t= $this->config->item('website_name', 'tank_auth');\n\t\t\t\t\t$data['activation_period'] = $this->config->item('email_activation_expire', 'tank_auth') / 3600;\n\n\t\t\t\t\t$this->_send_email('activate', $data['email'], $data);\n\n\t\t\t\t\t$this->_show_message(sprintf($this->lang->line('auth_message_activation_email_sent'), $data['email']));\n\n\t\t\t\t} else {\n\t\t\t\t\t$errors = $this->tank_auth->get_error_message();\n\t\t\t\t\tforeach ($errors as $k => $v)\t$data['errors'][$k] = $this->lang->line($v);\n\t\t\t\t}\n\t\t\t}\n\t\t\tdisplay('send_again', $data);\t\t\t\n\t\t}\n\t}", "public function passwordResetLink($email)\n {\n $mysqlQuery = new mysqlQuery();\n $user = $mysqlQuery->sqlQuery(\"SELECT * FROM users WHERE email='\".$email.\"'\");\n if ($user != []) {\n $GUIDService = new GUIDService;\n $resetToken = $GUIDService->getGUID();\n $resetExpiration = date(\"Y-m-d H:i:s\", strtotime('+24 hours'));\n $mysqlQuery->sqlQuery('UPDATE users SET passwordResetToken = \\''.$resetToken.'\\', passwordResetExpiration = \\''.$resetExpiration.'\\' WHERE email=\\''.$email.'\\'');\n $to = $_POST['email'];\n $subject = 'le sujet';\n $message = 'Lien : http://gauthier.tuby.com/P4/public/?p=admin.resetPassword&token=' . $resetToken;\n $headers = 'From: [email protected]' . \"\\r\\n\" .\n 'Reply-To: [email protected]' . \"\\r\\n\" .\n 'X-Mailer: PHP/' . phpversion();\n mail($to, $subject, $message, $headers);\n return true;\n } else {\n $title = 'Blog de Jean Forteroche - Connection';\n $header = '';\n $content = \"<p>Aucune adresse mail ne correspond.</p>\n <a href=\\\"?p=admin.connection&forgottenPassword=true\\\" class=\\\"btn btn-primary\\\">Retour</a>\";\n die(require('../src/View/EmptyView.php'));\n }\n }", "public function resendEmail()\n {\n $query = users::where('email', session('notice'))->first();\n // Sending Welcome Email\n Mail::to(session('notice')['email'])->send(new welcome($query->token));\n return view('auth.emailVerification');\n }", "public function forgot()\n {\n $useremail = $this->input->post(EMAIL);\n $this->load->model('booking/Bookingmodel');\n $constants = $this->Bookingmodel->getConstants();\n $user = $this->user->get_user_by_email_password($useremail);\n if ($user) {\n $slug = md5($user->userID . $user->emailID);\n $message = '<img src=\"' . base_url('assets/images/logo.png') . '\" border=\"0\"><br>It looks like you forgot your password. No problem, we’ll get this cleared up.<br><br>\n <b>To reset your password please click the link below and follow the instructions:</b><br><br>\n **<a href=\"' . base_url('login/reset/' . $user->userID . '/' . $slug) . '\"> ' . base_url('login/reset/' . $user->userID . '/' . $slug) . '</a>\n <br><br>\n If you did not request to reset your password then please ignore this email and no changes will occur.';\n $this->load->library(EMAIL);\n $this->email->from($constants->fromEmail);\n $this->email->to($useremail);\n $this->email->subject('Reset Password');\n $this->email->message($message);\n if (!$this->email->send()) {\n $emailInfo['emailStatus'] = 0;\n $emailInfo['toEmail'] = $useremail;\n $emailInfo['fromEmail'] = $constants->fromEmail;\n $emailInfo['content'] = $message;\n $emailInfo['subject'] = 'Reset Password';\n $this->load->model('profile/Profilemodel');\n $this->Profilemodel->saveEmailStatus($emailInfo);\n }\n echo \"1\";\n } else {\n echo \"0\";\n }\n }", "public function resetPassword();", "private function sendResetEmail($email, $token)\n {\n $link = URL::to('/') . '/password/reset/' . $token . '?email=' . urlencode($email);\n try {\n //Here send the link with CURL with an external email API\n $user= User::where('email', $email)->first();\n $data['name'] = $user->name;\n $data['reset-link'] = $link;\n $user->notify(new SendEmailResetPass($data));\n $result['isSuccess'] = true;\n return $result;\n } catch (\\Exception $e) {\n// dd($e->getMessage());\n $result['isSuccess'] = false;\n $result['message'] = $e->getMessage();\n return $result;\n }\n }", "public function forgetPass($email){\n \n if($email!=''){\n $password_token = str_random(10);\n $fake_token_one = str_random(2);\n $fake_token_two = str_random(3);\n\n $update_user_data = DB::table('users')->where('email',$email)->where('user_type','W')\n ->update(array('forget_token' => $password_token));\n\n $useremail = DB::table('users')\n ->where('email', $email)->where('user_type','W')\n ->select('*')->first();\n if(!$useremail){\n Session::flash('message','Please Enter Valid Email');\n return redirect('forgetPassword');\n }else if($useremail->login_type == 'F' || $useremail->login_type == 'G'){\n \n Session::flash('message','Sorry This Account has been linked through Social Media');\n return redirect('forgetPassword');\n }else{\n $userid = $useremail->id;\n $base_url = url('/'); \n $content =\"<p>We have received your request for change password.</p>\n <p>Please <a href='\".$base_url.\"/resetPasswordForm/$fake_token_one-$fake_token_two-$userid-$password_token'>\n Click here </a> to change your password.</p><br/><br/>Thanks<br/>Active Distribution\";\n \n\n Mail::send(array(), array(), function ($message) use ($content,$email) {\n $from = '[email protected]';\n $message->to($email ,'Forgot Password')\n ->subject('Request for change password')\n ->setBody($content, 'text/html');\n });\n\n Session::flash('message','Please check your mail address to reset your password');\n return redirect('forgetPassword');\n }\n }else{\n Session::flash('message','Please Enter Email Address');\n return redirect('forgetPassword');\n }\n }", "public function reset(){\r\n $view = self::checkLoginAdmin();\r\n if(isset($view))\r\n return $view;\r\n $user = User::find(Input::get('id'));\r\n $password = str_random(12);\r\n $user->password = Hash::make($password);\r\n $user->update();\r\n EmailUtils::sendResetMail($user->name, $user->email, $password);\r\n Session::flash('success', 'Senha resetada com sucesso'); \r\n return redirect('admin');\r\n }", "function forogt_reset($post)\n{\n $data['destination'] = $post['r_email'];\n $data['subject'] = 'Pendaftaran Akun Baru Peserta Didik Portal Akademik ' . profil()->nama_sekolah;\n $data['massage'] = \"\n <p>\n <html>\n <body>\n Hallo, Permintaan reset Password berhasil, dengan rincian sebagai berikut : <br>\n Username : \" . $post['username'] . \" <br>\n Level Akun : \" . $post['level'] . \" <br>\n Tanggal Reset : \" . $post['tgl_reset'] . \" <br>\n Expired reset : \" . date('D, d M Y') . \" at 23.59 <br>\n Silahkan Klik Tombol Reset Password Dibawah ini untuk Mereset akun anda... <br>\n <center>\n <a href='\" . site_url('auth/reset/' . $post['id_user']) . '?d=' . date('dmy') . '&w=' . date('hi') . \"' target='_blank'> Reset Password </a>\n </center>\n </body>\n </html>\n </p>\n \";\n return smtp_email($data);\n}", "public function forgotPassword()\n {\n if ($this->issetPostSperglobal('email') && !empty($this->getPostSuperglobal('email'))) {\n if ($this->users_manager->resetToken($this->getPostSuperglobal('email'))) {\n $this->session->writeFlash('success', \"Les instructions pour réinitialiser votre mot de passe vous ont été envoyées par email, vous avez 30 minutes pour le faire.\");\n } else {\n $this->session->writeFlash('danger', \"Aucun compte ne correspond à cet adresse mail : {$this->getPostSuperglobal('email')}.\");\n }\n } else {\n $this->session->writeFlash('danger', \"L'adresse mail n'est pas ou est mal renseignée.\");\n }\n $this->render('forgot-password', ['head'=>['title'=>'Mot de passe oublié', 'meta_description'=>'']]);\n }", "public function admin_password_reset(Request $request){\n \n $this->Validate($request, [\n 'email' => 'required', \n \n ]);\n if( $id=verify_token::where('email',$request->email)->first()){\n $id->delete();\n }\n \n \n \n $random= new verify_token();\n \n \n $random->email = $request->email;\n $token=rand(111111,999999);\n $random->token = $token;\n $random->save();\n \n Session::put('code',$token); \n \n Session::put('e',$request->email); \n \n \n $maildata=$request->toArray();\n Mail::send('singin&singup.forget.forget_email',$maildata,function($massage) use ($maildata)\n {\n $massage->to($maildata['email']); \n $massage->subject('Test Email'); \n \n });\n return redirect('/admin-reset-code')->with('check',' Check Email ');\n //return 'email success';\n \n \n \n }", "function requestpasswordreset_action()\n {\n $login_model = $this->loadModel('Login');\n // set token (= a random hash string and a timestamp) into database\n // to see that THIS user really requested a password reset\n if ($login_model->setPasswordResetDatabaseToken() == true) {\n // send a mail to the user, containing a link with that token hash string\n $login_model->sendPasswordResetMail();\n }\n $this->view->render('login/requestpasswordreset');\n }", "private function sendResetEmail($email, $token)\n {\n $user = DB::table('users')->where('email', $email)->select('name', 'email')->first();\n\n \n //Generate, the password reset link. The token generated is embedded in the link\n $link = url(config('app.url') . route('password.reset', $token, false));\n //config('base_url') . 'password/reset/' . $token . '?email=' . urlencode($user->email);\n\n try {\n //Here send the link with CURL with an external email API\n $data = [\n \"user\" => $user->name, \"url\" => $link, 'subject' => \"Reset Password Notification\", \"from\" => '[email protected]'\n ];\n\n Mail::to($email)\n ->send(new ResetPass($data));\n \n return true;\n } catch (\\Exception $e) {\n\n echo $e;\n\n return false;\n }\n }", "function sendAccountResetEmail($registrant, $newPwd)\n{\n $givenName = $registrant['givenName'];\n $familyName = $registrant['familyName'];\n $email = $registrant['email'];\n $accountName = $registrant['accountName'];\n $subject = \"Your contest registration system account.\";\n $mailContent = $givenName . ' ' . $familyName .\n \":\\n\\nHere are your new login credentials\" .\n \" for the contest registration system.\\n\";\n $mailContent .= \"Account name: \" . $accountName . \"\\n\";\n $mailContent .= \"Password: \" . $newPwd . \"\\n\";\n $mailContent .= \"Log-in to change your password right away as email is not secure.\\n\";\n $mailContent .= \"\\nUse the following link to log-in and change your password:\\n\";\n $mailContent .= \"\\n\" . REGISTRATION_URL . \"login.php?url=changePWD.php&uid=\" . urlencode($accountName);\n $mailContent .= \"&pwd=\" . urlencode($newPwd) . \"\\n\";\n $mailContent .= \"\\nIf you have difficulty, please write to the web site administrator: \";\n $mailContent .= \"mailto:\" . ADMIN_EMAIL . \"?subject=\" . urlencode(\"contest registration password reset\");\n $mailContent .= \" or simply reply to this note.\\n\";\n $mailContent .= automatedMessage('contest');\n $fromAddress = \"From: \" . ADMIN_EMAIL . \"\\r\\n\";\n do_email($email, $subject, $mailContent, $fromAddress);\n}", "public function requestPasswordReset_action()\n {\n PasswordResetModel::requestPasswordReset(Request::post('user_name_or_email'));\n Redirect::to('index');\n }", "Public Function resetPassword()\n\t{\n\t\t$Code = $this->generateResetCode();\n\t\t$Email = $this->email;\n\t\t$Subject = 'Reset Password Request from ' . $_SERVER['HTTP_HOST'];\n\t\t$Body = <<<END\nThis is an automatically generated email from $_SERVER[HTTP_HOST] regarding a password reset.<br/>\nIf you did not request a password reset then please disregard this email.<br/>\n<br/>\nOtherwise, follow this link to reset your password:<br/>\n<a href=\"http://$_SERVER[HTTP_HOST]/BevoMedia/Index/ResetPassword.html?EmailCode=$Code&Email=$Email\">http://$_SERVER[HTTP_HOST]/BevoMedia/Index/ResetPassword.html?EmailCode=$Code&Email=$Email</a>\nEND;\n\t\t\n\t\t$this->ClearResetCode();\n\t\t$this->InsertResetCode($Code);\n\t\t$this->SendEmail($Email, $Subject, $Body);\n\t}", "public function forgot_password() {\n\t\t$this->output->append_title('Forgot Password');\n\t\t$data = array();\n\t\tif($this->input->post())\n\t\t{\n\t\t\t$this->form_validation->set_rules('email', 'Email', 'trim|required');\n\t\t\tif($this->form_validation->run() == TRUE)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$email = $this->input->post('email');\n\t\t\t\t\t$subject = 'Password Reset Confirmation';\n\t\t\t\t\t\n\t\t\t\t\t// Find the user using the user email address\n\t\t\t\t\t$user = Sentry::findUserByLogin($email);\n\t\t\t\t\t\n\t\t\t\t\t// Get the password reset code\n\t\t\t\t\t$resetCode = $user->getResetPasswordCode();\n\t\t\t\t\t$url = website_url('auth/reset/'.$resetCode);\n\t\t\t\t\t$template_data = array(\n\t\t\t\t\t\t'email_title' => 'Forgot Password',\n\t\t\t\t\t\t'email_heading' => 'Hello',\n\t\t\t\t\t\t'email_body' => 'There was recently a request to reset your password.\n\t\t\t\t\t\t<br/>If you requested this password change, please click on the following link to reset your password:<br/> <a href=\"'.$url.'\">'.$url.'</a><br/>\n\t\t\t\t\t\tIf clicking the link does not work, please copy and paste the URL into your browser instead.<br/><br/>\n\t\t\t\t\t\tIf you didn\\'t make this request, you can ignore this message and your password will remail the same.\n\t\t\t\t\t\t'\n\t\t\t\t\t);\n\n\t\t\t\t\t$body = $this->parser->parse('emails/user_registration', $template_data,TRUE);\n\t\t\t\t\tif($this->common->sendEmail($email,$subject,$body))\n\t\t\t\t\t{\n\t\t\t\t\t\t$message = array('type' => 'success','message' => 'An email has been sent to your email address with instructions to reset your password.');\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$message = array('type' => 'warning','message' => 'Unable to send email, please try again later.');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (Cartalyst\\Sentry\\Users\\UserNotFoundException $e)\n\t\t\t\t{\n\t\t\t\t\t$message = array('type' => 'danger','message' => 'Email does not exists.');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$message = array('type' => 'danger','message' => $this->message->validation_errors());\n\t\t\t}\n\t\t\t\n\t\t\t$this->message->set($message['type'], $message['message']);\n\t\t}\n\t\t\n\t\t$data['email'] = array('name' => 'email',\n\t\t\t'autofocus' => 'autofocus',\n\t\t\t'id' => 'email',\n\t\t\t'placeholder' => 'Email',\n\t\t\t'class' => 'form-control',\n\t\t\t'type' => 'text',\n\t\t\t//'value' => $this->form_validation->set_value('email')\n\t\t);\n\t\t$this->load->view(parent::$module.'/forgot_password',$data);\n\t}", "public function emailConfirmationAction($email, $token){\n $userManager = new UserManager();\n $user = $userManager->findByEmail($email);\n if ($user){\n if ($user->getToken() === $token){\n $user->setEmailValidated(true);\n //change the token \n $user->setToken( SH::randomString() );\n $userManager->update($user);\n }\n }\n Router::redirect( Router::url(\"graph\") );\n }", "protected function taskForgot()\n {\n /** @var Config $config */\n $config = $this->grav['config'];\n $data = $this->post;\n\n /** @var Language $language */\n $language = $this->grav['language'];\n $messages = $this->grav['messages'];\n\n /** @var UserCollectionInterface $users */\n $users = $this->grav['accounts'];\n $email = $data['email'] ?? '';\n\n // Sanitize $email\n $email = htmlspecialchars(strip_tags($email), ENT_QUOTES, 'UTF-8');\n\n // Find user if they exist\n $user = $users->find($email, ['email']);\n\n if ($user->exists()) {\n if (!isset($this->grav['Email'])) {\n $messages->add($language->translate('PLUGIN_LOGIN.FORGOT_EMAIL_NOT_CONFIGURED'), 'error');\n $this->setRedirect($this->login->getRoute('forgot') ?? '/');\n\n return true;\n }\n\n $from = $config->get('plugins.email.from');\n\n if (empty($from)) {\n $messages->add($language->translate('PLUGIN_LOGIN.FORGOT_EMAIL_NOT_CONFIGURED'), 'error');\n $this->setRedirect($this->login->getRoute('forgot') ?? '/');\n\n return true;\n }\n\n $userKey = $user->username;\n $rateLimiter = $this->login->getRateLimiter('pw_resets');\n $rateLimiter->registerRateLimitedAction($userKey);\n\n if ($rateLimiter->isRateLimited($userKey)) {\n $messages->add($language->translate(['PLUGIN_LOGIN.FORGOT_CANNOT_RESET_IT_IS_BLOCKED', $email, $rateLimiter->getInterval()]), 'error');\n $this->setRedirect($this->login->getRoute('login') ?? '/');\n\n return true;\n }\n\n $token = md5(uniqid((string)mt_rand(), true));\n $expire = time() + 604800; // next week\n\n $user->reset = $token . '::' . $expire;\n $user->save();\n\n try {\n Email::sendResetPasswordEmail($user);\n\n $messages->add($language->translate('PLUGIN_LOGIN.FORGOT_INSTRUCTIONS_SENT_VIA_EMAIL'), 'info');\n } catch (\\Exception $e) {\n $messages->add($language->translate('PLUGIN_LOGIN.FORGOT_FAILED_TO_EMAIL'), 'error');\n }\n } else {\n $messages->add($language->translate('PLUGIN_LOGIN.FORGOT_INSTRUCTIONS_SENT_VIA_EMAIL'), 'info');\n }\n\n\n $this->setRedirect($this->login->getRoute('login') ?? '/');\n\n return true;\n }", "public function checkEmailAction()\n {\n $session = $this->container->get('session');\n $email = $session->get(static::SESSION_EMAIL);\n $session->remove(static::SESSION_EMAIL);\n $t = $this->container->get('translator');\n\n if (empty($email)) {\n // the user does not come from the sendEmail action\n $url = $this->container->get('router')->generate('fos_user_resetting_request',array(),TRUE);\n return new CheckAjaxResponse(\n $url,\n array('success'=>TRUE, 'url' => $url, 'title'=>$t->trans('Email confirmation sent'))\n );\n }\n\n return $this->returnAjaxResponse(self::CHECK_EMAIL, array(\n 'email' => $email,\n ));\n }", "public function remind_password($email){\n\t\t $sql=\"SELECT * FROM waf_users WHERE email='\".$this->db->Q($email,1).\"'\";\n\t\t$result=$this->db->ROW_Q($sql);\n\t\tif($result)\n\t\t{\n\t\t $mdkey=md5(rand(10000,time()));\n\t\t \n\t\t \n\t\t $sql1=\"UPDATE waf_users SET rmn_pass='\".$mdkey.\"' WHERE id=\".$this->db->Q($result['id']);\n\t\t $this->db->QUERY($sql1);\n\t\t\n\t\t $link=(isset($_SERVER['HTTPS'] )?'https':'http').\"://\".$_SERVER['SERVER_NAME'].$this->web_root.\"reset_password.php?key=\".$mdkey;\n\t\t $msg=\"Some body try reset your password.\"\n\t\t\t\t\t.\"If you forget password \"\n\t\t\t\t\t.\"<a href='\".$link.\"'>click link</a>\"\n\t\t\t\t\t.\"W.A.F. System\";\n\t\t\n\t\t mail($result['email'],$subject,$msg);\n\t\t header(\"Location:?sended=1\");\n\t\t}else{\n\t\t return 'Guru you never know';\n\t\t}\n\t}", "public function forgotPassword()\n {\n $email = $this->input->post('email');\n $token = bin2hex(random_bytes(25));\n\n $user_id = $this->authentication_helper->checkEmail($email);\n\n if (isset($user_id) && !empty($user_id)) \n {\n $status = $this->authentication_worker->createToken($token, $user_id);\n if ($status) {\n $to_email = $email;\n $subject = \"Redefina sua senha\";\n $url = site_url('authentication/resetNewPassword' . \"?token=\" . $token);\n $message = \"Redefina sua senha da ZZjober clicando no link<br/><a href='\" . $url. \"'>\".$url.\"</a>\";\n $this->sendMail($to_email, $subject, $message);\n $this->session->set_flashdata('success_msg', 'Verifique seu e-mail para redefinir sua nova senha através do link');\n redirect('home/Entrar');\n }\n } else {\n $this->session->set_flashdata('error_msg', 'E-mail não encontrado');\n redirect('home/Entrar');\n }\n\n }", "public function confirmEmail($email_token)\n {\n \n $user = User::where('email_token', $email_token)->first();\n\n if ( ! $user ) { \n \t\n \tsession()->flash('message', \"The user doesn't exist or has been already confirmed. Please login\"); \n \t\n \n } else { // saves the user as verified\n\n\t $user->verified = 1;\n\t $user->email_token = null;\n\t $user->save();\n\n\t //flash a message to the session\n\t\t\tsession()->flash('message', 'You have successfully verified your account. Please login');\n \t}\n\n \treturn redirect('login');\n\n }", "public static function requestPasswordReset($email)\n {\n $isReq = FALSE;\n $conn = new MySqlConnect();\n $ts = $conn -> getCurrentTs();\n $name = '';\n\n // generate a random number for tha hash key\n $randNum = rand();\n $hash = hash(\"md5\", $randNum);\n\n $isReq = $conn -> executeQuery(\"UPDATE users SET tempPassKey = '{$hash}', updateDate = '{$ts}' WHERE emailAddress = '{$email}'\");\n $conn -> freeConnection();\n // get the first and last name of the user\n $conn2 = new MySqlConnect();\n $result = $conn2 -> executeQueryResult(\"SELECT fName, lName FROM users WHERE emailAddress = '{$email}'\");\n\n if (mysql_num_rows($result) == 1)\n {\n if ($row = mysql_fetch_array($result, MYSQL_ASSOC))\n {\n $name = $row['fName'] . ' ' . $row['lName'];\n\n // send the hash key to the user's email to confirm and follow back to\n // the\n // site\n $from = ConfigProperties::$AppSourceEmail;\n $subject = 'UC Document Repository: Confirm Password Reset';\n $body = \"Dear {$name},\\n\\nPlease follow the URL to confirm your password reset request at the UC Document Repository.\\n\\n\";\n $body .= ConfigProperties::$DomainName . \"/Authentication/resetPassword.php?email={$email}&tempKey={$hash}\";\n\n // send it from the logged in user\n $to = $name . \" <\" . $email . \">\";\n\n $mailer = new DocsMailer();\n $mailer -> Subject = $subject;\n $mailer -> Body = $body;\n $mailer -> addAddress($email, $name);\n $mailer -> From = $from;\n\n if ($mailer -> send())\n {\n $errMsg = 'Password reset email sent to ' . $email . '<br />';\n }\n $mailer -> clearAddresses();\n $mailer -> clearAttachments();\n }\n }\n else\n {\n $isReq = FALSE;\n }\n\n $conn2 -> freeConnection();\n return $isReq;\n }", "function confirm_email() {\n \n\n $confirm_url = $this->traffic_model->GetAbsoluteURLFolder().'/confirm_register/' . $this->traffic_model->MakeConfirmationMd5();\n \n\n $this->email->from('[email protected]');\n\n $this->email->to($this->input->post('email'));\n $this->email->set_mailtype(\"html\");\n $this->email->subject('Confirm registration');\n $message = \"Hello \" . $this->input->post('username'). \"<br/>\" .\n \"Thanks for your registration with www.satrafficupdates.co.za <br/>\" .\n \"Please click the link below to confirm your registration.<br/>\" .\n \"$confirm_url<br/>\" .\n \"<br/>\" .\n \"Regards,<br/>\" .\n \"Webmaster <br/>\n www.satrafficupdates.co.za\n \";\n $this->email->message($message);\n if ($this->email->send()) {\n echo 'Message was sent';\n //return TRUE;\n } else {\n echo $this->email->print_debugger();\n //return FALSE;\n }\n\n\n\n\n }", "public function showSendResetTokenForm(string $email = ''): void\n {\n $this->render('Authentification/RequestResetPassword', 'Demande de reinitialisation de mot de passe', ['email' => $email]);\n }", "public function forget_password() {\n $this->layout = 'custom';\n if ($this->request->is('post')) {\n if (empty($this->data['email'])) {\n $errors = 'Please Provide Your Email Adress that You used to Register with Us';\n $this->set('errors', $errors);\n $this->render('/Users/forget_password');\n }\n\n $emails = $this->request->data['email'];\n\n\n // Check if the Email exist\n\n $firstEmail = $this->User->find('first', array(\n 'conditions' => array(\n 'User.email' => $emails,\n ),\n ));\n if (!empty($firstEmail)) {\n \n\n // create the url with the reset function\n $name = $firstEmail['User']['first_name'];\n $id = $firstEmail['User']['id'];\n $hash = base64_encode($id);\n $url = Router::url(array(\n 'controller' => 'users',\n 'action' => 'reset',\n ), true) . '/' . $id;\n \n $dataArry =array('url' => $url,\n 'name' =>$name, );\n // ============Email================//\n\n if ($emails) {\n $Email = new Email();\n $status = $Email->sendEmail($emails, 'forget password', 'reset_password', $dataArry);\n $emailSucces = 'Check Your Email To Reset your password';\n $this->set('successmsg', $emailSucces);\n $this->render('/Users/forget_password');\n } else {\n $errors = 'Please Provide Your Email Adress that You used to Register with Us';\n $this->set('errors', $errors);\n $this->render('/Users/forget_password');\n }\n }\n }\n\n \n $this->render('/Users/forget_password');\n }", "function forget_password($email)\n\t{\n\t $this->db->select('username,password');\n\t\t$this->db->from('es_admin');\n\t\t$this->db->where('email ', $email); \n\t\t$query = $this->db->get();\n\n\t\tif($query->num_rows() >0 ) \n\t\t{\n\t\t $pass_key\t= md5( $email .\"_\". time() );\n\t\t\t$this->update_pass_reset_key($email, $pass_key );\n\t\t \t$to = $email; \n\t\t\t$subject = 'Password Reset'; \n\t\t\t$message= 'To reset your password, click the link below:</br><a href=\"' . base_url().('password/reset/' . $pass_key ) . '\" >Reset admin Account Password.</a>'; \n\t\t\t$headers = \"MIME-Version: 1.0\" . \"\\r\\n\";\n\t\t\t$headers .= \"Content-type:text/html;charset=iso-8859-1\" . \"\\r\\n\";\n\t\t\t$headers .= 'From: <\"[email protected]\">' . \"\\r\\n\";\n\t\t\t$send = mail($to, $subject, $message,$headers);\n\n\t\t\treturn $msg = \"You should receive an email shortly.\";\n\t\t} \n\t\telse \n\t\t{\n\t\t\treturn $msg = \"There is no admin account associated with this email!\";\n\t\t}\n\t}", "public function testSendsPasswordResetEmail()\n {\n $user = factory(User::class)->create();\n $this->expectsNotification($user, ResetPassword::class);\n $response = $this->post('password/email', ['email' => $user->email]);\n $response->assertStatus(302);\n }", "function emailResetPasswordLink(){\r\n\t\tif(empty($_POST['Uemail'])){\r\n\t\t\t$this->HandleError(\"Email is empty!\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t$user_rec = array();\r\n\t\t\r\n\t\tif(false === $this->getUserFromEmail($_POST['Uemail'], $user_rec)){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tif(false === $this->sendResetPasswordLink($user_rec)){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}", "public function onUserResetPassword($event) \n {\n $event->user->notify(new NotifyUser($event->user, 'reset'));\n }", "public function resetconfirmation(Request $request) {\n $returnData = array();\n $response = \"OK\";\n $statusCode = 200;\n $result = null;\n $message = \"Confirmation resent.\";\n $isError = FALSE;\n $missingParams = null;\n\n $input = $request->all();\n $email = (isset($input['email'])) ? $input['email'] : null;\n\n if(!isset($email)) { $missingParams[] = \"email\"; }\n\n if(isset($missingParams)) {\n $isError = TRUE;\n $response = \"FAILED\";\n $statusCode = 400;\n $message = \"Missing parameters : {\".implode(', ', $missingParams).\"}\";\n }\n\n if(!$isError) {\n try {\n $user = User::where('email', $email)->first();\n if ($user->confirmationcode) {\n $confirmationcode = str_random(30);\n $user->confirmationcode = $confirmationcode;\n $user->save();\n\n\n if (env('APP_ENV', 'local') !== 'local') {\n Mail::send('emails.confirmation', ['confirmationcode'=>$confirmationcode], function($m) use ($user) {\n $m->from(env('MAIL_ADDRESS','[email protected]'), env('MAIL_NAME','Translator-gator'));\n $m->to($user->email, $user->username)->subject(env('MAIL_SUBJECT','Translator-gator Confirmation'));\n });\n }\n } else { throw new \\Exception(\"User with email $email already activated.\"); }\n\n } catch (\\Exception $e) {\n $response = \"FAILED\";\n $statusCode = 400;\n $message = $e->getMessage();\n }\n }\n\n $returnData = array(\n 'response' => $response,\n 'status_code' => $statusCode,\n 'message' => $message,\n 'result' => $result\n );\n\n return response()->json($returnData, $statusCode)->header('access-control-allow-origin', '*');\n }", "public static function confirmPasswordReset($email, $tempKey)\n {\n $isConfirmed = FALSE;\n $conn = new MySqlConnect();\n $dbEmail = null;\n $dbUserID = null;\n\n $result = $conn -> executeQueryResult(\"SELECT userID, emailAddress FROM users WHERE tempPassKey = '{$tempKey}' AND emailAddress = '{$email}'\");\n if (isset($result))\n {\n // use mysql_fetch_array($result, MYSQL_ASSOC) to access the result object\n if ($row = mysql_fetch_array($result, MYSQL_ASSOC))\n {\n // get the email in the db for the user with the corresponding\n // tempPassKey set\n $dbEmail = $row['emailAddress'];\n }\n }\n\n // compare the sent email to the email in db\n if ($email == $dbEmail)\n {\n session_start();\n $isConfirmed = TRUE;\n // put the userId in the SESSION variable for retrieval when saving the\n // new password to the db\n $_SESSION['userId'] = $row['userID'];\n }\n\n $conn -> freeConnection();\n return $isConfirmed;\n }", "public function email(){\n $input = Input::all();\n $rules = array(\n 'email' => 'required|email',\n );\n $validator = \\Validator::make($input, $rules);\n if ($validator->fails()) {\n return \\Redirect::to('auth/reset')->withInput()->withErrors($validator);\n }else{\n\n if($user = User::where('user_email',$input['email'])->first()){\n\n $data = array('email'=> $input['email'], 'name'=>'mohd aminuddin ali','provider_id'=> $user->provider_id );\n Mail::send('email.reset_password', ['name'=> $data['name'], 'email'=> $data['email'], 'provider_id'=>$data['provider_id'] ], function($message) use ($data){\n\n $message->to($data['email'], $data['name'])->subject('reset password');\n });\n return \\Redirect::to('auth/login')->with('title', 'Login');\n }\n\n Session::flash('alert-danger','This email is not register yet');\n return \\Redirect::to('auth/reset')->withInput()->withErrors($validator);\n\n }\n\n }", "public function execute()\n {\n $email = (string)$this->getRequest()->getParam('email');\n $params = $this->getRequest()->getParams();\n\n /** @var \\Magento\\Framework\\Controller\\Result\\Redirect $resultRedirect */\n $resultRedirect = $this->resultRedirectFactory->create();\n if (!empty($email) && !empty($params)) {\n // Validate received data to be an email address\n if (\\Zend_Validate::is($email, EmailAddress::class)) {\n try {\n $this->securityManager->performSecurityCheck(\n PasswordResetRequestEvent::ADMIN_PASSWORD_RESET_REQUEST,\n $email\n );\n } catch (SecurityViolationException $exception) {\n $this->messageManager->addErrorMessage($exception->getMessage());\n return $resultRedirect->setPath('admin');\n }\n /** @var $collection \\Magento\\User\\Model\\ResourceModel\\User\\Collection */\n $collection = $this->userCollectionFactory->create();\n $collection->addFieldToFilter('email', $email);\n $collection->load(false);\n\n try {\n if ($collection->getSize() > 0) {\n foreach ($collection as $item) {\n /** @var \\Magento\\User\\Model\\User $user */\n $user = $this->_userFactory->create()->load($item->getId());\n if ($user->getId()) {\n $newPassResetToken = $this->backendDataHelper->generateResetPasswordLinkToken();\n $user->changeResetPasswordLinkToken($newPassResetToken);\n $user->save();\n $this->notificator->sendForgotPassword($user);\n }\n break;\n }\n }\n } catch (\\Exception $exception) {\n $this->messageManager->addExceptionMessage(\n $exception,\n __('We\\'re unable to send the password reset email.')\n );\n return $resultRedirect->setPath('admin');\n }\n // @codingStandardsIgnoreStart\n $this->messageManager->addSuccess(__('We\\'ll email you a link to reset your password.'));\n // @codingStandardsIgnoreEnd\n $this->getResponse()->setRedirect(\n $this->backendDataHelper->getHomePageUrl()\n );\n return;\n } else {\n $this->messageManager->addError(__('Please correct this email address:'));\n }\n } elseif (!empty($params)) {\n $this->messageManager->addError(__('Please enter an email address.'));\n }\n $this->_view->loadLayout();\n $this->_view->renderLayout();\n }", "public function sendResetLink()\n {\n return $this->authService->sendPasswordResetLink(request()->input('email'));\n }", "public function actionResend()\n\t{\n\t\t$model = new ProfileForm;\n\t\t$model->load(Yii::app()->user->id);\n\n\t\t// If we don't have one on file, then someone the user got to a page they shouldn't have gotten to\n\t\t// Seamlessly redirect them back\n\t\tif ($model->getNewEmail() == NULL)\n\t\t\t$this->redirect(Yii::app()->user->returnUrl);\n\n\t\tif ($model->sendVerificationEmail())\n\t\t\tYii::app()->user->setFlash('success', Yii::t('ciims.controllers.Profile', 'A new verification email has been resent to {{user}}. Please check your email address.', array(\n\t\t\t\t'{{user}}' => $model->getNewEmail()\n\t\t\t)));\n\t\telse\n\t\t\tYii::app()->user->setFlash('error', Yii::t('ciims.controllers.Profile', 'There was an error resending the verification email. Please try again later.'));\n\n\t\t$this->redirect($this->createUrl('profile/edit'));\n\t}", "function recover_password()\n{\n if($_SERVER['REQUEST_METHOD']=='POST'){\n\n if(isset($_SESSION['token']) && $_POST['token']=== $_SESSION['token']){\n $email=clean($_POST['email']);\n if(email_exists($email)){\n $validation_code=md5($email . microtime());\n setcookie('temp_access_code',$validation_code,time()+900);\n $sql=\"UPDATE users SET validation_code='\".escape($validation_code).\"' WHERE email='\".escape($email).\"'\";\n $result=query($sql);\n $subject=\"Please reset your password\";\n $message=\" Here is your password reset code {$validation_code}\n Click here to reset your password http://localhost/code.php?email=$email&code=$validation_code\n \";\n $headers=\"From: [email protected]\";\n\n send_email($email,$subject,$message,$headers);\n\n\n set_message(\"<p class='bg-success text-center'>Please check your email or spam folder for a password reset code</p>\");\n redirect(\"index.php\");\n }else{\n echo validation_errors(\"This email does not exist\");\n }\n }else{\n redirect(\"index.php\");\n }//token checks\n if(isset($_POST['cancel_submit'])){\n redirect(\"login.php\");\n }\n }//post request\n}", "public function resetUserPassword()\n\t{\n\t\t# make the call to the API\n\t\t$response = App::make('ApiClient')->post('user/password?forgotten=true', Input::only('email'));\t\n\n\t\t# if the call was successful we'll want to give some feedback to the user\n\t\tif(isset($response['success'])) \n\t\t{\n\t\t\tSession::flash('success', $response['success']['data']);\n\t\t}\n\t\t# similarly if it failed, but this time also show the previous form data\n\t\telse {\n\t\t\t# save the API response to some flash data\n\t\t\tSession::flash('reset-errors', getErrors($response));\n\n\t\t\t# also flash the input so we can replay it out onto the reg form again\n\t\t\tInput::flash();\n\t\t}\t\t\n\n\t\t# ... and show the reset form again\n\t\treturn Redirect::to('forgotten-password');\n\t}", "public function setPasswordResetDatabaseTokenAndSendMail($email)\n {\n $email = trim($email);\n\n if (empty($email)) {\n $this->errors[] = MESSAGE_USERNAME_EMPTY;\n\n } else {\n // generate timestamp (to see when exactly the user (or an attacker) requested the password reset mail)\n // btw this is an integer ;)\n $temporary_timestamp = time();\n // generate random hash for email password reset verification (40 char string)\n $user_password_reset_hash = sha1(uniqid(mt_rand(), true));\n // database query, getting all the info of the selected user\n $select = $this->getUserData($email);\n\n // if this user exists\n if (isset($select[\"user_id\"])) {\n\n // database query:\n $update = $this->db->query(\n 'UPDATE users \n SET user_password_reset_hash = :user_password_reset_hash,\n user_password_reset_timestamp = :user_password_reset_timestamp \n WHERE user_email = :user_email',\n\n array(\n \"user_password_reset_hash\"=>$user_password_reset_hash,\n \"user_password_reset_timestamp\"=>$temporary_timestamp,\n \"user_email\"=>$email\n )\n );\n\n // check if exactly one row was successfully changed:\n if ($update == 1) {\n // send a mail to the user, containing a link with that token hash string\n $this->sendPasswordResetMail($select[\"user_name\"], $email, $user_password_reset_hash);\n return true;\n } else {\n $this->errors[] = MESSAGE_DATABASE_ERROR;\n }\n } else {\n $this->errors[] = MESSAGE_USER_DOES_NOT_EXIST;\n }\n }\n // return false (this method only returns true when the database entry has been set successfully)\n return false;\n }", "function resetPasswordRequest($email) {\n\t\tglobal $databaseConnect;\n\t\tglobal $databaseSelect;\n\t\tglobal $dbResult;\n\t\tglobal $dbCount;\n\t\tglobal $dbRow;\n\t\tglobal $resetResult;\n\t\t\n\t\t$dbResult = mysql_query('SELECT a.users_password FROM users a LEFT JOIN contacts b ON a.users_id = b.contacts_users_id WHERE b.contacts_email = \"'.addslashes($email).'\" AND a.users_active = 1',$databaseConnect);\n\t\t$dbRow = mysql_fetch_array($dbResult);\n\t\t$dbCount = mysql_num_rows($dbResult);\n\t\tif ($dbCount == 1) {\n\t\t\t$resetResult = $this->makePassword($dbRow['users_password']).'.'.md5($email);\n\t\t}\n\t\telse {\n\t\t\t$resetResult = false;\n\t\t}\n\t\t\n\t\treturn $resetResult;\n\t\n\t}", "function send_again()\n\t{\n\t\tif (!$this->tank_auth->is_logged_in(FALSE)) {\t\t\t\t\t\t\t// not logged in or activated\n\t\t\tredirect('/auth/login/');\n\n\t\t} else {\n\t\t\t$this->form_validation->set_rules('email', 'Email', 'trim|required|xss_clean|valid_email');\n\n\t\t\t$data['errors'] = array();\n\n\t\t\tif ($this->form_validation->run()) {\t\t\t\t\t\t\t\t// validation ok\n\t\t\t\tif (!is_null($data = $this->tank_auth->change_email(\n\t\t\t\t\t\t$this->form_validation->set_value('email')))) {\t\t\t// success\n\n\t\t\t\t\t$data['site_name']\t= config_item('company_name');\n\t\t\t\t\t$data['activation_period'] = config_item('email_activation_expire') / 3600;\n\n\t\t\t\t\t$this->_send_email('activate', $data['email'], $data);\n\t\t\t\t\t$this->session->set_flashdata('message', sprintf($this->lang->line('auth_message_activation_email_sent'), $data['email']));\n\t\t\t\t\t\tredirect('/auth/login');\n\t\t\t\t\t//$this->_show_message(sprintf($this->lang->line('auth_message_activation_email_sent'), $data['email']));\n\n\t\t\t\t} else {\n\t\t\t\t\t$errors = $this->tank_auth->get_error_message();\n\t\t\t\t\tforeach ($errors as $k => $v)\t$data['errors'][$k] = $this->lang->line($v);\n\t\t\t\t}\n\t\t\t}\n\t$this->load->module('layouts');\n\t$this->load->library('template');\n\t$this->template->title('Send Password - '.config_item('company_name'));\n\t$this->template\n\t->set_layout('login')\n\t->build('auth/send_again_form',isset($data) ? $data : NULL);\n\t\t}\n\t}", "public function forgot()\n\t{\n\t\t/**\n\t\t* Intilize Url class for post and get request\n\t\t**/\n\t\t$email = $this->url->post('mail');\n\t\t/** \n\t\t* Check submit is POST request \n\t\t* Validate input field\n **/\n\t\tif (!isset($_POST['forgot']) || !$this->validateForgot($email)) {\n\t\t\t$this->session->data['error'] = 'Warning: Please enter valid data in input box.';\n\t\t\t$this->url->redirect('forgot');\n\t\t}\n\n\t\t$token = $this->url->post('_token');\n\t\t$token_check = hash('sha512', TOKEN . TOKEN_SALT);\n\t\tif (hash_equals($token_check, $token) === false ) {\n\t\t\t$this->session->data['error'] = 'Warning: Invalid token. Please try again.';\n\t\t\t$this->url->redirect('forgot');\n\t\t}\n\n\t\t/** \n\t\t* If the user exists\n\t\t* Check his account and login attempts\n\t\t* Get user data \n **/\n\t\t$this->loginModel = new Login();\n\t\tif ($user = $this->loginModel->checkUserEmail($email)) {\n\t\t\t/** \n\t\t\t* Check Login attempt\n\t\t\t* The account is locked From too many login attempts \n **/\n\t\t\tif (!$this->checkLoginAttempts($email)) {\n\t\t\t\t$this->session->data['error'] = 'Warning: Your account has exceeded allowed number of login attempts. Please try again in 1 hour.';\n\t\t\t\t$this->url->redirect('forgot');\n\t\t\t} elseif ( $user['status'] != \"1\" ) {\n\t\t\t\t$data['hash'] = md5(uniqid(mt_rand(), true));\n\t\t\t\t$data['email'] = $email;\n\t\t\t\t$data['name'] = $user['name'];\n\t\t\t\t$this->loginModel->editHash($data);\n\t\t\t\t$this->forgotMail($data);\n\t\t\t\t$this->session->data['success'] = 'Success: Reset instruction sent to your E-mail address.';\n\t\t\t\t$this->url->redirect('login');\n\t\t\t} else {\n\t \t/** \n\t \t* If account is disabled by admin \n\t\t * Then Show error to user\n\t\t **/\n\t \t$this->session->data['success'] = 'Success: Your account has disabled by admin, For more info contact us.';\n\t \t$this->url->redirect('login');\n\t }\n\n\t\t\t/** \n\t\t\t* User exists now We check if\n\t\t\t* Send Mail to user for reset password\n **/\n\n\t\t} else {\n\t\t\t$this->session->data['error'] = 'Warning: Account does not exists.';\n\t\t\t$this->url->redirect('forgot');\n\t\t}\n\t}", "public function user_email_reset($email){\n\t \t$this->db->where('email', $email);\n\t \t$query = $this->db->get('users');\n\t \treturn $query->row_array();\n\t }", "public function confirmForget() {\n $user_id = $_GET['id'];\n $token = $_GET['token'];\n $userForgetConfirmed = $this->model->confirmTokenAfterForget($user_id, $token);\n\n if ($userForgetConfirmed) {\n $this->model->setFlash('success', 'Votre compte est à nouveau validé');\n // $_SESSION['flash']['success'] = 'Votre compte est à nouveau validé';\n header('location:index.php?controller=security&action=formReset');\n } else {\n $this->model->setFlash('danger', \"Ce token n'est plus valide\");\n // $_SESSION['flash']['danger'] = \"Ce token n'est plus valide\";\n header('location:index.php?controller=security&action=formLogin');\n }\n }", "public function resendActivateEmail($email)\n {\n // Trigger a request to reset the password in the API - this will return the activation token or\n // throw an exception\n try {\n $result = $this->apiClient->httpPost('/v2/users/password-reset', [\n 'username' => strtolower($email),\n ]);\n\n if (isset($result['activation_token'])) {\n return $this->sendAccountActivateEmail($email, $result['activation_token']);\n }\n } catch (ApiException $ex) {\n $this->getLogger()->err($ex->getMessage());\n }\n\n // If a proper reset token was returned, or the exception thrown was NOT account-not-activated then\n // something has gone wrong so return false - when using this function the account should existing\n // but be inactive so an exception of account-not-activated is the only \"valid\" outcome above\n return false;\n }", "public function confirm()\n {\n $this->confirmed = true;\n $this->confirmation_token = null;\n\n $this->save();\n }", "public function unconfirmedTask()\n\t{\n\t\t$xprofile = User::getInstance();\n\t\t$email_confirmed = $xprofile->get('activation');\n\n\t\t// Incoming\n\t\t$return = Request::getString('return', urlencode('/'));\n\n\t\t// Check if the email has been confirmed\n\t\tif ($email_confirmed == 1 || $email_confirmed == 3)\n\t\t{\n\t\t\tApp::redirect(urldecode($return));\n\t\t}\n\n\t\t// Check if the user is logged in\n\t\tif (User::isGuest())\n\t\t{\n\t\t\t$return = base64_encode(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller . '&task=' . $this->_task, false, true));\n\t\t\tApp::redirect(\n\t\t\t\tRoute::url('index.php?option=com_users&view=login&return=' . $return, false),\n\t\t\t\tLang::txt('COM_MEMBERS_REGISTER_ERROR_LOGIN_TO_CONFIRM'),\n\t\t\t\t'warning'\n\t\t\t);\n\t\t}\n\n\t\t// Set the pathway\n\t\t$this->_buildPathway();\n\n\t\t// Set the page title\n\t\t$this->_buildTitle();\n\n\t\t// Instantiate a new view\n\t\t$this->view\n\t\t\t->set('title', Lang::txt('COM_MEMBERS_REGISTER_UNCONFIRMED'))\n\t\t\t->set('email', $xprofile->get('email'))\n\t\t\t->set('return', $return)\n\t\t\t->set('sitename', Config::get('sitename'))\n\t\t\t->setErrors($this->getErrors())\n\t\t\t->display();\n\t}", "public function verifyEmail()\n {\n $this->verified = true;\n\n $this->save();\n\n $this->activationToken->delete();\n }", "public function sendEmailVerificationNotification()\n { \n \n $this->notify(new ConfirmEmail); \n \n }", "public function removeEmailConfirmToken()\n {\n $this->email_confirm_token = null;\n }", "public function sendEmailAction(Request $request)\n {\n $username = $request->request->get('username');\n\n $user = $this->userManager->findUserByUsernameOrEmail($username);\n\n $event = new GetResponseNullableUserEvent($user, $request);\n $this->eventDispatcher->dispatch(FOSUserEvents::RESETTING_SEND_EMAIL_INITIALIZE, $event);\n\n if (null !== $event->getResponse()) {\n return $event->getResponse();\n }\n\n if (null !== $user && !$user->isPasswordRequestNonExpired($this->retryTtl)) {\n $event = new GetResponseUserEvent($user, $request);\n $this->eventDispatcher->dispatch(FOSUserEvents::RESETTING_RESET_REQUEST, $event);\n\n if (null !== $event->getResponse()) {\n return $event->getResponse();\n }\n\n if (null === $user->getConfirmationToken()) {\n $user->setConfirmationToken($this->tokenGenerator->generateToken());\n }\n\n $event = new GetResponseUserEvent($user, $request);\n $this->eventDispatcher->dispatch(FOSUserEvents::RESETTING_SEND_EMAIL_CONFIRM, $event);\n\n if (null !== $event->getResponse()) {\n return $event->getResponse();\n }\n $mailer = $this->get('mailer');\n $resetLink = $request->getHost() . $this->generateUrl('fos_user_resetting_reset', [\n 'token' => $user->getConfirmationToken()\n ]);\n $message = (new \\Swift_Message('Reset password'))\n ->setFrom('[email protected]')\n ->setTo($user->getEmail())\n ->setBody(\n \"To reset your password click on this link $resetLink\"\n );\n\n $mailer->send($message);\n $this->addFlash('success', 'A password reset link has been sent , please check your mail');\n //$this->mailer->sendResettingEmailMessage($user);\n $user->setPasswordRequestedAt(new \\DateTime());\n $this->userManager->updateUser($user);\n\n $event = new GetResponseUserEvent($user, $request);\n $this->eventDispatcher->dispatch(FOSUserEvents::RESETTING_SEND_EMAIL_COMPLETED, $event);\n\n if (null !== $event->getResponse()) {\n return $event->getResponse();\n }\n }\n\n return new RedirectResponse($this->generateUrl('homepage'));\n }", "public function submit_forgot(){\n $this->form_validation->set_rules('email','Email ID','required|trim|xss_clean|valid_email');\n if($this->form_validation->run()==FALSE){\n $this->forgate_password();\n }else{\n $email = $this->input->post('email');\n //before mail check then send msg\n $result = $this->user_model->get_user($email);\n if ($result) {\n if ($result->RegisterType == 3) {\n $Email['name'] = $result->FirstName;\n $Email['msg_title'] = 'Reset password';\n $Email['temp_pass'] = sha1($result->UserName);\n $Email['temp_key'] = sha1('AppsInfotech@123');\n $message = $this->load->view('web/user/mail_msg/reset_password.php', $Email, true);\n $subject = 'New Generate Password';\n $this->customlib->send_exp_remider($email, $message, $subject);\n\n $this->session->set_flashdata('success_msg', 'Reset password link send.');\n redirect(site_url('forgot'));\n } else if ($result->RegisterType == 2) {\n $this->session->set_flashdata('danger_msg', 'Please login google');\n redirect(site_url('forgot'));\n } else if ($result->RegisterType == 1) {\n $this->session->set_flashdata('danger_msg', 'Please login facebook');\n redirect(site_url('forgot'));\n }\n } else {\n $this->session->set_flashdata('danger_msg', 'Enter Valid Email.');\n redirect(site_url('forgot'));\n }\n }\n }", "public function sendResetPasswordEmail()\n {\n $passwordReset = $this->generateResetPasswordToken();\n\n SendEmailJob::dispatch($this, 'forgot-password', 'Reset Your Password', ['props' => $passwordReset])->onQueue('account-notifications');\n }", "function verifyEmail($action = ''){\n\t\t//$url = ROOT_URI_UI.'validUser.php?k='.$this->secretKey($this->username).'&e='.$this->username;\n\n\t\t$url = $_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'].'?k='.$this->secretKey($this->username).'&e='.$this->username;\n\t\t\n\t\tif('recover' == $action){\n\t\t\t$msg = DICO_WORD_PASSWORD_RESTORE;\n\t\t}else{\n\t\t\t$msg = DICO_WORD_CONFIRM_EMAIL;\n\t\t}\n\t\t\n\t\t$body_message = DICO_MAIL_VALID_HEAD.'<br>'\n\t\t\t\t\t\t.'<a href=\"'.$url.'\">'.$msg.'</a><br><br>'\n\t\t\t\t\t\t.$url.'<br>'\n\t\t\t\t\t\t.DICO_MAIL_VALID_FOOT;\n\n\t\t\n\t\treturn send_mail(ROOT_EMAIL, $this->username, '', ROOT_EMAIL_NAME.' '.DICO_WORD_AUTH,$body_message);\n\t}", "public function emailCheck(Request $request){\n $this->validate($request,[\n 'email' => 'required|email|max:255',\n ]);\n $email = $request->email;\n $check_email = DB::select('select UserId,UserName from users where Email=? and UserRandomId=?',[$email,1]);\n if(count($check_email)>0){\n $id = $check_email[0]->UserId;\n $token = rand();\n DB::table('users')->where('UserId',$id)->update(['ApprovalStatus'=>$token]);\n $activation_url = url(\"/changepassword/\".$id.\",\".$token);\n $data = array('activation_url' => $activation_url);\n Mail::send('emailtemplates.forgotpassword',$data,function($message) use($email){\n $message->to($email,'')->subject('Please Reset your SWIMMIQ password');\n $message->from('[email protected]','SWIMMIQ');\n });\n $request->session()->flash('message.level','info');\n $request->session()->flash('message.content','Please Check your Email to reset your password');\n return redirect('forgotpassword');\n }\n else{\n $request->session()->flash('message.level', 'danger');\n $request->session()->flash('message.content', 'Please check your Email, Either the email not available in our database or Activation pending for the Email...');\n return redirect('forgotpassword');\n }\n }", "public function forgetpasswordAction() {\n \n $modelPlugin = $this->modelplugin();\n $dynamicPath = $modelPlugin->dynamicPath();\n $phpprenevt = $this->phpinjectionpreventplugin(); \n $mailplugin = $this->mailplugin();\n $jsonArray = $modelPlugin->jsondynamic();\n $email = $phpprenevt->stringReplace($_POST['eid']);\n $publisheremailarray = array('email' => $email);\n $chkemail = $modelPlugin->getpublisherTable()->selectEmail($publisheremailarray);\n $currentDatetime = strtotime(date(\"Y-m-d h:i:s\"));\n $restpassallow = 0;\n if ($chkemail[0]['forgetpassTimestamp']) {\n $databaseDatetime = strtotime($chkemail[0]['forgetpassTimestamp']);\n $all = $currentDatetime - $databaseDatetime;\n $day = round(($all % 604800) / 86400);\n $hours = round((($all % 604800) % 86400) / 3600);\n $m = round(((($all % 604800) % 86400) % 3600) / 60);\n\n if ($day <= 0) {\n if ($hours <= 0) {\n if ($m <= 15) {\n $restpassallow = 1;\n $contentone['minutes'] = 15 - $m;\n }\n }\n }\n }\n if (count($chkemail) == 0) {\n $contentone['data'] = 0;\n } else if ($restpassallow == 1) {\n $contentone['data'] = 2;\n } else {\n $id = $chkemail[0][\"publisherId\"];\n $pass1 = password_hash($email, PASSWORD_BCRYPT);\n $arraypass = str_replace('/', '', $pass1);\n $buttonclick = $dynamicPath . \"/Gallery/galleryview/resetpassword/\" . $arraypass;\n $mail_link = \"<a href='\" . $buttonclick . \"' style='background-color: #04ad6a; border: medium none; border-radius: 19px; padding: 12px; color: #fff; text-align: center; text-decoration: none; text-transform: uppercase;'>Click here</a>\";\n $subject = \"[Smartfanpage] Set your password\";\n $from = $jsonArray['sendgridaccount']['addfrom'];\n $keyArray = array('mailCatagory' => 'F_MAIL');\n $getMailStructure = $modelPlugin->getconfirmMailTable()->fetchall($keyArray);\n $getmailbodyFromTable = $getMailStructure[0]['mailTemplate'];\n $mailLinkreplace = str_replace(\"|MAILLINK|\", $mail_link, $getmailbodyFromTable);\n $mailBody = str_replace(\"|DYNAMICPATH|\", $dynamicPath, $mailLinkreplace);\n $fogetPasswordMail = $mailplugin->confirmationmail($email, $from, $subject, $mailBody);\n $keyArray = array('publisherId' => $id);\n $dataForForget = array('forgetpassword' => $arraypass, 'forgetpassTimestamp' => date(\"Y-m-d h:i:s\"));\n $contentone1 = $modelPlugin->getpublisherTable()->updateuser($dataForForget, $keyArray);\n $contentone['data'] = $contentone1;\n $user_session->loginId = ($_SESSION['loginId']);\n $user_session = new \\Zend\\Session\\Container('loginId');\n $user_session->getManager()->destroy();\n }\n echo json_encode($contentone);\n exit;\n }", "private function sendResetEmail($email, $token)\n\t{\n\t$user = DB::table('userschema.usermaster')->where('email_id', $email)->select('email_id', 'name')->first();\n\t\n\t//Generate, the password reset link. The token generated is embedded in the link\n\t return (new MailMessage)\n ->subject('Your Reset Password Subject Here')\n ->line('You are receiving this email because we received a password reset request for your account.')\n ->action('Reset Password', url('password/reset', $token))\n ->line('If you did not request a password reset, no further action is required.');\n//print_r($link);exit;\n\t\ttry {\n\t\t//Here send the link with CURL with an external email API \n\t\t\treturn true;\n\t\t} catch (\\Exception $e) {\n\t\t\treturn false;\n\t\t}\n\t}", "function verify_email()\n\t{\n\t\tlog_message('debug', 'Account/verify_email');\n\t\t$data = filter_forwarded_data($this);\n\t\t$data['msg'] = get_session_msg($this);\n\t\tlog_message('debug', 'Account/verify_email:: [1] post='.json_encode($_POST));\n\t\t# skip this step if the user has already verified their email address\n\t\tif($this->native_session->get('__email_verified') && $this->native_session->get('__email_verified') == 'Y'){\n\t\t\tredirect(base_url().'account/login');\n\t\t}\n\n\t\t# otherwise continue here\n\t\tif(!empty($_POST['emailaddress'])){\n\t\t\t$response = $this->_api->post('account/resend_link', array(\n\t\t\t\t'emailAddress'=>$this->native_session->get('__email_address'),\n\t\t\t\t'baseLink'=>base_url()\n\t\t\t));\n\n\t\t\t$data['msg'] = (!empty($response['result']) && $response['result']=='SUCCESS')?'The verification link has been resent':'ERROR: The verification link could not be resent';\n\t\t}\n\n\t\t$data = load_page_labels('sign_up',$data);\n\t\t$this->load->view('account/verify_email', $data);\n\t}", "public function check_reset_password(){\n if($this->model_users->email_exists($this->input->post('email'))){\n $this->form_validation->set_rules('email','Email','required|valid_email|trim');\n if($this->form_validation->run()){\n //generate Key\n $key=md5(uniqid());\n //get email\n urldecode($email=$this->input->post('email'));\n //insert into users\n\n if($this->model_users->insert_reset_key($key,$email)){\n $config = array(\n 'protocol'=>'smtp',\n 'smtp_host'=>'ssl://smtp.gmail.com',\n 'smtp_port'=>465,\n 'smtp_user'=>'[email protected]',\n 'smtp_pass'=>'temppassword',\n 'mailtype'=>'html',\n 'charset'=> 'iso-8859-1',\n 'wordwrap'=>TRUE\n );\n $this->load->library('email',$config);\n $this->load->model(\"model_users\");\n $this->email->set_newline(\"\\r\\n\");\n\n\n //send email to a user\n $this->email->from('[email protected]',\"Controllet Admin\");\n $this->email->to($this->input->post('email'));\n $this->email->subject(\"Reset your password.\");\n $message=\"<p>We are here to help you reset your account, please follow the instructions</p>\";\n $message.=\"<p><a href='\".base_url().\"Users/reset_password_function/$email/$key'>Click here</a> to reset your accounts password.</p>\";\n $this->email->message($message);\n if($this->email->send()){\n redirect('users/forgotten_password'.\"?emailsent=ok\");\n }else\n {\n redirect('users/forgotten_password'.\"?emailsent=bad\");\n }\n\n }\n else{\n redirect('users/forgotten_password'.\"?insertKey=bad\");\n }\n\n }else{\n redirect('users/forgotten_password'.\"?bad=ok\");\n }\n }else{\n redirect('users/forgotten_password'.\"?emailExists=bad\");\n }\n }", "public function forgotten_password() {\n $email = $this->input->post('email');\n if (!$this->users_model->fields(array('id'))->where('email', $email)->limit(1)->get()) {\n return $this->send_error('NOT_REGISTERED');\n }\n $this->load->helper('string');\n $this->load->library('email');\n $token = random_string('sha1');\n if (!$this->users_model->where('email', $email)->update(array('forgotten_password_code' => $token, 'forgotten_password_time' => time()))) {\n return $this->send_error('ERROR');\n }\n $this->email->from(config_item('email_from'), config_item('email_from_name'))\n ->to($email)\n ->subject('Passwrod reset | Go4Slam app')\n ->message('Hello, <br><br> Press the link below to set a new password. <br><br><a href=\"' . base_url() . 'user/reset_password/' . urlencode($email) . '/' . urlencode($token) . '\">Click here</a>')\n ->set_mailtype('html');\n if (!$this->email->send()) {\n return $this->send_error('UNABLE_TO_SEND_EMAIL');\n }\n return $this->send_success();\n }" ]
[ "0.82694083", "0.8205335", "0.81678516", "0.7703786", "0.7534456", "0.740942", "0.7174486", "0.71714264", "0.7149296", "0.7146564", "0.7123151", "0.7122646", "0.7075273", "0.70726126", "0.70519567", "0.7030401", "0.7010139", "0.69262695", "0.69105756", "0.6900558", "0.68847215", "0.6877404", "0.68743795", "0.6863809", "0.68592274", "0.68518895", "0.6838536", "0.68375635", "0.6826115", "0.6810048", "0.6805186", "0.68017197", "0.68016094", "0.6797232", "0.6771603", "0.67454064", "0.67403275", "0.67389596", "0.6737649", "0.67297995", "0.67204845", "0.6712273", "0.66941345", "0.6672223", "0.6660634", "0.6656435", "0.66549814", "0.66548187", "0.6641955", "0.66329896", "0.6623113", "0.66162044", "0.6615716", "0.6608564", "0.6590261", "0.65877986", "0.6577785", "0.6574747", "0.6572532", "0.65619135", "0.6559683", "0.6550965", "0.6545632", "0.65334415", "0.65315", "0.6531306", "0.652954", "0.6527309", "0.65252614", "0.6509999", "0.65071726", "0.6495633", "0.649539", "0.6488706", "0.6487179", "0.64775646", "0.64693034", "0.64614016", "0.64508575", "0.6424346", "0.64231527", "0.6414324", "0.6410452", "0.64012176", "0.63826", "0.6371329", "0.6369159", "0.6359287", "0.63571167", "0.63549656", "0.63457865", "0.63392234", "0.6337297", "0.63367015", "0.633522", "0.6331215", "0.6328517", "0.6318671", "0.63168675", "0.6314436", "0.63127196" ]
0.0
-1
Build a handler stack.
protected function getHandlerStack($app): HandlerStack { if (isset($app['guzzle_handler'])) { $handler = $app->raw('guzzle_handler'); $handler = is_string($app['guzzle_handler']) ? new $handler() : $handler; } else { $handler = Utils::chooseHandler(); } $handlerStack = HandlerStack::create($handler); $handlerStack->push(GuzzleMiddleware::retry($app['config']->get('http.max_retries', 1), $app['config']->get('http.retry_delay', 500)), 'retry'); $handlerStack->push(GuzzleMiddleware::log($app['logger'], $app['config']['http.log_template']), 'log'); return $handlerStack; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getHandlerStack()\n {\n\n $handlerStack = HandlerStack::create();\n\n foreach ($this->middleware as $name => $middleware) {\n $handlerStack->push($middleware, $name);\n }\n\n return $handlerStack;\n }", "public function getHandlerStack(): HandlerStack\n {\n if ($this->handlerStack) {\n return $this->handlerStack;\n }\n\n $this->handlerStack = HandlerStack::create($this->getGuzzleHandler());\n\n foreach ($this->middlewares as $name => $middleware) {\n $this->handlerStack->push($middleware, $name);\n }\n\n return $this->handlerStack;\n }", "public function make()\n {\n $app = $this->kernel;\n\n while ($this->queue->valid()) {\n $kernel = $this->queue->extract();\n $kernel->setKernel($app);\n $app = $kernel;\n }\n\n return new HttpStack($app);\n }", "private function initializeClientHandlerStack(array $config)\n {\n $stack = HandlerStack::create();\n\n // Adds the CodeMiddleware.\n $stack->push(new CodeMiddleware($config));\n\n return $stack;\n }", "public function push(HandlerStack $stack): HandlerStack\n {\n $stack->push(function (callable $handler) {\n return function (\n RequestInterface $request,\n array $options\n ) use ($handler) {\n if (isset($this->config['headers'])) {\n $lowercaseHeaders = array_change_key_case($this->config['headers']);\n if (isset($lowercaseHeaders['host'])) {\n $request = $request->withHeader('host', $lowercaseHeaders['host']);\n }\n }\n\n return $handler($request, $options);\n };\n }, 'hostForwarder_forward');\n\n return $stack;\n }", "public function __construct(HandlerStack $handlerStack)\n {\n $this->handlerStack = $handlerStack;\n }", "abstract protected function createHandler();", "private static function buildHandlersChain(array $handlers): HandlerInterface\n {\n if (empty($handlers)) {\n throw new BuilderException('Supplied handlers chain must contain at least one handler');\n }\n\n if (1 === count($handlers)) {\n return $handlers[0];\n }\n\n for ($i = 0, $iMax = count($handlers) - 1; $i < $iMax; $i++) {\n $handlers[$i]->setNext($handlers[$i + 1]);\n }\n\n return $handlers[0];\n }", "public function initRequestHandlers()\n {\n\n // initialize the storage for the request handlers\n $this->requestHandlers = new GenericStackable();\n\n // iterate over the applications and initialize a pool of request handlers for each\n foreach ($this->applications as $application) {\n // initialize the pool\n $pool = new GenericStackable();\n\n // initialize 10 request handlers per for each application\n for ($i = 0; $i < 10; $i++) {\n // create a mutex\n $mutex = \\Mutex::create();\n\n // initialize the request handler\n $requestHandler = new RequestHandler();\n $requestHandler->injectMutex($mutex);\n $requestHandler->injectValves($this->valves);\n $requestHandler->injectApplication($application);\n $requestHandler->start();\n\n // add it to the pool\n $pool[] = $requestHandler;\n }\n\n // add the pool to the pool of request handlers\n $this->requestHandlers[$application->getName()] = $pool;\n }\n }", "public function build()\n {\n if (!$this->isValid()) {\n return false;\n }\n\n $handlerData = $this->parseData($this->payload);\n $classExists = class_exists($handlerData->class);\n\n if (!$classExists) {\n return false;\n }\n\n $handler = new $handlerData->class($this->botManInstance, $this->bot, $handlerData->value);\n $methodExists = method_exists($handler, $handlerData->method);\n\n if (!$methodExists) {\n return false;\n }\n\n return $handler;\n }", "protected function build()\n {\n // Grab some files from the config settings\n $exchange = $this->exchange;\n $queue = $this->queue;\n $routingKey = $this->routingKey;\n\n\n // Determine the DLX queue info\n $dlxQueue = is_null($this->dlxQueue) ? $queue . '.dlx' : $this->dlxQueue;\n $dlxRoutingKey = is_null($this->dlxRoutingKey) ? 'dlx' : $this->dlxRoutingKey;\n\n // Build the Exchange\n $this->createExchange($exchange);\n\n // Build the Queues\n $this->createQueue($dlxQueue);\n $this->createQueue($queue, [\n 'x-dead-letter-exchange' => $exchange,\n 'x-dead-letter-routing-key' => $dlxRoutingKey,\n ]);\n\n // Bind the Queues to the Exchange\n $this->bind($dlxQueue, $exchange, $dlxRoutingKey);\n $this->bind($queue, $exchange, $routingKey);\n }", "protected function _initActionStack()\n\t{\n\t $actionStack = Zend_Controller_Action_HelperBroker::getStaticHelper('actionStack');\n\t\t// $actionStack->actionToStack(new Zend_Controller_Request_Simple('afficher', 'menu', 'default'));\n\t return $actionStack;\n\t}", "protected function resolve()\n {\n// $callStack = new CallStack;\n\n $executePattern = $this->route->getProperty('execute');\n\n /** @var ExecuteHandler[] $handlers */\n $handlers = array();\n\n $middlewares = array();\n\n $decorators = array();\n\n foreach ($this->route->getFullRoutes() as $route) {\n $group = $route->getGroup();\n\n foreach ($group->factory->getExecuteHandlers() as $handler)\n $handlers[get_class($handler)] = $handler;\n\n // stack all the handlers\n foreach ($group->getExecuteHandlers() as $name => $handler)\n $handlers[$name] = $handler;\n\n foreach ($group->getMiddlewares() as $middleware)\n $middlewares[] = new Call($this->resolveMiddleware($middleware[0]), $middleware[1]);\n// $callStack->addCallable($this->resolveMiddleware($middleware[0]), $middleware[1]);\n\n // append all route middlewares\n// foreach ($route->getProperty('middleware') as $middleware)\n// $middlewares[] = new Call($this->resolveMiddleware($middleware[0]), $middleware[1]);\n// $callStack->addCallable($this->resolveMiddleware($middleware[0]), $middleware[1]);\n\n foreach ($route->getStates() as $key => $value)\n $this->states[$key] = $value;\n\n foreach ($route->getFlags() as $flag)\n $this->flags[] = $flag;\n\n foreach ($route->getSerieses() as $key => $value) {\n if (!array_key_exists($key, $this->serieses))\n $this->serieses[$key] = array();\n\n foreach ($value as $v)\n $this->serieses[$key][] = $v;\n }\n\n foreach ($group->getDecorators() as $decorator)\n $decorators[] = new Call($this->resolveMiddleware($decorator));\n\n// foreach ($route->getDecorators() as $decorator)\n// $decorators[] = new Call($this->resolveMiddleware($decorator));\n\n // pass config.\n if ($config = $route->getProperty('config'))\n $this->config = array_merge($this->config, $config);\n }\n\n foreach ($handlers as $name => $class) {\n $handler = null;\n\n if (is_string($class)) {\n $handler = new $class;\n } else if (is_object($class)) {\n if ($class instanceof \\Closure) {\n $class($handler = new DynamicHandler());\n } else if ($class instanceof ExecuteHandler) {\n $handler = $class;\n }\n }\n\n if (!$handler || !is_object($handler) || !($handler instanceof ExecuteHandler))\n throw new InvalidArgumentException('Handler must be either class name, ' . ExecuteHandler::class . ' or \\Closure ');\n\n if ($handler->validateHandle($executePattern)) {\n $resolve = $handler->resolveHandle($executePattern);\n\n if (!is_callable($resolve))\n throw new \\Exedra\\Exception\\InvalidArgumentException('The resolveHandle() method for handler [' . get_class($handler) . '] must return \\Closure or callable');\n\n $properties = array();\n\n if ($this->route->hasDependencies())\n $properties['dependencies'] = $this->route->getProperty('dependencies');\n\n if (!$resolve)\n throw new InvalidArgumentException('The route [' . $this->route->getAbsoluteName() . '] execute handle was not properly resolved. ' . (is_string($executePattern) ? ' [' . $executePattern . ']' : ''));\n\n// $callStack->addCallable($resolve, $properties);\n\n return $this->createCallStack($middlewares, $decorators, new Call($resolve, $properties));\n\n// return $callStack;\n }\n }\n\n return null;\n }", "public function __construct(){\n\t\t$this->stack = array();\n\t}", "public function getMiddlewareStack() : array;", "protected function buildMessageStack($context)\n {\n $this->messageStack = new MessageStack();\n $this->messageStack->overwriteDefaultMessages($this->defaultMessages);\n\n foreach ([self::DEFAULT_CONTEXT, $context] as $currentContext) {\n if (isset($this->messageOverwrites[$currentContext])) {\n $this->messageStack->overwriteMessages($this->messageOverwrites[$currentContext]);\n }\n }\n\n return $this->messageStack;\n }", "private function setHandler($authorization)\n {\n $stack = new HandlerStack();\n\n $stack->setHandler(new CurlHandler());\n\n // Set authorization headers\n $this->authorization = $authorization;\n $stack->push(Middleware::mapRequest(function (Request $request) {\n return $request->withHeader('Authorization', $this->authorization);\n }), 'set_authorization_header');\n \n // Set the request ui\n $stack->push(Middleware::mapRequest(function (Request $request) {\n $uri = $request->getUri()->withHost($this->host)->withScheme($this->scheme);\n\n return $request->withUri($uri);\n }), 'set_host');\n\n return $stack;\n }", "public function __construct()\n {\n $this->stack = array();\n }", "public function menu_router_build()\n {\n return menu_router_build();\n }", "public function pushContext()\n {\n \\array_push($this->contextStack, $this->context);\n \\array_push($this->showStack, $this->showState);\n }", "protected function createStackDriver()\n {\n $determiners = (new Collection((array) $this->app['config']['localize-middleware']['driver']))\n ->filter(function ($driver) {\n return $driver !== 'stack';\n })\n ->map(function ($driver) {\n return $this->driver($driver)->setFallback(null);\n });\n\n return (new Determiners\\Stack($determiners))\n ->setFallback($this->app['config']['app']['fallback_locale']);\n }", "public static function make(array $event)\n {\n return isset($event['Records'][0]['messageId'])\n ? new QueueHandler\n : new CliHandler;\n }", "function build () {\n foreach ( $this->items as $item ) {\n if ( $item->isRoot() ) {\n $this->menu[]=$item;\n $this->appendChildren($item);\n }\n }\n reset ( $this->menu );\n }", "protected function _initActionStack()\n {\n $actionStack = Zend_Controller_Action_HelperBroker::getStaticHelper('actionStack');\n $actionStack->actionToStack(new Zend_Controller_Request_Simple('login', 'index', 'default'));\n return $actionStack;\n }", "public function pushStack($token) {}", "protected function buildRequestHandler()\n {\n return FormRequestHandler::create($this);\n }", "function __construct() {\n $this->dataStack = new SplStack();\n $this->minStack = new SplStack();\n }", "private function createHttpHandler()\n {\n $this->httpMock = new MockHandler();\n\n $handlerStack = HandlerStack::create($this->httpMock);\n $handlerStack->push(Middleware::history($this->curlHistory));\n\n $this->client = new Client(['handler' => $handlerStack]);\n\n app()->instance(Client::class, $this->client);\n }", "function build () {\n foreach ( $this->items as $item ) {\n if ( $item->id() == $this->current->id() ) {\n $this->menu[]=$item;\n $this->appendChildren();\n } else if ( $item->parent_id() == $this->current->parent_id() ) {\n $this->menu[]=$item;\n }\n }\n reset ( $this->menu );\n }", "private function packMenus()\n {\n $menus = include_once __DIR__ . '/elements/menus.php';\n if (!is_array($menus)) {\n $this->modx->log(modX::LOG_LEVEL_ERROR, 'Cannot build menus');\n } else {\n foreach ($menus as $menu) {\n $this->builder->putVehicle($this->builder->createVehicle($menu, [\n xPDOTransport::PRESERVE_KEYS => true,\n xPDOTransport::UPDATE_OBJECT => true,\n xPDOTransport::UNIQUE_KEY => 'text',\n xPDOTransport::RELATED_OBJECTS => true,\n xPDOTransport::RELATED_OBJECT_ATTRIBUTES => [\n 'Action' => [\n xPDOTransport::PRESERVE_KEYS => false,\n xPDOTransport::UPDATE_OBJECT => true,\n xPDOTransport::UNIQUE_KEY => ['namespace', 'controller']\n ]\n ]\n ]));\n $this->modx->log(modX::LOG_LEVEL_INFO, 'Packaged in ' . count($menus) . ' menus.');\n }\n }\n }", "public function testPushOrdering()\n {\n $one = function () {\n };\n $two = function () {\n };\n\n $stack = new MiddlewareStack();\n $this->assertCount(0, $stack);\n\n $stack->push($one);\n $this->assertCount(1, $stack);\n\n $stack->push($two);\n $this->assertCount(2, $stack);\n\n $this->assertSame($one, $stack->get(0));\n $this->assertSame($two, $stack->get(1));\n }", "protected function build()\n\t{\n\t}", "public static function make($stack = null)\n\t{\n\t\treturn new static($stack);\n\t}", "public function build(): SetMaxCallStackSizeToCaptureRequest\n\t{\n\t\t$instance = new SetMaxCallStackSizeToCaptureRequest();\n\t\tif ($this->size === null) {\n\t\t\tthrow new BuilderException('Property [size] is required.');\n\t\t}\n\t\t$instance->size = $this->size;\n\t\treturn $instance;\n\t}", "public function getHandlerData()\n {\n $uri = $this->request->getUri();\n $method = $this->request->getMethod();\n $searches = array_keys($this->patterns);\n $replaces = array_values($this->patterns);\n\n $this->routes = str_replace('//', '/', $this->routes);\n\n $routes = $this->routes;\n foreach ($routes as $pos => $route) {\n $curRoute = str_replace(['//', '\\\\'], '/', $route);\n if (strpos($curRoute, ':') !== false) {\n $curRoute = str_replace($searches, $replaces, $curRoute);\n }\n if (preg_match('#^' . $curRoute . '$#', $uri, $matched)) {\n\n if (isset($this->callbacks[$pos][$method])) {\n //remove $matched[0] as [1] is the first parameter.\n array_shift($matched);\n\n $this->currentRoute = $curRoute;\n $this->currentVars = $matched;\n\n return $this->getHandlerDetail($this->callbacks[$pos][$method], $matched);\n }\n }\n }\n\n return $this->getHandlerDetail($this->errorCallback, []);\n }", "abstract protected function registerHandlers();", "private function toStack($hook) {\n\t\t\t// if it open hook\n\t\t\tif(isset($this->openHooks[$hook]))\n\t\t\t\tarray_push($this->openStack, $hook);\n\t\t\t// if it close hook\n\t\t\telse\n\t\t\t\tarray_push($this->closeStack, $hook);\n\t\t}", "public function build()\n {\n $this->responseData = [\n 'data' => $this->getData(),\n 'meta' => $this->getMeta(),\n 'links' => $this->getLinks(),\n ];\n }", "public function getHandler();", "public function getHandler();", "protected function buildMenu() {\n// $structures = DataSource::factory(Structure::cls());\n// $structures->builder()\n// ->where(\"structure_id=0\")\n// ->order('priority');\n// /** @var Structure[] $aStructures */\n// $aStructures = $structures->findAll();\n// foreach ($aStructures as $oStructure) {\n// $menu->addLeftItem($oStructure->name, $oStructure->path);\n// $this->loadMenuItems($menu->findLeftItemByPath($oStructure->path), $oStructure);\n// }\n//\n// $view = new ViewMMenu();\n// $view->menu = $menu;\n// return $view;\n\n $ViewMainMenu = new ViewMainMenu($this->config['name']);\n $this->setMenuItems($ViewMainMenu->itemsList);\n $currentPath = explode('?', $this->Router->getRoute());\n $ViewMainMenu->currentPath = reset($currentPath);\n\n return $ViewMainMenu;\n }", "public function getHandler() {}", "public function push($value)\r\n {\r\n array_push($this->_stack, $value);\r\n return $this;\r\n }", "public function buildMenuTree()\n {\n $menu = new Menu\\Menu('menuTree');\n\n // Top level.\n $this->p1 = $menu->addItem(new Menu\\Item('p.1'));\n $this->p2 = $menu->addItem(new Menu\\Item('p.2'));\n\n // First level (p1).\n $this->c11 = $this->p1->addChild(new Menu\\Item('c.1.1'));\n $this->c12 = $this->p1->addChild(new Menu\\Item('c.1.2'));\n\n // First level (p2).\n $this->c21 = $this->p2->addChild(new Menu\\Item('c.2.1'));\n $this->c22 = $this->p2->addChild(new Menu\\Item('c.2.2'));\n $this->c23 = $this->p2->addChild(new Menu\\Item('c.2.3'));\n\n // Second level (c.1.1).\n $this->c111 = $this->c11->addChild(new Menu\\Item('c.1.1'));\n }", "public static function getHandlersQueue($init=true)\n\t{\n\t\tif ($init) {MHTTPD::$handlersQueue->init();}\n\t\treturn MHTTPD::$handlersQueue;\n\t}", "public function build() {}", "public function build() {}", "public function build() {}", "public function build();", "public function build();", "public function build();", "public function build();", "public function build();", "public function build();", "public function build();", "public static function handler(int $backoff = null, array $codes = null, HandlerStack $stack = null)\n {\n $stack = $stack ?: HandlerStack::create();\n\n $stack->push(Middleware::retry(function ($retries, RequestInterface $request, ResponseInterface $response = null, TransferException $exception = null) use ($codes) {\n return $retries < 3 && ($exception instanceof ConnectException || ($response && ($response->getStatusCode() >= 500 || in_array($response->getStatusCode(), $codes === null ? self::CODES : $codes, true))));\n }, function ($retries) use ($backoff) {\n return (int) pow(2, $retries) * ($backoff === null ? self::BACKOFF : $backoff);\n }));\n\n return $stack;\n }", "public function create (Application $app) {\n\n foreach ($this->handlers as $handlerset) {\n $this->addHandlerSetToApplication($app, $handlerset);\n }\n\n //$this->addApiAddedRoute($app);\n\n $this->addJsonParser($app);\n\n }", "protected function getHandlers()\n {\n return (fn () => $this->signalHandlers)\n ->call($this->registry);\n }", "public function createStackAction() {\n\n $request = reqBup::get('post');\n $response = new responseBup();\n\n /** @var backupLogModelBup $log */\n $log = $this->getModel('backupLog');\n\n if (!isset($request['files'])) {\n return;\n }\n\n $log->string(sprintf('Trying to generate a stack of %s files', count($request['files'])));\n\n $filesystem = $this->getModel()->getFilesystem();\n $filename = $filesystem->getTemporaryArchive($request['files']);\n\n if ($filename === null) {\n $log->string('Unable to create the temporary archive');\n $response->addError(langBup::_('Unable to create the temporary archive'));\n } else {\n $log->string(sprintf('Temporary stack %s successfully generated', $filename));\n $response->addData(array('filename' => $filename));\n }\n\n return $response->ajaxExec();\n }", "public function ProcessCustomHandlers (& $handlers = []);", "public function testGetHandlerDefinition()\n {\n $clientName = 'clientName';\n\n /** @var ContainerBuilder|ObjectProphecy $container */\n $container = $this->prophesize(ContainerBuilder::class);\n\n $middleware = ['test_middleware' => [\n ['method' => 'attach']\n ]];\n\n $handler = $this->subject->getHandlerDefinition($container->reveal(), $clientName, $middleware);\n\n // Test basic stuff\n $this->assertSame('%guzzle_http.handler_stack.class%', $handler->getClass());\n $this->assertSame(['%guzzle_http.handler_stack.class%', 'create'], $handler->getFactory());\n\n $methodCalls = $handler->getMethodCalls();\n // Count is the number of the given middleware + the default event and log middleware expressions\n $this->assertCount(3, $methodCalls);\n\n $customMiddlewareCall = array_shift($methodCalls);\n $this->assertSame('push', array_shift($customMiddlewareCall));\n /** @var Expression[] $customMiddlewareExpressions */\n $customMiddlewareExpressions = array_shift($customMiddlewareCall);\n $customMiddlewareExpression = array_shift($customMiddlewareExpressions);\n $this->assertInstanceOf(Expression::class, $customMiddlewareExpression);\n $this->assertSame('service(\"test_middleware\").attach()', $customMiddlewareExpression->__toString());\n\n $logMiddlewareCall = array_shift($methodCalls);\n $this->assertSame('push', array_shift($logMiddlewareCall));\n /** @var Expression[] $logMiddlewareExpressions */\n $logMiddlewareExpressions = array_shift($logMiddlewareCall);\n $logMiddlewareExpression = array_shift($logMiddlewareExpressions);\n $this->assertInstanceOf(Expression::class, $logMiddlewareExpression);\n $this->assertSame(\n 'service(\"guzzle_bundle.middleware.log.clientName\").log()',\n $logMiddlewareExpression->__toString()\n );\n\n $eventDispatchMiddlewareCall = array_shift($methodCalls);\n $this->assertSame('unshift', array_shift($eventDispatchMiddlewareCall));\n /** @var Expression[] $eventDispatchMiddlewareExpressions */\n $eventDispatchMiddlewareExpressions = array_shift($eventDispatchMiddlewareCall);\n $eventDispatchMiddlewareExpression = array_shift($eventDispatchMiddlewareExpressions);\n $this->assertInstanceOf(Expression::class, $eventDispatchMiddlewareExpression);\n $this->assertSame(\n 'service(\"guzzle_bundle.middleware.event_dispatch.clientName\").dispatch()',\n $eventDispatchMiddlewareExpression->__toString()\n );\n }", "public function __construct()\n {\n $this->propertyHandler = container_resolve(PropertyHandler::class, [$this]);\n $this->relationHandler = container_resolve(RelationHandler::class, [$this]);\n $this->actionHandler = container_resolve(ActionHandler::class, [$this]);\n }", "public abstract function build();", "public abstract function build();", "public function toStack(): Stack {\n $stack = new ArrayStack();\n foreach ($this->items as $item) {\n $stack->push($item);\n }\n return $stack;\n }", "private function build(iterable $stack, array $args = []) : array\n {\n $stackLength = count($stack);\n $building = [];\n\n while ($stackLength) {\n $item = $stack[--$stackLength];\n\n if ($item instanceof ReflectionClass && ! is_object(reset($args))) {\n $building[] = $this->container->invoke(\n $item->name,\n $this->container->has($item->name) && $this->container->isShared($item->name)\n ? $args\n : $this->extractFirst($args)\n );\n } elseif ($args) {\n $building[] = $this->extractFirst($args);\n }\n }\n\n return $building;\n }", "public function __construct()\n\t{\n\t\t$this->_stack = array();\n\t\t$this->setSeparator();\n\t}", "public function resolve()\n {\n if (!($prev = $this->handler)) {\n throw new \\LogicException('No handler has been specified');\n }\n\n ksort($this->stack);\n foreach ($this->stack as $stack) {\n foreach (array_reverse($stack) as $fn) {\n /** @var callable $fn */\n $prev = $fn($prev);\n }\n }\n\n return $prev;\n }", "public function merge()\n\t{\n\t\treturn new static(array_merge($this->stack, func_get_args()));\n\t}", "public function handler(string $handler): self\n {\n return $this->state(['handler' => $handler]);\n }", "public function build(array $config)\n {\n $breadcrumb = [];\n $this->registerServices($config, $breadcrumb);\n }", "public function addHandler(...$handlers)\n {\n array_push($this->handlers, ...$handlers);\n }", "protected function build()\n {\n $stockalign = new GtkAlignment(0, 0, 0, 0);\n $stockalign->add(\n GtkImage::new_from_stock(\n Gtk::STOCK_DIALOG_ERROR, Gtk::ICON_SIZE_DIALOG\n )\n );\n $this->pack_start($stockalign, false, true);\n\n\n $this->expander = new GtkExpander('');\n\n $this->message = new GtkLabel();\n $this->expander->set_label_widget($this->message);\n $this->message->set_selectable(true);\n $this->message->set_line_wrap(true);\n\n $this->userinfo = new GtkLabel();\n $this->userinfo->set_selectable(true);\n $this->userinfo->set_line_wrap(true);\n //FIXME: add scrolled window\n $this->expander->add($this->userinfo);\n\n $this->pack_start($this->expander);\n }", "protected static function getStackCache()\n {\n if (self::$stackCache == null) {\n //Folder save Cache response\n if (isset(self::$configApp['cacheHttp']) && isset(self::$configApp['cacheHttp']['folderCache'])) {\n $folderCache = self::$configApp['cacheHttp']['folderCache'];\n } else {\n $folderCache = __DIR__ . '/../../storage/cacheHttp';\n }\n //Create folder\n if (is_dir($folderCache) == false) {\n mkdir($folderCache, 0777, true);\n chmod($folderCache, 0777);\n }\n\n $localStorage = new Local($folderCache);\n $systemStorage = new FlysystemStorage($localStorage);\n $cacheStrategy = new PrivateCacheStrategy($systemStorage);\n\n $stack = HandlerStack::create();\n $stack->push(new CacheMiddleware($cacheStrategy), 'cache');\n self::$stackCache = $stack;\n }\n return self::$stackCache;\n }", "abstract function build();", "public function build() {\n\t\t$this->validate_input();\n\n\t\t$tree = $this->sql_tree;\n\n\t\t$pagination_info = $this->make_pagination_info();\n\n\t\tif (!$this->ignore_filtering) {\n\t\t\t$tree = $this->filter_transform->alter($tree, $pagination_info);\n\t\t}\n\t\t$tree = $this->sort_transform->alter($tree, $pagination_info);\n\t\tif (!$this->ignore_pagination) {\n\t\t\tif ($pagination_info instanceof PaginationInfoWithCount) {\n\t\t\t\t$num_rows = $pagination_info->get_row_count();\n\t\t\t}\n\t\t\telseif ($this->settings === null || $this->settings->get_total_rows() === null) {\n\t\t\t\tthrow new Exception(\"SQLBuilder->settings must contain the number of rows in order to paginate properly\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$num_rows = $this->settings->get_total_rows();\n\t\t\t}\n\n\t\t\t$pagination_info_with_count = new PaginationInfoWithCount($pagination_info, $num_rows);\n\t\t\t$tree = $this->pagination_transform->alter($tree, $pagination_info_with_count);\n\t\t}\n\n\t\t$creator = new PHPSQLCreator();\n\t\treturn $creator->create($tree);\n\t}", "public function build()\n {\n }", "private static function traverseRoutes() {\r\n\r\n\r\n\t\t$method = $_SERVER['REQUEST_METHOD'];\r\n\t\t$requested = $_SERVER['REQUEST_URI'];\r\n\t\t$path = $requested; // set our path to our request\r\n\t\t$path = explode('?',$path)[0]; // check for a query string. At zero index\r\n\t\t$path = strlen($path) > 1 ? rtrim($path,'/') : $path; //strip the slash at the end of the string (if its there). rtrim will take care of this automatically\r\n\t\t$parts = explode('/',$path);\r\n\t\t$parameters = array(); // Start traversal process. These are the parameters that we will pass\r\n\t\t$level = &self::$routes[$method]; // same as when we are registering. Grab a reference to our trunk\r\n\t\t\r\n\t\t// traverse the tree and determine if we have a valid route\r\n\t\treset($parts);\r\n\t\twhile(($part = current($parts)) !== false) {\r\n\r\n\t\t\tif(isset($level[$part])) { // found, now we move down one more level\r\n\t\t\t\t$level = &$level[$part];\r\n\t\t\t} elseif(isset($level['@'])) { // didn't find a defined, but we have a wild card. Go down this level\r\n\t\t\t\t$level = &$level['@'];\r\n\t\t\t\t$parameters[$level['name']] = urldecode($part);\r\n\t\t\t} else {\r\n\t\t\t\tthrow new RouteException($requested.' route not found');\r\n\t\t\t}\r\n\r\n\t\t\tnext($parts);\r\n\t\t}\r\n\r\n\t\t// we have reached the final level. Extract the required information and dig in \r\n\t\t$callback = $level['*'];\r\n\t\tif(is_callable($callback)) {\r\n\t\t\t$callback($parameters);\r\n\t\t} else {\r\n\t\t\t$callbackParts = explode('@', $callback);\r\n\t\t\t$class = 'App\\Controllers\\\\'.$callbackParts[0];\r\n\t\t\t$function = $callbackParts[1];\r\n\t\t\t$controller = new $class();\r\n\t\t\treturn $controller->{$function}($parameters);\r\n\t\t}\r\n\r\n\t}", "public function build(): SetAsyncCallStackDepthRequest\n\t{\n\t\t$instance = new SetAsyncCallStackDepthRequest();\n\t\tif ($this->maxDepth === null) {\n\t\t\tthrow new BuilderException('Property [maxDepth] is required.');\n\t\t}\n\t\t$instance->maxDepth = $this->maxDepth;\n\t\treturn $instance;\n\t}", "public function get_handler()\n {\n }", "function drush_module_builder_callback_build_module() {\n $commands = func_get_args();\n\n // Check settings before we start. This sort of wastes the potential of using\n // exceptions, but it's polite to warn the user of problems before they've\n // spent ages typing in all the hook names in interactive mode.\n // Get our task handler. This performs a sanity check on the environment which\n // throws an exception.\n try {\n $mb_task_handler_generate = \\DrupalCodeBuilder\\Factory::getTask('Generate', 'module');\n }\n catch (\\DrupalCodeBuilder\\Exception\\SanityException $e) {\n // If the problem is that the hooks need downloading, we can recover from this.\n if ($e->getFailedSanityLevel() == 'component_data_processed') {\n if (drush_confirm(dt('No hook definitions found. Would you like to download them now?'))) {\n // Download the hooks so we can move on.\n $success = drush_module_builder_callback_hook_download();\n if (!$success) {\n drush_set_error(DRUSH_APPLICATION_ERROR, 'Problem downloading hook data.');\n return;\n }\n\n // Get the task handler that we were trying to get in the first place.\n $mb_task_handler_generate = \\DrupalCodeBuilder\\Factory::getTask('Generate', 'module');\n }\n }\n // Otherwise, fail.\n else {\n drush_set_error(DRUSH_APPLICATION_ERROR, $e->getMessage());\n return;\n }\n }\n\n // Extra drush-specific component data info for the module component.\n // This defines command prefixes and drush options.\n // This gets merged with the component data info returned from the Module\n // generator.\n $component_info_drush_extra = array(\n 'root_name' => array(\n 'drush_value_process' => 'module_builder_drush_component_root_name_process',\n ),\n 'hooks' => array(\n 'command_prefix' => 'hooks',\n // The list is huge, so bypass showing the options.\n 'drush_no_option_list' => TRUE,\n ),\n 'module_hook_presets' => array(\n 'command_prefix' => 'presets',\n ),\n 'readable_name' => array(\n 'drush_option' => 'name',\n ),\n 'short_description' => array(\n 'drush_option' => 'desc',\n ),\n 'module_help_text' => array(\n 'drush_option' => 'helptext',\n ),\n 'module_dependencies' => array(\n 'drush_option' => 'dep',\n ),\n 'module_package' => array(\n 'drush_option' => 'package',\n ),\n 'permissions' => array(\n 'command_prefix' => 'perms',\n ),\n 'services' => array(\n 'command_prefix' => 'services',\n ),\n 'plugins' => array(\n 'command_prefix' => 'plugins',\n ),\n 'forms' => array(\n 'command_prefix' => 'forms',\n ),\n 'theme_hooks' => array(\n 'command_prefix' => 'theme',\n ),\n 'router_items' => array(\n 'command_prefix' => 'routes',\n ),\n );\n\n $component_data_extra = array();\n\n // Extra component data for the build list and the bare code options.\n // What to build.\n $build = drush_get_option('build');\n\n // write options:\n // - all -- everything we can do\n // - code -- code files, not info (module + install _ ..?)\n // - info -- only info fole\n // - module -- only module file\n // - install -- only install file\n // - ??? whatever hooks need\n\n // No build: set nice default.\n if (!$build) {\n // If we are adding, 'code' is implied\n if (drush_get_option('add')) {\n $build = 'code';\n }\n // If we are writing or going, all.\n elseif (drush_get_option(array('write', 'go'))) {\n $build = 'all';\n }\n // Otherwise, outputting to terminal: only module\n else {\n $build = 'code';\n }\n }\n\n // Make a list out of the build option string. This may of course have only\n // one item in it.\n $build_list = explode(' ', $build);\n\n // Multi build: set a single string to switch on below.\n if (count($build_list) > 1) {\n $build = 'code';\n }\n\n // Set the build list in the module data.\n // TODO: move all the above to a helper function!\n $component_data_extra['requested_build'] = array_fill_keys($build_list, TRUE);\n\n // The 'bare code' option. This doesn't fully work yet, as 'add' doesn't\n // fully work yet! TODO!\n $bare_code = drush_get_option('add');\n $component_data_extra['bare_code'] = $bare_code;\n\n // Insert the 'hooks' prefix into the commands array, after the module name.\n // This privileges the hooks: they don't need a prefix and all commands up to\n // another prefix are taken to be hooks.\n array_splice($commands, 1, 0, 'hooks:');\n\n // Call the main function to do the work of gathering data from the user and\n // building the files and optionally writing them.\n drush_module_builder_build_component($commands, 'module', $component_info_drush_extra, $component_data_extra);\n\n // Enable the module if requested.\n if (drush_get_option('go')) {\n pm_module_manage(array(array_shift($commands)), TRUE);\n }\n}", "abstract public function build();", "abstract public function build();", "public function __construct(RequestStack $stack) {\n $this->requestStack = $stack;\n }", "public static function build(array $config)\n {\n return Facades\\FSM::create($config);\n }", "public function getHandler()\n {\n }", "public function loadStack($index = null)\n {\n $this->registry = $this->dumpStack($index);\n return $this;\n }", "protected function build()\n {\n $this->global_variables = (new GlobalVariablesGenerator)->generate();\n }", "public function getHandlers()\n {\n return $this->handlers;\n }", "public function getActionStack ()\n {\n return $this->context->getActionStack();\n }", "public static function build(AuthInterface $handler) {\n\t\treturn new self($handler);\n\t}", "protected function getRequestStackService()\n {\n return $this->services['request_stack'] = new \\Symfony\\Component\\HttpFoundation\\RequestStack();\n }", "protected function getRequestStackService()\n {\n return $this->services['request_stack'] = new \\Symfony\\Component\\HttpFoundation\\RequestStack();\n }", "protected function getRequestStackService()\n {\n return $this->services['request_stack'] = new \\Symfony\\Component\\HttpFoundation\\RequestStack();\n }", "public function getHandlers() : array {\r\n return $this->handlers;\r\n }", "function createDevelopmentHandler() {\n\t\towa_coreAPI::setSetting('base', 'error_log_level', self::OWA_LOG_DEBUG );\n\t\t// make file logger\n\t\t$this->make_file_logger();\n\t\t// if the CLI is in use, makea console logger.\n\t\tif ( defined('OWA_CLI') ) {\n\t\t\n\t\t\t$this->make_console_logger();\n\t\t}\n\t\t\n\t\t\t\n\t\t$this->logPhpErrors();\n\t\t\n\t\tset_exception_handler( array($this, 'logException') );\n\t\t\n\t}", "protected function getMonolog_Handler_NestedService()\n {\n $this->services['monolog.handler.nested'] = $instance = new \\Monolog\\Handler\\StreamHandler(($this->targetDirs[2].'/logs/prod.log'), 100, true, NULL);\n\n $instance->pushProcessor(${($_ = isset($this->services['monolog.processor.psr_log_message']) ? $this->services['monolog.processor.psr_log_message'] : $this->getMonolog_Processor_PsrLogMessageService()) && false ?: '_'});\n\n return $instance;\n }", "public function getStack(){\r\n return $this->stack;\r\n }", "protected function build()\n {\n if ($this->relations) {\n $this->addRelational();\n }\n $this->loadSubQueries();\n }", "public function build() {\n\t\t$extender = $this->container->make(SidebarExtender::class);\n\n\t\t$this->menu->add(\n\t\t\t$extender->extendWith($this->menu)\n\t\t);\n\t}" ]
[ "0.6657721", "0.657692", "0.58712894", "0.5806797", "0.57198095", "0.5447057", "0.5444572", "0.5294282", "0.5230233", "0.5145153", "0.5119409", "0.50474495", "0.5041364", "0.5004163", "0.4949316", "0.49242017", "0.49010244", "0.48819548", "0.47930935", "0.4786927", "0.47708768", "0.47243837", "0.47017682", "0.46698582", "0.4649036", "0.46437964", "0.4637065", "0.4601073", "0.4581545", "0.45268613", "0.4523583", "0.45157447", "0.44956234", "0.44749725", "0.44709328", "0.44403902", "0.4415928", "0.44139323", "0.440176", "0.440176", "0.44012043", "0.438285", "0.43817332", "0.4373866", "0.43729267", "0.43637666", "0.43630347", "0.43630347", "0.43395078", "0.43395078", "0.43395078", "0.43395078", "0.43395078", "0.43395078", "0.43395078", "0.43395057", "0.43223462", "0.43122193", "0.43119618", "0.43001997", "0.42933497", "0.4292619", "0.42918384", "0.42918384", "0.42884925", "0.42870775", "0.42609018", "0.4259437", "0.42553926", "0.42498788", "0.4249498", "0.4241797", "0.4239007", "0.42350182", "0.42187282", "0.42129633", "0.4205133", "0.42016202", "0.41954494", "0.41928172", "0.41852677", "0.4183419", "0.4183419", "0.41813225", "0.41739705", "0.41738337", "0.41659805", "0.4164324", "0.41631627", "0.41628596", "0.41616598", "0.41614258", "0.41614258", "0.41614258", "0.41343957", "0.4126364", "0.4124558", "0.41219303", "0.41216785", "0.4119567" ]
0.6092302
2
Run the database seeds.
public function run() { // Remove Tudo quando é corrido Localization::truncate(); Localization::create([ 'event_id' => '1', 'localization' => 'Lisboa City', 'latitude' => '38.721711', 'longitude' => '-9.136848', 'hour' => '10:00' ]); Localization::create([ 'event_id' => '1', 'localization' => 'Fátima City', 'latitude' => '38.721711', 'longitude' => '-9.136848', 'hour' => '10:00' ]); Localization::create([ 'event_id' => '2', 'localization' => 'Lisboa City', 'latitude' => '38.721711', 'longitude' => '-9.136848', 'hour' => '10:00' ]); Localization::create([ 'event_id' => '2', 'localization' => 'Fátima City', 'latitude' => '38.721711', 'longitude' => '-9.136848', 'hour' => '10:00' ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Configures the current command.
protected function configure() { $this->setName('appconfig') ->setDescription('Create appserver.io Config') ->addArgument('application-name', InputOption::VALUE_REQUIRED, 'config application name') ->addArgument('namespace', InputOption::VALUE_REQUIRED, 'namespace for the project') ->addArgument('directory', InputOption::VALUE_REQUIRED, 'webapps root directory') ->addOption('routlt-version', 'rl', InputOption::VALUE_OPTIONAL, 'the routlt version to use', '~2.0'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function configure() {\n\n\t\tparent::configure();\n\t\t$this\n\t\t\t->setName( self::COMMAND_NAME )\n\t\t\t->setDescription( 'Just testing some command-running stuff' );\n\n\n\t}", "abstract public function configure(Command $command);", "protected function configure() {\n\n\t\t$this\n\t\t\t->setName( self::COMMAND_NAME )\n\t\t\t->setDescription( 'Executes a task file' )\n\t\t\t->addArgument(\n\t\t\t\tself::ARGUMENT_FILE,\n\t\t\t\tInputArgument::REQUIRED,\n\t\t\t\t'The task file to execute',\n\t\t\t\tnull\n\t\t\t)\n\t\t\t->addOption(\n\t\t\t\tself::OPTION_WP_DIR,\n\t\t\t\tnull,\n\t\t\t\tInputOption::VALUE_OPTIONAL,\n\t\t\t\t'WordPress directory',\n\t\t\t\tnull\n\t\t\t)\n\t\t\t->addOption(\n\t\t\t\tself::OPTION_WP_CLI,\n\t\t\t\tnull,\n\t\t\t\tInputOption::VALUE_OPTIONAL,\n\t\t\t\t'WP-CLI binary',\n\t\t\t\t'wp'\n\t\t\t);\n\t}", "protected function configure()\n {\n $this\n ->setName('command:again')\n ->addArgument('id', InputArgument::OPTIONAL, 'The command ID')\n ->setDescription('Re-execute a CLI command');\n }", "protected function configure()\n {\n $this->setName('configure')\n ->setDescription('Configure application and add necessary configs')\n ->addOption('cache_dir', 'd', InputOption::VALUE_OPTIONAL, 'Path to cache directory')\n\n ->addOption('chronos_url', 'u', InputOption::VALUE_OPTIONAL, 'The chronos url (inclusive port)', '')\n ->addOption('chronos_http_username', 'un', InputOption::VALUE_OPTIONAL, 'The chronos username (HTTP credentials)', '')\n ->addOption('chronos_http_password', 'p', InputOption::VALUE_OPTIONAL, 'The chronos password (HTTP credentials)', '')\n ->addOption('repository_dir', 'r', InputOption::VALUE_OPTIONAL, 'Root path to your job files', '')\n\n ->addOption('marathon_url', 'mu', InputOption::VALUE_OPTIONAL, 'The marathon url (inclusive port)', '')\n ->addOption('marathon_http_username', 'mun', InputOption::VALUE_OPTIONAL, 'The marathon username (HTTP credentials)', '')\n ->addOption('marathon_http_password', 'mp', InputOption::VALUE_OPTIONAL, 'The marathon password (HTTP credentials)', '')\n ->addOption('repository_dir_marathon', 'mr', InputOption::VALUE_OPTIONAL, 'Root path to the app files', '')\n ;\n }", "protected function configure() {\n $this\n ->setName('command:traitement')\n ->setDescription('Traitement des données Apidae');\n }", "protected function configure() {\n $this\n // the name of the command (the part after \"bin/console\")\n ->setName('admin:generar-clientes-prueba')\n\n // the short description shown while running \"php bin/console list\"\n ->setDescription('Crea clientes de manera aleatoria.')\n\n // the full command description shown when running the command with\n // the \"--help\" option\n ->setHelp(\"Crea clientes de manera aleatoria con un numero definido por el primer parametro\")\n ->addArgument('cantidad', InputArgument::REQUIRED, '¿Cuantos clientes?')\n ;\n }", "protected function configure()\n {\n\n // initialize the command with the required/optional options\n $this->setName(CommandNames::IMPORT_CREATE_OK_FILE)\n ->addArgument(InputArgumentKeysInterface::SHORTCUT, InputArgument::OPTIONAL, 'The shortcut that defines the operation(s) that has to be used for the import, one of \"create-ok-files\" or a combination of them', 'create-ok-files')\n ->setDescription('Create\\'s the OK file for the CSV files of the configured source directory');\n\n // invoke the parent method\n parent::configure();\n }", "protected function configure()\n {\n $this\n ->setName('config:open')\n ->setDescription('Opens the config')\n ->configureGlobal();\n }", "protected function configure()\n {\n $this->setName($this->command)->setDescription($this->text);\n\n $this->addArgument('name', InputArgument::REQUIRED, 'Name of the class');\n\n $optional = InputOption::VALUE_OPTIONAL;\n\n $this->addOption('path', null, $optional, 'Path for the file to be created', $this->path);\n\n $this->addOption('namespace', null, $optional, 'Namespace of the class', $this->namespace);\n\n $this->addOption('package', null, $optional, 'Name of the package', 'App');\n\n $author = 'Rougin Gutib <[email protected]>';\n\n $this->addOption('author', null, $optional, 'Name of the author', $author);\n }", "protected function configure()\n {\n $this\n ->setName('generate-container')\n ->setDescription('Generate container')\n ->addOption(\n 'mode',\n 'm',\n Input\\InputOption::VALUE_OPTIONAL,\n 'The mode (dev, live, test)',\n null\n )\n ->addOption(\n 'debug',\n 'd',\n Input\\InputOption::VALUE_NONE,\n 'Debug the container output'\n )\n ->addOption(\n 'dev-build',\n 'b',\n Input\\InputOption::VALUE_NONE,\n 'Build the database'\n );\n }", "protected function configure()\n {\n // with options '-c', '-p' (alias '--password'), '-h' (alias '--help')\n // looks like:\n // $ php index.php demons\n // $ php index.php demons -h\n $this->setName('demo')\n ->setDescription('Demo command shows example.')\n ->disableOptions();\n }", "protected function configure()\n {\n $this->setName('examplecommand:helloworld');\n $this->setDescription('ExampleCommandDescription');\n $this->addOption('name', null, InputOption::VALUE_REQUIRED, 'Your name:');\n }", "protected function configure()\n {\n $this\n ->setName('install')\n ->setDescription('Install October CMS.')\n ->addOption(\n 'force',\n null,\n InputOption::VALUE_NONE,\n 'Make the installer behave as if it is run for the first time. Existing files may get overwritten.'\n )\n ->addOption(\n 'php',\n null,\n InputOption::VALUE_OPTIONAL,\n 'Specify the path to a custom PHP binary',\n 'php'\n )\n ->addOption(\n 'templates-from',\n null,\n InputOption::VALUE_OPTIONAL,\n 'Specify from where to fetch template files (git remote)',\n ''\n );\n }", "protected function configure()\n\t{\n\t\t$this->setName( self::$defaultName );\n\t\t$this->setDescription( 'Initialize or update the Aimeos database tables' );\n\t\t$this->addArgument( 'site', InputArgument::OPTIONAL, 'Site for updating database entries', 'default' );\n\t\t$this->addArgument( 'tplsite', InputArgument::OPTIONAL, 'Template site for creating or updating database entries', 'default' );\n\t\t$this->addOption( 'option', null, InputOption::VALUE_REQUIRED, 'Optional setup configuration, name and value are separated by \":\" like \"setup/default/demo:1\"', [] );\n\t\t$this->addOption( 'q', null, InputOption::VALUE_NONE, 'Quiet (suppress output)', null );\n\t\t$this->addOption( 'v', null, InputOption::VALUE_OPTIONAL, 'Verbosity level', 'v' );\n\t}", "protected function configure()\n {\n // the short description shown while running \"php bin/console list\"\n $this->setDescription('Identification data process.')\n\n // the full command description shown when running the command with\n // the \"--help\" option\n ->setHelp('This command allows you to upload identification data...')\n\n // configure an argument\n ->addArgument('file', InputArgument::REQUIRED, 'The document file.')\n // ...\n ;\n }", "protected function configure()\n {\n $this->configurable();\n\n $this->setName('make:task')\n ->setDescription('Generates a task file with one task.')\n ->setDefinition([\n\n new InputArgument('taskfile', InputArgument::REQUIRED, 'The task file name'), \n \n new InputOption('frequency', 'f', InputOption::VALUE_OPTIONAL, 'The task\\'s frequency', $this->defaults['frequency']),\n new InputOption('constraint', 'c', InputOption::VALUE_OPTIONAL, 'The task\\'s constraint', $this->defaults['constraint']),\n new InputOption('in', 'i', InputOption::VALUE_OPTIONAL, 'The command\\'s path', $this->defaults['in']),\n new InputOption('run', 'r', InputOption::VALUE_OPTIONAL, 'The task\\'s command', $this->defaults['run']),\n new InputOption('description', 'd', InputOption::VALUE_OPTIONAL, 'The task\\'s description', $this->defaults['description']),\n new InputOption('type', 't', InputOption::VALUE_OPTIONAL, 'The task type', $this->defaults['type']),\n\n ])\n ->setHelp('This command makes a task file skeleton.');\n }", "protected function configure()\n {\n $this->setName('cache:clear')\n ->setDescription('Clear Application Caches');\n\n $this->addOption('folder', 'f', InputOption::VALUE_OPTIONAL, 'Cache Folder name');\n }", "protected function configure()\n {\n $this\n ->setName('init')\n ->setDescription('Initializes an objective-wp application')\n ->addArgument('type', InputArgument::REQUIRED, 'Options: plugin, enfold')\n ->addArgument('name', InputArgument::OPTIONAL, 'The name of the project (the directory)')\n ->addOption('dev', null, InputOption::VALUE_NONE, 'Installs the latest \"development\" release')\n ->addOption('force', 'f', InputOption::VALUE_NONE, 'Forces install even if the directory already exists');\n }", "protected function configure()\n {\n // command configuration\n $this->setName('cs:generate:group')\n ->setDescription('Create and register new group')\n ->addArgument('name', InputArgument::OPTIONAL, \"What's the group name?\")\n ->addArgument('locked', InputArgument::OPTIONAL, \"What's the group locked state?\")\n ->addArgument('expiration', InputArgument::OPTIONAL, \"What's the group expiration date?\")\n ->addArgument('roles', InputArgument::IS_ARRAY, \"What's the group roles?\");\n }", "protected function configure()\n {\n $this\n ->setName('demo:greet')\n ->setDescription('Greet someone')\n ->addArgument(\n 'name',\n InputArgument::OPTIONAL,\n 'Who do you want to greet?'\n )\n ->addOption(\n 'yell',\n null,\n InputOption::VALUE_NONE,\n 'If set, the task will yell in uppercase letters'\n );\n }", "protected function configure()\n {\n $this\n ->setName('snippet')\n ->setDescription('Grab your snippet files from ViperLab.')\n ->addOption('debug', null, InputOption::VALUE_NONE, 'Debug.')\n ->addOption('private-token', null, InputOption::VALUE_REQUIRED, 'Add your private token for ViperLab')\n ->addOption('project-id', null, InputOption::VALUE_REQUIRED, 'You must provide the Project ID for the file.')\n ->addOption('title', null, InputOption::VALUE_REQUIRED, 'You must provide the title for the file.')\n ->addOption('update', 'u', InputOption::VALUE_NONE, 'Update after install.');\n }", "protected function configure()\n {\n $this\n ->setDescription('Produce messages from console.')\n ->addArgument('message', InputArgument::REQUIRED, 'The message')\n ->addOption('--repeat', '-r', InputOption::VALUE_REQUIRED, 'How many times the message must be published. Useful for testing.')\n ->addOption('--base64', '-b', InputOption::VALUE_REQUIRED, 'Set value to \"1\" if the message is base64 encoded.')\n ;\n }", "protected function configure()\n {\n $this\n ->setName('check')\n ->setDescription('Check current for build or runtime')\n //->addOption('path', null, InputOption::VALUE_REQUIRED, 'Install on specific path', getcwd())\n ;\n }", "protected function configure()\n {\n $this\n ->setName('repo:switch')\n ->setAliases(['switch'])\n ->addOption('id', null, InputOption::VALUE_OPTIONAL, 'The ID of the repo to switch to')\n ->setDescription('Switch to a different repo context, you may optionally pass Repo Name');\n }", "protected function configure()\n {\n $this->setName('networking:initcms:install')\n ->setDescription(\n \"Install the Networking Init cms: create update schema, load fixtures, create super user, dump assetic resources\"\n )\n ->addOption('username', '', InputOption::VALUE_REQUIRED, 'username of the to be created super user')\n ->addOption('email', '', InputOption::VALUE_REQUIRED, 'the email address of the to be created super user')\n ->addOption('password', '', InputOption::VALUE_REQUIRED, 'password of the to be created super user');\n\n }", "protected function configure(): void\n {\n $this->setName('abc:check-cars')\n ->setDescription('Check all cars')\n ->addArgument('format', InputArgument::OPTIONAL, 'Progress format')\n ->addOption('option', null, InputOption::VALUE_NONE, 'Option description');\n }", "protected function configure()\n {\n $this\n // the name of the command (the part after \"bin/console\")\n ->setName('torrent:wget_file')\n ->setDescription('Récupère les fichiers sur le serveur');\n }", "protected function configure()\n {\n foreach ($this->getArguments() as $argument) {\n $this->addArgument($argument[0], $argument[1], $argument[2], $argument[3]);\n }\n\n foreach ($this->getOptions() as $option) {\n $this->addOption($option[0], $option[1], $option[2], $option[3], $option[4]);\n }\n }", "protected function configure() : void\n {\n $defaultBuildFolder = __DIR__ . self::DEFAULT_BUILD_FOLDER;\n $defaultResourceFolder = __DIR__ . self::DEFAULT_RESOURCES_FOLDER;\n\n $this\n ->setName('build')\n ->setDescription('The JSON source files and builds the INI files')\n ->addArgument('version', InputArgument::REQUIRED, 'Version number to apply')\n ->addOption('output', null, InputOption::VALUE_REQUIRED, 'Where to output the build files to', $defaultBuildFolder)\n ->addOption('resources', null, InputOption::VALUE_REQUIRED, 'Where the resource files are located', $defaultResourceFolder)\n ->addOption('coverage', null, InputOption::VALUE_NONE, 'Collect and build with pattern ids useful for coverage');\n }", "protected function configure()\n {\n $this->setName(static::NAME);\n $this->setDescription(static::DESCRIPTION);\n foreach (static::ARGUMENTS as $argment) {\n $this->addArgument(...$argment);\n }\n foreach (static::OPTIONS as $option) {\n $this->addOption(...$option);\n }\n $this->setHelperSet(new HelperSet([new QuestionHelper()]));\n }", "protected function configure(): void\n {\n $this\n ->setDescription('This command triggers ZgwToVrijbrpService->zgwToVrijbrpHandler() for a birth e-dienst')\n ->setHelp('This command allows you to test mapping and sending a ZGW zaak to the Vrijbrp api /dossiers')\n ->addOption('zaak', 'z', InputOption::VALUE_REQUIRED, 'The zaak uuid we should test with')\n ->addOption('source', 's', InputOption::VALUE_OPTIONAL, 'The location of the Source we will send a request to, location of an existing Source object')\n ->addOption('location', 'l', InputOption::VALUE_OPTIONAL, 'The endpoint we will use on the Source to send a request, just a string')\n ->addOption('mapping', 'm', InputOption::VALUE_OPTIONAL, 'The reference of the mapping we will use before sending the data to the source')\n ->addOption('synchronizationEntity', 'se', InputOption::VALUE_OPTIONAL, 'The reference of the entity we need to create a synchronization object');\n }", "protected function configure()\n {\n $this\n ->setName('generate')\n ->setDescription('Generate Licenses file from project dependencies.')\n ->addOption('hide-version', 'hv', InputOption::VALUE_NONE, 'Hide dependency version')\n ->addOption('csv', null, InputOption::VALUE_NONE, 'Output csv format');\n }", "protected function defineCommandOptions()\n {\n $this->addOption('all', 'A', InputOption::VALUE_NONE, \"List all defined globals settings\");\n\n $this->addArgument('key', InputArgument::OPTIONAL, \"Config param name\", null);\n $this->addArgument('value', InputArgument::OPTIONAL, \"If set, will set param [key] to this value\", null);\n\n }", "protected function configure()\n {\n $this->setName('build:project')\n ->setDescription('Generate configuration files for the project. Build the Codeception project.')\n ->addOption(\n \"upgrade\",\n 'u',\n InputOption::VALUE_NONE,\n 'upgrade existing MFTF tests according to last major release requiements'\n );\n $this->envProcessor = new EnvProcessor(TESTS_BP . DIRECTORY_SEPARATOR . '.env');\n $env = $this->envProcessor->getEnv();\n foreach ($env as $key => $value) {\n $this->addOption($key, null, InputOption::VALUE_REQUIRED, '', $value);\n }\n }", "protected function configure()\n {\n $this\n ->setName('iNachoLee:copiarcargas')\n ->setDefinition(array(\n new InputOption('accion', false, InputOption::VALUE_OPTIONAL, 'Preguntas Temporales')\n ))\n ->setDescription('Genera Slug y Linea de academica');\n }", "protected function configure()\n {\n $this\n ->setName(\"{$this->namespace}:{$this->method}\")\n ->setDescription($this->description)\n ->addArgument($this->argName, InputArgument::REQUIRED, 'The input string.')\n ->configureOptions();\n }", "protected function configure()\n {\n $this->setName( 'ezp_cookbook:myfistcommand' )->setDefinition(\n array(\n new InputArgument( 'contentId', InputArgument::REQUIRED, 'An existing content id' )\n )\n );\n }", "protected function configure(): void\n {\n parent::configure();\n\n $this->setName('data-fixture:import')\n ->setDescription('Import Data Fixtures')\n ->setHelp('The import command Imports data-fixtures')\n ->addOption('append', null, InputOption::VALUE_NONE, 'Append data to existing data.');\n\n if (null !== $this->purger) {\n $this->addOption(\n 'purge-with-truncate',\n null,\n InputOption::VALUE_NONE,\n 'Truncate tables before inserting data'\n );\n }\n }", "protected function configure()\n {\n $this->ignoreValidationErrors();\n\n $this->setName('make')\n ->setDescription('Make Lumen skeleton into the current project.')\n ->addOption('force', null, InputOption::VALUE_NONE, 'Overwrite any existing files.');\n }", "protected function configure()\n {\n $this\n ->setName('docs')\n ->setDescription('Open the Laravel docs')\n ->addArgument('version', InputArgument::OPTIONAL);\n }", "protected function configure()\n {\n $this\n ->setName('generate-container')\n ->setDescription('Generate container')\n ->addOption(\n 'services',\n 's',\n Input\\InputOption::VALUE_OPTIONAL,\n 'Use the specified services file to generate the container'\n );\n }", "protected function configure() {\n $this\n ->setName('import')\n ->setDescription(\n 'Import Dash Commands from yml'\n )\n ->addArgument(\n 'dbpath',\n InputArgument::REQUIRED,\n 'Path to library.dash. Usually /Users/x/Library/Application Support/Dash/library.dash'\n )\n ->addOption(\n 'file',\n NULL,\n InputOption::VALUE_REQUIRED,\n 'full path to file you want to import with extension'\n )\n ->addOption(\n 'backup',\n NULL,\n InputOption::VALUE_OPTIONAL,\n 'backup your existing dash database before doing the import',\n TRUE\n );\n }", "protected function configure()\n {\n // $this->addArguments(array(\n // new sfCommandArgument('my_arg', sfCommandArgument::REQUIRED, 'My argument'),\n // ));\n\n $this->addOptions(array(\n new sfCommandOption('application', null, sfCommandOption::PARAMETER_REQUIRED, 'The application name'),\n new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev'),\n new sfCommandOption('connection', null, sfCommandOption::PARAMETER_REQUIRED, 'The connection name', 'doctrine'),\n new sfCommandOption('idstart',null,sfCommandOption::PARAMETER_REQUIRED, 'The position to start the task', '1') \n // add your own options here\n ));\n $this->namespace = '';\n $this->name = 'set-tokens';\n $this->briefDescription = '';\n $this->detailedDescription = <<<EOF\nThe [set-tokens|INFO] task does things.\nCall it with:\n\n [php symfony set-tokens|INFO]\nEOF;\n }", "protected function configure()\n {\n $this->addDatabaseConfig();\n $this->addVariantConfig();\n $this->addOption(\n 'override',\n null,\n InputOption::VALUE_NONE,\n 'Allow overriding an existing database'\n );\n $this->addOption(\n 'wait',\n 'w',\n InputOption::VALUE_NONE,\n 'Wait for the server to be ready'\n );\n $this->addOption(\n 'migrate',\n null,\n InputOption::VALUE_NONE,\n \"Do not fail if the database exists, but perform a\\nmigration, instead\"\n );\n }", "protected function configure()\n {\n $this->setName('translate');\n $this->setDescription('Help translate language keys.');\n\n $this->addArgument('viewsPath', InputArgument::OPTIONAL, 'HTML views path.');\n $this->addArgument('langDir', InputArgument::OPTIONAL, 'Language directory.');\n $this->addArgument('langFile', InputArgument::OPTIONAL, 'Language file to use (defaults to `dashboard.php`)');\n }", "protected function configure()\n {\n assert(valid_num_args());\n\n $this\n ->setName('deploy')\n ->setDescription('Deploys the new repo.')\n ->setHelp('This command will pull new version, create release, and set to live');\n }", "protected function configure()\n {\n $this->setName('state:list')\n ->setDescription('List states of a stated class')\n ->addArgument(\n 'path',\n InputOption::VALUE_REQUIRED,\n 'Path of the stated class'\n );\n }", "public function configure()\n {\n $this->setName('reserve:all')\n ->setDescription('Generate backups of your folders and databases.')\n ->addOption('folders', 'f', InputOption::VALUE_NONE, 'Don\\'t include folders.')\n ->addOption('bzip', 'b', InputOption::VALUE_NONE, 'Use bzip to archive folders.')\n ->addOption('databases', 'd', InputOption::VALUE_NONE, 'Don\\'t include databases.')\n ->addOption('gzip', 'g', InputOption::VALUE_NONE, 'Use gzip to archive databases.')\n ->addOption('all', 'a', InputOption::VALUE_NONE, 'Dump all accessible databases in a single file.');\n }", "protected function configure()\n {\n $this->setName('update')\n ->setDescription('Install the ChromeDriver binary.')\n ->addArgument('version', InputArgument::OPTIONAL)\n ->addOption('all', null, InputOption::VALUE_NONE, 'Install a ChromeDriver binary for every OS');\n\n parent::configure();\n }", "protected function configure()\n {\n $this->setName('key:drop')\n ->setDescription('Drops registered key')\n ->setHelp(\"<comment>\\nDrops registered key.\\n</comment>\")\n ->addOption('storage', null, InputOption::VALUE_REQUIRED, 'Specify the storage of the key to delete', 'file');\n }", "protected function configure()\n {\n $this\n ->setName('calc')\n ->setDescription('calculate expression')\n ->addArgument('expression', InputArgument::REQUIRED, 'The expression to calculate')\n ;\n\n parent::configure();\n }", "protected function configure()\n {\n $this\n ->setName('install')\n ->setDescription('Install Laravel UI scaffolding')\n ->addArgument('preset', InputArgument::REQUIRED, 'Install the preset type')\n ->addOption('auth', null, InputOption::VALUE_NONE, 'Install authentication scaffolding');\n }", "protected function configure()\n {\n $this->setDescription('Sets the API settings on an instance.');\n $this->setHelp('Sets the API settings on an instance.');\n\n $this->addOption(\n 'instanceid',\n 'i',\n InputOption::VALUE_REQUIRED,\n 'The instanceid of the instance we are setting the property value for.'\n );\n\n $this->addArgument('settings', InputArgument::IS_ARRAY | InputArgument::REQUIRED, 'The API settings seperate values with spaces (in format key:value).');\n\n }", "protected function configure()\n {\n $this->setDefinition([\n new InputArgument('name', InputArgument::OPTIONAL, 'A setting name'),\n new InputOption('domain', null, InputOption::VALUE_REQUIRED, 'Displays settings for a specific domain'),\n new InputOption('domains', null, InputOption::VALUE_NONE, 'Displays all configured domains'),\n new InputOption('tag', null, InputOption::VALUE_REQUIRED, 'Shows all settings with a specific tag'),\n ])->setDescription('Displays current settings for an application')->setHelp(<<<'EOF'\nThe <info>%command.name%</info> command displays all available settings:\n\n <info>php %command.full_name%</info>\n\nUse the <info>--domains</info> option to display all configured domains:\n\n <info>php %command.full_name% --domains</info>\n\nDisplay settings for a specific domain by specifying its name with the <info>--domain</info> option:\n\n <info>php %command.full_name% --domain=default</info>\n\nFind all settings with a specific tag by specifying the tag name with the <info>--tag</info> option:\n\n <info>php %command.full_name% --tag=foo</info>\n\nEOF\n );\n }", "protected function configure()\n {\n parent::configure();\n\n $this->setName('doctrine:phpcr:jackrabbit')\n ->addArgument('cmd', InputArgument::REQUIRED, 'Command to execute (start | stop | status)')\n ->addOption('jackrabbit_jar', null, InputOption::VALUE_OPTIONAL, 'Path to the Jackrabbit jar file')\n ->setDescription('Start and stop the Jackrabbit server')\n ->setHelp(<<<EOF\nThe <info>phpcr:jackrabbit</info> command allows to have a minimal control on the Jackrabbit server from within a\nSymfony 2 command.\n\nIf the <info>jackrabbit_jar</info> option is set, it will be used as the Jackrabbit server jar file.\nOtherwise you will have to set the doctrine_phpcr.jackrabbit_jar config parameter to a valid Jackrabbit\nserver jar file.\nEOF\n);\n }", "protected function configure()\n {\n $this\n ->setName('cache:clear')\n ->setDescription('Clears the caches');\n }", "protected function configure()\n {\n $this->setName('tangoman:privileges')\n ->setDescription('Creates default privileges');\n }", "protected function configure()\n {\n $this\n ->setName('new')\n ->setDescription('Create a new Bolt installation.')\n ->addArgument('name', InputArgument::REQUIRED);\n }", "protected function configure()\n\t{\n\t\t$this\n\t\t\t->setName('cache:clear')\n\t\t\t->setDescription('Clears cache for your machine \"Space Station\"!');\n\t}", "protected function configure() {\n // $this->addArguments(array(\n // new sfCommandArgument('my_arg', sfCommandArgument::REQUIRED, 'My argument'),\n // ));\n\n $this->addOptions(array(\n new sfCommandOption('application', null, sfCommandOption::PARAMETER_REQUIRED, 'The application name'),\n new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev'),\n new sfCommandOption('connection', null, sfCommandOption::PARAMETER_REQUIRED, 'The connection name', 'propel'),\n // add your own options here\n ));\n\n $this->namespace = 'u';\n $this->name = 'build-all';\n $this->briefDescription = '';\n $this->detailedDescription = <<<EOF\nThe [export-orders|INFO] task does things.\nCall it with:\n\n [php symfony u:build-all|INFO]\nEOF;\n }", "protected function configure()\n {\n $this->setName('worker/process')\n ->setHidden(true)\n ->setDescription('Runs a given worker')\n ->setDefinition(new InputDefinition([\n new InputOption('config', 'c', InputOption::VALUE_REQUIRED, 'A YAML configuration file'),\n new InputOption('jobId', null, InputOption::VALUE_REQUIRED, 'A Job UUID'),\n new InputOption('name', null, InputOption::VALUE_REQUIRED, 'The queue name to work with. Defaults to `default`.'),\n ]));\n }", "protected function configure()\n\t{\n\t\t$this\n\t\t\t->setName('user:activate')\n\t\t\t->setDescription($this->language->lang('CLI_DESCRIPTION_USER_ACTIVATE'))\n\t\t\t->setHelp($this->language->lang('CLI_HELP_USER_ACTIVATE'))\n\t\t\t->addArgument(\n\t\t\t\t'username',\n\t\t\t\tInputArgument::REQUIRED,\n\t\t\t\t$this->language->lang('CLI_DESCRIPTION_USER_ACTIVATE_USERNAME')\n\t\t\t)\n\t\t\t->addOption(\n\t\t\t\t'deactivate',\n\t\t\t\t'd',\n\t\t\t\tInputOption::VALUE_NONE,\n\t\t\t\t$this->language->lang('CLI_DESCRIPTION_USER_ACTIVATE_DEACTIVATE')\n\t\t\t)\n\t\t\t->addOption(\n\t\t\t\t'send-email',\n\t\t\t\tnull,\n\t\t\t\tInputOption::VALUE_NONE,\n\t\t\t\t$this->language->lang('CLI_DESCRIPTION_USER_ADD_OPTION_NOTIFY')\n\t\t\t)\n\t\t;\n\t}", "protected function configure()\n {\n $this\n ->setName('permissions')\n ->setDescription('Set the permissions of a kServer project')\n ->addArgument('name', InputArgument::REQUIRED, 'The name of the project');\n }", "protected function configure()\n {\n $this->setName('swissup:theme:create')\n ->setDescription('Create Local Swissup theme')\n ->addArgument('name', InputArgument::REQUIRED, 'Put the theme name you want to create (Local/argento-stripes)')\n ->addArgument('parent', InputArgument::REQUIRED, 'Put the parent short theme name (stripes)');\n\n $this->addOption(\n 'css',\n null,\n InputOption::VALUE_OPTIONAL,\n 'Should I create custom css?',\n false\n );\n\n parent::configure();\n }", "protected function configure()\n {\n // $this->addArguments(array(\n // new sfCommandArgument('my_arg', sfCommandArgument::REQUIRED, 'My argument'),\n // ));\n\n $this->addOptions(array(\n new sfCommandOption('application', null, sfCommandOption::PARAMETER_REQUIRED, 'The application name', 'declarvin'),\n new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev'),\n new sfCommandOption('connection', null, sfCommandOption::PARAMETER_REQUIRED, 'The connection name', 'default'),\n // add your own options here\n ));\n\n $this->namespace = 'debug';\n $this->name = 'DRM';\n $this->briefDescription = '';\n $this->detailedDescription = <<<EOF\n\nEOF;\n }", "protected function configure()\n {\n // $this->addArguments(array(\n // new sfCommandArgument('my_arg', sfCommandArgument::REQUIRED, 'My argument'),\n // ));\n\n $this->addOptions(array(\n new sfCommandOption('application', null, sfCommandOption::PARAMETER_REQUIRED, 'The application name'),\n new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev'),\n new sfCommandOption('connection', null, sfCommandOption::PARAMETER_REQUIRED, 'The connection name', 'doctrine'),\n // add your own options here\n ));\n\n $this->namespace = '';\n $this->name = 'cleanAuthor';\n $this->briefDescription = '';\n $this->detailedDescription = <<<EOF\nThe [cleanAuthor|INFO] task does things.\nCall it with:\n\n [php symfony cleanAuthor|INFO]\nEOF;\n }", "protected function defineCommandOptions(){}", "protected function configure()\n {\n // $this->addArguments(array(\n // new sfCommandArgument('my_arg', sfCommandArgument::REQUIRED, 'My argument'),\n // ));\n\n $this->addOptions(array(\n new sfCommandOption('application', null, sfCommandOption::PARAMETER_REQUIRED, 'The application name'),\n new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev'),\n new sfCommandOption('connection', null, sfCommandOption::PARAMETER_REQUIRED, 'The connection name', 'doctrine'),\n // add your own options here\n ));\n\n $this->namespace = 'game';\n $this->name = 'srv';\n $this->briefDescription = '';\n $this->detailedDescription = <<<EOF\nThe [game:srv|INFO] task does things.\nCall it with:\n\n [php symfony game:srv|INFO]\nEOF;\n }", "protected function configure()\n {\n parent::configure();\n $this->setName('create')\n ->setDescription('Creates a checksum file for use in verifying package integrity')\n ->addOption('path', null, InputOption::VALUE_OPTIONAL, 'The path to the package to create checksum file for');\n }", "protected function configure()\n {\n $this\n ->setName('tc:cache:refresh-adslots')\n ->setDescription('Create initial ad slot cache if needed to avoid slams')\n ->addOption(\n 'publisher',\n 'p',\n InputOption::VALUE_OPTIONAL,\n 'The publisher\\'s id for updating all own ad slots'\n );\n }", "protected function configure()\n {\n $this\n ->setName('jump')\n ->addArgument('name', InputArgument::OPTIONAL, 'The name of the jumpbox')\n ->setDescription('Create a new jumpbox for accessing private databases');\n }", "protected function configure()\n {\n $this->setName('scaledown')\n ->setDescription(\"Remove the latest host from a service.\")\n ->addArgument('service', InputArgument::REQUIRED);\n }", "protected function configure()\n {\n $this\n ->setName('laravel')\n ->setDescription('Quickstart a new Laravel application')\n ->addArgument('name', InputArgument::REQUIRED)\n ->addOption('force', 'f', InputOption::VALUE_NONE, 'Forces install even if the directory already exists');\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->command_name = config(\"custom-commands.command_name\");\n\n parent::__construct($this->signature = $this->command_name);\n\n $this->commands = (array) config(\"custom-commands.commands\");\n \n $this->table = config(\"custom-commands.table\");\n\n $this->row = config(\"custom-commands.row\");\n\n $this->changeEnv = (boolean) config(\"custom-commands.change_env\");\n\n }", "protected function configure()\n {\n $this->setDescription('This command verifies and summarizes current configuration');\n }", "protected function configure()\n {\n $this->setDescription('Send a notification to a user')\n ->setHelp('This command allows you to send a notification to a user');\n $this->addArgument('subject', InputArgument::REQUIRED, 'Add notification subject');\n $this->addArgument('message', InputArgument::REQUIRED, 'Add notification message');\n $this->addArgument('type', InputArgument::REQUIRED, 'Specify notification type');\n $this->addArgument('username', InputArgument::REQUIRED, 'Specify user to whom this notification will be sent to');\n }", "protected function configure()\n {\n $this->setName('consult:question:classification:queue')\n ->setDescription('Queue to assign new questions to doctors')\n ->addArgument('domain', InputArgument::OPTIONAL, 'Consult Domain', 'https://consult.practo.com');\n }", "protected function configure()\n {\n $this\n ->setName('import:random')\n ->setDescription('Imports random data')\n ->addArgument('iterations', InputArgument::OPTIONAL, 'Amount of iterations', 1)\n ;\n }", "protected function configure()\n {\n $this->addArgument('name', InputArgument::REQUIRED, 'The name of the created component.');\n $this->addOption(\n 'force', 'f', InputOption::VALUE_NONE, \n 'If the component already exists its forced to the overrided.'\n );\n $this->addOption(\n 'constructor', 'c', InputOption::VALUE_NONE,\n 'Creates the new class with its constructor already defined.'\n );\n\n foreach ($this->options() as $opt) {\n $this->addOption(...$opt);\n }\n foreach ($this->arguments() as $arg) {\n $this->addArgument(...$arg);\n }\n }", "protected function configure()\r\n {\r\n $this->addArguments(array(\r\n new sfCommandArgument('theme', sfCommandArgument::REQUIRED, 'Theme to create'),\r\n ));\r\n\r\n $this->addOptions(array(\r\n \r\n // add your own options here\r\n ));\r\n\r\n $this->namespace = 'compass';\r\n $this->name = 'watch';\r\n $this->briefDescription = 'Change triggered automatic compilation of a compass project';\r\n $this->detailedDescription = <<<EOF\r\nThe [compass:watch|INFO] task does things.\r\nCall it with:\r\n\r\n [php symfony compass:watch|INFO]\r\nEOF;\r\n }", "protected function configure()\n {\n $this->setDescription('Deletes an App class or directory.');\n $this->setHelp('Deletes an App class or directory.');\n $this->addOption(\n 'type',\n 't',\n InputOption::VALUE_REQUIRED,\n 'The type we are deleting, eg: class or directory.',\n null\n );\n $this->addArgument('name', InputArgument::REQUIRED, 'The path to the file or directory (this is realative to the APP folder).');\n $this->addArgument('newName', InputArgument::REQUIRED, 'The new path to the file or directory (this is realative to the APP folder).');\n\n }", "protected function configure()\n {\n $this->ignoreValidationErrors();\n\n $this->setName('run')\n ->setDescription('Run an Envoy task.')\n ->addArgument('task', InputArgument::REQUIRED)\n ->addOption('continue', null, InputOption::VALUE_NONE, 'Continue running even if a task fails')\n ->addOption('pretend', null, InputOption::VALUE_NONE, 'Dump Bash script for inspection')\n ->addOption('path', null, InputOption::VALUE_REQUIRED, 'The path to the Envoy.blade.php file')\n ->addOption('conf', null, InputOption::VALUE_REQUIRED, 'The name of the Envoy file', 'Envoy.blade.php');\n }", "protected function configure()\n {\n $this\n ->setName('train:pdo')\n ->setDescription('Train the classifier with a PDO query')\n ->configureIndex()\n ->addArgument(\n 'category',\n Input\\InputArgument::REQUIRED,\n 'Which category this data is'\n )\n ->addArgument(\n 'column',\n Input\\InputArgument::REQUIRED,\n 'Which column to select'\n )\n ->addArgument(\n 'query',\n Input\\InputArgument::REQUIRED,\n 'The query to run'\n )\n ->addArgument(\n 'dsn',\n Input\\InputArgument::REQUIRED,\n 'The dsn to use'\n )\n ->addArgument(\n 'username',\n Input\\InputArgument::OPTIONAL,\n 'The username to use'\n )\n ->addArgument(\n 'password',\n Input\\InputArgument::OPTIONAL,\n 'The password to use'\n )\n ->configureClassifier()\n ->configurePrepare();\n }", "protected function configure()\n {\n $this\n ->setDescription('Bounce mail handling MDA for fetchmail')\n ->addArgument(\n 'rawmailsource',\n InputArgument::OPTIONAL,\n 'Raw mail source'\n );\n }", "protected function configure()\n {\n $this->setName('buktopuha:questionbot')\n ->setDescription('Endless process that monitors time and asks questions')\n ->setTimeout(1);\n }", "protected function configure()\n {\n parent::configure();\n $this\n ->setName('zig:task:execute')\n ->addOption('id', null, InputOption::VALUE_REQUIRED, 'Task ID', false)\n ->setHelp(<<<EOT\nThe <info>zig:tastk:runner</info> command loops into running\ntasks to do.\nEOT\n );\n }", "protected function configure(): void\n {\n $this->addArgument(\n 'issues',\n InputOption::VALUE_REQUIRED,\n 'Issues / Ticket numbers comma separated. (Eg. OP-1498,ONLINE-515)'\n );\n\n $this->addOption(\n 'from',\n 'df',\n InputOption::VALUE_OPTIONAL,\n 'Get work logs from date YYYY-MM-DD'\n );\n\n $this->addOption(\n 'to',\n 'dt',\n InputOption::VALUE_OPTIONAL,\n 'Get work logs to date YYYY-MM-DD'\n );\n }", "protected function configure()\n {\n // $this->addArguments(array(\n // new sfCommandArgument('my_arg', sfCommandArgument::REQUIRED, 'My argument'),\n // ));\n\n $this->addOptions(array(\n new sfCommandOption('application', null, sfCommandOption::PARAMETER_REQUIRED, 'The application name', 'statistics'),\n new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev'),\n new sfCommandOption('connection', null, sfCommandOption::PARAMETER_REQUIRED, 'The connection name', 'doctrine'),\n // add your own options here\n ));\n\n $this->namespace = 'yiid';\n $this->name = 's3-sync';\n $this->briefDescription = '';\n $this->detailedDescription = <<<EOF\nThe [S3Sync|INFO] task does things.\nCall it with:\n\n [php symfony S3Sync|INFO]\nEOF;\n }", "protected function configure()\n {\n $this\n ->setName('numa:util')\n ->setDescription('Remove spaces from unit#')\n ;\n }", "protected function configure(): void\n {\n $this->setName('schedule:list')\n ->setDescription('Displays the list of scheduled tasks.')\n ->setDefinition(\n [\n new InputArgument(\n 'source',\n InputArgument::OPTIONAL,\n 'The source directory for collecting the tasks.',\n $this->configuration\n ->getSourcePath()\n ),\n ]\n )\n ->setHelp('This command displays the scheduled tasks in a tabular format.');\n }", "protected function configure()\n {\n // $this->addArguments(array(\n // new sfCommandArgument('my_arg', sfCommandArgument::REQUIRED, 'My argument'),\n // ));\n\n $this->addOptions(array(\n new sfCommandOption('application', null, sfCommandOption::PARAMETER_REQUIRED, 'The application name'),\n new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev'),\n new sfCommandOption('connection', null, sfCommandOption::PARAMETER_REQUIRED, 'The connection name', 'doctrine'),\n // add your own options here\n ));\n\n $this->namespace = 'county';\n $this->name = 'Romania';\n $this->briefDescription = '';\n $this->detailedDescription = <<<EOF\nThe [countyRomania|INFO] task does things.\nCall it with:\n\n [php symfony countyRomania|INFO]\nEOF;\n }", "protected function configure()\n {\n $this->setDescription('Scan for legacy error middleware or error middleware invocation.');\n $this->setHelp(self::HELP);\n $this->addOption('dir', 'd', InputOption::VALUE_REQUIRED, self::HELP_OPT_DIR);\n }", "protected function configure()\n {\n $this\n ->setDescription('Print all indices of an app-id')\n ->addOption(\n 'app-id',\n 'a',\n InputOption::VALUE_OPTIONAL\n );\n }", "protected function configure(): void\n {\n $this->setDescription('Generates the code for a project')\n ->addOption('project', 'p', InputOption::VALUE_REQUIRED, 'The path to the project definition file.', __DIR__ . '/project.json')\n ->addOption('template', 't', InputOption::VALUE_REQUIRED, 'The path to the template to use for code generation.', dirname(__DIR__) . '/templates/joomla35classic')\n ->addOption('output', 'o', InputOption::VALUE_REQUIRED, 'The path to the output directory for the generated code.', dirname(__DIR__, 2) . '/generated')\n ;\n }", "protected function configure()\n {\n // $this->addArguments(array(\n // new sfCommandArgument('my_arg', sfCommandArgument::REQUIRED, 'My argument'),\n // ));\n\n $this->addOptions(array(\n new sfCommandOption('application', null, sfCommandOption::PARAMETER_REQUIRED, 'frontend'),\n new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev'),\n new sfCommandOption('connection', null, sfCommandOption::PARAMETER_REQUIRED, 'The connection name', 'doctrine'),\n // add your own options here\n ));\n\n $this->namespace = '';\n $this->name = 'sendMail';\n $this->briefDescription = '';\n $this->detailedDescription = <<<EOF\nThe [sendMail|INFO] task does things.\nCall it with:\n\n [php symfony sendMail|INFO]\nEOF;\n }", "protected function configure()\r\n {\r\n $this\r\n ->setName('mysql')\r\n ->setDescription('Dumping MySql Data')\r\n ->setHelp('This command will be able to handle dumping large data and split it into sql file');\r\n }", "protected function configure()\n {\n $this\n ->setName('cache:show')\n ->addArgument('cache', InputArgument::REQUIRED, 'The cache name / ID')\n ->setDescription('Display the details of a cache');\n }", "protected function configure()\n {\n $this->setName('execute')\n ->addArgument(\n 'script',\n InputArgument::REQUIRED,\n 'Script to execute'\n )\n ->addOption(\n 'configuration',\n null,\n InputOption::VALUE_REQUIRED,\n 'Read configuration from XML file'\n )\n ->addOption(\n 'blacklist',\n null,\n InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY,\n 'Add directory or file to the blacklist'\n )\n ->addOption(\n 'whitelist',\n null,\n InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY,\n 'Add directory or file to the whitelist'\n )\n ->addOption(\n 'add-uncovered',\n null,\n InputOption::VALUE_NONE,\n 'Add whitelisted files that are not covered'\n )\n ->addOption(\n 'process-uncovered',\n null,\n InputOption::VALUE_NONE,\n 'Process whitelisted files that are not covered'\n )\n ->addOption(\n 'clover',\n null,\n InputOption::VALUE_REQUIRED,\n 'Generate code coverage report in Clover XML format'\n )\n ->addOption(\n 'crap4j',\n null,\n InputOption::VALUE_REQUIRED,\n 'Generate code coverage report in Crap4J XML format'\n )\n ->addOption(\n 'html',\n null,\n InputOption::VALUE_REQUIRED,\n 'Generate code coverage report in HTML format'\n )\n ->addOption(\n 'php',\n null,\n InputOption::VALUE_REQUIRED,\n 'Export PHP_CodeCoverage object to file'\n )\n ->addOption(\n 'text',\n null,\n InputOption::VALUE_REQUIRED,\n 'Generate code coverage report in text format'\n );\n }", "protected function configure()\n {\n // $this->addArguments(array(\n // new sfCommandArgument('my_arg', sfCommandArgument::REQUIRED, 'My argument'),\n // ));\n\n $this->addOptions(array(\n new sfCommandOption('application', null, sfCommandOption::PARAMETER_REQUIRED, 'The application name', 'frontend'),\n new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'console'),\n new sfCommandOption('connection', null, sfCommandOption::PARAMETER_REQUIRED, 'The connection name', 'doctrine'),\n // add your own options here\n ));\n\n $this->namespace = 'sp';\n $this->name = 'sendMailNews';\n $this->briefDescription = '';\n $this->detailedDescription = <<<EOF\nThe [sendMailNews|INFO] task does things.\nCall it with:\n\n [php symfony sendMailNews|INFO]\nEOF;\n }" ]
[ "0.76795566", "0.74016345", "0.73392624", "0.7339198", "0.7246556", "0.7232773", "0.7204392", "0.71926033", "0.7189445", "0.71743834", "0.7166279", "0.7157821", "0.70908475", "0.70349544", "0.6981401", "0.6973459", "0.69733375", "0.6950586", "0.6938145", "0.69201624", "0.69125855", "0.6902213", "0.68932235", "0.6882876", "0.68802214", "0.68708545", "0.6868415", "0.6860303", "0.6832247", "0.68257713", "0.68143255", "0.68127173", "0.68114245", "0.68003196", "0.6790195", "0.6789958", "0.67883563", "0.67881405", "0.6778484", "0.6758438", "0.6758094", "0.6749717", "0.67467064", "0.6739561", "0.6737291", "0.6734802", "0.67318815", "0.6729894", "0.67286825", "0.6721822", "0.67193806", "0.671353", "0.6708975", "0.6708212", "0.6701009", "0.6691401", "0.667606", "0.66750234", "0.66741836", "0.66710585", "0.66703904", "0.6660973", "0.6658026", "0.66359526", "0.6634783", "0.66278934", "0.66207725", "0.66175634", "0.65986675", "0.6596709", "0.6593462", "0.65932894", "0.65898395", "0.6589712", "0.65822697", "0.65799737", "0.6578132", "0.65718347", "0.65701944", "0.6567103", "0.6563391", "0.6556001", "0.6547943", "0.6526764", "0.6524172", "0.6514826", "0.65128154", "0.6510044", "0.6507619", "0.65075547", "0.6507273", "0.6502586", "0.6499068", "0.64892906", "0.64863294", "0.6485624", "0.6482429", "0.6468801", "0.6468288", "0.64682424" ]
0.6973511
15
Executes the current command. This method is not abstract because you can use this class as a concrete class. In this case, instead of defining the execute() method, you set the code to execute by passing a Closure to the setCode() method.
protected function execute(InputInterface $input, OutputInterface $output) { $arguments = new Properties(); $arguments->add('application-name', $input->getArgument('application-name')); $arguments->add('namespace', $input->getArgument('namespace')); $arguments->add('directory', $input->getArgument('directory')); $arguments->add('routlt-version', $input->getOption('routlt-version')); $arguments->add('action-namespace', Util::backslashToSlash($input->getArgument('namespace'))); if ($this->validateArguments($arguments)) { FilesystemUtil::createDirectories($arguments->getProperty('directory'), $arguments->getProperty('namespace')); //Make the directory Property use a realpath $arguments->setProperty('directory', realpath($arguments->getProperty('directory'))); FilesystemUtil::findFiles(DirKeys::STATICTEMPLATES, $arguments); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function executeCommand();", "public function execute() {\n\t\t$this->command->execute($this->arguments, $this->flags);\n\t}", "function execute()\n\t{\n\t\t// Call controller method\n\t\t// echo \"METHOD: \" . $this->method;\n\t\t// return;\n\t\teval(\"\\$this->\" . $this->method . \"();\");\n\t}", "protected function callCommandMethod() {}", "public function execute()\n {\n if ($this->escape !== false) {\n $this->options = $this->escape($this->options);\n }\n $command = $this->builder->build($this->options);\n\n exec($command);\n }", "public function execute(): void\n {\n $argv = $this->commandLoaderFactory->getCommandParameters();\n $commandNameSet = isset($argv[self::COMMAND_NAME_INDEX]);\n\n if ($commandNameSet) {\n $commandName = $argv[self::COMMAND_NAME_INDEX];\n\n $commandList = $this->getCommandList();\n $commands = array_filter(\n $commandList,\n fn($command) => strtolower($argv[self::COMMAND_NAME_INDEX]) === strtolower($command->getName())\n );\n\n if (count($commands) < 1) {\n $this->writeDataAndExit('Command {{'.$commandName.'}} does not exist');\n }\n $command = $commands[array_key_first($commands)];\n $this->doExecute($command);\n } else {\n $this->printCommandList();\n }\n }", "abstract public function Execute();", "public function execute()\n\t{\n\t\t$this->run();\n\t}", "public function execute()\n {\n $this->run();\n }", "public abstract function execute();", "public abstract function execute();", "public abstract function execute();", "abstract public function run($command);", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {\n\t\t\t$connection = \\Leap\\Core\\DB\\Connection\\Pool::instance()->get_connection($this->data_source);\n\t\t\tif ($this->before !== NULL) {\n\t\t\t\tcall_user_func_array($this->before, array($connection));\n\t\t\t}\n\t\t\t$connection->execute($this->command());\n\t\t\tif ($this->after !== NULL) {\n\t\t\t\tcall_user_func_array($this->after, array($connection));\n\t\t\t}\n\t\t}", "public function execute() {\n if ( $this->mInternalMode ) {\n $this->executeAction();\n } else {\n $this->executeActionWithErrorHandling();\n }\n }", "public abstract function exec();", "protected function doExecute()\n\t{\n\t\t$controller = $this->getController();\n\n\t\t$controller = new $controller($this->input, $this);\n\n\t\t$this->setBody($controller->execute());\n\t}", "public function execute()\n {\n foreach ($this->commands as $command) {\n $command->execute();\n }\n }", "function execute() {\r\n\t\t\r\n\t\tswitch( $this->mAction ) {\r\n\t\t\tcase 'help':\r\n\t\t\t\t$this->Help();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 'compute':\r\n\t\t\t\t$this->Compute();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 'liste':\r\n\t\t\t\t$this->Liste();\r\n\t\t\t\t$this->mOutput->display();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 'open':\r\n\t\t\t\t$this->Open();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 'save':\r\n\t\t\t\t$this->Save();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 'delete':\r\n\t\t\t\t$this->Delete();\r\n\t\t\t\t$this->mOutput->display();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 'install':\r\n\t\t\t\t$this->Install();\r\n\t\t\t\t$this->mOutput->display();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\t$this->mOutput->start( $this->mDB->isOK(), $this->mLang, $this->mText, array(), '', $this->mCountRegexes, $this->mRegexes );\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}", "public function execute(): void;", "public function execute() { }", "public function execute(Command $command): void;", "public function execute() {\n\t\t$controller = $this->manager->get($this->getController());\n\t\t$reflection = new \\ReflectionClass($controller);\n\t\t$controller->run( $this->getAction($reflection) );\n\t}", "public function run(): void\n {\n $this->command->execute();\n }", "abstract function command();", "final public function perform()\n {\n $this->execute($this->args, $this->app);\n }", "public function execute() {\n\t}", "public function execute(): void\n\t{\n\t\techo 'Complex Command: should be done by a receiver object <br>';\n\t\t$this->receiver->doSomething($this->a);\n\t\t$this->receiver->doSomethingElse($this->b);\n\t}", "public function execute() {\n }", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute(Command $command, callable $next): object;", "function execute()\n {\n }", "abstract public function execute();", "abstract public function execute();", "abstract public function execute();", "abstract public function execute();", "abstract public function doExecute(array $options);", "function performCommand($cmd)\n\t{\n\n\t\tswitch ($cmd)\n\t\t{\n\t\t\tcase \"configure\":\n\t\t\tcase \"save\":\n\t\t\t\t$this->$cmd();\n\t\t\t\tbreak;\n\n\t\t}\n\t}", "public function execute()\n {\n }", "public function execute()\n {\n }", "public function __invoke()\n {\n $this->execute();\n }", "public function execute()\n {\n }", "public function execute() {\n \n return (new Result(shell_exec($this->fullCommand())));\n }", "public function execute(Command $command, $handler = null);", "public function execute()\n\t{\t\n\t\t$this->controller = new Controller($this->path);\n\t\t$this->static_server = new StaticServer($this->path);\n\t\t\n\t\tCurrent::$plugins->hook('prePathParse', $this->controller, $this->static_server);\n\t\t\n\t\tif ( $this->static_server->isFile() )\n\t\t{\n\t\t\tCurrent::$plugins->hook('preStaticServe', $this->static_server);\n\t\t\t\n\t\t\t// Output the file\n\t\t\t$this->static_server->render();\n\t\t\t\n\t\t\tCurrent::$plugins->hook('postStaticServe', $this->static_server);\n\t\t\t\n\t\t\texit;\n\t\t}\n\t\t\n\t\t// Parse arguments from path and call appropriate command\n\t\tCowl::timer('cowl parse');\n\t\t$request = $this->controller->parse();\n\t\tCowl::timerEnd('cowl parse');\n\t\n\t\tif ( COWL_CLI )\n\t\t{\n\t\t\t$this->fixRequestForCLI($request);\n\t\t}\n\t\t\n\t\t$command = new $request->argv[0];\n\t\t\n\t\t// Set template directory, which is the command directory mirrored\n\t\t$command->setTemplateDir(Current::$config->get('paths.view') . $request->app_directory);\n\t\t\n\t\tCurrent::$plugins->hook('postPathParse', $request);\n\t\t\n\t\tCowl::timer('cowl command run');\n\t\t$ret = $command->run($request);\n\t\tCowl::timerEnd('cowl command run');\n\t\t\n\t\tCurrent::$plugins->hook('postRun');\n\t\t\n\t\tif ( is_string($ret) )\n\t\t{\n\t\t\tCowl::redirect($ret);\n\t\t}\n\t}", "abstract public function dispatch($command);", "protected abstract function onExecute();", "private function execute()\n\t{\n\t\t// set working dir and cli path\n\t\t$this->workingDir = getcwd();\n\t\t$this->cliPath = $this->argv[0];\n\n\t\t// get home directory\n\t\t$this->getHomeDir();\n\t}", "protected function _exec()\n {\n }", "abstract public function execute() ;", "public function run($textCommand);", "protected abstract function executeProcess();", "public function execute(): void\n {\n }", "abstract protected function getCommand();", "function Execute ();", "protected function executeAdminCommand() {}", "protected function executeAdminCommand() {}", "protected function executeAdminCommand() {}", "abstract function execute ();", "function execute()\r\n\t{\r\n\t\t\r\n\t}", "abstract function execute();", "abstract function execute();", "public function execute()\n\t{\n\t\t$this->executeCall();\n\t\t$this->executeReminder();\n\t}", "function execute() {\n\t\tif (empty($this->args)) {\n\t\t\t$this->__interactive();\n\t\t}\n\n\t\tif (count($this->args) == 1) {\n\t\t\t$this->__interactive($this->args[0]);\n\t\t}\n\n\t\tif (count($this->args) > 1) {\n\t\t\t$type = Inflector::underscore($this->args[0]);\n\t\t\tif ($this->bake($type, $this->args[1])) {\n\t\t\t\t$this->out('done');\n\t\t\t}\n\t\t}\n\t}", "public function execute()\n {\n\n }", "public function exec()\n {\n exec($this->cmd, $this->output, $this->return_value);\n }" ]
[ "0.7138889", "0.67977643", "0.6445027", "0.6432103", "0.6311858", "0.620613", "0.6179266", "0.61410993", "0.61165714", "0.60875714", "0.60875714", "0.60875714", "0.60555696", "0.6036967", "0.6036967", "0.6036967", "0.6036967", "0.6036967", "0.6036967", "0.60362613", "0.60362613", "0.6035832", "0.6035832", "0.6035832", "0.6035832", "0.6035832", "0.6035832", "0.6035832", "0.6035832", "0.6035832", "0.6035832", "0.6035832", "0.6035832", "0.6035832", "0.5993056", "0.5989074", "0.59838897", "0.5968548", "0.59428257", "0.59241307", "0.5906406", "0.5858982", "0.58535624", "0.58501995", "0.58235425", "0.581154", "0.58092415", "0.57979167", "0.57925665", "0.5791239", "0.578466", "0.578466", "0.578466", "0.578466", "0.578466", "0.578466", "0.578466", "0.578466", "0.578466", "0.578466", "0.578466", "0.578466", "0.578466", "0.578466", "0.578466", "0.57506466", "0.571299", "0.57051665", "0.57051665", "0.57051665", "0.57051665", "0.5700984", "0.57008535", "0.5700305", "0.5700305", "0.5697539", "0.56949455", "0.56930804", "0.5679043", "0.56570345", "0.5651523", "0.562905", "0.56160885", "0.56069344", "0.559199", "0.55855596", "0.55832267", "0.55676377", "0.5564955", "0.55503815", "0.55335486", "0.55335486", "0.55335486", "0.5521584", "0.55163336", "0.5509607", "0.5509607", "0.55063856", "0.5504479", "0.549095", "0.5485222" ]
0.0
-1
create empty collections for each markets
public function setRelations($relationName, $key, $relations) { $this->collection->each(function($event) use ($relationName) { $event->setRelation($relationName, new EloquentResourceCollection(new Collection(), 'TopBetta\Resources\MarketResource')); }); //get dictionary $dictionary = $this->collection->getDictionary(); foreach($relations as $relation) { //push each relation onto correct model relation $dictionary[$relation->{$key}]->{$relationName}->push($relation); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function markets()\n {\n return $this->_call('public/getmarkets', [], false);\n }", "protected function generateCollections()\n {\n if ( ! is_null($this->collections) ) {\n foreach ( $this->collections as $collection ) {\n $this->iterateCollection($collection);\n }\n }\n }", "public function markets()\n {\n return $this->hasMany(Market::class);\n }", "public function __construct()\n {\n $this->categories = new ArrayCollection();\n $this->families = new ArrayCollection();\n $this->types = new ArrayCollection();\n $this->designations = new ArrayCollection();\n $this->makes = new ArrayCollection();\n }", "public function all()\n {\n $objects = SevDeskApi::getFromSevDesk($this->objectName);\n $this->collection = collect();\n\n foreach($objects as $object)\n $this->collection->push($this->newInstance($object));\n\n return $this->collection;\n }", "public function prepareObject() {\n\t\tforeach($this->tempData as $sem) {\n\t\t\t$s = new Semestar($sem);\n\t\t\t$this->semester[] = $s;\n\t\t}\n\t\tunset($this->tempData);\n\t}", "protected function makeData()\n {\n $Collection = new Collection();\n for($i = 0; $i < 35; $i++){\n $Collection->push([\n 'name' => $this->Faker->name,\n 'email' => $this->Faker->email,\n 'birthday' => $this->Faker->date,\n 'phone_number' => $this->Faker->phoneNumber,\n 'bio' => $this->Faker->text,\n ]);\n }\n\n return $Collection;\n }", "public function getMarkets ()\n\t{\n\t\treturn $this->call ('public/getmarkets');\n\t}", "public function createSmartCollections()\n {\n $this->nameAttributeId = $this->getNameAttributeId();\n $this->categoryNames = $this->getCategoryNames();\n $stores = $this->storeRepository->getList();\n $output = null;\n\n foreach ($stores as $store) {\n $this->currentStoreId = $store->getStoreId();\n $smartCollections = $this->getAllSmartCollections($this->currentStoreId);\n\n $categories = $this->categoryCollection->create()\n ->addAttributeToSelect('url_path')\n ->addAttributeToSelect('name')\n ->addAttributeToSelect('is_active')\n ->setStore($this->currentStoreId);\n\n foreach ($categories as $category) {\n if (in_array($category->getEntityId(), [1, 2]) || !$category->getName()) {\n continue;\n }\n\n $categoryPath = self::SMART_COLLECTION_PREFIX . trim($category->getUrlPath());\n\n if (!in_array($categoryPath, $smartCollections)) {\n $result = $this->createSmartCollection($category, $this->currentStoreId);\n } else {\n // If a smart collection already exists edit it\n $collectionId = array_search($categoryPath, $smartCollections);\n $result = $this->updateSmartCollection($category, $this->currentStoreId, $collectionId);\n }\n if (isset($result['error'])) {\n $output = $result['error']['message'];\n }\n }\n }\n\n return $output;\n }", "protected function _prepareCollection()\r\n {\r\n $this->setCollection(Mage::getModel('dynamic_brand/brand')->getCollection());\r\n return parent::_prepareCollection();\r\n }", "public function createStoreCollection($stores)\n {\n // Build a new basic collection\n $collection = new Varien_Data_Collection();\n\n // Loop through each store\n foreach($stores as $store) {\n\n // Create a new instance of the store model and append the data\n $storeItem = Mage::getModel('gene_doddle/store')->addData($store);\n\n // Add the item into our collection\n $collection->addItem($storeItem);\n }\n\n return $collection;\n }", "public function __construct()\n {\n $this->postules = new ArrayCollection();\n $this->competences = new ArrayCollection();\n $this->habilitations = new ArrayCollection();\n }", "function createUpdateMarkets($markets){\n foreach($markets as $market => $value){\n list($asset1, $asset2) = explode('|',$market);\n $market_id = createMarket($asset1, $asset2);\n updateMarketInfo($market_id);\n }\n}", "public function resetCollectionsForPersist()\n {\n $this->containers = new ArrayCollection();\n $this->functions = new ArrayCollection();\n $this->constants = new ArrayCollection();\n }", "protected function _createCollection()\n {\n return Mage::getModel('wishlist/item')->getCollection()\n ->setWebsiteId($this->_getCustomer()->getWebsiteId())\n ->setCustomerGroupId($this->_getCustomer()->getGroupId());\n }", "protected function _prepareCollection () {\n $collection\n = Mage::getResourceModel('mventory/carrier_volumerate_collection')\n ->setWebsiteFilter($this->getWebsiteId());\n\n $this->setCollection($collection);\n\n $shippingTypes\n = Mage::getModel('mventory/system_config_source_allowedshippingtypes')\n ->toArray();\n\n foreach ($collection as $rate) {\n $name = $rate->getConditionName();\n\n if ($name == 'weight')\n $rate->setWeight($rate->getConditionValue());\n else if ($name == 'volume')\n $rate->setVolume($rate->getConditionValue());\n\n $shippingType = $rate->getShippingType();\n\n $shippingType = isset($shippingTypes[$shippingType])\n ? $shippingTypes[$shippingType]\n : '';\n\n $rate->setShippingType($shippingType);\n }\n\n return parent::_prepareCollection();\n }", "public function createStoreCollection($stores)\n {\n // Build a new basic collection\n $collection = new Varien_Data_Collection();\n\n // Loop through each store\n foreach ($stores as $store) {\n // Create a new instance of the store model and append the data\n $storeItem = Mage::getModel('gene_doddle/store')->addData($store);\n\n // Add the item into our collection\n $collection->addItem($storeItem);\n }\n\n return $collection;\n }", "public function run ()\n {\n\n DB::table('regions')->insert([\n 'name' => 'US',\n 'id' => 1,\n ]);\n DB::table('regions')->insert([\n 'name' => 'EU',\n 'id' => 2,\n ]);\n\n DB::table('regions')->insert([\n 'name' => 'FE',\n 'id' => 3,\n ]);\n// factory(\\App\\Marketplace::class, 50)->create();\n\n $marketplaces = [\n [\n 'amazon_marketplace_id' => 'A2EUQ1WTGCTBG2',\n 'endpoint' => 'mws.amazonservices.ca',\n 'name' => 'Canada',\n 'code' => 'CA',\n 'region_id' => 1,\n ],\n [\n 'amazon_marketplace_id' => 'ATVPDKIKX0DER',\n 'endpoint' => 'mws.amazonservices.com',\n 'name' => 'US',\n 'code' => 'US',\n 'region_id' => 1,\n ],\n [\n 'amazon_marketplace_id' => 'A1AM78C64UM0Y8',\n 'endpoint' => 'mws.amazonservices.com.mx',\n 'name' => 'Mexico',\n 'code' => 'MX',\n 'region_id' => 1,\n ],\n [\n 'amazon_marketplace_id' => 'A2Q3Y263D00KWC',\n 'endpoint' => 'mws.amazonservices.com',\n 'name' => 'Brazil',\n 'code' => 'BR',\n 'region_id' => 1,\n\n ],\n\n [\n 'amazon_marketplace_id' => 'A1PA6795UKMFR9',\n 'endpoint' => 'mws-eu.amazonservices.com',\n 'name' => 'Germany',\n 'code' => 'DE',\n 'region_id' => 2,\n ],\n [\n 'amazon_marketplace_id' => 'A1RKKUPIHCS9HS',\n 'endpoint' => 'mws-eu.amazonservices.com',\n 'name' => 'Spain',\n 'code' => 'ES',\n 'region_id' => 2,\n ],\n [\n 'amazon_marketplace_id' => 'A13V1IB3VIYZZH',\n 'endpoint' => 'mws-eu.amazonservices.com',\n 'name' => 'France',\n 'code' => 'FR',\n 'region_id' => 2,\n ],\n [\n 'amazon_marketplace_id' => 'A21TJRUUN4KGV',\n 'endpoint' => 'mws.amazonservices.in',\n 'name' => 'India',\n 'code' => 'IN',\n 'region_id' => 2,\n ],\n [\n 'amazon_marketplace_id' => 'APJ6JRA9NG5V4',\n 'endpoint' => 'mws-eu.amazonservices.com',\n 'name' => 'Italy',\n 'code' => 'IT',\n 'region_id' => 2,\n ],\n [\n 'amazon_marketplace_id' => 'A1F83G8C2ARO7P',\n 'endpoint' => 'mws-eu.amazonservices.com',\n 'name' => 'UK',\n 'code' => 'GB',\n 'region_id' => 2,\n ],\n\n\n\n ];\n\n foreach ($marketplaces as $marketplace) {\n\n DB::table('marketplaces')->insert($marketplace);\n }\n\n }", "public function __construct() {\n $this->disciplinas = new \\Doctrine\\Common\\Collections\\ArrayCollection();\n $this->tendencias = new \\Doctrine\\Common\\Collections\\ArrayCollection();\n $this->institucionalEstrategias = new \\Doctrine\\Common\\Collections\\ArrayCollection();\n $this->ofertas = new \\Doctrine\\Common\\Collections\\ArrayCollection();\n $this->estrategiaCampos = new \\Doctrine\\Common\\Collections\\ArrayCollection();\n $this->eventos = new \\Doctrine\\Common\\Collections\\ArrayCollection();\n $this->encuestas = new \\Doctrine\\Common\\Collections\\ArrayCollection();\n }", "public function __construct()\n {\n $this->itemPrices = new ArrayCollection();\n }", "protected function _prepareCollection()\n {\n /** @var $collection ChazkiExpressCollection */\n $collection = $this->_collectionFactory->create();\n $collection->setWebsiteFilter($this->getWebsiteId());\n\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }", "protected function _prepareCollection()\n {\t\t \n\t\t\n $collection = Mage::getModel('catalog/product')\n \t->getCollection()\n \t->addAttributeToSelect('name')\n \t->addAttributeToSelect('price')\n \t->addAttributeToSelect('special_price')\n \t->addAttributeToSelect('name')\n \t->addAttributeToSelect('manufacturer')\n \t->addFieldToFilter('type_id', array('in' => array(Mage_Catalog_Model_Product_Type::TYPE_SIMPLE, Mage_Catalog_Model_Product_Type::TYPE_VIRTUAL)))\n ->joinField('qty',\n 'cataloginventory/stock_item',\n 'qty',\n 'product_id=entity_id',\n '{{table}}.stock_id=1',\n 'left');\n \t;\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "public function __construct() {\n $this->items = new ArrayCollection;\n $this->orderProducts = new ArrayCollection;\n $this->promotions = new ArrayCollection();\n\n }", "function marketsAction() {\n\t $this->_helper->layout->disableLayout();\n\t $this->_helper->viewRenderer->setNoRender(TRUE);\n\t $conn = Doctrine_Manager::connection(); \n \t$session = SessionWrapper::getInstance();\n \t$formvalues = $this->_getAllParams();\n \t// debugMessage($formvalues);\n \t// debugMessage($this->_getAllParams());\n \t\n \t \t$feed = '';\n \t$hasall = true;\n \t$issearch = false;\n \t$iscount = false;\n \t$ispaged = false;\n \t$where_query = \" \";\n \t$type_query = \" AND pc.pricecategoryid = '2' \";\n \t$group_query = \" GROUP BY p.id \";\n \t$limit_query = \"\";\n \t$select_query = \" p.id, p.name as market, p.locationid as districtid, l.regionid as regionid, l.name as district, lr.name as region \";\n \t$join_query = \" INNER JOIN location AS l ON (p.locationid = l.id AND l.locationtype = 2) \n \t\t\t\t\tINNER JOIN pricesourcecategory AS pc ON (p.id = pc.pricesourceid) \n \t\t\t\t\tINNER JOIN location AS lr ON (l.regionid = lr.id) \";\n \t\n \tif(isArrayKeyAnEmptyString('filter', $formvalues)){\n \t\techo \"NO_FILTER_SPECIFIED\";\n \t\texit();\n \t}\n \t\n \t# fetch commodities filtered by categoryid\n \tif($this->_getParam('filter') == 'all'){\n\t \t$districtquery = false;\n\t \tif(!isArrayKeyAnEmptyString('districtid', $formvalues) || !isArrayKeyAnEmptyString('district', $formvalues)){\n\t \t\t\t$district = new District();\n\t \t\t\tif(!isArrayKeyAnEmptyString('districtid', $formvalues)){\n\t\t \t\t$district->populate($formvalues['districtid']);\n\t\t \t\t// debugMessage($market->toArray());\n\t\t \t\tif(isEmptyString($district->getID()) || !is_numeric($formvalues['districtid'])){\n\t\t \t\t\techo \"DISTRICT_INVALID\";\n\t\t \t\t\texit();\n\t\t \t\t}\n\t\t \t\t$distid = $formvalues['districtid'];\n\t \t\t\t}\n\t \t\t\tif(!isArrayKeyAnEmptyString('district', $formvalues)){\n\t \t\t\t\t$distid = $district->findByName($formvalues['district'], 2);\n\t \t\t\tif(isEmptyString($distid)){\n\t\t \t\t\techo \"DISTRICT_INVALID\";\n\t\t \t\t\texit();\n\t\t \t\t}\n\t \t\t\t}\n\t \t\t$districtquery = true;\n\t \t\t$where_query .= \" AND p.locationid = '\".$distid.\"' \";\n\t \t}\n\t \t\n\t \t$regionquery = false;\n\t \tif(!isArrayKeyAnEmptyString('regionid', $formvalues) || !isArrayKeyAnEmptyString('region', $formvalues)){\n\t \t\t\t$region = new Region();\n\t \t\t\tif(!isArrayKeyAnEmptyString('regionid', $formvalues)){\n\t\t \t\t$region->populate($formvalues['regionid']);\n\t\t \t\t// debugMessage(region->toArray());\n\t\t \t\tif(isEmptyString($region->getID()) || !is_numeric($formvalues['regionid'])){\n\t\t \t\t\techo \"REGION_INVALID\";\n\t\t \t\t\texit();\n\t\t \t\t}\n\t\t \t\t$regid = $formvalues['regionid'];\n\t \t\t\t}\n\t \t\tif(!isEmptyString($this->_getParam('region'))){\n\t \t\t\t\t$regid = $region->findByName($formvalues['region'], 1);\n\t \t\t\tif(isEmptyString($regid)){\n\t\t \t\t\techo \"REGION_INVALID\";\n\t\t \t\t\texit();\n\t\t \t\t}\n\t \t\t\t}\n\t \t\t$regionquery = true;\n\t \t\t$where_query .= \" AND l.regionid = '\".$regid.\"' \";\n\t \t}\n \t}\n \t\n \t# searching for particular commodity\n \tif($formvalues['filter'] == 'search'){\n \t\t// check that search parameters have been specified\n \t\tif(isEmptyString($this->_getParam('marketid')) && isEmptyString($this->_getParam('market'))){\n \t\t\techo \"NULL_SEARCH_PARAMETER\";\n\t \t\texit();\n \t\t}\n \t\t$source = new PriceSource();\n \t\t// pricesourceid specified\n \t\tif(!isEmptyString($this->_getParam('marketid'))){\n\t \t\t$source->populate($formvalues['marketid']);\n\t \t\t// debugMessage($com->toArray());\n\t \t\tif(isEmptyString($source->getID()) || !is_numeric($formvalues['marketid'])){\n\t \t\t\techo \"MARKET_INVALID\";\n\t \t\t\texit();\n\t \t\t}\n\t \t\t$sourceid = $source->getID();\n\t \t\t$where_query .= \" AND p.id = '\".$sourceid.\"' \";\n \t\t}\n \t\t// market name specified\n \t\tif(!isEmptyString($this->_getParam('market'))){\n \t\t\t$searchstring = $formvalues['market'];\n \t\t\t$islist = false;\n\t \t\tif(strpos($searchstring, ',') !== false) {\n\t\t\t\t\t$islist = true;\n\t\t\t\t}\n\t\t\t\tif(!$islist){\n\t \t\t\t$sourceid = $source->findByName($searchstring);\n\t \t\t\t$sourceid_count = count($sourceid);\n\t \t\t\tif($sourceid_count == 0){\n\t\t \t\t\techo \"MARKET_INVALID\";\n\t\t \t\t\texit();\n\t\t \t\t}\n\t\t \t\tif($sourceid_count == 1){\n\t\t \t\t\t$where_query .= \" AND c.id = '\".$sourceid[0]['id'].\"' \";\n\t\t \t\t}\n\t \t\t\tif($sourceid_count > 1){\n\t \t\t\t\t$ids_array = array();\n\t \t\t\t\tforeach ($sourceid as $value){\n\t \t\t\t\t\t$ids_array[] = $value['id'];\n\t \t\t\t\t}\n\t \t\t\t\t$ids_list = implode($ids_array, \"','\");\n\t \t\t\t\t// debugMessage($ids_list);\n\t\t \t\t\t$where_query .= \" AND p.id IN('\".$ids_list.\"') \";\n\t\t \t\t}\n\t\t\t\t}\n\t\t\t\tif($islist){\n\t\t\t\t\t$bundled = false;\n\t\t\t\t\t$searchstring = trim($searchstring);\n\t\t\t\t\t$seach_array = explode(',', $searchstring);\n\t\t\t\t\t// debugMessage($seach_array);\n\t\t\t\t\tif(is_array($seach_array)){\n\t\t\t\t\t\t$ids_array = array();\n\t\t\t\t\t\tforeach ($seach_array as $string){\n\t\t\t\t\t\t\t$source = new PriceSource();\n\t\t\t\t\t\t\t$sourceid = $source->findByName($string);\n\t \t\t\t\t\t$sourceid_count = count($sourceid);\n\t\t\t\t\t\t\tif($sourceid_count > 0){\n\t\t\t \t\t\t\tforeach ($sourceid as $value){\n\t\t\t \t\t\t\t\t$ids_array[] = $value['id'];\n\t\t\t \t\t\t\t}\n\t\t\t\t \t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(count($ids_array) > 0){\n\t\t\t\t\t\t\t$ids_list = implode($ids_array, \"','\");\n\t\t\t \t\t\t// debugMessage($ids_list);\n\t\t\t\t \t\t$where_query .= \" AND c.id IN('\".$ids_list.\"') \";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\techo \"MARKET_LIST_INVALID\";\n\t\t \t\t\t\texit();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo \"MARKET_LIST_INVALID\";\n\t\t \t\t\texit();\n\t\t\t\t\t}\n\t\t\t\t}\n \t\t}\n \t}\n \t\n \t// when fetching total results\n \tif(!isEmptyString($this->_getParam('fetch')) && $this->_getParam('fetch') == 'total'){\n \t\t$select_query = \" count(l.id) as records \";\n \t\t$group_query = \"\";\n \t\t$iscount = true;\n \t}\n \t\n \t// when fetching limited results via pagination \n \tif(!isEmptyString($this->_getParam('paged')) && $this->_getParam('paged') == 'Y'){\n \t\t$ispaged = true;\n \t\t$hasall = false;\n \t\t$start = $this->_getParam('start');\n \t\t$limit = $this->_getParam('limit');\n \t\tif(isEmptyString($start)){\n \t\t\techo \"RANGE_START_NULL\";\n\t \t\texit();\n \t\t}\n \t\tif(!is_numeric($limit)){\n \t\t\techo \"INVALID_RANGE_START\";\n\t \t\texit();\n \t\t}\n \t\tif(isEmptyString($start)){\n \t\t\techo \"RANGE_LIMIT_NULL\";\n\t \t\texit();\n \t\t}\n \t\tif(!is_numeric($limit)){\n \t\t\techo \"INVALID_RANGE_LIMIT\";\n\t \t\texit();\n \t\t}\n \t\t$limit_query = \" limit \".$start.\",\".$limit.\" \";\n \t}\n \t\n \t// \n \t$com_query = \"SELECT \".$select_query.\" FROM pricesource p \".$join_query.\" WHERE p.name <> '' \".$type_query.$where_query.\" \n \t\".$group_query.\" ORDER BY p.name ASC \".$limit_query;\n \t// debugMessage($com_query);\n \t\n \t$result = $conn->fetchAll($com_query);\n \t$comcount = count($result);\n \t// debugMessage($result); exit();\n \t\n \tif($comcount == 0){\n \t\techo \"RESULT_NULL\";\n \t\texit();\n \t} else {\n \t\tif($iscount){\n \t\t\t$feed .= '<item>';\n\t \t\t$feed .= '<total>'.$result[0]['records'].'</total>';\n\t\t\t $feed .= '</item>';\n \t\t}\n \t\tif(!$iscount){\n\t \t\tforeach ($result as $line){\n\t\t\t \t$feed .= '<item>';\n\t\t \t\t$feed .= '<id>'.$line['id'].'</id>';\n\t\t \t\t$feed .= '<name>'.str_replace('Market', '', $line['market']).'</name>';\n\t\t \t\t$feed .= '<districtid>'.$line['districtid'].'</districtid>';\n\t\t \t\t$feed .= '<district>'.$line['district'].'</district>';\n\t\t \t\t$feed .= '<regionid>'.$line['regionid'].'</regionid>';\n\t\t \t\t$feed .= '<region>'.$line['region'].'</region>';\n\t\t\t\t $feed .= '</item>';\n\t\t \t}\n \t\t}\n \t}\n \t\n \t# output the xml returned\n \tif(isEmptyString($feed)){\n \t\techo \"EXCEPTION_ERROR\";\n \t\texit();\n \t} else {\n \t\techo '<?xml version=\"1.0\" encoding=\"UTF-8\"?><items>'.$feed.'</items>';\n \t}\n }", "protected function createCollection()\n {\n $model = $this->getModel();\n return $model->asCollection();\n }", "protected function createEmptyCollection(): Collection\n {\n /** @var Collection<TEntity> $emptyCollection */\n $emptyCollection = new Collection($this->db);\n return $emptyCollection;\n }", "protected function _prepareCollection() {\n /**\n * \n * @var unknown\n */\n /**\n * Calling the parent Construct Method.\n * \n * Getting collection for bank details\n */\n $managebankdetailsCollection = Mage::getModel ( 'airhotels/managebankdetails' )->getCollection ();\n $this->setCollection ( $managebankdetailsCollection ); \n return parent::_prepareCollection ();\n /**\n * return _prepareCollection\n */\n }", "protected function _setCollection(){\n $storeId = Mage::app()->getStore()->getId();\n $products = Mage::getResourceModel('reports/product_collection')\n ->addOrderedQty()\n ->addAttributeToSelect(array('name', 'price', 'small_image', 'short_description', 'description'))\n ->setStoreId($storeId)\n ->addStoreFilter($storeId)\n ->setPageSize($this->getProductsCount())\n ->setOrder('ordered_qty', 'desc');\n\n Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);\n Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);\n\n $this->_topsellerCollection = $products;\n }", "public function get_markets()\n {\n return $this->_request('getmarkets');\n }", "protected function _prepareCollection()\n {\n $collection = Mage::getResourceModel($this->_getCollectionClass());\n\t\t//$collection->getSelect()->joinLeft(array('st' => 'core_store'),'main_table.SiteID = st.store_id',array('storename' => 'st.name'));\n $this->setCollection($collection);\n \n return parent::_prepareCollection();\n }", "abstract protected function _generateDataCollection();", "public function initEtablissements()\n {\n $this->collEtablissements = new PropelObjectCollection();\n $this->collEtablissements->setModel('Etablissement');\n }", "public function __construct()\n {\n $this->genres = new Genres();\n $this->productionCompanies = new GenericCollection();\n $this->productionCountries = new GenericCollection();\n $this->spokenLanguages = new GenericCollection();\n $this->alternativeTitles = new GenericCollection();\n $this->changes = new GenericCollection();\n $this->credits = new CreditsCollection();\n $this->externalIds = new ExternalIds();\n $this->images = new Images();\n $this->keywords = new GenericCollection();\n $this->lists = new GenericCollection();\n $this->releases = new GenericCollection();\n $this->release_dates = new GenericCollection();\n $this->similar = new GenericCollection();\n $this->recommendations = new GenericCollection();\n $this->translations = new GenericCollection();\n $this->videos = new Videos();\n $this->watchProviders = new GenericCollection();\n }", "protected function _prepareCollection()\r\n {\r\n $collection = Mage::getModel('enterprise_giftcardaccount/giftcardaccount')->getCollection();\r\n $giftCartAccount_data = array();\r\n foreach($collection as $key=>$item){\r\n $giftCartAccount_data[$item->getData('giftcardaccount_id')][0] = $item->getData();\r\n $collection->removeItemByKey($key);\r\n }\r\n\r\n $creat_collection = Mage::getModel('enterprise_giftcardaccount/history')->getCollection();\r\n $creat_collection->getSelect()\r\n ->reset(Zend_Db_Select::COLUMNS)\r\n ->columns(array('giftcardaccount_id','generated_order_number' => 'additional_info', 'original_amount' => 'balance_delta'));\r\n $creat_collection->addFieldToFilter('action', 0);\r\n $creat_collection->setOrder('giftcardaccount_id', 'asc');\r\n $creat_collection->setOrder('updated_at', 'asc');\r\n $id = '';\r\n $i = 0;\r\n foreach($creat_collection as $item){\r\n $giftcardaccount_id = $item->getData('giftcardaccount_id');\r\n if($giftcardaccount_id == $id){\r\n $i++;\r\n }else{\r\n $id = $giftcardaccount_id;\r\n $i = 0;\r\n }\r\n $giftCartAccount_data[$giftcardaccount_id][$i]['generated_order_number'] = $item->getData('generated_order_number');\r\n $giftCartAccount_data[$giftcardaccount_id][$i]['original_amount'] = $item->getData('original_amount');\r\n }\r\n\r\n $use_collection = Mage::getModel('enterprise_giftcardaccount/history')->getCollection();\r\n $use_collection->getSelect()\r\n ->reset(Zend_Db_Select::COLUMNS)\r\n ->columns(array('giftcardaccount_id','used_date' => 'updated_at', 'used_order_number' => 'additional_info', 'used_amount' => 'ABS(main_table.balance_delta)'));\r\n $use_collection->addFieldToFilter('action', 1);\r\n $use_collection->setOrder('giftcardaccount_id', 'asc');\r\n $use_collection->setOrder('updated_at', 'asc');\r\n $id = '';\r\n $i = 0;\r\n foreach($use_collection as $item){\r\n $giftcardaccount_id = $item->getData('giftcardaccount_id');\r\n if($giftcardaccount_id == $id){\r\n $i++;\r\n }else{\r\n $id = $giftcardaccount_id;\r\n $i = 0;\r\n }\r\n $giftCartAccount_data[$giftcardaccount_id][$i]['used_date'] = $item->getData('used_date');\r\n $giftCartAccount_data[$giftcardaccount_id][$i]['used_order_number'] = $item->getData('used_order_number');\r\n $giftCartAccount_data[$giftcardaccount_id][$i]['used_amount'] = $item->getData('used_amount');\r\n }\r\n\r\n $send_collection = Mage::getModel('enterprise_giftcardaccount/history')->getCollection();\r\n $send_collection->getSelect()\r\n ->reset(Zend_Db_Select::COLUMNS)\r\n ->columns(array('giftcardaccount_id','additional_info'));\r\n $send_collection->addFieldToFilter('action', 2);\r\n $send_collection->setOrder('giftcardaccount_id', 'asc');\r\n $send_collection->setOrder('updated_at', 'asc');\r\n $id = '';\r\n $i = 0;\r\n foreach($send_collection as $item){\r\n $giftcardaccount_id = $item->getData('giftcardaccount_id');\r\n if($giftcardaccount_id == $id){\r\n $i++;\r\n }else{\r\n $id = $giftcardaccount_id;\r\n $i = 0;\r\n }\r\n $additional_info = $item->getData('additional_info');\r\n preg_match ('/^Recipient: (.*?) <(.*?)>.(.*)$/', $additional_info, $param);\r\n $giftCartAccount_data[$giftcardaccount_id][$i]['receptor_name'] = $param[1];\r\n $giftCartAccount_data[$giftcardaccount_id][$i]['receptor_email']= $param[2];\r\n }\r\n\r\n $total_collection = Mage::getModel('enterprise_giftcardaccount/giftcardaccount')->getCollection();\r\n $total_collection->getSelect()\r\n ->reset(Zend_Db_Select::COLUMNS)\r\n ->columns(array('main_table.giftcardaccount_id'))\r\n ->joinLeft(\r\n array('history' => $collection->getTable('enterprise_giftcardaccount/history')),\r\n 'history.giftcardaccount_id = main_table.giftcardaccount_id and history.action = 1',\r\n array('total'=>'ABS(SUM(history.balance_delta))')\r\n )\r\n ->group('main_table.giftcardaccount_id');\r\n foreach($total_collection->getData() as $val){\r\n $giftCartAccount_data[$val['giftcardaccount_id']][0]['total_used_amount'] = $val['total']?$val['total']:'';\r\n }\r\n\r\n foreach($giftCartAccount_data as $value){\r\n foreach($value as $val){\r\n $item = $collection->getNewEmptyItem();\r\n $item->setData($val);\r\n $collection->addItem($item);\r\n }\r\n }\r\n $this->setCollection($collection);\r\n\r\n parent::_prepareCollection();\r\n return $this;\r\n }", "public function __construct()\n {\n $this->feeds = new ArrayCollection();\n }", "private function getTableCollection()\n {\n $tables = $this->tables;\n $collection = new TableCollection();\n\n foreach ($tables as $tableKey => $tableMeta) {\n $collection->add(new TableVO($tableKey, $tableMeta));\n }\n\n return $collection;\n }", "public function __construct()\n {\n $this->articles = new ArrayCollection();\n $this->commentaires = new ArrayCollection();\n }", "private function generateTestPlanetList( )\r\n {\r\n $this->testPlanetListIndex = 0;\r\n $this->testPlanetList = array();\r\n \r\n foreach ( $this->getPlanets() as $testPlanet ) {\r\n if ( ! $testPlanet->isCreated() ) {\r\n continue;\r\n }\r\n \r\n $this->testPlanetList[] = $testPlanet;\r\n } \r\n }", "public function init(): Set;", "private function _getDataProviderEmpty4()\n {\n return [\n [\n 'containerDesignBlockModel' => [\n 'marginTop' => ' '\n ],\n 'titleDesignBlockModel' => [\n 'marginTop' => ' '\n ],\n 'titleDesignTextModel' => [\n 'size' => ' '\n ],\n 'descriptionDesignBlockModel' => [\n 'marginTop' => ' '\n ],\n 'descriptionDesignTextModel' => [\n 'size' => ' '\n ],\n 'paginationDesignBlockModel' => [\n 'marginTop' => ' '\n ],\n 'paginationItemDesignBlockModel' => [\n 'marginTop' => ' '\n ],\n 'paginationItemDesignTextModel' => [\n 'size' => ' '\n ],\n ],\n [\n 'containerDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'titleDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'titleDesignTextModel' => [\n 'size' => 0\n ],\n 'descriptionDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'descriptionDesignTextModel' => [\n 'size' => 0\n ],\n 'paginationDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'paginationItemDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'paginationItemDesignTextModel' => [\n 'size' => 0\n ],\n ],\n [\n 'containerDesignBlockModel' => [],\n 'titleDesignBlockModel' => [],\n 'titleDesignTextModel' => [],\n 'descriptionDesignBlockModel' => [],\n 'descriptionDesignTextModel' => [],\n 'paginationDesignBlockModel' => [],\n 'paginationItemDesignBlockModel' => [],\n 'paginationItemDesignTextModel' => [],\n ],\n [\n 'containerDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'titleDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'titleDesignTextModel' => [\n 'size' => 0\n ],\n 'descriptionDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'descriptionDesignTextModel' => [\n 'size' => 0\n ],\n 'paginationDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'paginationItemDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'paginationItemDesignTextModel' => [\n 'size' => 0\n ],\n ],\n ];\n }", "public function newCollection(array $models = []);", "public function getHotels(): Collection;", "public function __construct()\n {\n $this->spotWebcams = new ArrayCollection();\n }", "public function createCollection()\n\t{\n\t\t/** @var $collection \\Magento\\Catalog\\Model\\ResourceModel\\Product\\Collection */\n\t\t$collection = $this->productCollectionFactory->create();\n\t\t$collection->setVisibility($this->catalogProductVisibility->getVisibleInCatalogIds());\n\n\t\t$collection = $this->_addProductAttributesAndPrices($collection)\n\t\t\t->addStoreFilter()\n\t\t\t->setPageSize($this->getPageSize())\n\t\t\t->setCurPage($this->getRequest()->getParam(self::PAGE_VAR_NAME, 1));\n\n\t\t$conditions = $this->getConditions();\n\t\t$conditions->collectValidatedAttributes($collection);\n\t\t$this->sqlBuilder->attachConditionToCollection($collection, $conditions);\n\n\t\treturn $collection;\n\t}", "protected function _prepareCollection()\n {\n $collection = Mage::getModel('lavi_news/news')->getResourceCollection();\n\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "static function getAll()\n {\n $returned_stores = $GLOBALS['DB']->query(\"SELECT * FROM stores;\");\n $stores = array();\n foreach ($returned_stores as $store) {\n $store_name = $store['store_name'];\n $id = $store['id'];\n $new_store = new Store($store_name, $id);\n array_push($stores, $new_store);\n }\n return $stores;\n }", "protected function _prepareCollection()\n {\n $collection = Mage::getModel('catalog/product')->getCollection()\n ->addAttributeToSelect('name')\n ->addAttributeToSelect('type')\n ->addAttributeToSelect('status')\n ->addAttributeToSelect('visibility')\n ->addAttributeToSelect('sku');\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "public function clearCollection()\n {\n $this->collections = [];\n }", "public function run()\n {\n foreach (\\App\\Collection::all() as $collection) {\n factory(App\\Series::class)->create([\n 'collection_id' => $collection->id,\n 'reference' => 'RW33',\n 'name' => 'Records of the Preservation and Digital Preservation Department',\n 'description' => '\t\nThe series contains digital records created in the Preservation area of The National Archives functional electronic file plan used between 2003 and 2008; the records would have been predominantly created by the various Preservation and Digital Preservation departments. This function concerns the devising and promulgating of pro-active and preventative strategies for the preservation of both government and non-public archival records. This involves managing the integrity and usability of all records, traditional and digital, in The National Archives. It includes developing internal and external preservation strategies and systems, researching physical and chemical properties of materials, and applying conservation techniques.'\n ]);\n }\n }", "private function _getDataProviderEmpty1()\n {\n return [\n [],\n [\n 'containerDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'titleDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'titleDesignTextModel' => [\n 'size' => 0\n ],\n 'descriptionDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'descriptionDesignTextModel' => [\n 'size' => 0\n ],\n 'paginationDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'paginationItemDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'paginationItemDesignTextModel' => [\n 'size' => 0\n ],\n ],\n [\n 'containerDesignBlockModel' => '',\n 'titleDesignBlockModel' => '',\n 'titleDesignTextModel' => '',\n 'descriptionDesignBlockModel' => '',\n 'descriptionDesignTextModel' => '',\n 'paginationDesignBlockModel' => '',\n 'paginationItemDesignBlockModel' => '',\n 'paginationItemDesignTextModel' => '',\n ],\n [\n 'containerDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'titleDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'titleDesignTextModel' => [\n 'size' => 0\n ],\n 'descriptionDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'descriptionDesignTextModel' => [\n 'size' => 0\n ],\n 'paginationDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'paginationItemDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'paginationItemDesignTextModel' => [\n 'size' => 0\n ],\n ],\n ];\n }", "public function getStoresCollection()\n {\n return $this->createStoreCollection($this->getStores());\n }", "public function run()\n {\n foreach (\\App\\Collection::all() as $collection) {\n $series = factory(App\\Series::class)->create(['collection_id' => $collection->id]);\n }\n }", "public function run(Faker\\Generator $faker)\n {\n $wgro = App\\Market::whereSlug('wgro')->first();\n $lrh = App\\Market::whereSlug('lrh')->first();\n $elizowka = App\\Market::whereSlug('elizowka')->first();\n $agrohurt = App\\Market::whereSlug('agrohurt')->first();\n\n for($x = 0; $x <= 150; $x++) {\n $this->products[$faker->unique()->word] = [\n 'type' => $this->type[array_rand($this->type)],\n 'origin' => $this->origin[array_rand($this->origin)],\n \"package\" => $this->package[array_rand($this->package)],\n ];\n }\n\n foreach ($this->products as $name => $attrs) {\n\n for ($x = 10; $x <= 30; $x++) {\n DB::table('offers')->insert([\n \"product\" => $name,\n \"type\" => $attrs['type'],\n \"origin\" => $attrs['origin'],\n \"package\" => $attrs['package'],\n \"price_min\" => rand(1,20),\n \"price_max\" => rand(20,75),\n \"date\" => new MongoDB\\BSON\\UTCDateTime(new DateTime('2018-01-'.$x)),\n \"market_id\" => new ObjectID($wgro->id),\n ]);\n }\n }\n\n foreach ($this->products as $name => $attrs) {\n for ($x = 10; $x <= 30; $x++) {\n DB::table('offers')->insert([\n \"product\" => $name,\n \"type\" => $attrs['type'],\n \"origin\" => $attrs['origin'],\n \"package\" => $attrs['package'],\n \"price_max\" => rand(15,50),\n \"price_min\" => rand(1,14),\n \"date\" => new MongoDB\\BSON\\UTCDateTime(new DateTime('2018-01-'.$x)),\n \"market_id\" => new ObjectID($lrh->id),\n ]);\n }\n }\n\n foreach ($this->products as $name => $attrs) {\n for ($x = 10; $x <= 30; $x++) {\n DB::table('offers')->insert([\n \"product\" => $name,\n \"type\" => $attrs['type'],\n \"origin\" => $attrs['origin'],\n \"package\" => $attrs['package'],\n \"price_max\" => rand(15,50),\n \"price_min\" => rand(1,14),\n \"date\" => new MongoDB\\BSON\\UTCDateTime(new DateTime('2018-01-'.$x)),\n \"market_id\" => new ObjectID($elizowka->id),\n ]);\n }\n }\n\n foreach ($this->products as $name => $attrs) {\n for ($x = 10; $x <= 30; $x++) {\n DB::table('offers')->insert([\n \"product\" => $name,\n \"type\" => $attrs['type'],\n \"origin\" => $attrs['origin'],\n \"package\" => $attrs['package'],\n \"price_max\" => rand(15,50),\n \"price_min\" => rand(1,14),\n \"date\" => new MongoDB\\BSON\\UTCDateTime(new DateTime('2018-01-'.$x)),\n \"market_id\" => new ObjectID($agrohurt->id),\n ]);\n }\n }\n }", "private function prepareIndustryGreedyData() {\n $industry_greedy_data = $this->toArray();\n return $industry_greedy_data;\n }", "private function instantiateAll() {\n $this->Corporations = new Corporations($this);\n $this->MemberTracking = new MemberTracking($this);\n $this->Characters = new Characters($this);\n $this->Stations = new Stations($this);\n $this->Facilities = new Facilities($this);\n $this->Industry = new Industry($this);\n $this->Markets = new Markets($this);\n $this->Universe = new Universe($this);\n $this->Contracts = new Contracts($this);\n $this->Wallet = new Wallet($this);\n $this->Assets = new Assets($this);\n $this->Killmails = new Killmails($this);\n $this->Status = new Status($this);\n $this->Usage = new Usage($this);\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->organismes = new ArrayCollection();\n $this->reponses = new ArrayCollection();\n $this->tags = new ArrayCollection(); \n $this->categories = new \\Doctrine\\Common\\Collections\\ArrayCollection();\n }", "protected function _prepareCollection()\n {\n $collection = $this->collectionFactory->create();\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }", "public function __construct()\n {\n \t$this->cities = new ArrayCollection();\n }", "public function getTransformedCollection( ) {\n $response[\"data\"] = [];\n foreach ( (new static)->get() as $industry_object) {\n $response['data'][] = $industry_object->getBeforeStandard();\n }//foreach ( (new static)->get() as $industry_object)\n return $response;\n }", "protected function _prepareCollection($resultSet)\n {\n $entities = array();\n foreach ($resultSet as $row) {\n $entity = new Model\\Translation(array(\n 'translationId' => $row['translation_id'],\n 'baseId' => $row['base_id'],\n 'locale' => $row['locale'],\n 'currentTranslation' => $row['current_translation'],\n 'unclearTranslation' => $row['unclear_translation'],\n ));\n $entities[$row['translation_id']] = $entity;\n }\n return $entities;\n }", "public function getCollection()\n {\n $store = Mage::app()->getRequest()->getParam('store');\n $website = Mage::app()->getRequest()->getParam('website');\n if ($store) {\n /** @var Mage_Core_Model_Config_Element $cfg */\n $storeId = Mage::getConfig()->getNode('stores')->{$store}->{'system'}->{'store'}->{'id'}->asArray();\n } elseif ($website) {\n /** @var Mage_Core_Model_Config_Element $cfg */\n $storeId =\n array_values(Mage::getConfig()->getNode('websites')->{$website}->{'system'}->{'stores'}->asArray());\n } else {\n $storeId = 0;\n }\n\n return Mage::getModel('cms/mysql4_page_collection')\n ->addStoreFilter($storeId)\n ->addFieldToFilter('is_active', 1)\n ->addFieldToFilter('identifier', array(array('nin' => array('no-route', 'enable-cookies'))));\n\n }", "private function _getDataProviderEmpty3()\n {\n return [\n [\n 'containerDesignBlockId' => ' ',\n 'titleDesignBlockId' => ' ',\n 'titleDesignTextId' => ' ',\n 'descriptionDesignBlockId' => ' ',\n 'descriptionDesignTextId' => ' ',\n 'paginationDesignBlockId' => ' ',\n 'paginationItemDesignBlockId' => ' ',\n 'paginationItemDesignTextId' => ' ',\n ],\n [\n 'containerDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'titleDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'titleDesignTextModel' => [\n 'size' => 0\n ],\n 'descriptionDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'descriptionDesignTextModel' => [\n 'size' => 0\n ],\n 'paginationDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'paginationItemDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'paginationItemDesignTextModel' => [\n 'size' => 0\n ],\n ],\n [\n 'containerDesignBlockId' => null,\n 'titleDesignBlockId' => null,\n 'titleDesignTextId' => null,\n 'descriptionDesignBlockId' => null,\n 'descriptionDesignTextId' => null,\n 'paginationDesignBlockId' => null,\n 'paginationItemDesignBlockId' => null,\n 'paginationItemDesignTextId' => null,\n ],\n [\n 'containerDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'titleDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'titleDesignTextModel' => [\n 'size' => 0\n ],\n 'descriptionDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'descriptionDesignTextModel' => [\n 'size' => 0\n ],\n 'paginationDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'paginationItemDesignBlockModel' => [\n 'marginTop' => 0\n ],\n 'paginationItemDesignTextModel' => [\n 'size' => 0\n ],\n ],\n ];\n }", "protected function _createSubset() {}", "public static function all() {\n\n $db = Zend_Registry::get('dbAdapter');\n $result = $db->query('select id from companys')->fetchAll();\n $companys = new SplObjectStorage();\n foreach ($result as $c) {\n try {\n $company = new Yourdelivery_Model_Company($c['id']);\n } catch (Yourdelivery_Exception_Database_Inconsistency $e) {\n continue;\n }\n $companys->attach($company);\n }\n return $companys;\n }", "public function all()\n {\n // set the url\n $url = self::$apiUrl . self::$servicePoint;\n\n // get a raw response\n self::$rawData = self::apiCall($url, '', array('headers' => array('Accept: ' . self::$httpAccept), 'options' => $this->getOptions()));\n\n // decode it and set php native rough data....\n if (self::$httpAccept == 'application/xml') {\n self::$data = simplexml_load_string(self::$rawData);\n } elseif (self::$httpAccept == 'application/json') {\n self::$data = json_decode(self::$rawData);\n }\n\n $data = self::getData();\n\n if (is_object($data) && property_exists($data, 'context')) {\n $context = (array)$data->context;\n } else {\n $context = null;\n }\n\n $model = self::$model;\n $class = 'MIMAS\\\\Service\\Jorum\\\\' . strtoupper(substr($model, 0, 1)) . substr($model, 1);\n\n $data = array();\n\n foreach (self::getData()->$model as $i => $object) {\n $data[] = new $class((array)$object);\n }\n\n $ret = new \\MIMAS\\Service\\DataCollection($data, $context);\n\n return ($ret);\n }", "function mapSkyscrapers($items = null) {\n\tstatic $skyscrapers = null;\n\tif(is_null($skyscrapers)) $skyscrapers = new PageArray();\n\tif(!is_null($items) && $items instanceof PageArray) $skyscrapers->add($items);\n\treturn $skyscrapers;\n}", "protected function _prepareCollection()\n {\n $collection = $this->_createCollection()->addCustomerIdFilter($this->_getCustomer()->getId())\n ->resetSortOrder()\n ->addDaysInWishlist()\n ->addStoreData();\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }", "public function initShoppingCarts()\n\t{\n\t\t$this->collShoppingCarts = array();\n\t}", "public function run()\n {\n $tags = collect(['science', 'sport', 'games', 'porn', 'memes']);\n $tags->each(function ($tagName) {\n Tag::create(['name' => $tagName]);\n });\n }", "public function populateCollection() {\n\t\tif(empty($this->rawData)) {\n\t\t\treturn;\n\t\t}\n\n\t\tforeach($this->rawData as $item) {\n\t\t\t$feedItem = new TwitterItemAdapter($item);\n\t\t\t$this->feed->addItem($feedItem);\n\t\t}\n\t}", "public function getFeedCollection($websiteId)\n {\n // Create collection (of sales order items\n $collection = Mage::getResourceModel('sales/order_item_collection');\n\n $collection // tried to use an array here, but it kept giving an error\n ->addAttributeToSelect('order_id')\n ->addAttributeToSelect('created_at')\n ->addAttributeToSelect('product_id')\n ->addAttributeToSelect('qty_ordered')\n ->addAttributeToSelect('base_price')\n ->addAttributeToSelect('base_row_total')\n ->addAttributeToSelect('base_original_price')\n ->addAttributeToSelect('parent_item_id');\n\n //filter out child products\n $collection->addAttributeToFilter('parent_item_id', array('null' => true));\n\n // Filter collection for current website\n // need to join to core_store table and grab website_id field\n $collection->getSelect()\n ->joinLeft('core_store', 'main_table.store_id = core_store.store_id', 'core_store.website_id')\n ->where('core_store.website_id = ' . $websiteId);\n\n // Join order item up with main order record for subtotals and emails\n $collection->getSelect()\n ->joinLeft('sales_flat_order', 'main_table.order_id = sales_flat_order.entity_id', array('base_subtotal', 'customer_email', 'increment_id'));\n\n //get the visibility data from the product's attribute data\n //thanks Vanai\n $attributeCode = 'visibility';\n $alias = $attributeCode . '_table';\n $attribute = Mage::getSingleton('eav/config')\n ->getAttribute(Mage_Catalog_Model_Product::ENTITY, $attributeCode);\n\n $collection->getSelect()\n ->join(\n array($alias => $attribute->getBackendTable()),\n \"main_table.product_id = $alias.entity_id AND $alias.attribute_id={$attribute->getId()}\",\n array($attributeCode => 'value')\n );\n\n\n //addExpressionAttributeToSelect does not work for the order_item_collection model\n //use the send columns function to add the if directly\n $collection\n ->getSelect()->columns(array('calc_product_id' =>\n 'if((product_type=\"grouped\" and `visibility_table`.`value` = ' . Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE . '),\n \t if(LOCATE(\\'super_product_config\\', product_options)>0,\n \t\t CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(product_options,\\'super_product_config\\',-1), \\'product_id\\',-1), \\'\";\\',2),\\':\"\\',-1) AS UNSIGNED),\n \t\t 0),\n \t `main_table`.`product_id`)'));\n\n\t\t// Add alias for entity_id column to use with throttle function\n\t\t$collection->getSelect()\n\t\t\t->columns(array('entity_id' => 'main_table.item_id'));\n\n // order by order item id\n $collection->getSelect()\n ->order('main_table.item_id');\n\n //fix problems with some installs returning multiple identical rows\n $collection->getSelect()\n ->distinct();\n\n // Return collection\n return $collection;\n }", "protected function _prepareCollection()\n {\n $collection = Mage::getModel('sales/order_shipment')->getCollection();\n $tableName = Mage::getSingleton('core/resource')->getTableName('sales_flat_order');\n\n $collection->getSelect()->joinLeft(array('o'=>$tableName), 'main_table.order_id=o.entity_id', array(\n 'order_increment_id'=>'o.increment_id',\n 'order_created_date'=>'o.created_at',\n 'o.shipping_description'));\n\n $collection->addFieldToFilter('o.shipping_description', array('like'=>'%canpar%'));\n $tableName = Mage::getSingleton('core/resource')->getTableName('ch_canpar_shipment');\n\n $collection->getSelect()->joinLeft(array('ch_shipment'=>$tableName), 'main_table.entity_id=ch_shipment.magento_shipment_id',array(\n 'canpar_shipment_id'=>'shipment_id',\n 'manifest_id'=>'manifest_id'));\n\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "public function group(): Collection;", "public function getWarehouses(): Collection\n\t{\n\t\treturn collect($this->warehouses)\n\t\t\t\t\t\t->map(function ($item) {\n\t\t\t\t\t\t\treturn $item->warehouse;\n\t\t\t\t\t\t})\n\t\t\t\t\t\t->unique('id')\n\t\t\t\t\t\t->values();\n\t}", "public function __construct() {\n $this->bestellijn = new ArrayCollection();\n }", "protected function _prepareCollection() {\n $session = Mage::getModel('core/session');\n $filterConditions = $session->getData('rp_conditions');\n if (!$filterConditions)\n $filterConditions = $this->_filterConditions;\n $posorderCollection = Mage::getModel('webpos/posorder')->getCollection();\n /* Jack - create an empty collection */\n $collection = $posorderCollection;\n foreach ($collection->getItems() as $key => $item) {\n $collection->removeItemByKey($key);\n }\n /**/\n\n /* Define variables and set default data */\n $totalsSalesByUser = array();\n $totalSales = 0;\n $incTimeStrings = array('1' => ' +1 week', '2' => ' +1 day', '3' => ' +1 month', '4' => ' +1 day', '5' => ' +1 day', '6' => ' +1 week', '7' => ' +1 week');\n $descTimeStrings = array('4' => ' -1 week', '5' => ' -1 week', '6' => ' -1 month', '7' => ' -1 month');\n $periodFormat = ($filterConditions['period'] == 3 || $filterConditions['period'] == 6 || $filterConditions['period'] == 7 ) ? \"Y-m-d\" : \"Y-m-d\";\n $specialPeriod = array('1', '2', '3', '4');\n $stringTimeFrom = array('1' => 'monday this week', '2' => 'monday last week', '3' => 'first day of this month', '4' => 'first day of previous month');\n $stringTimeTo = array('1' => 'sunday this week', '2' => 'sunday last week', '3' => 'last day of this month', '4' => 'last day of previous month');\n $thisFriday = date($periodFormat, strtotime('friday this week'));\n $today = date($periodFormat);\n $userIds = $this->userIds;\n if (($filterConditions['from'] == '' || $filterConditions['to'] == '' ) && in_array($filterConditions['period'], $specialPeriod) == false) {\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }\n\n $startTime = (in_array($filterConditions['range'], $specialPeriod)) ? (date($periodFormat, strtotime($stringTimeFrom[$filterConditions['range']]))) : date($periodFormat, strtotime($filterConditions['from']));\n $timeFrom = (in_array($filterConditions['range'], $specialPeriod)) ? (date($periodFormat, strtotime($stringTimeFrom[$filterConditions['range']]))) : date($periodFormat, strtotime($filterConditions['from']));\n $timeTo = (in_array($filterConditions['range'], $specialPeriod)) ? (date($periodFormat, strtotime($stringTimeTo[$filterConditions['range']]))) : date(\"Y-m-d\", strtotime($filterConditions['to']));\n if ($timeFrom && $timeTo) {\n while ($timeFrom <= $timeTo) {\n $i = 0;\n foreach ($this->userIds as $userId => $displayName) {\n $isSave = true;\n $totalSalesOfPeriod = 0;\n $isEmpty = true;\n if ($filterConditions['period'] == 1) {\n $endTime = $this->lastDayOf('year', new DateTime($timeFrom))->format('Y-m-d');\n } else if ($filterConditions['period'] == 3) {\n $endTime = $this->lastDayOf('month', new DateTime($timeFrom))->format('Y-m-d');\n } else\n $endTime = date('Y-m-d', strtotime($timeFrom . $incTimeStrings[$filterConditions['period']]));\n $endTime = (strtotime($endTime) < strtotime($timeTo)) ? $endTime : $timeTo;\n $itemDataObject = new Varien_Object();\n if ($i == 0) {\n if ($filterConditions['period'] == 1) {\n $exTimeFrom = explode('-', $timeFrom);\n $itemDataObject->setData('period', $exTimeFrom[0]);\n } else if ($filterConditions['period'] == 3) {\n $exTimeFrom = explode('-', $timeFrom);\n $itemDataObject->setData('period', $exTimeFrom[0] . '-' . $exTimeFrom[1]);\n } else\n $itemDataObject->setData('period', $timeFrom);\n } else\n $itemDataObject->setData('period', '');\n if ($itemDataObject->getData('period'))\n $itemDataObject->setData('period', date('F j, Y', strtotime($itemDataObject->getData('period'))));\n $webposOrderCollection = $this->getSalesCollection($timeFrom, $endTime, array('user_id' => $userId));\n $totalU = 0;\n if (count($webposOrderCollection) > 0) {\n foreach ($webposOrderCollection as $order) {\n $totalU += $order->getTotals();\n }\n }\n if (!$totalU && $filterConditions['rp_settings']['show_empty_result'] == 'false')\n $isSave = false;\n\n if ($isSave) {\n $itemDataObject->setData('user', $displayName);\n\n $itemDataObject->setData('totals_sales', ($totalU > 0) ? $totalU : '0.00');\n $collection->addItem($itemDataObject);\n }\n $i++;\n }\n if ($filterConditions['period'] == 1)\n $timeFrom = date('Y-m-d', strtotime($endTime));\n else\n $timeFrom = date($periodFormat, strtotime($timeFrom . $incTimeStrings[$filterConditions['period']]));\n }\n /* get last item data \n $i = 0;\n foreach($this->userIds as $userId => $displayName){\n $isSave = true;\n $beforeLastItem = new Varien_Object();\n if($i == 0){\n if($filterConditions['period'] == 1){\n $exTimeFrom = explode('-',$timeTo);\n $beforeLastItem->setData('period',$exTimeFrom[0]);\n }\n else if($filterConditions['period'] == 3){\n $exTimeFrom = explode('-',$timeTo);\n $beforeLastItem->setData('period',$exTimeFrom[0].'-'.$exTimeFrom[1]);\n }\n else\n $beforeLastItem->setData('period',$timeTo);\n }\n else\n $beforeLastItem->setData('period','');\n if($beforeLastItem->getData('period'))\n $beforeLastItem->setData('period',date('F j, Y', strtotime($beforeLastItem->getData('period'))));\n $webposOrderCollection = $this->getSalesCollection($timeTo,$timeTo,array('user_id' => $userId))->getFirstItem();\n if( !$webposOrderCollection->getTotals() && $filterConditions['rp_settings']['show_empty_result'] == 'false')\n $isSave = false;\n if($isSave){\n $beforeLastItem->setData('user',$displayName);\n $beforeLastItem->setData('totals_sales',$webposOrderCollection->getTotals()?$webposOrderCollection->getTotals():'0.00');\n $collection->addItem($beforeLastItem);\n }\n $i++;\n }\n end last item */\n }\n /* set data for totals row */\n $lastItemDataObject = new Varien_Object();\n $lastItemDataObject->setData('period', 'Totals:');\n $orders = $this->getSalesTotal($startTime, $endTime);\n\n $totalU = 0;\n if (count($orders) > 0) {\n foreach ($orders as $order) {\n $totalU += $order->getTotals();\n }\n }\n $lastItemDataObject->setData('totals_sales', $totalU);\n $collection->addItem($lastItemDataObject);\n $this->setCollection($collection);\n /* set session for chart */\n $sessionObject = new Varien_Object();\n foreach ($this->userIds as $userId => $username) {\n $orders = $this->getSalesTotal($startTime, $endTime, array('user_id' => $userId));\n\n\n $totalU = 0;\n if (count($orders) > 0) {\n foreach ($orders as $order) {\n $totalU += $order->getTotals();\n }\n }\n $sessionObject->setData($username, $totalU);\n }\n Mage::getSingleton('core/session')->setData('total_sales_by_user', $sessionObject->toArray());\n Mage::getSingleton('core/session')->setType('user');\n $this->setTotalRowByUser($sessionObject->toArray());\n return parent::_prepareCollection();\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Pack::truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n \n // // Create 15 records of packs\n factory(App\\Pack::class, 15)->create();\n\n\n\n factory(App\\Pack::class, 5)->create()->each(function($pack){\n $pack->tags()->attach( Tag::where('name', 'drums')->first() );\n });\n\n factory(App\\Pack::class, 5)->create()->each(function($pack){\n $pack->tags()->attach( Tag::where('name','collections')->first() );\n });\n\n factory(App\\Pack::class, 5)->create()->each(function($pack){\n $pack->tags()->attach( Tag::where('name', 'basses')->first() );\n });\n }", "public function __construct() {\n $this->reservations = new ArrayCollection();\n }", "public function createCollection($name) {}", "public function stores()\n {\n $object_manager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n $store_manager = $object_manager->get('\\Magento\\Store\\Model\\StoreManagerInterface');\n $stores = $store_manager->getStores();\n\n $hydrated_stores = array();\n foreach ($stores as $store) {\n $store_id = $store->getId();\n $store_website_id = $store->getWebsiteId();\n $store_name = $store->getName();\n $store_code = $store->getCode();\n $base_url = $store->getBaseUrl();\n $media_base_url = $store->getBaseUrl(\\Magento\\Framework\\UrlInterface::URL_TYPE_MEDIA);\n\n array_push($hydrated_stores, array(\n 'id' => $store_id,\n 'website_id' => $store_website_id,\n 'name' => $store_name,\n 'code' => $store_code,\n 'base_url' => $base_url,\n 'media_base_url' => $media_base_url,\n ));\n }\n\n return $hydrated_stores;\n }", "public function testWithAllNonExistentTags(): void\n {\n /** @var Collection $models */\n $models = TestModel::withAllTags('Apple,Kumquat')->get();\n\n self::assertEmpty($models);\n }", "function _prepareVertexTypes() {\n\t\t//Load Model of Relations\n\t\t$this->loadModel('VertexType');\n\t\t$this->VertexType = new VertexType();\n\t\t\n\t\t$this->VertexType->contain();\n\t\t$vertexTypes = $this->VertexType->find('list', array('conditions' => array('VertexType.deleted' => '0'), 'order' => 'VertexType.title'));\n\t\t$this->set(compact('vertexTypes',$vertexTypes));\n\t}", "public function getAll(): Collection\n {\n if (count($this->catalog)) {\n return $this->catalog;\n }\n if ($this->attached) {\n return $this->attached->getAll();\n }\n throw new \\Exception(\"Missing catalog data\");\n }", "public function createCollection($data = array());", "function getDataSets()\n {\n if ($this->getResource('wdrs:describedby')){\n $dataset = $this->getResource('wdrs:describedby')->all('void:inDataset');\n }else {\n $schemaUrls = $this->allResources('schema:url');\n $describedBy = array_filter($schemaUrls, function($schemaUrl)\n {\n return(strpos($schemaUrl->getURI(), 'worldcat.org/title'));\n });\n $describedBy = array_shift($describedBy);\n $dataset = $describedBy->all('void:inDataset');\n }\n \n return $dataset;\n }", "protected function _initAttributeSets()\n {\n foreach ($this->_setColFactory->create()->setEntityTypeFilter($this->_entityTypeId) as $attributeSet) {\n $this->_attrSetNameToId[$attributeSet->getAttributeSetName()] = $attributeSet->getId();\n $this->_attrSetIdToName[$attributeSet->getId()] = $attributeSet->getAttributeSetName();\n }\n return $this;\n }", "protected function _prepareCollection()\n\t{\n\t\t$collection = Mage::getResourceModel($this->_getCollectionClass());\n\t\t$this->setCollection($collection);\n\t\t \n\t\treturn parent::_prepareCollection();\n\t}", "protected function _prepareCollection() {\n $collection = Mage::getModel('vidtest/video')\n ->getCollection()\n ->addProductFilter($this->getProduct()->getId())\n ;\n\n if ($storeId = $this->getProduct()->getStoreId()) {\n $collection->addStoreFilter($storeId);\n }\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "public function import()\n {\n $itemTypeId = $this->_insertItemType();\n \n // Insert the Omeka collection.\n $collectionOmekaId = $this->_insertCollection();\n \n // Insert an Omeka item for every Sept11 object.\n foreach ($this->_fetchCollectionObjectsSept11() as $object) {\n \n $metadata = array('item_type_id' => $itemTypeId);\n \n // Set the story.\n $xml = new SimpleXMLElement($object['OBJECT_ABSOLUTE_PATH'], null, true);\n $elementTexts = array(\n ElementSet::ITEM_TYPE_NAME => array(\n 'SEIU Story: Story' => array(array('text' => $xml->STORY, 'html' => false)), \n 'SEIU Story: Local Union' => array(array('text' => $xml->LOCAL_UNION, 'html' => false)), \n )\n );\n \n $itemId = $this->_insertItem($collectionOmekaId, $object, $metadata, $elementTexts);\n }\n }", "protected function createCollection($website, $pageNumber)\n {\n }", "public function init()\n {\n $this->bases = new \\Doctrine\\Common\\Collections\\ArrayCollection();\n }", "public function containers()\n {\n }", "public function __construct()\n {\n $this->items = new Collection;\n }", "public function __construct()\n {\n $this->items = new Collection;\n }", "protected function _prepareCollection() {\n /**\n * Get the Collection of Manage Subscription\n */\n $manageSubscription = Mage::getModel ( 'airhotels/managesubscriptions' )->getCollection ();\n \n /**\n * Get the Table Prefix Value\n */\n $tablePrefix = Mage::getConfig ()->getTablePrefix ();\n $manageSubscription->getSelect ()->group ( 'main_table.product_id' )->joinLeft ( $tablePrefix . 'apptha_productsubscriptions', 'main_table.product_id =' . $tablePrefix . 'apptha_productsubscriptions.product_id AND ' . $tablePrefix . 'apptha_productsubscriptions.is_delete = 0', array (\n 'main_table.id as id',\n 'main_table.product_name as product_name',\n $tablePrefix . 'apptha_productsubscriptions.subscription_type as subscription_type' \n ) )->where ( 'main_table.is_subscription_only = ?', 1 );\n \n $collection = $manageSubscription;\n $this->setCollection ( $collection );\n /**\n * Calling the parent Construct Method.\n */\n return parent::_prepareCollection ();\n }", "public function test_comicEntityIsCreated_collections_setCollections()\n {\n $sut = $this->getSUT();\n $collections = $sut->getCollections();\n $expected = [\n ComicSummary::create(\n 'http://collectionResourceURINumber1',\n 'collection name number 1'\n ),\n ComicSummary::create(\n 'http://collectionResourceURINumber2',\n 'collection name number 2'\n ),\n ];\n\n $this->assertEquals($expected, $collections);\n }", "private function create_collection() {\n\n\t\treturn new MapCollection();\n\t}", "protected function _prepareCollection()\n {\n $collection = Mage::getResourceModel($this->_getCollectionClass());\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }", "public function __construct()\n {\n $this->tasks = new ArrayCollection();\n $this->comments = new ArrayCollection();\n $this->timeEntries = new ArrayCollection();\n }", "public function initGearInfos()\n\t{\n\t\t$this->collGearInfos = array();\n\t}", "protected function initStorageObjects()\n {\n \t$this->language = new \\TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage();\n \t$this->travel = new \\TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage();\n \t$this->col = new \\TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage();\n \t$this->categories = new \\TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage();\n }" ]
[ "0.5858339", "0.5833733", "0.58005047", "0.5649182", "0.5545866", "0.54580694", "0.5436958", "0.5413862", "0.54008716", "0.5366551", "0.5360134", "0.5359453", "0.5346464", "0.534306", "0.533246", "0.5330216", "0.5329883", "0.5315876", "0.53001404", "0.5298573", "0.5291162", "0.52473", "0.5237905", "0.52275664", "0.52268046", "0.52253246", "0.5216243", "0.5205631", "0.52050924", "0.5201898", "0.5187104", "0.5153663", "0.5153315", "0.51531154", "0.51192427", "0.511645", "0.511253", "0.5102721", "0.50958204", "0.5085149", "0.5076999", "0.5060654", "0.5058583", "0.50514716", "0.5050607", "0.50310254", "0.5016027", "0.501351", "0.50084955", "0.50079113", "0.4986096", "0.4984275", "0.49792185", "0.49787948", "0.49773362", "0.49701577", "0.4952651", "0.4946019", "0.49437892", "0.49385542", "0.49282536", "0.49271527", "0.49109417", "0.49098298", "0.4906632", "0.49054363", "0.49016318", "0.48950645", "0.48754674", "0.48656178", "0.48606712", "0.48597503", "0.48562688", "0.48453775", "0.4842201", "0.4840846", "0.48341072", "0.48284057", "0.48194292", "0.481923", "0.4816485", "0.48102516", "0.48062122", "0.4799797", "0.47957116", "0.4794142", "0.47907618", "0.4790508", "0.4788655", "0.47831765", "0.47810775", "0.4780776", "0.47803062", "0.47803062", "0.47799832", "0.47790554", "0.4777025", "0.47729123", "0.4772312", "0.4766046", "0.476535" ]
0.0
-1
Determine if the user is authorized to make this request.
public function authorize(): bool { return $this->user()->can('create_contact'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authorize()\n {\n if ($this->user() !== null) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() != null;\n }", "public function authorize(): bool\n {\n return $this->user() !== null;\n }", "public function authorize(): bool\n {\n return $this->isUserAuthorised();\n }", "public function authorize()\n {\n return !is_null($this->user());\n }", "public function authorize()\n {\n return request()->user() != null;\n }", "public function authorize()\n\t{\n\t\t// if user is updating his profile or a user is an admin\n\t\tif( $this->user()->isSuperAdmin() || !$this->route('user') ){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n // this was my best guess\n return $this->user()->id === $this->route('user')->id;\n }", "public function isAuthorized()\n {\n return $this->cookieHelper->requestCookieExists('auth');\n }", "public function authorize()\n {\n return !empty(Auth::user()) && ($this->user()->isAnAdmin() || $this->user()->hasRole('user'));\n }", "public function authorize()\n {\n $originAccount = Account::find($this->get('origin_account_id'));\n return $originAccount->user_id == auth()->id();\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default:\n return $this->user()->type == 'App\\\\Staff' ? true : false;\n break;\n }\n\n return false;\n }", "public function authorize()\n {\n if($this->user()->role == \"admin\" || $this->user()->id == $this->request->get('author_id')) return true;\n else return false;\n }", "public function authorize()\n {\n if(\\Auth::guest())\n {\n return false;\n } else {\n // Action 1 - Check if authenticated user is a superadmin\n if(\\Auth::User()->hasRole('superadmin'))\n return true;\n\n // Action 2 - Find UUID from request and compare to authenticated user\n $user = User::where('uuid', $this->user_uuid)->firstOrFail();\n if($user->id == \\Auth::User()->id)\n return true;\n\n // Action 3 - Fail request\n return false;\n }\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "public function isAuthorized(): bool\n {\n // TODO: implement authorization check\n\n return true;\n }", "public function isAuthorized() {}", "public function authorize()\n {\n return request()->loggedin_role === 1;\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n if ($this->isEdit() && !is_null($this->model)) {\n if (!user()->hasPermissionTo('Administrations::admin.user') && $this->model->id != user()->id) {\n return false;\n }\n }\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "public function authorize()\n {\n $accessor = $this->user();\n\n return $accessor->isAdmin() || $accessor->hasKey('post-users');\n }", "public function authorize()\n {\n $user = \\Auth::getUser();\n\n return $user->user_type == 1;\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\n }", "public function authorize()\n {\n /**\n * @var User $user\n * @var Document $document\n */\n $user = Auth::user();\n $document = $this->route('document');\n\n return (int)$user->id === (int)$document->user_id;\n }", "public function authorize()\n {\n switch (true) {\n case $this->wantsToList():\n case $this->wantsToShow():\n if ($this->hasRoles(['owner', 'administrator'])) {\n return true;\n }\n break;\n case $this->wantsToStore():\n case $this->wantsToUpdate():\n case $this->wantsToDestroy():\n if ($this->hasRoles(['owner'])) {\n return true;\n }\n break;\n }\n\n return false;\n }", "public function authorize()\n {\n $user = JWTAuth::parseToken()->authenticate();\n $organisation = Organization::findOrFail($this->route('organizations'));\n return $organisation->admin_id == $user->id;\n }", "public function authorize()\n {\n if($this->user()->isAdmin())\n return true;\n\n return false;\n }", "function isAuthorized()\n {\n $authorized = parent::isAuthorized();\n return $authorized;\n }", "public function authorize()\n {\n $user = auth('web')->user();\n if ($user && $user->active) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n $this->user = User::query()->find($this->route()->parameter('user'));\n $this->merge(['verified' => $this->get('verified') ? 1 : 0]);\n\n return true;\n }", "public function authorize()\n {\n $user = request()->user('api');\n return $user->isSenior();\n }", "public function authorize()\n {\n return is_client_or_staff();\n }", "public function isAuthorized() {\n\t\treturn true;\n\t}", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin'])) {\n return true;\n } else {\n return false;\n }\n }", "public function isAuthorized()\n\t{\n\t\t$sessionVal = Yii::$app->session->get($this->sessionParam);\n\t\treturn (!empty($sessionVal));\n\t}", "public function authorize() {\n\n return auth()->user() && auth()->user()->username === $this->user->username;\n }", "public function authorize()\n {\n return session('storefront_key') || request()->session()->has('api_credential');\n }", "public function authorize()\n {\n if ($this->user()->isAdmin($this->route('organization'))) {\n return true;\n }\n\n return false;\n\n }", "public function authorize()\n {\n return $this->user() && $this->user()->role === Constants::USER_ROLE_ADMIN;\n }", "public function authorized()\n {\n return $this->accepted && ! $this->test_mode;\n }", "public function authorize()\n {\n if (!auth()->check()) {\n return false;\n }\n return true;\n }", "public function hasAuthorized() {\n return $this->_has(1);\n }", "public function authorize()\n {\n $resource = Resource::find($this->route('id'));\n\n if (!$resource) {\n return true;\n }\n\n return $resource && $this->user()->can('access', $resource);\n }", "public function authorize()\n {\n /*\n if ($this->loan_id && is_numeric($this->loan_id) && $loan = Loan::whereId($this->loan_id)->first()) {\n // loan_id belongs to requesting user\n return $loan && $this->user()->id == $loan->user_id;\n }\n */\n return true; // let rules handle it\n }", "public function authorize()\n {\n //TODO Authorice Request (without Controller)\n return auth()->user()->role_id === 1;\n }", "public function authorize(): bool\n {\n return $this->user()->id === $this->article->user->id;\n }", "public function authorize()\n {\n return $this->user()->rol == 'admin' ? true : false;\n }", "public function isAuth()\n {\n return $this->session->hasAuthorisation();\n }", "public function authorize()\n {\n if(Auth::user())\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin', 'hrmanager', 'hruser'])) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n return \\Auth::check() ? true : false;\n }", "public function authorize()\n\t{\n\t\treturn true; //no user checking\n\t}", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return !empty(Auth::user());\n }", "public function authorize()\n {\n return $this->groupHasUser() || $this->hasSeller();\n }", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function isAuthorized() {\n\t\t\n\t}", "public function authorize()\n {\n if(Auth::check())\n {\n return (Auth::user()->has_world_admin_access);\n }\n return false;\n }", "public function authorize()\n {\n if (!\\Auth::guest()) {\n $user = \\Auth::getUser();\n if ($user->type == User::USER_TYPE_ADMIN) {\n return true;\n }\n }\n\n return false;\n }", "public function authorize()\n {\n if (auth()->user()->is_admin) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n if ($this->user()->is_admin){\n return true;\n }\n else if ($this->method == \"PUT\"){\n if ($this->user()->id == $this->input('id')){\n return true;\n }\n }\n return false;\n }", "public function authorize(): bool\n {\n return parent::authorize() && (int)$this->playList->user_id === auth()->user()->id;\n }", "public function authorize() {\n\t\treturn $this->user()->is_admin;\n\t}", "public function authorize()\n {\n if (Auth::check()) {\n \n return true;\n \n }\n return false;\n }", "public function authorize()\n {\n $user = Auth::user();\n return $user && $user->rol == 'admin';\n }", "public function authorize()\n\t{\n\t\t// Nutzern akzeptiert werden\n\t\tif(Auth::check())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n // TODO: Check if has business\n return session()->has('id');\n }", "public function authorize()\n {\n if (auth()->check() && auth()->user()->isAdmin()) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n return $this->auth->check();\n }", "public function authorize() {\n\t\t$user = \\Auth::user();\n\n\t\tif ( $user->isAdmin() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function authorize()\n {\n if (auth()->user()->isAdmin() || auth()->user()->isCustomer()) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->container['auth']->check();\n }", "function isAuthorized($request) {\n return true;\n }", "public function authorize()\n {\n return Auth::guest() || isMember();\n }", "public function authorize()\n {\n return auth()->user() && auth()->user()->isCeo();\n }", "public function authorize(): bool\n {\n $deckId = $this->request->get('deck_id');\n $userId = Deck::whereKey($deckId)->value('user_id');\n\n return $userId === user()->id;\n }", "public function authorize()\n {\n return Auth::check() && Auth::user()->is_contractor;\n }", "public function authorize()\n {\n return TRUE;\n }", "public function authorize()\n {\n $user = User::find($this->id);\n\n if (!$user) {\n $user = User::where('no_ahli', $this->no_ahli)->first();\n }\n if ($user && $user->id == auth()->user()->id) return true;\n if (auth()->user()->is('admin')) return true;\n\n return false;\n }", "public function authorize()\n {\n # if it's false, it will rejected\n return true;\n }", "public function authorize()\n {\n $isValid = auth()->user()->is($this->route('task')->attempt->checklist->owner);\n\n return $isValid;\n }", "public function authorize()\n {\n $user = Auth::user();\n\n return ($user->getRole() == 'admin');\n }", "public function is_authorized() {\n\t\t$authorized = true;\n\t\tif ( $this->is_access_token_expired() ) {\n\t\t\t$authorized = false;\n\t\t}\n\n\t\treturn $authorized;\n\t}", "public function authorize()\n {\n $user = User::findOrFail($this->route('id'));\n\n return $user->hasRole('admin') || $user->hasRole('teacher');\n }", "public function authorize()\n {\n $project = \\App\\Project::find($this->request->get('project'));\n return $project && $project->isManager($this->user()->name);\n }", "public function isAuthorized() {\n\t\treturn (bool)$this->_storage->hasData();\n\t}", "public function authorize()\n {\n $idExpense = $this->input('expense');\n $expense = Expense::find($idExpense);\n\n return $expense && $this->user()->id == $expense->user_id;\n }", "public function authorize()\n {\n // User system not implemented\n return true;\n }", "public function authorize() : bool\n {\n // TODO check request to xhr in middleware\n return true;\n }", "public function authorize()\n {\n $organizationId = (string) $this->route('id');\n\n $this->organization = Organization::findByUuidOrFail($organizationId);\n\n return $this->user()->can('show', [Organization::class, $this->organization]);\n }", "public function authorize()\n {\n $user = $this->findFromUrl('user');\n return $this->user()->can('update', $user);\n }", "public function authorize()\n {\n $user = Auth::user();\n $orderElement = OrderElement::find($this->input(\"order_element_id\"));\n $order = $orderElement->order;\n\n if ($user->id == $order->user_id) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n $current_user = auth()->user();\n $convention = Convention::find($this->route('convention_id'));\n\n // Use ClientPolicy here to authorize before checking the fields\n return $current_user->can('store', Convention::class)\n || $current_user->can('update', $convention);\n }", "public function authorize()\n {\n if (session()->has('user'))\n {\n $participantController = new ParticipantController();\n\n return !$participantController->isParticipating($this->input('id_user'), $this->input('id_event'));\n }\n else\n {\n return false;\n }\n }", "public function authorize()\n {\n return (Auth::user()->allowSuperAdminAccess || Auth::user()->allowAdminAccess);\n }" ]
[ "0.8401071", "0.8377486", "0.8377486", "0.8344406", "0.8253731", "0.824795", "0.8213121", "0.8146598", "0.81115526", "0.8083369", "0.7991986", "0.79907674", "0.79836637", "0.79604936", "0.79516214", "0.79494005", "0.79265946", "0.7915068", "0.79001635", "0.7894822", "0.7891453", "0.7890965", "0.7862504", "0.78414804", "0.78414804", "0.7837965", "0.78248763", "0.7812292", "0.7809632", "0.77928597", "0.7788316", "0.7781619", "0.77815884", "0.7763308", "0.7754035", "0.7717961", "0.7717961", "0.77171147", "0.77138597", "0.7705001", "0.7693082", "0.7692783", "0.76915383", "0.76909506", "0.76733255", "0.7667128", "0.7665592", "0.7656238", "0.7650853", "0.764326", "0.76431626", "0.76431614", "0.7635147", "0.76311624", "0.76294273", "0.7627076", "0.76207024", "0.76207024", "0.76139116", "0.76036394", "0.76035625", "0.76035625", "0.76032084", "0.7602515", "0.76007926", "0.75971127", "0.7588128", "0.7586303", "0.7581912", "0.7563037", "0.7554785", "0.75526226", "0.755171", "0.75436753", "0.75432944", "0.7540682", "0.7538806", "0.75280696", "0.751548", "0.75149626", "0.7501161", "0.74959517", "0.74956346", "0.74911124", "0.7489147", "0.74858016", "0.748033", "0.7478443", "0.7472642", "0.7472576", "0.7465409", "0.7464371", "0.74630046", "0.7462218", "0.7461453", "0.7449168", "0.74399257", "0.74358094", "0.7433247", "0.7432659", "0.74248093" ]
0.0
-1
Get the validation rules that apply to the request.
public function rules(): array { return [ 'option_toggle' => 'sometimes|required', 'import_file' => 'required_if:option_toggle,on|mimes:csv,txt', 'delimiter' => 'required_with:recipients', ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rules()\n {\n $commons = [\n\n ];\n return get_request_rules($this, $commons);\n }", "public function getRules()\n {\n return $this->validator->getRules();\n }", "public function getValidationRules()\n {\n $rules = [];\n\n // Get the schema\n $schema = $this->getSchema();\n\n return $schema->getRules($this);\n }", "public function rules()\n {\n return $this->validationRules;\n }", "public function rules()\n {\n $rules = [];\n switch ($this->getMethod()):\n case \"POST\":\n $rules = [\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"PUT\":\n $rules = [\n 'id' => 'required|numeric',\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"DELETE\":\n $rules = [\n 'id' => 'required|numeric'\n ];\n break;\n endswitch;\n return $rules;\n }", "public static function getRules()\n {\n return (new static)->getValidationRules();\n }", "public function getRules()\n {\n return $this->validation_rules;\n }", "public function getValidationRules()\n {\n return [];\n }", "public function getValidationRules() {\n return [\n 'email' => 'required|email',\n 'name' => 'required|min:3',\n 'password' => 'required',\n ];\n }", "public function rules()\n {\n if($this->isMethod('post')){\n return $this->post_rules();\n }\n if($this->isMethod('put')){\n return $this->put_rules();\n }\n }", "public function rules()\n {\n $rules = [];\n\n // Validation request for stripe keys for stripe if stripe status in active\n if($this->has('stripe_status')){\n $rules[\"api_key\"] = \"required\";\n $rules[\"api_secret\"] = \"required\";\n $rules[\"webhook_key\"] = \"required\";\n }\n\n if($this->has('razorpay_status')){\n $rules[\"razorpay_key\"] = \"required\";\n $rules[\"razorpay_secret\"] = \"required\";\n $rules[\"razorpay_webhook_secret\"] = \"required\";\n }\n\n // Validation request for paypal keys for paypal if paypal status in active\n if($this->has('paypal_status')){\n $rules[\"paypal_client_id\"] = \"required\";\n $rules[\"paypal_secret\"] = \"required\";\n $rules[\"paypal_mode\"] = \"required_if:paypal_status,on|in:sandbox,live\";\n }\n\n\n return $rules;\n }", "protected function getValidationRules()\n {\n $rules = [\n 'title' => 'required|min:3|max:255',\n ];\n\n return $rules;\n }", "public function getRules()\n\t{\n\t\t$rules['user_id'] = ['required', 'exists:' . app()->make(User::class)->getTable() . ',id'];\n\t\t$rules['org_id'] = ['required', 'exists:' . app()->make(Org::class)->getTable() . ',id'];\n\t\t$rules['role'] = ['required', 'string', 'in:' . implode(',', Static::ROLES)];\n\t\t$rules['scopes'] = ['nullable', 'array'];\n\t\t$rules['ended_at'] = ['nullable', 'date'];\n\t\t$rules['photo_url'] = ['nullable', 'string'];\n\n\t\treturn $rules;\n\t}", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n case 'PUT':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n }\n }", "public function rules()\n {\n\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'min:6|same:password',\n 'role_id' => 'required'\n ];\n break;\n case 'PUT':\n case 'PATCH':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n\n default:\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n }\n return $rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n switch($this->method()) {\n case 'GET':\n return [];\n case 'POST':\n return [\n 'name' => 'required|max:50',\n 'company' => 'required|max:100',\n 'position' => 'required|max:50',\n 'email' => 'required|email|max:150',\n 'phone' => 'required|max:25',\n 'description' => 'nullable|max:500',\n ];\n case 'PUT':\n case 'PATCH':\n return [\n 'name' => 'required|max:50',\n 'company' => 'required|max:100',\n 'position' => 'required|max:50',\n 'email' => 'required|email|max:150',\n 'phone' => 'required|max:25',\n 'description' => 'nullable|max:500',\n ];\n case 'DELETE':\n return [];\n default:break;\n }\n \n }", "public function rules($request) {\n $function = explode(\"@\", $request->route()[1]['uses'])[1];\n return $this->getRouteValidateRule($this->rules, $function);\n // // 获取请求验证的函数名\n // // ltrim(strstr($a,'@'),'@')\n // if (count(explode(\"@\", Request::route()->getActionName())) >= 2) {\n // $actionFunctionName = explode(\"@\", Request::route()->getActionName()) [1];\n // }\n\n // // 取配置并返回\n // if (isset($this->rules[$actionFunctionName])) {\n // if (is_array($this->rules[$actionFunctionName])) {\n // return $this->rules[$actionFunctionName];\n // }\n // else {\n // return $this->rules[$this->rules[$actionFunctionName]];\n // }\n // }\n // else {\n // return [];\n // }\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_MovieID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CountryID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_BroadCastDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t\t'_CreatedDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n {\n if ($this->method() === 'POST') {\n return $this->rulesForCreating();\n }\n\n return $this->rulesForUpdating();\n }", "public function rules()\n {\n $validation = [];\n if ($this->method() == \"POST\") {\n $validation = [\n 'name' => 'required|unique:users',\n 'email' => 'required|unique:users|email',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'required|min:6',\n 'roles' => 'required',\n ];\n } elseif ($this->method() == \"PUT\") {\n $validation = [\n 'name' => 'required|unique:users,name,' . $this->route()->parameter('id') . ',id',\n 'email' => 'required|unique:users,email,' . $this->route()->parameter('id') . ',id|email',\n 'roles' => 'required',\n ];\n\n if ($this->request->get('change_password') == true) {\n $validation['password'] = 'required|min:6|confirmed';\n $validation['password_confirmation'] = 'required|min:6';\n }\n }\n\n return $validation;\n }", "protected function getValidationRules()\n {\n $class = $this->model;\n\n return $class::$rules;\n }", "public function rules()\n {\n $data = $this->request->all();\n $rules['username'] = 'required|email';\n $rules['password'] = 'required'; \n\n return $rules;\n }", "public function rules()\n {\n $rules = $this->rules;\n\n $rules['fee'] = 'required|integer';\n $rules['phone'] = 'required|min:8|max:20';\n $rules['facebook'] = 'required|url';\n $rules['youtube'] = 'required|url';\n $rules['web'] = 'url';\n\n $rules['requestgender'] = 'required';\n $rules['serviceaddress'] = 'required|max:150';\n $rules['servicetime'] = 'required|max:150';\n $rules['language'] = 'required|max:150';\n $rules['bust'] = 'required|max:100|integer';\n $rules['waistline'] = 'required|max:100|integer';\n $rules['hips'] = 'required|max:100|integer';\n $rules['motto'] = 'max:50';\n\n return $rules;\n }", "protected function getValidRules()\n {\n return $this->validRules;\n }", "public function rules()\n {\n switch($this->method())\n {\n case 'GET':\n case 'DELETE':\n {\n return [];\n }\n case 'POST':\n case 'PUT':\n {\n return [\n 'name' => 'required',\n ];\n }\n default:break;\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n {\n return [\n 'mobile' => ['required','max:11','min:11'],\n 'code' => ['required','max:6','min:6'],\n 'avatar' => ['required'],\n 'wx_oauth' => ['required'],\n 'password' => ['nullable','min:6','max:20']\n ];\n }\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default: {\n return [];\n }\n }\n }", "public function rules()\n {\n switch ($this->getRequestMethod()) {\n case 'index':\n return [\n 'full_name' => 'nullable|string',\n 'phone' => 'nullable|string',\n ];\n break;\n case 'store':\n return [\n 'crm_resource_id' => 'required|exists:crm_resources,id',\n 'channel' => 'required|in:' . get_validate_in_string(CrmResourceCallLog::$channel),\n 'call_status' => 'required|in:' . get_validate_in_string(CrmResourceCallLog::$call_statuses),\n ];\n break;\n default:\n return [];\n break;\n }\n }", "public function rules()\n {\n //With password\n if(request('password') || request('password_confirmation')) {\n return array_merge($this->passwordRules(), $this->defaultRules());\n }\n //Without password\n return $this->defaultRules();\n }", "public function rules()\n {\n $rules = [\n '_token' => 'required'\n ];\n\n foreach($this->request->get('emails') as $key => $val) {\n $rules['emails.'.$key] = 'required|email';\n }\n\n return $rules;\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CoverImageID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_TrackID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Status' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Rank' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CreateDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n { \n return $this->rules;\n }", "public function getValidationRules()\n {\n if (method_exists($this, 'rules')) {\n return $this->rules();\n }\n\n $table = $this->getTable();\n $cacheKey = 'validate.' . $table;\n\n if (config('validate.cache') && Cache::has($cacheKey)) {\n return Cache::get($cacheKey);\n }\n\n // Get table info for model and generate rules\n $manager = DB::connection()->getDoctrineSchemaManager();\n $details = $manager->listTableDetails($table);\n $foreignKeys = $manager->listTableForeignKeys($table);\n\n $this->generateRules($details, $foreignKeys);\n\n if (config('validate.cache')) {\n Cache::forever($cacheKey, $this->rules);\n }\n\n return $this->rules;\n }", "public function getValidationRules()\n {\n $rules = $this->getBasicValidationRules();\n\n if (in_array($this->type, ['char', 'string', 'text', 'enum'])) {\n $rules[] = 'string';\n if (in_array($this->type, ['char', 'string']) && isset($this->arguments[0])) {\n $rules[] = 'max:' . $this->arguments[0];\n }\n } elseif (in_array($this->type, ['timestamp', 'date', 'dateTime', 'dateTimeTz'])) {\n $rules[] = 'date';\n } elseif (str_contains(strtolower($this->type), 'integer')) {\n $rules[] = 'integer';\n } elseif (str_contains(strtolower($this->type), 'decimal')) {\n $rules[] = 'numeric';\n } elseif (in_array($this->type, ['boolean'])) {\n $rules[] = 'boolean';\n } elseif ($this->type == 'enum' && count($this->arguments)) {\n $rules[] = 'in:' . join(',', $this->arguments);\n }\n\n return [$this->name => join('|', $rules)];\n }", "public function rules()\n {\n $rules = [];\n if ($this->isMethod('post')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n } elseif ($this->isMethod('put')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n }\n return $rules;\n }", "public function validationRules()\n {\n return [];\n }", "public function rules()\n {\n $rules = $this->rules;\n if(Request::isMethod('PATCH')){\n $rules['mg_name'] = 'required|min:2,max:16';\n }\n return $rules;\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_EventID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_SourceID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_HasEvent' => array(\n\t\t\t\t'inArray' => array('values' => array(self::HASEVENT_0, self::HASEVENT_1),),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n {\n $rules = [];\n switch ($this->method()){\n case 'GET':\n $rules['mobile'] = ['required', 'regex:/^1[3456789]\\d{9}$/'];\n break;\n case 'POST':\n if($this->route()->getActionMethod() == 'sms') {\n $rules['area_code'] = ['digits_between:1,6'];\n if(in_array($this->get('type'), ['signup', 'reset_pay_pwd'])) {\n $rules['mobile'] = ['required', 'digits_between:5,20'];\n if($this->get('type') == 'signup' && !$this->get('area_code')) {\n $this->error('请选择区号');\n }\n }\n $rules['type'] = ['required', Rule::in(\\App\\Models\\Captcha::getSmsType())];\n }\n break;\n }\n return $rules;\n }", "public function rules()\n {\n if ($this->isMethod('post')) {\n return $this->createRules();\n } elseif ($this->isMethod('put')) {\n return $this->updateRules();\n }\n }", "public function rules()\n {\n $rules = [\n 'first_name' => ['required'],\n 'birthdate' => ['required', 'date', 'before:today'],\n ];\n\n if (is_international_session()) {\n $rules['email'] = ['required', 'email'];\n }\n\n if (should_collect_international_phone()) {\n $rules['phone'] = ['phone'];\n }\n\n if (is_domestic_session()) {\n $rules['phone'] = ['required', 'phone'];\n }\n\n return $rules;\n }", "public function rules()\n {\n dd($this->request->get('answer'));\n foreach ($this->request->get('answer') as $key => $val)\n {\n $rules['answer.'.$key] = 'required';\n }\n\n return $rules;\n }", "public function rules()\n {\n return static::$rules;\n }", "function getRules() {\n\t\t$fields = $this->getFields();\n\t\t$allRules = array();\n\n\t\tforeach ($fields as $field) {\n\t\t\t$fieldRules = $field->getValidationRules();\n\t\t\t$allRules[$field->getName()] = $fieldRules;\n\t\t}\n\n\t\treturn $allRules;\n\t}", "public static function getValidationRules(): array\n {\n return [\n 'name' => 'required|string|min:1|max:255',\n 'version' => 'required|float',\n 'type' => 'required|string',\n ];\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required',\n 'phone' => 'required|numeric',\n 'subject' => 'required',\n 'message' => 'required',\n 'email' => 'required|email',\n ];\n\n return $rules;\n }", "public function getValidationRules(): array\n {\n return [\n 'email_address' => 'required|email',\n 'email_type' => 'nullable|in:html,text',\n 'status' => 'required|in:subscribed,unsubscribed,cleaned,pending',\n 'merge_fields' => 'nullable|array',\n 'interests' => 'nullable|array',\n 'language' => 'nullable|string',\n 'vip' => 'nullable|boolean',\n 'location' => 'nullable|array',\n 'location.latitude' => ['regex:/^[-]?(([0-8]?[0-9])\\.(\\d+))|(90(\\.0+)?)$/'], \n 'location.longitude' => ['regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\\.(\\d+))|180(\\.0+)?)$/'],\n 'marketing_permissions' => 'nullable|array',\n 'tags' => 'nullable|array'\n ];\n }", "protected function getValidationRules()\n {\n return [\n 'first_name' => 'required|max:255',\n 'last_name' => 'required|max:255',\n 'email' => 'required|email|max:255',\n 'new_password' => 'required_with:current_password|confirmed|regex:' . config('security.password_policy'),\n ];\n }", "public function rules()\n {\n // get 直接放行\n if( request()->isMethod('get') ){\n return []; // 规则为空\n }\n\n // 只在post的时候做验证\n return [\n 'username' => 'required|min:2|max:10', \n 'password' => 'required|min:2|max:10', \n 'email' => 'required|min:2|max:10|email', \n 'phoneNumber' => 'required|min:2|max:10', \n\n ];\n }", "public function rules()\n {\n\n $rules = [\n 'id_tecnico_mantenimiento' => 'required',\n 'id_equipo_mantenimiento' => 'required'\n ];\n\n if ($this->request->has('status')) {\n $rules['status'] = 'required';\n }\n\n if ($this->request->has('log_mantenimiento')) {\n $rules['log_mantenimiento'] = 'required';\n }\n\n return $rules;\n }", "public function rules()\n {\n $this->buildRules();\n return $this->rules;\n }", "public function rules()\n {\n $rules = [];\n\n if ($this->isUpdate() || $this->isStore()) {\n $rules = array_merge($rules, [\n 'name' => 'required|string',\n 'email' => 'email',\n 'password' => 'confirmed|min:6',\n\n ]);\n }\n\n if ($this->isStore()) {\n $rules = array_merge($rules, [\n\n ]);\n }\n\n if ($this->isUpdate()) {\n $rules = array_merge($rules, [\n ]);\n }\n\n return $rules;\n }", "public function rules()\n {\n switch (true) {\n case $this->wantsToList():\n $rules = $this->listRules;\n break;\n case $this->wantsToStore():\n $rules = $this->storeRules;\n break;\n case $this->wantsToUpdate():\n $this->storeRules['email'] = 'required|email|between:5,100|unique:users,email,' . $this->route('administrators');\n\n $rules = $this->storeRules;\n break;\n default:\n $rules = [];\n }\n\n return $rules;\n }", "public function rules()\n {\n if($this->isMethod('post')) {\n return $this->storeRules();\n }\n else if($this->isMethod('put') || $this->isMethod('patch')){\n return $this->updateRules();\n }\n }", "abstract protected function getValidationRules();", "public function rules()\n\t{\n\t\treturn ModelHelper::getRules($this);\n\t}", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return $this->getPostRules();\n case 'PUT':\n return $this->getPutRules();\n }\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required|string|min:2',\n 'email' => \"required|email|unique:users,email, {$this->request->get('user_id')}\",\n 'role_id' => 'required|numeric',\n 'group_id' => 'required|numeric',\n ];\n\n if ($this->request->has('password')){\n $rules['password'] = 'required|min:6';\n }\n\n return $rules;\n }", "public function rules()\n {\n if($this->method() == 'POST')\n {\n return [\n 'reason'=>'required',\n 'date_from'=>'required',\n 'date_to'=>'required',\n 'attachment'=>'required',\n ];\n }\n }", "public function rules()\n {\n $method = $this->method();\n if ($this->get('_method', null) !== null) {\n $method = $this->get('_method');\n }\n // $this->offsetUnset('_method');\n switch ($method) {\n case 'DELETE':\n case 'GET':\n break; \n case 'POST':\n $mailRules = \\Config::get('database.default').'.users';\n break;\n case 'PUT':\n $user = $this->authService->authJWTUserForm();\n $mailRules = \\Config::get('database.default').'.users,email,'.$user->getKey();\n break;\n case 'PATCH':\n break;\n default:\n break;\n }\n \n return [\n 'name' => 'required|string|max:256',\n 'email' => 'required|string|email|max:255|unique:'.$mailRules,\n 'password' => 'required|string|min:3',\n ];\n }", "public function rules() {\n $rule = [\n 'value' => 'bail|required',\n ];\n if ($this->getMethod() == 'POST') {\n $rule += ['type' => 'bail|required'];\n }\n return $rule;\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return [];\n }\n case 'POST': {\n return [\n 'from' => 'required|max:100',\n 'to' => 'required|max:500',\n 'day' => 'required|max:500',\n ];\n }\n case 'PUT':\n case 'PATCH': {\n return [\n 'from' => 'required|max:100',\n 'to' => 'required|max:500',\n 'day' => 'required|max:500',\n ];\n }\n default:\n break;\n }\n\n return [\n //\n ];\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return [];\n }\n case 'POST':\n case 'PUT':\n case 'PATCH': {\n return [\n 'name' => 'required|string|max:255',\n 'iso_code_2' => 'required|string|size:2',\n 'iso_code_3' => 'required|string|size:3',\n ];\n }\n default:\n return [];\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE':\n return [];\n case 'POST':\n return [\n 'name' => 'required|string',\n 'lastName' => 'string',\n 'gender' => 'boolean',\n 'avatar' => 'sometimes|mimes:jpg,png,jpeg|max:3048'\n ];\n case 'PUT':\n case 'PATCH':\n return [\n 'oldPassword' => 'required|string',\n 'newPassword' => 'required|string',\n ];\n default:\n break;\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE':\n {\n return [\n 'validation' => [\n 'accepted'\n ]\n ];\n }\n case 'POST':\n {\n return [\n 'title' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250'\n ],\n 'body' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250000'\n ],\n 'online' => [\n 'required',\n ],\n 'indexable' => [\n 'required',\n ],\n 'published_at' => [\n 'required',\n ],\n 'published_at_time' => [\n 'required',\n ],\n 'unpublished_at' => [\n 'nullable',\n ],\n 'unpublished_time' => [\n 'nullable',\n ],\n ];\n }\n case 'PUT':\n {\n return [\n 'title' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250'\n ],\n 'body' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250000'\n ],\n 'online' => [\n 'required',\n ],\n 'indexable' => [\n 'required',\n ],\n 'published_at' => [\n 'required',\n ],\n 'unpublished_at' => [\n 'nullable',\n ],\n ];\n }\n case 'PATCH':\n {\n return [];\n }\n default:\n break;\n }\n }", "public function rules()\n {\n if (in_array($this->method(), ['PUT', 'PATCH'])) {\n $user = User::findOrFail(\\Request::input('id'))->first();\n\n array_forget($this->rules, 'email');\n $this->rules = array_add($this->rules, 'email', 'required|email|max:255|unique:users,email,' . $user->id);\n }\n\n return $this->rules;\n }", "public function rules()\n {\n $method = explode('@', $this->route()->getActionName())[1];\n return $this->get_rules_arr($method);\n }", "public function rules()\n {\n $rules = parent::rules();\n $extra_rules = [];\n $rules = array_merge($rules, $extra_rules);\n return $rules;\n }", "public function rules()\n {\n\t\tswitch($this->method()) {\n\t\t\tcase 'POST':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tcase 'PUT':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tdefault:break;\n\t\t}\n }", "public function rules()\n {\n $this->sanitize();\n return [\n 'event_id' => 'required',\n 'member_id' => 'required',\n 'guild_pts' => 'required',\n 'position' => 'required',\n 'solo_pts' => 'required',\n 'league_id' => 'required',\n 'solo_rank' => 'required',\n 'global_rank' => 'required',\n ];\n }", "public function rules()\n {\n $this->rules['email'] = ['required', 'min:6', 'max:60', 'email'];\n $this->rules['password'] = ['required', 'min:6', 'max:60'];\n\n return $this->rules;\n }", "public function getValidatorRules()\n {\n if ($validator = $this->getValidator()) {\n return $validator->getRulesForField($this->owner);\n }\n \n return [];\n }", "public function getValidationRules() : array;", "public function rules()\n {\n switch ($this->route()->getActionMethod()) {\n case 'login': {\n if ($this->request->has('access_token')) {\n return [\n 'access_token' => 'required',\n 'driver' => 'required|in:facebook,github,google',\n ];\n }\n return [\n 'email' => 'required|email',\n 'password' => 'required|min:6',\n ];\n }\n case 'register': {\n return [\n 'email' => 'required|email|unique:users,email',\n 'password' => 'required|min:6',\n 'name' => 'required',\n ];\n }\n default: return [];\n }\n }", "public function rules()\n {\n Validator::extend('mail_address_available', function($attribute, $value, $parameters, $validator){\n return MailAddressSpec::isAvailable($value);\n });\n Validator::extend('password_available', function($attribute, $value, $parameters, $validator){\n return PassWordSpec::isAvailable($value);\n });\n\n return [\n 'mail_address' => [\n 'required',\n 'mail_address_available'\n ],\n 'password' => [\n 'required',\n 'password_available',\n ],\n ];\n }", "public function rules()\n {\n switch (strtolower($this->method())) {\n case 'get':\n return $this->getMethodRules();\n case 'post':\n return $this->postMethodRules();\n case 'put':\n return $this->putMethodRules();\n case 'patch':\n return $this->patchMethodRules();\n case 'delete':\n return $this->deleteMethodRules();\n }\n }", "public function rules()\n {\n /**\n * This is the original way, expecting post params for each user value\n */\n return [\n 'firstName' => 'required|min:2|max:255',\n 'lastName' => 'required|min:2|max:255',\n 'phone' => 'min:9|max:25',\n 'gender' => 'in:M,V',\n 'dateOfBirth' => 'before:today|after:1890-01-01',\n 'email' => 'email|min:12|max:255',\n ];\n }", "public function getValidationRules(): array {\n\t\t$result = [];\n\t\t\n\t\tforeach ($this->getSections() as $section) {\n\t\t\t$result = array_merge($result, $section->getValidationRules());\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function rules()\n\t{\n\t\t$rule = [];\n\t\tif(Request::path() == 'api/utility/upload-image'){\n\t\t\t$rule = [\n\t\t\t\t'imagePath' => 'required',\n\t\t\t];\n\t\t}else if(Request::path() == 'api/utility/check-transaction'){\n\t\t\t$rule = [\n\t\t\t\t'countNumber' => 'required',\n\t\t\t];\n\t\t}\n\t\treturn $rule;\n\t}", "public function rules()\n {\n $rules = array();\n return $rules;\n }", "public function rules()\n {\n $this->setValidator($this->operation_type);\n return $this->validator;\n }", "public function rules()\n {\n switch($this->method()){\n case 'POST':\n return [\n 'name' => 'required',\n 'app_id' => 'required',\n 'account_id' => 'required',\n 'start_at' => 'required',\n 'end_at' => 'required',\n 'content' => 'required',\n ];\n break;\n default:\n return [];\n break;\n }\n\n }", "protected function get_validation_rules()\n {\n }", "public function rules()\n {\n $rules = [\n 'users' => 'required|array',\n ];\n\n foreach($this->request->get('users') as $key => $user) {\n $rules['users.'. $key . '.name'] = 'required|string|min:3|max:255';\n $rules['users.'. $key . '.phone'] = 'required|regex:/^[0-9\\+\\s]+$/|min:10|max:17';\n $rules['users.'. $key . '.country'] = 'required|string|min:2:max:3';\n }\n\n return $rules;\n }", "public function rules()\n {\n $rules = [\n 'mail_driver' => 'required',\n 'mail_name' => 'required',\n 'mail_email' => 'required',\n ];\n\n $newRules = [];\n\n if($this->mail_driver == 'smtp') {\n $newRules = [\n 'mail_host' => 'required',\n 'mail_port' => 'required|numeric',\n 'mail_username' => 'required',\n 'mail_password' => 'required',\n 'mail_encryption' => 'required',\n ];\n }\n\n return array_merge($rules, $newRules);\n }", "public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n $rules['location'] = 'required';\n $rules['end_recruit_date'] = 'required';\n $rules['time_taken'] = 'required';\n $rules['payment'] = 'required';\n $rules['objective'] = 'required';\n $rules['method_desc'] = 'required';\n $rules['health_condition'] = 'required';\n $rules['required_applicant'] = 'required|integer';\n $rules['applicant'] = 'nullable';\n $rules['datetime'] = 'required';\n\n return $rules;\n }", "public function rules()\n {\n switch($this->method()) {\n\n case 'PUT':\n {\n return [\n 'company_name' => 'required',\n 'status' => 'required|integer',\n 'notify_url' => 'required',\n 'name' => 'required'\n ];\n }\n case 'POST':\n {\n return [\n 'company_name' => 'required',\n 'status' => 'required|integer',\n 'notify_url' => 'required',\n 'name' => 'required'\n ];\n }\n default:\n return [];\n }\n\n }", "public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n\n return $rules;\n }", "public function rules()\n {\n switch(Route::currentRouteName()){\n case 'adminBinding' :\n return [\n 'order_id' => 'required|integer',\n 'money' => 'required|numeric',\n ];\n case 'adminUnbinding' :\n return [\n 'order_id' => 'required|integer',\n 'pivot_id' => 'required|integer',\n ];\n case 'adminReceiptSave' :\n case 'adminReceiptUpdate' :\n return [\n 'customer_id' => 'required',\n 'receiptcorp' => 'required',\n 'account' => 'required',\n 'account_id' => 'required',\n 'bank' => 'required',\n 'currency_id' => 'required',\n 'advance_amount' => 'required|numeric',\n 'picture' => 'required',\n 'business_type' => 'required|in:1,2,3,4,5',\n 'exchange_type' => 'required_unless:currency_id,354|in:1,2',\n 'expected_received_at' => 'required|date_format:Y-m-d',\n ];\n case 'adminReceiptExchange' :\n return [\n 'rate' => 'required|numeric',\n ];\n default :\n return [];\n }\n }", "public function rules()\n {\n $rules = [];\n $method = $this->getMethod();\n switch ($method) {\n case 'GET':\n if (Route::currentRouteName() === 'schoolActivity.getSchoolActivity') {\n $rules = [\n ];\n }\n break;\n }\n return $rules;\n }", "public function rules()\n {\n $rules = new Collection();\n\n if (!$this->user() or !$this->user()->addresses()->count()) {\n $rules = $rules->merge($this->addressRules('billing'));\n if ($this->has('different_shipping_address')) {\n $rules = $rules->merge($this->addressRules('shipping'));\n }\n\n return $rules->toArray();\n }\n\n return $rules->merge([\n 'billing_address_id' => 'required|numeric',\n 'shipping_address_id' => 'required|numeric',\n ])->toArray();\n }", "public function rules(): array\n {\n switch ($this->method()) {\n case 'POST':\n return $this->__rules() + $this->__post();\n case 'PUT':\n return $this->__rules() + $this->__put();\n default:\n return [];\n }\n }", "public function defineValidationRules()\n {\n return [];\n }", "public function rules(Request $request)\n {\n return Qc::$rules;\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'user_name' => 'nullable|string',\n 'excel' => 'nullable|file|mimes:xlsx',\n 'category' => 'required|int|in:' . implode(',', array_keys(UserMessage::$categories)),\n 'content' => 'required|string|max:500',\n 'member_status' => 'required|int|in:' . implode(',', array_keys(User::$statuses)),\n ];\n break;\n }\n }", "public function rules()\n {\n return [\n 'lead_id' => [\n 'required', 'string',\n ],\n 'api_version' => [\n 'required', 'string',\n ],\n 'form_id' => [\n 'required', 'int',\n ],\n 'campaign_id' => [\n 'required', 'int',\n ],\n 'google_key' => [\n 'required', 'string', new GoogleKeyRule,\n ],\n ];\n }" ]
[ "0.8342703", "0.80143493", "0.7937251", "0.79264987", "0.79233825", "0.79048395", "0.78603816", "0.7790699", "0.77842164", "0.77628785", "0.7737272", "0.7733618", "0.7710535", "0.7691693", "0.76849866", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7675849", "0.76724476", "0.76665044", "0.7657698", "0.7641827", "0.7630892", "0.76293766", "0.7617708", "0.76102096", "0.7607475", "0.7602442", "0.7598732", "0.7597544", "0.75924", "0.75915384", "0.7588146", "0.7581354", "0.7555758", "0.755526", "0.7551423", "0.7546329", "0.7541439", "0.75366044", "0.75363225", "0.7530296", "0.7517988", "0.75155175", "0.7508439", "0.75069886", "0.7505724", "0.749979", "0.7495976", "0.74949056", "0.7492888", "0.7491117", "0.74901396", "0.7489651", "0.7486808", "0.7486108", "0.7479687", "0.7478561", "0.7469412", "0.74635684", "0.74619836", "0.7461325", "0.74591017", "0.7455279", "0.745352", "0.7453257", "0.7449877", "0.74486", "0.7441391", "0.7440429", "0.7435489", "0.7435326", "0.74341524", "0.7430354", "0.7429103", "0.7423808", "0.741936", "0.74152505", "0.7414828", "0.741382", "0.74126065", "0.74105227", "0.740555", "0.7404385", "0.74040926", "0.74015605", "0.73905706", "0.73837525", "0.73732615", "0.7371123", "0.7369176", "0.73619753", "0.73554605", "0.73448825", "0.7344659", "0.73427117", "0.73357755" ]
0.0
-1
Specification: Publish price list prices for product abstracts. Uses the given IDs of the `fos_price_product_price_list` table. Merges created or updated prices to the existing ones.
public function publishAbstractPriceProductPriceList(array $priceProductPriceListIds): void;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function publishConcretePriceProductPriceList(array $priceProductPriceListIds): void;", "public function publishAbstractPriceProductPriceListByIdPriceList(int $idPriceList): void;", "public function publishConcretePriceProductPriceListByIdPriceList(int $idPriceList): void;", "public function publishConcretePriceProductByProductIds(array $productIds): void;", "public function updatePrices($contractId, $priceList);", "public function publishAbstractPriceProductByByProductAbstractIds(array $productAbstractIds): void;", "public function updateprices()\n {\n\n $aParams = oxRegistry::getConfig()->getRequestParameter(\"updateval\");\n if (is_array($aParams)) {\n foreach ($aParams as $soxId => $aStockParams) {\n $this->addprice($soxId, $aStockParams);\n }\n }\n }", "protected function putProductsVariantsPricelistPriceRequest($body, $product_id, $variant_id, $pricelist_id)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling putProductsVariantsPricelistPrice'\n );\n }\n // verify the required parameter 'product_id' is set\n if ($product_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $product_id when calling putProductsVariantsPricelistPrice'\n );\n }\n if ($product_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$product_id\" when calling DefaultApi.putProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'variant_id' is set\n if ($variant_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $variant_id when calling putProductsVariantsPricelistPrice'\n );\n }\n if ($variant_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$variant_id\" when calling DefaultApi.putProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'pricelist_id' is set\n if ($pricelist_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pricelist_id when calling putProductsVariantsPricelistPrice'\n );\n }\n if ($pricelist_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$pricelist_id\" when calling DefaultApi.putProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n $resourcePath = '/products/{productId}/variants/{variantId}/prices/{pricelistId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($product_id !== null) {\n $resourcePath = str_replace(\n '{' . 'productId' . '}',\n ObjectSerializer::toPathValue($product_id),\n $resourcePath\n );\n }\n // path params\n if ($variant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'variantId' . '}',\n ObjectSerializer::toPathValue($variant_id),\n $resourcePath\n );\n }\n // path params\n if ($pricelist_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pricelistId' . '}',\n ObjectSerializer::toPathValue($pricelist_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n \n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function patchProductsVariantsPricelistPriceRequest($body, $product_id, $variant_id, $pricelist_id)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling patchProductsVariantsPricelistPrice'\n );\n }\n // verify the required parameter 'product_id' is set\n if ($product_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $product_id when calling patchProductsVariantsPricelistPrice'\n );\n }\n if ($product_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$product_id\" when calling DefaultApi.patchProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'variant_id' is set\n if ($variant_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $variant_id when calling patchProductsVariantsPricelistPrice'\n );\n }\n if ($variant_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$variant_id\" when calling DefaultApi.patchProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'pricelist_id' is set\n if ($pricelist_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pricelist_id when calling patchProductsVariantsPricelistPrice'\n );\n }\n if ($pricelist_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$pricelist_id\" when calling DefaultApi.patchProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n $resourcePath = '/products/{productId}/variants/{variantId}/prices/{pricelistId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($product_id !== null) {\n $resourcePath = str_replace(\n '{' . 'productId' . '}',\n ObjectSerializer::toPathValue($product_id),\n $resourcePath\n );\n }\n // path params\n if ($variant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'variantId' . '}',\n ObjectSerializer::toPathValue($variant_id),\n $resourcePath\n );\n }\n // path params\n if ($pricelist_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pricelistId' . '}',\n ObjectSerializer::toPathValue($pricelist_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n \n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PATCH',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function updateAmazonProductsPrices($items)\n{\n\tif (sizeof($items) > 0) {\n\t\t$data['lastmod'] = time();\n\t\t$data['lastmod_user'] = getAmazonSessionUserId();\n\t\t$data['lastpriceupdate'] = time();\n\t\t$data['submitedProduct'] = 0;\n\t\t$data['submitedPrice'] = 0;\n\t\t$data['upload'] = 1;\n\t\t$caseStandardPrice = \"StandardPrice = CASE\";\n\t\tforeach($items as $key => $item)\n\t\t{\n\t\t\t$caseStandardPrice.= \"\\n WHEN id_product = \" . $items[$key]['id_product'] . \" THEN \" . $items[$key]['price'];\n\t\t\t$productsIds[] = $items[$key]['id_product'];\n\t\t}\n\t\t$caseStandardPrice.= \"\n\t\t\tEND\n\t\t\tWHERE id_product IN (\" . implode(\", \", $productsIds) . \")\n\t\t\";\n\t\t$addWhere\t = $caseStandardPrice;\n\t\tSQLUpdate('amazon_products', $data, $addWhere, 'shop', __FILE__, __LINE__);\n\t}\n}", "public function api_update_price(){\n $watchlists = $this->wr->all();\n foreach($watchlists as $watchlist)\n {\n $current_price = $this->get_quotes($watchlist->id);\n\n $this->wr->update([\n 'current_price' => $current_price,\n ],$watchlist->id);\n }\n }", "function editPrices() {\n\t\tglobal $HTML;\n\t\tglobal $page;\n\t\tglobal $id;\n\t\t$HTML->details(1);\n\n\t\t$this->getPrices();\n\n\t\t$price_groups = $this->priceGroupClass->getItems();\n\t\t$countries = $this->countryClass->getItems();\n\n\t\t$_ = '';\n\t\t$_ .= '<div class=\"c init:form form:action:'.$page->url.'\" id=\"container:prices\">';\n\t\t$_ .= '<div class=\"c\">';\n\n\t\t$_ .= $HTML->inputHidden(\"id\", $id);\n\t\t$_ .= $HTML->inputHidden(\"item_id\", $id);\n\n\t\t$_ .= $HTML->head(\"Prices\", \"2\");\n\n\t\tif(Session::getLogin()->validatePage(\"prices_update\")) {\n\t\t\t$_ .= $HTML->inputHidden(\"page_status\", \"prices_update\");\n\t\t}\n\n\t\tif($this->item() && count($this->item[\"id\"]) == 1) {\n\n\t\t\tforeach($countries[\"id\"] as $country_key => $country_id) {\n\n\t\t\t\t$_ .= '<div class=\"ci33\">';\n\n\t\t\t\t\t$_ .= $HTML->head($countries[\"values\"][$country_key], 3);\n\n\t\t\t\t\tforeach($price_groups[\"uid\"] as $index => $price_group_uid) {\n\t\t\t\t\t\t$price = ($this->item[\"price\"][0] && isset($this->item[\"price\"][0][$country_id][$price_group_uid])) ? $this->item[\"price\"][0][$country_id][$price_group_uid] : \"\";\n\t\t\t\t\t\t$_ .= $HTML->input($price_groups[\"values\"][$index], \"prices[$country_id][$price_group_uid]\", $price);\n\t\t\t\t\t}\n\n\t\t\t\t\t$_ .= $HTML->separator();\n\t\t\t\t$_ .= '</div>';\n\n\t\t\t}\n\t\t}\n\n\t\t$_ .= '</div>';\n\n\t\t$_ .= $HTML->smartButton($this->translate(\"Cancel\"), false, \"prices_cancel\", \"fleft key:esc\");\n\t\t$_ .= $HTML->smartButton($this->translate(\"Save\"), false, \"prices_update\", \"fright key:s\");\n\n\t\t$_ .= '</div>';\n\n\t\treturn $_;\n\t}", "public function gETPriceIdPriceListRequest($price_id)\n {\n // verify the required parameter 'price_id' is set\n if ($price_id === null || (is_array($price_id) && count($price_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $price_id when calling gETPriceIdPriceList'\n );\n }\n\n $resourcePath = '/prices/{priceId}/price_list';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($price_id !== null) {\n $resourcePath = str_replace(\n '{' . 'priceId' . '}',\n ObjectSerializer::toPathValue($price_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function get_prices($ids)\n\t{\n\t\t$data = '';\n\n\t\t// create comma sepearted lists\n\t\t$items = '';\n\t\tforeach ($ids as $id) {\n\t\t\tif ($items != '') {\n\t\t\t\t$items .= ',';\n\t\t\t}\n\t\t\t$items .= $id;\n\t\t}\n\n\t\t// get multiple product info based on list of ids\n\t\tif($result = $this->Database->query(\"SELECT id, price FROM $this->db_table WHERE id IN ($items) ORDER BY name\" ))\n\t\t{\n\t\t\tif($result->num_rows > 0)\n\t\t\t{\n\t\t\t\twhile($row = $result->fetch_array())\n\t\t\t\t{\n\t\t\t\t\t$data[] = array(\n\t\t\t\t\t\t'id' => $row['id'],\n\t\t\t\t\t\t'price' => $row['price']\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $data;\n\n\t}", "protected function getProductsVariantsPricelistPriceRequest($product_id, $variant_id, $pricelist_id)\n {\n // verify the required parameter 'product_id' is set\n if ($product_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $product_id when calling getProductsVariantsPricelistPrice'\n );\n }\n if ($product_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$product_id\" when calling DefaultApi.getProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'variant_id' is set\n if ($variant_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $variant_id when calling getProductsVariantsPricelistPrice'\n );\n }\n if ($variant_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$variant_id\" when calling DefaultApi.getProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'pricelist_id' is set\n if ($pricelist_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pricelist_id when calling getProductsVariantsPricelistPrice'\n );\n }\n if ($pricelist_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$pricelist_id\" when calling DefaultApi.getProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n $resourcePath = '/products/{productId}/variants/{variantId}/prices/{pricelistId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($product_id !== null) {\n $resourcePath = str_replace(\n '{' . 'productId' . '}',\n ObjectSerializer::toPathValue($product_id),\n $resourcePath\n );\n }\n // path params\n if ($variant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'variantId' . '}',\n ObjectSerializer::toPathValue($variant_id),\n $resourcePath\n );\n }\n // path params\n if ($pricelist_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pricelistId' . '}',\n ObjectSerializer::toPathValue($pricelist_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n \n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function run()\n {\n $prices = [\n [\n 'product_id' => 2,\n 'user_id' => 3,\n 'price' => 18,\n 'created_at' => now(),\n 'updated_at' => now()\n ],\n [\n 'product_id' => 3,\n 'user_id' => 3,\n 'price' => 15,\n 'created_at' => now(),\n 'updated_at' => now()\n ],\n [\n 'product_id' => 2,\n 'user_id' => 4,\n 'price' => 18,\n 'created_at' => now(),\n 'updated_at' => now()\n ],\n [\n 'product_id' => 3,\n 'user_id' => 4,\n 'price' => 15,\n 'created_at' => now(),\n 'updated_at' => now()\n ],\n ];\n ProductPrice::query()->insert($prices);\n }", "public function test_comicEntityIsCreated_prices_setPrices()\n {\n $sut = $this->getSUT();\n $prices = $sut->getPrices();\n $expected = [\n Price::create(\n 'printPrice',\n 19.99\n ),\n ];\n\n $this->assertEquals($expected, $prices);\n }", "protected function deleteProductsVariantsPricelistPriceRequest($product_id, $variant_id, $pricelist_id)\n {\n // verify the required parameter 'product_id' is set\n if ($product_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $product_id when calling deleteProductsVariantsPricelistPrice'\n );\n }\n if ($product_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$product_id\" when calling DefaultApi.deleteProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'variant_id' is set\n if ($variant_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $variant_id when calling deleteProductsVariantsPricelistPrice'\n );\n }\n if ($variant_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$variant_id\" when calling DefaultApi.deleteProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'pricelist_id' is set\n if ($pricelist_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pricelist_id when calling deleteProductsVariantsPricelistPrice'\n );\n }\n if ($pricelist_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$pricelist_id\" when calling DefaultApi.deleteProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n $resourcePath = '/products/{productId}/variants/{variantId}/prices/{pricelistId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($product_id !== null) {\n $resourcePath = str_replace(\n '{' . 'productId' . '}',\n ObjectSerializer::toPathValue($product_id),\n $resourcePath\n );\n }\n // path params\n if ($variant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'variantId' . '}',\n ObjectSerializer::toPathValue($variant_id),\n $resourcePath\n );\n }\n // path params\n if ($pricelist_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pricelistId' . '}',\n ObjectSerializer::toPathValue($pricelist_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n \n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function doActionSetSalePrice()\n {\n $form = new \\XLite\\Module\\CDev\\Sale\\View\\Form\\SaleSelectedDialog();\n $form->getRequestData();\n\n if ($form->getValidationMessage()) {\n \\XLite\\Core\\TopMessage::addError($form->getValidationMessage());\n } elseif (!$this->getSelected() && $ids = $this->getActionProductsIds()) {\n $qb = \\XLite\\Core\\Database::getRepo('XLite\\Model\\Product')->createQueryBuilder();\n $alias = $qb->getMainAlias();\n $qb->update('\\XLite\\Model\\Product', $alias)\n ->andWhere($qb->expr()->in(\"{$alias}.product_id\", $ids));\n\n foreach ($this->getUpdateInfoElement() as $key => $value) {\n $qb->set(\"{$alias}.{$key}\", \":{$key}\")\n ->setParameter($key, $value);\n }\n\n $qb->execute();\n\n \\XLite\\Core\\TopMessage::addInfo('Products information has been successfully updated');\n } else {\n \\XLite\\Core\\Database::getRepo('\\XLite\\Model\\Product')->updateInBatchById($this->getUpdateInfo());\n \\XLite\\Core\\TopMessage::addInfo('Products information has been successfully updated');\n }\n\n $this->setReturnURL($this->buildURL('product_list', '', ['mode' => 'search']));\n }", "public function saved(Price $price)\n {\n PriceItem::where('price_id', $price->id)->delete();\n\n $productId = request()->input('product_id');\n\n foreach (request()->input('prices', []) as $priceInput) {\n $priceCategoryAttributes = [\n 'product_id' => $productId,\n ];\n\n foreach (config('app.locales') as $lang => $locale) {\n $priceCategoryAttributes[\"title_{$lang}\"] = $priceInput['category'][$lang];\n }\n\n $priceCategory = PriceCategory::firstOrCreate($priceCategoryAttributes);\n\n $priceItemAttributes = [\n 'price_id' => $price->id,\n 'price_category_id' => $priceCategory->id,\n ];\n foreach ($priceInput['items'] as $item) {\n $priceItemAttributes['price'] = $item['price'];\n $priceItemAttributes['date_start'] = $item['date_start'];\n $priceItemAttributes['date_end'] = $item['date_end'];\n\n foreach (config('app.locales') as $lang => $locale) {\n $priceItemAttributes[\"title_{$lang}\"] = $item['title'][$lang];\n }\n }\n\n PriceItem::create($priceItemAttributes);\n }\n }", "public function setListPrice(float $listPrice)\n\t{\n\t\t$this->addKeyValue('list_price', $listPrice); \n\n\t}", "public function getOnSaleProducts_List (array $listOptions = array()) {\n // global $app;\n // $options['sort'] = 'shop_products.DateUpdated';\n // $options['order'] = 'DESC';\n // $options['_fshop_products.Status'] = join(',', dbquery::getProductStatusesWhenAvailable()) . ':IN';\n // $options['_fshop_products.Price'] = 'PrevPrice:>';\n // $options['_fshop_products.Status'] = 'DISCOUNT';\n // $config = dbquery::shopGetProductList_NewItems($options);\n // if (empty($config))\n // return null;\n // $self = $this;\n // $callbacks = array(\n // \"parse\" => function ($items) use($self) {\n // $_items = array();\n // foreach ($items as $key => $orderRawItem) {\n // $_items[] = $self->getProductByID($orderRawItem['ID']);\n // }\n // return $_items;\n // }\n // );\n // $dataList = $app->getDB()->getDataList($config, $options, $callbacks);\n // return $dataList;\n\n\n $self = $this;\n $params = array();\n $params['list'] = $listOptions;\n $params['callbacks'] = array(\n 'parse' => function ($dbRawItem) use ($self) {\n return $self->getProductByID($dbRawItem['ID']);\n }\n );\n\n return dbquery::fetchOnSaleProducts_List($params);\n }", "public function prices()\n {\n return $this->morphToMany(Price::class, 'price_able');\n }", "public function calculatePrices(): void\n {\n $orders = ServiceContainer::orders();\n $pizzaPrice = $orders->calculatePizzaPrice($this->items);\n $deliveryPrice = $orders->calculateDeliveryPrice($pizzaPrice, $this->outside, $this->currency);\n $this->delivery_price = $deliveryPrice;\n $this->total_price = $pizzaPrice + $deliveryPrice;\n }", "public function execute($ids = [])\n {\n /**\n * @var $idCollection \\Bazaarvoice\\Connector\\Model\\ResourceModel\\Index\\Collection \n */\n\n if (!$this->canIndex()) {\n return false;\n }\n try {\n $this->logger->debug('Partial Product Feed Index');\n\n if (empty($ids)) {\n $idCollection = $this->bvIndexCollectionFactory->create()->addFieldToFilter('version_id', 0);\n $idCollection->getSelect()->group('product_id');\n $idCollection->addFieldToSelect('product_id');\n $ids = $idCollection->getColumnValues('product_id');\n }\n\n $this->logger->debug('Found '.count($ids).' products to update.');\n\n /**\n * Break ids into pages \n */\n $productIdSets = array_chunk($ids, 50);\n\n /**\n * Time throttling \n */\n $limit = ($this->configProvider->getCronjobDurationLimit() * 60) - 10;\n $stop = time() + $limit;\n $counter = 0;\n do {\n if (time() > $stop) {\n break;\n }\n\n $productIds = array_pop($productIdSets);\n if (!is_array($productIds)\n || count($productIds) == 0\n ) {\n break;\n }\n\n $this->logger->debug('Updating product ids '.implode(',', $productIds));\n\n $this->reindexProducts($productIds);\n $counter += count($productIds);\n } while (1);\n\n if ($counter) {\n if ($counter < count($ids)) {\n $changelogTable = $this->resourceConnection->getTableName('bazaarvoice_product_cl');\n $indexTable = $this->resourceConnection->getTableName('bazaarvoice_index_product');\n $this->resourceConnection->getConnection('core_write')\n ->query(\"INSERT INTO `$changelogTable` (`entity_id`) SELECT `product_id` FROM `$indexTable` WHERE `version_id` = 0;\");\n }\n $this->logStats();\n }\n } catch (Exception $e) {\n $this->logger->crit($e->getMessage().\"\\n\".$e->getTraceAsString());\n }\n\n return true;\n }", "public function syncProductList()\n {\n // Evaluation only needed for custom product list and product tag\n if (!$this->isCustomList() && !$this->model_type !== ProductTag::class) return;\n\n $product_ids = $this->isCustomList() ? $this->product_ids : $this->getProductQuery()->get('id')->pluck('id')->all();\n\n $this->products()->sync($product_ids);\n }", "function _prepareGroupedProductPriceData($entityIds = null) {\n\t\t\t$write = $this->_getWriteAdapter( );\n\t\t\t$table = $this->getIdxTable( );\n\t\t\t$select = $write->select( )->from( array( 'e' => $this->getTable( 'catalog/product' ) ), 'entity_id' )->joinLeft( array( 'l' => $this->getTable( 'catalog/product_link' ) ), 'e.entity_id = l.product_id AND l.link_type_id=' . LINK_TYPE_GROUPED, array( ) )->join( array( 'cg' => $this->getTable( 'customer/customer_group' ) ), '', array( 'customer_group_id' ) );\n\t\t\t$this->_addWebsiteJoinToSelect( $select, true );\n\t\t\t$this->_addProductWebsiteJoinToSelect( $select, 'cw.website_id', 'e.entity_id' );\n\n\t\t\tif ($this->getVersionHelper( )->isGe1600( )) {\n\t\t\t\t$minCheckSql = $write->getCheckSql( 'le.required_options = 0', 'i.min_price', 0 );\n\t\t\t\t$maxCheckSql = $write->getCheckSql( 'le.required_options = 0', 'i.max_price', 0 );\n\t\t\t\t$taxClassId = $this->_getReadAdapter( )->getCheckSql( 'MIN(i.tax_class_id) IS NULL', '0', 'MIN(i.tax_class_id)' );\n\t\t\t\t$minPrice = new Zend_Db_Expr( 'MIN(' . $minCheckSql . ')' );\n\t\t\t\t$maxPrice = new Zend_Db_Expr( 'MAX(' . $maxCheckSql . ')' );\n\t\t\t} \nelse {\n\t\t\t\t$taxClassId = new Zend_Db_Expr( 'IFNULL(i.tax_class_id, 0)' );\n\t\t\t\t$minPrice = new Zend_Db_Expr( 'MIN(IF(le.required_options = 0, i.min_price, 0))' );\n\t\t\t\t$maxPrice = new Zend_Db_Expr( 'MAX(IF(le.required_options = 0, i.max_price, 0))' );\n\t\t\t}\n\n\t\t\t$stockId = 'IF (i.stock_id IS NOT NULL, i.stock_id, 1)';\n\t\t\t$select->columns( 'website_id', 'cw' )->joinLeft( array( 'le' => $this->getTable( 'catalog/product' ) ), 'le.entity_id = l.linked_product_id', array( ) );\n\n\t\t\tif ($this->getVersionHelper( )->isGe1700( )) {\n\t\t\t\t$columns = array( 'tax_class_id' => $taxClassId, 'price' => new Zend_Db_Expr( 'NULL' ), 'final_price' => new Zend_Db_Expr( 'NULL' ), 'min_price' => $minPrice, 'max_price' => $maxPrice, 'tier_price' => new Zend_Db_Expr( 'NULL' ), 'group_price' => new Zend_Db_Expr( 'NULL' ), 'stock_id' => $stockId, 'currency' => 'i.currency', 'store_id' => 'i.store_id' );\n\t\t\t} \nelse {\n\t\t\t\t$columns = array( 'tax_class_id' => $taxClassId, 'price' => new Zend_Db_Expr( 'NULL' ), 'final_price' => new Zend_Db_Expr( 'NULL' ), 'min_price' => $minPrice, 'max_price' => $maxPrice, 'tier_price' => new Zend_Db_Expr( 'NULL' ), 'stock_id' => $stockId, 'currency' => 'i.currency', 'store_id' => 'i.store_id' );\n\t\t\t}\n\n\t\t\t$select->joinLeft( array( 'i' => $table ), '(i.entity_id = l.linked_product_id) AND (i.website_id = cw.website_id) AND ' . '(i.customer_group_id = cg.customer_group_id)', $columns );\n\t\t\t$select->group( array( 'e.entity_id', 'cg.customer_group_id', 'cw.website_id', $stockId, 'i.currency', 'i.store_id' ) )->where( 'e.type_id=?', $this->getTypeId( ) );\n\n\t\t\tif (!is_null( $entityIds )) {\n\t\t\t\t$select->where( 'l.product_id IN(?)', $entityIds );\n\t\t\t}\n\n\t\t\t$eventData = array( 'select' => $select, 'entity_field' => new Zend_Db_Expr( 'e.entity_id' ), 'website_field' => new Zend_Db_Expr( 'cw.website_id' ), 'stock_field' => new Zend_Db_Expr( $stockId ), 'currency_field' => new Zend_Db_Expr( 'i.currency' ), 'store_field' => new Zend_Db_Expr( 'cs.store_id' ) );\n\n\t\t\tif (!$this->getWarehouseHelper( )->getConfig( )->isMultipleMode( )) {\n\t\t\t\t$eventData['stock_field'] = new Zend_Db_Expr( 'i.stock_id' );\n\t\t\t}\n\n\t\t\tMage::dispatchEvent( 'catalog_product_prepare_index_select', $eventData );\n\t\t\t$query = $select->insertFromSelect( $table );\n\t\t\t$write->query( $query );\n\t\t\treturn $this;\n\t\t}", "public function Save($id, $desc, $rating, $genre, $developer, $listPrice, $releaseDate)\n {\t\n\t\ttry\n\t\t{\t\n\t\t\t$response = $this->_obj->Execute(\"Product(\" . $id . \")\" );\n\t\t\t$products = $response->Result;\n\t\t\tforeach ($products as $product) \n\t\t\t{\n\t\t\t\t$product->ProductDescription = $desc;\n\t\t\t\t$product->ListPrice = str_replace('$', '', $listPrice);\n\t\t\t\t$product->ReleaseDate = $releaseDate;\n\t\t\t\t$product->ProductVersion = $product->ProductVersion;\n\t\t\t\t$this->_obj->UpdateObject($product);\n\t\t\t}\n\t\t\t$this->_obj->SaveChanges(); \n\t\t\t$response = $this->_obj->Execute(\"Game?\\$filter=ProductID eq \" . $id );;\n\t\t\t$games = $response->Result;\n\t\t\tforeach ($games as $game) \n\t\t\t{\n\t\t\t\t$game->Rating = str_replace('%20', ' ', $rating);\n\t\t\t\t$game->Genre = str_replace('%20', ' ', $genre);\n\t\t\t\t$game->Developer = $developer;\n\t\t\t\t$game->GameVersion = $game->GameVersion;\n\t\t\t\t$this->_obj->UpdateObject($game);\n\t\t\t}\n\t\t\t$this->_obj->SaveChanges();\n\t\t\t$products[0]->Game = $games;\n\t\t\treturn $products[0];\n }\n catch(ADODotNETDataServicesException $e)\n {\n\t\t\t echo \"Error: \" . $e->getError() . \"<br>\" . \"Detailed Error: \" . $e->getDetailedError();\n }\n }", "public function addprice($sOXID = null, $aUpdateParams = null)\n {\n $myConfig = $this->getConfig();\n\n $this->resetContentCache();\n\n $sOxArtId = $this->getEditObjectId();\n\n\n\n $aParams = oxRegistry::getConfig()->getRequestParameter(\"editval\");\n\n if (!is_array($aParams)) {\n return;\n }\n\n if (isset($aUpdateParams) && is_array($aUpdateParams)) {\n $aParams = array_merge($aParams, $aUpdateParams);\n }\n\n //replacing commas\n foreach ($aParams as $key => $sParam) {\n $aParams[$key] = str_replace(\",\", \".\", $sParam);\n }\n\n $aParams['oxprice2article__oxshopid'] = $myConfig->getShopID();\n\n if (isset($sOXID)) {\n $aParams['oxprice2article__oxid'] = $sOXID;\n }\n\n $aParams['oxprice2article__oxartid'] = $sOxArtId;\n if (!isset($aParams['oxprice2article__oxamount']) || !$aParams['oxprice2article__oxamount']) {\n $aParams['oxprice2article__oxamount'] = \"1\";\n }\n\n if (!$myConfig->getConfigParam('blAllowUnevenAmounts')) {\n $aParams['oxprice2article__oxamount'] = round(( string ) $aParams['oxprice2article__oxamount']);\n $aParams['oxprice2article__oxamountto'] = round(( string ) $aParams['oxprice2article__oxamountto']);\n }\n\n $dPrice = $aParams['price'];\n $sType = $aParams['pricetype'];\n\n $oArticlePrice = oxNew(\"oxbase\");\n $oArticlePrice->init(\"oxprice2article\");\n $oArticlePrice->assign($aParams);\n\n $oArticlePrice->$sType = new oxField($dPrice);\n\n //validating\n if ($oArticlePrice->$sType->value &&\n $oArticlePrice->oxprice2article__oxamount->value &&\n $oArticlePrice->oxprice2article__oxamountto->value &&\n is_numeric($oArticlePrice->$sType->value) &&\n is_numeric($oArticlePrice->oxprice2article__oxamount->value) &&\n is_numeric($oArticlePrice->oxprice2article__oxamountto->value) &&\n $oArticlePrice->oxprice2article__oxamount->value <= $oArticlePrice->oxprice2article__oxamountto->value\n ) {\n $oArticlePrice->save();\n }\n\n // check if abs price is lower than base price\n $oArticle = oxNew(\"oxArticle\");\n $oArticle->loadInLang($this->_iEditLang, $sOxArtId);\n $sPriceField = 'oxarticles__oxprice';\n if (($aParams['price'] >= $oArticle->$sPriceField->value) &&\n ($aParams['pricetype'] == 'oxprice2article__oxaddabs')) {\n if (is_null($sOXID)) {\n $sOXID = $oArticlePrice->getId();\n }\n $this->_aViewData[\"errorscaleprice\"][] = $sOXID;\n }\n\n }", "protected function saveUpdateProducts()\r\n\t{\r\n\t\tif (count($this->newProducts) > 0) {\r\n\t\t\t// inserir as novas\r\n\t\t\tforeach ($this->newProducts as $product) {\r\n\t\t\t\t$result = $this->client->catalogProductUpdate($this->sessionid, $product->sku, $product);\r\n\t\t\t\t$this->log->addInfo('updated', array(\"sku\" => $product->sku, \"result\" => $result));\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->newProducts = array();\r\n\t}", "public function updateProductListPivot()\n {\n $model = $this->productListable;\n $products = $model->products()->get('id');\n $this->products()->sync($products->pluck('id'));\n }", "public function addProductIDs($productIDs)\n {\n $parameters = $this->request->getParameters();\n $parameters->add('id', $productIDs);\n $this->recommendationsUpToDate = false;\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $model->prices = $model->getAllPrices();\n $modelPrice = [new InventoryPrice()];\n\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n $prices = Yii::$app->request->post();\n $oldPrices = ArrayHelper::map($model->prices, 'id', 'id');\n $currentPrices = ArrayHelper::map($prices['Inventory']['prices'], 'id', 'id');\n $deletedPrices = array_diff($oldPrices, array_filter($currentPrices));\n\n $transaction = Yii::$app->db->beginTransaction();\n try {\n $model->save();\n\n // detete price\n if (!empty($deletedPrices)) {\n InventoryPrice::deleteAll(['id' => $deletedPrices]);\n }\n\n foreach ($prices['Inventory']['prices'] as $key => $item) {\n if (empty($item['id'])) {\n $modelPrice = new InventoryPrice();\n $modelPrice->created_at = time();\n $modelPrice->created_by = Yii::$app->user->id;\n } else {\n $modelPrice = InventoryPrice::find()->where(['id' => $item['id']])->one();\n }\n $modelPrice->inventory_id = $model->id;\n $modelPrice->vendor_id = $item['vendor_id'];\n $modelPrice->vendor_name = @Inventory::getVendorName($modelPrice->vendor_id);\n $modelPrice->price = $item['price'];\n $modelPrice->due_date = $item['due_date'];\n $modelPrice->active = !isset($item['active']) ? InventoryPrice::STATUS_INACTIVE : $item['active'];\n\n\n if ($modelPrice->price && $modelPrice->vendor_id) {\n $modelPrice->save(false);\n }\n }\n\n\n $transaction->commit();\n Yii::$app->session->setFlash('success', 'เพิ่มสินค้าใหม่เรียบร้อย');\n return $this->redirect(['view', 'id' => $model->id]);\n } catch (Exception $e) {\n $transaction->rollBack();\n Yii::$app->session->setFlash('error', $e->getMessage());\n return $this->redirect(['update', 'id' => $model->id]);\n }\n\n\n } else {\n return $this->render('update', [\n 'model' => $model,\n 'modelPrice' => $modelPrice,\n ]);\n }\n }", "function updateRetailerProductList($con, $ProductIdList, $TypeList, $QuantityList, $PriceList){\n $result = true;\n\n // iterate through each card and process individually\n foreach($ProductIdList as $key => $ProductId){\n\n if(doesSellsExist($con, $ProductId, $TypeList[$key])){\n\n // if card exists, update\n $result = updateSells($con, $ProductId, $TypeList[$key], $QuantityList[$key], $PriceList[$key]);\n\n } else if(doesSellsExist($con, abs($ProductId), $TypeList[$key])){\n // if card id is negative it has been marked for deletion\n $result = deleteSells($con, abs($ProductId), $TypeList[$key]);\n\n }\n\n if(!$result) return $result;\n }\n\n return $result;\n}", "public function actionGetProductPrice($id=null)\n {\n $userData = User::find()->andFilterWhere(['u_id' => $id])->andWhere(['IS NOT', 'u_mws_seller_id', null])->all();\n\n foreach ($userData as $user) {\n \\Yii::$app->data->getMwsDetails($user->u_mws_seller_id, $user->u_mws_auth_token);\n $models = FbaAllListingData::find()->andWhere(['created_by' => $user->u_id])->all(); //->andWhere(['status' => 'Active'])\n\n foreach ($models as $model) {\n if ($model->seller_sku) {\n $productDetails = \\Yii::$app->api->getProductCompetitivePrice($model->seller_sku);\n if ($productDetails) {\n $model->buybox_price = $productDetails;\n if ($model->save(false)) {\n echo $model->asin1 . \" is Updated.\";\n }\n }\n }\n sleep(3);\n }\n }\n }", "public function processOperations(\\Magento\\AsynchronousOperations\\Api\\Data\\OperationListInterface $operationList)\n {\n $pricesUpdateDto = [];\n $pricesDeleteDto = [];\n $operationSkus = [];\n foreach ($operationList->getItems() as $index => $operation) {\n $serializedData = $operation->getSerializedData();\n $unserializedData = $this->serializer->unserialize($serializedData);\n $operationSkus[$index] = $unserializedData['product_sku'];\n $pricesUpdateDto = array_merge(\n $pricesUpdateDto,\n $this->priceProcessor->createPricesUpdate($unserializedData)\n );\n $pricesDeleteDto = array_merge(\n $pricesDeleteDto,\n $this->priceProcessor->createPricesDelete($unserializedData)\n );\n }\n\n $failedDeleteItems = [];\n $failedUpdateItems = [];\n $uncompletedOperations = [];\n try {\n $failedDeleteItems = $this->tierPriceStorage->delete($pricesDeleteDto);\n $failedUpdateItems = $this->tierPriceStorage->update($pricesUpdateDto);\n } catch (\\Magento\\Framework\\Exception\\CouldNotSaveException $e) {\n $uncompletedOperations['status'] = OperationInterface::STATUS_TYPE_RETRIABLY_FAILED;\n $uncompletedOperations['error_code'] = $e->getCode();\n $uncompletedOperations['message'] = $e->getMessage();\n } catch (\\Magento\\Framework\\Exception\\CouldNotDeleteException $e) {\n $uncompletedOperations['status'] = OperationInterface::STATUS_TYPE_RETRIABLY_FAILED;\n $uncompletedOperations['error_code'] = $e->getCode();\n $uncompletedOperations['message'] = $e->getMessage();\n } catch (\\Exception $e) {\n $uncompletedOperations['status'] = OperationInterface::STATUS_TYPE_RETRIABLY_FAILED;\n $uncompletedOperations['error_code'] = $e->getCode();\n $uncompletedOperations['message'] =\n __('Sorry, something went wrong during product prices update. Please see log for details.');\n }\n\n $failedItems = array_merge($failedDeleteItems, $failedUpdateItems);\n $failedOperations = [];\n foreach ($failedItems as $failedItem) {\n if (isset($failedItem->getParameters()['SKU'])) {\n $failedOperations[$failedItem->getParameters()['SKU']] = $this->priceProcessor->prepareErrorMessage(\n $failedItem\n );\n }\n }\n\n try {\n $this->changeOperationStatus($operationList, $failedOperations, $uncompletedOperations, $operationSkus);\n } catch (\\Exception $exception) {\n // prevent consumer from failing, silently log exception\n $this->logger->critical($exception->getMessage());\n }\n }", "public function create_individual_product_list ($all_product_ids, $all_qtys) {\n \n foreach(array_combine($all_product_ids, $all_qtys) as $value => $tally){\n \n $key_location = array_search($value, array_column($this->json_source_array['products'], 'id'));\n \n // Add multiple entries when there are multiples of a product\n \n while ($this->qty_counter < $tally) {\n $this->category_price[$this->counter]['category'] = $this->json_source_array['products'][$key_location]['category'];\n $this->category_price[$this->counter]['price'] = $this->json_source_array['products'][$key_location]['price'];\n \n $this->qty_counter += 1;\n $this->counter += 1;\n } \n \n $this->qty_counter = 0;\n }\n\n }", "protected function createProductVariantPricelistPriceRequest($body, $product_id, $variant_id)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling createProductVariantPricelistPrice'\n );\n }\n // verify the required parameter 'product_id' is set\n if ($product_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $product_id when calling createProductVariantPricelistPrice'\n );\n }\n if ($product_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$product_id\" when calling DefaultApi.createProductVariantPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'variant_id' is set\n if ($variant_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $variant_id when calling createProductVariantPricelistPrice'\n );\n }\n if ($variant_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$variant_id\" when calling DefaultApi.createProductVariantPricelistPrice, must be bigger than or equal to 1.');\n }\n $resourcePath = '/products/{productId}/variants/{variantId}/prices';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($product_id !== null) {\n $resourcePath = str_replace(\n '{' . 'productId' . '}',\n ObjectSerializer::toPathValue($product_id),\n $resourcePath\n );\n }\n // path params\n if ($variant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'variantId' . '}',\n ObjectSerializer::toPathValue($variant_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n \n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function get_product_pricebooks($id)\n\t{\n\t\tglobal $log,$singlepane_view;\n\t\t$log->debug(\"Entering get_product_pricebooks(\".$id.\") method ...\");\n\t\tglobal $mod_strings;\n\t\trequire_once('modules/PriceBooks/PriceBooks.php');\n\t\t$focus = new PriceBooks();\n\t\t$button = '';\n\t\tif($singlepane_view == 'true')\n\t\t\t$returnset = '&return_module=Products&return_action=DetailView&return_id='.$id;\n\t\telse\n\t\t\t$returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id;\n\n\n\t\t$query = \"SELECT ec_pricebook.pricebookid as crmid,\n\t\t\tec_pricebook.*,\n\t\t\tec_pricebookproductrel.productid as prodid\n\t\t\tFROM ec_pricebook\n\t\t\tINNER JOIN ec_pricebookproductrel\n\t\t\t\tON ec_pricebookproductrel.pricebookid = ec_pricebook.pricebookid\n\t\t\tWHERE ec_pricebook.deleted = 0\n\t\t\tAND ec_pricebookproductrel.productid = \".$id;\n\t\t$log->debug(\"Exiting get_product_pricebooks method ...\");\n\t\treturn GetRelatedList('Products','PriceBooks',$focus,$query,$button,$returnset);\n\t}", "protected function listProductsVariantsPricelistPricesRequest($product_id, $variant_id)\n {\n // verify the required parameter 'product_id' is set\n if ($product_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $product_id when calling listProductsVariantsPricelistPrices'\n );\n }\n if ($product_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$product_id\" when calling DefaultApi.listProductsVariantsPricelistPrices, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'variant_id' is set\n if ($variant_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $variant_id when calling listProductsVariantsPricelistPrices'\n );\n }\n if ($variant_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$variant_id\" when calling DefaultApi.listProductsVariantsPricelistPrices, must be bigger than or equal to 1.');\n }\n $resourcePath = '/products/{productId}/variants/{variantId}/prices';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($product_id !== null) {\n $resourcePath = str_replace(\n '{' . 'productId' . '}',\n ObjectSerializer::toPathValue($product_id),\n $resourcePath\n );\n }\n // path params\n if ($variant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'variantId' . '}',\n ObjectSerializer::toPathValue($variant_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n \n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function _getCatalogProductPriceData($productIds = null)\n {\n $connection = $this->getConnection();\n $catalogProductIndexPriceSelect = [];\n\n foreach ($this->dimensionCollectionFactory->create() as $dimensions) {\n if (!isset($dimensions[WebsiteDimensionProvider::DIMENSION_NAME]) ||\n $this->websiteId === null ||\n $dimensions[WebsiteDimensionProvider::DIMENSION_NAME]->getValue() === $this->websiteId) {\n $select = $connection->select()->from(\n $this->tableResolver->resolve('catalog_product_index_price', $dimensions),\n ['entity_id', 'customer_group_id', 'website_id', 'min_price']\n );\n if ($productIds) {\n $select->where('entity_id IN (?)', $productIds);\n }\n $catalogProductIndexPriceSelect[] = $select;\n }\n }\n\n $catalogProductIndexPriceUnionSelect = $connection->select()->union($catalogProductIndexPriceSelect);\n\n $result = [];\n foreach ($connection->fetchAll($catalogProductIndexPriceUnionSelect) as $row) {\n $result[$row['website_id']][$row['entity_id']][$row['customer_group_id']] = round($row['min_price'], 2);\n }\n\n return $result;\n }", "public function save($data)\n {\n /* Prices */\n $data['price_low'] = preg_replace(\"/[^0-9\\.]/\", \"\", $data['price_low']);\n $data['special_price_low'] = preg_replace(\"/[^0-9\\.]/\", \"\", $data['special_price_low']);\n\n /* Attributes */\n $attributes = array();\n foreach ($data['attributes']['title'] as $key => $title) {\n $attributes[] = array(\n 'title' => str_replace('\"', '\\\"', $title),\n 'value' => str_replace('\"', '\\\"', $data['attributes']['value'][$key]),\n 'is_variation' => ($data['attributes']['is_variation'][$key] === 'on')\n );\n }\n\n $data['attributes'] = $attributes;\n\n /* Variations */\n if (!empty($data['variations'])) {\n $variations = array();\n foreach ($data['variations']['name'] as $key => $name) {\n $variations[] = array(\n 'name' => str_replace('\"', '\\\"', $name),\n 'available_quantity' => $data['variations']['available_quantity'][$key],\n 'price' => $data['variations']['price'][$key],\n 'special_price' => $data['variations']['special_price'][$key],\n 'advertised' => $data['variations']['advertised'][$key],\n 'final_price' => $data['variations']['final_price'][$key],\n 'image' => $data['variations']['image'][$key]\n );\n }\n\n $data['variations'] = $variations;\n }\n \n $data['short_description'] = str_replace('\"', '\\\"', $data['short_description']);\n $data['description'] = str_replace('\"', '\\\"', $data['description']);\n $data['short_description'] = str_replace(PHP_EOL, '<br />', $data['short_description']);\n $data['description'] = str_replace(PHP_EOL, '<br />', $data['description']);\n \n $productId = $data['product_id'];\n $dataJson = str_replace(\"'\", \"\\'\", json_encode($data));\n \n $query = \"UPDATE products SET processed_data = '{$dataJson}', last_status_change = NOW() WHERE id = {$productId}\";\n $this->query($query);\n\n $errors = $this->getLastError();\n if ($errors) {\n die($errors);\n }\n \n return $this;\n }", "public function addShippingPrice($productID, $shippingPriceList){\n\n global $db;\n\n if(!is_numeric($productID) || !is_array($shippingPriceList) || count($shippingPriceList) < 1){\n return;\n }\n\n foreach($shippingPriceList as $shippingPrice){\n $param = ['productID' => $productID, 'locationID' => $shippingPrice['locationID'], 'price' => fn_buckys_get_btc_price_formated($shippingPrice['price']),];\n\n $db->insertFromArray(TABLE_SHOP_SHIPPING_PRICE, $param);\n\n }\n\n }", "public function wc_epo_product_price_rules( $price = array(), $product ) {\n\t\tif ( $this->is_elex_dpd_enabled() ) {\n\t\t\t$check_price = apply_filters( 'wc_epo_discounted_price', NULL, $product, NULL );\n\t\t\tif ( $check_price ) {\n\t\t\t\t$price['product'] = array();\n\t\t\t\tif ( $check_price['is_multiprice'] ) {\n\t\t\t\t\tforeach ( $check_price['rules'] as $variation_id => $variation_rule ) {\n\t\t\t\t\t\tforeach ( $variation_rule as $rulekey => $pricerule ) {\n\t\t\t\t\t\t\t$price['product'][ $variation_id ][] = array(\n\t\t\t\t\t\t\t\t\"min\" => $pricerule[\"min\"],\n\t\t\t\t\t\t\t\t\"max\" => $pricerule[\"max\"],\n\t\t\t\t\t\t\t\t\"value\" => ( $pricerule[\"type\"] != \"percentage\" ) ? apply_filters( 'wc_epo_product_price', $pricerule[\"value\"], \"\", FALSE ) : $pricerule[\"value\"],\n\t\t\t\t\t\t\t\t\"type\" => $pricerule[\"type\"],\n\t\t\t\t\t\t\t\t'conditions' => isset( $pricerule[\"conditions\"] ) ? $pricerule[\"conditions\"] : array(),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tforeach ( $check_price['rules'] as $rulekey => $pricerule ) {\n\t\t\t\t\t\t$price['product'][0][] = array(\n\t\t\t\t\t\t\t\"min\" => $pricerule[\"min\"],\n\t\t\t\t\t\t\t\"max\" => $pricerule[\"max\"],\n\t\t\t\t\t\t\t\"value\" => ( $pricerule[\"type\"] != \"percentage\" ) ? apply_filters( 'wc_epo_product_price', $pricerule[\"value\"], \"\", FALSE ) : $pricerule[\"value\"],\n\t\t\t\t\t\t\t\"type\" => $pricerule[\"type\"],\n\t\t\t\t\t\t\t'conditions' => isset( $pricerule[\"conditions\"] ) ? $pricerule[\"conditions\"] : array(),\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$price['price'] = apply_filters( 'woocommerce_tm_epo_price_compatibility', apply_filters( 'wc_epo_product_price', $product->get_price(), \"\", FALSE ), $product );\n\t\t}\n\n\t\treturn $price;\n\t}", "public function loadPriceData($storeId, $productIds)\r\n {\r\n $websiteId = $this->getStore($storeId)->getWebsiteId();\r\n\r\n // check if entities data exist in price index table\r\n $select = $this->getConnection()->select()\r\n ->from(['p' => $this->getTable('catalog_product_index_price')])\r\n ->where('p.customer_group_id = ?', 0) // for all customers\r\n ->where('p.website_id = ?', $websiteId)\r\n ->where('p.entity_id IN (?)', $productIds);\r\n\r\n $result = $this->getConnection()->fetchAll($select);\r\n\t\t\r\n\t\treturn $result;\r\n\r\n if ($this->limiter > 3) {\r\n return $result;\r\n }\r\n\r\n // new added product prices may not be populated into price index table in some reason,\r\n // try to force reindex for unprocessed entities\r\n $processedIds = [];\r\n foreach ($result as $priceData) {\r\n $processedIds[] = $priceData['entity_id'];\r\n }\r\n $diffIds = array_diff($productIds, $processedIds);\r\n if (!empty($diffIds)) {\r\n $this->getPriceIndexer()->executeList($diffIds);\r\n $this->limiter += 1;\r\n $this->loadPriceData($storeId, $productIds);\r\n }\r\n\r\n return $result;\r\n }", "public static function updateDealProducts($deal_id, $order_data, $deal_info) {\n\t\t$result = false;\n\t\tif (self::checkConnection()) {\n\t\t\t$old_prod_rows = Rest::execute('crm.deal.productrows.get', [\n\t\t\t\t'id' => $deal_id\n\t\t\t]);\n\t\t\t$new_rows = [];\n\t\t\t// Products list of deal\n\t\t\tforeach ($order_data['PRODUCTS'] as $k => $item) {\n\t\t\t\t// Discount\n\t\t\t\t$price = $item['PRICE'];\n\t\t\t\t// Product fields\n\t\t\t\t$deal_prod = [\n\t\t\t\t\t'PRODUCT_NAME' => $item['PRODUCT_NAME'],\n\t\t\t\t\t'QUANTITY' => $item['QUANTITY'],\n\t\t\t\t\t'DISCOUNT_TYPE_ID' => 1,\n\t\t\t\t\t'DISCOUNT_SUM' => $item['DISCOUNT_SUM'],\n\t\t\t\t\t'MEASURE_CODE' => $item['MEASURE_CODE'],\n\t\t\t\t\t'TAX_RATE' => $item['TAX_RATE'],\n\t\t\t\t\t'TAX_INCLUDED' => $item['TAX_INCLUDED'],\n\t\t\t\t];\n\t\t\t\tif ($item['TAX_INCLUDED']) {\n\t\t\t\t\t$deal_prod['PRICE_EXCLUSIVE'] = $price;\n\t\t\t\t\t$deal_prod['PRICE'] = $price + $price * 0.01 * (int)$item['TAX_RATE'];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$deal_prod['PRICE'] = $price;\n\t\t\t\t}\n\t\t\t\t$new_rows[] = $deal_prod;\n\t\t\t}\n//\t\t\t// Delivery\n//\t\t\t$delivery_sync_type = Settings::get('products_delivery');\n//\t\t\tif (!$delivery_sync_type || ($delivery_sync_type == 'notnull' && $order_data['DELIVERY_PRICE'])) {\n//\t\t\t\t$new_rows[] = [\n//\t\t\t\t\t'PRODUCT_ID' => 'delivery',\n//\t\t\t\t\t'PRODUCT_NAME' => Loc::getMessage(\"SP_CI_PRODUCTS_DELIVERY\"),\n//\t\t\t\t\t'PRICE' => $order_data['DELIVERY_PRICE'],\n//\t\t\t\t\t'QUANTITY' => 1,\n//\t\t\t\t];\n//\t\t\t}\n\t\t\t// Check changes\n\t\t\t$new_rows = self::convEncForDeal($new_rows);\n\t\t\t$has_changes = false;\n\t\t\tif (count($new_rows) != count($old_prod_rows)) {\n\t\t\t\t$has_changes = true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tforeach ($new_rows as $j => $row) {\n\t\t\t\t\tforeach ($row as $k => $value) {\n\t\t\t\t\t\tif ($value != $old_prod_rows[$j][$k]) {\n\t\t\t\t\t\t\t$has_changes = true;\n\t\t\t\t\t\t\tcontinue 2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Send request\n\t\t\tif ($has_changes) {\n\t\t\t\t//\\Helper::Log('(updateDealProducts) deal '.$deal_id.' changed products '.print_r($new_rows, true));\n\t\t\t\t$resp = Rest::execute('crm.deal.productrows.set', [\n\t\t\t\t\t'id' => $deal_id,\n\t\t\t\t\t'rows' => $new_rows\n\t\t\t\t]);\n\t\t\t\tif ($resp) {\n\t\t\t\t\t$result = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "public function setPriceAttribute($value)\n {\n if ( ! is_array($value)) {\n return;\n }\n foreach ($value as $currency => $price) {\n ProductPrice::updateOrCreate([\n 'product_id' => $this->id,\n 'currency_id' => Currency::where('code', $currency)->firstOrFail()->id,\n ], [\n 'price' => $price,\n ]);\n }\n }", "public function productPrices()\n {\n return $this->belongsToMany(ProductPrice::class, 'product_prices', null, 'product_id');\n }", "function woocommerce_rrp_add_bulk_on_edit() {\n\t\t\tglobal $typenow;\n\t\t\t$post_type = $typenow;\n\t\t\t\n\t\t\tif($post_type == 'product') {\n\t\t\t\t\n\t\t\t\t// get the action\n\t\t\t\t$wp_list_table = _get_list_table('WP_Posts_List_Table'); // depending on your resource type this could be WP_Users_List_Table, WP_Comments_List_Table, etc\n\t\t\t\t$action = $wp_list_table->current_action();\n\t\t\t\t\n\t\t\t\t$allowed_actions = array(\"set_price_to_rrp\");\n\t\t\t\tif(!in_array($action, $allowed_actions)) return;\n\t\t\t\t\n\t\t\t\t// security check\n\t\t\t\tcheck_admin_referer('bulk-posts');\n\t\t\t\t\n\t\t\t\t// make sure ids are submitted. depending on the resource type, this may be 'media' or 'ids'\n\t\t\t\tif(isset($_REQUEST['post'])) {\n\t\t\t\t\t$post_ids = array_map('intval', $_REQUEST['post']);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(empty($post_ids)) return;\n\t\t\t\t\n\t\t\t\t// this is based on wp-admin/edit.php\n\t\t\t\t$sendback = remove_query_arg( array('price_setted_to_rrp', 'untrashed', 'deleted', 'ids'), wp_get_referer() );\n\t\t\t\tif ( ! $sendback )\n\t\t\t\t\t$sendback = admin_url( \"edit.php?post_type=$post_type\" );\n\t\t\t\t\n\t\t\t\t$pagenum = $wp_list_table->get_pagenum();\n\t\t\t\t$sendback = add_query_arg( 'paged', $pagenum, $sendback );\n\t\t\t\t\n\t\t\t\tswitch($action) {\n\t\t\t\t\tcase 'set_price_to_rrp':\n\t\t\t\t\t\t\n\t\t\t\t\t\t// if we set up user permissions/capabilities, the code might look like:\n\t\t\t\t\t\t//if ( !current_user_can($post_type_object->cap->export_post, $post_id) )\n\t\t\t\t\t\t//\twp_die( __('You are not allowed to export this post.') );\n\t\t\t\t\t\t\n\t\t\t\t\t\t$price_setted_to_rrp = 0;\n\t\t\t\t\t\tforeach( $post_ids as $post_id ) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$buy_price = get_post_meta($post_id, 'buy_price', true);\n\t\t\t\t\t\t\t$rrp_calc_params = array(\n\t\t\t\t\t\t\t\t'ads_cost' => get_rrp_param($post_id, 'ads_cost'),\t\n\t\t\t\t\t\t\t\t'shipping_cost' => get_rrp_param($post_id, 'shipping_cost'),\t\n\t\t\t\t\t\t\t\t'package_cost' => get_rrp_param($post_id, 'package_cost'),\t\n\t\t\t\t\t\t\t\t'min_profit' => get_rrp_param($post_id, 'min_profit'),\t\n\t\t\t\t\t\t\t\t'desired_profit' => get_rrp_param($post_id, 'desired_profit'),\t\n\t\t\t\t\t\t\t\t'tax_rate' => get_rrp_param($post_id, 'tax_rate'),\n\t\t\t\t\t\t\t);\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$caluculated_rrp = calculate_rrp($buy_price, $rrp_calc_params);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tupdate_post_meta( $post_id, '_regular_price', $caluculated_rrp );\n\t\t\t\n\t\t\t\t\t\t\t$price_setted_to_rrp++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$sendback = add_query_arg( array('price_setted_to_rrp' => $price_setted_to_rrp, 'ids' => join(',', $post_ids) ), $sendback );\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tdefault: return;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$sendback = remove_query_arg( array('action', 'action2', 'tags_input', 'post_author', 'comment_status', 'ping_status', '_status', 'post', 'bulk_edit', 'post_view'), $sendback );\n\t\t\t\t\n\t\t\t\twp_redirect($sendback);\n\t\t\t\texit();\n\t\t\t}\n\t\t}", "public function getAllList_Price()\n {\n try\n {\n // Создаем новый запрс\n $db = $this->getDbo();\n $query = $db->getQuery(true);\n\n $query->select('a.*');\n $query->from('`#__gm_ceiling_components_option` AS a');\n $query->select('CONCAT( component.title , \\' \\', a.title ) AS full_name');\n $query->select('component.id AS component_id');\n $query->select('component.title AS component_title');\n $query->select('component.unit AS component_unit');\n $query->join('RIGHT', '`#__gm_ceiling_components` AS component ON a.component_id = component.id');\n\n $db->setQuery($query);\n $return = $db->loadObjectList();\n return $return;\n }\n catch(Exception $e)\n {\n Gm_ceilingHelpersGm_ceiling::add_error_in_log($e->getMessage(), __FILE__, __FUNCTION__, func_get_args());\n }\n }", "public function run()\n {\n ProductPrice::insert(\n \t[\n \t[\"product_id\" => 1,\n \t \"description\" => \"economical\",\n \t \"price\" => 10000\n \t],\n \t[\"product_id\" => 1,\n \t \"description\" => \"default\",\n \t \"price\" => 100000\n \t],\n \t[\"product_id\" => 1,\n \t \"description\" => \"plus\",\n \t \"price\" => 1000000\n \t],\n \t[\"product_id\" => 2,\n \t \"description\" => \"economical\",\n \t \"price\" => 10000\n \t],\n \t[\"product_id\" => 2,\n \t \"description\" => \"default\",\n \t \"price\" => 100000\n \t],\n \t[\"product_id\" => 2,\n \t \"description\" => \"plus\",\n \t \"price\" => 1000000\n \t],\n \t[\"product_id\" => 3,\n \t \"description\" => \"economical\",\n \t \"price\" => 10000\n \t],\n \t[\"product_id\" => 3,\n \t \"description\" => \"default\",\n \t \"price\" => 100000\n \t],\n \t[\"product_id\" => 3,\n \t \"description\" => \"plus\",\n \t \"price\" => 1000000\n \t],\n \t[\"product_id\" => 4,\n \t \"description\" => \"economical\",\n \t \"price\" => 10000\n \t],\n \t[\"product_id\" => 4,\n \t \"description\" => \"default\",\n \t \"price\" => 100000\n \t],\n \t[\"product_id\" => 4,\n \t \"description\" => \"plus\",\n \t \"price\" => 1000000\n \t],\n \t[\"product_id\" => 5,\n \t \"description\" => \"economical\",\n \t \"price\" => 10000\n \t],\n \t[\"product_id\" => 5,\n \t \"description\" => \"default\",\n \t \"price\" => 100000\n \t],\n \t[\"product_id\" => 5,\n \t \"description\" => \"plus\",\n \t \"price\" => 1000000\n \t]\n \t]);\n }", "public function updateProduct()\n {\n \t$quote=$this->getQuote();\n \tif($quote)\n \t{\n \t\t$detailproduct=$this->getProduct();\n \t\t$quoteproduct=$quote->getProduct();\n \t\tif(\n\t\t\t\t$quote->getPrice()!=$this->getPrice() or\n\t\t\t\t$quote->getDiscrate()!=$this->getDiscrate() or\n\t\t\t\t$quote->getDiscamt()!=$this->getDiscamt() or\n\t\t\t\t$quote->getProductId()!=$this->getProductId()\n\t\t\t)\n\t\t\t{\n\t\t\t\t$quote->setPrice($this->getPrice());\n\t\t\t\t$quote->setDiscrate($this->getDiscrate());\n\t\t\t\t$quote->setDiscamt($this->getDiscamt());\n\t\t\t\t$quote->setProductId($this->getProductId());\n\t\t\t\t$quote->calc(); //auto save\n\t\t\t\t$detailproduct->calcSalePrices();\n\t\t\t\t\n\t\t\t\t//if product changed, calc old product\n\t\t\t\tif($quoteproduct->getId()!=$detailproduct->getId())\n\t\t\t\t\t$quoteproduct->calcSalePrices();\n\t\t\t}\n \t}\n \telse\n \t{\n\t\t\t//if none, see if product quote by vendor with similar pricing exists. \n\t\t\t$quote=Fetcher::fetchOne(\"Quote\",array('total'=>$this->getUnittotal(),'vendor_id'=>SettingsTable::fetch(\"me_vendor_id\"),'product_id'=>$this->getProductId()));\n\n\t\t\t//if it doesn't exist, create it, and product->calc()\n\t\t\tif(!$quote)\n\t\t\t{\n\t\t\t\tQuoteTable::createOne(array(\n\t\t\t\t\t'date'=>$this->getInvoice()->getDate(),\n\t\t\t\t\t'price'=>$this->getPrice(),\n\t\t\t\t\t'discrate'=>$this->getDiscrate(),\n\t\t\t\t\t'discamt'=>$this->getDiscamt(),\n\t\t\t\t\t'vendor_id'=>SettingsTable::fetch(\"me_vendor_id\"),\n\t\t\t\t\t'product_id'=>$this->getProductId(),\n\t\t\t\t\t'ref_class'=>\"Invoicedetail\",\n\t\t\t\t\t'ref_id'=>$this->getId(),\n\t\t\t\t\t'mine'=>1,\n\t\t\t\t\t));\n\t\t\t\t$this->getProduct()->calcSalePrices();\n\t\t\t}\n \t}\n }", "public function execute($ids)\n {\n // TODO: check configurable products\n\n $storeIds = array_keys($this->storeManager->getStores());\n foreach ($storeIds as $storeId) {\n if (!$this->configHelper->isEnabled($storeId)) {\n $this->logger->info('[LOGSHUBSEARCH] Synchronizing disabled for #'.$storeId);\n return;\n }\n if (!$this->configHelper->isReadyToIndex($storeId)) {\n $this->logger->error('[LOGSHUBSEARCH] Unable to update products index. Configuration error #'.$storeId);\n return;\n }\n\n if (!is_array($ids) || empty($ids)) {\n $ids = $this->getAllProductIds();\n $this->logger->info('[LOGSHUBSEARCH] Synchronizing all the '.count($ids).' products, store: #'.$storeId);\n }\n \n $sender = $this->helper->getProductsSender($storeId);\n $pageLength = $this->configHelper->getProductsIndexerPageLength($storeId);\n foreach (array_chunk($ids, $pageLength) as $chunk) {\n $apiProducts = $this->helper->getApiProducts($chunk);\n $sender->synch($apiProducts);\n }\n }\n }", "function findsAmazonProductsForPriceUpdate($amazonAccountsSitesId)\n{\n\t$data['from'] = 'amazon_products';\n\t$data['select'] = 'id_product, accountsite_id, SKU, lastpriceupdate';\n\t$data['where'] = \"\n\t\taccountsite_id = '\" . $amazonAccountsSitesId . \"'\n\t\";\n\treturn SQLSelect($data['from'], $data['select'], $data['where'], 0, 0, 0, 'shop', __FILE__, __LINE__);\n}", "public function getPriceList() {\n\t\tif( count($this->prices) > 0 ) {\n\t\t\tthrow new \\InvalidArgumentException(sprintf('The name \"%s\" is invalid.', $name));\n\t\t}\n\t\treturn $this->prices;\n\t}", "protected function calculatePrices()\n {\n }", "public function get_prices()\n\t{\n\t\t$product_price_old = 0;\n\t\t$product_price_sale = 0;\n\t\t$price = 0;\n\t\t$eco = 0;\n\t\t$taxes = 0;\n\t\t$dataoc = isset($this->request->post['dataoc']) ? $this->request->post['dataoc'] : '';\n\n\t\tif (!empty($dataoc)) {\n\t\t\t$dataoc = str_replace('&quot;', '\"', $dataoc);\n\t\t\t$json = @json_decode($dataoc, true);\n\t\t\t$product_quantity = isset($json['quantity']) ? $json['quantity'] : 0;\n\t\t\t$product_id_oc = isset($json['product_id_oc']) ? $json['product_id_oc'] : 0;\n\t\t\tif ($product_id_oc == 0) $product_id_oc = isset($json['_product_id_oc']) ? $json['_product_id_oc'] : 0;\n\n\t\t\t// get options\n\t\t\t$options = isset($json['option_oc']) ? $json['option_oc'] : array();\n\t\t\tforeach ($options as $key => $value) {\n\t\t\t\tif ($value == null || empty($value)) unset($options[$key]);\n\t\t\t}\n\n\t\t\t// get all options of product\n\t\t\t$options_temp = $this->get_options_oc($product_id_oc);\n\n\t\t\t// Calc price for ajax\n\t\t\tforeach ($options_temp as $value) {\n\t\t\t\tforeach ($options as $k => $option_val) {\n\t\t\t\t\tif ($k == $value['product_option_id']) {\n\t\t\t\t\t\tif ($value['type'] == 'checkbox' && is_array($option_val) && count($option_val) > 0) {\n\t\t\t\t\t\t\tforeach ($option_val as $val) {\n\t\t\t\t\t\t\t\tforeach ($value['product_option_value'] as $op) {\n\t\t\t\t\t\t\t\t\t// calc price\n\t\t\t\t\t\t\t\t\tif ($val == $op['product_option_value_id']) {\n\t\t\t\t\t\t\t\t\t\tif ($op['price_prefix'] == $this->minus) $price -= isset($op['price_no_tax']) ? $op['price_no_tax'] : 0;\n\t\t\t\t\t\t\t\t\t\telse $price += isset($op['price_no_tax']) ? $op['price_no_tax'] : 0;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} elseif ($value['type'] == 'radio' || $value['type'] == 'select') {\n\t\t\t\t\t\t\tforeach ($value['product_option_value'] as $op) {\n\t\t\t\t\t\t\t\tif ($option_val == $op['product_option_value_id']) {\n\t\t\t\t\t\t\t\t\tif ($op['price_prefix'] == $this->minus) $price -= isset($op['price_no_tax']) ? $op['price_no_tax'] : 0;\n\t\t\t\t\t\t\t\t\telse $price += isset($op['price_no_tax']) ? $op['price_no_tax'] : 0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// the others have not price, so don't need calc\n\t\t\t\t\t}\n\t\t\t\t\t// if not same -> return.\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$product_prices = $this->get_product_price($product_id_oc, $product_quantity);\n\t\t\t$product_price_old = isset($product_prices['price_old']) ? $product_prices['price_old'] : 0;\n\t\t\t$product_price_sale = isset($product_prices['price_sale']) ? $product_prices['price_sale'] : 0;\n\t\t\t$enable_taxes = $this->config->get('tshirtecommerce_allow_taxes');\n\t\t\tif ($enable_taxes === null || $enable_taxes == 1) {\n\t\t\t\t$taxes = isset($product_prices['taxes']) ? $product_prices['taxes'] : 0;\n\t\t\t\t$eco = isset($product_prices['eco']) ? $product_prices['eco'] : 0;\n\t\t\t} else {\n\t\t\t\t$taxes = 0;\n\t\t\t\t$eco = 0;\n\t\t\t}\n\t\t\t\n\t\t} // do nothing when empty/blank\n\n\t\t// return price for ajax\n\t\techo @json_encode(array(\n\t\t\t'price' => $price, \n\t\t\t'price_old' => $product_price_old, \n\t\t\t'price_sale' => $product_price_sale, \n\t\t\t'taxes' => $taxes,\n\t\t\t'eco' => $eco\n\t\t));\n\t\treturn;\n\t}", "public function executeList(array $ids)\n {\n $this->smartCollectionsHelper->createSmartCollections();\n }", "public function update(Request $request, $id)\n {\n $pricelist = $this->pricelist->find($id);\n $pricelist->fill($request->except('pricelist_items'));\n $pricelist->save();\n\n $priceListItem = [];\n $requestPricelistItems = json_decode($request->pricelist_items);\n\n foreach ( $requestPricelistItems as $pricelistItem) {\n $priceListItem = [\n 'price_list_id' => $id,\n 'waste_id' => $pricelistItem->pivot->waste_id,\n 'unit_id' => $pricelistItem->unit_id,\n 'unit_price' => (double)$pricelistItem->pivot->unit_price\n ];\n $priceListItemToBeUpdated = $this->pricelistItem->where('waste_id',$pricelistItem->pivot->waste_id)\n ->where('price_list_id',$id)->first();\n if ($priceListItemToBeUpdated->count() > 0) {\n \n $priceListItemToBeUpdated->unit_price = (double)$pricelistItem->pivot->unit_price;\n $priceListItemToBeUpdated->unit_id = $pricelistItem->unit_id;\n $priceListItemToBeUpdated->save();\n\n } else {\n $pricelist->wastes()->attach($priceListItem);\n }\n }\n\n return redirect()->route('settings.pricelists')\n ->with('success', 'Pricelist has been updated!');\n }", "public function getPriceByListWithEcotax( PriceList $list = null )\n {\n // Return Price Object\n $price = $this->getPriceByList( $list );\n\n // Add Ecotax\n if ( Configuration::isTrue('ENABLE_ECOTAXES') && $this->ecotax )\n {\n // Template: $price = [ price, price_tax_inc, price_is_tax_inc ]\n// $ecoprice = Price::create([\n// $this->getEcotax(), \n// $this->getEcotax()*(1.0+$price->tax_percent/100.0), \n// $price->price_tax_inc\n// ]);\n\n $price->add( $this->getEcotax() ); \n }\n\n return $price;\n }", "public function deleteprice()\n {\n $this->resetContentCache();\n\n $oDb = oxDb::getDb();\n $sPriceId = $oDb->quote(oxRegistry::getConfig()->getRequestParameter(\"priceid\"));\n $sId = $oDb->quote($this->getEditObjectId());\n $oDb->execute(\"delete from oxprice2article where oxid = {$sPriceId} and oxartid = {$sId}\");\n }", "function addListPrice($request) {\n\t\t$sourceModule = $request->getModule();\n\t\t$sourceRecordId = $request->get('src_record');\n\t\t$relatedModule = $request->get('related_module');\n\t\t$relInfos = $request->get('relinfo');\n\n\t\t$sourceModuleModel = Vtiger_Module_Model::getInstance($sourceModule);\n\t\t$relatedModuleModel = Vtiger_Module_Model::getInstance($relatedModule);\n\t\t$relationModel = Vtiger_Relation_Model::getInstance($sourceModuleModel, $relatedModuleModel);\n\t\tforeach($relInfos as $relInfo) {\n\t\t\t$price = CurrencyField::convertToDBFormat($relInfo['price'], null, true);\n\t\t\t$relationModel->addListPrice($sourceRecordId, $relInfo['id'], $price);\n\t\t}\n\t}", "public function priceLists()\n {\n return $this->hasOne('App\\Models\\PriceList');\n }", "function getArticlesByPrice($priceMin=0, $priceMax=0, $usePriceGrossInstead=0, $proofUid=1){\n //first get all real articles, then create objects and check prices\n\t //do not get prices directly from DB because we need to take (price) hooks into account\n\t $table = 'tx_commerce_articles';\n\t $where = '1=1';\n\t if($proofUid){\n\t $where.= ' and tx_commerce_articles.uid_product = '.$this->uid;\n\t }\t\n //todo: put correct constant here\n\t $where.= ' and article_type_uid=1';\n\t $where.= $this->cObj->enableFields($table);\n\t $groupBy = '';\n\t $orderBy = 'sorting';\n\t $limit = '';\n\t $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery (\n\t 'uid', $table,\n\t $where, $groupBy,\n\t $orderBy,$limit\n\t );\n\t $rawArticleUidList = array();\n\t while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n\t $rawArticleUidList[] = $row['uid'];\n\t }\n\t $GLOBALS['TYPO3_DB']->sql_free_result($res);\n\t \n\t //now run the price test\n\t $articleUidList = array();\n\t foreach ($rawArticleUidList as $rawArticleUid) {\n\t\t $tmpArticle = new tx_commerce_article($rawArticleUid,$this->lang_uid);\n\t\t $tmpArticle->load_data();\n\t\t\t $myPrice = $usePriceGrossInstead ? $tmpArticle->get_price_gross() : $tmpArticle->get_price_net();\n\t\t\t if (($priceMin <= $myPrice) && ($myPrice <= $priceMax)) {\n\t\t\t $articleUidList[] = $tmpArticle->get_uid();\n\t\t\t }\n\t\t }\n if(count($articleUidList)>0){\n return $articleUidList;\n }else{\n return false;\n\t }\n\t}", "public function listProductprices(){\n try{\n $sql = \"Select * from productforsale pr inner join product p on pr.id_product = p.id_product inner join categoryp c on p.id_categoryp = c.id_categoryp inner join medida m on p.product_unid_type = m.medida_id\";\n $stm = $this->pdo->prepare($sql);\n $stm->execute();\n $result = $stm->fetchAll();\n } catch (Exception $e){\n $this->log->insert($e->getMessage(), 'Inventory|listProductprices');\n $result = 2;\n }\n\n return $result;\n }", "private function createMultipleProductsPlaceHolders($multipleProducts, $translations, &$args)\n\t{\n\t\t$formId = (int) $args['form']->FormId;\n\t\t$submissionId = (int) $args['submission']->SubmissionId;\n\t\t$multipleSeparator = nl2br($args['form']->MultipleSeparator);\n\t\t$properties = RSFormProHelper::getComponentProperties($multipleProducts, false);\n\t\t$priceHelper = new Price($this->loadFormSettings($formId));\n\t\t$this->translate($properties, $translations);\n\n\t\tforeach ($multipleProducts as $product)\n\t\t{\n\t\t\t$data = $properties[$product];\n\t\t\t$value = $this->getSubmissionValue($submissionId, (int) $product);\n\n\t\t\tif ($value === '' || $value === null)\n\t\t\t{\n\t\t\t\t$args['placeholders'][] = '{' . $data['NAME'] . ':amount}';\n\t\t\t\t$args['values'][] = '';\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$values = explode(\"\\n\", $value);\n\n\t\t\t$field = new MultipleProducts(\n\t\t\t\t[\n\t\t\t\t\t'formId' => $formId,\n\t\t\t\t\t'componentId' => $product,\n\t\t\t\t\t'data' => $data,\n\t\t\t\t\t'value' => ['formId' => $formId, $data['NAME'] => $values],\n\t\t\t\t\t'invalid' => false,\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t$replace = '{' . $data['NAME'] . ':price}';\n\t\t\t$with = [];\n\t\t\t$withAmount = [];\n\n\t\t\tif ($items = $field->getItems())\n\t\t\t{\n\t\t\t\tforeach ($items as $item)\n\t\t\t\t{\n\t\t\t\t\tif (empty($item))\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$item = new RSFormProFieldItem($item);\n\n\t\t\t\t\tforeach ($values as $value)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (stristr($value, $item->label))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$with[] = $priceHelper->getPriceMask(\n\t\t\t\t\t\t\t\t$value, $item->value, ($data['CURRENCY'] ?? '')\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$quantity = trim(str_ireplace($item->label, '', $value));\n\n\t\t\t\t\t\t\tif (strlen($quantity) === 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$quantity = 1;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$withAmount[] = $quantity * $item->value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (($position = array_search($replace, $args['placeholders'])) !== false)\n\t\t\t{\n\t\t\t\t$args['placeholders'][$position] = $replace;\n\t\t\t\t$args['values'][$position] = implode($multipleSeparator, $with);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$args['placeholders'][] = $replace;\n\t\t\t\t$args['values'][] = implode($multipleSeparator, $with);\n\t\t\t}\n\n\t\t\t$args['placeholders'][] = '{' . $data['NAME'] . ':amount}';\n\t\t\t$args['values'][] = $priceHelper->getAmountMask(\n\t\t\t\t($withAmount ? array_sum($withAmount) : 0), ($data['CURRENCY'] ?? '')\n\t\t\t);\n\t\t}\n\t}", "public function prepareData($collection, $productIds)\n {\n foreach ($collection as &$item) {\n if ($item->getSpecialPrice()) {\n $product = $this->productRepository->get($item->getSku());\n $specialFromDate = $product->getSpecialFromDate();\n $specialToDate = $product->getSpecialToDate();\n\n if ($specialFromDate || $specialToDate) {\n $id = $product->getId();\n $this->effectiveDates[$id] = $this->getSpecialEffectiveDate($specialFromDate, $specialToDate);\n }\n }\n }\n }", "public function prices()\n {\n return $this\n ->belongsToMany(PricingGroup::class, PriceListItem::getTableName(), 'item_unit_id', 'pricing_group_id')\n ->withPivot(['price', 'discount_value', 'discount_percent', 'date', 'pricing_group_id']);\n }", "public function processPurchaseOrder($productIds)\r\n {\r\n // process every products for PO creation\r\n foreach ($productIds as $productId) {\r\n // get the additional stock received from PO\r\n $this->Inventory->addStock($productId, 20);\r\n\r\n // update PO data after receiving\r\n $this->ProductsPurchased->updatePurchaseOrderAfterReceiving($productId);\r\n }\r\n }", "public function testPriceGroupWithVariants()\n {\n $number = __FUNCTION__;\n $context = $this->getContext();\n\n $data = $this->createPriceGroupProduct($number, $context, true);\n\n $this->helper->createArticle($data);\n\n $listProduct = $this->helper->getListProduct($number, $context, [\n 'useLastGraduationForCheapestPrice' => true,\n ]);\n\n /* @var ListProduct $listProduct */\n static::assertEquals(7, $listProduct->getCheapestPrice()->getCalculatedPrice());\n }", "public function removeShippingPriceByIDs($idList){\n\n global $db;\n\n if(!is_array($idList)){\n $idList = [$idList];\n }\n\n if(!is_array($idList) || count($idList) < 1)\n return;\n\n $query = sprintf('DELETE FROM %s WHERE id IN (%s)', TABLE_SHOP_SHIPPING_PRICE, implode(',', $idList));\n\n return $db->query($query);\n\n }", "public function run()\n {\n DB::table('product_prices')->insert([\n 'product_id' => 1,\n 'description' => 'single',\n 'price' => 100.00\n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 2,\n 'description' => 'single', \n 'price' => 200.00 \n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 3,\n 'description' => 'single', \n 'price' => 300.00 \n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 4,\n 'description' => 'single',\n 'price' => 400.00 \n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 5,\n 'description' => 'single',\n 'price' => 500.00\n ]);\n DB::table('product_prices')->insert([\n 'product_id' => 6,\n 'description' => 'single',\n 'price' => 600.00\n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 7,\n 'description' => 'single',\n 'price' => 700.00\n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 8,\n 'description' => 'single',\n 'price' => 800.00\n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 9,\n 'description' => 'single',\n 'price' => 9000.00\n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 1,\n 'description' => 'bundle (10 pcs)',\n 'price' => 1000.00\n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 2,\n 'description' => 'bundle (10 pcs)', \n 'price' => 2000.00 \n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 3,\n 'description' => 'bundle (10 pcs)', \n 'price' => 3000.00 \n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 4,\n 'description' => 'bundle (10 pcs)',\n 'price' => 4000.00 \n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 5,\n 'description' => 'bundle (10 pcs)',\n 'price' => 5000.00\n ]);\n DB::table('product_prices')->insert([\n 'product_id' => 6,\n 'description' => 'bundle (10 pcs)',\n 'price' => 6000.00\n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 7,\n 'description' => 'bundle (10 pcs)',\n 'price' => 7000.00\n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 8,\n 'description' => 'bundle (10 pcs)',\n 'price' => 8000.00\n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 9,\n 'description' => 'bundle (10 pcs)',\n 'price' => 9000.00\n ]);\n }", "public function editDeleteRelatedUpSellCrossSellProductsProvider(): array\n {\n return [\n 'update' => [\n 'data' => [\n 'defaultLinks' => $this->defaultDataFixture,\n 'productLinks' => $this->existingProducts,\n ],\n ],\n 'delete' => [\n 'data' => [\n 'defaultLinks' => $this->defaultDataFixture,\n 'productLinks' => []\n ],\n ],\n 'same' => [\n 'data' => [\n 'defaultLinks' => $this->existingProducts,\n 'productLinks' => $this->existingProducts,\n ],\n ],\n 'change_position' => [\n 'data' => [\n 'defaultLinks' => $this->existingProducts,\n 'productLinks' => array_replace_recursive(\n $this->existingProducts,\n [\n ['position' => 4],\n ['position' => 5],\n ['position' => 6],\n ]\n ),\n ],\n ],\n 'without_position' => [\n 'data' => [\n 'defaultLinks' => $this->defaultDataFixture,\n 'productLinks' => array_replace_recursive(\n $this->existingProducts,\n [\n ['position' => null],\n ['position' => null],\n ['position' => null],\n ]\n ),\n 'expectedProductLinks' => array_replace_recursive(\n $this->existingProducts,\n [\n ['position' => 1],\n ['position' => 2],\n ['position' => 3],\n ]\n ),\n ],\n ],\n ];\n }", "public function execute($ids)\n {\n $this->smartCollectionsHelper->createSmartCollections();\n }", "public function execute(ProductListTransfer $productListTransfer): void;", "public function import_products() {\n\n\t\t// Make sure this was triggered by a real person\n\t\tif ( ! check_admin_referer( 'amazon_product_import') ) {\n\t\t\twp_die( \n\t\t\t\t__( 'Invalid nonce specified', $this->plugin_name ), \n\t\t\t\t__( 'Error', $this->plugin_name ), \n\t\t\t\t[\n\t\t\t\t\t'response' \t=> 403,\n\t\t\t\t\t'back_link' => 'admin.php?page=' . $this->plugin_name,\n\t\t\t\t]\n\t\t\t);\n\t\t\texit;\n\t\t}\n\n\t\t// Get a list of all the product IDs that we want to update\n\t\t$products = $this->collect_product_identifiers();\n\n\t\t// If we have some IDs\n\t\tif ( !empty($products) ) {\n\n\t\t\t// Lets fetch the updates from Amazon via the SDK\n\t\t\t$updates = $this->fetch_items($products);\n\n\t\t\t// Remove the error key in the array\n\t\t\t$errors = $updates['error'];\n\t\t\tunset($updates['error']);\n\n\t\t\tif ( !empty($updates) && count($errors) === 0 ) {\n\t\t\t\t// Now lets update our DB with the new information\n\t\t\t\t$this->update_items($updates);\n\n\t\t\t\t// Finally lets throw up a confirmation box to the user and redirect\n\t\t\t\twp_redirect( admin_url( 'admin.php?page=amazon-product-import%2Fadmin%2Fpartials%2Famazon-product-import-admin-display.php&success=true' ) );\n exit;\n\t\t\t}\n\t\t\telse if (count($errors) > 0) {\n\t\t\t\t// Store the errors in a transient\n\t\t\t\tset_transient( 'amazon-import-errors', $errors, MINUTE_IN_SECONDS );\n\t\t\t\t// Finally lets throw up an error box to the user and redirect\n\t\t\t\twp_redirect( admin_url( 'admin.php?page=amazon-product-import%2Fadmin%2Fpartials%2Famazon-product-import-admin-display.php&success=false' ) );\n exit;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// No updates\n\t\t\t\t// Finally lets throw up a confirmation box to the user and redirect\n\t\t\t\twp_redirect( admin_url( 'admin.php?page=amazon-product-import%2Fadmin%2Fpartials%2Famazon-product-import-admin-display.php&success=true' ) );\n exit;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t// No products to import\n\t\t\t// Finally lets throw up a confirmation box to the user and redirect\n\t\t\twp_redirect( admin_url( 'admin.php?page=amazon-product-import%2Fadmin%2Fpartials%2Famazon-product-import-admin-display.php&success=true' ) );\n\t\t\texit;\n\t\t}\n\n\t\n\t}", "public function setProductIDs($productIDs)\n {\n $parameters = $this->request->getParameters();\n $parameters['id'] = $productIDs;\n $this->recommendationsUpToDate = false;\n }", "public static function getPrice(&$products_table = NULL, $uid = NULL) {\n Yii::import('application.controllers.ProfileController');\n\n if (!$products_table) { //if it's cart products table\n $table = 'store_cart';\n } else {\n $table = 'temp_order_product_' . (Yii::app()->user->id ? Yii::app()->user->id : 'exchange');\n $query = \"DROP TABLE IF EXISTS {$table};\";\n $query .= \"CREATE TEMPORARY TABLE {$table} (product_id int(11) unsigned, quantity smallint(5) unsigned);\";\n foreach ($products_table as $item) {\n\n if ($item instanceof OrderProduct || $item instanceof stdClass || $item instanceof Cart) {\n $product = Product::model()->findByAttributes(array('id' => (string) $item->product_id));\n } else {\n $product = Product::model()->findByAttributes(array('code' => (string) $item->code));\n }\n\n if ($product) {\n $query .= \"INSERT INTO {$table} VALUES ({$product->id}, {$item->quantity});\";\n } else {\n throw new Exception('Product not found. Product code: ' . $item->code);\n }\n }\n Yii::app()->db->createCommand($query)->execute();\n }\n $query = Yii::app()->db->createCommand()\n ->select('SUM(c.quantity*round(prices.price*(1-greatest(ifnull(disc.percent,0),ifnull(disc1.percent,0),ifnull(disc2.percent,0))/100))) as c_summ, prices.price_id')\n ->from($table . ' c')\n ->join('store_product product', 'c.product_id=product.id')\n ->join('store_product_price prices', 'product.id=prices.product_id')\n ->join('store_price price', 'price.id=prices.price_id')\n ->leftJoin('store_discount disc', \"disc.product_id=0 and disc.actual=1 and (disc.begin_date='0000-00-00' or disc.begin_date<=CURDATE()) and (disc.end_date='0000-00-00' or disc.end_date>=CURDATE())\")\n ->leftJoin('store_product_category cat', 'cat.product_id=product.id')\n ->leftJoin('store_discount_category discat', 'discat.category_id=cat.category_id')\n ->leftJoin('store_discount disc1', \"disc1.product_id=1 and disc1.id=discat.discount_id and disc1.actual=1 and (disc1.begin_date='0000-00-00' or disc1.begin_date<=CURDATE()) and (disc1.end_date='0000-00-00' or disc1.end_date>=CURDATE())\")\n ->leftJoin('store_discount_product dispro', 'dispro.product_id=product.id')\n ->leftJoin('store_discount disc2', \"disc2.product_id=2 and disc2.id=dispro.discount_id and disc2.actual=1 and (disc2.begin_date='0000-00-00' or disc2.begin_date<=CURDATE()) and (disc2.end_date='0000-00-00' or disc2.end_date>=CURDATE())\")\n ->order('price.summ DESC')\n ->group('prices.price_id, price.summ')\n ->having('c_summ>price.summ');\n\n if (!$products_table){\n $sid = ProfileController::getSession();\n $query->where(\"(session_id=:sid AND :sid<>'') OR (user_id=:uid AND :sid<>'')\", array(\n ':sid' => $sid,\n ':uid' => Yii::app()->user->isGuest ? '' : Yii::app()->user->id,\n ));\n }\n\n// $text = $query->getText();\n $row = $query->queryRow();\n if ($row)\n $price = self::model()->findByPk($row['price_id']);\n else\n $price = self::model()->find(array('order' => 'summ'));\n\n if ($products_table)\n Yii::app()->db->createCommand(\"DROP TABLE IF EXISTS {$table};\")->execute();\n\n if ($uid)\n $profile = CustomerProfile::model()->with('price')->findByAttributes(array('user_id' => $uid));\n else\n $profile = ProfileController::getProfile();\n\n if ($profile && $profile->price_id && $profile->price->summ > $price->summ)\n return $profile->price;\n else\n return $price;\n }", "public function price(StoreProductPriceRequest $request, $id){\n\n $product = Product::findOrFail($id);\n $productPrice = new ProductQuantityPrice();\n $productPrice->fill($request->all());\n $productPrice->product_id = $product->id;\n $productPrice->save();\n\n return (new ProductPrice($productPrice))\n ->response()\n ->setStatusCode(201);\n }", "public function updatePriceID($data)\n {\n $i_data = array_merge(['price_id' => Price::uniqueId()], $data);\n Price::where('sellable_id', '=', $data['sellable_id'])\n ->where('sellable_type', '=', $data['sellable_type'])\n ->update($i_data, ['upsert' => true]);\n }", "public static function updateFlashSaleTime($listUpdate){\n $tmp = $listUpdate;\n $p = new Products();\n foreach ($p as $item => $tmp){\n\n }\n }", "function editPrices($item, $_options = false) {\n\t\tglobal $model;\n\t\tglobal $page;\n\n\t\t$currency_options = $model->toOptions($page->currencies(), \"id\", \"id\");\n\t\t$default_currency = $page->currency();\n\n\t\t$vatrate_options = $model->toOptions($page->vatrates(), \"id\", \"name\");\n\n\t\t$type_options = array(\"default\" => \"Standard price\", \"offer\" => \"Special offer\", \"bulk\" => \"Bulk price\");\n\n\t\t$_ = '';\n\n\t\t$_ .= '<div class=\"prices i:defaultPrices i:collapseHeader item_id:'.$item[\"id\"].'\"'.$this->jsData([\"prices\"]).'>';\n\t\t$_ .= '<h2>Prices</h2>';\n\n\t\t$_ .= $this->priceList($item[\"item_id\"]);\n\n\t\t$_ .= $model->formStart($this->path.\"/addPrice/\".$item[\"id\"], array(\"class\" => \"labelstyle:inject\"));\n\t\t$_ .= '<fieldset>';\n\t\t$_ .= $model->input(\"item_price\");\n\t\t$_ .= $model->input(\"item_price_currency\", array(\"type\" => \"select\", \"options\" => $currency_options, \"value\" => $default_currency));\n\t\t$_ .= $model->input(\"item_price_vatrate\", array(\"type\" => \"select\", \"options\" => $vatrate_options));\n\t\t$_ .= $model->input(\"item_price_type\", array(\"type\" => \"select\", \"options\" => $type_options));\n\t\t$_ .= $model->input(\"item_price_quantity\");\n\t\t$_ .= '</fieldset>';\n\n\t\t$_ .= '<ul class=\"actions\">';\n\t\t$_ .= $model->submit(\"Add new price\", array(\"class\" => \"primary\", \"wrapper\" => \"li.save\"));\n\t\t$_ .= '</ul>';\n\t\t$_ .= $model->formEnd();\n\t\t$_ .= '</div>';\n\n\t\treturn $_;\n\t}", "public static function productLists()\n {\n array_push(self::$products, \n [\n CART::ID => self::$id,\n CART::NAME => self::$name,\n CART::PRICE => self::$price,\n CART::QUANTITY => self::$quantity\n ]);\n }", "function autorelist($auction = array()) {\n\t$productSql = mysql_query(\"SELECT id FROM auctions WHERE deleted = 0 AND closed = 0 AND active = 1 AND product_id = \".$auction['product_id']);\n\tif(mysql_num_rows($productSql) == 0) {\n\t\t// check for a delayed start time\n\t\t$delayed_start = get('autolist_delay_time');\n\n\t\tif(!empty($delayed_start)) {\n\t\t\t$auction['start_time'] = date('Y-m-d H:i:s', time() + $delayed_start * 60);\n\t\t\t$auction['end_time'] = date('Y-m-d H:i:s', time() + (get('autolist_expire_time') + $delayed_start) * 60);\n\t\t} else {\n\t\t\t$auction['start_time'] = date('Y-m-d H:i:s');\n\t\t\t$auction['end_time'] = date('Y-m-d H:i:s', time() + get('autolist_expire_time') * 60);\n\t\t}\n\n\t\tif($auction['max_end_time'] < $auction['end_time']) {\n\t\t\t$auction['max_end_time'] = $auction['end_time'];\n\t\t}\n\n\t\t$product = mysql_fetch_array(mysql_query(\"SELECT start_price, minimum_price FROM products WHERE id = \".$auction['product_id']), MYSQL_ASSOC);\n\n\t\t$auction['price'] \t\t\t= $product['start_price'];\n\t\t$auction['minimum_price'] \t= $product['minimum_price'];\n\n\t\tmysql_query(\"INSERT INTO auctions (product_id, start_time, end_time, max_end, max_end_time, price, autolist, featured, peak_only, nail_bitter, penny, hidden_reserve, minimum_price, active, bid_debit, created, modified) VALUES ('\".$auction['product_id'].\"', '\".$auction['start_time'].\"', '\".$auction['end_time'].\"', '\".$auction['max_end'].\"', '\".$auction['max_end_time'].\"', '\".$auction['price'].\"', '\".$auction['autolist'].\"', '\".$auction['featured'].\"', '\".$auction['peak_only'].\"', '\".$auction['nail_bitter'].\"', '\".$auction['penny'].\"', '\".$auction['hidden_reserve'].\"', '\".$auction['minimum_price'].\"', '\".$auction['active'].\"', '\".$auction['bid_debit'].\"', '\".date('Y-m-d H:i:s').\"', '\".date('Y-m-d H:i:s').\"')\");\n\t}\n}", "public function testProductGetPrices()\n {\n $product = $this->find('product', 1);\n $prices = $product->getPrices();\n $price = $prices[0];\n \n $currencies = $this->findAll('currency');\n $dollarCurrency = $currencies[0];\n \n $money = Money::create(10, $dollarCurrency); \n \n $this->assertEquals(\n $money,\n $price\n );\n }", "function _do_price_mail()\n\t{\n\t\t$i=0;\n\t\twhile (array_key_exists('pop3_'.strval($i),$_POST))\n\t\t{\n\t\t\t$price=post_param_integer('pop3_'.strval($i));\n\t\t\t$name='pop3_'.post_param('dpop3_'.strval($i));\n\t\t\t$name2='pop3_'.post_param('ndpop3_'.strval($i));\n\t\t\tif (post_param_integer('delete_pop3_'.strval($i),0)==1)\n\t\t\t{\n\t\t\t\t$GLOBALS['SITE_DB']->query_delete('prices',array('name'=>$name),'',1);\n\t\t\t} else\n\t\t\t{\n\t\t\t\t$GLOBALS['SITE_DB']->query_update('prices',array('price'=>$price,'name'=>$name2),array('name'=>$name),'',1);\n\t\t\t}\n\n\t\t\t$i++;\n\t\t}\n\t}", "public static function addFinalPriceForProductObject($data)\n {\n $taxClassArray = self::getTax();\n foreach ($data as $row) {\n $priceRs = self::getPriceToCalculateTax($row);\n $row->final_price = self::finalPrice($priceRs['price'], $row->tax_class_id, $taxClassArray);\n $row->display_price_promotion = $priceRs['display_price_promotion'];\n }\n return $data;\n }", "public function bulkproducts() {\n\n $this->checkPlugin();\n\n if ( $_SERVER['REQUEST_METHOD'] === 'POST' ){\n //insert products\n $requestjson = file_get_contents('php://input');\n\n $requestjson = json_decode($requestjson, true);\n\n if (!empty($requestjson) && count($requestjson) > 0) {\n\n $this->addProducts($requestjson);\n }else {\n $this->response->setOutput(json_encode(array('success' => false)));\n }\n\n }else if ( $_SERVER['REQUEST_METHOD'] === 'PUT' ){\n //update products\n $requestjson = file_get_contents('php://input');\n $requestjson = json_decode($requestjson, true);\n\n if (!empty($requestjson) && count($requestjson) > 0) {\n $this->updateProducts($requestjson);\n }else {\n $this->response->setOutput(json_encode(array('success' => false)));\n }\n\n }\n }", "public function addProducts(array $products);", "public function getPriceAll()\n { \n $collection = $this->PostCollectionFactory->create();\n /*$a = $collection->getPrice();*/\n foreach ($collection as $key => $value) {\n $value->getPrice();\n }\n return $value->getPrice();\n }", "public function createAction()\n {\n $entity = new Pricelist();\n $request = $this->getRequest();\n $form = $this->createForm(new PricelistType(), $entity);\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('Price_show', array('id' => $entity->getId())));\n \n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView()\n );\n }", "public function setOptions_values_price( $options_values_price ) {\n\t\t$this->options_values_price = $options_values_price;\n\t}", "public function actionManagePrice()\n {\n $model = Price::model()->findAll();\n\n $this->render('managePrice', array('model' => $model, ));\n }", "public function makePrice(array & $rows)\n {\n if (empty($rows)) {\n return;\n }\n\n $articles = array_column($rows, 'article');\n\n $articles = array_map(function ($item) {\n settype($item, 'string');\n\n return preg_replace('/[^\\w+]/is', '', $item);\n }, $articles);\n\n $model = MongoModel::factory('Prices');\n $model->selectDB();\n\n $articles = array_unique($articles);\n array_reverse($articles, 1);\n $articles = array_reverse($articles);\n\n $priceRows = $model\n ->where('clear_article', 'in', $articles)\n ->find_all();\n\n if (empty($priceRows)) {\n foreach ($rows as $key => & $item) {\n $item['qty'] = 0;\n $item['price'] = 0;\n }\n\n return $rows;\n }\n\n $priceRows = array_combine(array_column($priceRows, 'clear_article'), $priceRows);\n\n foreach ($rows as $key => & $item) {\n $item['qty'] = (isset($priceRows[$item['clear_article']]['qty']) ? $priceRows[$item['clear_article']]['qty'] : 0);\n $item['price'] = (isset($priceRows[$item['clear_article']]['price']) ? $priceRows[$item['clear_article']]['price'] : 0);\n }\n\n return $rows;\n\n }", "public function getById(int $idPriceList): ?PriceListTransfer;", "public function getPriceList()\n {\n try {\n $apiClient = $this->getApiClientPricing();\n $priceList = $apiClient->get(\n array(\"parcel\" => array('dimensions' => $this->getParcelDimensions()))\n );\n\n return json_decode($priceList);\n } catch (\\Exception $e) {\n Logger::debug($e->getMessage());\n return array();\n }\n }", "public function gETMarketIdPriceListRequest($market_id)\n {\n // verify the required parameter 'market_id' is set\n if ($market_id === null || (is_array($market_id) && count($market_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $market_id when calling gETMarketIdPriceList'\n );\n }\n\n $resourcePath = '/markets/{marketId}/price_list';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($market_id !== null) {\n $resourcePath = str_replace(\n '{' . 'marketId' . '}',\n ObjectSerializer::toPathValue($market_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getItemsPrice()\n {\n return [10,20,54];\n }", "protected function updateQuoteProducts($quote, $products)\n {\n foreach ($products['cart'] as $id => $product) {\n $product['quote_id'] = $quote->id;\n $product['product_id'] = $id;\n\n ProductQuote::create($product);\n }\n }", "public function testPrices()\n {\n $product_id = 7;\n $variation = PRICE_VARIATION_MIDLANDS;\n $price = 68.21;\n $this->assertDatabaseHas('product_prices', [\n 'price' => $price,\n 'product_id' => $product_id,\n 'variation' => $variation\n ]);\n\n $product_id = 10;\n $variation = PRICE_VARIATION_MIDLANDS;\n $price = 68.21;\n $this->assertDatabaseMissing('product_prices', [\n 'price' => $price,\n 'product_id' => $product_id,\n 'variation' => $variation\n ]);\n\n }" ]
[ "0.8055158", "0.7791744", "0.75901276", "0.6740554", "0.6615686", "0.65738237", "0.59323585", "0.59132767", "0.5906179", "0.5710619", "0.56863517", "0.56150806", "0.5550583", "0.54916686", "0.5474283", "0.5438785", "0.54045933", "0.5398685", "0.5302523", "0.5298761", "0.5219344", "0.5205988", "0.5204178", "0.5191773", "0.5179187", "0.51746595", "0.5171184", "0.5169964", "0.5135243", "0.511783", "0.5116487", "0.51037663", "0.50844604", "0.5080082", "0.50796425", "0.50581616", "0.50452715", "0.5030583", "0.50249636", "0.49868467", "0.49816644", "0.49486285", "0.4947778", "0.4944418", "0.49254194", "0.4921444", "0.49189815", "0.49065235", "0.48939803", "0.4885227", "0.4864272", "0.4851507", "0.48473048", "0.48466808", "0.48418352", "0.48345825", "0.4832656", "0.48133266", "0.4812302", "0.47919843", "0.4785426", "0.47853225", "0.4779232", "0.47769496", "0.4767044", "0.4757873", "0.47522214", "0.4747308", "0.4725159", "0.47174814", "0.47134358", "0.4713376", "0.4708151", "0.4702678", "0.46997917", "0.46941656", "0.4691161", "0.46876103", "0.46863505", "0.46861577", "0.46855012", "0.4678575", "0.46575433", "0.46519828", "0.4648513", "0.46437985", "0.4641814", "0.46417993", "0.46371558", "0.46290326", "0.4628849", "0.46286327", "0.46285552", "0.46266526", "0.46254554", "0.46247098", "0.4618915", "0.4603832", "0.45951346", "0.45950717" ]
0.82506853
0
Specification: Publish price list prices for product abstracts. Uses the given fkPriceList of the `fos_price_product_price_list` table. Merges created or updated prices to the existing ones.
public function publishAbstractPriceProductPriceListByIdPriceList(int $idPriceList): void;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function publishAbstractPriceProductPriceList(array $priceProductPriceListIds): void;", "public function publishConcretePriceProductPriceList(array $priceProductPriceListIds): void;", "public function publishConcretePriceProductPriceListByIdPriceList(int $idPriceList): void;", "public function updatePrices($contractId, $priceList);", "public function setListPrice(float $listPrice)\n\t{\n\t\t$this->addKeyValue('list_price', $listPrice); \n\n\t}", "public function publishAbstractPriceProductByByProductAbstractIds(array $productAbstractIds): void;", "protected function putProductsVariantsPricelistPriceRequest($body, $product_id, $variant_id, $pricelist_id)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling putProductsVariantsPricelistPrice'\n );\n }\n // verify the required parameter 'product_id' is set\n if ($product_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $product_id when calling putProductsVariantsPricelistPrice'\n );\n }\n if ($product_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$product_id\" when calling DefaultApi.putProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'variant_id' is set\n if ($variant_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $variant_id when calling putProductsVariantsPricelistPrice'\n );\n }\n if ($variant_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$variant_id\" when calling DefaultApi.putProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'pricelist_id' is set\n if ($pricelist_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pricelist_id when calling putProductsVariantsPricelistPrice'\n );\n }\n if ($pricelist_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$pricelist_id\" when calling DefaultApi.putProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n $resourcePath = '/products/{productId}/variants/{variantId}/prices/{pricelistId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($product_id !== null) {\n $resourcePath = str_replace(\n '{' . 'productId' . '}',\n ObjectSerializer::toPathValue($product_id),\n $resourcePath\n );\n }\n // path params\n if ($variant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'variantId' . '}',\n ObjectSerializer::toPathValue($variant_id),\n $resourcePath\n );\n }\n // path params\n if ($pricelist_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pricelistId' . '}',\n ObjectSerializer::toPathValue($pricelist_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n \n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function patchProductsVariantsPricelistPriceRequest($body, $product_id, $variant_id, $pricelist_id)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling patchProductsVariantsPricelistPrice'\n );\n }\n // verify the required parameter 'product_id' is set\n if ($product_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $product_id when calling patchProductsVariantsPricelistPrice'\n );\n }\n if ($product_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$product_id\" when calling DefaultApi.patchProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'variant_id' is set\n if ($variant_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $variant_id when calling patchProductsVariantsPricelistPrice'\n );\n }\n if ($variant_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$variant_id\" when calling DefaultApi.patchProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'pricelist_id' is set\n if ($pricelist_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pricelist_id when calling patchProductsVariantsPricelistPrice'\n );\n }\n if ($pricelist_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$pricelist_id\" when calling DefaultApi.patchProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n $resourcePath = '/products/{productId}/variants/{variantId}/prices/{pricelistId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($product_id !== null) {\n $resourcePath = str_replace(\n '{' . 'productId' . '}',\n ObjectSerializer::toPathValue($product_id),\n $resourcePath\n );\n }\n // path params\n if ($variant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'variantId' . '}',\n ObjectSerializer::toPathValue($variant_id),\n $resourcePath\n );\n }\n // path params\n if ($pricelist_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pricelistId' . '}',\n ObjectSerializer::toPathValue($pricelist_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n \n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PATCH',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getPriceByListWithEcotax( PriceList $list = null )\n {\n // Return Price Object\n $price = $this->getPriceByList( $list );\n\n // Add Ecotax\n if ( Configuration::isTrue('ENABLE_ECOTAXES') && $this->ecotax )\n {\n // Template: $price = [ price, price_tax_inc, price_is_tax_inc ]\n// $ecoprice = Price::create([\n// $this->getEcotax(), \n// $this->getEcotax()*(1.0+$price->tax_percent/100.0), \n// $price->price_tax_inc\n// ]);\n\n $price->add( $this->getEcotax() ); \n }\n\n return $price;\n }", "public function publishConcretePriceProductByProductIds(array $productIds): void;", "public function updateprices()\n {\n\n $aParams = oxRegistry::getConfig()->getRequestParameter(\"updateval\");\n if (is_array($aParams)) {\n foreach ($aParams as $soxId => $aStockParams) {\n $this->addprice($soxId, $aStockParams);\n }\n }\n }", "public function api_update_price(){\n $watchlists = $this->wr->all();\n foreach($watchlists as $watchlist)\n {\n $current_price = $this->get_quotes($watchlist->id);\n\n $this->wr->update([\n 'current_price' => $current_price,\n ],$watchlist->id);\n }\n }", "protected function deleteProductsVariantsPricelistPriceRequest($product_id, $variant_id, $pricelist_id)\n {\n // verify the required parameter 'product_id' is set\n if ($product_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $product_id when calling deleteProductsVariantsPricelistPrice'\n );\n }\n if ($product_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$product_id\" when calling DefaultApi.deleteProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'variant_id' is set\n if ($variant_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $variant_id when calling deleteProductsVariantsPricelistPrice'\n );\n }\n if ($variant_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$variant_id\" when calling DefaultApi.deleteProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'pricelist_id' is set\n if ($pricelist_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pricelist_id when calling deleteProductsVariantsPricelistPrice'\n );\n }\n if ($pricelist_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$pricelist_id\" when calling DefaultApi.deleteProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n $resourcePath = '/products/{productId}/variants/{variantId}/prices/{pricelistId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($product_id !== null) {\n $resourcePath = str_replace(\n '{' . 'productId' . '}',\n ObjectSerializer::toPathValue($product_id),\n $resourcePath\n );\n }\n // path params\n if ($variant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'variantId' . '}',\n ObjectSerializer::toPathValue($variant_id),\n $resourcePath\n );\n }\n // path params\n if ($pricelist_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pricelistId' . '}',\n ObjectSerializer::toPathValue($pricelist_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n \n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function getProductsVariantsPricelistPriceRequest($product_id, $variant_id, $pricelist_id)\n {\n // verify the required parameter 'product_id' is set\n if ($product_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $product_id when calling getProductsVariantsPricelistPrice'\n );\n }\n if ($product_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$product_id\" when calling DefaultApi.getProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'variant_id' is set\n if ($variant_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $variant_id when calling getProductsVariantsPricelistPrice'\n );\n }\n if ($variant_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$variant_id\" when calling DefaultApi.getProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'pricelist_id' is set\n if ($pricelist_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pricelist_id when calling getProductsVariantsPricelistPrice'\n );\n }\n if ($pricelist_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$pricelist_id\" when calling DefaultApi.getProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n $resourcePath = '/products/{productId}/variants/{variantId}/prices/{pricelistId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($product_id !== null) {\n $resourcePath = str_replace(\n '{' . 'productId' . '}',\n ObjectSerializer::toPathValue($product_id),\n $resourcePath\n );\n }\n // path params\n if ($variant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'variantId' . '}',\n ObjectSerializer::toPathValue($variant_id),\n $resourcePath\n );\n }\n // path params\n if ($pricelist_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pricelistId' . '}',\n ObjectSerializer::toPathValue($pricelist_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n \n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function processOperations(\\Magento\\AsynchronousOperations\\Api\\Data\\OperationListInterface $operationList)\n {\n $pricesUpdateDto = [];\n $pricesDeleteDto = [];\n $operationSkus = [];\n foreach ($operationList->getItems() as $index => $operation) {\n $serializedData = $operation->getSerializedData();\n $unserializedData = $this->serializer->unserialize($serializedData);\n $operationSkus[$index] = $unserializedData['product_sku'];\n $pricesUpdateDto = array_merge(\n $pricesUpdateDto,\n $this->priceProcessor->createPricesUpdate($unserializedData)\n );\n $pricesDeleteDto = array_merge(\n $pricesDeleteDto,\n $this->priceProcessor->createPricesDelete($unserializedData)\n );\n }\n\n $failedDeleteItems = [];\n $failedUpdateItems = [];\n $uncompletedOperations = [];\n try {\n $failedDeleteItems = $this->tierPriceStorage->delete($pricesDeleteDto);\n $failedUpdateItems = $this->tierPriceStorage->update($pricesUpdateDto);\n } catch (\\Magento\\Framework\\Exception\\CouldNotSaveException $e) {\n $uncompletedOperations['status'] = OperationInterface::STATUS_TYPE_RETRIABLY_FAILED;\n $uncompletedOperations['error_code'] = $e->getCode();\n $uncompletedOperations['message'] = $e->getMessage();\n } catch (\\Magento\\Framework\\Exception\\CouldNotDeleteException $e) {\n $uncompletedOperations['status'] = OperationInterface::STATUS_TYPE_RETRIABLY_FAILED;\n $uncompletedOperations['error_code'] = $e->getCode();\n $uncompletedOperations['message'] = $e->getMessage();\n } catch (\\Exception $e) {\n $uncompletedOperations['status'] = OperationInterface::STATUS_TYPE_RETRIABLY_FAILED;\n $uncompletedOperations['error_code'] = $e->getCode();\n $uncompletedOperations['message'] =\n __('Sorry, something went wrong during product prices update. Please see log for details.');\n }\n\n $failedItems = array_merge($failedDeleteItems, $failedUpdateItems);\n $failedOperations = [];\n foreach ($failedItems as $failedItem) {\n if (isset($failedItem->getParameters()['SKU'])) {\n $failedOperations[$failedItem->getParameters()['SKU']] = $this->priceProcessor->prepareErrorMessage(\n $failedItem\n );\n }\n }\n\n try {\n $this->changeOperationStatus($operationList, $failedOperations, $uncompletedOperations, $operationSkus);\n } catch (\\Exception $exception) {\n // prevent consumer from failing, silently log exception\n $this->logger->critical($exception->getMessage());\n }\n }", "public function execute(ProductListTransfer $productListTransfer): void;", "public function saved(Price $price)\n {\n PriceItem::where('price_id', $price->id)->delete();\n\n $productId = request()->input('product_id');\n\n foreach (request()->input('prices', []) as $priceInput) {\n $priceCategoryAttributes = [\n 'product_id' => $productId,\n ];\n\n foreach (config('app.locales') as $lang => $locale) {\n $priceCategoryAttributes[\"title_{$lang}\"] = $priceInput['category'][$lang];\n }\n\n $priceCategory = PriceCategory::firstOrCreate($priceCategoryAttributes);\n\n $priceItemAttributes = [\n 'price_id' => $price->id,\n 'price_category_id' => $priceCategory->id,\n ];\n foreach ($priceInput['items'] as $item) {\n $priceItemAttributes['price'] = $item['price'];\n $priceItemAttributes['date_start'] = $item['date_start'];\n $priceItemAttributes['date_end'] = $item['date_end'];\n\n foreach (config('app.locales') as $lang => $locale) {\n $priceItemAttributes[\"title_{$lang}\"] = $item['title'][$lang];\n }\n }\n\n PriceItem::create($priceItemAttributes);\n }\n }", "public function addShippingPrice($productID, $shippingPriceList){\n\n global $db;\n\n if(!is_numeric($productID) || !is_array($shippingPriceList) || count($shippingPriceList) < 1){\n return;\n }\n\n foreach($shippingPriceList as $shippingPrice){\n $param = ['productID' => $productID, 'locationID' => $shippingPrice['locationID'], 'price' => fn_buckys_get_btc_price_formated($shippingPrice['price']),];\n\n $db->insertFromArray(TABLE_SHOP_SHIPPING_PRICE, $param);\n\n }\n\n }", "public function setProductList($obProductList)\n {\n $this->obProductList = $obProductList;\n }", "public function __construct(PriceList $price_list = null)\n {\n $this->price_list = $price_list;\n }", "function addListPrice($request) {\n\t\t$sourceModule = $request->getModule();\n\t\t$sourceRecordId = $request->get('src_record');\n\t\t$relatedModule = $request->get('related_module');\n\t\t$relInfos = $request->get('relinfo');\n\n\t\t$sourceModuleModel = Vtiger_Module_Model::getInstance($sourceModule);\n\t\t$relatedModuleModel = Vtiger_Module_Model::getInstance($relatedModule);\n\t\t$relationModel = Vtiger_Relation_Model::getInstance($sourceModuleModel, $relatedModuleModel);\n\t\tforeach($relInfos as $relInfo) {\n\t\t\t$price = CurrencyField::convertToDBFormat($relInfo['price'], null, true);\n\t\t\t$relationModel->addListPrice($sourceRecordId, $relInfo['id'], $price);\n\t\t}\n\t}", "public function gETPriceIdPriceListRequest($price_id)\n {\n // verify the required parameter 'price_id' is set\n if ($price_id === null || (is_array($price_id) && count($price_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $price_id when calling gETPriceIdPriceList'\n );\n }\n\n $resourcePath = '/prices/{priceId}/price_list';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($price_id !== null) {\n $resourcePath = str_replace(\n '{' . 'priceId' . '}',\n ObjectSerializer::toPathValue($price_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function editPrices() {\n\t\tglobal $HTML;\n\t\tglobal $page;\n\t\tglobal $id;\n\t\t$HTML->details(1);\n\n\t\t$this->getPrices();\n\n\t\t$price_groups = $this->priceGroupClass->getItems();\n\t\t$countries = $this->countryClass->getItems();\n\n\t\t$_ = '';\n\t\t$_ .= '<div class=\"c init:form form:action:'.$page->url.'\" id=\"container:prices\">';\n\t\t$_ .= '<div class=\"c\">';\n\n\t\t$_ .= $HTML->inputHidden(\"id\", $id);\n\t\t$_ .= $HTML->inputHidden(\"item_id\", $id);\n\n\t\t$_ .= $HTML->head(\"Prices\", \"2\");\n\n\t\tif(Session::getLogin()->validatePage(\"prices_update\")) {\n\t\t\t$_ .= $HTML->inputHidden(\"page_status\", \"prices_update\");\n\t\t}\n\n\t\tif($this->item() && count($this->item[\"id\"]) == 1) {\n\n\t\t\tforeach($countries[\"id\"] as $country_key => $country_id) {\n\n\t\t\t\t$_ .= '<div class=\"ci33\">';\n\n\t\t\t\t\t$_ .= $HTML->head($countries[\"values\"][$country_key], 3);\n\n\t\t\t\t\tforeach($price_groups[\"uid\"] as $index => $price_group_uid) {\n\t\t\t\t\t\t$price = ($this->item[\"price\"][0] && isset($this->item[\"price\"][0][$country_id][$price_group_uid])) ? $this->item[\"price\"][0][$country_id][$price_group_uid] : \"\";\n\t\t\t\t\t\t$_ .= $HTML->input($price_groups[\"values\"][$index], \"prices[$country_id][$price_group_uid]\", $price);\n\t\t\t\t\t}\n\n\t\t\t\t\t$_ .= $HTML->separator();\n\t\t\t\t$_ .= '</div>';\n\n\t\t\t}\n\t\t}\n\n\t\t$_ .= '</div>';\n\n\t\t$_ .= $HTML->smartButton($this->translate(\"Cancel\"), false, \"prices_cancel\", \"fleft key:esc\");\n\t\t$_ .= $HTML->smartButton($this->translate(\"Save\"), false, \"prices_update\", \"fright key:s\");\n\n\t\t$_ .= '</div>';\n\n\t\treturn $_;\n\t}", "public function getOnSaleProducts_List (array $listOptions = array()) {\n // global $app;\n // $options['sort'] = 'shop_products.DateUpdated';\n // $options['order'] = 'DESC';\n // $options['_fshop_products.Status'] = join(',', dbquery::getProductStatusesWhenAvailable()) . ':IN';\n // $options['_fshop_products.Price'] = 'PrevPrice:>';\n // $options['_fshop_products.Status'] = 'DISCOUNT';\n // $config = dbquery::shopGetProductList_NewItems($options);\n // if (empty($config))\n // return null;\n // $self = $this;\n // $callbacks = array(\n // \"parse\" => function ($items) use($self) {\n // $_items = array();\n // foreach ($items as $key => $orderRawItem) {\n // $_items[] = $self->getProductByID($orderRawItem['ID']);\n // }\n // return $_items;\n // }\n // );\n // $dataList = $app->getDB()->getDataList($config, $options, $callbacks);\n // return $dataList;\n\n\n $self = $this;\n $params = array();\n $params['list'] = $listOptions;\n $params['callbacks'] = array(\n 'parse' => function ($dbRawItem) use ($self) {\n return $self->getProductByID($dbRawItem['ID']);\n }\n );\n\n return dbquery::fetchOnSaleProducts_List($params);\n }", "public function priceLists()\n {\n return $this->hasOne('App\\Models\\PriceList');\n }", "public function edit(PriceListRequest $request, PriceList $price_list)\n {\n return $this->response->title(trans('app.edit') . ' ' . trans('pricelist::price_list.name'))\n ->view('pricelist::price_list.edit', true)\n ->data(compact('price_list'))\n ->output();\n }", "public function test_comicEntityIsCreated_prices_setPrices()\n {\n $sut = $this->getSUT();\n $prices = $sut->getPrices();\n $expected = [\n Price::create(\n 'printPrice',\n 19.99\n ),\n ];\n\n $this->assertEquals($expected, $prices);\n }", "function updateRetailerProductList($con, $ProductIdList, $TypeList, $QuantityList, $PriceList){\n $result = true;\n\n // iterate through each card and process individually\n foreach($ProductIdList as $key => $ProductId){\n\n if(doesSellsExist($con, $ProductId, $TypeList[$key])){\n\n // if card exists, update\n $result = updateSells($con, $ProductId, $TypeList[$key], $QuantityList[$key], $PriceList[$key]);\n\n } else if(doesSellsExist($con, abs($ProductId), $TypeList[$key])){\n // if card id is negative it has been marked for deletion\n $result = deleteSells($con, abs($ProductId), $TypeList[$key]);\n\n }\n\n if(!$result) return $result;\n }\n\n return $result;\n}", "public function setPriceAttribute($value)\n {\n if ( ! is_array($value)) {\n return;\n }\n foreach ($value as $currency => $price) {\n ProductPrice::updateOrCreate([\n 'product_id' => $this->id,\n 'currency_id' => Currency::where('code', $currency)->firstOrFail()->id,\n ], [\n 'price' => $price,\n ]);\n }\n }", "public function prices()\n {\n return $this->morphToMany(Price::class, 'price_able');\n }", "public function wc_epo_product_price_rules( $price = array(), $product ) {\n\t\tif ( $this->is_elex_dpd_enabled() ) {\n\t\t\t$check_price = apply_filters( 'wc_epo_discounted_price', NULL, $product, NULL );\n\t\t\tif ( $check_price ) {\n\t\t\t\t$price['product'] = array();\n\t\t\t\tif ( $check_price['is_multiprice'] ) {\n\t\t\t\t\tforeach ( $check_price['rules'] as $variation_id => $variation_rule ) {\n\t\t\t\t\t\tforeach ( $variation_rule as $rulekey => $pricerule ) {\n\t\t\t\t\t\t\t$price['product'][ $variation_id ][] = array(\n\t\t\t\t\t\t\t\t\"min\" => $pricerule[\"min\"],\n\t\t\t\t\t\t\t\t\"max\" => $pricerule[\"max\"],\n\t\t\t\t\t\t\t\t\"value\" => ( $pricerule[\"type\"] != \"percentage\" ) ? apply_filters( 'wc_epo_product_price', $pricerule[\"value\"], \"\", FALSE ) : $pricerule[\"value\"],\n\t\t\t\t\t\t\t\t\"type\" => $pricerule[\"type\"],\n\t\t\t\t\t\t\t\t'conditions' => isset( $pricerule[\"conditions\"] ) ? $pricerule[\"conditions\"] : array(),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tforeach ( $check_price['rules'] as $rulekey => $pricerule ) {\n\t\t\t\t\t\t$price['product'][0][] = array(\n\t\t\t\t\t\t\t\"min\" => $pricerule[\"min\"],\n\t\t\t\t\t\t\t\"max\" => $pricerule[\"max\"],\n\t\t\t\t\t\t\t\"value\" => ( $pricerule[\"type\"] != \"percentage\" ) ? apply_filters( 'wc_epo_product_price', $pricerule[\"value\"], \"\", FALSE ) : $pricerule[\"value\"],\n\t\t\t\t\t\t\t\"type\" => $pricerule[\"type\"],\n\t\t\t\t\t\t\t'conditions' => isset( $pricerule[\"conditions\"] ) ? $pricerule[\"conditions\"] : array(),\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$price['price'] = apply_filters( 'woocommerce_tm_epo_price_compatibility', apply_filters( 'wc_epo_product_price', $product->get_price(), \"\", FALSE ), $product );\n\t\t}\n\n\t\treturn $price;\n\t}", "function SetBidList(&$list)\n\t{\n\t\t$this->_bidList = array();\n\t\t$existingBidList = $this->GetBidList();\n\t\tforeach ($existingBidList as $bid)\n\t\t{\n\t\t\t$bid->supplierId = '';\n\t\t\t$bid->Save(false);\n\t\t}\n\t\t$this->_bidList = $list;\n\t}", "public function savePrice(FipeVehiclePrice $price){\n $em = $this->getEntityManager();\n $em->persist($price);\n $em->flush();\n }", "public function calculatePrices(): void\n {\n $orders = ServiceContainer::orders();\n $pizzaPrice = $orders->calculatePizzaPrice($this->items);\n $deliveryPrice = $orders->calculateDeliveryPrice($pizzaPrice, $this->outside, $this->currency);\n $this->delivery_price = $deliveryPrice;\n $this->total_price = $pizzaPrice + $deliveryPrice;\n }", "protected function convertPriceList() {\n\t\t$retArray =array();\n\t\t\n\t\tforeach ($this->DetailPriceList as $name => $nameValue) {\n\t\t\t$description = '';\n\t\t\t$unit = '';\n\t\t\t$price = 0;\n\t\t\t$avgPrice = 0;\n\t\t\tif (is_array($nameValue)) {\n\t\t\t\tforeach ($nameValue as $desc => $prices) {\n\t\t\t\t\tif (is_array($prices)) {\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$price = $nameValue;\n\t\t\t\t$avgPrice = $price;\n\t\t\t}\n\t\t\t$retArray[] = array($name,$description, $unit,$price, $avgPrice );\n\t\t}\n\t}", "function _prepareGroupedProductPriceData($entityIds = null) {\n\t\t\t$write = $this->_getWriteAdapter( );\n\t\t\t$table = $this->getIdxTable( );\n\t\t\t$select = $write->select( )->from( array( 'e' => $this->getTable( 'catalog/product' ) ), 'entity_id' )->joinLeft( array( 'l' => $this->getTable( 'catalog/product_link' ) ), 'e.entity_id = l.product_id AND l.link_type_id=' . LINK_TYPE_GROUPED, array( ) )->join( array( 'cg' => $this->getTable( 'customer/customer_group' ) ), '', array( 'customer_group_id' ) );\n\t\t\t$this->_addWebsiteJoinToSelect( $select, true );\n\t\t\t$this->_addProductWebsiteJoinToSelect( $select, 'cw.website_id', 'e.entity_id' );\n\n\t\t\tif ($this->getVersionHelper( )->isGe1600( )) {\n\t\t\t\t$minCheckSql = $write->getCheckSql( 'le.required_options = 0', 'i.min_price', 0 );\n\t\t\t\t$maxCheckSql = $write->getCheckSql( 'le.required_options = 0', 'i.max_price', 0 );\n\t\t\t\t$taxClassId = $this->_getReadAdapter( )->getCheckSql( 'MIN(i.tax_class_id) IS NULL', '0', 'MIN(i.tax_class_id)' );\n\t\t\t\t$minPrice = new Zend_Db_Expr( 'MIN(' . $minCheckSql . ')' );\n\t\t\t\t$maxPrice = new Zend_Db_Expr( 'MAX(' . $maxCheckSql . ')' );\n\t\t\t} \nelse {\n\t\t\t\t$taxClassId = new Zend_Db_Expr( 'IFNULL(i.tax_class_id, 0)' );\n\t\t\t\t$minPrice = new Zend_Db_Expr( 'MIN(IF(le.required_options = 0, i.min_price, 0))' );\n\t\t\t\t$maxPrice = new Zend_Db_Expr( 'MAX(IF(le.required_options = 0, i.max_price, 0))' );\n\t\t\t}\n\n\t\t\t$stockId = 'IF (i.stock_id IS NOT NULL, i.stock_id, 1)';\n\t\t\t$select->columns( 'website_id', 'cw' )->joinLeft( array( 'le' => $this->getTable( 'catalog/product' ) ), 'le.entity_id = l.linked_product_id', array( ) );\n\n\t\t\tif ($this->getVersionHelper( )->isGe1700( )) {\n\t\t\t\t$columns = array( 'tax_class_id' => $taxClassId, 'price' => new Zend_Db_Expr( 'NULL' ), 'final_price' => new Zend_Db_Expr( 'NULL' ), 'min_price' => $minPrice, 'max_price' => $maxPrice, 'tier_price' => new Zend_Db_Expr( 'NULL' ), 'group_price' => new Zend_Db_Expr( 'NULL' ), 'stock_id' => $stockId, 'currency' => 'i.currency', 'store_id' => 'i.store_id' );\n\t\t\t} \nelse {\n\t\t\t\t$columns = array( 'tax_class_id' => $taxClassId, 'price' => new Zend_Db_Expr( 'NULL' ), 'final_price' => new Zend_Db_Expr( 'NULL' ), 'min_price' => $minPrice, 'max_price' => $maxPrice, 'tier_price' => new Zend_Db_Expr( 'NULL' ), 'stock_id' => $stockId, 'currency' => 'i.currency', 'store_id' => 'i.store_id' );\n\t\t\t}\n\n\t\t\t$select->joinLeft( array( 'i' => $table ), '(i.entity_id = l.linked_product_id) AND (i.website_id = cw.website_id) AND ' . '(i.customer_group_id = cg.customer_group_id)', $columns );\n\t\t\t$select->group( array( 'e.entity_id', 'cg.customer_group_id', 'cw.website_id', $stockId, 'i.currency', 'i.store_id' ) )->where( 'e.type_id=?', $this->getTypeId( ) );\n\n\t\t\tif (!is_null( $entityIds )) {\n\t\t\t\t$select->where( 'l.product_id IN(?)', $entityIds );\n\t\t\t}\n\n\t\t\t$eventData = array( 'select' => $select, 'entity_field' => new Zend_Db_Expr( 'e.entity_id' ), 'website_field' => new Zend_Db_Expr( 'cw.website_id' ), 'stock_field' => new Zend_Db_Expr( $stockId ), 'currency_field' => new Zend_Db_Expr( 'i.currency' ), 'store_field' => new Zend_Db_Expr( 'cs.store_id' ) );\n\n\t\t\tif (!$this->getWarehouseHelper( )->getConfig( )->isMultipleMode( )) {\n\t\t\t\t$eventData['stock_field'] = new Zend_Db_Expr( 'i.stock_id' );\n\t\t\t}\n\n\t\t\tMage::dispatchEvent( 'catalog_product_prepare_index_select', $eventData );\n\t\t\t$query = $select->insertFromSelect( $table );\n\t\t\t$write->query( $query );\n\t\t\treturn $this;\n\t\t}", "public function getById(int $idPriceList): ?PriceListTransfer;", "public static function updateFlashSaleTime($listUpdate){\n $tmp = $listUpdate;\n $p = new Products();\n foreach ($p as $item => $tmp){\n\n }\n }", "protected function handleSaveFieldsConfig(\n Laposta_Connect_Model_List $list\n ) {\n $fieldsMap = $this->resolveFieldsMap();\n $added = array();\n $updated = array();\n $removed = array();\n $skipped = array();\n /** @var $fields Laposta_Connect_Model_Mysql4_Field_Collection */\n $fields = Mage::getModel('lapostaconnect/field')->getCollection();\n\n $fields->addFilter('list_id', $list->getListId());\n\n /** @var $field Laposta_Connect_Model_Field */\n foreach ($fields as $key => $field) {\n $fieldName = $field->getFieldName();\n\n if (!isset($fieldsMap[$fieldName])) {\n $removed[$fieldName] = $field;\n $fields->removeItemByKey($key);\n $field->delete();\n\n continue;\n }\n\n $field->setFieldRelation($fieldsMap[$fieldName]);\n $field->setUpdatedTime($fields->formatDate(time()));\n $updated[$fieldName] = $field;\n }\n\n $fieldsMap = array_diff_key($fieldsMap, $updated, $removed, $skipped);\n\n /**\n * Add the remaining entries in fieldsMap\n */\n foreach ($fieldsMap as $fieldName => $fieldRelation) {\n $field = $fields->getNewEmptyItem();\n $field->setListId($list->getListId());\n $field->setFieldName($fieldName);\n $field->setFieldRelation($fieldRelation);\n $field->setUpdatedTime($fields->formatDate(time()));\n\n $fields->addItem($field);\n $added[$fieldName] = $field;\n }\n\n try {\n /** @var $syncHelper Laposta_Connect_Helper_Sync */\n $syncHelper = Mage::helper('lapostaconnect/sync');\n $syncHelper->syncFields($list, $fields);\n }\n catch (Exception $e) {\n Mage::helper('lapostaconnect')->log($e);\n }\n\n $fields->save();\n }", "public function getListPrice()\n\t{\n\t\treturn $this->getKeyValue('list_price'); \n\n\t}", "protected function _saveProductTierPrices(array $tierPriceData)\n {\n static $tableName = null;\n\n if (!$tableName) {\n $tableName = $this->_resourceFactory->create()->getTable('catalog_product_entity_tier_price');\n }\n if ($tierPriceData) {\n $tierPriceIn = [];\n $delProductId = [];\n\n foreach ($tierPriceData as $delSku => $tierPriceRows) {\n $productId = $this->skuProcessor->getNewSku($delSku)[$this->getProductEntityLinkField()];\n $delProductId[] = $productId;\n\n foreach ($tierPriceRows as $row) {\n $row[$this->getProductEntityLinkField()] = $productId;\n $tierPriceIn[] = $row;\n }\n }\n if (Import::BEHAVIOR_APPEND != $this->getBehavior()) {\n $this->_connection->delete(\n $tableName,\n $this->_connection->quoteInto(\"{$this->getProductEntityLinkField()} IN (?)\", $delProductId)\n );\n }\n if ($tierPriceIn) {\n $this->_connection->insertOnDuplicate($tableName, $tierPriceIn, ['value']);\n }\n }\n return $this;\n }", "public function prices()\n {\n return $this\n ->belongsToMany(PricingGroup::class, PriceListItem::getTableName(), 'item_unit_id', 'pricing_group_id')\n ->withPivot(['price', 'discount_value', 'discount_percent', 'date', 'pricing_group_id']);\n }", "public function run()\n {\n $prices = [\n [\n 'product_id' => 2,\n 'user_id' => 3,\n 'price' => 18,\n 'created_at' => now(),\n 'updated_at' => now()\n ],\n [\n 'product_id' => 3,\n 'user_id' => 3,\n 'price' => 15,\n 'created_at' => now(),\n 'updated_at' => now()\n ],\n [\n 'product_id' => 2,\n 'user_id' => 4,\n 'price' => 18,\n 'created_at' => now(),\n 'updated_at' => now()\n ],\n [\n 'product_id' => 3,\n 'user_id' => 4,\n 'price' => 15,\n 'created_at' => now(),\n 'updated_at' => now()\n ],\n ];\n ProductPrice::query()->insert($prices);\n }", "protected function doActionSetSalePrice()\n {\n $form = new \\XLite\\Module\\CDev\\Sale\\View\\Form\\SaleSelectedDialog();\n $form->getRequestData();\n\n if ($form->getValidationMessage()) {\n \\XLite\\Core\\TopMessage::addError($form->getValidationMessage());\n } elseif (!$this->getSelected() && $ids = $this->getActionProductsIds()) {\n $qb = \\XLite\\Core\\Database::getRepo('XLite\\Model\\Product')->createQueryBuilder();\n $alias = $qb->getMainAlias();\n $qb->update('\\XLite\\Model\\Product', $alias)\n ->andWhere($qb->expr()->in(\"{$alias}.product_id\", $ids));\n\n foreach ($this->getUpdateInfoElement() as $key => $value) {\n $qb->set(\"{$alias}.{$key}\", \":{$key}\")\n ->setParameter($key, $value);\n }\n\n $qb->execute();\n\n \\XLite\\Core\\TopMessage::addInfo('Products information has been successfully updated');\n } else {\n \\XLite\\Core\\Database::getRepo('\\XLite\\Model\\Product')->updateInBatchById($this->getUpdateInfo());\n \\XLite\\Core\\TopMessage::addInfo('Products information has been successfully updated');\n }\n\n $this->setReturnURL($this->buildURL('product_list', '', ['mode' => 'search']));\n }", "public function item_setprice($item)\n {\n if ($item['product_type'] != 2 || $item['product_payment'] != 'prepay') return;\n\n $db = db(config('db'));\n\n if ($_POST)\n {\n $db -> beginTrans();\n\n switch ($item['objtype'])\n {\n case 'room':\n $data = $this -> _format_room_price($item);\n\n // close old price\n $where = \"`supply`='EBK' AND `supplyid`=:sup AND `payment`=3 AND `hotel`=:hotel AND `room`=:room AND `date`>=:start AND `date`<=:end\";\n $condition = array(':sup'=>$item['pid'], ':hotel'=>$item['objpid'], ':room'=>$item['id'], ':start'=>$_POST['start'], ':end'=>$_POST['end']);\n $rs = $db -> prepare(\"UPDATE `ptc_hotel_price_date` SET `close`=1, `price`=0 WHERE {$where}\") -> execute($condition);\n if ($rs === false)\n json_return(null, 6, '保存失败,请重试');\n\n if ($data)\n {\n $data = array_values($data);\n list($column, $sql, $value) = array_values(insert_array($data));\n\n $_columns = update_column(array_keys($data[0]));\n $rs = $db -> prepare(\"INSERT INTO `ptc_hotel_price_date` {$column} VALUES {$sql} ON DUPLICATE KEY UPDATE {$_columns};\") -> execute($value); //var_dump($rs); exit;\n if (false == $rs)\n {\n $db -> rollback();\n json_return(null, 7, '数据保存失败,请重试~');\n }\n }\n break;\n\n case 'auto':\n $data = $this -> _format_auto_price($item);\n\n // close old price\n $where = \"`auto`=:auto AND `date`>=:start AND `date`<=:end\";\n $condition = array(':auto'=>$item['objpid'], ':start'=>$_POST['start'], ':end'=>$_POST['end']);\n $rs = $db -> prepare(\"UPDATE `ptc_auto_price_date` SET `close`=1, `price`=0 WHERE {$where}\") -> execute($condition);\n if ($rs === false)\n json_return(null, 6, '保存失败,请重试');\n\n if ($data)\n {\n $data = array_values($data);\n list($column, $sql, $value) = array_values(insert_array($data));\n\n $_columns = update_column(array_keys($data[0]));\n $rs = $db -> prepare(\"INSERT INTO `ptc_auto_price_date` {$column} VALUES {$sql} ON DUPLICATE KEY UPDATE {$_columns};\") -> execute($value); //var_dump($rs); exit;\n if (false == $rs)\n {\n $db -> rollback();\n json_return(null, 7, '数据保存失败,请重试~');\n }\n }\n break;\n }\n\n if (false === $db -> commit())\n json_return(null, 9, '数据保存失败,请重试~');\n else\n json_return($rs);\n }\n\n $month = !empty($_GET['month']) ? $_GET['month'] : date('Y-m');\n\n $first = strtotime($month.'-1');\n $first_day = date('N', $first);\n\n $start = $first_day == 7 ? $first : $first - $first_day * 86400;\n $end = $start + 41 * 86400;\n\n switch ($item['objtype'])\n {\n case 'room':\n $_date = $db -> prepare(\"SELECT `key`,`date`,`price`,`breakfast`,`allot`,`sold`,`filled`,`standby`,`close` FROM `ptc_hotel_price_date` WHERE `supply`='EBK' AND `supplyid`=:sup AND `hotel`=:hotel AND `room`=:room AND `date`>=:start AND `date`<=:end AND `close`=0\")\n -> execute(array(':sup'=>$item['pid'], ':hotel'=>$item['objpid'], ':room'=>$item['id'], ':start'=>$start, ':end'=>$end));\n break;\n\n case 'auto':\n $_date = $db -> prepare(\"SELECT `key`,`date`,`price`,`child`,`baby`,`allot`,`sold`,`filled`,`close` FROM `ptc_auto_price_date` WHERE `auto`=:auto AND `date`>=:start AND `date`<=:end AND `close`=0\")\n -> execute(array(':auto'=>$item['objpid'], ':start'=>$start, ':end'=>$end));\n break;\n }\n\n $date = array();\n foreach ($_date as $v)\n {\n $date[$v['date']] = $v;\n }\n unset($_date);\n\n include dirname(__FILE__).'/product/price_'.$item['objtype'].'.tpl.php';\n }", "private function mapPrices(ProductInterface $magentoProduct, SkyLinkProduct $skyLinkProduct)\n {\n $magentoProduct->setPrice($skyLinkProduct->getPricingStructure()->getRegularPrice()->toNative());\n\n $magentoProduct->unsetData('special_price');\n $magentoProduct->unsetData('special_from_date');\n $magentoProduct->unsetData('special_to_date');\n\n if (false === $skyLinkProduct->getPricingStructure()->hasSpecialPrice()) {\n $this->removeSpecialPrices($magentoProduct);\n return;\n }\n\n $skyLinkSpecialPrice = $skyLinkProduct->getPricingStructure()->getSpecialPrice();\n\n // If the end date is before now, we do not need to put a new special price on at all, as\n // it cannot end in the past. In fact, Magento will let you save it, but won't let\n // subsequent saves from the admin interface occur.\n $now = new DateTimeImmutable();\n if ($skyLinkSpecialPrice->hasEndDate() && $skyLinkSpecialPrice->getEndDate() < $now) {\n $this->removeSpecialPrices($magentoProduct);\n return;\n }\n\n $magentoProduct->setCustomAttribute('special_price', $skyLinkSpecialPrice->getPrice()->toNative());\n\n // If there's a start date at least now or in the future, we'll use that...\n if ($skyLinkSpecialPrice->hasStartDate() && $skyLinkSpecialPrice->getStartDate() >= $now) {\n $magentoProduct->setCustomAttribute(\n 'special_from_date',\n $this->dateTimeToLocalisedAttributeValue($skyLinkSpecialPrice->getStartDate())\n );\n\n // Otherwise, we'll use a start date from now\n } else {\n $magentoProduct->setCustomAttribute('special_from_date', $this->dateTimeToLocalisedAttributeValue($now));\n }\n\n // If there's an end date, we'll just use that\n if ($skyLinkSpecialPrice->hasEndDate()) {\n $magentoProduct->setCustomAttribute(\n 'special_to_date',\n $this->dateTimeToLocalisedAttributeValue($skyLinkSpecialPrice->getEndDate())\n );\n\n // Otherwise, it's indefinite\n } else {\n $distantFuture = new DateTimeImmutable('2099-01-01');\n $magentoProduct->setCustomAttribute('special_to_date', $this->dateTimeToLocalisedAttributeValue($distantFuture));\n }\n }", "public function productPrices()\n {\n return $this->belongsToMany(ProductPrice::class, 'product_prices', null, 'product_id');\n }", "public function setTblProdPrices(ChildTblProdPrices $v = null)\n {\n if ($v === null) {\n $this->setProdId(NULL);\n } else {\n $this->setProdId($v->getProdId());\n }\n\n $this->aTblProdPrices = $v;\n\n // Add binding for other direction of this 1:1 relationship.\n if ($v !== null) {\n $v->setTblProdInfo($this);\n }\n\n\n return $this;\n }", "function updateAmazonProductsPrices($items)\n{\n\tif (sizeof($items) > 0) {\n\t\t$data['lastmod'] = time();\n\t\t$data['lastmod_user'] = getAmazonSessionUserId();\n\t\t$data['lastpriceupdate'] = time();\n\t\t$data['submitedProduct'] = 0;\n\t\t$data['submitedPrice'] = 0;\n\t\t$data['upload'] = 1;\n\t\t$caseStandardPrice = \"StandardPrice = CASE\";\n\t\tforeach($items as $key => $item)\n\t\t{\n\t\t\t$caseStandardPrice.= \"\\n WHEN id_product = \" . $items[$key]['id_product'] . \" THEN \" . $items[$key]['price'];\n\t\t\t$productsIds[] = $items[$key]['id_product'];\n\t\t}\n\t\t$caseStandardPrice.= \"\n\t\t\tEND\n\t\t\tWHERE id_product IN (\" . implode(\", \", $productsIds) . \")\n\t\t\";\n\t\t$addWhere\t = $caseStandardPrice;\n\t\tSQLUpdate('amazon_products', $data, $addWhere, 'shop', __FILE__, __LINE__);\n\t}\n}", "public function updateProductListPivot()\n {\n $model = $this->productListable;\n $products = $model->products()->get('id');\n $this->products()->sync($products->pluck('id'));\n }", "public function createAction()\n {\n $entity = new Pricelist();\n $request = $this->getRequest();\n $form = $this->createForm(new PricelistType(), $entity);\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('Price_show', array('id' => $entity->getId())));\n \n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView()\n );\n }", "public function setOptions_values_price( $options_values_price ) {\n\t\t$this->options_values_price = $options_values_price;\n\t}", "function SaveListEntity($listEntity)\n\t{\n\t\t$result = $this->sendRequest(\"SaveListEntity\", array(\"ListEntity\"=>$listEntity));\n\t\treturn $this->getResultFromResponse($result);\n\t}", "protected function calculatePrices()\n {\n }", "public function syncProductList()\n {\n // Evaluation only needed for custom product list and product tag\n if (!$this->isCustomList() && !$this->model_type !== ProductTag::class) return;\n\n $product_ids = $this->isCustomList() ? $this->product_ids : $this->getProductQuery()->get('id')->pluck('id')->all();\n\n $this->products()->sync($product_ids);\n }", "public function addprice($sOXID = null, $aUpdateParams = null)\n {\n $myConfig = $this->getConfig();\n\n $this->resetContentCache();\n\n $sOxArtId = $this->getEditObjectId();\n\n\n\n $aParams = oxRegistry::getConfig()->getRequestParameter(\"editval\");\n\n if (!is_array($aParams)) {\n return;\n }\n\n if (isset($aUpdateParams) && is_array($aUpdateParams)) {\n $aParams = array_merge($aParams, $aUpdateParams);\n }\n\n //replacing commas\n foreach ($aParams as $key => $sParam) {\n $aParams[$key] = str_replace(\",\", \".\", $sParam);\n }\n\n $aParams['oxprice2article__oxshopid'] = $myConfig->getShopID();\n\n if (isset($sOXID)) {\n $aParams['oxprice2article__oxid'] = $sOXID;\n }\n\n $aParams['oxprice2article__oxartid'] = $sOxArtId;\n if (!isset($aParams['oxprice2article__oxamount']) || !$aParams['oxprice2article__oxamount']) {\n $aParams['oxprice2article__oxamount'] = \"1\";\n }\n\n if (!$myConfig->getConfigParam('blAllowUnevenAmounts')) {\n $aParams['oxprice2article__oxamount'] = round(( string ) $aParams['oxprice2article__oxamount']);\n $aParams['oxprice2article__oxamountto'] = round(( string ) $aParams['oxprice2article__oxamountto']);\n }\n\n $dPrice = $aParams['price'];\n $sType = $aParams['pricetype'];\n\n $oArticlePrice = oxNew(\"oxbase\");\n $oArticlePrice->init(\"oxprice2article\");\n $oArticlePrice->assign($aParams);\n\n $oArticlePrice->$sType = new oxField($dPrice);\n\n //validating\n if ($oArticlePrice->$sType->value &&\n $oArticlePrice->oxprice2article__oxamount->value &&\n $oArticlePrice->oxprice2article__oxamountto->value &&\n is_numeric($oArticlePrice->$sType->value) &&\n is_numeric($oArticlePrice->oxprice2article__oxamount->value) &&\n is_numeric($oArticlePrice->oxprice2article__oxamountto->value) &&\n $oArticlePrice->oxprice2article__oxamount->value <= $oArticlePrice->oxprice2article__oxamountto->value\n ) {\n $oArticlePrice->save();\n }\n\n // check if abs price is lower than base price\n $oArticle = oxNew(\"oxArticle\");\n $oArticle->loadInLang($this->_iEditLang, $sOxArtId);\n $sPriceField = 'oxarticles__oxprice';\n if (($aParams['price'] >= $oArticle->$sPriceField->value) &&\n ($aParams['pricetype'] == 'oxprice2article__oxaddabs')) {\n if (is_null($sOXID)) {\n $sOXID = $oArticlePrice->getId();\n }\n $this->_aViewData[\"errorscaleprice\"][] = $sOXID;\n }\n\n }", "public function Save($id, $desc, $rating, $genre, $developer, $listPrice, $releaseDate)\n {\t\n\t\ttry\n\t\t{\t\n\t\t\t$response = $this->_obj->Execute(\"Product(\" . $id . \")\" );\n\t\t\t$products = $response->Result;\n\t\t\tforeach ($products as $product) \n\t\t\t{\n\t\t\t\t$product->ProductDescription = $desc;\n\t\t\t\t$product->ListPrice = str_replace('$', '', $listPrice);\n\t\t\t\t$product->ReleaseDate = $releaseDate;\n\t\t\t\t$product->ProductVersion = $product->ProductVersion;\n\t\t\t\t$this->_obj->UpdateObject($product);\n\t\t\t}\n\t\t\t$this->_obj->SaveChanges(); \n\t\t\t$response = $this->_obj->Execute(\"Game?\\$filter=ProductID eq \" . $id );;\n\t\t\t$games = $response->Result;\n\t\t\tforeach ($games as $game) \n\t\t\t{\n\t\t\t\t$game->Rating = str_replace('%20', ' ', $rating);\n\t\t\t\t$game->Genre = str_replace('%20', ' ', $genre);\n\t\t\t\t$game->Developer = $developer;\n\t\t\t\t$game->GameVersion = $game->GameVersion;\n\t\t\t\t$this->_obj->UpdateObject($game);\n\t\t\t}\n\t\t\t$this->_obj->SaveChanges();\n\t\t\t$products[0]->Game = $games;\n\t\t\treturn $products[0];\n }\n catch(ADODotNETDataServicesException $e)\n {\n\t\t\t echo \"Error: \" . $e->getError() . \"<br>\" . \"Detailed Error: \" . $e->getDetailedError();\n }\n }", "public function testPriceGroupWithVariants()\n {\n $number = __FUNCTION__;\n $context = $this->getContext();\n\n $data = $this->createPriceGroupProduct($number, $context, true);\n\n $this->helper->createArticle($data);\n\n $listProduct = $this->helper->getListProduct($number, $context, [\n 'useLastGraduationForCheapestPrice' => true,\n ]);\n\n /* @var ListProduct $listProduct */\n static::assertEquals(7, $listProduct->getCheapestPrice()->getCalculatedPrice());\n }", "public function deleteprice()\n {\n $this->resetContentCache();\n\n $oDb = oxDb::getDb();\n $sPriceId = $oDb->quote(oxRegistry::getConfig()->getRequestParameter(\"priceid\"));\n $sId = $oDb->quote($this->getEditObjectId());\n $oDb->execute(\"delete from oxprice2article where oxid = {$sPriceId} and oxartid = {$sId}\");\n }", "public function update(Request $request, $id)\n {\n $pricelist = $this->pricelist->find($id);\n $pricelist->fill($request->except('pricelist_items'));\n $pricelist->save();\n\n $priceListItem = [];\n $requestPricelistItems = json_decode($request->pricelist_items);\n\n foreach ( $requestPricelistItems as $pricelistItem) {\n $priceListItem = [\n 'price_list_id' => $id,\n 'waste_id' => $pricelistItem->pivot->waste_id,\n 'unit_id' => $pricelistItem->unit_id,\n 'unit_price' => (double)$pricelistItem->pivot->unit_price\n ];\n $priceListItemToBeUpdated = $this->pricelistItem->where('waste_id',$pricelistItem->pivot->waste_id)\n ->where('price_list_id',$id)->first();\n if ($priceListItemToBeUpdated->count() > 0) {\n \n $priceListItemToBeUpdated->unit_price = (double)$pricelistItem->pivot->unit_price;\n $priceListItemToBeUpdated->unit_id = $pricelistItem->unit_id;\n $priceListItemToBeUpdated->save();\n\n } else {\n $pricelist->wastes()->attach($priceListItem);\n }\n }\n\n return redirect()->route('settings.pricelists')\n ->with('success', 'Pricelist has been updated!');\n }", "public function updateProduct()\n {\n \t$quote=$this->getQuote();\n \tif($quote)\n \t{\n \t\t$detailproduct=$this->getProduct();\n \t\t$quoteproduct=$quote->getProduct();\n \t\tif(\n\t\t\t\t$quote->getPrice()!=$this->getPrice() or\n\t\t\t\t$quote->getDiscrate()!=$this->getDiscrate() or\n\t\t\t\t$quote->getDiscamt()!=$this->getDiscamt() or\n\t\t\t\t$quote->getProductId()!=$this->getProductId()\n\t\t\t)\n\t\t\t{\n\t\t\t\t$quote->setPrice($this->getPrice());\n\t\t\t\t$quote->setDiscrate($this->getDiscrate());\n\t\t\t\t$quote->setDiscamt($this->getDiscamt());\n\t\t\t\t$quote->setProductId($this->getProductId());\n\t\t\t\t$quote->calc(); //auto save\n\t\t\t\t$detailproduct->calcSalePrices();\n\t\t\t\t\n\t\t\t\t//if product changed, calc old product\n\t\t\t\tif($quoteproduct->getId()!=$detailproduct->getId())\n\t\t\t\t\t$quoteproduct->calcSalePrices();\n\t\t\t}\n \t}\n \telse\n \t{\n\t\t\t//if none, see if product quote by vendor with similar pricing exists. \n\t\t\t$quote=Fetcher::fetchOne(\"Quote\",array('total'=>$this->getUnittotal(),'vendor_id'=>SettingsTable::fetch(\"me_vendor_id\"),'product_id'=>$this->getProductId()));\n\n\t\t\t//if it doesn't exist, create it, and product->calc()\n\t\t\tif(!$quote)\n\t\t\t{\n\t\t\t\tQuoteTable::createOne(array(\n\t\t\t\t\t'date'=>$this->getInvoice()->getDate(),\n\t\t\t\t\t'price'=>$this->getPrice(),\n\t\t\t\t\t'discrate'=>$this->getDiscrate(),\n\t\t\t\t\t'discamt'=>$this->getDiscamt(),\n\t\t\t\t\t'vendor_id'=>SettingsTable::fetch(\"me_vendor_id\"),\n\t\t\t\t\t'product_id'=>$this->getProductId(),\n\t\t\t\t\t'ref_class'=>\"Invoicedetail\",\n\t\t\t\t\t'ref_id'=>$this->getId(),\n\t\t\t\t\t'mine'=>1,\n\t\t\t\t\t));\n\t\t\t\t$this->getProduct()->calcSalePrices();\n\t\t\t}\n \t}\n }", "protected function createProductVariantPricelistPriceRequest($body, $product_id, $variant_id)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling createProductVariantPricelistPrice'\n );\n }\n // verify the required parameter 'product_id' is set\n if ($product_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $product_id when calling createProductVariantPricelistPrice'\n );\n }\n if ($product_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$product_id\" when calling DefaultApi.createProductVariantPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'variant_id' is set\n if ($variant_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $variant_id when calling createProductVariantPricelistPrice'\n );\n }\n if ($variant_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$variant_id\" when calling DefaultApi.createProductVariantPricelistPrice, must be bigger than or equal to 1.');\n }\n $resourcePath = '/products/{productId}/variants/{variantId}/prices';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($product_id !== null) {\n $resourcePath = str_replace(\n '{' . 'productId' . '}',\n ObjectSerializer::toPathValue($product_id),\n $resourcePath\n );\n }\n // path params\n if ($variant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'variantId' . '}',\n ObjectSerializer::toPathValue($variant_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n \n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function woocommerce_rrp_add_bulk_on_edit() {\n\t\t\tglobal $typenow;\n\t\t\t$post_type = $typenow;\n\t\t\t\n\t\t\tif($post_type == 'product') {\n\t\t\t\t\n\t\t\t\t// get the action\n\t\t\t\t$wp_list_table = _get_list_table('WP_Posts_List_Table'); // depending on your resource type this could be WP_Users_List_Table, WP_Comments_List_Table, etc\n\t\t\t\t$action = $wp_list_table->current_action();\n\t\t\t\t\n\t\t\t\t$allowed_actions = array(\"set_price_to_rrp\");\n\t\t\t\tif(!in_array($action, $allowed_actions)) return;\n\t\t\t\t\n\t\t\t\t// security check\n\t\t\t\tcheck_admin_referer('bulk-posts');\n\t\t\t\t\n\t\t\t\t// make sure ids are submitted. depending on the resource type, this may be 'media' or 'ids'\n\t\t\t\tif(isset($_REQUEST['post'])) {\n\t\t\t\t\t$post_ids = array_map('intval', $_REQUEST['post']);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(empty($post_ids)) return;\n\t\t\t\t\n\t\t\t\t// this is based on wp-admin/edit.php\n\t\t\t\t$sendback = remove_query_arg( array('price_setted_to_rrp', 'untrashed', 'deleted', 'ids'), wp_get_referer() );\n\t\t\t\tif ( ! $sendback )\n\t\t\t\t\t$sendback = admin_url( \"edit.php?post_type=$post_type\" );\n\t\t\t\t\n\t\t\t\t$pagenum = $wp_list_table->get_pagenum();\n\t\t\t\t$sendback = add_query_arg( 'paged', $pagenum, $sendback );\n\t\t\t\t\n\t\t\t\tswitch($action) {\n\t\t\t\t\tcase 'set_price_to_rrp':\n\t\t\t\t\t\t\n\t\t\t\t\t\t// if we set up user permissions/capabilities, the code might look like:\n\t\t\t\t\t\t//if ( !current_user_can($post_type_object->cap->export_post, $post_id) )\n\t\t\t\t\t\t//\twp_die( __('You are not allowed to export this post.') );\n\t\t\t\t\t\t\n\t\t\t\t\t\t$price_setted_to_rrp = 0;\n\t\t\t\t\t\tforeach( $post_ids as $post_id ) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$buy_price = get_post_meta($post_id, 'buy_price', true);\n\t\t\t\t\t\t\t$rrp_calc_params = array(\n\t\t\t\t\t\t\t\t'ads_cost' => get_rrp_param($post_id, 'ads_cost'),\t\n\t\t\t\t\t\t\t\t'shipping_cost' => get_rrp_param($post_id, 'shipping_cost'),\t\n\t\t\t\t\t\t\t\t'package_cost' => get_rrp_param($post_id, 'package_cost'),\t\n\t\t\t\t\t\t\t\t'min_profit' => get_rrp_param($post_id, 'min_profit'),\t\n\t\t\t\t\t\t\t\t'desired_profit' => get_rrp_param($post_id, 'desired_profit'),\t\n\t\t\t\t\t\t\t\t'tax_rate' => get_rrp_param($post_id, 'tax_rate'),\n\t\t\t\t\t\t\t);\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$caluculated_rrp = calculate_rrp($buy_price, $rrp_calc_params);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tupdate_post_meta( $post_id, '_regular_price', $caluculated_rrp );\n\t\t\t\n\t\t\t\t\t\t\t$price_setted_to_rrp++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$sendback = add_query_arg( array('price_setted_to_rrp' => $price_setted_to_rrp, 'ids' => join(',', $post_ids) ), $sendback );\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tdefault: return;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$sendback = remove_query_arg( array('action', 'action2', 'tags_input', 'post_author', 'comment_status', 'ping_status', '_status', 'post', 'bulk_edit', 'post_view'), $sendback );\n\t\t\t\t\n\t\t\t\twp_redirect($sendback);\n\t\t\t\texit();\n\t\t\t}\n\t\t}", "public function updateShippingPrice($productID, $newShippingPriceList){\n\n global $db;\n\n if(!is_numeric($productID)){\n return;\n }\n\n $newShippingLocationList = [];\n $delShippingPriceIDList = [];\n foreach($newShippingPriceList as $shippingData){\n $newShippingLocationList[$shippingData['locationID']] = $shippingData['price'];\n }\n\n $oldShippingPriceList = $this->getShippingPrice($productID);\n\n if(isset($oldShippingPriceList) && is_array($oldShippingPriceList) && count($oldShippingPriceList) > 0){\n foreach($oldShippingPriceList as $shippingData){\n if(array_key_exists($shippingData['locationID'], $newShippingLocationList)){\n $query = sprintf('UPDATE %s SET price=%s WHERE id=%d', TABLE_SHOP_SHIPPING_PRICE, $newShippingLocationList[$shippingData['locationID']], $shippingData['id']);\n $db->query($query);\n unset($newShippingLocationList[$shippingData['locationID']]);\n\n }else{\n $delShippingPriceIDList[] = $shippingData['id'];\n }\n }\n }\n\n $this->removeShippingPriceByIDs($delShippingPriceIDList);\n\n if(count($newShippingLocationList) > 0){\n foreach($newShippingLocationList as $key => $val){\n $param = ['productID' => $productID, 'locationID' => $key, 'price' => $val,];\n\n $db->insertFromArray(TABLE_SHOP_SHIPPING_PRICE, $param);\n }\n }\n\n return true;\n\n }", "public function setPrice(float $price) : void\n {\n $this->set('price', $price, 'products');\n }", "public function price(){\n return $this->hasMany('App\\Pricebookentry','product2id','sfid');\n }", "public function create(PriceListRequest $request)\n {\n\n $price_list = $this->repository->newInstance([]);\n return $this->response->title(trans('app.new') . ' ' . trans('pricelist::price_list.name')) \n ->view('pricelist::price_list.create', true) \n ->data(compact('price_list'))\n ->output();\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $model->prices = $model->getAllPrices();\n $modelPrice = [new InventoryPrice()];\n\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n $prices = Yii::$app->request->post();\n $oldPrices = ArrayHelper::map($model->prices, 'id', 'id');\n $currentPrices = ArrayHelper::map($prices['Inventory']['prices'], 'id', 'id');\n $deletedPrices = array_diff($oldPrices, array_filter($currentPrices));\n\n $transaction = Yii::$app->db->beginTransaction();\n try {\n $model->save();\n\n // detete price\n if (!empty($deletedPrices)) {\n InventoryPrice::deleteAll(['id' => $deletedPrices]);\n }\n\n foreach ($prices['Inventory']['prices'] as $key => $item) {\n if (empty($item['id'])) {\n $modelPrice = new InventoryPrice();\n $modelPrice->created_at = time();\n $modelPrice->created_by = Yii::$app->user->id;\n } else {\n $modelPrice = InventoryPrice::find()->where(['id' => $item['id']])->one();\n }\n $modelPrice->inventory_id = $model->id;\n $modelPrice->vendor_id = $item['vendor_id'];\n $modelPrice->vendor_name = @Inventory::getVendorName($modelPrice->vendor_id);\n $modelPrice->price = $item['price'];\n $modelPrice->due_date = $item['due_date'];\n $modelPrice->active = !isset($item['active']) ? InventoryPrice::STATUS_INACTIVE : $item['active'];\n\n\n if ($modelPrice->price && $modelPrice->vendor_id) {\n $modelPrice->save(false);\n }\n }\n\n\n $transaction->commit();\n Yii::$app->session->setFlash('success', 'เพิ่มสินค้าใหม่เรียบร้อย');\n return $this->redirect(['view', 'id' => $model->id]);\n } catch (Exception $e) {\n $transaction->rollBack();\n Yii::$app->session->setFlash('error', $e->getMessage());\n return $this->redirect(['update', 'id' => $model->id]);\n }\n\n\n } else {\n return $this->render('update', [\n 'model' => $model,\n 'modelPrice' => $modelPrice,\n ]);\n }\n }", "function SetWebsiteList(&$list)\n\t{\n\t\t$this->_websiteList = array();\n\t\t$existingWebsiteList = $this->GetWebsiteList();\n\t\tforeach ($existingWebsiteList as $website)\n\t\t{\n\t\t\t$website->supplierId = '';\n\t\t\t$website->Save(false);\n\t\t}\n\t\t$this->_websiteList = $list;\n\t}", "public function getAllList_Price()\n {\n try\n {\n // Создаем новый запрс\n $db = $this->getDbo();\n $query = $db->getQuery(true);\n\n $query->select('a.*');\n $query->from('`#__gm_ceiling_components_option` AS a');\n $query->select('CONCAT( component.title , \\' \\', a.title ) AS full_name');\n $query->select('component.id AS component_id');\n $query->select('component.title AS component_title');\n $query->select('component.unit AS component_unit');\n $query->join('RIGHT', '`#__gm_ceiling_components` AS component ON a.component_id = component.id');\n\n $db->setQuery($query);\n $return = $db->loadObjectList();\n return $return;\n }\n catch(Exception $e)\n {\n Gm_ceilingHelpersGm_ceiling::add_error_in_log($e->getMessage(), __FILE__, __FUNCTION__, func_get_args());\n }\n }", "protected function configureListFields(ListMapper $list): void\r\n {\r\n $list\r\n ->addIdentifier('id')\r\n ->add('expediente', EntityType::class, ['class' => ComercialExpediente::class, 'choice_label' => 'titulo'])\r\n ->add('cotizacion')\r\n ->add('personaNif')\r\n ->add('oficina')\r\n ->add('horizontal')\r\n ->add('vertical')\r\n ->add('missatge')\r\n ->add('nivel')\r\n ->add('updatedAt')\r\n ->add('createdAt')\r\n ->add('active')\r\n ->add('deleted')\r\n ->add('deletedBy')\r\n ->add('deletedAt');\r\n }", "public function getPriceAll()\n { \n $collection = $this->PostCollectionFactory->create();\n /*$a = $collection->getPrice();*/\n foreach ($collection as $key => $value) {\n $value->getPrice();\n }\n return $value->getPrice();\n }", "public function createAppendReplaceList($client, $listName, $listFields, $forceReplace = false)\n\t{\n\t\tMage::helper('pure360_list')->writeDebug(__METHOD__ . ' - start');\n\n\t\t// Calculate list fields\n\t\t$fieldNames = array('email', 'store', 'website', 'subscription_date', 'customer_id');\n\n\t\tforeach($listFields as $field)\n\t\t{\n\t\t\t$fieldNames[] = $field['field_value'];\n\t\t}\n\n\t\t$listCheck = $this->listCheck($client, $listName, $fieldNames);\n\n\t\t// Set list properties ready for replace\n\t\t$listInput = array(\n\t\t\t\"listName\" => $listName,\n\t\t\t\"languageCode\" => \"en_GB.UTF-8\",\n\t\t\t\"uploadFileNotifyEmail\" => \"IGNORE\",\n\t\t\t\"uploadTransactionType\" => ($listCheck === 'NEW' ? \"CREATE\" : \n\t\t\t\t(( $listCheck === 'EXISTS' && !$forceReplace) ? \"APPEND\" : \"REPLACE\")),\n\t\t\t\"uploadFileCategory\" => \"PAINT\",\n\t\t\t\"externalSystemKey\" => \"magento\");\n\n\t\t$customFieldCount = 0;\n\n\t\t// Get date key lookup:\n\t\t$dateKeyLookup = Mage::helper('pure360_list')->getDateKeyLookup();\n\t\t\n\t\t// Set field names\n\t\tfor($index = 0; ($index < count($fieldNames) & $customFieldCount <= 40); $index++)\n\t\t{\n\t\t\t$fieldName = $fieldNames[$index];\n\n\t\t\tswitch($fieldName)\n\t\t\t{\n\t\t\t\tcase \"email\":\n\t\t\t\t\t$listInput[\"emailCol\"] = $index;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"mobile\":\n\t\t\t\t\t$listInput[\"mobileCol\"] = $index;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"signupDate\":\n\t\t\t\t\t$listInput[\"signupDateCol\"] = $index;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t$fieldColStr = \"field\" . $index . \"Col\";\n\t\t\t\t\t$fieldNameStr = \"field\" . $index . \"Name\";\n\t\t\t\t\t$fieldName = str_replace(' ', '_', $fieldName);\n\n\t\t\t\t\t$listInput[$fieldColStr] = $index;\n\t\t\t\t\t$listInput[$fieldNameStr] = $fieldName;\n\n\t\t\t\t\tif(in_array($fieldName, $dateKeyLookup))\n\t\t\t\t\t{\n\t\t\t\t\t\t$fieldTypeStr = \"field\" . $index . \"DataType\";\n\t\t\t\t\t\t$listInput[$fieldTypeStr] = 'date';\n\t\t\t\t\t\t$fieldFormatStr = \"field\" . $index . \"DataFormat\";\n\t\t\t\t\t\t$listInput[$fieldFormatStr] = 'yyyy-mm-dd';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$customFieldCount++;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Create/Replace list\n\t\t$createOutput = $client->campaign->marketingList->_create($listInput);\n\t\t$storeInput = array(\"beanId\" => $createOutput[\"beanId\"]);\n\t\t$result = $client->campaign->marketingList->_store($storeInput);\n\n\t\tMage::helper('pure360_list')->writeDebug(__METHOD__ . ' - end');\n\n\t\treturn $result;\n\t}", "public static function addFinalPriceForProductObject($data)\n {\n $taxClassArray = self::getTax();\n foreach ($data as $row) {\n $priceRs = self::getPriceToCalculateTax($row);\n $row->final_price = self::finalPrice($priceRs['price'], $row->tax_class_id, $taxClassArray);\n $row->display_price_promotion = $priceRs['display_price_promotion'];\n }\n return $data;\n }", "public function getProductPriceAll()\n {\n return $this->_scopeConfig->getValue('splitprice/split_price_config/show_all', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n }", "function SetWeddingList(&$list)\n\t{\n\t\t$this->_weddingList = array();\n\t\t$existingWeddingList = $this->GetWeddingList();\n\t\tforeach ($existingWeddingList as $wedding)\n\t\t{\n\t\t\t$wedding->supplierId = '';\n\t\t\t$wedding->Save(false);\n\t\t}\n\t\t$this->_weddingList = $list;\n\t}", "Function update_price($int_productID,\r\n $flt_amount,\r\n $int_currency_id,\r\n $start_date,\r\n $end_date = FALSE,\r\n $min_quantity = 1,\r\n $max_quantity = 0,\r\n $int_contact_id = FALSE) {\r\n global $db_iwex;\r\n //echo \" update_price curr: \" . $int_currency_id;\r\n // Check if there is a record that can be updated.\r\n $int_current_price = GetField(\"SELECT recordID\r\n\t\t\t\t\t\t\t\t FROM pricing\r\n\t\t\t\t\t\t\t\t WHERE productID = '$int_productID'\r\n\t\t\t\t\t\t\t\t\t\tAND currencyid = '$int_currency_id'\r\n\t\t\t\t\t\t\t\t\t\tAND start_number = '$min_quantity'\r\n\t\t\t\t\t\t\t\t\t\tAND end_number = '$max_quantity'\r\n\t\t\t\t\t\t\t\t\t\tAND start_date = '$start_date'\r\n\t\t\t\t\t\t\t\t\t\tAND (end_date >= NOW() OR end_date = '0000-00-00')\r\n\t\t\t\t\t\t\t\t\t\tAND ContactID = $int_contact_id\");\r\n // When there is an old price that matches it.\r\n $str_sql = \"SELECT recordID\r\n\t\t\t\tFROM pricing \r\n\t\t\t\tWHERE ProductID = '$int_productID' \r\n\t\t\t\t\tAND currencyid = '$int_currency_id'\r\n\t\t\t\t\tAND ContactID='$int_contact_id'\r\n\t\t\t\t\tAND (start_date <= '$start_date' || isnull(start_date) || start_date=0) \r\n\t\t\t\t\tAND (end_date >= \".($end_date && $end_date != \"0000-00-00\" ? \"'$end_date'\" : \"NOW()\").\" || isnull(end_date) || end_date=0)\r\n\t\t\t\t\tAND (start_number <= '$min_quantity' || isnull(start_number) || start_number=0)\r\n\t\t\t\t\tAND (\".($max_quantity ? \"end_number >= '$max_quantity' ||\" : \"\").\" isnull(end_number) || end_number=0)\";\r\n $int_record_id = GetField($str_sql);\r\n\r\n $bl_record_used = $int_current_price ? SalesPriceUsedInOrder($int_current_price) : FALSE;\r\n\r\n // When there is an other record that also matches this new price set it valid to the today -1 day.\r\n if ($int_record_id != $int_current_price\r\n &&\r\n $int_record_id\r\n ) {\r\n EndOldSalesPrice($start_date, $int_record_id);\r\n }\r\n\r\n if ($bl_record_used) {\r\n EndOldSalesPrice($start_date, $int_current_price);\r\n $int_current_price = FALSE;\r\n }\r\n\r\n if (!$int_current_price) { // Create a new record.\r\n $sql = \"INSERT INTO\";\r\n // New records are started today when false or 0;\r\n $start_date = !$start_date || $start_date == \"0000-00-00\" ? date(DATEFORMAT_LONG) : $start_date;\r\n $sql_where = \", created_by = '\" . $GLOBALS[\"employee_id\"] . \"', created = '\".date(DATEFORMAT_LONG) . \"'\";\r\n } else {\r\n $sql = \"UPDATE\";\r\n $sql_where = \", modified_by = '\" . $GLOBALS[\"employee_id\"] . \"', modified = '\".date(DATEFORMAT_LONG) . \"'\r\n\t\t\t\t\t WHERE recordID = $int_current_price\";\r\n\r\n }\r\n $sql .= \" pricing SET amount = '$flt_amount',\r\n \t\t\t\t\t\t currencyid = '$int_currency_id',\r\n\t\t\t\t\t\t ContactID = '$int_contact_id', \r\n\t\t\t\t\t\t productID = '$int_productID', \r\n\t\t\t\t\t\t start_number = '$min_quantity',\r\n\t\t\t\t\t\t end_number = '$max_quantity', \r\n\t\t\t\t\t\t start_date = '$start_date' \";\r\n if ($end_date) $sql .= \", end_date = '$end_date'\";\r\n\r\n //echo $sql.$sql_where;\r\n $db_iwex->query($sql.$sql_where);\r\n\r\n return $int_current_price ? $int_current_price : $db_iwex->lastinserted();\r\n}", "public function calculateBundleAmount($basePriceValue, $bundleProduct, $selectionPriceList, $exclude = null);", "public function price()\n {\n return $this->morphToMany('Sanatorium\\Pricing\\Models\\Money', 'priceable', 'priced');\n }", "public function updateProductStyleOptionPricingAll(){\n\t\t$all_products = $this->getAll();\n\t\t$this->load->model('catalog/product');\n\t\t$this->load->model('tshirtgang/pricing');\n\t\t$this->load->model('catalog/option');\n\t\t$tshirt_option_names = array('Tshirt Color', 'Tshirt Style', 'Tshirt Size');\n\t\t$tshirt_colored = array(\n\t\t\t\"Black\",\n\t\t\t\"Charcoal Grey\",\n\t\t\t\"Daisy\",\n\t\t\t\"Dark Chocolate\",\n\t\t\t\"Forest Green\",\n\t\t\t\"Gold\",\n\t\t\t\"Irish Green\",\n\t\t\t\"Light Blue\",\n\t\t\t\"Light Pink\",\n\t\t\t\"Military Green\",\n\t\t\t\"Navy\",\n\t\t\t\"Orange\",\n\t\t\t\"Purple\",\n\t\t\t\"Red\",\n\t\t\t\"Royal Blue\",\n\t\t\t\"Sport Grey\",\n\t\t\t\"Tan\",\n\t\t\t\"Burgundy\"\n\t\t);\n\t\t$tshirt_ringer = array(\n\t\t\t\"Navy Ringer\",\n\t\t\t\"Black Ringer\",\n\t\t\t\"Red Ringer\"\n\t\t);\n\t\t$tshirt_options = array();\n\t\t$tshirt_options_price = array();\n\t\t$options = $this->model_catalog_option->getOptions();\n\t\t$temp_price = 0.0;\n\t\tforeach($options as $option){\n\t\t\t//if($option['name'] == 'Tshirt Color'){\n\t\t\t//\t$tshirtcolor_option_id = $option['option_id'];\n\t\t\t//}\n\t\t\t//if($option['name'] == 'Tshirt Style'){\n\t\t\t//\t$tshirtstyle_option_id = $option['option_id'];\n\t\t\t//}\n\t\t\t//if($option['name'] == 'Tshirt Size'){\n\t\t\t//\t$tshirtsize_option_id = $option['option_id'];\n\t\t\t//}\n\t\t\tif(in_array($option['name'], $tshirt_option_names)){\n\t\t\t\t$tshirt_options[$option['name']] = array();\n\t\t\t\t$tshirt_options[$option['name']]['option_id'] = $option['option_id'];\n\t\t\t\t$tshirt_options[$option['name']]['prices'] = array();\n\t\t\t}\n\t\t}\n\t\tforeach($tshirt_option_names as $tshirt_option_name){\n\t\t\t$option_value_descriptions = $this->model_catalog_option->getOptionValueDescriptions($tshirt_options[$tshirt_option_name]['option_id']);\n\t\t\tforeach($option_value_descriptions as $opv){\n\t\t\t\t$temp_price = 0.0;\n\t\t\t\tif($tshirt_option_name=='Tshirt Color'){\n\t\t\t\t\tif( in_array($opv['option_value_description'][1]['name'], $tshirt_colored )){\n\t\t\t\t\t\t$temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'ColorShirt' ));\n\t\t\t\t\t} elseif( in_array($opv['option_value_description'][1]['name'], $tshirt_ringer )){\n\t\t\t\t\t\t$temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'RingerShirt' ));\n\t\t\t\t\t} else { // white\n\t\t\t\t\t\t$temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'WhiteShirt' ));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif($tshirt_option_name=='Tshirt Style'){\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"Mens Fitted\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'MensFittedIncremental' ));\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"Ladies\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'LadiesIncremental' ));\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"Hooded Pullover\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'HoodieIncremental' ));\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"Apron\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'ApronIncremental' ));\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"Vneck\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'VneckIncremental' ));\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"Tanktop\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'TanktopIncremental' ));\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"Baby One Piece\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'BabyOnePieceIncremental' ));\n\t\t\t\t}\n\t\t\t\tif($tshirt_option_name=='Tshirt Size'){\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"2 X-Large\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'Shirt_2XL_Incremental' ));\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"3 X-Large\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'Shirt_3XL6XL_Incremental' ));\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"4 X-Large\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'Shirt_3XL6XL_Incremental' ));\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"5 X-Large\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'Shirt_3XL6XL_Incremental' ));\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"6 X-Large\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'Shirt_3XL6XL_Incremental' ));\n\t\t\t\t}\n\t\t\t\tif($temp_price != 0.0){\n\t\t\t\t\t$tshirt_options_price = array(\n\t\t\t\t\t\t'option_value_id' => $opv['option_value_id'],\n\t\t\t\t\t\t'name' => $opv['option_value_description'][1]['name'],\n\t\t\t\t\t\t'price' => $temp_price\n\t\t\t\t\t);\n\t\t\t\t\t$tshirt_options[$tshirt_option_name]['prices'][] = $tshirt_options_price;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tforeach($tshirt_options as $tso1){\n\t\t\tforeach($tso1['prices'] as $tso2){\n\t\t\t\t$sql = \"UPDATE \" . DB_PREFIX . \"product_option_value ocpov \";\n\t\t\t\t$sql .= \"LEFT JOIN \" . DB_PREFIX . \"product ocp \";\n\t\t\t\t$sql .= \" ON ocp.product_id = ocpov.product_id \";\n\t\t\t\t$sql .= \"LEFT JOIN \" . DB_PREFIX . \"tshirtgang_products tsgp \";\n\t\t\t\t$sql .= \" ON tsgp.product_id = ocp.product_id \";\n\t\t\t\t$sql .= \"SET ocpov.price=\". (float)$tso2['price'] . \" \";\n\t\t\t\t$sql .= \"WHERE \";\n\t\t\t\t$sql .= \" ocpov.option_value_id = \" . (int)$tso2['option_value_id'] . \" \";\n\t\t\t\t//$sql .= \" AND \";\n\t\t\t\t//$sql .= \" tsgp.id IS NOT NULL \";\n\t\t\t\t$this->db->query($sql);\n\t\t\t}\n\t\t}\n\t}", "public function addPricesToCollection($response)\n {\n if (isset($response['Book'])) {\n foreach ($response['Book'] as $offer) {\n $offer = (object) $offer;\n $price = $this->createNewPrice();\n if (isset($offer->listingPrice)) {\n if (isset($offer->listingCondition) && strtolower($offer->listingCondition) == 'new book') {\n $price->condition = parent::CONDITION_NEW;\n } elseif (isset($offer->itemCondition)) {\n $price->condition = $this->getConditionFromString($offer->itemCondition);\n }\n if (empty($price->condition)) {\n $price->condition = parent::CONDITION_GOOD;\n }\n $price->isbn13 = $offer->isbn13;\n $price->price = $offer->listingPrice;\n $price->shipping_price = $offer->firstBookShipCost;\n $price->url = 'http://affiliates.abebooks.com/c/74871/77797/2029?u='.urlencode($offer->listingUrl);\n $price->retailer = self::RETAILER;\n $price->term = parent::TERM_PERPETUAL;\n }\n $this->addPriceToCollection($price);\n }\n }\n return $this;\n }", "public function actionUpdateProductBuyBoxPrice()\n {\n $userData = User::find()->andWhere(['IS NOT', 'u_mws_seller_id', null])->all();\n\n foreach ($userData as $user) {\n $productData = FbaAllListingData::find()->andWhere(['created_by' => $user->u_id])->all();\n $skuData = AppliedRepriserRule::find()->select(['arr_sku'])->where(['arr_user_id' => $userData->u_id])->column();\n\n foreach ($productData as $product) {\n $productBuyBox = \\Yii::$app->api->getProductCompetitivePrice($product->seller_sku);\n $product->buybox_price = $productBuyBox;\n\n if(in_array($product->seller_sku, $skuData)) {\n $magicPrice = \\Yii::$app->api->getMagicRepricerPrice($product->seller_sku, $productBuyBox, $product->repricing_min_price, $product->repricing_max_price, $product->repricing_rule_id);\n if($magicPrice) {\n $product->repricing_cost_price = $magicPrice;\n }\n }\n\n if ($product->save(false)) {\n echo $product->asin1 . \" is Updated.\";\n }\n sleep(2);\n }\n sleep(1);\n }\n }", "public function setProductPrice($product_price){\n $this->product_price = $product_price;\n }", "public function __construct(PriceListRepositoryInterface $price_list)\n {\n parent::__construct();\n $this->repository = $price_list;\n $this->repository\n ->pushCriteria(\\Litepie\\Repository\\Criteria\\RequestCriteria::class)\n ->pushCriteria(\\Litecms\\Pricelist\\Repositories\\Criteria\\PriceListResourceCriteria::class);\n }", "public function update($listOfValue);", "public function getAdminList($paramPriceGroupId, $paramTaxPercentage)\r\n {\r\n $pricePlansHTML = '';\r\n $validPriceGroupId = StaticValidator::getValidPositiveInteger($paramPriceGroupId, 0);\r\n $validTaxPercentage = floatval($paramTaxPercentage);\r\n if($this->currencySymbolLocation == 0)\r\n {\r\n $printLeftCurrencySymbol = esc_html(sanitize_text_field($this->currencySymbol)).' ';\r\n $printRightCurrencySymbol = '';\r\n } else\r\n {\r\n $printLeftCurrencySymbol = '';\r\n $printRightCurrencySymbol = ' '.esc_html(sanitize_text_field($this->currencySymbol));\r\n }\r\n\r\n $pricePlanIds = $this->getAllIds($paramPriceGroupId);\r\n foreach($pricePlanIds AS $pricePlanId)\r\n {\r\n $objPricePlan = new PricePlan($this->conf, $this->lang, $this->settings, $pricePlanId);\r\n $pricePlanDetails = $objPricePlan->getDetails();\r\n\r\n if($pricePlanDetails['seasonal_price'] == 0)\r\n {\r\n // Regular prices\r\n $pricePlanEditLink = '<a href=\"'.admin_url('admin.php?page='.$this->conf->getURLPrefix().'add-edit-price-plan&amp;item_id='.$validPriceGroupId.'&amp;price_plan_id='.$pricePlanId).'\">'.$this->lang->getText('NRS_ADMIN_EDIT_TEXT').'</a>';\r\n $pricePlanDeleteLink = '';\r\n } else\r\n {\r\n // Seasonal prices\r\n $pricePlanEditLink = '<a href=\"'.admin_url('admin.php?page='.$this->conf->getURLPrefix().'add-edit-price-plan&amp;price_group_id='.$validPriceGroupId.'&amp;price_plan_id='.$pricePlanId).'\">'.$this->lang->getText('NRS_ADMIN_EDIT_TEXT').'</a>';\r\n $pricePlanDeleteLink = '<a href=\"'.admin_url('admin.php?page='.$this->conf->getURLPrefix().'add-edit-price-plan&amp;noheader=true&amp;delete_price_plan='.$pricePlanId).'\">'.$this->lang->getText('NRS_ADMIN_DELETE_TEXT').'</a>';\r\n }\r\n\r\n $dailyPriceTypeTitle = $this->lang->getText('NRS_PRICE_TEXT').' / '.$this->lang->getText('NRS_PER_DAY_SHORT_TEXT').'<br />';\r\n $hourlyPriceTypeTitle = $this->lang->getText('NRS_PRICE_TEXT').' / '.$this->lang->getText('NRS_PER_HOUR_SHORT_TEXT').'<br />';\r\n if($validTaxPercentage > 0)\r\n {\r\n $dailyPriceTypeTitle .= $this->lang->getText('NRS_PRICE_TEXT').' + '.$this->lang->getText('NRS_TAX_TEXT').' / '.$this->lang->getText('NRS_PER_DAY_SHORT_TEXT');\r\n $hourlyPriceTypeTitle .= $this->lang->getText('NRS_PRICE_TEXT').' + '.$this->lang->getText('NRS_TAX_TEXT').' / '.$this->lang->getText('NRS_PER_HOUR_SHORT_TEXT');\r\n }\r\n\r\n\r\n $dailyPrices = array();\r\n $hourlyPrices = array();\r\n foreach($objPricePlan->getWeekdays() AS $weekDay => $dayName)\r\n {\r\n\r\n $dailyPrice = $printLeftCurrencySymbol.number_format_i18n($pricePlanDetails['daily_rate_'.$weekDay], 2).$printRightCurrencySymbol;\r\n $dailyPrice .= $validTaxPercentage > 0 ? '<br />'.$printLeftCurrencySymbol.number_format_i18n($pricePlanDetails['daily_rate_'.$weekDay]*( 1 + $validTaxPercentage / 100), 2).$printRightCurrencySymbol : '';\r\n $dailyPrices[] = $dailyPrice;\r\n\r\n $hourlyPrice = $printLeftCurrencySymbol.number_format_i18n($pricePlanDetails['hourly_rate_'.$weekDay], 2);\r\n $hourlyPrice .= $validTaxPercentage > 0 ? '<br />'.$printLeftCurrencySymbol.number_format_i18n($pricePlanDetails['hourly_rate_'.$weekDay]*( 1 + $validTaxPercentage / 100), 2).$printRightCurrencySymbol : '';\r\n $hourlyPrices[] = $hourlyPrice;\r\n }\r\n\r\n // HTML OUTPUT: START\r\n $pricePlansHTML .= '<tr class=\"price-plan-heading\">';\r\n $pricePlansHTML .= '<td colspan=\"9\" class=\"price-plan-big-label\">'.$pricePlanDetails['print_label'].'</td>';\r\n $pricePlansHTML .= '</tr>';\r\n $pricePlansHTML .= '<tr>';\r\n $pricePlansHTML .= '<td class=\"price-plan-label\">'.$this->lang->getText('NRS_ADMIN_PRICE_TYPE_TEXT').'</td>';\r\n foreach($objPricePlan->getWeekdays() AS $weekDay => $dayName)\r\n {\r\n $pricePlansHTML .= '<td class=\"price-plan-label\">'.$dayName.'</td>';\r\n }\r\n $pricePlansHTML .= '<td class=\"price-plan-label\">&nbsp;</td>';\r\n $pricePlansHTML .= '</tr>';\r\n\r\n if(in_array($this->priceCalculationType, array(1, 3)))\r\n {\r\n // Price by days\r\n $pricePlansHTML .= '<tr class=\"odd\">';\r\n $pricePlansHTML .= '<td class=\"price-plan-description\">'.$dailyPriceTypeTitle.'</td>';\r\n foreach($dailyPrices AS $dailyPrice)\r\n {\r\n $pricePlansHTML .= '<td class=\"price-plan-label\">'.$dailyPrice.'</td>';\r\n }\r\n $pricePlansHTML .= '<td class=\"price-plan-links\">';\r\n if(in_array($this->priceCalculationType, array(1, 3)))\r\n {\r\n $pricePlansHTML .= '<span class=\"price-plan-link\">'.$pricePlanEditLink.'</span>';\r\n if($pricePlanDeleteLink)\r\n {\r\n $pricePlansHTML .= ' &nbsp;&nbsp;&nbsp;||&nbsp;&nbsp;&nbsp; ';\r\n $pricePlansHTML .= '<span class=\"price-plan-link\">'.$pricePlanDeleteLink.'</span>';\r\n }\r\n } else\r\n {\r\n $pricePlansHTML .= \"&nbsp;\";\r\n }\r\n $pricePlansHTML .= '</td>';\r\n $pricePlansHTML .= '</tr>';\r\n }\r\n\r\n if(in_array($this->priceCalculationType, array(2, 3)))\r\n {\r\n // Price by hours\r\n $pricePlansHTML .= '<tr class=\"even\">';\r\n $pricePlansHTML .= '<td class=\"price-plan-description\">'.$hourlyPriceTypeTitle.'</td>';\r\n foreach($hourlyPrices AS $hourlyPrice)\r\n {\r\n $pricePlansHTML .= '<td class=\"price-plan-label\">'.$hourlyPrice.'</td>';\r\n }\r\n $pricePlansHTML .= '<td class=\"price-plan-links\">';\r\n if($this->priceCalculationType == 2)\r\n {\r\n $pricePlansHTML .= '<span class=\"price-plan-link\">'.$pricePlanEditLink.'</span>';\r\n if($pricePlanDeleteLink)\r\n {\r\n $pricePlansHTML .= ' &nbsp;&nbsp;&nbsp;||&nbsp;&nbsp;&nbsp; ';\r\n $pricePlansHTML .= '<span class=\"price-plan-link\">'.$pricePlanDeleteLink.'</span>';\r\n }\r\n } else\r\n {\r\n $pricePlansHTML .= \"&nbsp;\";\r\n }\r\n $pricePlansHTML .= '</td>';\r\n $pricePlansHTML .= '</tr>';\r\n }\r\n // HTML OUTPUT: END\r\n }\r\n\r\n return $pricePlansHTML;\r\n }", "public static function updateDealProducts($deal_id, $order_data, $deal_info) {\n\t\t$result = false;\n\t\tif (self::checkConnection()) {\n\t\t\t$old_prod_rows = Rest::execute('crm.deal.productrows.get', [\n\t\t\t\t'id' => $deal_id\n\t\t\t]);\n\t\t\t$new_rows = [];\n\t\t\t// Products list of deal\n\t\t\tforeach ($order_data['PRODUCTS'] as $k => $item) {\n\t\t\t\t// Discount\n\t\t\t\t$price = $item['PRICE'];\n\t\t\t\t// Product fields\n\t\t\t\t$deal_prod = [\n\t\t\t\t\t'PRODUCT_NAME' => $item['PRODUCT_NAME'],\n\t\t\t\t\t'QUANTITY' => $item['QUANTITY'],\n\t\t\t\t\t'DISCOUNT_TYPE_ID' => 1,\n\t\t\t\t\t'DISCOUNT_SUM' => $item['DISCOUNT_SUM'],\n\t\t\t\t\t'MEASURE_CODE' => $item['MEASURE_CODE'],\n\t\t\t\t\t'TAX_RATE' => $item['TAX_RATE'],\n\t\t\t\t\t'TAX_INCLUDED' => $item['TAX_INCLUDED'],\n\t\t\t\t];\n\t\t\t\tif ($item['TAX_INCLUDED']) {\n\t\t\t\t\t$deal_prod['PRICE_EXCLUSIVE'] = $price;\n\t\t\t\t\t$deal_prod['PRICE'] = $price + $price * 0.01 * (int)$item['TAX_RATE'];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$deal_prod['PRICE'] = $price;\n\t\t\t\t}\n\t\t\t\t$new_rows[] = $deal_prod;\n\t\t\t}\n//\t\t\t// Delivery\n//\t\t\t$delivery_sync_type = Settings::get('products_delivery');\n//\t\t\tif (!$delivery_sync_type || ($delivery_sync_type == 'notnull' && $order_data['DELIVERY_PRICE'])) {\n//\t\t\t\t$new_rows[] = [\n//\t\t\t\t\t'PRODUCT_ID' => 'delivery',\n//\t\t\t\t\t'PRODUCT_NAME' => Loc::getMessage(\"SP_CI_PRODUCTS_DELIVERY\"),\n//\t\t\t\t\t'PRICE' => $order_data['DELIVERY_PRICE'],\n//\t\t\t\t\t'QUANTITY' => 1,\n//\t\t\t\t];\n//\t\t\t}\n\t\t\t// Check changes\n\t\t\t$new_rows = self::convEncForDeal($new_rows);\n\t\t\t$has_changes = false;\n\t\t\tif (count($new_rows) != count($old_prod_rows)) {\n\t\t\t\t$has_changes = true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tforeach ($new_rows as $j => $row) {\n\t\t\t\t\tforeach ($row as $k => $value) {\n\t\t\t\t\t\tif ($value != $old_prod_rows[$j][$k]) {\n\t\t\t\t\t\t\t$has_changes = true;\n\t\t\t\t\t\t\tcontinue 2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Send request\n\t\t\tif ($has_changes) {\n\t\t\t\t//\\Helper::Log('(updateDealProducts) deal '.$deal_id.' changed products '.print_r($new_rows, true));\n\t\t\t\t$resp = Rest::execute('crm.deal.productrows.set', [\n\t\t\t\t\t'id' => $deal_id,\n\t\t\t\t\t'rows' => $new_rows\n\t\t\t\t]);\n\t\t\t\tif ($resp) {\n\t\t\t\t\t$result = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "public function getPriceList($priceListCode, $responseFields = null)\r\n\t{\r\n\t\t$mozuClient = PriceListClient::getPriceListClient($priceListCode, $responseFields);\r\n\t\t$mozuClient = $mozuClient->withContext($this->apiContext);\r\n\t\t$mozuClient->execute();\r\n\t\treturn $mozuClient->getResult();\r\n\r\n\t}", "function getArticlesByPrice($priceMin=0, $priceMax=0, $usePriceGrossInstead=0, $proofUid=1){\n //first get all real articles, then create objects and check prices\n\t //do not get prices directly from DB because we need to take (price) hooks into account\n\t $table = 'tx_commerce_articles';\n\t $where = '1=1';\n\t if($proofUid){\n\t $where.= ' and tx_commerce_articles.uid_product = '.$this->uid;\n\t }\t\n //todo: put correct constant here\n\t $where.= ' and article_type_uid=1';\n\t $where.= $this->cObj->enableFields($table);\n\t $groupBy = '';\n\t $orderBy = 'sorting';\n\t $limit = '';\n\t $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery (\n\t 'uid', $table,\n\t $where, $groupBy,\n\t $orderBy,$limit\n\t );\n\t $rawArticleUidList = array();\n\t while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n\t $rawArticleUidList[] = $row['uid'];\n\t }\n\t $GLOBALS['TYPO3_DB']->sql_free_result($res);\n\t \n\t //now run the price test\n\t $articleUidList = array();\n\t foreach ($rawArticleUidList as $rawArticleUid) {\n\t\t $tmpArticle = new tx_commerce_article($rawArticleUid,$this->lang_uid);\n\t\t $tmpArticle->load_data();\n\t\t\t $myPrice = $usePriceGrossInstead ? $tmpArticle->get_price_gross() : $tmpArticle->get_price_net();\n\t\t\t if (($priceMin <= $myPrice) && ($myPrice <= $priceMax)) {\n\t\t\t $articleUidList[] = $tmpArticle->get_uid();\n\t\t\t }\n\t\t }\n if(count($articleUidList)>0){\n return $articleUidList;\n }else{\n return false;\n\t }\n\t}", "public function store(Request $request)\n {\n // return json_decode($request->pricelist_items);\n $pricelist = $this->pricelist->create($request->except('pricelist_items'));\n $priceListItems = [];\n $requestPricelistItems = json_decode($request->pricelist_items);\n foreach ( $requestPricelistItems as $pricelistItem) {\n array_push($priceListItems, [\n 'price_list_id' => $pricelist->id,\n 'waste_id' => $pricelistItem->waste_id,\n 'unit_id' => $pricelistItem->unit_id,\n 'unit_price' => $pricelistItem->unit_price\n ]);\n }\n $pricelist->wastes()->attach($priceListItems);\n return redirect()->route('settings.pricelists')\n ->with('success', 'Pricelist has been created!');\n }", "public function scalePrices($product)\n {\n \n // Get the configurable Id\n $configurableId = $this->getConfigurableId($product);\n \n // Check we actually have a configurable product\n if ($configurableId > 0)\n {\n // Get the configurable product and associated base price\n // Please note the price will not be the actual configurable, price but the cheapest price from all the simple products\n $configurableProduct = Mage::getSingleton(\"catalog/Product\")->load($configurableId);\n $configurablePrice = $configurableProduct->getPrice();\n \n // Get current attribute data\n $configurableAttributesData = $configurableProduct->getTypeInstance()->getConfigurableAttributesAsArray();\n $configurableProductsData = array();\n \n // We need to identify the attribute name and Id\n $prodAttrName = $this->getAttributeName($configurableProduct);\n $prodAttrId = $this->getAttributeId($prodAttrName);\n \n // Get associates simple products\n $associatedProducts = $configurableProduct->getTypeInstance()->getUsedProducts();\n foreach ($associatedProducts as $prodList)\n {\n // For each associated simple product gather the data and calculate the extra fixed price\n $prodId = $prodList->getId();\n $prodAttrLabel = $prodList->getAttributeText($prodAttrName);\n $prodAttrValueIndex = $prodList[$prodAttrName];\n $prodScalePrice = $prodList['price'] - $configurablePrice;\n \n $productData = array(\n 'label' => $prodAttrLabel,\n 'attribute_id' => $prodAttrId,\n 'value_index' => $prodAttrValueIndex,\n 'pricing_value' => $prodScalePrice,\n 'is_percent' => '0'\n );\n $configurableProductsData[$prodId] = $productData;\n $configurableAttributesData[0]['values'][] = $productData;\n }\n \n $configurableProduct->setConfigurableProductsData($configurableProductsData);\n $configurableProduct->setConfigurableAttributesData($configurableAttributesData);\n $configurableProduct->setCanSaveConfigurableAttributes(true);\n Mage::log($configurableProductsData, null, 'configurableProductsData.log', true);\n Mage::log($configurableAttributesData, null, 'configurableAttributesData.log', true);\n \n try\n {\n $configurableProduct->save(); \n }\n catch (Exception $e)\n {\n $this->_debug($e->getMessage());\n }\n \n } \n }", "public function productPriceSetMeta( $thisProd, $post_id='', $return=true ) {\n\t\t\t$ret = array();\n\t\t\t$o = array(\n\t\t\t\t'ItemAttributes'\t\t=> isset($thisProd['ItemAttributes']['ListPrice']) ? array('ListPrice' => $thisProd['ItemAttributes']['ListPrice']) : array(),\n\t\t\t\t'Offers'\t\t\t\t=> isset($thisProd['Offers']) ? $thisProd['Offers'] : array(),\n\t\t\t\t'OfferSummary'\t\t\t=> isset($thisProd['OfferSummary']) ? $thisProd['OfferSummary'] : array(),\n\t\t\t\t'VariationSummary'\t\t=> isset($thisProd['VariationSummary']) ? $thisProd['VariationSummary'] : array(),\n\t\t\t);\n\t\t\tupdate_post_meta($post_id, '_amzaff_amzRespPrice', $o);\n\t\t\t\n\t\t\t// Offers/Offer/OfferListing/IsEligibleForSuperSaverShipping\n\t\t\tif ( isset($o['Offers']['Offer']['OfferListing']['IsEligibleForSuperSaverShipping']) ) {\n\t\t\t\t$ret['isSuperSaverShipping'] = $o['Offers']['Offer']['OfferListing']['IsEligibleForSuperSaverShipping'] === true ? 1 : 0;\n\t\t\t\tupdate_post_meta($post_id, '_amzaff_isSuperSaverShipping', $ret['isSuperSaverShipping']);\n\t\t\t}\n\t\t\t\n\t\t\t// Offers/Offer/OfferListing/Availability\n\t\t\tif ( isset($o['Offers']['Offer']['OfferListing']['Availability']) ) {\n\t\t\t\t$ret['availability'] = (string) $o['Offers']['Offer']['OfferListing']['Availability'];\n\t\t\t\tupdate_post_meta($post_id, '_amzaff_availability', $ret['availability']);\n\t\t\t}\n\t\t\t\n\t\t\treturn $ret;\n\t\t}", "public function buildArticleList(Mage_Sales_Model_Abstract $entity, $context)\n {\n if ($context == self::TYPE_PI) {\n return array();\n }\n // collection adjustment fees is not supported by billsafe\n if (self::TYPE_RF == $context && $entity->getAdjustmentNegative()) {\n throw new Mage_Core_Exception($this->getHelper()->__(\n 'Add adjustment fees is not supported by BillSAFE'\n ));\n }\n\n $order = $entity;\n if (in_array($context, array(self::TYPE_RS, self::TYPE_RF))) {\n $order = $entity->getOrder();\n }\n\n $data = array();\n $items = $this->getAllOrderItems($entity, $order, $context);\n\n $remainShipItemQty = $this->getRemainingShipmentItemQty(\n $order, $context\n );\n\n\n\n $taxAmount = 0;\n $amount = 0;\n $paymentFeeItem = null;\n // order items\n $orderItemData = $this->getOrderItemData(\n $items, $amount, $taxAmount, $context\n );\n\n /*\n * append any virtual products to the last shipping, so that the billsafe state is changed correctly\n *\n */\n if (($context == self::TYPE_RS && $this->areAllPhysicalItemsShipped($order))\n || $context == self::TYPE_VO || $context == self::TYPE_VO) {\n $amount = $orderItemData['amount'];\n $taxAmount = $orderItemData['tax_amount'];\n $virtualItemData = $this->getVirtualItemData($order, $amount, $taxAmount, $context);\n if (0 < count($virtualItemData['data'])) {\n $orderItemData['data'] = array_merge($orderItemData['data'], $virtualItemData['data']);\n $orderItemData['amount'] = $virtualItemData['amount'];\n $orderItemData['tax_amount'] = $virtualItemData['tax_amount'];\n }\n }\n\n if (0 < count($orderItemData)) {\n if (array_key_exists('payment_fee_item', $orderItemData)) {\n $paymentFeeItem = $orderItemData['payment_fee_item'];\n }\n if (array_key_exists('data', $orderItemData)) {\n $data = $orderItemData['data'];\n }\n if (array_key_exists('amount', $orderItemData)) {\n $amount = $orderItemData['amount'];\n }\n if (array_key_exists('tax_amount', $orderItemData)) {\n $taxAmount = $orderItemData['tax_amount'];\n }\n }\n //shipping item data\n $shippingItemData = $this->getShippingItemData($order, $context);\n if (0 < count($shippingItemData)) {\n $data[] = $shippingItemData;\n $amountExclTax\n = $order->getShippingAmount() - $order->getShippingRefunded();\n $amount += round(\n $amountExclTax * (1 +\n $this->getShippingTaxPercent($order) / 100)\n );\n $taxAmount += round($amount - $amountExclTax, 2);\n }\n // discount item\n $discountItemData = $this->getDiscountItemData($order, $context);\n if (0 < count($discountItemData)) {\n $data[] = $discountItemData;\n $amount -= $order->getDiscountAmount();\n }\n // adjustment (refund)\n $adjustmentData = $this->getAdjustmentData($order, $context, $amount);\n if (0 < count($adjustmentData)) {\n if (array_key_exists('data', $adjustmentData)) {\n $data[] = $adjustmentData['data'];\n }\n if (array_key_exists('amount', $adjustmentData)) {\n $amount = $adjustmentData['amount'];\n }\n }\n\n // payment fee\n $paymentFeeData = $this->getPaymentFeeData(\n $paymentFeeItem, $context, $amount, $taxAmount\n );\n if (0 < count($paymentFeeData)) {\n if (array_key_exists('data', $paymentFeeData)) {\n $data[] = $paymentFeeData['data'];\n }\n if (array_key_exists('amount', $paymentFeeData)) {\n $amount = $paymentFeeData['amount'];\n }\n if (array_key_exists('tax_amount', $paymentFeeData)) {\n $taxAmount = $paymentFeeData['tax_amount'];\n }\n }\n // special refund\n if (self::TYPE_RF == $context) {\n $data['tax_amount'] = $taxAmount;\n $data['amount'] = $amount;\n }\n return $data;\n }", "public function setPriceListInfo(\\Diadoc\\Api\\Proto\\Docflow\\PriceListDocumentInfo $value=null)\n {\n return $this->set(self::PRICELISTINFO, $value);\n }", "public function cleanProductsInCatalogPriceRule(Varien_Event_Observer $observer) {\n /**\n * @var $engine Brim_PageCache_Model_Engine\n * @var $rule Mage_CatalogRule_Model_Rule\n */\n\n $engine = Mage::getSingleton('brim_pagecache/engine');\n\n if (!$engine->isEnabled()) {\n return;\n }\n\n $engine->devDebug(__METHOD__);\n\n $tags = array();\n $rule = $observer->getEvent()->getRule();\n foreach ($rule->getMatchingProductIds() as $productId) {\n $tags[] = Brim_PageCache_Model_Engine::FPC_TAG . '_PRODUCT_' . $productId;\n }\n $engine->devDebug($tags);\n Mage::app()->getCacheInstance()->clean($tags);\n }", "public function getPriceList() {\n\t\tif( count($this->prices) > 0 ) {\n\t\t\tthrow new \\InvalidArgumentException(sprintf('The name \"%s\" is invalid.', $name));\n\t\t}\n\t\treturn $this->prices;\n\t}", "public function run()\n {\n ProductPrice::insert(\n \t[\n \t[\"product_id\" => 1,\n \t \"description\" => \"economical\",\n \t \"price\" => 10000\n \t],\n \t[\"product_id\" => 1,\n \t \"description\" => \"default\",\n \t \"price\" => 100000\n \t],\n \t[\"product_id\" => 1,\n \t \"description\" => \"plus\",\n \t \"price\" => 1000000\n \t],\n \t[\"product_id\" => 2,\n \t \"description\" => \"economical\",\n \t \"price\" => 10000\n \t],\n \t[\"product_id\" => 2,\n \t \"description\" => \"default\",\n \t \"price\" => 100000\n \t],\n \t[\"product_id\" => 2,\n \t \"description\" => \"plus\",\n \t \"price\" => 1000000\n \t],\n \t[\"product_id\" => 3,\n \t \"description\" => \"economical\",\n \t \"price\" => 10000\n \t],\n \t[\"product_id\" => 3,\n \t \"description\" => \"default\",\n \t \"price\" => 100000\n \t],\n \t[\"product_id\" => 3,\n \t \"description\" => \"plus\",\n \t \"price\" => 1000000\n \t],\n \t[\"product_id\" => 4,\n \t \"description\" => \"economical\",\n \t \"price\" => 10000\n \t],\n \t[\"product_id\" => 4,\n \t \"description\" => \"default\",\n \t \"price\" => 100000\n \t],\n \t[\"product_id\" => 4,\n \t \"description\" => \"plus\",\n \t \"price\" => 1000000\n \t],\n \t[\"product_id\" => 5,\n \t \"description\" => \"economical\",\n \t \"price\" => 10000\n \t],\n \t[\"product_id\" => 5,\n \t \"description\" => \"default\",\n \t \"price\" => 100000\n \t],\n \t[\"product_id\" => 5,\n \t \"description\" => \"plus\",\n \t \"price\" => 1000000\n \t]\n \t]);\n }", "private function validatePrice(array $price)\n {\n if (empty($price) || empty($price['product_id']) || !isset($price['custom_price'])\n || !isset($price['price_type']) || !isset($price['website_id'])\n ) {\n return false;\n }\n\n $customPrices = $this->getStorage()->getProductPrices($price['product_id']);\n if (!$this->productItemTierPriceValidator->canChangePrice($customPrices, $price['website_id'])) {\n return false;\n }\n\n return true;\n }", "protected function AddPriceRangeToFilterList($AllPriceArray, $PriceColumnName){\n\t\n\t\t$AmountBreakPoints\t= array(\n\t\t\t\t100 \t=> 2,\n\t\t\t\t300 \t=> 3,\n\t\t\t\t600 \t=> 3,\n\t\t\t\t900 \t=> 3,\n\t\t\t\t1200 \t=> 4,\n\t\t\t\t1600 \t=> 4\n\t\t);\n\t\n\t\t$uniquePriceNumber = count($AllPriceArray);\n\t\n\t\tif( $uniquePriceNumber <= 1) return false;\n\t\n\t\t//sort the price array - hight -> low\n\t\tkrsort($AllPriceArray);\n\t\n\t\t$MaxPrice = floatval(key($AllPriceArray));\n\t\n\t\t//calculate and define the price range groups number\n\t\t$GroupNumber \t= 2;\n\t\t$RangeMax\t\t= -1;\n\t\t$RangeMin\t\t= 0;\n\t\tforeach ($AmountBreakPoints as $CurrentAmount => $gaps){\n\t\t\tif($MaxPrice < $CurrentAmount){\n\t\t\t\t$RangeMax \t\t= $CurrentAmount;\n\t\t\t\t$GroupNumber \t= $gaps;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\n\t\t//out of range, then set the highest amount of $AmountBreakPoints\n\t\tif($RangeMax < 0){\n\t\t\t$RangeMax \t\t= key(krsort($AllPriceArray));\n\t\t\t$GroupNumber\t= $AmountBreakPoints[$RangeMax];\n\t\t}\n\t\n\t\t//create all ranges and save them into $optionsArray\n\t\t$optionsArray = array();\n\t\t// Sample ------\n\t\t// \t\t$optionsArray = array(\n\t\t// \t\t\t0 => array(\n\t\t//\t\t\t\t\t'OptionProductCount' \t=> 1,\n\t\t//\t\t\t\t\t'Price' \t\t\t\t=> 1,\n\t\t//\t\t\t\t\t'StartPrice' \t\t\t=> '10.0000',\n\t\t//\t\t\t\t\t'EndPrice' \t\t\t\t=> '20.0000'\n\t\t// \t\t\t\t),\n\t\t// \t\t\t1 => array(\n\t\t//\t\t\t\t\t'OptionProductCount' => 1\n\t\t//\t\t\t\t\t'OptionProductCount' \t=> 1,\n\t\t//\t\t\t\t\t'Price' \t\t\t\t=> 1,\n\t\t//\t\t\t\t\t'StartPrice' \t\t\t=> '20.0000',\n\t\t//\t\t\t\t\t'EndPrice' \t\t\t\t=> '30.0000'\n\t\t// \t\t\t)\n\t\t// \t\t);\n\t\n\t\t$i = 1;\n\t\t$Interval \t\t= ($RangeMax / $GroupNumber);\n\t\t$startAmount\t= 0;\n\t\t$endAmount\t\t= 0;\n\t\n\t\twhile ($i <= $GroupNumber){\n\t\t\t$startAmount\t= $Interval * ($i - 1);\n\t\t\t$endAmount\t\t= $Interval * $i;\n\t\n\t\t\t$priceArray = array();\n\t\n\t\t\t$productCount = 0;\n\t\n\t\t\tforeach ($AllPriceArray as $amount => $pCount){\n\t\t\t\tif($startAmount <= $amount && $amount < $endAmount){\n\t\t\t\t\t$productCount += $pCount;\n\t\t\t\t\tunset($AllPriceArray[$amount]);\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t$priceArray['OptionProductCount'] = $productCount;\n\t\t\t$priceArray['StartAmount'] \t= $startAmount;\n\t\t\t$priceArray['EndAmount'] \t= $endAmount;\n\t\n\t\t\t$optionsArray[] = $priceArray;\n\t\n\t\t\t$i++;\n\t\t}\n\t\t\n\t\t$title = Config::inst()->get($this->ClassName, 'FilterTitle');\n\t\t$title = $title ? $title : 'Price';\n\t\t\n\t\treturn array($title => $optionsArray);\n\t}", "private function updateQuoteItemPrices(CartInterface $quote)\n {\n $negotiableQuote = $quote->getExtensionAttributes()->getNegotiableQuote();\n $quoteId = $quote->getId();\n if (!in_array($quoteId, $this->updatedQuoteIds)) {\n $this->updatedQuoteIds[] = $quoteId;\n if ($negotiableQuote->getNegotiatedPriceValue() === null) {\n $this->quoteItemManagement->recalculateOriginalPriceTax($quote->getId(), true, true, false, false);\n } else {\n $this->quoteItemManagement->updateQuoteItemsCustomPrices($quote->getId(), false);\n }\n }\n }" ]
[ "0.80534816", "0.7952984", "0.7765074", "0.690995", "0.6181764", "0.594303", "0.59004945", "0.5870128", "0.57718617", "0.56299037", "0.5404034", "0.53822976", "0.5303255", "0.5289086", "0.52537", "0.5225113", "0.5182147", "0.50484776", "0.50363904", "0.50108063", "0.4999216", "0.49949336", "0.49890825", "0.49513867", "0.49177074", "0.49171355", "0.48833734", "0.48533088", "0.48498088", "0.48408565", "0.48181376", "0.48144153", "0.48068446", "0.4796411", "0.47637698", "0.47498852", "0.47395712", "0.4737924", "0.47376826", "0.47218063", "0.4708601", "0.47043645", "0.46949595", "0.46871388", "0.46769544", "0.4675729", "0.4670371", "0.4665369", "0.46614227", "0.46518874", "0.4642176", "0.46369767", "0.4632879", "0.4630324", "0.46198544", "0.46049663", "0.45943087", "0.45920923", "0.45601553", "0.45458347", "0.45439598", "0.4543227", "0.4538495", "0.44984776", "0.4493887", "0.44916296", "0.44883323", "0.4482669", "0.44820422", "0.44753847", "0.4471716", "0.44709012", "0.44692326", "0.446453", "0.44622302", "0.44550434", "0.44540542", "0.4448889", "0.44466352", "0.44258723", "0.4412573", "0.44041446", "0.43984115", "0.43927166", "0.4389308", "0.43796268", "0.4376392", "0.4373304", "0.43701208", "0.436323", "0.43609792", "0.43542147", "0.43516493", "0.43417057", "0.43262374", "0.4322872", "0.43221787", "0.43188715", "0.4318157", "0.43178406" ]
0.78454113
2
Specification: Publish price list prices for product abstracts. Uses the given fkPriceList of the `fos_price_product_price_list` table. Merges created or updated prices to the existing ones.
public function publishConcretePriceProductPriceListByIdPriceList(int $idPriceList): void;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function publishAbstractPriceProductPriceList(array $priceProductPriceListIds): void;", "public function publishConcretePriceProductPriceList(array $priceProductPriceListIds): void;", "public function publishAbstractPriceProductPriceListByIdPriceList(int $idPriceList): void;", "public function updatePrices($contractId, $priceList);", "public function setListPrice(float $listPrice)\n\t{\n\t\t$this->addKeyValue('list_price', $listPrice); \n\n\t}", "public function publishAbstractPriceProductByByProductAbstractIds(array $productAbstractIds): void;", "protected function putProductsVariantsPricelistPriceRequest($body, $product_id, $variant_id, $pricelist_id)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling putProductsVariantsPricelistPrice'\n );\n }\n // verify the required parameter 'product_id' is set\n if ($product_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $product_id when calling putProductsVariantsPricelistPrice'\n );\n }\n if ($product_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$product_id\" when calling DefaultApi.putProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'variant_id' is set\n if ($variant_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $variant_id when calling putProductsVariantsPricelistPrice'\n );\n }\n if ($variant_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$variant_id\" when calling DefaultApi.putProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'pricelist_id' is set\n if ($pricelist_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pricelist_id when calling putProductsVariantsPricelistPrice'\n );\n }\n if ($pricelist_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$pricelist_id\" when calling DefaultApi.putProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n $resourcePath = '/products/{productId}/variants/{variantId}/prices/{pricelistId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($product_id !== null) {\n $resourcePath = str_replace(\n '{' . 'productId' . '}',\n ObjectSerializer::toPathValue($product_id),\n $resourcePath\n );\n }\n // path params\n if ($variant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'variantId' . '}',\n ObjectSerializer::toPathValue($variant_id),\n $resourcePath\n );\n }\n // path params\n if ($pricelist_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pricelistId' . '}',\n ObjectSerializer::toPathValue($pricelist_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n \n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function patchProductsVariantsPricelistPriceRequest($body, $product_id, $variant_id, $pricelist_id)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling patchProductsVariantsPricelistPrice'\n );\n }\n // verify the required parameter 'product_id' is set\n if ($product_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $product_id when calling patchProductsVariantsPricelistPrice'\n );\n }\n if ($product_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$product_id\" when calling DefaultApi.patchProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'variant_id' is set\n if ($variant_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $variant_id when calling patchProductsVariantsPricelistPrice'\n );\n }\n if ($variant_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$variant_id\" when calling DefaultApi.patchProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'pricelist_id' is set\n if ($pricelist_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pricelist_id when calling patchProductsVariantsPricelistPrice'\n );\n }\n if ($pricelist_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$pricelist_id\" when calling DefaultApi.patchProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n $resourcePath = '/products/{productId}/variants/{variantId}/prices/{pricelistId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($product_id !== null) {\n $resourcePath = str_replace(\n '{' . 'productId' . '}',\n ObjectSerializer::toPathValue($product_id),\n $resourcePath\n );\n }\n // path params\n if ($variant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'variantId' . '}',\n ObjectSerializer::toPathValue($variant_id),\n $resourcePath\n );\n }\n // path params\n if ($pricelist_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pricelistId' . '}',\n ObjectSerializer::toPathValue($pricelist_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n \n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PATCH',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getPriceByListWithEcotax( PriceList $list = null )\n {\n // Return Price Object\n $price = $this->getPriceByList( $list );\n\n // Add Ecotax\n if ( Configuration::isTrue('ENABLE_ECOTAXES') && $this->ecotax )\n {\n // Template: $price = [ price, price_tax_inc, price_is_tax_inc ]\n// $ecoprice = Price::create([\n// $this->getEcotax(), \n// $this->getEcotax()*(1.0+$price->tax_percent/100.0), \n// $price->price_tax_inc\n// ]);\n\n $price->add( $this->getEcotax() ); \n }\n\n return $price;\n }", "public function publishConcretePriceProductByProductIds(array $productIds): void;", "public function updateprices()\n {\n\n $aParams = oxRegistry::getConfig()->getRequestParameter(\"updateval\");\n if (is_array($aParams)) {\n foreach ($aParams as $soxId => $aStockParams) {\n $this->addprice($soxId, $aStockParams);\n }\n }\n }", "public function api_update_price(){\n $watchlists = $this->wr->all();\n foreach($watchlists as $watchlist)\n {\n $current_price = $this->get_quotes($watchlist->id);\n\n $this->wr->update([\n 'current_price' => $current_price,\n ],$watchlist->id);\n }\n }", "protected function deleteProductsVariantsPricelistPriceRequest($product_id, $variant_id, $pricelist_id)\n {\n // verify the required parameter 'product_id' is set\n if ($product_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $product_id when calling deleteProductsVariantsPricelistPrice'\n );\n }\n if ($product_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$product_id\" when calling DefaultApi.deleteProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'variant_id' is set\n if ($variant_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $variant_id when calling deleteProductsVariantsPricelistPrice'\n );\n }\n if ($variant_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$variant_id\" when calling DefaultApi.deleteProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'pricelist_id' is set\n if ($pricelist_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pricelist_id when calling deleteProductsVariantsPricelistPrice'\n );\n }\n if ($pricelist_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$pricelist_id\" when calling DefaultApi.deleteProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n $resourcePath = '/products/{productId}/variants/{variantId}/prices/{pricelistId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($product_id !== null) {\n $resourcePath = str_replace(\n '{' . 'productId' . '}',\n ObjectSerializer::toPathValue($product_id),\n $resourcePath\n );\n }\n // path params\n if ($variant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'variantId' . '}',\n ObjectSerializer::toPathValue($variant_id),\n $resourcePath\n );\n }\n // path params\n if ($pricelist_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pricelistId' . '}',\n ObjectSerializer::toPathValue($pricelist_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n \n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function getProductsVariantsPricelistPriceRequest($product_id, $variant_id, $pricelist_id)\n {\n // verify the required parameter 'product_id' is set\n if ($product_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $product_id when calling getProductsVariantsPricelistPrice'\n );\n }\n if ($product_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$product_id\" when calling DefaultApi.getProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'variant_id' is set\n if ($variant_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $variant_id when calling getProductsVariantsPricelistPrice'\n );\n }\n if ($variant_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$variant_id\" when calling DefaultApi.getProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'pricelist_id' is set\n if ($pricelist_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pricelist_id when calling getProductsVariantsPricelistPrice'\n );\n }\n if ($pricelist_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$pricelist_id\" when calling DefaultApi.getProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n $resourcePath = '/products/{productId}/variants/{variantId}/prices/{pricelistId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($product_id !== null) {\n $resourcePath = str_replace(\n '{' . 'productId' . '}',\n ObjectSerializer::toPathValue($product_id),\n $resourcePath\n );\n }\n // path params\n if ($variant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'variantId' . '}',\n ObjectSerializer::toPathValue($variant_id),\n $resourcePath\n );\n }\n // path params\n if ($pricelist_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pricelistId' . '}',\n ObjectSerializer::toPathValue($pricelist_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n \n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function processOperations(\\Magento\\AsynchronousOperations\\Api\\Data\\OperationListInterface $operationList)\n {\n $pricesUpdateDto = [];\n $pricesDeleteDto = [];\n $operationSkus = [];\n foreach ($operationList->getItems() as $index => $operation) {\n $serializedData = $operation->getSerializedData();\n $unserializedData = $this->serializer->unserialize($serializedData);\n $operationSkus[$index] = $unserializedData['product_sku'];\n $pricesUpdateDto = array_merge(\n $pricesUpdateDto,\n $this->priceProcessor->createPricesUpdate($unserializedData)\n );\n $pricesDeleteDto = array_merge(\n $pricesDeleteDto,\n $this->priceProcessor->createPricesDelete($unserializedData)\n );\n }\n\n $failedDeleteItems = [];\n $failedUpdateItems = [];\n $uncompletedOperations = [];\n try {\n $failedDeleteItems = $this->tierPriceStorage->delete($pricesDeleteDto);\n $failedUpdateItems = $this->tierPriceStorage->update($pricesUpdateDto);\n } catch (\\Magento\\Framework\\Exception\\CouldNotSaveException $e) {\n $uncompletedOperations['status'] = OperationInterface::STATUS_TYPE_RETRIABLY_FAILED;\n $uncompletedOperations['error_code'] = $e->getCode();\n $uncompletedOperations['message'] = $e->getMessage();\n } catch (\\Magento\\Framework\\Exception\\CouldNotDeleteException $e) {\n $uncompletedOperations['status'] = OperationInterface::STATUS_TYPE_RETRIABLY_FAILED;\n $uncompletedOperations['error_code'] = $e->getCode();\n $uncompletedOperations['message'] = $e->getMessage();\n } catch (\\Exception $e) {\n $uncompletedOperations['status'] = OperationInterface::STATUS_TYPE_RETRIABLY_FAILED;\n $uncompletedOperations['error_code'] = $e->getCode();\n $uncompletedOperations['message'] =\n __('Sorry, something went wrong during product prices update. Please see log for details.');\n }\n\n $failedItems = array_merge($failedDeleteItems, $failedUpdateItems);\n $failedOperations = [];\n foreach ($failedItems as $failedItem) {\n if (isset($failedItem->getParameters()['SKU'])) {\n $failedOperations[$failedItem->getParameters()['SKU']] = $this->priceProcessor->prepareErrorMessage(\n $failedItem\n );\n }\n }\n\n try {\n $this->changeOperationStatus($operationList, $failedOperations, $uncompletedOperations, $operationSkus);\n } catch (\\Exception $exception) {\n // prevent consumer from failing, silently log exception\n $this->logger->critical($exception->getMessage());\n }\n }", "public function execute(ProductListTransfer $productListTransfer): void;", "public function saved(Price $price)\n {\n PriceItem::where('price_id', $price->id)->delete();\n\n $productId = request()->input('product_id');\n\n foreach (request()->input('prices', []) as $priceInput) {\n $priceCategoryAttributes = [\n 'product_id' => $productId,\n ];\n\n foreach (config('app.locales') as $lang => $locale) {\n $priceCategoryAttributes[\"title_{$lang}\"] = $priceInput['category'][$lang];\n }\n\n $priceCategory = PriceCategory::firstOrCreate($priceCategoryAttributes);\n\n $priceItemAttributes = [\n 'price_id' => $price->id,\n 'price_category_id' => $priceCategory->id,\n ];\n foreach ($priceInput['items'] as $item) {\n $priceItemAttributes['price'] = $item['price'];\n $priceItemAttributes['date_start'] = $item['date_start'];\n $priceItemAttributes['date_end'] = $item['date_end'];\n\n foreach (config('app.locales') as $lang => $locale) {\n $priceItemAttributes[\"title_{$lang}\"] = $item['title'][$lang];\n }\n }\n\n PriceItem::create($priceItemAttributes);\n }\n }", "public function addShippingPrice($productID, $shippingPriceList){\n\n global $db;\n\n if(!is_numeric($productID) || !is_array($shippingPriceList) || count($shippingPriceList) < 1){\n return;\n }\n\n foreach($shippingPriceList as $shippingPrice){\n $param = ['productID' => $productID, 'locationID' => $shippingPrice['locationID'], 'price' => fn_buckys_get_btc_price_formated($shippingPrice['price']),];\n\n $db->insertFromArray(TABLE_SHOP_SHIPPING_PRICE, $param);\n\n }\n\n }", "public function setProductList($obProductList)\n {\n $this->obProductList = $obProductList;\n }", "public function __construct(PriceList $price_list = null)\n {\n $this->price_list = $price_list;\n }", "function addListPrice($request) {\n\t\t$sourceModule = $request->getModule();\n\t\t$sourceRecordId = $request->get('src_record');\n\t\t$relatedModule = $request->get('related_module');\n\t\t$relInfos = $request->get('relinfo');\n\n\t\t$sourceModuleModel = Vtiger_Module_Model::getInstance($sourceModule);\n\t\t$relatedModuleModel = Vtiger_Module_Model::getInstance($relatedModule);\n\t\t$relationModel = Vtiger_Relation_Model::getInstance($sourceModuleModel, $relatedModuleModel);\n\t\tforeach($relInfos as $relInfo) {\n\t\t\t$price = CurrencyField::convertToDBFormat($relInfo['price'], null, true);\n\t\t\t$relationModel->addListPrice($sourceRecordId, $relInfo['id'], $price);\n\t\t}\n\t}", "public function gETPriceIdPriceListRequest($price_id)\n {\n // verify the required parameter 'price_id' is set\n if ($price_id === null || (is_array($price_id) && count($price_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $price_id when calling gETPriceIdPriceList'\n );\n }\n\n $resourcePath = '/prices/{priceId}/price_list';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($price_id !== null) {\n $resourcePath = str_replace(\n '{' . 'priceId' . '}',\n ObjectSerializer::toPathValue($price_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function editPrices() {\n\t\tglobal $HTML;\n\t\tglobal $page;\n\t\tglobal $id;\n\t\t$HTML->details(1);\n\n\t\t$this->getPrices();\n\n\t\t$price_groups = $this->priceGroupClass->getItems();\n\t\t$countries = $this->countryClass->getItems();\n\n\t\t$_ = '';\n\t\t$_ .= '<div class=\"c init:form form:action:'.$page->url.'\" id=\"container:prices\">';\n\t\t$_ .= '<div class=\"c\">';\n\n\t\t$_ .= $HTML->inputHidden(\"id\", $id);\n\t\t$_ .= $HTML->inputHidden(\"item_id\", $id);\n\n\t\t$_ .= $HTML->head(\"Prices\", \"2\");\n\n\t\tif(Session::getLogin()->validatePage(\"prices_update\")) {\n\t\t\t$_ .= $HTML->inputHidden(\"page_status\", \"prices_update\");\n\t\t}\n\n\t\tif($this->item() && count($this->item[\"id\"]) == 1) {\n\n\t\t\tforeach($countries[\"id\"] as $country_key => $country_id) {\n\n\t\t\t\t$_ .= '<div class=\"ci33\">';\n\n\t\t\t\t\t$_ .= $HTML->head($countries[\"values\"][$country_key], 3);\n\n\t\t\t\t\tforeach($price_groups[\"uid\"] as $index => $price_group_uid) {\n\t\t\t\t\t\t$price = ($this->item[\"price\"][0] && isset($this->item[\"price\"][0][$country_id][$price_group_uid])) ? $this->item[\"price\"][0][$country_id][$price_group_uid] : \"\";\n\t\t\t\t\t\t$_ .= $HTML->input($price_groups[\"values\"][$index], \"prices[$country_id][$price_group_uid]\", $price);\n\t\t\t\t\t}\n\n\t\t\t\t\t$_ .= $HTML->separator();\n\t\t\t\t$_ .= '</div>';\n\n\t\t\t}\n\t\t}\n\n\t\t$_ .= '</div>';\n\n\t\t$_ .= $HTML->smartButton($this->translate(\"Cancel\"), false, \"prices_cancel\", \"fleft key:esc\");\n\t\t$_ .= $HTML->smartButton($this->translate(\"Save\"), false, \"prices_update\", \"fright key:s\");\n\n\t\t$_ .= '</div>';\n\n\t\treturn $_;\n\t}", "public function getOnSaleProducts_List (array $listOptions = array()) {\n // global $app;\n // $options['sort'] = 'shop_products.DateUpdated';\n // $options['order'] = 'DESC';\n // $options['_fshop_products.Status'] = join(',', dbquery::getProductStatusesWhenAvailable()) . ':IN';\n // $options['_fshop_products.Price'] = 'PrevPrice:>';\n // $options['_fshop_products.Status'] = 'DISCOUNT';\n // $config = dbquery::shopGetProductList_NewItems($options);\n // if (empty($config))\n // return null;\n // $self = $this;\n // $callbacks = array(\n // \"parse\" => function ($items) use($self) {\n // $_items = array();\n // foreach ($items as $key => $orderRawItem) {\n // $_items[] = $self->getProductByID($orderRawItem['ID']);\n // }\n // return $_items;\n // }\n // );\n // $dataList = $app->getDB()->getDataList($config, $options, $callbacks);\n // return $dataList;\n\n\n $self = $this;\n $params = array();\n $params['list'] = $listOptions;\n $params['callbacks'] = array(\n 'parse' => function ($dbRawItem) use ($self) {\n return $self->getProductByID($dbRawItem['ID']);\n }\n );\n\n return dbquery::fetchOnSaleProducts_List($params);\n }", "public function edit(PriceListRequest $request, PriceList $price_list)\n {\n return $this->response->title(trans('app.edit') . ' ' . trans('pricelist::price_list.name'))\n ->view('pricelist::price_list.edit', true)\n ->data(compact('price_list'))\n ->output();\n }", "public function priceLists()\n {\n return $this->hasOne('App\\Models\\PriceList');\n }", "public function test_comicEntityIsCreated_prices_setPrices()\n {\n $sut = $this->getSUT();\n $prices = $sut->getPrices();\n $expected = [\n Price::create(\n 'printPrice',\n 19.99\n ),\n ];\n\n $this->assertEquals($expected, $prices);\n }", "function updateRetailerProductList($con, $ProductIdList, $TypeList, $QuantityList, $PriceList){\n $result = true;\n\n // iterate through each card and process individually\n foreach($ProductIdList as $key => $ProductId){\n\n if(doesSellsExist($con, $ProductId, $TypeList[$key])){\n\n // if card exists, update\n $result = updateSells($con, $ProductId, $TypeList[$key], $QuantityList[$key], $PriceList[$key]);\n\n } else if(doesSellsExist($con, abs($ProductId), $TypeList[$key])){\n // if card id is negative it has been marked for deletion\n $result = deleteSells($con, abs($ProductId), $TypeList[$key]);\n\n }\n\n if(!$result) return $result;\n }\n\n return $result;\n}", "public function setPriceAttribute($value)\n {\n if ( ! is_array($value)) {\n return;\n }\n foreach ($value as $currency => $price) {\n ProductPrice::updateOrCreate([\n 'product_id' => $this->id,\n 'currency_id' => Currency::where('code', $currency)->firstOrFail()->id,\n ], [\n 'price' => $price,\n ]);\n }\n }", "public function prices()\n {\n return $this->morphToMany(Price::class, 'price_able');\n }", "public function wc_epo_product_price_rules( $price = array(), $product ) {\n\t\tif ( $this->is_elex_dpd_enabled() ) {\n\t\t\t$check_price = apply_filters( 'wc_epo_discounted_price', NULL, $product, NULL );\n\t\t\tif ( $check_price ) {\n\t\t\t\t$price['product'] = array();\n\t\t\t\tif ( $check_price['is_multiprice'] ) {\n\t\t\t\t\tforeach ( $check_price['rules'] as $variation_id => $variation_rule ) {\n\t\t\t\t\t\tforeach ( $variation_rule as $rulekey => $pricerule ) {\n\t\t\t\t\t\t\t$price['product'][ $variation_id ][] = array(\n\t\t\t\t\t\t\t\t\"min\" => $pricerule[\"min\"],\n\t\t\t\t\t\t\t\t\"max\" => $pricerule[\"max\"],\n\t\t\t\t\t\t\t\t\"value\" => ( $pricerule[\"type\"] != \"percentage\" ) ? apply_filters( 'wc_epo_product_price', $pricerule[\"value\"], \"\", FALSE ) : $pricerule[\"value\"],\n\t\t\t\t\t\t\t\t\"type\" => $pricerule[\"type\"],\n\t\t\t\t\t\t\t\t'conditions' => isset( $pricerule[\"conditions\"] ) ? $pricerule[\"conditions\"] : array(),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tforeach ( $check_price['rules'] as $rulekey => $pricerule ) {\n\t\t\t\t\t\t$price['product'][0][] = array(\n\t\t\t\t\t\t\t\"min\" => $pricerule[\"min\"],\n\t\t\t\t\t\t\t\"max\" => $pricerule[\"max\"],\n\t\t\t\t\t\t\t\"value\" => ( $pricerule[\"type\"] != \"percentage\" ) ? apply_filters( 'wc_epo_product_price', $pricerule[\"value\"], \"\", FALSE ) : $pricerule[\"value\"],\n\t\t\t\t\t\t\t\"type\" => $pricerule[\"type\"],\n\t\t\t\t\t\t\t'conditions' => isset( $pricerule[\"conditions\"] ) ? $pricerule[\"conditions\"] : array(),\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$price['price'] = apply_filters( 'woocommerce_tm_epo_price_compatibility', apply_filters( 'wc_epo_product_price', $product->get_price(), \"\", FALSE ), $product );\n\t\t}\n\n\t\treturn $price;\n\t}", "function SetBidList(&$list)\n\t{\n\t\t$this->_bidList = array();\n\t\t$existingBidList = $this->GetBidList();\n\t\tforeach ($existingBidList as $bid)\n\t\t{\n\t\t\t$bid->supplierId = '';\n\t\t\t$bid->Save(false);\n\t\t}\n\t\t$this->_bidList = $list;\n\t}", "public function savePrice(FipeVehiclePrice $price){\n $em = $this->getEntityManager();\n $em->persist($price);\n $em->flush();\n }", "public function calculatePrices(): void\n {\n $orders = ServiceContainer::orders();\n $pizzaPrice = $orders->calculatePizzaPrice($this->items);\n $deliveryPrice = $orders->calculateDeliveryPrice($pizzaPrice, $this->outside, $this->currency);\n $this->delivery_price = $deliveryPrice;\n $this->total_price = $pizzaPrice + $deliveryPrice;\n }", "protected function convertPriceList() {\n\t\t$retArray =array();\n\t\t\n\t\tforeach ($this->DetailPriceList as $name => $nameValue) {\n\t\t\t$description = '';\n\t\t\t$unit = '';\n\t\t\t$price = 0;\n\t\t\t$avgPrice = 0;\n\t\t\tif (is_array($nameValue)) {\n\t\t\t\tforeach ($nameValue as $desc => $prices) {\n\t\t\t\t\tif (is_array($prices)) {\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$price = $nameValue;\n\t\t\t\t$avgPrice = $price;\n\t\t\t}\n\t\t\t$retArray[] = array($name,$description, $unit,$price, $avgPrice );\n\t\t}\n\t}", "function _prepareGroupedProductPriceData($entityIds = null) {\n\t\t\t$write = $this->_getWriteAdapter( );\n\t\t\t$table = $this->getIdxTable( );\n\t\t\t$select = $write->select( )->from( array( 'e' => $this->getTable( 'catalog/product' ) ), 'entity_id' )->joinLeft( array( 'l' => $this->getTable( 'catalog/product_link' ) ), 'e.entity_id = l.product_id AND l.link_type_id=' . LINK_TYPE_GROUPED, array( ) )->join( array( 'cg' => $this->getTable( 'customer/customer_group' ) ), '', array( 'customer_group_id' ) );\n\t\t\t$this->_addWebsiteJoinToSelect( $select, true );\n\t\t\t$this->_addProductWebsiteJoinToSelect( $select, 'cw.website_id', 'e.entity_id' );\n\n\t\t\tif ($this->getVersionHelper( )->isGe1600( )) {\n\t\t\t\t$minCheckSql = $write->getCheckSql( 'le.required_options = 0', 'i.min_price', 0 );\n\t\t\t\t$maxCheckSql = $write->getCheckSql( 'le.required_options = 0', 'i.max_price', 0 );\n\t\t\t\t$taxClassId = $this->_getReadAdapter( )->getCheckSql( 'MIN(i.tax_class_id) IS NULL', '0', 'MIN(i.tax_class_id)' );\n\t\t\t\t$minPrice = new Zend_Db_Expr( 'MIN(' . $minCheckSql . ')' );\n\t\t\t\t$maxPrice = new Zend_Db_Expr( 'MAX(' . $maxCheckSql . ')' );\n\t\t\t} \nelse {\n\t\t\t\t$taxClassId = new Zend_Db_Expr( 'IFNULL(i.tax_class_id, 0)' );\n\t\t\t\t$minPrice = new Zend_Db_Expr( 'MIN(IF(le.required_options = 0, i.min_price, 0))' );\n\t\t\t\t$maxPrice = new Zend_Db_Expr( 'MAX(IF(le.required_options = 0, i.max_price, 0))' );\n\t\t\t}\n\n\t\t\t$stockId = 'IF (i.stock_id IS NOT NULL, i.stock_id, 1)';\n\t\t\t$select->columns( 'website_id', 'cw' )->joinLeft( array( 'le' => $this->getTable( 'catalog/product' ) ), 'le.entity_id = l.linked_product_id', array( ) );\n\n\t\t\tif ($this->getVersionHelper( )->isGe1700( )) {\n\t\t\t\t$columns = array( 'tax_class_id' => $taxClassId, 'price' => new Zend_Db_Expr( 'NULL' ), 'final_price' => new Zend_Db_Expr( 'NULL' ), 'min_price' => $minPrice, 'max_price' => $maxPrice, 'tier_price' => new Zend_Db_Expr( 'NULL' ), 'group_price' => new Zend_Db_Expr( 'NULL' ), 'stock_id' => $stockId, 'currency' => 'i.currency', 'store_id' => 'i.store_id' );\n\t\t\t} \nelse {\n\t\t\t\t$columns = array( 'tax_class_id' => $taxClassId, 'price' => new Zend_Db_Expr( 'NULL' ), 'final_price' => new Zend_Db_Expr( 'NULL' ), 'min_price' => $minPrice, 'max_price' => $maxPrice, 'tier_price' => new Zend_Db_Expr( 'NULL' ), 'stock_id' => $stockId, 'currency' => 'i.currency', 'store_id' => 'i.store_id' );\n\t\t\t}\n\n\t\t\t$select->joinLeft( array( 'i' => $table ), '(i.entity_id = l.linked_product_id) AND (i.website_id = cw.website_id) AND ' . '(i.customer_group_id = cg.customer_group_id)', $columns );\n\t\t\t$select->group( array( 'e.entity_id', 'cg.customer_group_id', 'cw.website_id', $stockId, 'i.currency', 'i.store_id' ) )->where( 'e.type_id=?', $this->getTypeId( ) );\n\n\t\t\tif (!is_null( $entityIds )) {\n\t\t\t\t$select->where( 'l.product_id IN(?)', $entityIds );\n\t\t\t}\n\n\t\t\t$eventData = array( 'select' => $select, 'entity_field' => new Zend_Db_Expr( 'e.entity_id' ), 'website_field' => new Zend_Db_Expr( 'cw.website_id' ), 'stock_field' => new Zend_Db_Expr( $stockId ), 'currency_field' => new Zend_Db_Expr( 'i.currency' ), 'store_field' => new Zend_Db_Expr( 'cs.store_id' ) );\n\n\t\t\tif (!$this->getWarehouseHelper( )->getConfig( )->isMultipleMode( )) {\n\t\t\t\t$eventData['stock_field'] = new Zend_Db_Expr( 'i.stock_id' );\n\t\t\t}\n\n\t\t\tMage::dispatchEvent( 'catalog_product_prepare_index_select', $eventData );\n\t\t\t$query = $select->insertFromSelect( $table );\n\t\t\t$write->query( $query );\n\t\t\treturn $this;\n\t\t}", "public function getById(int $idPriceList): ?PriceListTransfer;", "protected function handleSaveFieldsConfig(\n Laposta_Connect_Model_List $list\n ) {\n $fieldsMap = $this->resolveFieldsMap();\n $added = array();\n $updated = array();\n $removed = array();\n $skipped = array();\n /** @var $fields Laposta_Connect_Model_Mysql4_Field_Collection */\n $fields = Mage::getModel('lapostaconnect/field')->getCollection();\n\n $fields->addFilter('list_id', $list->getListId());\n\n /** @var $field Laposta_Connect_Model_Field */\n foreach ($fields as $key => $field) {\n $fieldName = $field->getFieldName();\n\n if (!isset($fieldsMap[$fieldName])) {\n $removed[$fieldName] = $field;\n $fields->removeItemByKey($key);\n $field->delete();\n\n continue;\n }\n\n $field->setFieldRelation($fieldsMap[$fieldName]);\n $field->setUpdatedTime($fields->formatDate(time()));\n $updated[$fieldName] = $field;\n }\n\n $fieldsMap = array_diff_key($fieldsMap, $updated, $removed, $skipped);\n\n /**\n * Add the remaining entries in fieldsMap\n */\n foreach ($fieldsMap as $fieldName => $fieldRelation) {\n $field = $fields->getNewEmptyItem();\n $field->setListId($list->getListId());\n $field->setFieldName($fieldName);\n $field->setFieldRelation($fieldRelation);\n $field->setUpdatedTime($fields->formatDate(time()));\n\n $fields->addItem($field);\n $added[$fieldName] = $field;\n }\n\n try {\n /** @var $syncHelper Laposta_Connect_Helper_Sync */\n $syncHelper = Mage::helper('lapostaconnect/sync');\n $syncHelper->syncFields($list, $fields);\n }\n catch (Exception $e) {\n Mage::helper('lapostaconnect')->log($e);\n }\n\n $fields->save();\n }", "public static function updateFlashSaleTime($listUpdate){\n $tmp = $listUpdate;\n $p = new Products();\n foreach ($p as $item => $tmp){\n\n }\n }", "public function getListPrice()\n\t{\n\t\treturn $this->getKeyValue('list_price'); \n\n\t}", "protected function _saveProductTierPrices(array $tierPriceData)\n {\n static $tableName = null;\n\n if (!$tableName) {\n $tableName = $this->_resourceFactory->create()->getTable('catalog_product_entity_tier_price');\n }\n if ($tierPriceData) {\n $tierPriceIn = [];\n $delProductId = [];\n\n foreach ($tierPriceData as $delSku => $tierPriceRows) {\n $productId = $this->skuProcessor->getNewSku($delSku)[$this->getProductEntityLinkField()];\n $delProductId[] = $productId;\n\n foreach ($tierPriceRows as $row) {\n $row[$this->getProductEntityLinkField()] = $productId;\n $tierPriceIn[] = $row;\n }\n }\n if (Import::BEHAVIOR_APPEND != $this->getBehavior()) {\n $this->_connection->delete(\n $tableName,\n $this->_connection->quoteInto(\"{$this->getProductEntityLinkField()} IN (?)\", $delProductId)\n );\n }\n if ($tierPriceIn) {\n $this->_connection->insertOnDuplicate($tableName, $tierPriceIn, ['value']);\n }\n }\n return $this;\n }", "public function prices()\n {\n return $this\n ->belongsToMany(PricingGroup::class, PriceListItem::getTableName(), 'item_unit_id', 'pricing_group_id')\n ->withPivot(['price', 'discount_value', 'discount_percent', 'date', 'pricing_group_id']);\n }", "public function run()\n {\n $prices = [\n [\n 'product_id' => 2,\n 'user_id' => 3,\n 'price' => 18,\n 'created_at' => now(),\n 'updated_at' => now()\n ],\n [\n 'product_id' => 3,\n 'user_id' => 3,\n 'price' => 15,\n 'created_at' => now(),\n 'updated_at' => now()\n ],\n [\n 'product_id' => 2,\n 'user_id' => 4,\n 'price' => 18,\n 'created_at' => now(),\n 'updated_at' => now()\n ],\n [\n 'product_id' => 3,\n 'user_id' => 4,\n 'price' => 15,\n 'created_at' => now(),\n 'updated_at' => now()\n ],\n ];\n ProductPrice::query()->insert($prices);\n }", "protected function doActionSetSalePrice()\n {\n $form = new \\XLite\\Module\\CDev\\Sale\\View\\Form\\SaleSelectedDialog();\n $form->getRequestData();\n\n if ($form->getValidationMessage()) {\n \\XLite\\Core\\TopMessage::addError($form->getValidationMessage());\n } elseif (!$this->getSelected() && $ids = $this->getActionProductsIds()) {\n $qb = \\XLite\\Core\\Database::getRepo('XLite\\Model\\Product')->createQueryBuilder();\n $alias = $qb->getMainAlias();\n $qb->update('\\XLite\\Model\\Product', $alias)\n ->andWhere($qb->expr()->in(\"{$alias}.product_id\", $ids));\n\n foreach ($this->getUpdateInfoElement() as $key => $value) {\n $qb->set(\"{$alias}.{$key}\", \":{$key}\")\n ->setParameter($key, $value);\n }\n\n $qb->execute();\n\n \\XLite\\Core\\TopMessage::addInfo('Products information has been successfully updated');\n } else {\n \\XLite\\Core\\Database::getRepo('\\XLite\\Model\\Product')->updateInBatchById($this->getUpdateInfo());\n \\XLite\\Core\\TopMessage::addInfo('Products information has been successfully updated');\n }\n\n $this->setReturnURL($this->buildURL('product_list', '', ['mode' => 'search']));\n }", "public function item_setprice($item)\n {\n if ($item['product_type'] != 2 || $item['product_payment'] != 'prepay') return;\n\n $db = db(config('db'));\n\n if ($_POST)\n {\n $db -> beginTrans();\n\n switch ($item['objtype'])\n {\n case 'room':\n $data = $this -> _format_room_price($item);\n\n // close old price\n $where = \"`supply`='EBK' AND `supplyid`=:sup AND `payment`=3 AND `hotel`=:hotel AND `room`=:room AND `date`>=:start AND `date`<=:end\";\n $condition = array(':sup'=>$item['pid'], ':hotel'=>$item['objpid'], ':room'=>$item['id'], ':start'=>$_POST['start'], ':end'=>$_POST['end']);\n $rs = $db -> prepare(\"UPDATE `ptc_hotel_price_date` SET `close`=1, `price`=0 WHERE {$where}\") -> execute($condition);\n if ($rs === false)\n json_return(null, 6, '保存失败,请重试');\n\n if ($data)\n {\n $data = array_values($data);\n list($column, $sql, $value) = array_values(insert_array($data));\n\n $_columns = update_column(array_keys($data[0]));\n $rs = $db -> prepare(\"INSERT INTO `ptc_hotel_price_date` {$column} VALUES {$sql} ON DUPLICATE KEY UPDATE {$_columns};\") -> execute($value); //var_dump($rs); exit;\n if (false == $rs)\n {\n $db -> rollback();\n json_return(null, 7, '数据保存失败,请重试~');\n }\n }\n break;\n\n case 'auto':\n $data = $this -> _format_auto_price($item);\n\n // close old price\n $where = \"`auto`=:auto AND `date`>=:start AND `date`<=:end\";\n $condition = array(':auto'=>$item['objpid'], ':start'=>$_POST['start'], ':end'=>$_POST['end']);\n $rs = $db -> prepare(\"UPDATE `ptc_auto_price_date` SET `close`=1, `price`=0 WHERE {$where}\") -> execute($condition);\n if ($rs === false)\n json_return(null, 6, '保存失败,请重试');\n\n if ($data)\n {\n $data = array_values($data);\n list($column, $sql, $value) = array_values(insert_array($data));\n\n $_columns = update_column(array_keys($data[0]));\n $rs = $db -> prepare(\"INSERT INTO `ptc_auto_price_date` {$column} VALUES {$sql} ON DUPLICATE KEY UPDATE {$_columns};\") -> execute($value); //var_dump($rs); exit;\n if (false == $rs)\n {\n $db -> rollback();\n json_return(null, 7, '数据保存失败,请重试~');\n }\n }\n break;\n }\n\n if (false === $db -> commit())\n json_return(null, 9, '数据保存失败,请重试~');\n else\n json_return($rs);\n }\n\n $month = !empty($_GET['month']) ? $_GET['month'] : date('Y-m');\n\n $first = strtotime($month.'-1');\n $first_day = date('N', $first);\n\n $start = $first_day == 7 ? $first : $first - $first_day * 86400;\n $end = $start + 41 * 86400;\n\n switch ($item['objtype'])\n {\n case 'room':\n $_date = $db -> prepare(\"SELECT `key`,`date`,`price`,`breakfast`,`allot`,`sold`,`filled`,`standby`,`close` FROM `ptc_hotel_price_date` WHERE `supply`='EBK' AND `supplyid`=:sup AND `hotel`=:hotel AND `room`=:room AND `date`>=:start AND `date`<=:end AND `close`=0\")\n -> execute(array(':sup'=>$item['pid'], ':hotel'=>$item['objpid'], ':room'=>$item['id'], ':start'=>$start, ':end'=>$end));\n break;\n\n case 'auto':\n $_date = $db -> prepare(\"SELECT `key`,`date`,`price`,`child`,`baby`,`allot`,`sold`,`filled`,`close` FROM `ptc_auto_price_date` WHERE `auto`=:auto AND `date`>=:start AND `date`<=:end AND `close`=0\")\n -> execute(array(':auto'=>$item['objpid'], ':start'=>$start, ':end'=>$end));\n break;\n }\n\n $date = array();\n foreach ($_date as $v)\n {\n $date[$v['date']] = $v;\n }\n unset($_date);\n\n include dirname(__FILE__).'/product/price_'.$item['objtype'].'.tpl.php';\n }", "private function mapPrices(ProductInterface $magentoProduct, SkyLinkProduct $skyLinkProduct)\n {\n $magentoProduct->setPrice($skyLinkProduct->getPricingStructure()->getRegularPrice()->toNative());\n\n $magentoProduct->unsetData('special_price');\n $magentoProduct->unsetData('special_from_date');\n $magentoProduct->unsetData('special_to_date');\n\n if (false === $skyLinkProduct->getPricingStructure()->hasSpecialPrice()) {\n $this->removeSpecialPrices($magentoProduct);\n return;\n }\n\n $skyLinkSpecialPrice = $skyLinkProduct->getPricingStructure()->getSpecialPrice();\n\n // If the end date is before now, we do not need to put a new special price on at all, as\n // it cannot end in the past. In fact, Magento will let you save it, but won't let\n // subsequent saves from the admin interface occur.\n $now = new DateTimeImmutable();\n if ($skyLinkSpecialPrice->hasEndDate() && $skyLinkSpecialPrice->getEndDate() < $now) {\n $this->removeSpecialPrices($magentoProduct);\n return;\n }\n\n $magentoProduct->setCustomAttribute('special_price', $skyLinkSpecialPrice->getPrice()->toNative());\n\n // If there's a start date at least now or in the future, we'll use that...\n if ($skyLinkSpecialPrice->hasStartDate() && $skyLinkSpecialPrice->getStartDate() >= $now) {\n $magentoProduct->setCustomAttribute(\n 'special_from_date',\n $this->dateTimeToLocalisedAttributeValue($skyLinkSpecialPrice->getStartDate())\n );\n\n // Otherwise, we'll use a start date from now\n } else {\n $magentoProduct->setCustomAttribute('special_from_date', $this->dateTimeToLocalisedAttributeValue($now));\n }\n\n // If there's an end date, we'll just use that\n if ($skyLinkSpecialPrice->hasEndDate()) {\n $magentoProduct->setCustomAttribute(\n 'special_to_date',\n $this->dateTimeToLocalisedAttributeValue($skyLinkSpecialPrice->getEndDate())\n );\n\n // Otherwise, it's indefinite\n } else {\n $distantFuture = new DateTimeImmutable('2099-01-01');\n $magentoProduct->setCustomAttribute('special_to_date', $this->dateTimeToLocalisedAttributeValue($distantFuture));\n }\n }", "public function productPrices()\n {\n return $this->belongsToMany(ProductPrice::class, 'product_prices', null, 'product_id');\n }", "public function setTblProdPrices(ChildTblProdPrices $v = null)\n {\n if ($v === null) {\n $this->setProdId(NULL);\n } else {\n $this->setProdId($v->getProdId());\n }\n\n $this->aTblProdPrices = $v;\n\n // Add binding for other direction of this 1:1 relationship.\n if ($v !== null) {\n $v->setTblProdInfo($this);\n }\n\n\n return $this;\n }", "function updateAmazonProductsPrices($items)\n{\n\tif (sizeof($items) > 0) {\n\t\t$data['lastmod'] = time();\n\t\t$data['lastmod_user'] = getAmazonSessionUserId();\n\t\t$data['lastpriceupdate'] = time();\n\t\t$data['submitedProduct'] = 0;\n\t\t$data['submitedPrice'] = 0;\n\t\t$data['upload'] = 1;\n\t\t$caseStandardPrice = \"StandardPrice = CASE\";\n\t\tforeach($items as $key => $item)\n\t\t{\n\t\t\t$caseStandardPrice.= \"\\n WHEN id_product = \" . $items[$key]['id_product'] . \" THEN \" . $items[$key]['price'];\n\t\t\t$productsIds[] = $items[$key]['id_product'];\n\t\t}\n\t\t$caseStandardPrice.= \"\n\t\t\tEND\n\t\t\tWHERE id_product IN (\" . implode(\", \", $productsIds) . \")\n\t\t\";\n\t\t$addWhere\t = $caseStandardPrice;\n\t\tSQLUpdate('amazon_products', $data, $addWhere, 'shop', __FILE__, __LINE__);\n\t}\n}", "public function updateProductListPivot()\n {\n $model = $this->productListable;\n $products = $model->products()->get('id');\n $this->products()->sync($products->pluck('id'));\n }", "public function createAction()\n {\n $entity = new Pricelist();\n $request = $this->getRequest();\n $form = $this->createForm(new PricelistType(), $entity);\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('Price_show', array('id' => $entity->getId())));\n \n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView()\n );\n }", "public function setOptions_values_price( $options_values_price ) {\n\t\t$this->options_values_price = $options_values_price;\n\t}", "function SaveListEntity($listEntity)\n\t{\n\t\t$result = $this->sendRequest(\"SaveListEntity\", array(\"ListEntity\"=>$listEntity));\n\t\treturn $this->getResultFromResponse($result);\n\t}", "protected function calculatePrices()\n {\n }", "public function syncProductList()\n {\n // Evaluation only needed for custom product list and product tag\n if (!$this->isCustomList() && !$this->model_type !== ProductTag::class) return;\n\n $product_ids = $this->isCustomList() ? $this->product_ids : $this->getProductQuery()->get('id')->pluck('id')->all();\n\n $this->products()->sync($product_ids);\n }", "public function addprice($sOXID = null, $aUpdateParams = null)\n {\n $myConfig = $this->getConfig();\n\n $this->resetContentCache();\n\n $sOxArtId = $this->getEditObjectId();\n\n\n\n $aParams = oxRegistry::getConfig()->getRequestParameter(\"editval\");\n\n if (!is_array($aParams)) {\n return;\n }\n\n if (isset($aUpdateParams) && is_array($aUpdateParams)) {\n $aParams = array_merge($aParams, $aUpdateParams);\n }\n\n //replacing commas\n foreach ($aParams as $key => $sParam) {\n $aParams[$key] = str_replace(\",\", \".\", $sParam);\n }\n\n $aParams['oxprice2article__oxshopid'] = $myConfig->getShopID();\n\n if (isset($sOXID)) {\n $aParams['oxprice2article__oxid'] = $sOXID;\n }\n\n $aParams['oxprice2article__oxartid'] = $sOxArtId;\n if (!isset($aParams['oxprice2article__oxamount']) || !$aParams['oxprice2article__oxamount']) {\n $aParams['oxprice2article__oxamount'] = \"1\";\n }\n\n if (!$myConfig->getConfigParam('blAllowUnevenAmounts')) {\n $aParams['oxprice2article__oxamount'] = round(( string ) $aParams['oxprice2article__oxamount']);\n $aParams['oxprice2article__oxamountto'] = round(( string ) $aParams['oxprice2article__oxamountto']);\n }\n\n $dPrice = $aParams['price'];\n $sType = $aParams['pricetype'];\n\n $oArticlePrice = oxNew(\"oxbase\");\n $oArticlePrice->init(\"oxprice2article\");\n $oArticlePrice->assign($aParams);\n\n $oArticlePrice->$sType = new oxField($dPrice);\n\n //validating\n if ($oArticlePrice->$sType->value &&\n $oArticlePrice->oxprice2article__oxamount->value &&\n $oArticlePrice->oxprice2article__oxamountto->value &&\n is_numeric($oArticlePrice->$sType->value) &&\n is_numeric($oArticlePrice->oxprice2article__oxamount->value) &&\n is_numeric($oArticlePrice->oxprice2article__oxamountto->value) &&\n $oArticlePrice->oxprice2article__oxamount->value <= $oArticlePrice->oxprice2article__oxamountto->value\n ) {\n $oArticlePrice->save();\n }\n\n // check if abs price is lower than base price\n $oArticle = oxNew(\"oxArticle\");\n $oArticle->loadInLang($this->_iEditLang, $sOxArtId);\n $sPriceField = 'oxarticles__oxprice';\n if (($aParams['price'] >= $oArticle->$sPriceField->value) &&\n ($aParams['pricetype'] == 'oxprice2article__oxaddabs')) {\n if (is_null($sOXID)) {\n $sOXID = $oArticlePrice->getId();\n }\n $this->_aViewData[\"errorscaleprice\"][] = $sOXID;\n }\n\n }", "public function Save($id, $desc, $rating, $genre, $developer, $listPrice, $releaseDate)\n {\t\n\t\ttry\n\t\t{\t\n\t\t\t$response = $this->_obj->Execute(\"Product(\" . $id . \")\" );\n\t\t\t$products = $response->Result;\n\t\t\tforeach ($products as $product) \n\t\t\t{\n\t\t\t\t$product->ProductDescription = $desc;\n\t\t\t\t$product->ListPrice = str_replace('$', '', $listPrice);\n\t\t\t\t$product->ReleaseDate = $releaseDate;\n\t\t\t\t$product->ProductVersion = $product->ProductVersion;\n\t\t\t\t$this->_obj->UpdateObject($product);\n\t\t\t}\n\t\t\t$this->_obj->SaveChanges(); \n\t\t\t$response = $this->_obj->Execute(\"Game?\\$filter=ProductID eq \" . $id );;\n\t\t\t$games = $response->Result;\n\t\t\tforeach ($games as $game) \n\t\t\t{\n\t\t\t\t$game->Rating = str_replace('%20', ' ', $rating);\n\t\t\t\t$game->Genre = str_replace('%20', ' ', $genre);\n\t\t\t\t$game->Developer = $developer;\n\t\t\t\t$game->GameVersion = $game->GameVersion;\n\t\t\t\t$this->_obj->UpdateObject($game);\n\t\t\t}\n\t\t\t$this->_obj->SaveChanges();\n\t\t\t$products[0]->Game = $games;\n\t\t\treturn $products[0];\n }\n catch(ADODotNETDataServicesException $e)\n {\n\t\t\t echo \"Error: \" . $e->getError() . \"<br>\" . \"Detailed Error: \" . $e->getDetailedError();\n }\n }", "public function testPriceGroupWithVariants()\n {\n $number = __FUNCTION__;\n $context = $this->getContext();\n\n $data = $this->createPriceGroupProduct($number, $context, true);\n\n $this->helper->createArticle($data);\n\n $listProduct = $this->helper->getListProduct($number, $context, [\n 'useLastGraduationForCheapestPrice' => true,\n ]);\n\n /* @var ListProduct $listProduct */\n static::assertEquals(7, $listProduct->getCheapestPrice()->getCalculatedPrice());\n }", "public function deleteprice()\n {\n $this->resetContentCache();\n\n $oDb = oxDb::getDb();\n $sPriceId = $oDb->quote(oxRegistry::getConfig()->getRequestParameter(\"priceid\"));\n $sId = $oDb->quote($this->getEditObjectId());\n $oDb->execute(\"delete from oxprice2article where oxid = {$sPriceId} and oxartid = {$sId}\");\n }", "public function update(Request $request, $id)\n {\n $pricelist = $this->pricelist->find($id);\n $pricelist->fill($request->except('pricelist_items'));\n $pricelist->save();\n\n $priceListItem = [];\n $requestPricelistItems = json_decode($request->pricelist_items);\n\n foreach ( $requestPricelistItems as $pricelistItem) {\n $priceListItem = [\n 'price_list_id' => $id,\n 'waste_id' => $pricelistItem->pivot->waste_id,\n 'unit_id' => $pricelistItem->unit_id,\n 'unit_price' => (double)$pricelistItem->pivot->unit_price\n ];\n $priceListItemToBeUpdated = $this->pricelistItem->where('waste_id',$pricelistItem->pivot->waste_id)\n ->where('price_list_id',$id)->first();\n if ($priceListItemToBeUpdated->count() > 0) {\n \n $priceListItemToBeUpdated->unit_price = (double)$pricelistItem->pivot->unit_price;\n $priceListItemToBeUpdated->unit_id = $pricelistItem->unit_id;\n $priceListItemToBeUpdated->save();\n\n } else {\n $pricelist->wastes()->attach($priceListItem);\n }\n }\n\n return redirect()->route('settings.pricelists')\n ->with('success', 'Pricelist has been updated!');\n }", "public function updateProduct()\n {\n \t$quote=$this->getQuote();\n \tif($quote)\n \t{\n \t\t$detailproduct=$this->getProduct();\n \t\t$quoteproduct=$quote->getProduct();\n \t\tif(\n\t\t\t\t$quote->getPrice()!=$this->getPrice() or\n\t\t\t\t$quote->getDiscrate()!=$this->getDiscrate() or\n\t\t\t\t$quote->getDiscamt()!=$this->getDiscamt() or\n\t\t\t\t$quote->getProductId()!=$this->getProductId()\n\t\t\t)\n\t\t\t{\n\t\t\t\t$quote->setPrice($this->getPrice());\n\t\t\t\t$quote->setDiscrate($this->getDiscrate());\n\t\t\t\t$quote->setDiscamt($this->getDiscamt());\n\t\t\t\t$quote->setProductId($this->getProductId());\n\t\t\t\t$quote->calc(); //auto save\n\t\t\t\t$detailproduct->calcSalePrices();\n\t\t\t\t\n\t\t\t\t//if product changed, calc old product\n\t\t\t\tif($quoteproduct->getId()!=$detailproduct->getId())\n\t\t\t\t\t$quoteproduct->calcSalePrices();\n\t\t\t}\n \t}\n \telse\n \t{\n\t\t\t//if none, see if product quote by vendor with similar pricing exists. \n\t\t\t$quote=Fetcher::fetchOne(\"Quote\",array('total'=>$this->getUnittotal(),'vendor_id'=>SettingsTable::fetch(\"me_vendor_id\"),'product_id'=>$this->getProductId()));\n\n\t\t\t//if it doesn't exist, create it, and product->calc()\n\t\t\tif(!$quote)\n\t\t\t{\n\t\t\t\tQuoteTable::createOne(array(\n\t\t\t\t\t'date'=>$this->getInvoice()->getDate(),\n\t\t\t\t\t'price'=>$this->getPrice(),\n\t\t\t\t\t'discrate'=>$this->getDiscrate(),\n\t\t\t\t\t'discamt'=>$this->getDiscamt(),\n\t\t\t\t\t'vendor_id'=>SettingsTable::fetch(\"me_vendor_id\"),\n\t\t\t\t\t'product_id'=>$this->getProductId(),\n\t\t\t\t\t'ref_class'=>\"Invoicedetail\",\n\t\t\t\t\t'ref_id'=>$this->getId(),\n\t\t\t\t\t'mine'=>1,\n\t\t\t\t\t));\n\t\t\t\t$this->getProduct()->calcSalePrices();\n\t\t\t}\n \t}\n }", "protected function createProductVariantPricelistPriceRequest($body, $product_id, $variant_id)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling createProductVariantPricelistPrice'\n );\n }\n // verify the required parameter 'product_id' is set\n if ($product_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $product_id when calling createProductVariantPricelistPrice'\n );\n }\n if ($product_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$product_id\" when calling DefaultApi.createProductVariantPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'variant_id' is set\n if ($variant_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $variant_id when calling createProductVariantPricelistPrice'\n );\n }\n if ($variant_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$variant_id\" when calling DefaultApi.createProductVariantPricelistPrice, must be bigger than or equal to 1.');\n }\n $resourcePath = '/products/{productId}/variants/{variantId}/prices';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($product_id !== null) {\n $resourcePath = str_replace(\n '{' . 'productId' . '}',\n ObjectSerializer::toPathValue($product_id),\n $resourcePath\n );\n }\n // path params\n if ($variant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'variantId' . '}',\n ObjectSerializer::toPathValue($variant_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n \n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function woocommerce_rrp_add_bulk_on_edit() {\n\t\t\tglobal $typenow;\n\t\t\t$post_type = $typenow;\n\t\t\t\n\t\t\tif($post_type == 'product') {\n\t\t\t\t\n\t\t\t\t// get the action\n\t\t\t\t$wp_list_table = _get_list_table('WP_Posts_List_Table'); // depending on your resource type this could be WP_Users_List_Table, WP_Comments_List_Table, etc\n\t\t\t\t$action = $wp_list_table->current_action();\n\t\t\t\t\n\t\t\t\t$allowed_actions = array(\"set_price_to_rrp\");\n\t\t\t\tif(!in_array($action, $allowed_actions)) return;\n\t\t\t\t\n\t\t\t\t// security check\n\t\t\t\tcheck_admin_referer('bulk-posts');\n\t\t\t\t\n\t\t\t\t// make sure ids are submitted. depending on the resource type, this may be 'media' or 'ids'\n\t\t\t\tif(isset($_REQUEST['post'])) {\n\t\t\t\t\t$post_ids = array_map('intval', $_REQUEST['post']);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(empty($post_ids)) return;\n\t\t\t\t\n\t\t\t\t// this is based on wp-admin/edit.php\n\t\t\t\t$sendback = remove_query_arg( array('price_setted_to_rrp', 'untrashed', 'deleted', 'ids'), wp_get_referer() );\n\t\t\t\tif ( ! $sendback )\n\t\t\t\t\t$sendback = admin_url( \"edit.php?post_type=$post_type\" );\n\t\t\t\t\n\t\t\t\t$pagenum = $wp_list_table->get_pagenum();\n\t\t\t\t$sendback = add_query_arg( 'paged', $pagenum, $sendback );\n\t\t\t\t\n\t\t\t\tswitch($action) {\n\t\t\t\t\tcase 'set_price_to_rrp':\n\t\t\t\t\t\t\n\t\t\t\t\t\t// if we set up user permissions/capabilities, the code might look like:\n\t\t\t\t\t\t//if ( !current_user_can($post_type_object->cap->export_post, $post_id) )\n\t\t\t\t\t\t//\twp_die( __('You are not allowed to export this post.') );\n\t\t\t\t\t\t\n\t\t\t\t\t\t$price_setted_to_rrp = 0;\n\t\t\t\t\t\tforeach( $post_ids as $post_id ) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$buy_price = get_post_meta($post_id, 'buy_price', true);\n\t\t\t\t\t\t\t$rrp_calc_params = array(\n\t\t\t\t\t\t\t\t'ads_cost' => get_rrp_param($post_id, 'ads_cost'),\t\n\t\t\t\t\t\t\t\t'shipping_cost' => get_rrp_param($post_id, 'shipping_cost'),\t\n\t\t\t\t\t\t\t\t'package_cost' => get_rrp_param($post_id, 'package_cost'),\t\n\t\t\t\t\t\t\t\t'min_profit' => get_rrp_param($post_id, 'min_profit'),\t\n\t\t\t\t\t\t\t\t'desired_profit' => get_rrp_param($post_id, 'desired_profit'),\t\n\t\t\t\t\t\t\t\t'tax_rate' => get_rrp_param($post_id, 'tax_rate'),\n\t\t\t\t\t\t\t);\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$caluculated_rrp = calculate_rrp($buy_price, $rrp_calc_params);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tupdate_post_meta( $post_id, '_regular_price', $caluculated_rrp );\n\t\t\t\n\t\t\t\t\t\t\t$price_setted_to_rrp++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$sendback = add_query_arg( array('price_setted_to_rrp' => $price_setted_to_rrp, 'ids' => join(',', $post_ids) ), $sendback );\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tdefault: return;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$sendback = remove_query_arg( array('action', 'action2', 'tags_input', 'post_author', 'comment_status', 'ping_status', '_status', 'post', 'bulk_edit', 'post_view'), $sendback );\n\t\t\t\t\n\t\t\t\twp_redirect($sendback);\n\t\t\t\texit();\n\t\t\t}\n\t\t}", "public function updateShippingPrice($productID, $newShippingPriceList){\n\n global $db;\n\n if(!is_numeric($productID)){\n return;\n }\n\n $newShippingLocationList = [];\n $delShippingPriceIDList = [];\n foreach($newShippingPriceList as $shippingData){\n $newShippingLocationList[$shippingData['locationID']] = $shippingData['price'];\n }\n\n $oldShippingPriceList = $this->getShippingPrice($productID);\n\n if(isset($oldShippingPriceList) && is_array($oldShippingPriceList) && count($oldShippingPriceList) > 0){\n foreach($oldShippingPriceList as $shippingData){\n if(array_key_exists($shippingData['locationID'], $newShippingLocationList)){\n $query = sprintf('UPDATE %s SET price=%s WHERE id=%d', TABLE_SHOP_SHIPPING_PRICE, $newShippingLocationList[$shippingData['locationID']], $shippingData['id']);\n $db->query($query);\n unset($newShippingLocationList[$shippingData['locationID']]);\n\n }else{\n $delShippingPriceIDList[] = $shippingData['id'];\n }\n }\n }\n\n $this->removeShippingPriceByIDs($delShippingPriceIDList);\n\n if(count($newShippingLocationList) > 0){\n foreach($newShippingLocationList as $key => $val){\n $param = ['productID' => $productID, 'locationID' => $key, 'price' => $val,];\n\n $db->insertFromArray(TABLE_SHOP_SHIPPING_PRICE, $param);\n }\n }\n\n return true;\n\n }", "public function setPrice(float $price) : void\n {\n $this->set('price', $price, 'products');\n }", "public function price(){\n return $this->hasMany('App\\Pricebookentry','product2id','sfid');\n }", "public function create(PriceListRequest $request)\n {\n\n $price_list = $this->repository->newInstance([]);\n return $this->response->title(trans('app.new') . ' ' . trans('pricelist::price_list.name')) \n ->view('pricelist::price_list.create', true) \n ->data(compact('price_list'))\n ->output();\n }", "function SetWebsiteList(&$list)\n\t{\n\t\t$this->_websiteList = array();\n\t\t$existingWebsiteList = $this->GetWebsiteList();\n\t\tforeach ($existingWebsiteList as $website)\n\t\t{\n\t\t\t$website->supplierId = '';\n\t\t\t$website->Save(false);\n\t\t}\n\t\t$this->_websiteList = $list;\n\t}", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $model->prices = $model->getAllPrices();\n $modelPrice = [new InventoryPrice()];\n\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n $prices = Yii::$app->request->post();\n $oldPrices = ArrayHelper::map($model->prices, 'id', 'id');\n $currentPrices = ArrayHelper::map($prices['Inventory']['prices'], 'id', 'id');\n $deletedPrices = array_diff($oldPrices, array_filter($currentPrices));\n\n $transaction = Yii::$app->db->beginTransaction();\n try {\n $model->save();\n\n // detete price\n if (!empty($deletedPrices)) {\n InventoryPrice::deleteAll(['id' => $deletedPrices]);\n }\n\n foreach ($prices['Inventory']['prices'] as $key => $item) {\n if (empty($item['id'])) {\n $modelPrice = new InventoryPrice();\n $modelPrice->created_at = time();\n $modelPrice->created_by = Yii::$app->user->id;\n } else {\n $modelPrice = InventoryPrice::find()->where(['id' => $item['id']])->one();\n }\n $modelPrice->inventory_id = $model->id;\n $modelPrice->vendor_id = $item['vendor_id'];\n $modelPrice->vendor_name = @Inventory::getVendorName($modelPrice->vendor_id);\n $modelPrice->price = $item['price'];\n $modelPrice->due_date = $item['due_date'];\n $modelPrice->active = !isset($item['active']) ? InventoryPrice::STATUS_INACTIVE : $item['active'];\n\n\n if ($modelPrice->price && $modelPrice->vendor_id) {\n $modelPrice->save(false);\n }\n }\n\n\n $transaction->commit();\n Yii::$app->session->setFlash('success', 'เพิ่มสินค้าใหม่เรียบร้อย');\n return $this->redirect(['view', 'id' => $model->id]);\n } catch (Exception $e) {\n $transaction->rollBack();\n Yii::$app->session->setFlash('error', $e->getMessage());\n return $this->redirect(['update', 'id' => $model->id]);\n }\n\n\n } else {\n return $this->render('update', [\n 'model' => $model,\n 'modelPrice' => $modelPrice,\n ]);\n }\n }", "public function getAllList_Price()\n {\n try\n {\n // Создаем новый запрс\n $db = $this->getDbo();\n $query = $db->getQuery(true);\n\n $query->select('a.*');\n $query->from('`#__gm_ceiling_components_option` AS a');\n $query->select('CONCAT( component.title , \\' \\', a.title ) AS full_name');\n $query->select('component.id AS component_id');\n $query->select('component.title AS component_title');\n $query->select('component.unit AS component_unit');\n $query->join('RIGHT', '`#__gm_ceiling_components` AS component ON a.component_id = component.id');\n\n $db->setQuery($query);\n $return = $db->loadObjectList();\n return $return;\n }\n catch(Exception $e)\n {\n Gm_ceilingHelpersGm_ceiling::add_error_in_log($e->getMessage(), __FILE__, __FUNCTION__, func_get_args());\n }\n }", "protected function configureListFields(ListMapper $list): void\r\n {\r\n $list\r\n ->addIdentifier('id')\r\n ->add('expediente', EntityType::class, ['class' => ComercialExpediente::class, 'choice_label' => 'titulo'])\r\n ->add('cotizacion')\r\n ->add('personaNif')\r\n ->add('oficina')\r\n ->add('horizontal')\r\n ->add('vertical')\r\n ->add('missatge')\r\n ->add('nivel')\r\n ->add('updatedAt')\r\n ->add('createdAt')\r\n ->add('active')\r\n ->add('deleted')\r\n ->add('deletedBy')\r\n ->add('deletedAt');\r\n }", "public function getPriceAll()\n { \n $collection = $this->PostCollectionFactory->create();\n /*$a = $collection->getPrice();*/\n foreach ($collection as $key => $value) {\n $value->getPrice();\n }\n return $value->getPrice();\n }", "public function createAppendReplaceList($client, $listName, $listFields, $forceReplace = false)\n\t{\n\t\tMage::helper('pure360_list')->writeDebug(__METHOD__ . ' - start');\n\n\t\t// Calculate list fields\n\t\t$fieldNames = array('email', 'store', 'website', 'subscription_date', 'customer_id');\n\n\t\tforeach($listFields as $field)\n\t\t{\n\t\t\t$fieldNames[] = $field['field_value'];\n\t\t}\n\n\t\t$listCheck = $this->listCheck($client, $listName, $fieldNames);\n\n\t\t// Set list properties ready for replace\n\t\t$listInput = array(\n\t\t\t\"listName\" => $listName,\n\t\t\t\"languageCode\" => \"en_GB.UTF-8\",\n\t\t\t\"uploadFileNotifyEmail\" => \"IGNORE\",\n\t\t\t\"uploadTransactionType\" => ($listCheck === 'NEW' ? \"CREATE\" : \n\t\t\t\t(( $listCheck === 'EXISTS' && !$forceReplace) ? \"APPEND\" : \"REPLACE\")),\n\t\t\t\"uploadFileCategory\" => \"PAINT\",\n\t\t\t\"externalSystemKey\" => \"magento\");\n\n\t\t$customFieldCount = 0;\n\n\t\t// Get date key lookup:\n\t\t$dateKeyLookup = Mage::helper('pure360_list')->getDateKeyLookup();\n\t\t\n\t\t// Set field names\n\t\tfor($index = 0; ($index < count($fieldNames) & $customFieldCount <= 40); $index++)\n\t\t{\n\t\t\t$fieldName = $fieldNames[$index];\n\n\t\t\tswitch($fieldName)\n\t\t\t{\n\t\t\t\tcase \"email\":\n\t\t\t\t\t$listInput[\"emailCol\"] = $index;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"mobile\":\n\t\t\t\t\t$listInput[\"mobileCol\"] = $index;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"signupDate\":\n\t\t\t\t\t$listInput[\"signupDateCol\"] = $index;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t$fieldColStr = \"field\" . $index . \"Col\";\n\t\t\t\t\t$fieldNameStr = \"field\" . $index . \"Name\";\n\t\t\t\t\t$fieldName = str_replace(' ', '_', $fieldName);\n\n\t\t\t\t\t$listInput[$fieldColStr] = $index;\n\t\t\t\t\t$listInput[$fieldNameStr] = $fieldName;\n\n\t\t\t\t\tif(in_array($fieldName, $dateKeyLookup))\n\t\t\t\t\t{\n\t\t\t\t\t\t$fieldTypeStr = \"field\" . $index . \"DataType\";\n\t\t\t\t\t\t$listInput[$fieldTypeStr] = 'date';\n\t\t\t\t\t\t$fieldFormatStr = \"field\" . $index . \"DataFormat\";\n\t\t\t\t\t\t$listInput[$fieldFormatStr] = 'yyyy-mm-dd';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$customFieldCount++;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Create/Replace list\n\t\t$createOutput = $client->campaign->marketingList->_create($listInput);\n\t\t$storeInput = array(\"beanId\" => $createOutput[\"beanId\"]);\n\t\t$result = $client->campaign->marketingList->_store($storeInput);\n\n\t\tMage::helper('pure360_list')->writeDebug(__METHOD__ . ' - end');\n\n\t\treturn $result;\n\t}", "public static function addFinalPriceForProductObject($data)\n {\n $taxClassArray = self::getTax();\n foreach ($data as $row) {\n $priceRs = self::getPriceToCalculateTax($row);\n $row->final_price = self::finalPrice($priceRs['price'], $row->tax_class_id, $taxClassArray);\n $row->display_price_promotion = $priceRs['display_price_promotion'];\n }\n return $data;\n }", "public function getProductPriceAll()\n {\n return $this->_scopeConfig->getValue('splitprice/split_price_config/show_all', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n }", "function SetWeddingList(&$list)\n\t{\n\t\t$this->_weddingList = array();\n\t\t$existingWeddingList = $this->GetWeddingList();\n\t\tforeach ($existingWeddingList as $wedding)\n\t\t{\n\t\t\t$wedding->supplierId = '';\n\t\t\t$wedding->Save(false);\n\t\t}\n\t\t$this->_weddingList = $list;\n\t}", "Function update_price($int_productID,\r\n $flt_amount,\r\n $int_currency_id,\r\n $start_date,\r\n $end_date = FALSE,\r\n $min_quantity = 1,\r\n $max_quantity = 0,\r\n $int_contact_id = FALSE) {\r\n global $db_iwex;\r\n //echo \" update_price curr: \" . $int_currency_id;\r\n // Check if there is a record that can be updated.\r\n $int_current_price = GetField(\"SELECT recordID\r\n\t\t\t\t\t\t\t\t FROM pricing\r\n\t\t\t\t\t\t\t\t WHERE productID = '$int_productID'\r\n\t\t\t\t\t\t\t\t\t\tAND currencyid = '$int_currency_id'\r\n\t\t\t\t\t\t\t\t\t\tAND start_number = '$min_quantity'\r\n\t\t\t\t\t\t\t\t\t\tAND end_number = '$max_quantity'\r\n\t\t\t\t\t\t\t\t\t\tAND start_date = '$start_date'\r\n\t\t\t\t\t\t\t\t\t\tAND (end_date >= NOW() OR end_date = '0000-00-00')\r\n\t\t\t\t\t\t\t\t\t\tAND ContactID = $int_contact_id\");\r\n // When there is an old price that matches it.\r\n $str_sql = \"SELECT recordID\r\n\t\t\t\tFROM pricing \r\n\t\t\t\tWHERE ProductID = '$int_productID' \r\n\t\t\t\t\tAND currencyid = '$int_currency_id'\r\n\t\t\t\t\tAND ContactID='$int_contact_id'\r\n\t\t\t\t\tAND (start_date <= '$start_date' || isnull(start_date) || start_date=0) \r\n\t\t\t\t\tAND (end_date >= \".($end_date && $end_date != \"0000-00-00\" ? \"'$end_date'\" : \"NOW()\").\" || isnull(end_date) || end_date=0)\r\n\t\t\t\t\tAND (start_number <= '$min_quantity' || isnull(start_number) || start_number=0)\r\n\t\t\t\t\tAND (\".($max_quantity ? \"end_number >= '$max_quantity' ||\" : \"\").\" isnull(end_number) || end_number=0)\";\r\n $int_record_id = GetField($str_sql);\r\n\r\n $bl_record_used = $int_current_price ? SalesPriceUsedInOrder($int_current_price) : FALSE;\r\n\r\n // When there is an other record that also matches this new price set it valid to the today -1 day.\r\n if ($int_record_id != $int_current_price\r\n &&\r\n $int_record_id\r\n ) {\r\n EndOldSalesPrice($start_date, $int_record_id);\r\n }\r\n\r\n if ($bl_record_used) {\r\n EndOldSalesPrice($start_date, $int_current_price);\r\n $int_current_price = FALSE;\r\n }\r\n\r\n if (!$int_current_price) { // Create a new record.\r\n $sql = \"INSERT INTO\";\r\n // New records are started today when false or 0;\r\n $start_date = !$start_date || $start_date == \"0000-00-00\" ? date(DATEFORMAT_LONG) : $start_date;\r\n $sql_where = \", created_by = '\" . $GLOBALS[\"employee_id\"] . \"', created = '\".date(DATEFORMAT_LONG) . \"'\";\r\n } else {\r\n $sql = \"UPDATE\";\r\n $sql_where = \", modified_by = '\" . $GLOBALS[\"employee_id\"] . \"', modified = '\".date(DATEFORMAT_LONG) . \"'\r\n\t\t\t\t\t WHERE recordID = $int_current_price\";\r\n\r\n }\r\n $sql .= \" pricing SET amount = '$flt_amount',\r\n \t\t\t\t\t\t currencyid = '$int_currency_id',\r\n\t\t\t\t\t\t ContactID = '$int_contact_id', \r\n\t\t\t\t\t\t productID = '$int_productID', \r\n\t\t\t\t\t\t start_number = '$min_quantity',\r\n\t\t\t\t\t\t end_number = '$max_quantity', \r\n\t\t\t\t\t\t start_date = '$start_date' \";\r\n if ($end_date) $sql .= \", end_date = '$end_date'\";\r\n\r\n //echo $sql.$sql_where;\r\n $db_iwex->query($sql.$sql_where);\r\n\r\n return $int_current_price ? $int_current_price : $db_iwex->lastinserted();\r\n}", "public function calculateBundleAmount($basePriceValue, $bundleProduct, $selectionPriceList, $exclude = null);", "public function price()\n {\n return $this->morphToMany('Sanatorium\\Pricing\\Models\\Money', 'priceable', 'priced');\n }", "public function updateProductStyleOptionPricingAll(){\n\t\t$all_products = $this->getAll();\n\t\t$this->load->model('catalog/product');\n\t\t$this->load->model('tshirtgang/pricing');\n\t\t$this->load->model('catalog/option');\n\t\t$tshirt_option_names = array('Tshirt Color', 'Tshirt Style', 'Tshirt Size');\n\t\t$tshirt_colored = array(\n\t\t\t\"Black\",\n\t\t\t\"Charcoal Grey\",\n\t\t\t\"Daisy\",\n\t\t\t\"Dark Chocolate\",\n\t\t\t\"Forest Green\",\n\t\t\t\"Gold\",\n\t\t\t\"Irish Green\",\n\t\t\t\"Light Blue\",\n\t\t\t\"Light Pink\",\n\t\t\t\"Military Green\",\n\t\t\t\"Navy\",\n\t\t\t\"Orange\",\n\t\t\t\"Purple\",\n\t\t\t\"Red\",\n\t\t\t\"Royal Blue\",\n\t\t\t\"Sport Grey\",\n\t\t\t\"Tan\",\n\t\t\t\"Burgundy\"\n\t\t);\n\t\t$tshirt_ringer = array(\n\t\t\t\"Navy Ringer\",\n\t\t\t\"Black Ringer\",\n\t\t\t\"Red Ringer\"\n\t\t);\n\t\t$tshirt_options = array();\n\t\t$tshirt_options_price = array();\n\t\t$options = $this->model_catalog_option->getOptions();\n\t\t$temp_price = 0.0;\n\t\tforeach($options as $option){\n\t\t\t//if($option['name'] == 'Tshirt Color'){\n\t\t\t//\t$tshirtcolor_option_id = $option['option_id'];\n\t\t\t//}\n\t\t\t//if($option['name'] == 'Tshirt Style'){\n\t\t\t//\t$tshirtstyle_option_id = $option['option_id'];\n\t\t\t//}\n\t\t\t//if($option['name'] == 'Tshirt Size'){\n\t\t\t//\t$tshirtsize_option_id = $option['option_id'];\n\t\t\t//}\n\t\t\tif(in_array($option['name'], $tshirt_option_names)){\n\t\t\t\t$tshirt_options[$option['name']] = array();\n\t\t\t\t$tshirt_options[$option['name']]['option_id'] = $option['option_id'];\n\t\t\t\t$tshirt_options[$option['name']]['prices'] = array();\n\t\t\t}\n\t\t}\n\t\tforeach($tshirt_option_names as $tshirt_option_name){\n\t\t\t$option_value_descriptions = $this->model_catalog_option->getOptionValueDescriptions($tshirt_options[$tshirt_option_name]['option_id']);\n\t\t\tforeach($option_value_descriptions as $opv){\n\t\t\t\t$temp_price = 0.0;\n\t\t\t\tif($tshirt_option_name=='Tshirt Color'){\n\t\t\t\t\tif( in_array($opv['option_value_description'][1]['name'], $tshirt_colored )){\n\t\t\t\t\t\t$temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'ColorShirt' ));\n\t\t\t\t\t} elseif( in_array($opv['option_value_description'][1]['name'], $tshirt_ringer )){\n\t\t\t\t\t\t$temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'RingerShirt' ));\n\t\t\t\t\t} else { // white\n\t\t\t\t\t\t$temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'WhiteShirt' ));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif($tshirt_option_name=='Tshirt Style'){\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"Mens Fitted\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'MensFittedIncremental' ));\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"Ladies\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'LadiesIncremental' ));\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"Hooded Pullover\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'HoodieIncremental' ));\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"Apron\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'ApronIncremental' ));\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"Vneck\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'VneckIncremental' ));\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"Tanktop\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'TanktopIncremental' ));\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"Baby One Piece\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'BabyOnePieceIncremental' ));\n\t\t\t\t}\n\t\t\t\tif($tshirt_option_name=='Tshirt Size'){\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"2 X-Large\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'Shirt_2XL_Incremental' ));\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"3 X-Large\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'Shirt_3XL6XL_Incremental' ));\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"4 X-Large\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'Shirt_3XL6XL_Incremental' ));\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"5 X-Large\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'Shirt_3XL6XL_Incremental' ));\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"6 X-Large\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'Shirt_3XL6XL_Incremental' ));\n\t\t\t\t}\n\t\t\t\tif($temp_price != 0.0){\n\t\t\t\t\t$tshirt_options_price = array(\n\t\t\t\t\t\t'option_value_id' => $opv['option_value_id'],\n\t\t\t\t\t\t'name' => $opv['option_value_description'][1]['name'],\n\t\t\t\t\t\t'price' => $temp_price\n\t\t\t\t\t);\n\t\t\t\t\t$tshirt_options[$tshirt_option_name]['prices'][] = $tshirt_options_price;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tforeach($tshirt_options as $tso1){\n\t\t\tforeach($tso1['prices'] as $tso2){\n\t\t\t\t$sql = \"UPDATE \" . DB_PREFIX . \"product_option_value ocpov \";\n\t\t\t\t$sql .= \"LEFT JOIN \" . DB_PREFIX . \"product ocp \";\n\t\t\t\t$sql .= \" ON ocp.product_id = ocpov.product_id \";\n\t\t\t\t$sql .= \"LEFT JOIN \" . DB_PREFIX . \"tshirtgang_products tsgp \";\n\t\t\t\t$sql .= \" ON tsgp.product_id = ocp.product_id \";\n\t\t\t\t$sql .= \"SET ocpov.price=\". (float)$tso2['price'] . \" \";\n\t\t\t\t$sql .= \"WHERE \";\n\t\t\t\t$sql .= \" ocpov.option_value_id = \" . (int)$tso2['option_value_id'] . \" \";\n\t\t\t\t//$sql .= \" AND \";\n\t\t\t\t//$sql .= \" tsgp.id IS NOT NULL \";\n\t\t\t\t$this->db->query($sql);\n\t\t\t}\n\t\t}\n\t}", "public function addPricesToCollection($response)\n {\n if (isset($response['Book'])) {\n foreach ($response['Book'] as $offer) {\n $offer = (object) $offer;\n $price = $this->createNewPrice();\n if (isset($offer->listingPrice)) {\n if (isset($offer->listingCondition) && strtolower($offer->listingCondition) == 'new book') {\n $price->condition = parent::CONDITION_NEW;\n } elseif (isset($offer->itemCondition)) {\n $price->condition = $this->getConditionFromString($offer->itemCondition);\n }\n if (empty($price->condition)) {\n $price->condition = parent::CONDITION_GOOD;\n }\n $price->isbn13 = $offer->isbn13;\n $price->price = $offer->listingPrice;\n $price->shipping_price = $offer->firstBookShipCost;\n $price->url = 'http://affiliates.abebooks.com/c/74871/77797/2029?u='.urlencode($offer->listingUrl);\n $price->retailer = self::RETAILER;\n $price->term = parent::TERM_PERPETUAL;\n }\n $this->addPriceToCollection($price);\n }\n }\n return $this;\n }", "public function actionUpdateProductBuyBoxPrice()\n {\n $userData = User::find()->andWhere(['IS NOT', 'u_mws_seller_id', null])->all();\n\n foreach ($userData as $user) {\n $productData = FbaAllListingData::find()->andWhere(['created_by' => $user->u_id])->all();\n $skuData = AppliedRepriserRule::find()->select(['arr_sku'])->where(['arr_user_id' => $userData->u_id])->column();\n\n foreach ($productData as $product) {\n $productBuyBox = \\Yii::$app->api->getProductCompetitivePrice($product->seller_sku);\n $product->buybox_price = $productBuyBox;\n\n if(in_array($product->seller_sku, $skuData)) {\n $magicPrice = \\Yii::$app->api->getMagicRepricerPrice($product->seller_sku, $productBuyBox, $product->repricing_min_price, $product->repricing_max_price, $product->repricing_rule_id);\n if($magicPrice) {\n $product->repricing_cost_price = $magicPrice;\n }\n }\n\n if ($product->save(false)) {\n echo $product->asin1 . \" is Updated.\";\n }\n sleep(2);\n }\n sleep(1);\n }\n }", "public function setProductPrice($product_price){\n $this->product_price = $product_price;\n }", "public function __construct(PriceListRepositoryInterface $price_list)\n {\n parent::__construct();\n $this->repository = $price_list;\n $this->repository\n ->pushCriteria(\\Litepie\\Repository\\Criteria\\RequestCriteria::class)\n ->pushCriteria(\\Litecms\\Pricelist\\Repositories\\Criteria\\PriceListResourceCriteria::class);\n }", "public function update($listOfValue);", "public function getAdminList($paramPriceGroupId, $paramTaxPercentage)\r\n {\r\n $pricePlansHTML = '';\r\n $validPriceGroupId = StaticValidator::getValidPositiveInteger($paramPriceGroupId, 0);\r\n $validTaxPercentage = floatval($paramTaxPercentage);\r\n if($this->currencySymbolLocation == 0)\r\n {\r\n $printLeftCurrencySymbol = esc_html(sanitize_text_field($this->currencySymbol)).' ';\r\n $printRightCurrencySymbol = '';\r\n } else\r\n {\r\n $printLeftCurrencySymbol = '';\r\n $printRightCurrencySymbol = ' '.esc_html(sanitize_text_field($this->currencySymbol));\r\n }\r\n\r\n $pricePlanIds = $this->getAllIds($paramPriceGroupId);\r\n foreach($pricePlanIds AS $pricePlanId)\r\n {\r\n $objPricePlan = new PricePlan($this->conf, $this->lang, $this->settings, $pricePlanId);\r\n $pricePlanDetails = $objPricePlan->getDetails();\r\n\r\n if($pricePlanDetails['seasonal_price'] == 0)\r\n {\r\n // Regular prices\r\n $pricePlanEditLink = '<a href=\"'.admin_url('admin.php?page='.$this->conf->getURLPrefix().'add-edit-price-plan&amp;item_id='.$validPriceGroupId.'&amp;price_plan_id='.$pricePlanId).'\">'.$this->lang->getText('NRS_ADMIN_EDIT_TEXT').'</a>';\r\n $pricePlanDeleteLink = '';\r\n } else\r\n {\r\n // Seasonal prices\r\n $pricePlanEditLink = '<a href=\"'.admin_url('admin.php?page='.$this->conf->getURLPrefix().'add-edit-price-plan&amp;price_group_id='.$validPriceGroupId.'&amp;price_plan_id='.$pricePlanId).'\">'.$this->lang->getText('NRS_ADMIN_EDIT_TEXT').'</a>';\r\n $pricePlanDeleteLink = '<a href=\"'.admin_url('admin.php?page='.$this->conf->getURLPrefix().'add-edit-price-plan&amp;noheader=true&amp;delete_price_plan='.$pricePlanId).'\">'.$this->lang->getText('NRS_ADMIN_DELETE_TEXT').'</a>';\r\n }\r\n\r\n $dailyPriceTypeTitle = $this->lang->getText('NRS_PRICE_TEXT').' / '.$this->lang->getText('NRS_PER_DAY_SHORT_TEXT').'<br />';\r\n $hourlyPriceTypeTitle = $this->lang->getText('NRS_PRICE_TEXT').' / '.$this->lang->getText('NRS_PER_HOUR_SHORT_TEXT').'<br />';\r\n if($validTaxPercentage > 0)\r\n {\r\n $dailyPriceTypeTitle .= $this->lang->getText('NRS_PRICE_TEXT').' + '.$this->lang->getText('NRS_TAX_TEXT').' / '.$this->lang->getText('NRS_PER_DAY_SHORT_TEXT');\r\n $hourlyPriceTypeTitle .= $this->lang->getText('NRS_PRICE_TEXT').' + '.$this->lang->getText('NRS_TAX_TEXT').' / '.$this->lang->getText('NRS_PER_HOUR_SHORT_TEXT');\r\n }\r\n\r\n\r\n $dailyPrices = array();\r\n $hourlyPrices = array();\r\n foreach($objPricePlan->getWeekdays() AS $weekDay => $dayName)\r\n {\r\n\r\n $dailyPrice = $printLeftCurrencySymbol.number_format_i18n($pricePlanDetails['daily_rate_'.$weekDay], 2).$printRightCurrencySymbol;\r\n $dailyPrice .= $validTaxPercentage > 0 ? '<br />'.$printLeftCurrencySymbol.number_format_i18n($pricePlanDetails['daily_rate_'.$weekDay]*( 1 + $validTaxPercentage / 100), 2).$printRightCurrencySymbol : '';\r\n $dailyPrices[] = $dailyPrice;\r\n\r\n $hourlyPrice = $printLeftCurrencySymbol.number_format_i18n($pricePlanDetails['hourly_rate_'.$weekDay], 2);\r\n $hourlyPrice .= $validTaxPercentage > 0 ? '<br />'.$printLeftCurrencySymbol.number_format_i18n($pricePlanDetails['hourly_rate_'.$weekDay]*( 1 + $validTaxPercentage / 100), 2).$printRightCurrencySymbol : '';\r\n $hourlyPrices[] = $hourlyPrice;\r\n }\r\n\r\n // HTML OUTPUT: START\r\n $pricePlansHTML .= '<tr class=\"price-plan-heading\">';\r\n $pricePlansHTML .= '<td colspan=\"9\" class=\"price-plan-big-label\">'.$pricePlanDetails['print_label'].'</td>';\r\n $pricePlansHTML .= '</tr>';\r\n $pricePlansHTML .= '<tr>';\r\n $pricePlansHTML .= '<td class=\"price-plan-label\">'.$this->lang->getText('NRS_ADMIN_PRICE_TYPE_TEXT').'</td>';\r\n foreach($objPricePlan->getWeekdays() AS $weekDay => $dayName)\r\n {\r\n $pricePlansHTML .= '<td class=\"price-plan-label\">'.$dayName.'</td>';\r\n }\r\n $pricePlansHTML .= '<td class=\"price-plan-label\">&nbsp;</td>';\r\n $pricePlansHTML .= '</tr>';\r\n\r\n if(in_array($this->priceCalculationType, array(1, 3)))\r\n {\r\n // Price by days\r\n $pricePlansHTML .= '<tr class=\"odd\">';\r\n $pricePlansHTML .= '<td class=\"price-plan-description\">'.$dailyPriceTypeTitle.'</td>';\r\n foreach($dailyPrices AS $dailyPrice)\r\n {\r\n $pricePlansHTML .= '<td class=\"price-plan-label\">'.$dailyPrice.'</td>';\r\n }\r\n $pricePlansHTML .= '<td class=\"price-plan-links\">';\r\n if(in_array($this->priceCalculationType, array(1, 3)))\r\n {\r\n $pricePlansHTML .= '<span class=\"price-plan-link\">'.$pricePlanEditLink.'</span>';\r\n if($pricePlanDeleteLink)\r\n {\r\n $pricePlansHTML .= ' &nbsp;&nbsp;&nbsp;||&nbsp;&nbsp;&nbsp; ';\r\n $pricePlansHTML .= '<span class=\"price-plan-link\">'.$pricePlanDeleteLink.'</span>';\r\n }\r\n } else\r\n {\r\n $pricePlansHTML .= \"&nbsp;\";\r\n }\r\n $pricePlansHTML .= '</td>';\r\n $pricePlansHTML .= '</tr>';\r\n }\r\n\r\n if(in_array($this->priceCalculationType, array(2, 3)))\r\n {\r\n // Price by hours\r\n $pricePlansHTML .= '<tr class=\"even\">';\r\n $pricePlansHTML .= '<td class=\"price-plan-description\">'.$hourlyPriceTypeTitle.'</td>';\r\n foreach($hourlyPrices AS $hourlyPrice)\r\n {\r\n $pricePlansHTML .= '<td class=\"price-plan-label\">'.$hourlyPrice.'</td>';\r\n }\r\n $pricePlansHTML .= '<td class=\"price-plan-links\">';\r\n if($this->priceCalculationType == 2)\r\n {\r\n $pricePlansHTML .= '<span class=\"price-plan-link\">'.$pricePlanEditLink.'</span>';\r\n if($pricePlanDeleteLink)\r\n {\r\n $pricePlansHTML .= ' &nbsp;&nbsp;&nbsp;||&nbsp;&nbsp;&nbsp; ';\r\n $pricePlansHTML .= '<span class=\"price-plan-link\">'.$pricePlanDeleteLink.'</span>';\r\n }\r\n } else\r\n {\r\n $pricePlansHTML .= \"&nbsp;\";\r\n }\r\n $pricePlansHTML .= '</td>';\r\n $pricePlansHTML .= '</tr>';\r\n }\r\n // HTML OUTPUT: END\r\n }\r\n\r\n return $pricePlansHTML;\r\n }", "public static function updateDealProducts($deal_id, $order_data, $deal_info) {\n\t\t$result = false;\n\t\tif (self::checkConnection()) {\n\t\t\t$old_prod_rows = Rest::execute('crm.deal.productrows.get', [\n\t\t\t\t'id' => $deal_id\n\t\t\t]);\n\t\t\t$new_rows = [];\n\t\t\t// Products list of deal\n\t\t\tforeach ($order_data['PRODUCTS'] as $k => $item) {\n\t\t\t\t// Discount\n\t\t\t\t$price = $item['PRICE'];\n\t\t\t\t// Product fields\n\t\t\t\t$deal_prod = [\n\t\t\t\t\t'PRODUCT_NAME' => $item['PRODUCT_NAME'],\n\t\t\t\t\t'QUANTITY' => $item['QUANTITY'],\n\t\t\t\t\t'DISCOUNT_TYPE_ID' => 1,\n\t\t\t\t\t'DISCOUNT_SUM' => $item['DISCOUNT_SUM'],\n\t\t\t\t\t'MEASURE_CODE' => $item['MEASURE_CODE'],\n\t\t\t\t\t'TAX_RATE' => $item['TAX_RATE'],\n\t\t\t\t\t'TAX_INCLUDED' => $item['TAX_INCLUDED'],\n\t\t\t\t];\n\t\t\t\tif ($item['TAX_INCLUDED']) {\n\t\t\t\t\t$deal_prod['PRICE_EXCLUSIVE'] = $price;\n\t\t\t\t\t$deal_prod['PRICE'] = $price + $price * 0.01 * (int)$item['TAX_RATE'];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$deal_prod['PRICE'] = $price;\n\t\t\t\t}\n\t\t\t\t$new_rows[] = $deal_prod;\n\t\t\t}\n//\t\t\t// Delivery\n//\t\t\t$delivery_sync_type = Settings::get('products_delivery');\n//\t\t\tif (!$delivery_sync_type || ($delivery_sync_type == 'notnull' && $order_data['DELIVERY_PRICE'])) {\n//\t\t\t\t$new_rows[] = [\n//\t\t\t\t\t'PRODUCT_ID' => 'delivery',\n//\t\t\t\t\t'PRODUCT_NAME' => Loc::getMessage(\"SP_CI_PRODUCTS_DELIVERY\"),\n//\t\t\t\t\t'PRICE' => $order_data['DELIVERY_PRICE'],\n//\t\t\t\t\t'QUANTITY' => 1,\n//\t\t\t\t];\n//\t\t\t}\n\t\t\t// Check changes\n\t\t\t$new_rows = self::convEncForDeal($new_rows);\n\t\t\t$has_changes = false;\n\t\t\tif (count($new_rows) != count($old_prod_rows)) {\n\t\t\t\t$has_changes = true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tforeach ($new_rows as $j => $row) {\n\t\t\t\t\tforeach ($row as $k => $value) {\n\t\t\t\t\t\tif ($value != $old_prod_rows[$j][$k]) {\n\t\t\t\t\t\t\t$has_changes = true;\n\t\t\t\t\t\t\tcontinue 2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Send request\n\t\t\tif ($has_changes) {\n\t\t\t\t//\\Helper::Log('(updateDealProducts) deal '.$deal_id.' changed products '.print_r($new_rows, true));\n\t\t\t\t$resp = Rest::execute('crm.deal.productrows.set', [\n\t\t\t\t\t'id' => $deal_id,\n\t\t\t\t\t'rows' => $new_rows\n\t\t\t\t]);\n\t\t\t\tif ($resp) {\n\t\t\t\t\t$result = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "public function getPriceList($priceListCode, $responseFields = null)\r\n\t{\r\n\t\t$mozuClient = PriceListClient::getPriceListClient($priceListCode, $responseFields);\r\n\t\t$mozuClient = $mozuClient->withContext($this->apiContext);\r\n\t\t$mozuClient->execute();\r\n\t\treturn $mozuClient->getResult();\r\n\r\n\t}", "function getArticlesByPrice($priceMin=0, $priceMax=0, $usePriceGrossInstead=0, $proofUid=1){\n //first get all real articles, then create objects and check prices\n\t //do not get prices directly from DB because we need to take (price) hooks into account\n\t $table = 'tx_commerce_articles';\n\t $where = '1=1';\n\t if($proofUid){\n\t $where.= ' and tx_commerce_articles.uid_product = '.$this->uid;\n\t }\t\n //todo: put correct constant here\n\t $where.= ' and article_type_uid=1';\n\t $where.= $this->cObj->enableFields($table);\n\t $groupBy = '';\n\t $orderBy = 'sorting';\n\t $limit = '';\n\t $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery (\n\t 'uid', $table,\n\t $where, $groupBy,\n\t $orderBy,$limit\n\t );\n\t $rawArticleUidList = array();\n\t while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n\t $rawArticleUidList[] = $row['uid'];\n\t }\n\t $GLOBALS['TYPO3_DB']->sql_free_result($res);\n\t \n\t //now run the price test\n\t $articleUidList = array();\n\t foreach ($rawArticleUidList as $rawArticleUid) {\n\t\t $tmpArticle = new tx_commerce_article($rawArticleUid,$this->lang_uid);\n\t\t $tmpArticle->load_data();\n\t\t\t $myPrice = $usePriceGrossInstead ? $tmpArticle->get_price_gross() : $tmpArticle->get_price_net();\n\t\t\t if (($priceMin <= $myPrice) && ($myPrice <= $priceMax)) {\n\t\t\t $articleUidList[] = $tmpArticle->get_uid();\n\t\t\t }\n\t\t }\n if(count($articleUidList)>0){\n return $articleUidList;\n }else{\n return false;\n\t }\n\t}", "public function store(Request $request)\n {\n // return json_decode($request->pricelist_items);\n $pricelist = $this->pricelist->create($request->except('pricelist_items'));\n $priceListItems = [];\n $requestPricelistItems = json_decode($request->pricelist_items);\n foreach ( $requestPricelistItems as $pricelistItem) {\n array_push($priceListItems, [\n 'price_list_id' => $pricelist->id,\n 'waste_id' => $pricelistItem->waste_id,\n 'unit_id' => $pricelistItem->unit_id,\n 'unit_price' => $pricelistItem->unit_price\n ]);\n }\n $pricelist->wastes()->attach($priceListItems);\n return redirect()->route('settings.pricelists')\n ->with('success', 'Pricelist has been created!');\n }", "public function scalePrices($product)\n {\n \n // Get the configurable Id\n $configurableId = $this->getConfigurableId($product);\n \n // Check we actually have a configurable product\n if ($configurableId > 0)\n {\n // Get the configurable product and associated base price\n // Please note the price will not be the actual configurable, price but the cheapest price from all the simple products\n $configurableProduct = Mage::getSingleton(\"catalog/Product\")->load($configurableId);\n $configurablePrice = $configurableProduct->getPrice();\n \n // Get current attribute data\n $configurableAttributesData = $configurableProduct->getTypeInstance()->getConfigurableAttributesAsArray();\n $configurableProductsData = array();\n \n // We need to identify the attribute name and Id\n $prodAttrName = $this->getAttributeName($configurableProduct);\n $prodAttrId = $this->getAttributeId($prodAttrName);\n \n // Get associates simple products\n $associatedProducts = $configurableProduct->getTypeInstance()->getUsedProducts();\n foreach ($associatedProducts as $prodList)\n {\n // For each associated simple product gather the data and calculate the extra fixed price\n $prodId = $prodList->getId();\n $prodAttrLabel = $prodList->getAttributeText($prodAttrName);\n $prodAttrValueIndex = $prodList[$prodAttrName];\n $prodScalePrice = $prodList['price'] - $configurablePrice;\n \n $productData = array(\n 'label' => $prodAttrLabel,\n 'attribute_id' => $prodAttrId,\n 'value_index' => $prodAttrValueIndex,\n 'pricing_value' => $prodScalePrice,\n 'is_percent' => '0'\n );\n $configurableProductsData[$prodId] = $productData;\n $configurableAttributesData[0]['values'][] = $productData;\n }\n \n $configurableProduct->setConfigurableProductsData($configurableProductsData);\n $configurableProduct->setConfigurableAttributesData($configurableAttributesData);\n $configurableProduct->setCanSaveConfigurableAttributes(true);\n Mage::log($configurableProductsData, null, 'configurableProductsData.log', true);\n Mage::log($configurableAttributesData, null, 'configurableAttributesData.log', true);\n \n try\n {\n $configurableProduct->save(); \n }\n catch (Exception $e)\n {\n $this->_debug($e->getMessage());\n }\n \n } \n }", "public function productPriceSetMeta( $thisProd, $post_id='', $return=true ) {\n\t\t\t$ret = array();\n\t\t\t$o = array(\n\t\t\t\t'ItemAttributes'\t\t=> isset($thisProd['ItemAttributes']['ListPrice']) ? array('ListPrice' => $thisProd['ItemAttributes']['ListPrice']) : array(),\n\t\t\t\t'Offers'\t\t\t\t=> isset($thisProd['Offers']) ? $thisProd['Offers'] : array(),\n\t\t\t\t'OfferSummary'\t\t\t=> isset($thisProd['OfferSummary']) ? $thisProd['OfferSummary'] : array(),\n\t\t\t\t'VariationSummary'\t\t=> isset($thisProd['VariationSummary']) ? $thisProd['VariationSummary'] : array(),\n\t\t\t);\n\t\t\tupdate_post_meta($post_id, '_amzaff_amzRespPrice', $o);\n\t\t\t\n\t\t\t// Offers/Offer/OfferListing/IsEligibleForSuperSaverShipping\n\t\t\tif ( isset($o['Offers']['Offer']['OfferListing']['IsEligibleForSuperSaverShipping']) ) {\n\t\t\t\t$ret['isSuperSaverShipping'] = $o['Offers']['Offer']['OfferListing']['IsEligibleForSuperSaverShipping'] === true ? 1 : 0;\n\t\t\t\tupdate_post_meta($post_id, '_amzaff_isSuperSaverShipping', $ret['isSuperSaverShipping']);\n\t\t\t}\n\t\t\t\n\t\t\t// Offers/Offer/OfferListing/Availability\n\t\t\tif ( isset($o['Offers']['Offer']['OfferListing']['Availability']) ) {\n\t\t\t\t$ret['availability'] = (string) $o['Offers']['Offer']['OfferListing']['Availability'];\n\t\t\t\tupdate_post_meta($post_id, '_amzaff_availability', $ret['availability']);\n\t\t\t}\n\t\t\t\n\t\t\treturn $ret;\n\t\t}", "public function buildArticleList(Mage_Sales_Model_Abstract $entity, $context)\n {\n if ($context == self::TYPE_PI) {\n return array();\n }\n // collection adjustment fees is not supported by billsafe\n if (self::TYPE_RF == $context && $entity->getAdjustmentNegative()) {\n throw new Mage_Core_Exception($this->getHelper()->__(\n 'Add adjustment fees is not supported by BillSAFE'\n ));\n }\n\n $order = $entity;\n if (in_array($context, array(self::TYPE_RS, self::TYPE_RF))) {\n $order = $entity->getOrder();\n }\n\n $data = array();\n $items = $this->getAllOrderItems($entity, $order, $context);\n\n $remainShipItemQty = $this->getRemainingShipmentItemQty(\n $order, $context\n );\n\n\n\n $taxAmount = 0;\n $amount = 0;\n $paymentFeeItem = null;\n // order items\n $orderItemData = $this->getOrderItemData(\n $items, $amount, $taxAmount, $context\n );\n\n /*\n * append any virtual products to the last shipping, so that the billsafe state is changed correctly\n *\n */\n if (($context == self::TYPE_RS && $this->areAllPhysicalItemsShipped($order))\n || $context == self::TYPE_VO || $context == self::TYPE_VO) {\n $amount = $orderItemData['amount'];\n $taxAmount = $orderItemData['tax_amount'];\n $virtualItemData = $this->getVirtualItemData($order, $amount, $taxAmount, $context);\n if (0 < count($virtualItemData['data'])) {\n $orderItemData['data'] = array_merge($orderItemData['data'], $virtualItemData['data']);\n $orderItemData['amount'] = $virtualItemData['amount'];\n $orderItemData['tax_amount'] = $virtualItemData['tax_amount'];\n }\n }\n\n if (0 < count($orderItemData)) {\n if (array_key_exists('payment_fee_item', $orderItemData)) {\n $paymentFeeItem = $orderItemData['payment_fee_item'];\n }\n if (array_key_exists('data', $orderItemData)) {\n $data = $orderItemData['data'];\n }\n if (array_key_exists('amount', $orderItemData)) {\n $amount = $orderItemData['amount'];\n }\n if (array_key_exists('tax_amount', $orderItemData)) {\n $taxAmount = $orderItemData['tax_amount'];\n }\n }\n //shipping item data\n $shippingItemData = $this->getShippingItemData($order, $context);\n if (0 < count($shippingItemData)) {\n $data[] = $shippingItemData;\n $amountExclTax\n = $order->getShippingAmount() - $order->getShippingRefunded();\n $amount += round(\n $amountExclTax * (1 +\n $this->getShippingTaxPercent($order) / 100)\n );\n $taxAmount += round($amount - $amountExclTax, 2);\n }\n // discount item\n $discountItemData = $this->getDiscountItemData($order, $context);\n if (0 < count($discountItemData)) {\n $data[] = $discountItemData;\n $amount -= $order->getDiscountAmount();\n }\n // adjustment (refund)\n $adjustmentData = $this->getAdjustmentData($order, $context, $amount);\n if (0 < count($adjustmentData)) {\n if (array_key_exists('data', $adjustmentData)) {\n $data[] = $adjustmentData['data'];\n }\n if (array_key_exists('amount', $adjustmentData)) {\n $amount = $adjustmentData['amount'];\n }\n }\n\n // payment fee\n $paymentFeeData = $this->getPaymentFeeData(\n $paymentFeeItem, $context, $amount, $taxAmount\n );\n if (0 < count($paymentFeeData)) {\n if (array_key_exists('data', $paymentFeeData)) {\n $data[] = $paymentFeeData['data'];\n }\n if (array_key_exists('amount', $paymentFeeData)) {\n $amount = $paymentFeeData['amount'];\n }\n if (array_key_exists('tax_amount', $paymentFeeData)) {\n $taxAmount = $paymentFeeData['tax_amount'];\n }\n }\n // special refund\n if (self::TYPE_RF == $context) {\n $data['tax_amount'] = $taxAmount;\n $data['amount'] = $amount;\n }\n return $data;\n }", "public function setPriceListInfo(\\Diadoc\\Api\\Proto\\Docflow\\PriceListDocumentInfo $value=null)\n {\n return $this->set(self::PRICELISTINFO, $value);\n }", "public function cleanProductsInCatalogPriceRule(Varien_Event_Observer $observer) {\n /**\n * @var $engine Brim_PageCache_Model_Engine\n * @var $rule Mage_CatalogRule_Model_Rule\n */\n\n $engine = Mage::getSingleton('brim_pagecache/engine');\n\n if (!$engine->isEnabled()) {\n return;\n }\n\n $engine->devDebug(__METHOD__);\n\n $tags = array();\n $rule = $observer->getEvent()->getRule();\n foreach ($rule->getMatchingProductIds() as $productId) {\n $tags[] = Brim_PageCache_Model_Engine::FPC_TAG . '_PRODUCT_' . $productId;\n }\n $engine->devDebug($tags);\n Mage::app()->getCacheInstance()->clean($tags);\n }", "public function getPriceList() {\n\t\tif( count($this->prices) > 0 ) {\n\t\t\tthrow new \\InvalidArgumentException(sprintf('The name \"%s\" is invalid.', $name));\n\t\t}\n\t\treturn $this->prices;\n\t}", "public function run()\n {\n ProductPrice::insert(\n \t[\n \t[\"product_id\" => 1,\n \t \"description\" => \"economical\",\n \t \"price\" => 10000\n \t],\n \t[\"product_id\" => 1,\n \t \"description\" => \"default\",\n \t \"price\" => 100000\n \t],\n \t[\"product_id\" => 1,\n \t \"description\" => \"plus\",\n \t \"price\" => 1000000\n \t],\n \t[\"product_id\" => 2,\n \t \"description\" => \"economical\",\n \t \"price\" => 10000\n \t],\n \t[\"product_id\" => 2,\n \t \"description\" => \"default\",\n \t \"price\" => 100000\n \t],\n \t[\"product_id\" => 2,\n \t \"description\" => \"plus\",\n \t \"price\" => 1000000\n \t],\n \t[\"product_id\" => 3,\n \t \"description\" => \"economical\",\n \t \"price\" => 10000\n \t],\n \t[\"product_id\" => 3,\n \t \"description\" => \"default\",\n \t \"price\" => 100000\n \t],\n \t[\"product_id\" => 3,\n \t \"description\" => \"plus\",\n \t \"price\" => 1000000\n \t],\n \t[\"product_id\" => 4,\n \t \"description\" => \"economical\",\n \t \"price\" => 10000\n \t],\n \t[\"product_id\" => 4,\n \t \"description\" => \"default\",\n \t \"price\" => 100000\n \t],\n \t[\"product_id\" => 4,\n \t \"description\" => \"plus\",\n \t \"price\" => 1000000\n \t],\n \t[\"product_id\" => 5,\n \t \"description\" => \"economical\",\n \t \"price\" => 10000\n \t],\n \t[\"product_id\" => 5,\n \t \"description\" => \"default\",\n \t \"price\" => 100000\n \t],\n \t[\"product_id\" => 5,\n \t \"description\" => \"plus\",\n \t \"price\" => 1000000\n \t]\n \t]);\n }", "private function validatePrice(array $price)\n {\n if (empty($price) || empty($price['product_id']) || !isset($price['custom_price'])\n || !isset($price['price_type']) || !isset($price['website_id'])\n ) {\n return false;\n }\n\n $customPrices = $this->getStorage()->getProductPrices($price['product_id']);\n if (!$this->productItemTierPriceValidator->canChangePrice($customPrices, $price['website_id'])) {\n return false;\n }\n\n return true;\n }", "private function updateQuoteItemPrices(CartInterface $quote)\n {\n $negotiableQuote = $quote->getExtensionAttributes()->getNegotiableQuote();\n $quoteId = $quote->getId();\n if (!in_array($quoteId, $this->updatedQuoteIds)) {\n $this->updatedQuoteIds[] = $quoteId;\n if ($negotiableQuote->getNegotiatedPriceValue() === null) {\n $this->quoteItemManagement->recalculateOriginalPriceTax($quote->getId(), true, true, false, false);\n } else {\n $this->quoteItemManagement->updateQuoteItemsCustomPrices($quote->getId(), false);\n }\n }\n }", "protected function AddPriceRangeToFilterList($AllPriceArray, $PriceColumnName){\n\t\n\t\t$AmountBreakPoints\t= array(\n\t\t\t\t100 \t=> 2,\n\t\t\t\t300 \t=> 3,\n\t\t\t\t600 \t=> 3,\n\t\t\t\t900 \t=> 3,\n\t\t\t\t1200 \t=> 4,\n\t\t\t\t1600 \t=> 4\n\t\t);\n\t\n\t\t$uniquePriceNumber = count($AllPriceArray);\n\t\n\t\tif( $uniquePriceNumber <= 1) return false;\n\t\n\t\t//sort the price array - hight -> low\n\t\tkrsort($AllPriceArray);\n\t\n\t\t$MaxPrice = floatval(key($AllPriceArray));\n\t\n\t\t//calculate and define the price range groups number\n\t\t$GroupNumber \t= 2;\n\t\t$RangeMax\t\t= -1;\n\t\t$RangeMin\t\t= 0;\n\t\tforeach ($AmountBreakPoints as $CurrentAmount => $gaps){\n\t\t\tif($MaxPrice < $CurrentAmount){\n\t\t\t\t$RangeMax \t\t= $CurrentAmount;\n\t\t\t\t$GroupNumber \t= $gaps;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\n\t\t//out of range, then set the highest amount of $AmountBreakPoints\n\t\tif($RangeMax < 0){\n\t\t\t$RangeMax \t\t= key(krsort($AllPriceArray));\n\t\t\t$GroupNumber\t= $AmountBreakPoints[$RangeMax];\n\t\t}\n\t\n\t\t//create all ranges and save them into $optionsArray\n\t\t$optionsArray = array();\n\t\t// Sample ------\n\t\t// \t\t$optionsArray = array(\n\t\t// \t\t\t0 => array(\n\t\t//\t\t\t\t\t'OptionProductCount' \t=> 1,\n\t\t//\t\t\t\t\t'Price' \t\t\t\t=> 1,\n\t\t//\t\t\t\t\t'StartPrice' \t\t\t=> '10.0000',\n\t\t//\t\t\t\t\t'EndPrice' \t\t\t\t=> '20.0000'\n\t\t// \t\t\t\t),\n\t\t// \t\t\t1 => array(\n\t\t//\t\t\t\t\t'OptionProductCount' => 1\n\t\t//\t\t\t\t\t'OptionProductCount' \t=> 1,\n\t\t//\t\t\t\t\t'Price' \t\t\t\t=> 1,\n\t\t//\t\t\t\t\t'StartPrice' \t\t\t=> '20.0000',\n\t\t//\t\t\t\t\t'EndPrice' \t\t\t\t=> '30.0000'\n\t\t// \t\t\t)\n\t\t// \t\t);\n\t\n\t\t$i = 1;\n\t\t$Interval \t\t= ($RangeMax / $GroupNumber);\n\t\t$startAmount\t= 0;\n\t\t$endAmount\t\t= 0;\n\t\n\t\twhile ($i <= $GroupNumber){\n\t\t\t$startAmount\t= $Interval * ($i - 1);\n\t\t\t$endAmount\t\t= $Interval * $i;\n\t\n\t\t\t$priceArray = array();\n\t\n\t\t\t$productCount = 0;\n\t\n\t\t\tforeach ($AllPriceArray as $amount => $pCount){\n\t\t\t\tif($startAmount <= $amount && $amount < $endAmount){\n\t\t\t\t\t$productCount += $pCount;\n\t\t\t\t\tunset($AllPriceArray[$amount]);\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t$priceArray['OptionProductCount'] = $productCount;\n\t\t\t$priceArray['StartAmount'] \t= $startAmount;\n\t\t\t$priceArray['EndAmount'] \t= $endAmount;\n\t\n\t\t\t$optionsArray[] = $priceArray;\n\t\n\t\t\t$i++;\n\t\t}\n\t\t\n\t\t$title = Config::inst()->get($this->ClassName, 'FilterTitle');\n\t\t$title = $title ? $title : 'Price';\n\t\t\n\t\treturn array($title => $optionsArray);\n\t}" ]
[ "0.8053601", "0.7953346", "0.78466886", "0.6910239", "0.6182719", "0.5942458", "0.5900398", "0.5870045", "0.5772021", "0.5628682", "0.54029894", "0.53815985", "0.53034997", "0.5288748", "0.5253512", "0.52269745", "0.51821995", "0.50462675", "0.50366855", "0.50121194", "0.49994066", "0.49949798", "0.49896595", "0.49512666", "0.49190384", "0.49172625", "0.48833874", "0.48532882", "0.4848767", "0.48403987", "0.48173374", "0.4814647", "0.48069644", "0.47966617", "0.47635907", "0.4748367", "0.47399938", "0.47393897", "0.47380352", "0.4722292", "0.47080287", "0.47039917", "0.46939695", "0.46872067", "0.4676992", "0.4674889", "0.46696216", "0.4665126", "0.46607682", "0.46520603", "0.46428168", "0.46360078", "0.4633792", "0.46302593", "0.46195275", "0.46033934", "0.459388", "0.45921156", "0.4560494", "0.45460954", "0.45425707", "0.45425093", "0.4537527", "0.44971618", "0.44941214", "0.4490451", "0.44893873", "0.4483067", "0.4481914", "0.44761539", "0.44733843", "0.44710615", "0.44691363", "0.44641882", "0.446174", "0.4455788", "0.44521213", "0.4448007", "0.44463307", "0.442589", "0.4412114", "0.4403506", "0.43984565", "0.4394379", "0.4389144", "0.43799242", "0.4375626", "0.43735582", "0.4368892", "0.43636456", "0.43599764", "0.43533763", "0.4351634", "0.43430558", "0.43263873", "0.4323872", "0.43218356", "0.43190005", "0.43176416", "0.43171367" ]
0.7766696
3
Specification: Publish price list prices for product abstracts. Uses the given abstract product IDs. Merges created or updated prices to the existing ones.
public function publishAbstractPriceProductByByProductAbstractIds(array $productAbstractIds): void;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function publishAbstractPriceProductPriceList(array $priceProductPriceListIds): void;", "public function publishConcretePriceProductPriceList(array $priceProductPriceListIds): void;", "public function publishAbstractPriceProductPriceListByIdPriceList(int $idPriceList): void;", "public function publishConcretePriceProductByProductIds(array $productIds): void;", "public function publishConcretePriceProductPriceListByIdPriceList(int $idPriceList): void;", "public function updateprices()\n {\n\n $aParams = oxRegistry::getConfig()->getRequestParameter(\"updateval\");\n if (is_array($aParams)) {\n foreach ($aParams as $soxId => $aStockParams) {\n $this->addprice($soxId, $aStockParams);\n }\n }\n }", "public function updatePrices($contractId, $priceList);", "function updateAmazonProductsPrices($items)\n{\n\tif (sizeof($items) > 0) {\n\t\t$data['lastmod'] = time();\n\t\t$data['lastmod_user'] = getAmazonSessionUserId();\n\t\t$data['lastpriceupdate'] = time();\n\t\t$data['submitedProduct'] = 0;\n\t\t$data['submitedPrice'] = 0;\n\t\t$data['upload'] = 1;\n\t\t$caseStandardPrice = \"StandardPrice = CASE\";\n\t\tforeach($items as $key => $item)\n\t\t{\n\t\t\t$caseStandardPrice.= \"\\n WHEN id_product = \" . $items[$key]['id_product'] . \" THEN \" . $items[$key]['price'];\n\t\t\t$productsIds[] = $items[$key]['id_product'];\n\t\t}\n\t\t$caseStandardPrice.= \"\n\t\t\tEND\n\t\t\tWHERE id_product IN (\" . implode(\", \", $productsIds) . \")\n\t\t\";\n\t\t$addWhere\t = $caseStandardPrice;\n\t\tSQLUpdate('amazon_products', $data, $addWhere, 'shop', __FILE__, __LINE__);\n\t}\n}", "public function calculatePrices(): void\n {\n $orders = ServiceContainer::orders();\n $pizzaPrice = $orders->calculatePizzaPrice($this->items);\n $deliveryPrice = $orders->calculateDeliveryPrice($pizzaPrice, $this->outside, $this->currency);\n $this->delivery_price = $deliveryPrice;\n $this->total_price = $pizzaPrice + $deliveryPrice;\n }", "public function api_update_price(){\n $watchlists = $this->wr->all();\n foreach($watchlists as $watchlist)\n {\n $current_price = $this->get_quotes($watchlist->id);\n\n $this->wr->update([\n 'current_price' => $current_price,\n ],$watchlist->id);\n }\n }", "protected function patchProductsVariantsPricelistPriceRequest($body, $product_id, $variant_id, $pricelist_id)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling patchProductsVariantsPricelistPrice'\n );\n }\n // verify the required parameter 'product_id' is set\n if ($product_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $product_id when calling patchProductsVariantsPricelistPrice'\n );\n }\n if ($product_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$product_id\" when calling DefaultApi.patchProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'variant_id' is set\n if ($variant_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $variant_id when calling patchProductsVariantsPricelistPrice'\n );\n }\n if ($variant_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$variant_id\" when calling DefaultApi.patchProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'pricelist_id' is set\n if ($pricelist_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pricelist_id when calling patchProductsVariantsPricelistPrice'\n );\n }\n if ($pricelist_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$pricelist_id\" when calling DefaultApi.patchProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n $resourcePath = '/products/{productId}/variants/{variantId}/prices/{pricelistId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($product_id !== null) {\n $resourcePath = str_replace(\n '{' . 'productId' . '}',\n ObjectSerializer::toPathValue($product_id),\n $resourcePath\n );\n }\n // path params\n if ($variant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'variantId' . '}',\n ObjectSerializer::toPathValue($variant_id),\n $resourcePath\n );\n }\n // path params\n if ($pricelist_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pricelistId' . '}',\n ObjectSerializer::toPathValue($pricelist_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n \n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PATCH',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function putProductsVariantsPricelistPriceRequest($body, $product_id, $variant_id, $pricelist_id)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling putProductsVariantsPricelistPrice'\n );\n }\n // verify the required parameter 'product_id' is set\n if ($product_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $product_id when calling putProductsVariantsPricelistPrice'\n );\n }\n if ($product_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$product_id\" when calling DefaultApi.putProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'variant_id' is set\n if ($variant_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $variant_id when calling putProductsVariantsPricelistPrice'\n );\n }\n if ($variant_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$variant_id\" when calling DefaultApi.putProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'pricelist_id' is set\n if ($pricelist_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pricelist_id when calling putProductsVariantsPricelistPrice'\n );\n }\n if ($pricelist_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$pricelist_id\" when calling DefaultApi.putProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n $resourcePath = '/products/{productId}/variants/{variantId}/prices/{pricelistId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($product_id !== null) {\n $resourcePath = str_replace(\n '{' . 'productId' . '}',\n ObjectSerializer::toPathValue($product_id),\n $resourcePath\n );\n }\n // path params\n if ($variant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'variantId' . '}',\n ObjectSerializer::toPathValue($variant_id),\n $resourcePath\n );\n }\n // path params\n if ($pricelist_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pricelistId' . '}',\n ObjectSerializer::toPathValue($pricelist_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n \n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function editPrices() {\n\t\tglobal $HTML;\n\t\tglobal $page;\n\t\tglobal $id;\n\t\t$HTML->details(1);\n\n\t\t$this->getPrices();\n\n\t\t$price_groups = $this->priceGroupClass->getItems();\n\t\t$countries = $this->countryClass->getItems();\n\n\t\t$_ = '';\n\t\t$_ .= '<div class=\"c init:form form:action:'.$page->url.'\" id=\"container:prices\">';\n\t\t$_ .= '<div class=\"c\">';\n\n\t\t$_ .= $HTML->inputHidden(\"id\", $id);\n\t\t$_ .= $HTML->inputHidden(\"item_id\", $id);\n\n\t\t$_ .= $HTML->head(\"Prices\", \"2\");\n\n\t\tif(Session::getLogin()->validatePage(\"prices_update\")) {\n\t\t\t$_ .= $HTML->inputHidden(\"page_status\", \"prices_update\");\n\t\t}\n\n\t\tif($this->item() && count($this->item[\"id\"]) == 1) {\n\n\t\t\tforeach($countries[\"id\"] as $country_key => $country_id) {\n\n\t\t\t\t$_ .= '<div class=\"ci33\">';\n\n\t\t\t\t\t$_ .= $HTML->head($countries[\"values\"][$country_key], 3);\n\n\t\t\t\t\tforeach($price_groups[\"uid\"] as $index => $price_group_uid) {\n\t\t\t\t\t\t$price = ($this->item[\"price\"][0] && isset($this->item[\"price\"][0][$country_id][$price_group_uid])) ? $this->item[\"price\"][0][$country_id][$price_group_uid] : \"\";\n\t\t\t\t\t\t$_ .= $HTML->input($price_groups[\"values\"][$index], \"prices[$country_id][$price_group_uid]\", $price);\n\t\t\t\t\t}\n\n\t\t\t\t\t$_ .= $HTML->separator();\n\t\t\t\t$_ .= '</div>';\n\n\t\t\t}\n\t\t}\n\n\t\t$_ .= '</div>';\n\n\t\t$_ .= $HTML->smartButton($this->translate(\"Cancel\"), false, \"prices_cancel\", \"fleft key:esc\");\n\t\t$_ .= $HTML->smartButton($this->translate(\"Save\"), false, \"prices_update\", \"fright key:s\");\n\n\t\t$_ .= '</div>';\n\n\t\treturn $_;\n\t}", "public function test_comicEntityIsCreated_prices_setPrices()\n {\n $sut = $this->getSUT();\n $prices = $sut->getPrices();\n $expected = [\n Price::create(\n 'printPrice',\n 19.99\n ),\n ];\n\n $this->assertEquals($expected, $prices);\n }", "public function addprice($sOXID = null, $aUpdateParams = null)\n {\n $myConfig = $this->getConfig();\n\n $this->resetContentCache();\n\n $sOxArtId = $this->getEditObjectId();\n\n\n\n $aParams = oxRegistry::getConfig()->getRequestParameter(\"editval\");\n\n if (!is_array($aParams)) {\n return;\n }\n\n if (isset($aUpdateParams) && is_array($aUpdateParams)) {\n $aParams = array_merge($aParams, $aUpdateParams);\n }\n\n //replacing commas\n foreach ($aParams as $key => $sParam) {\n $aParams[$key] = str_replace(\",\", \".\", $sParam);\n }\n\n $aParams['oxprice2article__oxshopid'] = $myConfig->getShopID();\n\n if (isset($sOXID)) {\n $aParams['oxprice2article__oxid'] = $sOXID;\n }\n\n $aParams['oxprice2article__oxartid'] = $sOxArtId;\n if (!isset($aParams['oxprice2article__oxamount']) || !$aParams['oxprice2article__oxamount']) {\n $aParams['oxprice2article__oxamount'] = \"1\";\n }\n\n if (!$myConfig->getConfigParam('blAllowUnevenAmounts')) {\n $aParams['oxprice2article__oxamount'] = round(( string ) $aParams['oxprice2article__oxamount']);\n $aParams['oxprice2article__oxamountto'] = round(( string ) $aParams['oxprice2article__oxamountto']);\n }\n\n $dPrice = $aParams['price'];\n $sType = $aParams['pricetype'];\n\n $oArticlePrice = oxNew(\"oxbase\");\n $oArticlePrice->init(\"oxprice2article\");\n $oArticlePrice->assign($aParams);\n\n $oArticlePrice->$sType = new oxField($dPrice);\n\n //validating\n if ($oArticlePrice->$sType->value &&\n $oArticlePrice->oxprice2article__oxamount->value &&\n $oArticlePrice->oxprice2article__oxamountto->value &&\n is_numeric($oArticlePrice->$sType->value) &&\n is_numeric($oArticlePrice->oxprice2article__oxamount->value) &&\n is_numeric($oArticlePrice->oxprice2article__oxamountto->value) &&\n $oArticlePrice->oxprice2article__oxamount->value <= $oArticlePrice->oxprice2article__oxamountto->value\n ) {\n $oArticlePrice->save();\n }\n\n // check if abs price is lower than base price\n $oArticle = oxNew(\"oxArticle\");\n $oArticle->loadInLang($this->_iEditLang, $sOxArtId);\n $sPriceField = 'oxarticles__oxprice';\n if (($aParams['price'] >= $oArticle->$sPriceField->value) &&\n ($aParams['pricetype'] == 'oxprice2article__oxaddabs')) {\n if (is_null($sOXID)) {\n $sOXID = $oArticlePrice->getId();\n }\n $this->_aViewData[\"errorscaleprice\"][] = $sOXID;\n }\n\n }", "public function run()\n {\n $prices = [\n [\n 'product_id' => 2,\n 'user_id' => 3,\n 'price' => 18,\n 'created_at' => now(),\n 'updated_at' => now()\n ],\n [\n 'product_id' => 3,\n 'user_id' => 3,\n 'price' => 15,\n 'created_at' => now(),\n 'updated_at' => now()\n ],\n [\n 'product_id' => 2,\n 'user_id' => 4,\n 'price' => 18,\n 'created_at' => now(),\n 'updated_at' => now()\n ],\n [\n 'product_id' => 3,\n 'user_id' => 4,\n 'price' => 15,\n 'created_at' => now(),\n 'updated_at' => now()\n ],\n ];\n ProductPrice::query()->insert($prices);\n }", "function _prepareGroupedProductPriceData($entityIds = null) {\n\t\t\t$write = $this->_getWriteAdapter( );\n\t\t\t$table = $this->getIdxTable( );\n\t\t\t$select = $write->select( )->from( array( 'e' => $this->getTable( 'catalog/product' ) ), 'entity_id' )->joinLeft( array( 'l' => $this->getTable( 'catalog/product_link' ) ), 'e.entity_id = l.product_id AND l.link_type_id=' . LINK_TYPE_GROUPED, array( ) )->join( array( 'cg' => $this->getTable( 'customer/customer_group' ) ), '', array( 'customer_group_id' ) );\n\t\t\t$this->_addWebsiteJoinToSelect( $select, true );\n\t\t\t$this->_addProductWebsiteJoinToSelect( $select, 'cw.website_id', 'e.entity_id' );\n\n\t\t\tif ($this->getVersionHelper( )->isGe1600( )) {\n\t\t\t\t$minCheckSql = $write->getCheckSql( 'le.required_options = 0', 'i.min_price', 0 );\n\t\t\t\t$maxCheckSql = $write->getCheckSql( 'le.required_options = 0', 'i.max_price', 0 );\n\t\t\t\t$taxClassId = $this->_getReadAdapter( )->getCheckSql( 'MIN(i.tax_class_id) IS NULL', '0', 'MIN(i.tax_class_id)' );\n\t\t\t\t$minPrice = new Zend_Db_Expr( 'MIN(' . $minCheckSql . ')' );\n\t\t\t\t$maxPrice = new Zend_Db_Expr( 'MAX(' . $maxCheckSql . ')' );\n\t\t\t} \nelse {\n\t\t\t\t$taxClassId = new Zend_Db_Expr( 'IFNULL(i.tax_class_id, 0)' );\n\t\t\t\t$minPrice = new Zend_Db_Expr( 'MIN(IF(le.required_options = 0, i.min_price, 0))' );\n\t\t\t\t$maxPrice = new Zend_Db_Expr( 'MAX(IF(le.required_options = 0, i.max_price, 0))' );\n\t\t\t}\n\n\t\t\t$stockId = 'IF (i.stock_id IS NOT NULL, i.stock_id, 1)';\n\t\t\t$select->columns( 'website_id', 'cw' )->joinLeft( array( 'le' => $this->getTable( 'catalog/product' ) ), 'le.entity_id = l.linked_product_id', array( ) );\n\n\t\t\tif ($this->getVersionHelper( )->isGe1700( )) {\n\t\t\t\t$columns = array( 'tax_class_id' => $taxClassId, 'price' => new Zend_Db_Expr( 'NULL' ), 'final_price' => new Zend_Db_Expr( 'NULL' ), 'min_price' => $minPrice, 'max_price' => $maxPrice, 'tier_price' => new Zend_Db_Expr( 'NULL' ), 'group_price' => new Zend_Db_Expr( 'NULL' ), 'stock_id' => $stockId, 'currency' => 'i.currency', 'store_id' => 'i.store_id' );\n\t\t\t} \nelse {\n\t\t\t\t$columns = array( 'tax_class_id' => $taxClassId, 'price' => new Zend_Db_Expr( 'NULL' ), 'final_price' => new Zend_Db_Expr( 'NULL' ), 'min_price' => $minPrice, 'max_price' => $maxPrice, 'tier_price' => new Zend_Db_Expr( 'NULL' ), 'stock_id' => $stockId, 'currency' => 'i.currency', 'store_id' => 'i.store_id' );\n\t\t\t}\n\n\t\t\t$select->joinLeft( array( 'i' => $table ), '(i.entity_id = l.linked_product_id) AND (i.website_id = cw.website_id) AND ' . '(i.customer_group_id = cg.customer_group_id)', $columns );\n\t\t\t$select->group( array( 'e.entity_id', 'cg.customer_group_id', 'cw.website_id', $stockId, 'i.currency', 'i.store_id' ) )->where( 'e.type_id=?', $this->getTypeId( ) );\n\n\t\t\tif (!is_null( $entityIds )) {\n\t\t\t\t$select->where( 'l.product_id IN(?)', $entityIds );\n\t\t\t}\n\n\t\t\t$eventData = array( 'select' => $select, 'entity_field' => new Zend_Db_Expr( 'e.entity_id' ), 'website_field' => new Zend_Db_Expr( 'cw.website_id' ), 'stock_field' => new Zend_Db_Expr( $stockId ), 'currency_field' => new Zend_Db_Expr( 'i.currency' ), 'store_field' => new Zend_Db_Expr( 'cs.store_id' ) );\n\n\t\t\tif (!$this->getWarehouseHelper( )->getConfig( )->isMultipleMode( )) {\n\t\t\t\t$eventData['stock_field'] = new Zend_Db_Expr( 'i.stock_id' );\n\t\t\t}\n\n\t\t\tMage::dispatchEvent( 'catalog_product_prepare_index_select', $eventData );\n\t\t\t$query = $select->insertFromSelect( $table );\n\t\t\t$write->query( $query );\n\t\t\treturn $this;\n\t\t}", "public function getPriceAll()\n { \n $collection = $this->PostCollectionFactory->create();\n /*$a = $collection->getPrice();*/\n foreach ($collection as $key => $value) {\n $value->getPrice();\n }\n return $value->getPrice();\n }", "public function wc_epo_product_price_rules( $price = array(), $product ) {\n\t\tif ( $this->is_elex_dpd_enabled() ) {\n\t\t\t$check_price = apply_filters( 'wc_epo_discounted_price', NULL, $product, NULL );\n\t\t\tif ( $check_price ) {\n\t\t\t\t$price['product'] = array();\n\t\t\t\tif ( $check_price['is_multiprice'] ) {\n\t\t\t\t\tforeach ( $check_price['rules'] as $variation_id => $variation_rule ) {\n\t\t\t\t\t\tforeach ( $variation_rule as $rulekey => $pricerule ) {\n\t\t\t\t\t\t\t$price['product'][ $variation_id ][] = array(\n\t\t\t\t\t\t\t\t\"min\" => $pricerule[\"min\"],\n\t\t\t\t\t\t\t\t\"max\" => $pricerule[\"max\"],\n\t\t\t\t\t\t\t\t\"value\" => ( $pricerule[\"type\"] != \"percentage\" ) ? apply_filters( 'wc_epo_product_price', $pricerule[\"value\"], \"\", FALSE ) : $pricerule[\"value\"],\n\t\t\t\t\t\t\t\t\"type\" => $pricerule[\"type\"],\n\t\t\t\t\t\t\t\t'conditions' => isset( $pricerule[\"conditions\"] ) ? $pricerule[\"conditions\"] : array(),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tforeach ( $check_price['rules'] as $rulekey => $pricerule ) {\n\t\t\t\t\t\t$price['product'][0][] = array(\n\t\t\t\t\t\t\t\"min\" => $pricerule[\"min\"],\n\t\t\t\t\t\t\t\"max\" => $pricerule[\"max\"],\n\t\t\t\t\t\t\t\"value\" => ( $pricerule[\"type\"] != \"percentage\" ) ? apply_filters( 'wc_epo_product_price', $pricerule[\"value\"], \"\", FALSE ) : $pricerule[\"value\"],\n\t\t\t\t\t\t\t\"type\" => $pricerule[\"type\"],\n\t\t\t\t\t\t\t'conditions' => isset( $pricerule[\"conditions\"] ) ? $pricerule[\"conditions\"] : array(),\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$price['price'] = apply_filters( 'woocommerce_tm_epo_price_compatibility', apply_filters( 'wc_epo_product_price', $product->get_price(), \"\", FALSE ), $product );\n\t\t}\n\n\t\treturn $price;\n\t}", "protected function calculatePrices()\n {\n }", "public function create_individual_product_list ($all_product_ids, $all_qtys) {\n \n foreach(array_combine($all_product_ids, $all_qtys) as $value => $tally){\n \n $key_location = array_search($value, array_column($this->json_source_array['products'], 'id'));\n \n // Add multiple entries when there are multiples of a product\n \n while ($this->qty_counter < $tally) {\n $this->category_price[$this->counter]['category'] = $this->json_source_array['products'][$key_location]['category'];\n $this->category_price[$this->counter]['price'] = $this->json_source_array['products'][$key_location]['price'];\n \n $this->qty_counter += 1;\n $this->counter += 1;\n } \n \n $this->qty_counter = 0;\n }\n\n }", "protected function doActionSetSalePrice()\n {\n $form = new \\XLite\\Module\\CDev\\Sale\\View\\Form\\SaleSelectedDialog();\n $form->getRequestData();\n\n if ($form->getValidationMessage()) {\n \\XLite\\Core\\TopMessage::addError($form->getValidationMessage());\n } elseif (!$this->getSelected() && $ids = $this->getActionProductsIds()) {\n $qb = \\XLite\\Core\\Database::getRepo('XLite\\Model\\Product')->createQueryBuilder();\n $alias = $qb->getMainAlias();\n $qb->update('\\XLite\\Model\\Product', $alias)\n ->andWhere($qb->expr()->in(\"{$alias}.product_id\", $ids));\n\n foreach ($this->getUpdateInfoElement() as $key => $value) {\n $qb->set(\"{$alias}.{$key}\", \":{$key}\")\n ->setParameter($key, $value);\n }\n\n $qb->execute();\n\n \\XLite\\Core\\TopMessage::addInfo('Products information has been successfully updated');\n } else {\n \\XLite\\Core\\Database::getRepo('\\XLite\\Model\\Product')->updateInBatchById($this->getUpdateInfo());\n \\XLite\\Core\\TopMessage::addInfo('Products information has been successfully updated');\n }\n\n $this->setReturnURL($this->buildURL('product_list', '', ['mode' => 'search']));\n }", "public function prices()\n {\n return $this->morphToMany(Price::class, 'price_able');\n }", "public function execute($ids = [])\n {\n /**\n * @var $idCollection \\Bazaarvoice\\Connector\\Model\\ResourceModel\\Index\\Collection \n */\n\n if (!$this->canIndex()) {\n return false;\n }\n try {\n $this->logger->debug('Partial Product Feed Index');\n\n if (empty($ids)) {\n $idCollection = $this->bvIndexCollectionFactory->create()->addFieldToFilter('version_id', 0);\n $idCollection->getSelect()->group('product_id');\n $idCollection->addFieldToSelect('product_id');\n $ids = $idCollection->getColumnValues('product_id');\n }\n\n $this->logger->debug('Found '.count($ids).' products to update.');\n\n /**\n * Break ids into pages \n */\n $productIdSets = array_chunk($ids, 50);\n\n /**\n * Time throttling \n */\n $limit = ($this->configProvider->getCronjobDurationLimit() * 60) - 10;\n $stop = time() + $limit;\n $counter = 0;\n do {\n if (time() > $stop) {\n break;\n }\n\n $productIds = array_pop($productIdSets);\n if (!is_array($productIds)\n || count($productIds) == 0\n ) {\n break;\n }\n\n $this->logger->debug('Updating product ids '.implode(',', $productIds));\n\n $this->reindexProducts($productIds);\n $counter += count($productIds);\n } while (1);\n\n if ($counter) {\n if ($counter < count($ids)) {\n $changelogTable = $this->resourceConnection->getTableName('bazaarvoice_product_cl');\n $indexTable = $this->resourceConnection->getTableName('bazaarvoice_index_product');\n $this->resourceConnection->getConnection('core_write')\n ->query(\"INSERT INTO `$changelogTable` (`entity_id`) SELECT `product_id` FROM `$indexTable` WHERE `version_id` = 0;\");\n }\n $this->logStats();\n }\n } catch (Exception $e) {\n $this->logger->crit($e->getMessage().\"\\n\".$e->getTraceAsString());\n }\n\n return true;\n }", "function getArticlesByPrice($priceMin=0, $priceMax=0, $usePriceGrossInstead=0, $proofUid=1){\n //first get all real articles, then create objects and check prices\n\t //do not get prices directly from DB because we need to take (price) hooks into account\n\t $table = 'tx_commerce_articles';\n\t $where = '1=1';\n\t if($proofUid){\n\t $where.= ' and tx_commerce_articles.uid_product = '.$this->uid;\n\t }\t\n //todo: put correct constant here\n\t $where.= ' and article_type_uid=1';\n\t $where.= $this->cObj->enableFields($table);\n\t $groupBy = '';\n\t $orderBy = 'sorting';\n\t $limit = '';\n\t $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery (\n\t 'uid', $table,\n\t $where, $groupBy,\n\t $orderBy,$limit\n\t );\n\t $rawArticleUidList = array();\n\t while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n\t $rawArticleUidList[] = $row['uid'];\n\t }\n\t $GLOBALS['TYPO3_DB']->sql_free_result($res);\n\t \n\t //now run the price test\n\t $articleUidList = array();\n\t foreach ($rawArticleUidList as $rawArticleUid) {\n\t\t $tmpArticle = new tx_commerce_article($rawArticleUid,$this->lang_uid);\n\t\t $tmpArticle->load_data();\n\t\t\t $myPrice = $usePriceGrossInstead ? $tmpArticle->get_price_gross() : $tmpArticle->get_price_net();\n\t\t\t if (($priceMin <= $myPrice) && ($myPrice <= $priceMax)) {\n\t\t\t $articleUidList[] = $tmpArticle->get_uid();\n\t\t\t }\n\t\t }\n if(count($articleUidList)>0){\n return $articleUidList;\n }else{\n return false;\n\t }\n\t}", "protected function createProductVariantPricelistPriceRequest($body, $product_id, $variant_id)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling createProductVariantPricelistPrice'\n );\n }\n // verify the required parameter 'product_id' is set\n if ($product_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $product_id when calling createProductVariantPricelistPrice'\n );\n }\n if ($product_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$product_id\" when calling DefaultApi.createProductVariantPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'variant_id' is set\n if ($variant_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $variant_id when calling createProductVariantPricelistPrice'\n );\n }\n if ($variant_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$variant_id\" when calling DefaultApi.createProductVariantPricelistPrice, must be bigger than or equal to 1.');\n }\n $resourcePath = '/products/{productId}/variants/{variantId}/prices';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($product_id !== null) {\n $resourcePath = str_replace(\n '{' . 'productId' . '}',\n ObjectSerializer::toPathValue($product_id),\n $resourcePath\n );\n }\n // path params\n if ($variant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'variantId' . '}',\n ObjectSerializer::toPathValue($variant_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n \n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function get_prices($ids)\n\t{\n\t\t$data = '';\n\n\t\t// create comma sepearted lists\n\t\t$items = '';\n\t\tforeach ($ids as $id) {\n\t\t\tif ($items != '') {\n\t\t\t\t$items .= ',';\n\t\t\t}\n\t\t\t$items .= $id;\n\t\t}\n\n\t\t// get multiple product info based on list of ids\n\t\tif($result = $this->Database->query(\"SELECT id, price FROM $this->db_table WHERE id IN ($items) ORDER BY name\" ))\n\t\t{\n\t\t\tif($result->num_rows > 0)\n\t\t\t{\n\t\t\t\twhile($row = $result->fetch_array())\n\t\t\t\t{\n\t\t\t\t\t$data[] = array(\n\t\t\t\t\t\t'id' => $row['id'],\n\t\t\t\t\t\t'price' => $row['price']\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $data;\n\n\t}", "protected function _getCatalogProductPriceData($productIds = null)\n {\n $connection = $this->getConnection();\n $catalogProductIndexPriceSelect = [];\n\n foreach ($this->dimensionCollectionFactory->create() as $dimensions) {\n if (!isset($dimensions[WebsiteDimensionProvider::DIMENSION_NAME]) ||\n $this->websiteId === null ||\n $dimensions[WebsiteDimensionProvider::DIMENSION_NAME]->getValue() === $this->websiteId) {\n $select = $connection->select()->from(\n $this->tableResolver->resolve('catalog_product_index_price', $dimensions),\n ['entity_id', 'customer_group_id', 'website_id', 'min_price']\n );\n if ($productIds) {\n $select->where('entity_id IN (?)', $productIds);\n }\n $catalogProductIndexPriceSelect[] = $select;\n }\n }\n\n $catalogProductIndexPriceUnionSelect = $connection->select()->union($catalogProductIndexPriceSelect);\n\n $result = [];\n foreach ($connection->fetchAll($catalogProductIndexPriceUnionSelect) as $row) {\n $result[$row['website_id']][$row['entity_id']][$row['customer_group_id']] = round($row['min_price'], 2);\n }\n\n return $result;\n }", "public function Save($id, $desc, $rating, $genre, $developer, $listPrice, $releaseDate)\n {\t\n\t\ttry\n\t\t{\t\n\t\t\t$response = $this->_obj->Execute(\"Product(\" . $id . \")\" );\n\t\t\t$products = $response->Result;\n\t\t\tforeach ($products as $product) \n\t\t\t{\n\t\t\t\t$product->ProductDescription = $desc;\n\t\t\t\t$product->ListPrice = str_replace('$', '', $listPrice);\n\t\t\t\t$product->ReleaseDate = $releaseDate;\n\t\t\t\t$product->ProductVersion = $product->ProductVersion;\n\t\t\t\t$this->_obj->UpdateObject($product);\n\t\t\t}\n\t\t\t$this->_obj->SaveChanges(); \n\t\t\t$response = $this->_obj->Execute(\"Game?\\$filter=ProductID eq \" . $id );;\n\t\t\t$games = $response->Result;\n\t\t\tforeach ($games as $game) \n\t\t\t{\n\t\t\t\t$game->Rating = str_replace('%20', ' ', $rating);\n\t\t\t\t$game->Genre = str_replace('%20', ' ', $genre);\n\t\t\t\t$game->Developer = $developer;\n\t\t\t\t$game->GameVersion = $game->GameVersion;\n\t\t\t\t$this->_obj->UpdateObject($game);\n\t\t\t}\n\t\t\t$this->_obj->SaveChanges();\n\t\t\t$products[0]->Game = $games;\n\t\t\treturn $products[0];\n }\n catch(ADODotNETDataServicesException $e)\n {\n\t\t\t echo \"Error: \" . $e->getError() . \"<br>\" . \"Detailed Error: \" . $e->getDetailedError();\n }\n }", "public function prepareData($collection, $productIds)\n {\n foreach ($collection as &$item) {\n if ($item->getSpecialPrice()) {\n $product = $this->productRepository->get($item->getSku());\n $specialFromDate = $product->getSpecialFromDate();\n $specialToDate = $product->getSpecialToDate();\n\n if ($specialFromDate || $specialToDate) {\n $id = $product->getId();\n $this->effectiveDates[$id] = $this->getSpecialEffectiveDate($specialFromDate, $specialToDate);\n }\n }\n }\n }", "public function testPriceGroupWithVariants()\n {\n $number = __FUNCTION__;\n $context = $this->getContext();\n\n $data = $this->createPriceGroupProduct($number, $context, true);\n\n $this->helper->createArticle($data);\n\n $listProduct = $this->helper->getListProduct($number, $context, [\n 'useLastGraduationForCheapestPrice' => true,\n ]);\n\n /* @var ListProduct $listProduct */\n static::assertEquals(7, $listProduct->getCheapestPrice()->getCalculatedPrice());\n }", "public function get_prices()\n\t{\n\t\t$product_price_old = 0;\n\t\t$product_price_sale = 0;\n\t\t$price = 0;\n\t\t$eco = 0;\n\t\t$taxes = 0;\n\t\t$dataoc = isset($this->request->post['dataoc']) ? $this->request->post['dataoc'] : '';\n\n\t\tif (!empty($dataoc)) {\n\t\t\t$dataoc = str_replace('&quot;', '\"', $dataoc);\n\t\t\t$json = @json_decode($dataoc, true);\n\t\t\t$product_quantity = isset($json['quantity']) ? $json['quantity'] : 0;\n\t\t\t$product_id_oc = isset($json['product_id_oc']) ? $json['product_id_oc'] : 0;\n\t\t\tif ($product_id_oc == 0) $product_id_oc = isset($json['_product_id_oc']) ? $json['_product_id_oc'] : 0;\n\n\t\t\t// get options\n\t\t\t$options = isset($json['option_oc']) ? $json['option_oc'] : array();\n\t\t\tforeach ($options as $key => $value) {\n\t\t\t\tif ($value == null || empty($value)) unset($options[$key]);\n\t\t\t}\n\n\t\t\t// get all options of product\n\t\t\t$options_temp = $this->get_options_oc($product_id_oc);\n\n\t\t\t// Calc price for ajax\n\t\t\tforeach ($options_temp as $value) {\n\t\t\t\tforeach ($options as $k => $option_val) {\n\t\t\t\t\tif ($k == $value['product_option_id']) {\n\t\t\t\t\t\tif ($value['type'] == 'checkbox' && is_array($option_val) && count($option_val) > 0) {\n\t\t\t\t\t\t\tforeach ($option_val as $val) {\n\t\t\t\t\t\t\t\tforeach ($value['product_option_value'] as $op) {\n\t\t\t\t\t\t\t\t\t// calc price\n\t\t\t\t\t\t\t\t\tif ($val == $op['product_option_value_id']) {\n\t\t\t\t\t\t\t\t\t\tif ($op['price_prefix'] == $this->minus) $price -= isset($op['price_no_tax']) ? $op['price_no_tax'] : 0;\n\t\t\t\t\t\t\t\t\t\telse $price += isset($op['price_no_tax']) ? $op['price_no_tax'] : 0;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} elseif ($value['type'] == 'radio' || $value['type'] == 'select') {\n\t\t\t\t\t\t\tforeach ($value['product_option_value'] as $op) {\n\t\t\t\t\t\t\t\tif ($option_val == $op['product_option_value_id']) {\n\t\t\t\t\t\t\t\t\tif ($op['price_prefix'] == $this->minus) $price -= isset($op['price_no_tax']) ? $op['price_no_tax'] : 0;\n\t\t\t\t\t\t\t\t\telse $price += isset($op['price_no_tax']) ? $op['price_no_tax'] : 0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// the others have not price, so don't need calc\n\t\t\t\t\t}\n\t\t\t\t\t// if not same -> return.\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$product_prices = $this->get_product_price($product_id_oc, $product_quantity);\n\t\t\t$product_price_old = isset($product_prices['price_old']) ? $product_prices['price_old'] : 0;\n\t\t\t$product_price_sale = isset($product_prices['price_sale']) ? $product_prices['price_sale'] : 0;\n\t\t\t$enable_taxes = $this->config->get('tshirtecommerce_allow_taxes');\n\t\t\tif ($enable_taxes === null || $enable_taxes == 1) {\n\t\t\t\t$taxes = isset($product_prices['taxes']) ? $product_prices['taxes'] : 0;\n\t\t\t\t$eco = isset($product_prices['eco']) ? $product_prices['eco'] : 0;\n\t\t\t} else {\n\t\t\t\t$taxes = 0;\n\t\t\t\t$eco = 0;\n\t\t\t}\n\t\t\t\n\t\t} // do nothing when empty/blank\n\n\t\t// return price for ajax\n\t\techo @json_encode(array(\n\t\t\t'price' => $price, \n\t\t\t'price_old' => $product_price_old, \n\t\t\t'price_sale' => $product_price_sale, \n\t\t\t'taxes' => $taxes,\n\t\t\t'eco' => $eco\n\t\t));\n\t\treturn;\n\t}", "public function saved(Price $price)\n {\n PriceItem::where('price_id', $price->id)->delete();\n\n $productId = request()->input('product_id');\n\n foreach (request()->input('prices', []) as $priceInput) {\n $priceCategoryAttributes = [\n 'product_id' => $productId,\n ];\n\n foreach (config('app.locales') as $lang => $locale) {\n $priceCategoryAttributes[\"title_{$lang}\"] = $priceInput['category'][$lang];\n }\n\n $priceCategory = PriceCategory::firstOrCreate($priceCategoryAttributes);\n\n $priceItemAttributes = [\n 'price_id' => $price->id,\n 'price_category_id' => $priceCategory->id,\n ];\n foreach ($priceInput['items'] as $item) {\n $priceItemAttributes['price'] = $item['price'];\n $priceItemAttributes['date_start'] = $item['date_start'];\n $priceItemAttributes['date_end'] = $item['date_end'];\n\n foreach (config('app.locales') as $lang => $locale) {\n $priceItemAttributes[\"title_{$lang}\"] = $item['title'][$lang];\n }\n }\n\n PriceItem::create($priceItemAttributes);\n }\n }", "protected function saveUpdateProducts()\r\n\t{\r\n\t\tif (count($this->newProducts) > 0) {\r\n\t\t\t// inserir as novas\r\n\t\t\tforeach ($this->newProducts as $product) {\r\n\t\t\t\t$result = $this->client->catalogProductUpdate($this->sessionid, $product->sku, $product);\r\n\t\t\t\t$this->log->addInfo('updated', array(\"sku\" => $product->sku, \"result\" => $result));\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->newProducts = array();\r\n\t}", "public function save($data)\n {\n /* Prices */\n $data['price_low'] = preg_replace(\"/[^0-9\\.]/\", \"\", $data['price_low']);\n $data['special_price_low'] = preg_replace(\"/[^0-9\\.]/\", \"\", $data['special_price_low']);\n\n /* Attributes */\n $attributes = array();\n foreach ($data['attributes']['title'] as $key => $title) {\n $attributes[] = array(\n 'title' => str_replace('\"', '\\\"', $title),\n 'value' => str_replace('\"', '\\\"', $data['attributes']['value'][$key]),\n 'is_variation' => ($data['attributes']['is_variation'][$key] === 'on')\n );\n }\n\n $data['attributes'] = $attributes;\n\n /* Variations */\n if (!empty($data['variations'])) {\n $variations = array();\n foreach ($data['variations']['name'] as $key => $name) {\n $variations[] = array(\n 'name' => str_replace('\"', '\\\"', $name),\n 'available_quantity' => $data['variations']['available_quantity'][$key],\n 'price' => $data['variations']['price'][$key],\n 'special_price' => $data['variations']['special_price'][$key],\n 'advertised' => $data['variations']['advertised'][$key],\n 'final_price' => $data['variations']['final_price'][$key],\n 'image' => $data['variations']['image'][$key]\n );\n }\n\n $data['variations'] = $variations;\n }\n \n $data['short_description'] = str_replace('\"', '\\\"', $data['short_description']);\n $data['description'] = str_replace('\"', '\\\"', $data['description']);\n $data['short_description'] = str_replace(PHP_EOL, '<br />', $data['short_description']);\n $data['description'] = str_replace(PHP_EOL, '<br />', $data['description']);\n \n $productId = $data['product_id'];\n $dataJson = str_replace(\"'\", \"\\'\", json_encode($data));\n \n $query = \"UPDATE products SET processed_data = '{$dataJson}', last_status_change = NOW() WHERE id = {$productId}\";\n $this->query($query);\n\n $errors = $this->getLastError();\n if ($errors) {\n die($errors);\n }\n \n return $this;\n }", "public function run()\n {\n ProductPrice::insert(\n \t[\n \t[\"product_id\" => 1,\n \t \"description\" => \"economical\",\n \t \"price\" => 10000\n \t],\n \t[\"product_id\" => 1,\n \t \"description\" => \"default\",\n \t \"price\" => 100000\n \t],\n \t[\"product_id\" => 1,\n \t \"description\" => \"plus\",\n \t \"price\" => 1000000\n \t],\n \t[\"product_id\" => 2,\n \t \"description\" => \"economical\",\n \t \"price\" => 10000\n \t],\n \t[\"product_id\" => 2,\n \t \"description\" => \"default\",\n \t \"price\" => 100000\n \t],\n \t[\"product_id\" => 2,\n \t \"description\" => \"plus\",\n \t \"price\" => 1000000\n \t],\n \t[\"product_id\" => 3,\n \t \"description\" => \"economical\",\n \t \"price\" => 10000\n \t],\n \t[\"product_id\" => 3,\n \t \"description\" => \"default\",\n \t \"price\" => 100000\n \t],\n \t[\"product_id\" => 3,\n \t \"description\" => \"plus\",\n \t \"price\" => 1000000\n \t],\n \t[\"product_id\" => 4,\n \t \"description\" => \"economical\",\n \t \"price\" => 10000\n \t],\n \t[\"product_id\" => 4,\n \t \"description\" => \"default\",\n \t \"price\" => 100000\n \t],\n \t[\"product_id\" => 4,\n \t \"description\" => \"plus\",\n \t \"price\" => 1000000\n \t],\n \t[\"product_id\" => 5,\n \t \"description\" => \"economical\",\n \t \"price\" => 10000\n \t],\n \t[\"product_id\" => 5,\n \t \"description\" => \"default\",\n \t \"price\" => 100000\n \t],\n \t[\"product_id\" => 5,\n \t \"description\" => \"plus\",\n \t \"price\" => 1000000\n \t]\n \t]);\n }", "public function updateProduct()\n {\n \t$quote=$this->getQuote();\n \tif($quote)\n \t{\n \t\t$detailproduct=$this->getProduct();\n \t\t$quoteproduct=$quote->getProduct();\n \t\tif(\n\t\t\t\t$quote->getPrice()!=$this->getPrice() or\n\t\t\t\t$quote->getDiscrate()!=$this->getDiscrate() or\n\t\t\t\t$quote->getDiscamt()!=$this->getDiscamt() or\n\t\t\t\t$quote->getProductId()!=$this->getProductId()\n\t\t\t)\n\t\t\t{\n\t\t\t\t$quote->setPrice($this->getPrice());\n\t\t\t\t$quote->setDiscrate($this->getDiscrate());\n\t\t\t\t$quote->setDiscamt($this->getDiscamt());\n\t\t\t\t$quote->setProductId($this->getProductId());\n\t\t\t\t$quote->calc(); //auto save\n\t\t\t\t$detailproduct->calcSalePrices();\n\t\t\t\t\n\t\t\t\t//if product changed, calc old product\n\t\t\t\tif($quoteproduct->getId()!=$detailproduct->getId())\n\t\t\t\t\t$quoteproduct->calcSalePrices();\n\t\t\t}\n \t}\n \telse\n \t{\n\t\t\t//if none, see if product quote by vendor with similar pricing exists. \n\t\t\t$quote=Fetcher::fetchOne(\"Quote\",array('total'=>$this->getUnittotal(),'vendor_id'=>SettingsTable::fetch(\"me_vendor_id\"),'product_id'=>$this->getProductId()));\n\n\t\t\t//if it doesn't exist, create it, and product->calc()\n\t\t\tif(!$quote)\n\t\t\t{\n\t\t\t\tQuoteTable::createOne(array(\n\t\t\t\t\t'date'=>$this->getInvoice()->getDate(),\n\t\t\t\t\t'price'=>$this->getPrice(),\n\t\t\t\t\t'discrate'=>$this->getDiscrate(),\n\t\t\t\t\t'discamt'=>$this->getDiscamt(),\n\t\t\t\t\t'vendor_id'=>SettingsTable::fetch(\"me_vendor_id\"),\n\t\t\t\t\t'product_id'=>$this->getProductId(),\n\t\t\t\t\t'ref_class'=>\"Invoicedetail\",\n\t\t\t\t\t'ref_id'=>$this->getId(),\n\t\t\t\t\t'mine'=>1,\n\t\t\t\t\t));\n\t\t\t\t$this->getProduct()->calcSalePrices();\n\t\t\t}\n \t}\n }", "public function products()\n {\n //$products = $api->getAllProducts();\n //var_dump($products);\n // TODO save products to database\n }", "public function exportProducts()\n\t{\n\t\tYii::import( 'webroot.backend.protected.modules.triggmine.models.ProductExportEvent' );\n\t\tYii::import( 'webroot.backend.protected.modules.triggmine.models.ProductHistoryEvent' );\n\t\t\n\t\t$baseURL = Yii::app()->request->hostInfo;\n\t\t$pageSize = 20;\n\t\t\n\t\t$allProducts = Yii::app()->db->createCommand()\n\t ->select('p.id, p.parent, p.url, p.name, p.articul, p.price, p.notice, p.visible, p.discount, p.date_create, i.name AS img, s.name AS section')\n\t ->from('kalitniki_product AS p')\n\t ->join('kalitniki_product_img AS i', 'p.id = i.parent')\n\t ->join('kalitniki_product_assignment AS a', 'p.id = a.product_id')\n\t ->join('kalitniki_product_section AS s', 's.id = a.section_id')\n\t ->group('p.id')\n\t ->order('IF(p.position=0, 1, 0), p.position ASC ');\n\t\n\t $allProducts = $allProducts->queryAll();\n\t $productCount = count( $allProducts );\n\t \n\t $pages = ( $productCount % $pageSize ) > 0 ? floor( $productCount / $pageSize ) + 1 : $productCount / $pageSize;\n\t \n\t for ( $currentPage = 0; $currentPage <= $pages - 1; $currentPage++ )\n\t {\n\t \t$dataExport = new ProductHistoryEvent;\n\t \t\n\t \t$offset = $currentPage * $pageSize;\n\t \t$collection = array_slice( $allProducts, $offset, $pageSize );\n\t \t\n\t \tforeach ( $collection as $productItem )\n\t \t{\n\t \t\t$productPrices = array();\n\t\t\t\tif ( $productItem['discount'] )\n\t\t\t\t{\n\t\t\t\t $productPrice = array(\n\t\t\t 'price_id' => \"\",\n\t\t\t 'price_value' => Utils::calcDiscountPrice($productItem['price'], $productItem['discount']),\n\t\t\t 'price_priority' => null,\n\t\t\t 'price_active_from' => \"\",\n\t\t\t 'price_active_to' => \"\",\n\t\t\t 'price_customer_group' => \"\",\n\t\t\t 'price_quantity' => \"\"\n\t\t\t );\n\t\t\t \n\t\t\t $productPrices[] = $productPrice;\n\t\t\t\t}\n\t \t\t\n\t \t\t$productCategories = array();\n \t\t$productCategories[] = $productItem['section'];\n\t \t\t\n\t \t\t$product = new ProductExportEvent;\n $product->product_id = $productItem['id'];\n $product->parent_id = $productItem['parent'] ? $productItem['parent'] : \"\";\n $product->product_name = isset( $productItem['name'] ) ? $productItem['name'] : \"\";\n $product->product_desc = $productItem['notice'];\n $product->product_create_date = $productItem['date_create'];\n $product->product_sku = $productItem['articul'] ? $productItem['articul'] : \"\";\n $product->product_image = $baseURL . '/' . $productItem['img'];\n $product->product_url = $baseURL . '/' . $productItem['url'];\n $product->product_qty = \"\";\n $product->product_default_price = $productItem['price'];\n $product->product_prices = $productPrices;\n $product->product_categories = $productCategories;\n $product->product_relations = \"\";\n $product->product_is_removed = \"\";\n $product->product_is_active = $productItem['visible'];\n $product->product_active_from = \"\";\n $product->product_active_to = \"\";\n $product->product_show_as_new_from = \"\";\n $product->product_show_as_new_to = \"\";\n \n $dataExport->products[] = $product;\n\t \t}\n\n\t \t$this->client->sendEvent( $dataExport );\n\t }\n\t}", "public function gETPriceIdPriceListRequest($price_id)\n {\n // verify the required parameter 'price_id' is set\n if ($price_id === null || (is_array($price_id) && count($price_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $price_id when calling gETPriceIdPriceList'\n );\n }\n\n $resourcePath = '/prices/{priceId}/price_list';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($price_id !== null) {\n $resourcePath = str_replace(\n '{' . 'priceId' . '}',\n ObjectSerializer::toPathValue($price_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function addProductIDs($productIDs)\n {\n $parameters = $this->request->getParameters();\n $parameters->add('id', $productIDs);\n $this->recommendationsUpToDate = false;\n }", "protected function getProductsVariantsPricelistPriceRequest($product_id, $variant_id, $pricelist_id)\n {\n // verify the required parameter 'product_id' is set\n if ($product_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $product_id when calling getProductsVariantsPricelistPrice'\n );\n }\n if ($product_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$product_id\" when calling DefaultApi.getProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'variant_id' is set\n if ($variant_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $variant_id when calling getProductsVariantsPricelistPrice'\n );\n }\n if ($variant_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$variant_id\" when calling DefaultApi.getProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'pricelist_id' is set\n if ($pricelist_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pricelist_id when calling getProductsVariantsPricelistPrice'\n );\n }\n if ($pricelist_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$pricelist_id\" when calling DefaultApi.getProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n $resourcePath = '/products/{productId}/variants/{variantId}/prices/{pricelistId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($product_id !== null) {\n $resourcePath = str_replace(\n '{' . 'productId' . '}',\n ObjectSerializer::toPathValue($product_id),\n $resourcePath\n );\n }\n // path params\n if ($variant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'variantId' . '}',\n ObjectSerializer::toPathValue($variant_id),\n $resourcePath\n );\n }\n // path params\n if ($pricelist_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pricelistId' . '}',\n ObjectSerializer::toPathValue($pricelist_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n \n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function saveNewProducts()\r\n\t{\r\n\t\tif (count($this->newProducts) > 0) {\r\n\t\t\t// create new product in catalog\r\n\t\t\tforeach ($this->newProducts as $product) {\r\n\t\t\t \r\n\t\t\t $result = $this->client->catalogProductCreate($this->sessionid, $product->getProductType(), $product->getAttributeSet(), $product->sku, $product);\r\n\t\t\t \r\n\t\t\t\t$this->log->addInfo('created', array(\"sku\" => $product->sku, \"result\" => $result));\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->newProducts = array();\t\t\r\n\t}", "public function payMultipleSuppliers($attributes);", "public function processPurchaseOrder($productIds)\r\n {\r\n // process every products for PO creation\r\n foreach ($productIds as $productId) {\r\n // get the additional stock received from PO\r\n $this->Inventory->addStock($productId, 20);\r\n\r\n // update PO data after receiving\r\n $this->ProductsPurchased->updatePurchaseOrderAfterReceiving($productId);\r\n }\r\n }", "public static function calculate(PriceInterface $price);", "public function actionGetProductPrice($id=null)\n {\n $userData = User::find()->andFilterWhere(['u_id' => $id])->andWhere(['IS NOT', 'u_mws_seller_id', null])->all();\n\n foreach ($userData as $user) {\n \\Yii::$app->data->getMwsDetails($user->u_mws_seller_id, $user->u_mws_auth_token);\n $models = FbaAllListingData::find()->andWhere(['created_by' => $user->u_id])->all(); //->andWhere(['status' => 'Active'])\n\n foreach ($models as $model) {\n if ($model->seller_sku) {\n $productDetails = \\Yii::$app->api->getProductCompetitivePrice($model->seller_sku);\n if ($productDetails) {\n $model->buybox_price = $productDetails;\n if ($model->save(false)) {\n echo $model->asin1 . \" is Updated.\";\n }\n }\n }\n sleep(3);\n }\n }\n }", "public function addProducts(array $products);", "public static function getSellerProducts($id_seller, $start = 0, $limit = 0, $only_active = false, $random = false, $externalad = true) {\n $ret = array();\n if(!isset($id_seller))\n return $ret;\n\n $dbquery = new DbQuery();\n $dbquery->select('sp.`id_product`')\n ->from('seller_product', 'sp')\n ->leftJoin('product', 'p', 'sp.id_product = p.id_product');\n if ($only_active)\n $dbquery->where('sp.`id_seller` = '.$id_seller.' AND p.`active` = 1');\n else\n $dbquery->where('sp.`id_seller` = '.$id_seller);\n\n if($limit > 0)\n if ($start > 0)\n $dbquery->limit($start, $limit);\n else\n $dbquery->limit($limit);\n\n if ($random)\n $dbquery->orderBy('RAND()');\n else \n $dbquery->orderBy('UNIX_TIMESTAMP(p.`date_add`) DESC');\n \n if(!$externalad) {\n $dbquery->leftJoin('product_attribute', 'pa', 'p.`id_product` = pa.`id_product`');\n $dbquery->leftJoin('product_attribute_combination', 'pac', 'pac.`id_product_attribute` = pa.`id_product_attribute`');\n $dbquery->leftJoin('attribute', 'a', 'a.`id_attribute` = pac.`id_attribute`');\n $dbquery->leftJoin('attribute_lang', 'al', '(a.`id_attribute` = al.`id_attribute` AND al.`id_lang` = '.(int)Context::getContext()->language->id.')');\n $dbquery->where('al.`name` = \"ticket\" OR al.`name` = \"carnet\" OR al.`name` = \"ad\"');\n }\n\n $row = Db::getInstance()->executeS($dbquery);\n if ($row)\n foreach ($row as $val)\n $ret[] = $val['id_product'];\n\n return $ret;\n }", "public function loadPriceData($storeId, $productIds)\r\n {\r\n $websiteId = $this->getStore($storeId)->getWebsiteId();\r\n\r\n // check if entities data exist in price index table\r\n $select = $this->getConnection()->select()\r\n ->from(['p' => $this->getTable('catalog_product_index_price')])\r\n ->where('p.customer_group_id = ?', 0) // for all customers\r\n ->where('p.website_id = ?', $websiteId)\r\n ->where('p.entity_id IN (?)', $productIds);\r\n\r\n $result = $this->getConnection()->fetchAll($select);\r\n\t\t\r\n\t\treturn $result;\r\n\r\n if ($this->limiter > 3) {\r\n return $result;\r\n }\r\n\r\n // new added product prices may not be populated into price index table in some reason,\r\n // try to force reindex for unprocessed entities\r\n $processedIds = [];\r\n foreach ($result as $priceData) {\r\n $processedIds[] = $priceData['entity_id'];\r\n }\r\n $diffIds = array_diff($productIds, $processedIds);\r\n if (!empty($diffIds)) {\r\n $this->getPriceIndexer()->executeList($diffIds);\r\n $this->limiter += 1;\r\n $this->loadPriceData($storeId, $productIds);\r\n }\r\n\r\n return $result;\r\n }", "public function makePrice(array & $rows)\n {\n if (empty($rows)) {\n return;\n }\n\n $articles = array_column($rows, 'article');\n\n $articles = array_map(function ($item) {\n settype($item, 'string');\n\n return preg_replace('/[^\\w+]/is', '', $item);\n }, $articles);\n\n $model = MongoModel::factory('Prices');\n $model->selectDB();\n\n $articles = array_unique($articles);\n array_reverse($articles, 1);\n $articles = array_reverse($articles);\n\n $priceRows = $model\n ->where('clear_article', 'in', $articles)\n ->find_all();\n\n if (empty($priceRows)) {\n foreach ($rows as $key => & $item) {\n $item['qty'] = 0;\n $item['price'] = 0;\n }\n\n return $rows;\n }\n\n $priceRows = array_combine(array_column($priceRows, 'clear_article'), $priceRows);\n\n foreach ($rows as $key => & $item) {\n $item['qty'] = (isset($priceRows[$item['clear_article']]['qty']) ? $priceRows[$item['clear_article']]['qty'] : 0);\n $item['price'] = (isset($priceRows[$item['clear_article']]['price']) ? $priceRows[$item['clear_article']]['price'] : 0);\n }\n\n return $rows;\n\n }", "public function setBestPrice($product_id) {\n $query = \"SELECT * FROM wp_pwgb_postmeta WHERE post_id=:product_id;\";\n $stm = $this->db->prepare($query);\n $stm->bindValue(\":product_id\", $product_id, PDO::PARAM_INT);\n $stm->execute();\n\n $response = $stm->fetchAll(PDO::FETCH_ASSOC);\n $tag_prices = $this->productPrice();\n $theBest = ['price' => 0];\n $otherPrices = [];\n $hasChanged = false;\n\n // Obtiene el mejor precio anterior\n foreach ($response as $metadata) {\n // Mejor precio\n if (isset($metadata['meta_key']) && $metadata['meta_key'] == 'price_best') {\n $theBest['price'] = $metadata['meta_value'];\n }\n\n // Mejor tienda\n if (isset($metadata['meta_key']) && $metadata['meta_key'] == 'best_shop') {\n $theBest['shop'] = $metadata['meta_value'];\n }\n\n // Obtiene el precio de otras tiendas\n foreach ($tag_prices as $price) {\n if (isset($metadata['meta_key']) && $metadata['meta_key'] == $price) {\n $otherPrices[$price] = (int) $metadata['meta_value'];\n }\n }\n }\n\n $oldPrice = $theBest['price'];\n // Obtiene el nuevo mejor precio\n foreach ($otherPrices as $store => $price) {\n if (($price > 0) && ($price < $theBest['price'])) {\n $theBest['price'] = $price;\n $theBest['shop'] = $store;\n $hasChanged = true;\n }\n }\n\n // Si el mejor precio cambio, lo actualiza y lo guarda en el historial\n if ($hasChanged) {\n $query = \"INSERT INTO dw_historial (product_id, price_old, price_new, created_at) VALUES \n (:product_id, :price_old, :price_new, NOW());\";\n $stm2 = $this->db->prepare($query);\n $stm2->bindValue(\":product_id\", $product_id, PDO::PARAM_INT);\n $stm2->bindValue(\":price_old\", $oldPrice, PDO::PARAM_INT);\n $stm2->bindValue(\":price_new\", $theBest['price'], PDO::PARAM_INT);\n $stm2->execute();\n\n $query = \"UPDATE wp_pwgb_postmeta SET meta_value=:price_new WHERE post_id=:product_id AND meta_key='price_best';\";\n $stm3 = $this->db->prepare($query);\n $stm3->bindValue(\":product_id\", $product_id, PDO::PARAM_INT);\n $stm3->bindValue(\":price_new\", $theBest['price'], PDO::PARAM_INT);\n $stm3->execute();\n\n $query = \"UPDATE wp_pwgb_postmeta SET meta_value=:best_shop WHERE post_id=:product_id AND meta_key='best_shop';\";\n $stm4 = $this->db->prepare($query);\n $stm4->bindValue(\":product_id\", $product_id, PDO::PARAM_INT);\n $stm4->bindValue(\":best_shop\", $theBest['shop'], PDO::PARAM_STR);\n $stm4->execute();\n }\n }", "function fn_warehouses_gather_additional_products_data_post($product_ids, $params, &$products, $auth, $lang_code)\n{\n if (empty($product_ids) && !isset($params['get_warehouse_amount']) || $params['get_warehouse_amount'] === false) {\n return;\n }\n\n /** @var Tygh\\Addons\\Warehouses\\Manager $manager */\n $manager = Tygh::$app['addons.warehouses.manager'];\n $products = $manager->fetchProductsWarehousesAmounts($products);\n}", "public function scalePrices($product)\n {\n \n // Get the configurable Id\n $configurableId = $this->getConfigurableId($product);\n \n // Check we actually have a configurable product\n if ($configurableId > 0)\n {\n // Get the configurable product and associated base price\n // Please note the price will not be the actual configurable, price but the cheapest price from all the simple products\n $configurableProduct = Mage::getSingleton(\"catalog/Product\")->load($configurableId);\n $configurablePrice = $configurableProduct->getPrice();\n \n // Get current attribute data\n $configurableAttributesData = $configurableProduct->getTypeInstance()->getConfigurableAttributesAsArray();\n $configurableProductsData = array();\n \n // We need to identify the attribute name and Id\n $prodAttrName = $this->getAttributeName($configurableProduct);\n $prodAttrId = $this->getAttributeId($prodAttrName);\n \n // Get associates simple products\n $associatedProducts = $configurableProduct->getTypeInstance()->getUsedProducts();\n foreach ($associatedProducts as $prodList)\n {\n // For each associated simple product gather the data and calculate the extra fixed price\n $prodId = $prodList->getId();\n $prodAttrLabel = $prodList->getAttributeText($prodAttrName);\n $prodAttrValueIndex = $prodList[$prodAttrName];\n $prodScalePrice = $prodList['price'] - $configurablePrice;\n \n $productData = array(\n 'label' => $prodAttrLabel,\n 'attribute_id' => $prodAttrId,\n 'value_index' => $prodAttrValueIndex,\n 'pricing_value' => $prodScalePrice,\n 'is_percent' => '0'\n );\n $configurableProductsData[$prodId] = $productData;\n $configurableAttributesData[0]['values'][] = $productData;\n }\n \n $configurableProduct->setConfigurableProductsData($configurableProductsData);\n $configurableProduct->setConfigurableAttributesData($configurableAttributesData);\n $configurableProduct->setCanSaveConfigurableAttributes(true);\n Mage::log($configurableProductsData, null, 'configurableProductsData.log', true);\n Mage::log($configurableAttributesData, null, 'configurableAttributesData.log', true);\n \n try\n {\n $configurableProduct->save(); \n }\n catch (Exception $e)\n {\n $this->_debug($e->getMessage());\n }\n \n } \n }", "public function getPriceList() {\n\t\tif( count($this->prices) > 0 ) {\n\t\t\tthrow new \\InvalidArgumentException(sprintf('The name \"%s\" is invalid.', $name));\n\t\t}\n\t\treturn $this->prices;\n\t}", "private function mapPrices(ProductInterface $magentoProduct, SkyLinkProduct $skyLinkProduct)\n {\n $magentoProduct->setPrice($skyLinkProduct->getPricingStructure()->getRegularPrice()->toNative());\n\n $magentoProduct->unsetData('special_price');\n $magentoProduct->unsetData('special_from_date');\n $magentoProduct->unsetData('special_to_date');\n\n if (false === $skyLinkProduct->getPricingStructure()->hasSpecialPrice()) {\n $this->removeSpecialPrices($magentoProduct);\n return;\n }\n\n $skyLinkSpecialPrice = $skyLinkProduct->getPricingStructure()->getSpecialPrice();\n\n // If the end date is before now, we do not need to put a new special price on at all, as\n // it cannot end in the past. In fact, Magento will let you save it, but won't let\n // subsequent saves from the admin interface occur.\n $now = new DateTimeImmutable();\n if ($skyLinkSpecialPrice->hasEndDate() && $skyLinkSpecialPrice->getEndDate() < $now) {\n $this->removeSpecialPrices($magentoProduct);\n return;\n }\n\n $magentoProduct->setCustomAttribute('special_price', $skyLinkSpecialPrice->getPrice()->toNative());\n\n // If there's a start date at least now or in the future, we'll use that...\n if ($skyLinkSpecialPrice->hasStartDate() && $skyLinkSpecialPrice->getStartDate() >= $now) {\n $magentoProduct->setCustomAttribute(\n 'special_from_date',\n $this->dateTimeToLocalisedAttributeValue($skyLinkSpecialPrice->getStartDate())\n );\n\n // Otherwise, we'll use a start date from now\n } else {\n $magentoProduct->setCustomAttribute('special_from_date', $this->dateTimeToLocalisedAttributeValue($now));\n }\n\n // If there's an end date, we'll just use that\n if ($skyLinkSpecialPrice->hasEndDate()) {\n $magentoProduct->setCustomAttribute(\n 'special_to_date',\n $this->dateTimeToLocalisedAttributeValue($skyLinkSpecialPrice->getEndDate())\n );\n\n // Otherwise, it's indefinite\n } else {\n $distantFuture = new DateTimeImmutable('2099-01-01');\n $magentoProduct->setCustomAttribute('special_to_date', $this->dateTimeToLocalisedAttributeValue($distantFuture));\n }\n }", "public function getItemsPrice()\n {\n return [10,20,54];\n }", "public function listProductprices(){\n try{\n $sql = \"Select * from productforsale pr inner join product p on pr.id_product = p.id_product inner join categoryp c on p.id_categoryp = c.id_categoryp inner join medida m on p.product_unid_type = m.medida_id\";\n $stm = $this->pdo->prepare($sql);\n $stm->execute();\n $result = $stm->fetchAll();\n } catch (Exception $e){\n $this->log->insert($e->getMessage(), 'Inventory|listProductprices');\n $result = 2;\n }\n\n return $result;\n }", "function get_product_pricebooks($id)\n\t{\n\t\tglobal $log,$singlepane_view;\n\t\t$log->debug(\"Entering get_product_pricebooks(\".$id.\") method ...\");\n\t\tglobal $mod_strings;\n\t\trequire_once('modules/PriceBooks/PriceBooks.php');\n\t\t$focus = new PriceBooks();\n\t\t$button = '';\n\t\tif($singlepane_view == 'true')\n\t\t\t$returnset = '&return_module=Products&return_action=DetailView&return_id='.$id;\n\t\telse\n\t\t\t$returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id;\n\n\n\t\t$query = \"SELECT ec_pricebook.pricebookid as crmid,\n\t\t\tec_pricebook.*,\n\t\t\tec_pricebookproductrel.productid as prodid\n\t\t\tFROM ec_pricebook\n\t\t\tINNER JOIN ec_pricebookproductrel\n\t\t\t\tON ec_pricebookproductrel.pricebookid = ec_pricebook.pricebookid\n\t\t\tWHERE ec_pricebook.deleted = 0\n\t\t\tAND ec_pricebookproductrel.productid = \".$id;\n\t\t$log->debug(\"Exiting get_product_pricebooks method ...\");\n\t\treturn GetRelatedList('Products','PriceBooks',$focus,$query,$button,$returnset);\n\t}", "public function productsAction()\n {\n $this->_initCoursedoc();\n $this->loadLayout();\n $this->getLayout()->getBlock('coursedoc.edit.tab.product')\n ->setCoursedocProducts($this->getRequest()->getPost('coursedoc_products', null));\n $this->renderLayout();\n }", "abstract public function getPrice();", "function findsAmazonProductsForPriceUpdate($amazonAccountsSitesId)\n{\n\t$data['from'] = 'amazon_products';\n\t$data['select'] = 'id_product, accountsite_id, SKU, lastpriceupdate';\n\t$data['where'] = \"\n\t\taccountsite_id = '\" . $amazonAccountsSitesId . \"'\n\t\";\n\treturn SQLSelect($data['from'], $data['select'], $data['where'], 0, 0, 0, 'shop', __FILE__, __LINE__);\n}", "public function updateItems($products)\n {\n }", "protected function findPrice()\n\t{\n\t\trequire_once(TL_ROOT . '/system/modules/isotope/providers/ProductPriceFinder.php');\n\n\t\t$arrPrice = ProductPriceFinder::findPrice($this);\n\n\t\t$this->arrData['price'] = $arrPrice['price'];\n\t\t$this->arrData['tax_class'] = $arrPrice['tax_class'];\n\t\t$this->arrCache['from_price'] = $arrPrice['from_price'];\n\t\t$this->arrCache['minimum_quantity'] = $arrPrice['min'];\n\n\t\t// Add \"price_tiers\" to attributes, so the field is available in the template\n\t\tif ($this->hasAdvancedPrices())\n\t\t{\n\t\t\t$this->arrAttributes[] = 'price_tiers';\n\n\t\t\t// Add \"price_tiers\" to variant attributes, so the field is updated through ajax\n\t\t\tif ($this->hasVariantPrices())\n\t\t\t{\n\t\t\t\t$this->arrVariantAttributes[] = 'price_tiers';\n\t\t\t}\n\n\t\t\t$this->arrCache['price_tiers'] = $arrPrice['price_tiers'];\n\t\t}\n\t}", "public static function getPrice(&$products_table = NULL, $uid = NULL) {\n Yii::import('application.controllers.ProfileController');\n\n if (!$products_table) { //if it's cart products table\n $table = 'store_cart';\n } else {\n $table = 'temp_order_product_' . (Yii::app()->user->id ? Yii::app()->user->id : 'exchange');\n $query = \"DROP TABLE IF EXISTS {$table};\";\n $query .= \"CREATE TEMPORARY TABLE {$table} (product_id int(11) unsigned, quantity smallint(5) unsigned);\";\n foreach ($products_table as $item) {\n\n if ($item instanceof OrderProduct || $item instanceof stdClass || $item instanceof Cart) {\n $product = Product::model()->findByAttributes(array('id' => (string) $item->product_id));\n } else {\n $product = Product::model()->findByAttributes(array('code' => (string) $item->code));\n }\n\n if ($product) {\n $query .= \"INSERT INTO {$table} VALUES ({$product->id}, {$item->quantity});\";\n } else {\n throw new Exception('Product not found. Product code: ' . $item->code);\n }\n }\n Yii::app()->db->createCommand($query)->execute();\n }\n $query = Yii::app()->db->createCommand()\n ->select('SUM(c.quantity*round(prices.price*(1-greatest(ifnull(disc.percent,0),ifnull(disc1.percent,0),ifnull(disc2.percent,0))/100))) as c_summ, prices.price_id')\n ->from($table . ' c')\n ->join('store_product product', 'c.product_id=product.id')\n ->join('store_product_price prices', 'product.id=prices.product_id')\n ->join('store_price price', 'price.id=prices.price_id')\n ->leftJoin('store_discount disc', \"disc.product_id=0 and disc.actual=1 and (disc.begin_date='0000-00-00' or disc.begin_date<=CURDATE()) and (disc.end_date='0000-00-00' or disc.end_date>=CURDATE())\")\n ->leftJoin('store_product_category cat', 'cat.product_id=product.id')\n ->leftJoin('store_discount_category discat', 'discat.category_id=cat.category_id')\n ->leftJoin('store_discount disc1', \"disc1.product_id=1 and disc1.id=discat.discount_id and disc1.actual=1 and (disc1.begin_date='0000-00-00' or disc1.begin_date<=CURDATE()) and (disc1.end_date='0000-00-00' or disc1.end_date>=CURDATE())\")\n ->leftJoin('store_discount_product dispro', 'dispro.product_id=product.id')\n ->leftJoin('store_discount disc2', \"disc2.product_id=2 and disc2.id=dispro.discount_id and disc2.actual=1 and (disc2.begin_date='0000-00-00' or disc2.begin_date<=CURDATE()) and (disc2.end_date='0000-00-00' or disc2.end_date>=CURDATE())\")\n ->order('price.summ DESC')\n ->group('prices.price_id, price.summ')\n ->having('c_summ>price.summ');\n\n if (!$products_table){\n $sid = ProfileController::getSession();\n $query->where(\"(session_id=:sid AND :sid<>'') OR (user_id=:uid AND :sid<>'')\", array(\n ':sid' => $sid,\n ':uid' => Yii::app()->user->isGuest ? '' : Yii::app()->user->id,\n ));\n }\n\n// $text = $query->getText();\n $row = $query->queryRow();\n if ($row)\n $price = self::model()->findByPk($row['price_id']);\n else\n $price = self::model()->find(array('order' => 'summ'));\n\n if ($products_table)\n Yii::app()->db->createCommand(\"DROP TABLE IF EXISTS {$table};\")->execute();\n\n if ($uid)\n $profile = CustomerProfile::model()->with('price')->findByAttributes(array('user_id' => $uid));\n else\n $profile = ProfileController::getProfile();\n\n if ($profile && $profile->price_id && $profile->price->summ > $price->summ)\n return $profile->price;\n else\n return $price;\n }", "public function testPrices()\n {\n $product_id = 7;\n $variation = PRICE_VARIATION_MIDLANDS;\n $price = 68.21;\n $this->assertDatabaseHas('product_prices', [\n 'price' => $price,\n 'product_id' => $product_id,\n 'variation' => $variation\n ]);\n\n $product_id = 10;\n $variation = PRICE_VARIATION_MIDLANDS;\n $price = 68.21;\n $this->assertDatabaseMissing('product_prices', [\n 'price' => $price,\n 'product_id' => $product_id,\n 'variation' => $variation\n ]);\n\n }", "public function testAddRelatedUpSellCrossSellProducts(): void\n {\n $postData = $this->getPostData();\n $this->getRequest()->setMethod(HttpRequest::METHOD_POST);\n $this->getRequest()->setPostValue($postData);\n $this->dispatch('backend/catalog/product/save');\n $this->assertSessionMessages(\n $this->equalTo(['You saved the product.']),\n MessageInterface::TYPE_SUCCESS\n );\n $product = $this->productRepository->get('simple');\n $this->assertEquals(\n $this->getExpectedLinks($postData['links']),\n $this->getActualLinks($product),\n \"Expected linked products do not match actual linked products!\"\n );\n }", "public function setProductPrice($product_price){\n $this->product_price = $product_price;\n }", "public function setPriceCalculation($calculate = true)\n {\n $this->_calculatePrice = $calculate;\n }", "public function productPrices()\n {\n return $this->belongsToMany(ProductPrice::class, 'product_prices', null, 'product_id');\n }", "protected function listProductsVariantsPricelistPricesRequest($product_id, $variant_id)\n {\n // verify the required parameter 'product_id' is set\n if ($product_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $product_id when calling listProductsVariantsPricelistPrices'\n );\n }\n if ($product_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$product_id\" when calling DefaultApi.listProductsVariantsPricelistPrices, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'variant_id' is set\n if ($variant_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $variant_id when calling listProductsVariantsPricelistPrices'\n );\n }\n if ($variant_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$variant_id\" when calling DefaultApi.listProductsVariantsPricelistPrices, must be bigger than or equal to 1.');\n }\n $resourcePath = '/products/{productId}/variants/{variantId}/prices';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($product_id !== null) {\n $resourcePath = str_replace(\n '{' . 'productId' . '}',\n ObjectSerializer::toPathValue($product_id),\n $resourcePath\n );\n }\n // path params\n if ($variant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'variantId' . '}',\n ObjectSerializer::toPathValue($variant_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n \n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function updateProduct($product_id, $name, $price, $available, $society_id) {\r\n\t\t\tif ($product_id == null) {\r\n\t\t\t\t$sql = \"INSERT IGNORE INTO `products` (product_name, price, available, society_id) VALUES('%s', '%s', '%s', '%s')\";\r\n\t\t\t\treturn $this->query($sql, $name, $price, $available, $society_id);\r\n\t\t\t} else {\r\n\t\t\t\t$sql = \"UPDATE `products` SET product_name='%s', price='%s', available='%s', society_id='%s' WHERE product_id='%s'\";\r\n\t\t\t\treturn $this->query($sql, $name, $price, $available, $society_id, $product_id);\r\n\t\t\t}\r\n\t\t}", "private function calculate_item_prices()\r\n\t{\r\n\t\t// Loop through cart items.\r\n\t\tforeach($this->flexi->cart_contents['items'] as $row_id => $row)\r\n\t\t{\r\n\t\t\t// Check if the item has a specific tax rate set.\r\n\t\t\t$item_tax_rate = $this->get_item_tax_rate($row_id, FALSE); \r\n\r\n\t\t\t// Calculate the internal item price.\r\n\t\t\t$item_internal_tax_data = $this->calculate_tax($row[$this->flexi->cart_columns['item_internal_price']], $item_tax_rate);\r\n\r\n\t\t\t// Calculate the tax on the item price using the carts current location settings.\r\n\t\t\t$item_tax_data = $this->calculate_tax($item_internal_tax_data['value_ex_tax'], $item_tax_rate, FALSE, TRUE);\r\n\t\t\t\t\t\t\r\n\t\t\t// Update the item price.\r\n\t\t\t$row[$this->flexi->cart_columns['item_price']] = $this->format_calculation($item_tax_data['value_inc_tax']);\r\n\r\n\t\t\t// Save item pricing.\r\n\t\t\t$this->flexi->cart_contents['items'][$row_id] = $row;\r\n\t\t}\r\n\t}", "static public function resetProductsToMaxPrice( $items = false, $verbose = false ) {\n\n $items = $items ? $items : WPLA_ListingQueryHelper::getItemsWithoutLowestPriceButPriceLowerThanMaxPrice();\n $changed_product_ids = array();\n\n // loop found listings\n foreach ( $items as $item ) {\n\n // make sure there is a max_price but no lowest price\n if ( ! $item->post_id ) continue;\n if ( ! $item->min_price ) continue;\n if ( ! $item->max_price ) continue;\n if ( $item->lowest_price ) continue;\n\n // target price is max price\n $target_price = $item->max_price;\n if ( $verbose ) wpla_show_message( $item->sku.': No BuyBox price, no competitor - falling back to Max Price: '.$target_price );\n\n // update price\n $price_was_changed = self::updateAmazonPrice( $item, $target_price, $verbose );\n if ( $price_was_changed ) $changed_product_ids[] = $item->post_id;\n WPLA()->logger->info('resetProductsToMaxPrice() - new price for #'.$item->sku.': '.$target_price);\n\n } // foreach item\n\n return $changed_product_ids;\n }", "function _do_price_mail()\n\t{\n\t\t$i=0;\n\t\twhile (array_key_exists('pop3_'.strval($i),$_POST))\n\t\t{\n\t\t\t$price=post_param_integer('pop3_'.strval($i));\n\t\t\t$name='pop3_'.post_param('dpop3_'.strval($i));\n\t\t\t$name2='pop3_'.post_param('ndpop3_'.strval($i));\n\t\t\tif (post_param_integer('delete_pop3_'.strval($i),0)==1)\n\t\t\t{\n\t\t\t\t$GLOBALS['SITE_DB']->query_delete('prices',array('name'=>$name),'',1);\n\t\t\t} else\n\t\t\t{\n\t\t\t\t$GLOBALS['SITE_DB']->query_update('prices',array('price'=>$price,'name'=>$name2),array('name'=>$name),'',1);\n\t\t\t}\n\n\t\t\t$i++;\n\t\t}\n\t}", "public function _get_prices_result($arts, $discount = 0, $primary_article = null, $is_join_vendors = true)\n\t{\n\t\t$i_ids_array = $this->local->import_group_ids_array();\n\n $this->numbers = array();\n $this->brands = array();\n\t\t$this->stock = array();\n\n // Prep the brand warning trigger\n $this->all_brands_are_similar = TRUE;\n\n\t\t//\n\t\t$this->arts_keyvals = array();\n\n\t\tif (!empty($primary_article))\n\t\t\t$arts[] = $primary_article;\n\n\t\tif (empty($arts) || !is_array($arts))\n\t\t\treturn null;\n\n\t\t// Iterate through input\n\t\tforeach ($arts as $art)\n\t\t{\n\t\t\t// There can be complete article objects\n\t\t\tif (is_object($art))\n\t\t\t{\n\t\t\t\t$nr = (string) $art->number_clear;\n\t\t\t}\n\n\t\t\t// Or just article numbers (AZ1232 is also meant to be a number)\n\t\t\telse\n\t\t\t{\n\t\t\t\t// We cast string for the case when article number starts with zero\n\t\t\t\t$nr = (string) $art;\n\t\t\t}\n\n\t\t\t// If the number is not already in array\n\t\t\tif (!in_array($nr, $this->numbers, TRUE))\n\t\t\t{\n\t\t\t\t// Add to array\n $this->numbers[] = $nr;\n\t\t\t}\n\n\t\t\tif (!empty($art->brand_clear) && !empty($art->number_clear))\n\t\t\t\t$this->arts_keyvals[$art->brand_clear . $art->number_clear] = $art;\n\t\t\telse\n\t\t\t\t$this->arts_keyvals[] = $art;\n\t\t}\n\n\t\t// Prep a DB where_in routine\n\t\t$this->db->where_in('art_number_clear', $this->numbers);\n\n\t\t// Other DB conditions\n\t\tif ($is_join_vendors)\n\t\t{\n\t\t\t$this->db->select\n\t\t\t('\n\t\t\t\tprices.id,\n\t\t\t\tprices.art_number,\n\t\t\t\tprices.art_number_clear,\n\t\t\t\tprices.sup_brand,\n\t\t\t\tprices.vendor_id,\n\t\t\t\tprices.description,\n\t\t\t\tprices.qty,\n\t\t\t\tprices.price,\n\t\t\t\tvendors.vendor_name,\n\t\t\t\tvendors.delivery_days\n\t\t\t');\n\n\t\t\t$this->db->join('vendors', 'prices.vendor_id = vendors.id');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->db->select('`id`, `art_number_clear`, `art_number`, `sup_brand`, `vendor_id`, `description`, `qty`, `price`', FALSE);\n\t\t}\n\n\t\t$this->db->where_in('prices.import_group_id', $i_ids_array);\n\n\t\t// Limit to 500 just in case (as prices table is very heavy)\n\t\t$this->db->limit(500);\n\n\t\t// Perform query\n\t\t$q = $this->db->get('prices');\n\n $this->stock_num_rows = $q->num_rows();\n\n\t\tif ($this->stock_num_rows > 0) {\n\t\t\tforeach ($q->result() as $r) {\n\t\t\t\t$r->sup_brand_clear = $this->appflow->qprep($r->sup_brand, \"sup_brand\");\n\t\t\t\t$r->art_number_clear = $this->appflow->qprep($r->art_number, \"art_nr\");\n\n\t\t\t\t$r->idkey = $r->sup_brand_clear . $r->art_number_clear;\n\n if (!empty($this->arts_keyvals[$r->idkey])) {\n $stock_art = clone $this->arts_keyvals[$r->idkey];\n }\n else {\n $stock_art = new stdClass();\n\n if (count($arts) == 1 && !empty($primary_article)) {\n $stock_art->number = $primary_article->number;\n $stock_art->brand = $primary_article->brand;\n $stock_art->number_clear = $primary_article->number_clear;\n $stock_art->brand_clear = $primary_article->brand_clear;\n }\n }\n\n $stock_art->number_prc = $r->art_number;\n $stock_art->number_prc_clear = $r->art_number_clear;\n $stock_art->brand_prc = $r->sup_brand;\n $stock_art->brand_prc_clear = $r->sup_brand_clear;\n $stock_art->prices_row_id = $r->id;\n $stock_art->name_prc = $r->description;\n $stock_art->qty = $r->qty;\n $stock_art->price = $r->price;\n $stock_art->vendor_id = $r->vendor_id;\n $stock_art->vendor_name = $this->local->vendor($r->vendor_id)->vendor_name;\n $stock_art->vendor_delivery_days = $this->local->vendor($r->vendor_id)->delivery_days;\n $stock_art->vendor_last_update_readable = date('d.m.Y', $this->local->vendor($r->vendor_id)->last_update);\n $stock_art->discount = $discount;\n\n if ($discount > 0)\n {\n $stock_art->discount_price = $r->price * (1 - $discount/100);\n }\n else\n {\n $stock_art->discount_price = $r->price;\n }\n\n // Check Brands for matching\n $stock_art->brands_match = $this->is_similar_brands($stock_art->brand_prc_clear, $stock_art->brand_clear);\n\n if ($stock_art->brands_match === FALSE or $stock_art->brands_match === 'neutral')\n {\n $this->all_brands_are_similar = FALSE;\n }\n\n // Mark as primary\n if (!empty($primary_article) && $stock_art->brands_match === TRUE && $primary_article->number_clear == $stock_art->number_clear)\n $stock_art->primary = TRUE;\n else\n $stock_art->primary = FALSE;\n\n // no duplicates from prices\n $this->stock[$r->id] = $stock_art;\n\n // simply brands list\n if (!in_array($stock_art->brand_clear, $this->brands))\n $this->brands[] = $stock_art->brand_clear;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\n\n\t\t// Return\n\t\treturn false;\n\t}", "private function createMultipleProductsPlaceHolders($multipleProducts, $translations, &$args)\n\t{\n\t\t$formId = (int) $args['form']->FormId;\n\t\t$submissionId = (int) $args['submission']->SubmissionId;\n\t\t$multipleSeparator = nl2br($args['form']->MultipleSeparator);\n\t\t$properties = RSFormProHelper::getComponentProperties($multipleProducts, false);\n\t\t$priceHelper = new Price($this->loadFormSettings($formId));\n\t\t$this->translate($properties, $translations);\n\n\t\tforeach ($multipleProducts as $product)\n\t\t{\n\t\t\t$data = $properties[$product];\n\t\t\t$value = $this->getSubmissionValue($submissionId, (int) $product);\n\n\t\t\tif ($value === '' || $value === null)\n\t\t\t{\n\t\t\t\t$args['placeholders'][] = '{' . $data['NAME'] . ':amount}';\n\t\t\t\t$args['values'][] = '';\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$values = explode(\"\\n\", $value);\n\n\t\t\t$field = new MultipleProducts(\n\t\t\t\t[\n\t\t\t\t\t'formId' => $formId,\n\t\t\t\t\t'componentId' => $product,\n\t\t\t\t\t'data' => $data,\n\t\t\t\t\t'value' => ['formId' => $formId, $data['NAME'] => $values],\n\t\t\t\t\t'invalid' => false,\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t$replace = '{' . $data['NAME'] . ':price}';\n\t\t\t$with = [];\n\t\t\t$withAmount = [];\n\n\t\t\tif ($items = $field->getItems())\n\t\t\t{\n\t\t\t\tforeach ($items as $item)\n\t\t\t\t{\n\t\t\t\t\tif (empty($item))\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$item = new RSFormProFieldItem($item);\n\n\t\t\t\t\tforeach ($values as $value)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (stristr($value, $item->label))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$with[] = $priceHelper->getPriceMask(\n\t\t\t\t\t\t\t\t$value, $item->value, ($data['CURRENCY'] ?? '')\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$quantity = trim(str_ireplace($item->label, '', $value));\n\n\t\t\t\t\t\t\tif (strlen($quantity) === 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$quantity = 1;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$withAmount[] = $quantity * $item->value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (($position = array_search($replace, $args['placeholders'])) !== false)\n\t\t\t{\n\t\t\t\t$args['placeholders'][$position] = $replace;\n\t\t\t\t$args['values'][$position] = implode($multipleSeparator, $with);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$args['placeholders'][] = $replace;\n\t\t\t\t$args['values'][] = implode($multipleSeparator, $with);\n\t\t\t}\n\n\t\t\t$args['placeholders'][] = '{' . $data['NAME'] . ':amount}';\n\t\t\t$args['values'][] = $priceHelper->getAmountMask(\n\t\t\t\t($withAmount ? array_sum($withAmount) : 0), ($data['CURRENCY'] ?? '')\n\t\t\t);\n\t\t}\n\t}", "public function getEggWidgetProducts(array $params)\n {\n $sql = 'SELECT *';\n if ($params['sortby'] == 'discount')\n $sql .= ', old_price-price as discount';\n\n $sql .= ' from ' . $this->tableName();\n\n //where\n $ids = array();\n $where = array();\n if ($params['affegg_ids'])\n {\n $ids = explode(',', $params['affegg_ids']);\n if ($ids)\n {\n $inQuery = implode(',', array_fill(0, count($ids), '%d'));\n $where[] = 'egg_id IN(' . $inQuery . ')';\n }\n }\n if ($params['in_stock'])\n $where[] = 'in_stock = 1';\n if ($params['sortby'] == 'discount')\n $where[] = 'old_price != 0';\n if ($where)\n $sql .= \" WHERE \" . implode(\" AND \", $where);\n\n //order\n if ($params['sortby'] == 'last')\n $params['sortby'] = \"egg_id\";\n $sql .= ' ORDER BY ';\n if ($params['sortby'] == 'random')\n $sql .= 'RAND()';\n elseif ($params['sortby'] == 'create_date')\n $sql .= 'create_date DESC';\n elseif ($params['sortby'] == 'last_update')\n $sql .= 'last_update DESC';\n elseif ($params['sortby'] == 'egg_id')\n $sql .= 'egg_id DESC';\n elseif ($params['sortby'] == 'discount')\n $sql .= 'discount DESC';\n\n //limit\n if ($params['limit'])\n $sql .= ' LIMIT ' . (int) $params['limit'];\n if ($ids)\n $sql = $this->getDb()->prepare($sql, $ids);\n $rows = $this->getDb()->get_results($sql, \\ARRAY_A);\n if (!$rows)\n return array();\n foreach ($rows as $i => $r)\n {\n $rows[$i]['extra'] = unserialize($r['extra']);\n }\n return $rows;\n }", "function setPrice($new_price)\n {\n $this->price = $new_price;\n }", "public function execute($ids)\n {\n // TODO: check configurable products\n\n $storeIds = array_keys($this->storeManager->getStores());\n foreach ($storeIds as $storeId) {\n if (!$this->configHelper->isEnabled($storeId)) {\n $this->logger->info('[LOGSHUBSEARCH] Synchronizing disabled for #'.$storeId);\n return;\n }\n if (!$this->configHelper->isReadyToIndex($storeId)) {\n $this->logger->error('[LOGSHUBSEARCH] Unable to update products index. Configuration error #'.$storeId);\n return;\n }\n\n if (!is_array($ids) || empty($ids)) {\n $ids = $this->getAllProductIds();\n $this->logger->info('[LOGSHUBSEARCH] Synchronizing all the '.count($ids).' products, store: #'.$storeId);\n }\n \n $sender = $this->helper->getProductsSender($storeId);\n $pageLength = $this->configHelper->getProductsIndexerPageLength($storeId);\n foreach (array_chunk($ids, $pageLength) as $chunk) {\n $apiProducts = $this->helper->getApiProducts($chunk);\n $sender->synch($apiProducts);\n }\n }\n }", "protected function deleteProductsVariantsPricelistPriceRequest($product_id, $variant_id, $pricelist_id)\n {\n // verify the required parameter 'product_id' is set\n if ($product_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $product_id when calling deleteProductsVariantsPricelistPrice'\n );\n }\n if ($product_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$product_id\" when calling DefaultApi.deleteProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'variant_id' is set\n if ($variant_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $variant_id when calling deleteProductsVariantsPricelistPrice'\n );\n }\n if ($variant_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$variant_id\" when calling DefaultApi.deleteProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'pricelist_id' is set\n if ($pricelist_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pricelist_id when calling deleteProductsVariantsPricelistPrice'\n );\n }\n if ($pricelist_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$pricelist_id\" when calling DefaultApi.deleteProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n $resourcePath = '/products/{productId}/variants/{variantId}/prices/{pricelistId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($product_id !== null) {\n $resourcePath = str_replace(\n '{' . 'productId' . '}',\n ObjectSerializer::toPathValue($product_id),\n $resourcePath\n );\n }\n // path params\n if ($variant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'variantId' . '}',\n ObjectSerializer::toPathValue($variant_id),\n $resourcePath\n );\n }\n // path params\n if ($pricelist_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pricelistId' . '}',\n ObjectSerializer::toPathValue($pricelist_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n \n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function testProductGetPrices()\n {\n $product = $this->find('product', 1);\n $prices = $product->getPrices();\n $price = $prices[0];\n \n $currencies = $this->findAll('currency');\n $dollarCurrency = $currencies[0];\n \n $money = Money::create(10, $dollarCurrency); \n \n $this->assertEquals(\n $money,\n $price\n );\n }", "protected function _saveProducts()\n {\n $priceIsGlobal = $this->_catalogData->isPriceGlobal();\n $productLimit = null;\n $productsQty = null;\n $entityLinkField = $this->getProductEntityLinkField();\n\n while ($bunch = $this->_dataSourceModel->getNextBunch()) {\n $entityRowsIn = [];\n $entityRowsUp = [];\n $attributes = [];\n $this->websitesCache = [];\n $this->categoriesCache = [];\n $tierPrices = [];\n $mediaGallery = [];\n $labelsForUpdate = [];\n $imagesForChangeVisibility = [];\n $uploadedImages = [];\n $previousType = null;\n $prevAttributeSet = null;\n $existingImages = $this->getExistingImages($bunch);\n\n foreach ($bunch as $rowNum => $rowData) {\n // reset category processor's failed categories array\n $this->categoryProcessor->clearFailedCategories();\n\n if (!$this->validateRow($rowData, $rowNum)) {\n continue;\n }\n if ($this->getErrorAggregator()->hasToBeTerminated()) {\n $this->getErrorAggregator()->addRowToSkip($rowNum);\n continue;\n }\n $rowScope = $this->getRowScope($rowData);\n\n $rowData[self::URL_KEY] = $this->getUrlKey($rowData);\n\n $rowSku = $rowData[self::COL_SKU];\n\n if (null === $rowSku) {\n $this->getErrorAggregator()->addRowToSkip($rowNum);\n continue;\n } elseif (self::SCOPE_STORE == $rowScope) {\n // set necessary data from SCOPE_DEFAULT row\n $rowData[self::COL_TYPE] = $this->skuProcessor->getNewSku($rowSku)['type_id'];\n $rowData['attribute_set_id'] = $this->skuProcessor->getNewSku($rowSku)['attr_set_id'];\n $rowData[self::COL_ATTR_SET] = $this->skuProcessor->getNewSku($rowSku)['attr_set_code'];\n }\n\n // 1. Entity phase\n if ($this->isSkuExist($rowSku)) {\n // existing row\n if (isset($rowData['attribute_set_code'])) {\n $attributeSetId = $this->catalogConfig->getAttributeSetId(\n $this->getEntityTypeId(),\n $rowData['attribute_set_code']\n );\n\n // wrong attribute_set_code was received\n if (!$attributeSetId) {\n throw new LocalizedException(\n __(\n 'Wrong attribute set code \"%1\", please correct it and try again.',\n $rowData['attribute_set_code']\n )\n );\n }\n } else {\n $attributeSetId = $this->skuProcessor->getNewSku($rowSku)['attr_set_id'];\n }\n\n $entityRowsUp[] = [\n 'updated_at' => (new \\DateTime())->format(DateTime::DATETIME_PHP_FORMAT),\n 'attribute_set_id' => $attributeSetId,\n $entityLinkField => $this->getExistingSku($rowSku)[$entityLinkField]\n ];\n } else {\n if (!$productLimit || $productsQty < $productLimit) {\n $entityRowsIn[strtolower($rowSku)] = [\n 'attribute_set_id' => $this->skuProcessor->getNewSku($rowSku)['attr_set_id'],\n 'type_id' => $this->skuProcessor->getNewSku($rowSku)['type_id'],\n 'sku' => $rowSku,\n 'has_options' => isset($rowData['has_options']) ? $rowData['has_options'] : 0,\n 'created_at' => (new \\DateTime())->format(DateTime::DATETIME_PHP_FORMAT),\n 'updated_at' => (new \\DateTime())->format(DateTime::DATETIME_PHP_FORMAT),\n ];\n $productsQty++;\n } else {\n $rowSku = null;\n // sign for child rows to be skipped\n $this->getErrorAggregator()->addRowToSkip($rowNum);\n continue;\n }\n }\n\n if (!array_key_exists($rowSku, $this->websitesCache)) {\n $this->websitesCache[$rowSku] = [];\n }\n // 2. Product-to-Website phase\n if (!empty($rowData[self::COL_PRODUCT_WEBSITES])) {\n $websiteCodes = explode($this->getMultipleValueSeparator(), $rowData[self::COL_PRODUCT_WEBSITES]);\n foreach ($websiteCodes as $websiteCode) {\n $websiteId = $this->storeResolver->getWebsiteCodeToId($websiteCode);\n $this->websitesCache[$rowSku][$websiteId] = true;\n }\n }\n\n // 3. Categories phase\n if (!array_key_exists($rowSku, $this->categoriesCache)) {\n $this->categoriesCache[$rowSku] = [];\n }\n $rowData['rowNum'] = $rowNum;\n $categoryIds = $this->processRowCategories($rowData);\n foreach ($categoryIds as $id) {\n $this->categoriesCache[$rowSku][$id] = true;\n }\n unset($rowData['rowNum']);\n\n // 4.1. Tier prices phase\n if (!empty($rowData['_tier_price_website'])) {\n $tierPrices[$rowSku][] = [\n 'all_groups' => $rowData['_tier_price_customer_group'] == self::VALUE_ALL,\n 'customer_group_id' => $rowData['_tier_price_customer_group'] ==\n self::VALUE_ALL ? 0 : $rowData['_tier_price_customer_group'],\n 'qty' => $rowData['_tier_price_qty'],\n 'value' => $rowData['_tier_price_price'],\n 'website_id' => self::VALUE_ALL == $rowData['_tier_price_website'] ||\n $priceIsGlobal ? 0 : $this->storeResolver->getWebsiteCodeToId($rowData['_tier_price_website']),\n ];\n }\n\n if (!$this->validateRow($rowData, $rowNum)) {\n continue;\n }\n\n // 5. Media gallery phase\n list($rowImages, $rowLabels) = $this->getImagesFromRow($rowData);\n $storeId = !empty($rowData[self::COL_STORE])\n ? $this->getStoreIdByCode($rowData[self::COL_STORE])\n : Store::DEFAULT_STORE_ID;\n $imageHiddenStates = $this->getImagesHiddenStates($rowData);\n foreach (array_keys($imageHiddenStates) as $image) {\n if (array_key_exists($rowSku, $existingImages)\n && array_key_exists($image, $existingImages[$rowSku])\n ) {\n $rowImages[self::COL_MEDIA_IMAGE][] = $image;\n $uploadedImages[$image] = $image;\n }\n\n if (empty($rowImages)) {\n $rowImages[self::COL_MEDIA_IMAGE][] = $image;\n }\n }\n\n $rowData[self::COL_MEDIA_IMAGE] = [];\n\n /*\n * Note: to avoid problems with undefined sorting, the value of media gallery items positions\n * must be unique in scope of one product.\n */\n $position = 0;\n foreach ($rowImages as $column => $columnImages) {\n foreach ($columnImages as $columnImageKey => $columnImage) {\n if (!isset($uploadedImages[$columnImage])) {\n $uploadedFile = $this->uploadMediaFiles($columnImage);\n $uploadedFile = $uploadedFile ?: $this->getSystemFile($columnImage);\n if ($uploadedFile) {\n $uploadedImages[$columnImage] = $uploadedFile;\n } else {\n $this->addRowError(\n ValidatorInterface::ERROR_MEDIA_URL_NOT_ACCESSIBLE,\n $rowNum,\n null,\n null,\n ProcessingError::ERROR_LEVEL_NOT_CRITICAL\n );\n }\n } else {\n $uploadedFile = $uploadedImages[$columnImage];\n }\n\n if ($uploadedFile && $column !== self::COL_MEDIA_IMAGE) {\n $rowData[$column] = $uploadedFile;\n }\n\n if ($uploadedFile && !isset($mediaGallery[$storeId][$rowSku][$uploadedFile])) {\n if (isset($existingImages[$rowSku][$uploadedFile])) {\n $currentFileData = $existingImages[$rowSku][$uploadedFile];\n if (isset($rowLabels[$column][$columnImageKey])\n && $rowLabels[$column][$columnImageKey] !=\n $currentFileData['label']\n ) {\n $labelsForUpdate[] = [\n 'label' => $rowLabels[$column][$columnImageKey],\n 'imageData' => $currentFileData\n ];\n }\n\n if (array_key_exists($uploadedFile, $imageHiddenStates)\n && $currentFileData['disabled'] != $imageHiddenStates[$uploadedFile]\n ) {\n $imagesForChangeVisibility[] = [\n 'disabled' => $imageHiddenStates[$uploadedFile],\n 'imageData' => $currentFileData\n ];\n }\n } else {\n if ($column == self::COL_MEDIA_IMAGE) {\n $rowData[$column][] = $uploadedFile;\n }\n $mediaGallery[$storeId][$rowSku][$uploadedFile] = [\n 'attribute_id' => $this->getMediaGalleryAttributeId(),\n 'label' => isset($rowLabels[$column][$columnImageKey])\n ? $rowLabels[$column][$columnImageKey]\n : '',\n 'position' => ++$position,\n 'disabled' => isset($imageHiddenStates[$columnImage])\n ? $imageHiddenStates[$columnImage] : '0',\n 'value' => $uploadedFile,\n ];\n }\n }\n }\n }\n\n // 6. Attributes phase\n $rowStore = (self::SCOPE_STORE == $rowScope)\n ? $this->storeResolver->getStoreCodeToId($rowData[self::COL_STORE])\n : 0;\n $productType = isset($rowData[self::COL_TYPE]) ? $rowData[self::COL_TYPE] : null;\n if ($productType !== null) {\n $previousType = $productType;\n }\n if (isset($rowData[self::COL_ATTR_SET])) {\n $prevAttributeSet = $rowData[self::COL_ATTR_SET];\n }\n if (self::SCOPE_NULL == $rowScope) {\n // for multiselect attributes only\n if ($prevAttributeSet !== null) {\n $rowData[self::COL_ATTR_SET] = $prevAttributeSet;\n }\n if ($productType === null && $previousType !== null) {\n $productType = $previousType;\n }\n if ($productType === null) {\n continue;\n }\n }\n\n $productTypeModel = $this->_productTypeModels[$productType];\n if (!empty($rowData['tax_class_name'])) {\n $rowData['tax_class_id'] =\n $this->taxClassProcessor->upsertTaxClass($rowData['tax_class_name'], $productTypeModel);\n }\n\n if ($this->getBehavior() == Import::BEHAVIOR_APPEND ||\n empty($rowData[self::COL_SKU])\n ) {\n $rowData = $productTypeModel->clearEmptyData($rowData);\n }\n\n $rowData = $productTypeModel->prepareAttributesWithDefaultValueForSave(\n $rowData,\n !$this->isSkuExist($rowSku)\n );\n $product = $this->_proxyProdFactory->create(['data' => $rowData]);\n\n foreach ($rowData as $attrCode => $attrValue) {\n $attribute = $this->retrieveAttributeByCode($attrCode);\n\n if ('multiselect' != $attribute->getFrontendInput() && self::SCOPE_NULL == $rowScope) {\n // skip attribute processing for SCOPE_NULL rows\n continue;\n }\n $attrId = $attribute->getId();\n $backModel = $attribute->getBackendModel();\n $attrTable = $attribute->getBackend()->getTable();\n $storeIds = [0];\n\n if ('datetime' == $attribute->getBackendType()\n && (\n in_array($attribute->getAttributeCode(), $this->dateAttrCodes)\n || $attribute->getIsUserDefined()\n )\n ) {\n $attrValue = $this->dateTime->formatDate($attrValue, false);\n } elseif ('datetime' == $attribute->getBackendType() && strtotime($attrValue)) {\n $attrValue = gmdate(\n 'Y-m-d H:i:s',\n $this->_localeDate->date($attrValue)->getTimestamp()\n );\n } elseif ($backModel) {\n $attribute->getBackend()->beforeSave($product);\n $attrValue = $product->getData($attribute->getAttributeCode());\n }\n if (self::SCOPE_STORE == $rowScope) {\n if (self::SCOPE_WEBSITE == $attribute->getIsGlobal()) {\n // check website defaults already set\n if (!isset($attributes[$attrTable][$rowSku][$attrId][$rowStore])) {\n $storeIds = $this->storeResolver->getStoreIdToWebsiteStoreIds($rowStore);\n }\n } elseif (self::SCOPE_STORE == $attribute->getIsGlobal()) {\n $storeIds = [$rowStore];\n }\n if (!$this->isSkuExist($rowSku)) {\n $storeIds[] = 0;\n }\n }\n foreach ($storeIds as $storeId) {\n if (!isset($attributes[$attrTable][$rowSku][$attrId][$storeId])) {\n $attributes[$attrTable][$rowSku][$attrId][$storeId] = $attrValue;\n }\n }\n // restore 'backend_model' to avoid 'default' setting\n $attribute->setBackendModel($backModel);\n }\n }\n\n foreach ($bunch as $rowNum => $rowData) {\n if ($this->getErrorAggregator()->isRowInvalid($rowNum)) {\n unset($bunch[$rowNum]);\n }\n }\n\n $this->saveProductEntity(\n $entityRowsIn,\n $entityRowsUp\n )->_saveProductWebsites(\n $this->websitesCache\n )->_saveProductCategories(\n $this->categoriesCache\n )->_saveProductTierPrices(\n $tierPrices\n )->_saveMediaGallery(\n $mediaGallery\n )->_saveProductAttributes(\n $attributes\n )->updateMediaGalleryVisibility(\n $imagesForChangeVisibility\n )->updateMediaGalleryLabels(\n $labelsForUpdate\n );\n\n $this->_eventManager->dispatch(\n 'catalog_product_import_bunch_save_after',\n ['adapter' => $this, 'bunch' => $bunch]\n );\n }\n\n return $this;\n }", "private function updateQuoteItemPrices(CartInterface $quote)\n {\n $negotiableQuote = $quote->getExtensionAttributes()->getNegotiableQuote();\n $quoteId = $quote->getId();\n if (!in_array($quoteId, $this->updatedQuoteIds)) {\n $this->updatedQuoteIds[] = $quoteId;\n if ($negotiableQuote->getNegotiatedPriceValue() === null) {\n $this->quoteItemManagement->recalculateOriginalPriceTax($quote->getId(), true, true, false, false);\n } else {\n $this->quoteItemManagement->updateQuoteItemsCustomPrices($quote->getId(), false);\n }\n }\n }", "public function run()\n {\n DB::table('product_prices')->insert([\n 'product_id' => 1,\n 'description' => 'single',\n 'price' => 100.00\n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 2,\n 'description' => 'single', \n 'price' => 200.00 \n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 3,\n 'description' => 'single', \n 'price' => 300.00 \n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 4,\n 'description' => 'single',\n 'price' => 400.00 \n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 5,\n 'description' => 'single',\n 'price' => 500.00\n ]);\n DB::table('product_prices')->insert([\n 'product_id' => 6,\n 'description' => 'single',\n 'price' => 600.00\n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 7,\n 'description' => 'single',\n 'price' => 700.00\n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 8,\n 'description' => 'single',\n 'price' => 800.00\n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 9,\n 'description' => 'single',\n 'price' => 9000.00\n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 1,\n 'description' => 'bundle (10 pcs)',\n 'price' => 1000.00\n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 2,\n 'description' => 'bundle (10 pcs)', \n 'price' => 2000.00 \n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 3,\n 'description' => 'bundle (10 pcs)', \n 'price' => 3000.00 \n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 4,\n 'description' => 'bundle (10 pcs)',\n 'price' => 4000.00 \n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 5,\n 'description' => 'bundle (10 pcs)',\n 'price' => 5000.00\n ]);\n DB::table('product_prices')->insert([\n 'product_id' => 6,\n 'description' => 'bundle (10 pcs)',\n 'price' => 6000.00\n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 7,\n 'description' => 'bundle (10 pcs)',\n 'price' => 7000.00\n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 8,\n 'description' => 'bundle (10 pcs)',\n 'price' => 8000.00\n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 9,\n 'description' => 'bundle (10 pcs)',\n 'price' => 9000.00\n ]);\n }", "public function updateProductStyleOptionPricingAll(){\n\t\t$all_products = $this->getAll();\n\t\t$this->load->model('catalog/product');\n\t\t$this->load->model('tshirtgang/pricing');\n\t\t$this->load->model('catalog/option');\n\t\t$tshirt_option_names = array('Tshirt Color', 'Tshirt Style', 'Tshirt Size');\n\t\t$tshirt_colored = array(\n\t\t\t\"Black\",\n\t\t\t\"Charcoal Grey\",\n\t\t\t\"Daisy\",\n\t\t\t\"Dark Chocolate\",\n\t\t\t\"Forest Green\",\n\t\t\t\"Gold\",\n\t\t\t\"Irish Green\",\n\t\t\t\"Light Blue\",\n\t\t\t\"Light Pink\",\n\t\t\t\"Military Green\",\n\t\t\t\"Navy\",\n\t\t\t\"Orange\",\n\t\t\t\"Purple\",\n\t\t\t\"Red\",\n\t\t\t\"Royal Blue\",\n\t\t\t\"Sport Grey\",\n\t\t\t\"Tan\",\n\t\t\t\"Burgundy\"\n\t\t);\n\t\t$tshirt_ringer = array(\n\t\t\t\"Navy Ringer\",\n\t\t\t\"Black Ringer\",\n\t\t\t\"Red Ringer\"\n\t\t);\n\t\t$tshirt_options = array();\n\t\t$tshirt_options_price = array();\n\t\t$options = $this->model_catalog_option->getOptions();\n\t\t$temp_price = 0.0;\n\t\tforeach($options as $option){\n\t\t\t//if($option['name'] == 'Tshirt Color'){\n\t\t\t//\t$tshirtcolor_option_id = $option['option_id'];\n\t\t\t//}\n\t\t\t//if($option['name'] == 'Tshirt Style'){\n\t\t\t//\t$tshirtstyle_option_id = $option['option_id'];\n\t\t\t//}\n\t\t\t//if($option['name'] == 'Tshirt Size'){\n\t\t\t//\t$tshirtsize_option_id = $option['option_id'];\n\t\t\t//}\n\t\t\tif(in_array($option['name'], $tshirt_option_names)){\n\t\t\t\t$tshirt_options[$option['name']] = array();\n\t\t\t\t$tshirt_options[$option['name']]['option_id'] = $option['option_id'];\n\t\t\t\t$tshirt_options[$option['name']]['prices'] = array();\n\t\t\t}\n\t\t}\n\t\tforeach($tshirt_option_names as $tshirt_option_name){\n\t\t\t$option_value_descriptions = $this->model_catalog_option->getOptionValueDescriptions($tshirt_options[$tshirt_option_name]['option_id']);\n\t\t\tforeach($option_value_descriptions as $opv){\n\t\t\t\t$temp_price = 0.0;\n\t\t\t\tif($tshirt_option_name=='Tshirt Color'){\n\t\t\t\t\tif( in_array($opv['option_value_description'][1]['name'], $tshirt_colored )){\n\t\t\t\t\t\t$temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'ColorShirt' ));\n\t\t\t\t\t} elseif( in_array($opv['option_value_description'][1]['name'], $tshirt_ringer )){\n\t\t\t\t\t\t$temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'RingerShirt' ));\n\t\t\t\t\t} else { // white\n\t\t\t\t\t\t$temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'WhiteShirt' ));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif($tshirt_option_name=='Tshirt Style'){\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"Mens Fitted\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'MensFittedIncremental' ));\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"Ladies\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'LadiesIncremental' ));\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"Hooded Pullover\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'HoodieIncremental' ));\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"Apron\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'ApronIncremental' ));\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"Vneck\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'VneckIncremental' ));\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"Tanktop\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'TanktopIncremental' ));\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"Baby One Piece\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'BabyOnePieceIncremental' ));\n\t\t\t\t}\n\t\t\t\tif($tshirt_option_name=='Tshirt Size'){\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"2 X-Large\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'Shirt_2XL_Incremental' ));\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"3 X-Large\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'Shirt_3XL6XL_Incremental' ));\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"4 X-Large\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'Shirt_3XL6XL_Incremental' ));\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"5 X-Large\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'Shirt_3XL6XL_Incremental' ));\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"6 X-Large\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'Shirt_3XL6XL_Incremental' ));\n\t\t\t\t}\n\t\t\t\tif($temp_price != 0.0){\n\t\t\t\t\t$tshirt_options_price = array(\n\t\t\t\t\t\t'option_value_id' => $opv['option_value_id'],\n\t\t\t\t\t\t'name' => $opv['option_value_description'][1]['name'],\n\t\t\t\t\t\t'price' => $temp_price\n\t\t\t\t\t);\n\t\t\t\t\t$tshirt_options[$tshirt_option_name]['prices'][] = $tshirt_options_price;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tforeach($tshirt_options as $tso1){\n\t\t\tforeach($tso1['prices'] as $tso2){\n\t\t\t\t$sql = \"UPDATE \" . DB_PREFIX . \"product_option_value ocpov \";\n\t\t\t\t$sql .= \"LEFT JOIN \" . DB_PREFIX . \"product ocp \";\n\t\t\t\t$sql .= \" ON ocp.product_id = ocpov.product_id \";\n\t\t\t\t$sql .= \"LEFT JOIN \" . DB_PREFIX . \"tshirtgang_products tsgp \";\n\t\t\t\t$sql .= \" ON tsgp.product_id = ocp.product_id \";\n\t\t\t\t$sql .= \"SET ocpov.price=\". (float)$tso2['price'] . \" \";\n\t\t\t\t$sql .= \"WHERE \";\n\t\t\t\t$sql .= \" ocpov.option_value_id = \" . (int)$tso2['option_value_id'] . \" \";\n\t\t\t\t//$sql .= \" AND \";\n\t\t\t\t//$sql .= \" tsgp.id IS NOT NULL \";\n\t\t\t\t$this->db->query($sql);\n\t\t\t}\n\t\t}\n\t}", "public function addOrder($price, $products_id, $quantities, $id_method, $client)\n\t\t{\n\t\t\t$products = [];\n\t\t\tforeach ($products_id as $id) {\n\t\t\t\t$this->mgrProduct->getProductById($id);\n\t\t\t\tarray_push($products, $this->mgrProduct->getProduct()[0]);\n\t\t\t}\n\n\t\t\t$order = new Order(\"\", $client, $price, \"\", $products, $quantities, 'Ouverte');\n\t\t\t$this->mgrOrder->calculatePrice($order);\n\n\t\t\t$this->mgrOrder->insertOrder($order, $client, $id_method);\n\t\t}", "public function LoadProductsForPrice()\n\t\t{\n\t\t\t$query = \"\n\t\t\t\tSELECT\n\t\t\t\t\tp.*,\n\t\t\t\t\tFLOOR(prodratingtotal / prodnumratings) AS prodavgrating,\n\t\t\t\t\timageisthumb,\n\t\t\t\t\timagefile,\n\t\t\t\t\t\" . GetProdCustomerGroupPriceSQL() . \"\n\t\t\t\tFROM\n\t\t\t\t\t(\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\tDISTINCT ca.productid,\n\t\t\t\t\t\t\tFLOOR(prodratingtotal / prodnumratings) AS prodavgrating\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t[|PREFIX|]categoryassociations ca\n\t\t\t\t\t\t\tINNER JOIN [|PREFIX|]products p ON p.productid = ca.productid\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\tp.prodvisible = 1 AND\n\t\t\t\t\t\t\tca.categoryid IN (\" . $this->GetProductCategoryIds() . \") AND\n\t\t\t\t\t\t\tp.prodcalculatedprice >= '\".(int)$this->GetMinPrice().\"' AND\n\t\t\t\t\t\t\tp.prodcalculatedprice <= '\".(int)$this->GetMaxPrice().\"'\n\t\t\t\t\t\tORDER BY\n\t\t\t\t\t\t\t\" . $this->GetSortField() . \", p.prodname ASC\n\t\t\t\t\t\t\" . $GLOBALS['ISC_CLASS_DB']->AddLimit($this->GetStart(), GetConfig('CategoryProductsPerPage')) . \"\n\t\t\t\t\t) AS ca\n\t\t\t\t\tINNER JOIN [|PREFIX|]products p ON p.productid = ca.productid\n\t\t\t\t\tLEFT JOIN [|PREFIX|]product_images pi ON (pi.imageisthumb = 1 AND p.productid = pi.imageprodid)\n\t\t\t\";\n\n\t\t\t//$query .= $GLOBALS['ISC_CLASS_DB']->AddLimit($this->GetStart(), GetConfig('CategoryProductsPerPage'));\n\t\t\t$result = $GLOBALS['ISC_CLASS_DB']->Query($query);\n\t\t\twhile ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {\n\t\t\t\t$row['prodavgrating'] = (int)$row['prodavgrating'];\n\t\t\t\t$this->_priceproducts[] = $row;\n\t\t\t}\n\t\t}", "protected function updateQuoteProducts($quote, $products)\n {\n foreach ($products['cart'] as $id => $product) {\n $product['quote_id'] = $quote->id;\n $product['product_id'] = $id;\n\n ProductQuote::create($product);\n }\n }", "public function save_submissions() {\n\t\t\t$quiz_submissions = ! empty( $_POST['quiz_submissions'] ) ? $_POST['quiz_submissions'] : '';\n\t\t\t$parent_id = ! empty( $_POST['parent_id'] ) ? $_POST['parent_id'] : '';\n\t\t\t$linked_products = ! empty( $_POST['linked_products'] ) ? $_POST['linked_products'] : '';\n\t\t\t$all_products = array();\n\n\t\t\tif ( $quiz_submissions ) {\n\n\t\t\t\tif( $linked_products ) {\n\t\t\t\t\t\t\n\t\t\t\t\tforeach ($linked_products as $key => $value) {\n\n\t\t\t\t\t\tif( $value ){\n\t\t\t\t\t\t\t$all_products = array_merge( $all_products, explode( ',', $value ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t$all_products = array_unique( $all_products );\n\t\t\t\t\t$total = 0;\n\t\t\t\t\t\n\t\t\t\t\tforeach ( $all_products as $key => $product_id) {\n\t\t\t\t\t\t$product = wc_get_product( $product_id );\n\t\t\t\t\t\t$product_image = wp_get_attachment_url( $product->get_image_id() );\n\t\t\t\t\t\t$recomend_products[] = '<img src=\"'.$product_image.'\" height=\"auto\" width=\"100\"><br><a href=\"'.$product->get_permalink( $product->get_id() ).'\">'.$product->get_name().'</a> - '.$product->get_price_html(); \n\t\t\t\t\t\t$total += $product->get_price();\n\t\t\t\t\t\t$products[] = '<center><img src=\"'.$product_image.'\" height=\"auto\" width=\"200\"></center><br>'.\n\t\t\t\t\t\t'<p>'.$product->get_name().'</p>'.\n\t\t\t\t\t\t'<p>'.$product->get_short_description().'</p>'.\n\t\t\t\t\t\t'<a href=\"'.$product->get_permalink( $product->get_id() ).'\">More Information</a>';\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( isset( $_POST['customer_email'] ) && 'yes' == get_option( 'fitts_allow_email_product' ) && $all_products ) {\n\t\t\t\t\t\t$to = sanitize_text_field( wp_unslash( $_POST['customer_email'] ) );\n\t\t\t\t\t\t$subject = \"Recommended Products\";\n\t\t\t\t\t\t$headers = array('Content-Type: text/html; charset=UTF-8');\n\n\t\t\t\t\t\t$message .= \"<p><b>Recommended Products</b></p>\";\n\t\t\t\t\t\tforeach ( $recomend_products as $key => $product ) { \n\t\t\t\t\t\t\t$message .= \"<p>\" . $product .\"</p>\"; \n\t\t\t\t\t\t}\n\t\t\t\t\t\t$message .= \"<p><b>Total</b> \" . wc_price($total) .\"</p>\";\n\t\t\t\t\t\t$message .= \"<p>\" . wc_price($total/31) .\" <b>per day</b></p>\";\n\n\t\t\t\t\t\twp_mail( $to, $subject, $message, $headers );\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\t$post_arr = array(\n\t\t\t\t\t'post_title' => 'Fitts Quiz Submission',\n\t\t\t\t\t'post_status' => 'draft',\n\t\t\t\t\t'post_type' => 'post',\n\t\t\t\t\t'post_author' => get_current_user_id(),\n\t\t\t\t\t'post_parent' => $parent_id,\n\t\t\t\t\t'meta_input' => array(\n\t\t\t\t\t\t'fitts_quiz_submission' => $quiz_submissions,\n\t\t\t\t\t),\n\t\t\t\t);\n\n\t\t\t\t$post_id = wp_insert_post( $post_arr );\n\n\t\t\t\tif ( ! is_wp_error( $post_id ) ) {\n\n\t\t\t\t\tupdate_post_meta( $post_id, 'linked_products', $all_products );\n\t\t\t\t\tforeach ( $all_products as $key => $product_id ) {\n\n\t\t\t\t\t\t$quantity = 1;\n\t\t\t\t\t\t$cart_item_key = wc()->cart->add_to_cart( $product_id, $quantity, $cart_item_data );\n\n\t\t\t\t\t}\n\t\t\t\t\tif( ! $all_products ) {\n\t\t\t\t\t\t$redirect_url = site_url() . '/cart?from=quiz&results=none';\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$redirect_url = site_url() . '/cart?from=quiz';\n\t\t\t\t\t}\n\t\t\t\t\techo json_encode(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'status' => 'success',\n\t\t\t\t\t\t\t'url' => $redirect_url,\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\techo $post_id->get_error_message();\n\t\t\t\t}\n\t\t\t}\n\t\t\twp_die();\n\t\t}", "public function insertQuotedProducts()\n\t{\n\t\t// Insert each product into the database.\n\t\t$i = 0;\n\t\twhile ($i < $_POST['itemCount'])\n\t\t{\n\t\t\t/*\n\t\t\t * Here we will decode the json and create each product and insert it into the\n\t\t\t * product orders database.\n\t\t\t */\n\t\t\t$post_product = json_decode($_POST['product'.$i], true);\n\t\t\t$new_product = new Product($post_product['id']);\n\t\t\t$new_product->setProductQuantity($post_product['qty']);\n\t\t\t$new_product->setProductCost($post_product['cost']);\n\t\t\t$i++;\n\n\t\t\t// Insert the data into the database.\n\t\t\t$this->getDB()->insert('product_orders',array('quote_id'=>$this->id,\n\t\t\t\t\t\t\t'product_type'=>$new_product->getItemType(),\n\t\t\t\t\t\t\t'product_msn'=>$new_product->getModShortName(),\n\t\t\t\t\t\t\t'product_cost'=>$new_product->getProductCost(),\n\t\t\t\t\t\t\t'product_qty'=>$new_product->getProductQuantity(),\n\t\t\t\t\t\t\t'product_name'=>$new_product->getModName(),\n\t\t\t\t\t\t\t'product_id'=>$new_product->getId()));\n\n\t\t\t// Check to see if the data was inserted into the db properly, else throw exception.\n\t\t\tif($this->getDB()->lastId() == null)\n\t\t\t{\n\t\t\t\tthrow new Exception('The database did not insert products properly.');\n\t\t\t}\n\t\t}\n\t}", "public function getProductPriceAll()\n {\n return $this->_scopeConfig->getValue('splitprice/split_price_config/show_all', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n }", "public function fetchQuoteProducts()\n\t{\n\n\t\t$this->getDB()->query('SELECT * FROM product_orders WHERE quote_id = '.$this->getId());\n\t\t$res = $this->getDB()->results('arr');\n\t\tforeach($res as $quotedProd)\n\t\t{\n\t\t\t$product = new Product($quotedProd['product_id']);\n\t\t\t$product->setProductCost($quotedProd['product_cost']);\n\t\t\t$product->setProductQuantity($quotedProd['product_qty']);\n\t\t\t$product->setProductType($quotedProd['product_type']);\n\n\t\t\tarray_push($this->products, $product);\n\t\t}\n\t}", "public function price()\n {\n return $this->morphToMany('Sanatorium\\Pricing\\Models\\Money', 'priceable', 'priced');\n }", "public function getAllList_Price()\n {\n try\n {\n // Создаем новый запрс\n $db = $this->getDbo();\n $query = $db->getQuery(true);\n\n $query->select('a.*');\n $query->from('`#__gm_ceiling_components_option` AS a');\n $query->select('CONCAT( component.title , \\' \\', a.title ) AS full_name');\n $query->select('component.id AS component_id');\n $query->select('component.title AS component_title');\n $query->select('component.unit AS component_unit');\n $query->join('RIGHT', '`#__gm_ceiling_components` AS component ON a.component_id = component.id');\n\n $db->setQuery($query);\n $return = $db->loadObjectList();\n return $return;\n }\n catch(Exception $e)\n {\n Gm_ceilingHelpersGm_ceiling::add_error_in_log($e->getMessage(), __FILE__, __FUNCTION__, func_get_args());\n }\n }", "public function saveImageForProduct($images)\n {\n $productModel = Mage::getModel('catalog/product');\n $eanField = Mage::getStoreConfig('stockbase_options/login/stockbase_ean_field');\n $accessToken = Mage::getStoreConfig('stockbase_options/token/access');\n $tempFolder = Mage::getBaseDir('media') . DS . 'tmp';\n $io = new Varien_Io_File();\n $addedProducts = array();\n\n foreach ($images as $image) {\n $product = $productModel->loadByAttribute($eanField, $image->EAN);\n $io->checkAndCreateFolder($tempFolder);\n $filePath = $tempFolder . Mage::getSingleton('core/url')->parseUrl($image->{'Url'})->getPath();\n\n // Continue looping, if we dont have product, we have nothing.\n if (!$product) {\n continue;\n }\n\n $client = new Varien_Http_Client($image->{'Url'});\n $client->setMethod(Varien_Http_Client::GET);\n $client->setHeaders('Authentication', $accessToken);\n $protectedImage = $client->request()->getBody();\n\n if ($io->isWriteable($tempFolder)) {\n $io->write($filePath, $protectedImage);\n }\n\n // Verify written file exsist\n if ($io->fileExists($filePath)) {\n if ($product->getMediaGallery() == null) {\n $product->setMediaGallery(array('images' => array(), 'values' => array()));\n }\n $product->addImageToMediaGallery(\n $filePath,\n array('image', 'small_image', 'thumbnail'),\n false,\n false\n );\n $product->{'save'}();\n }\n }\n\n return true;\n }", "public function getPrices()\n {\n }", "public function updateOrGenerateOrderItems($newOrderId, $orderItems){\n\t\t$allItems = $this->itemRepo->getAllItems();\n\n\t\t//a flag indicates whether new products are created or not\n\t\t//after processing all ordered items\n\t\t$newProductsCreated = false;\n\n\t\t//take the first item from the order\n\t\twhile($orderItem = array_shift($orderItems)){\n\n\t\t\t//retrieve the collection that match the item\n\t\t\t$matchedItems = $allItems->filter(function($item, $key) use ($orderItem, $newOrderId){\n\t\t\t\treturn $item->status == ItemStatus::Available && $item->product->sku == $orderItem['sku'];\n\t\t\t});\n\n\t\t\t//in case there are just enough matched items in the database,\n\t\t\t//all these items will be updated to the order\n\t\t\tif($matchedItems->count() == $orderItem['quantity']){\n\t\t\t\t$this->updateAllMatchedItems($matchedItems, $newOrderId);\n\n\t\t\t}\n\t\t\t//in case there are more than enough matched items in the database,\n\t\t\t//only the required number of items will be updated to the order\n\t\t\t//the rest will remained available\n\t\t\telseif($matchedItems->count()>$orderItem['quantity']){\n\t\t\t\t//redundant items will be cut\n\t\t\t\t$matchedItems = $matchedItems->slice(0, $orderItem['quantity']);\n\t\t\t\t$this->updateAllMatchedItems($matchedItems, $newOrderId);\n\n\t\t\t}\n\t\t\t//in case there are less than enough matched available items in the database,\n\t\t\t//all these items will be updated to the order\n\t\t\t//extra records will be generated to match the order.\n\t\t\telseif($matchedItems->count()<$orderItem['quantity'] && $matchedItems->count()>0){\n\t\t\t\t//firstly, all the matched items will be updated\n\t\t\t\t$this->updateAllMatchedItems($matchedItems, $newOrderId);\n\t\t\t\t//number of missing items\n\t\t\t\t$missingCount = $orderItem['quantity'] - $matchedItems->count();\n\t\t\t\t//retrieve the product_id\n\t\t\t\t$productId = $matchedItems->first()->product_id;\n\n\t\t\t\t$this->generateNewOrderItems($productId, $newOrderId, $missingCount);\n\t\t\t}\n\t\t\t//in case there's no available item at all\n\t\t\telseif($matchedItems->count() == 0){\n\t\t\t\t//retrieve the product by sku\n\t\t\t\t$product = $this->productRepo->findProductBySku($orderItem{'sku'});\n\t\t\t\t//In case the product with the sku exists, new items will be generated for the order\n\t\t\t\tif(!is_null($product)){\n\t\t\t\t\t$this->generateNewOrderItems($product->id, $newOrderId, $orderItem['quantity']);\n\t\t\t\t}\n\t\t\t\t//In case the product with the sku does not exists\n\t\t\t\telse{\n\t\t\t\t\t//firstly, a product with the sku will be created\n\t\t\t\t\t$product = $this->productRepo->addProduct([\n\t\t\t\t\t\t'sku' => $orderItem['sku'],\n\t\t\t\t\t\t'colour' => 'green' \n\t\t\t\t\t]);\n\t\t\t\t\t//Then new items of this product will be generated for the order\n\t\t\t\t\t$this->generateNewOrderItems($product->id, $newOrderId, $orderItem['quantity']);\t\n\n\t\t\t\t\t$newProductsCreated = true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\treturn $newProductsCreated;\n\t}", "public function prepareData($collection, $productIds)\n {\n $productCollection = clone $collection;\n $productCollection->addAttributeToFilter('entity_id', ['in' => $productIds]);\n while ($product = $productCollection->fetchItem()) {\n $variations = [];\n $collectionAttr = $this->getWeeAttributeCollection();\n if ($collectionAttr->getSize() > 0) {\n foreach ($collectionAttr as $item) {\n $item->setScopeGlobal(1);\n $tax = $this->getDataTax($product, $item);\n if (!empty($tax)) {\n foreach ($tax as $element) {\n $str = 'name=' . $item->getAttributeCode()\n . Import::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR .\n 'country=' . $element['country']\n . Import::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR .\n 'state=' . $element['state']\n . Import::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR .\n 'value=' . $element['value'];\n if (isset($element['website_id'])) {\n $str .= Import::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR .\n 'website_id=' . $element['website_id'];\n }\n $variations[] = $str;\n }\n }\n }\n }\n $result = '';\n if (!empty($variations)) {\n $result = [\n self::WEE_TAX_VARIATIONS_COLUMN => implode(\n ImportProduct::PSEUDO_MULTI_LINE_SEPARATOR,\n $variations\n )\n ];\n }\n $this->weeTaxData[$product->getId()] = $result;\n }\n }", "public function item_setprice($item)\n {\n if ($item['product_type'] != 2 || $item['product_payment'] != 'prepay') return;\n\n $db = db(config('db'));\n\n if ($_POST)\n {\n $db -> beginTrans();\n\n switch ($item['objtype'])\n {\n case 'room':\n $data = $this -> _format_room_price($item);\n\n // close old price\n $where = \"`supply`='EBK' AND `supplyid`=:sup AND `payment`=3 AND `hotel`=:hotel AND `room`=:room AND `date`>=:start AND `date`<=:end\";\n $condition = array(':sup'=>$item['pid'], ':hotel'=>$item['objpid'], ':room'=>$item['id'], ':start'=>$_POST['start'], ':end'=>$_POST['end']);\n $rs = $db -> prepare(\"UPDATE `ptc_hotel_price_date` SET `close`=1, `price`=0 WHERE {$where}\") -> execute($condition);\n if ($rs === false)\n json_return(null, 6, '保存失败,请重试');\n\n if ($data)\n {\n $data = array_values($data);\n list($column, $sql, $value) = array_values(insert_array($data));\n\n $_columns = update_column(array_keys($data[0]));\n $rs = $db -> prepare(\"INSERT INTO `ptc_hotel_price_date` {$column} VALUES {$sql} ON DUPLICATE KEY UPDATE {$_columns};\") -> execute($value); //var_dump($rs); exit;\n if (false == $rs)\n {\n $db -> rollback();\n json_return(null, 7, '数据保存失败,请重试~');\n }\n }\n break;\n\n case 'auto':\n $data = $this -> _format_auto_price($item);\n\n // close old price\n $where = \"`auto`=:auto AND `date`>=:start AND `date`<=:end\";\n $condition = array(':auto'=>$item['objpid'], ':start'=>$_POST['start'], ':end'=>$_POST['end']);\n $rs = $db -> prepare(\"UPDATE `ptc_auto_price_date` SET `close`=1, `price`=0 WHERE {$where}\") -> execute($condition);\n if ($rs === false)\n json_return(null, 6, '保存失败,请重试');\n\n if ($data)\n {\n $data = array_values($data);\n list($column, $sql, $value) = array_values(insert_array($data));\n\n $_columns = update_column(array_keys($data[0]));\n $rs = $db -> prepare(\"INSERT INTO `ptc_auto_price_date` {$column} VALUES {$sql} ON DUPLICATE KEY UPDATE {$_columns};\") -> execute($value); //var_dump($rs); exit;\n if (false == $rs)\n {\n $db -> rollback();\n json_return(null, 7, '数据保存失败,请重试~');\n }\n }\n break;\n }\n\n if (false === $db -> commit())\n json_return(null, 9, '数据保存失败,请重试~');\n else\n json_return($rs);\n }\n\n $month = !empty($_GET['month']) ? $_GET['month'] : date('Y-m');\n\n $first = strtotime($month.'-1');\n $first_day = date('N', $first);\n\n $start = $first_day == 7 ? $first : $first - $first_day * 86400;\n $end = $start + 41 * 86400;\n\n switch ($item['objtype'])\n {\n case 'room':\n $_date = $db -> prepare(\"SELECT `key`,`date`,`price`,`breakfast`,`allot`,`sold`,`filled`,`standby`,`close` FROM `ptc_hotel_price_date` WHERE `supply`='EBK' AND `supplyid`=:sup AND `hotel`=:hotel AND `room`=:room AND `date`>=:start AND `date`<=:end AND `close`=0\")\n -> execute(array(':sup'=>$item['pid'], ':hotel'=>$item['objpid'], ':room'=>$item['id'], ':start'=>$start, ':end'=>$end));\n break;\n\n case 'auto':\n $_date = $db -> prepare(\"SELECT `key`,`date`,`price`,`child`,`baby`,`allot`,`sold`,`filled`,`close` FROM `ptc_auto_price_date` WHERE `auto`=:auto AND `date`>=:start AND `date`<=:end AND `close`=0\")\n -> execute(array(':auto'=>$item['objpid'], ':start'=>$start, ':end'=>$end));\n break;\n }\n\n $date = array();\n foreach ($_date as $v)\n {\n $date[$v['date']] = $v;\n }\n unset($_date);\n\n include dirname(__FILE__).'/product/price_'.$item['objtype'].'.tpl.php';\n }" ]
[ "0.7733322", "0.7470892", "0.6998848", "0.6969628", "0.6792842", "0.5643025", "0.56027704", "0.555223", "0.51989794", "0.5142331", "0.51414996", "0.51377356", "0.5066915", "0.5054238", "0.50529104", "0.5000146", "0.49731126", "0.49621835", "0.49568424", "0.49455938", "0.49293783", "0.4927947", "0.491836", "0.48786607", "0.4864831", "0.48631546", "0.48529536", "0.483512", "0.48220915", "0.48203528", "0.48065755", "0.48000726", "0.47993517", "0.47862044", "0.4783712", "0.47623473", "0.47379965", "0.4731763", "0.4718848", "0.4692122", "0.4684376", "0.46806502", "0.46787488", "0.46757174", "0.46756223", "0.46634102", "0.46552798", "0.46392426", "0.46346432", "0.46319875", "0.46317106", "0.46302763", "0.46277717", "0.46153942", "0.4613484", "0.46081975", "0.46004242", "0.4591354", "0.45836872", "0.45834205", "0.45770895", "0.45697042", "0.456713", "0.45661747", "0.4564171", "0.45562813", "0.45561627", "0.45524204", "0.45522833", "0.4546307", "0.45461518", "0.45406613", "0.45314962", "0.4529689", "0.4528188", "0.45252588", "0.45031378", "0.44933197", "0.449275", "0.44924584", "0.44907093", "0.44846055", "0.44823113", "0.44741765", "0.4470257", "0.44679248", "0.44661498", "0.44603452", "0.44586968", "0.44561568", "0.44458628", "0.44385827", "0.44385034", "0.44372725", "0.4433565", "0.44331017", "0.44318184", "0.4431253", "0.44232184", "0.44228753" ]
0.78147155
0
Specification: Publish merchant relationship prices for product concretes. Uses the given concrete product IDs. Refreshes the prices data for product concretes for all business units and merchant relationships.
public function publishConcretePriceProductByProductIds(array $productIds): void;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function publishAbstractPriceProductByByProductAbstractIds(array $productAbstractIds): void;", "public function publishConcretePriceProductPriceList(array $priceProductPriceListIds): void;", "public function publishAbstractPriceProductPriceList(array $priceProductPriceListIds): void;", "public function work($product_ids = array()) {\n $this->updateVersionsInOpenCart($product_ids);\n\n // Delete redundant references between category's and Square CATEGORYs. This step is to detect and delete any links to CATEGORYs deleted from the Square dashboard\n $this->deleteCategoryCategory();\n\n // Detect any version differences and prepare upsertion batches\n $this->insertUpdate();\n\n // Delete redundant references between category's and Square CATEGORYs\n $this->deleteCategoryCategory();\n\n // Delete redundant Square CATEGORYs\n $this->deleteCategory();\n }", "protected function _getCatalogProductPriceData($productIds = null)\n {\n $connection = $this->getConnection();\n $catalogProductIndexPriceSelect = [];\n\n foreach ($this->dimensionCollectionFactory->create() as $dimensions) {\n if (!isset($dimensions[WebsiteDimensionProvider::DIMENSION_NAME]) ||\n $this->websiteId === null ||\n $dimensions[WebsiteDimensionProvider::DIMENSION_NAME]->getValue() === $this->websiteId) {\n $select = $connection->select()->from(\n $this->tableResolver->resolve('catalog_product_index_price', $dimensions),\n ['entity_id', 'customer_group_id', 'website_id', 'min_price']\n );\n if ($productIds) {\n $select->where('entity_id IN (?)', $productIds);\n }\n $catalogProductIndexPriceSelect[] = $select;\n }\n }\n\n $catalogProductIndexPriceUnionSelect = $connection->select()->union($catalogProductIndexPriceSelect);\n\n $result = [];\n foreach ($connection->fetchAll($catalogProductIndexPriceUnionSelect) as $row) {\n $result[$row['website_id']][$row['entity_id']][$row['customer_group_id']] = round($row['min_price'], 2);\n }\n\n return $result;\n }", "public function get_prices()\n\t{\n\t\t$product_price_old = 0;\n\t\t$product_price_sale = 0;\n\t\t$price = 0;\n\t\t$eco = 0;\n\t\t$taxes = 0;\n\t\t$dataoc = isset($this->request->post['dataoc']) ? $this->request->post['dataoc'] : '';\n\n\t\tif (!empty($dataoc)) {\n\t\t\t$dataoc = str_replace('&quot;', '\"', $dataoc);\n\t\t\t$json = @json_decode($dataoc, true);\n\t\t\t$product_quantity = isset($json['quantity']) ? $json['quantity'] : 0;\n\t\t\t$product_id_oc = isset($json['product_id_oc']) ? $json['product_id_oc'] : 0;\n\t\t\tif ($product_id_oc == 0) $product_id_oc = isset($json['_product_id_oc']) ? $json['_product_id_oc'] : 0;\n\n\t\t\t// get options\n\t\t\t$options = isset($json['option_oc']) ? $json['option_oc'] : array();\n\t\t\tforeach ($options as $key => $value) {\n\t\t\t\tif ($value == null || empty($value)) unset($options[$key]);\n\t\t\t}\n\n\t\t\t// get all options of product\n\t\t\t$options_temp = $this->get_options_oc($product_id_oc);\n\n\t\t\t// Calc price for ajax\n\t\t\tforeach ($options_temp as $value) {\n\t\t\t\tforeach ($options as $k => $option_val) {\n\t\t\t\t\tif ($k == $value['product_option_id']) {\n\t\t\t\t\t\tif ($value['type'] == 'checkbox' && is_array($option_val) && count($option_val) > 0) {\n\t\t\t\t\t\t\tforeach ($option_val as $val) {\n\t\t\t\t\t\t\t\tforeach ($value['product_option_value'] as $op) {\n\t\t\t\t\t\t\t\t\t// calc price\n\t\t\t\t\t\t\t\t\tif ($val == $op['product_option_value_id']) {\n\t\t\t\t\t\t\t\t\t\tif ($op['price_prefix'] == $this->minus) $price -= isset($op['price_no_tax']) ? $op['price_no_tax'] : 0;\n\t\t\t\t\t\t\t\t\t\telse $price += isset($op['price_no_tax']) ? $op['price_no_tax'] : 0;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} elseif ($value['type'] == 'radio' || $value['type'] == 'select') {\n\t\t\t\t\t\t\tforeach ($value['product_option_value'] as $op) {\n\t\t\t\t\t\t\t\tif ($option_val == $op['product_option_value_id']) {\n\t\t\t\t\t\t\t\t\tif ($op['price_prefix'] == $this->minus) $price -= isset($op['price_no_tax']) ? $op['price_no_tax'] : 0;\n\t\t\t\t\t\t\t\t\telse $price += isset($op['price_no_tax']) ? $op['price_no_tax'] : 0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// the others have not price, so don't need calc\n\t\t\t\t\t}\n\t\t\t\t\t// if not same -> return.\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$product_prices = $this->get_product_price($product_id_oc, $product_quantity);\n\t\t\t$product_price_old = isset($product_prices['price_old']) ? $product_prices['price_old'] : 0;\n\t\t\t$product_price_sale = isset($product_prices['price_sale']) ? $product_prices['price_sale'] : 0;\n\t\t\t$enable_taxes = $this->config->get('tshirtecommerce_allow_taxes');\n\t\t\tif ($enable_taxes === null || $enable_taxes == 1) {\n\t\t\t\t$taxes = isset($product_prices['taxes']) ? $product_prices['taxes'] : 0;\n\t\t\t\t$eco = isset($product_prices['eco']) ? $product_prices['eco'] : 0;\n\t\t\t} else {\n\t\t\t\t$taxes = 0;\n\t\t\t\t$eco = 0;\n\t\t\t}\n\t\t\t\n\t\t} // do nothing when empty/blank\n\n\t\t// return price for ajax\n\t\techo @json_encode(array(\n\t\t\t'price' => $price, \n\t\t\t'price_old' => $product_price_old, \n\t\t\t'price_sale' => $product_price_sale, \n\t\t\t'taxes' => $taxes,\n\t\t\t'eco' => $eco\n\t\t));\n\t\treturn;\n\t}", "public function scalePrices($product)\n {\n \n // Get the configurable Id\n $configurableId = $this->getConfigurableId($product);\n \n // Check we actually have a configurable product\n if ($configurableId > 0)\n {\n // Get the configurable product and associated base price\n // Please note the price will not be the actual configurable, price but the cheapest price from all the simple products\n $configurableProduct = Mage::getSingleton(\"catalog/Product\")->load($configurableId);\n $configurablePrice = $configurableProduct->getPrice();\n \n // Get current attribute data\n $configurableAttributesData = $configurableProduct->getTypeInstance()->getConfigurableAttributesAsArray();\n $configurableProductsData = array();\n \n // We need to identify the attribute name and Id\n $prodAttrName = $this->getAttributeName($configurableProduct);\n $prodAttrId = $this->getAttributeId($prodAttrName);\n \n // Get associates simple products\n $associatedProducts = $configurableProduct->getTypeInstance()->getUsedProducts();\n foreach ($associatedProducts as $prodList)\n {\n // For each associated simple product gather the data and calculate the extra fixed price\n $prodId = $prodList->getId();\n $prodAttrLabel = $prodList->getAttributeText($prodAttrName);\n $prodAttrValueIndex = $prodList[$prodAttrName];\n $prodScalePrice = $prodList['price'] - $configurablePrice;\n \n $productData = array(\n 'label' => $prodAttrLabel,\n 'attribute_id' => $prodAttrId,\n 'value_index' => $prodAttrValueIndex,\n 'pricing_value' => $prodScalePrice,\n 'is_percent' => '0'\n );\n $configurableProductsData[$prodId] = $productData;\n $configurableAttributesData[0]['values'][] = $productData;\n }\n \n $configurableProduct->setConfigurableProductsData($configurableProductsData);\n $configurableProduct->setConfigurableAttributesData($configurableAttributesData);\n $configurableProduct->setCanSaveConfigurableAttributes(true);\n Mage::log($configurableProductsData, null, 'configurableProductsData.log', true);\n Mage::log($configurableAttributesData, null, 'configurableAttributesData.log', true);\n \n try\n {\n $configurableProduct->save(); \n }\n catch (Exception $e)\n {\n $this->_debug($e->getMessage());\n }\n \n } \n }", "public function updateProduct()\n {\n \t$quote=$this->getQuote();\n \tif($quote)\n \t{\n \t\t$detailproduct=$this->getProduct();\n \t\t$quoteproduct=$quote->getProduct();\n \t\tif(\n\t\t\t\t$quote->getPrice()!=$this->getPrice() or\n\t\t\t\t$quote->getDiscrate()!=$this->getDiscrate() or\n\t\t\t\t$quote->getDiscamt()!=$this->getDiscamt() or\n\t\t\t\t$quote->getProductId()!=$this->getProductId()\n\t\t\t)\n\t\t\t{\n\t\t\t\t$quote->setPrice($this->getPrice());\n\t\t\t\t$quote->setDiscrate($this->getDiscrate());\n\t\t\t\t$quote->setDiscamt($this->getDiscamt());\n\t\t\t\t$quote->setProductId($this->getProductId());\n\t\t\t\t$quote->calc(); //auto save\n\t\t\t\t$detailproduct->calcSalePrices();\n\t\t\t\t\n\t\t\t\t//if product changed, calc old product\n\t\t\t\tif($quoteproduct->getId()!=$detailproduct->getId())\n\t\t\t\t\t$quoteproduct->calcSalePrices();\n\t\t\t}\n \t}\n \telse\n \t{\n\t\t\t//if none, see if product quote by vendor with similar pricing exists. \n\t\t\t$quote=Fetcher::fetchOne(\"Quote\",array('total'=>$this->getUnittotal(),'vendor_id'=>SettingsTable::fetch(\"me_vendor_id\"),'product_id'=>$this->getProductId()));\n\n\t\t\t//if it doesn't exist, create it, and product->calc()\n\t\t\tif(!$quote)\n\t\t\t{\n\t\t\t\tQuoteTable::createOne(array(\n\t\t\t\t\t'date'=>$this->getInvoice()->getDate(),\n\t\t\t\t\t'price'=>$this->getPrice(),\n\t\t\t\t\t'discrate'=>$this->getDiscrate(),\n\t\t\t\t\t'discamt'=>$this->getDiscamt(),\n\t\t\t\t\t'vendor_id'=>SettingsTable::fetch(\"me_vendor_id\"),\n\t\t\t\t\t'product_id'=>$this->getProductId(),\n\t\t\t\t\t'ref_class'=>\"Invoicedetail\",\n\t\t\t\t\t'ref_id'=>$this->getId(),\n\t\t\t\t\t'mine'=>1,\n\t\t\t\t\t));\n\t\t\t\t$this->getProduct()->calcSalePrices();\n\t\t\t}\n \t}\n }", "public function processPurchaseOrder($productIds)\r\n {\r\n // process every products for PO creation\r\n foreach ($productIds as $productId) {\r\n // get the additional stock received from PO\r\n $this->Inventory->addStock($productId, 20);\r\n\r\n // update PO data after receiving\r\n $this->ProductsPurchased->updatePurchaseOrderAfterReceiving($productId);\r\n }\r\n }", "public function calculatePrices(): void\n {\n $orders = ServiceContainer::orders();\n $pizzaPrice = $orders->calculatePizzaPrice($this->items);\n $deliveryPrice = $orders->calculateDeliveryPrice($pizzaPrice, $this->outside, $this->currency);\n $this->delivery_price = $deliveryPrice;\n $this->total_price = $pizzaPrice + $deliveryPrice;\n }", "function _prepareGroupedProductPriceData($entityIds = null) {\n\t\t\t$write = $this->_getWriteAdapter( );\n\t\t\t$table = $this->getIdxTable( );\n\t\t\t$select = $write->select( )->from( array( 'e' => $this->getTable( 'catalog/product' ) ), 'entity_id' )->joinLeft( array( 'l' => $this->getTable( 'catalog/product_link' ) ), 'e.entity_id = l.product_id AND l.link_type_id=' . LINK_TYPE_GROUPED, array( ) )->join( array( 'cg' => $this->getTable( 'customer/customer_group' ) ), '', array( 'customer_group_id' ) );\n\t\t\t$this->_addWebsiteJoinToSelect( $select, true );\n\t\t\t$this->_addProductWebsiteJoinToSelect( $select, 'cw.website_id', 'e.entity_id' );\n\n\t\t\tif ($this->getVersionHelper( )->isGe1600( )) {\n\t\t\t\t$minCheckSql = $write->getCheckSql( 'le.required_options = 0', 'i.min_price', 0 );\n\t\t\t\t$maxCheckSql = $write->getCheckSql( 'le.required_options = 0', 'i.max_price', 0 );\n\t\t\t\t$taxClassId = $this->_getReadAdapter( )->getCheckSql( 'MIN(i.tax_class_id) IS NULL', '0', 'MIN(i.tax_class_id)' );\n\t\t\t\t$minPrice = new Zend_Db_Expr( 'MIN(' . $minCheckSql . ')' );\n\t\t\t\t$maxPrice = new Zend_Db_Expr( 'MAX(' . $maxCheckSql . ')' );\n\t\t\t} \nelse {\n\t\t\t\t$taxClassId = new Zend_Db_Expr( 'IFNULL(i.tax_class_id, 0)' );\n\t\t\t\t$minPrice = new Zend_Db_Expr( 'MIN(IF(le.required_options = 0, i.min_price, 0))' );\n\t\t\t\t$maxPrice = new Zend_Db_Expr( 'MAX(IF(le.required_options = 0, i.max_price, 0))' );\n\t\t\t}\n\n\t\t\t$stockId = 'IF (i.stock_id IS NOT NULL, i.stock_id, 1)';\n\t\t\t$select->columns( 'website_id', 'cw' )->joinLeft( array( 'le' => $this->getTable( 'catalog/product' ) ), 'le.entity_id = l.linked_product_id', array( ) );\n\n\t\t\tif ($this->getVersionHelper( )->isGe1700( )) {\n\t\t\t\t$columns = array( 'tax_class_id' => $taxClassId, 'price' => new Zend_Db_Expr( 'NULL' ), 'final_price' => new Zend_Db_Expr( 'NULL' ), 'min_price' => $minPrice, 'max_price' => $maxPrice, 'tier_price' => new Zend_Db_Expr( 'NULL' ), 'group_price' => new Zend_Db_Expr( 'NULL' ), 'stock_id' => $stockId, 'currency' => 'i.currency', 'store_id' => 'i.store_id' );\n\t\t\t} \nelse {\n\t\t\t\t$columns = array( 'tax_class_id' => $taxClassId, 'price' => new Zend_Db_Expr( 'NULL' ), 'final_price' => new Zend_Db_Expr( 'NULL' ), 'min_price' => $minPrice, 'max_price' => $maxPrice, 'tier_price' => new Zend_Db_Expr( 'NULL' ), 'stock_id' => $stockId, 'currency' => 'i.currency', 'store_id' => 'i.store_id' );\n\t\t\t}\n\n\t\t\t$select->joinLeft( array( 'i' => $table ), '(i.entity_id = l.linked_product_id) AND (i.website_id = cw.website_id) AND ' . '(i.customer_group_id = cg.customer_group_id)', $columns );\n\t\t\t$select->group( array( 'e.entity_id', 'cg.customer_group_id', 'cw.website_id', $stockId, 'i.currency', 'i.store_id' ) )->where( 'e.type_id=?', $this->getTypeId( ) );\n\n\t\t\tif (!is_null( $entityIds )) {\n\t\t\t\t$select->where( 'l.product_id IN(?)', $entityIds );\n\t\t\t}\n\n\t\t\t$eventData = array( 'select' => $select, 'entity_field' => new Zend_Db_Expr( 'e.entity_id' ), 'website_field' => new Zend_Db_Expr( 'cw.website_id' ), 'stock_field' => new Zend_Db_Expr( $stockId ), 'currency_field' => new Zend_Db_Expr( 'i.currency' ), 'store_field' => new Zend_Db_Expr( 'cs.store_id' ) );\n\n\t\t\tif (!$this->getWarehouseHelper( )->getConfig( )->isMultipleMode( )) {\n\t\t\t\t$eventData['stock_field'] = new Zend_Db_Expr( 'i.stock_id' );\n\t\t\t}\n\n\t\t\tMage::dispatchEvent( 'catalog_product_prepare_index_select', $eventData );\n\t\t\t$query = $select->insertFromSelect( $table );\n\t\t\t$write->query( $query );\n\t\t\treturn $this;\n\t\t}", "public static function getPrice(&$products_table = NULL, $uid = NULL) {\n Yii::import('application.controllers.ProfileController');\n\n if (!$products_table) { //if it's cart products table\n $table = 'store_cart';\n } else {\n $table = 'temp_order_product_' . (Yii::app()->user->id ? Yii::app()->user->id : 'exchange');\n $query = \"DROP TABLE IF EXISTS {$table};\";\n $query .= \"CREATE TEMPORARY TABLE {$table} (product_id int(11) unsigned, quantity smallint(5) unsigned);\";\n foreach ($products_table as $item) {\n\n if ($item instanceof OrderProduct || $item instanceof stdClass || $item instanceof Cart) {\n $product = Product::model()->findByAttributes(array('id' => (string) $item->product_id));\n } else {\n $product = Product::model()->findByAttributes(array('code' => (string) $item->code));\n }\n\n if ($product) {\n $query .= \"INSERT INTO {$table} VALUES ({$product->id}, {$item->quantity});\";\n } else {\n throw new Exception('Product not found. Product code: ' . $item->code);\n }\n }\n Yii::app()->db->createCommand($query)->execute();\n }\n $query = Yii::app()->db->createCommand()\n ->select('SUM(c.quantity*round(prices.price*(1-greatest(ifnull(disc.percent,0),ifnull(disc1.percent,0),ifnull(disc2.percent,0))/100))) as c_summ, prices.price_id')\n ->from($table . ' c')\n ->join('store_product product', 'c.product_id=product.id')\n ->join('store_product_price prices', 'product.id=prices.product_id')\n ->join('store_price price', 'price.id=prices.price_id')\n ->leftJoin('store_discount disc', \"disc.product_id=0 and disc.actual=1 and (disc.begin_date='0000-00-00' or disc.begin_date<=CURDATE()) and (disc.end_date='0000-00-00' or disc.end_date>=CURDATE())\")\n ->leftJoin('store_product_category cat', 'cat.product_id=product.id')\n ->leftJoin('store_discount_category discat', 'discat.category_id=cat.category_id')\n ->leftJoin('store_discount disc1', \"disc1.product_id=1 and disc1.id=discat.discount_id and disc1.actual=1 and (disc1.begin_date='0000-00-00' or disc1.begin_date<=CURDATE()) and (disc1.end_date='0000-00-00' or disc1.end_date>=CURDATE())\")\n ->leftJoin('store_discount_product dispro', 'dispro.product_id=product.id')\n ->leftJoin('store_discount disc2', \"disc2.product_id=2 and disc2.id=dispro.discount_id and disc2.actual=1 and (disc2.begin_date='0000-00-00' or disc2.begin_date<=CURDATE()) and (disc2.end_date='0000-00-00' or disc2.end_date>=CURDATE())\")\n ->order('price.summ DESC')\n ->group('prices.price_id, price.summ')\n ->having('c_summ>price.summ');\n\n if (!$products_table){\n $sid = ProfileController::getSession();\n $query->where(\"(session_id=:sid AND :sid<>'') OR (user_id=:uid AND :sid<>'')\", array(\n ':sid' => $sid,\n ':uid' => Yii::app()->user->isGuest ? '' : Yii::app()->user->id,\n ));\n }\n\n// $text = $query->getText();\n $row = $query->queryRow();\n if ($row)\n $price = self::model()->findByPk($row['price_id']);\n else\n $price = self::model()->find(array('order' => 'summ'));\n\n if ($products_table)\n Yii::app()->db->createCommand(\"DROP TABLE IF EXISTS {$table};\")->execute();\n\n if ($uid)\n $profile = CustomerProfile::model()->with('price')->findByAttributes(array('user_id' => $uid));\n else\n $profile = ProfileController::getProfile();\n\n if ($profile && $profile->price_id && $profile->price->summ > $price->summ)\n return $profile->price;\n else\n return $price;\n }", "public function calc_price_with_ro($product_price, $ro_combs, $special=0, $stock=false, $ro_price_modificator=0, $quantity=false) {\n \t\t\n\t\t$ro_settings = $this->config->get('related_options');\n\t\t$lp_settings = $this->getLivePriceSettings();\n\t\t\n\t\t$ro_price = $product_price;\n\t\t$ro_discount_addition_total = 0;\n\t\t$ro_special_addition_total = 0;\n\t\t/*\n\t\tif ( !empty($ro_settings['spec_price']) ) {\n\t\t\t$ro_price = $product_price;\n\t\t} else {\n\t\t\t$ro_price = false;\n\t\t}\n\t\t*/\n\t\t$in_stock = null;\n\t\t\n\t\tif ($this->installed()) {\n\t\t\t\n\t\t\tforeach ($ro_combs as $ro_comb) {\n\t\t\t\t\n\t\t\t\tif ( !empty($ro_settings['spec_price']) ) {\n\t\t\t\t\t\n\t\t\t\t\t//if (isset($ro_comb['price']) && $ro_comb['price']!=0) {\n\t\t\t\t\t\t// \"+\" may has effect even without price (by discounts)\n\t\t\t\t\t\tif (isset($ro_settings['spec_price_prefix']) && $ro_settings['spec_price_prefix'] && ($ro_comb['price_prefix'] == '+' || $ro_comb['price_prefix'] == '-') ) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$ro_price_addition = $ro_comb['price'];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ( $ro_comb['price_prefix'] == '-' ) {\n\t\t\t\t\t\t\t\t$ro_price_addition = -$ro_price_addition;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (!empty($ro_price_addition)) {\n\t\t\t\t\t\t\t\t//$ro_price+= $ro_price_addition;\n\t\t\t\t\t\t\t\t$ro_price_modificator+= $ro_price_addition;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ( !empty($lp_settings['ropro_discounts_addition']) ) {\n\t\t\t\t\t\t\t\tif ( $ro_comb['price_prefix'] == '+' ) {\n\t\t\t\t\t\t\t\t\t$ro_discount_addition_total+= $this->calc_price_with_ro_get_discount($ro_comb, $quantity);\n\t\t\t\t\t\t\t\t} else { // -\n\t\t\t\t\t\t\t\t\t$ro_discount_addition_total-= $this->calc_price_with_ro_get_discount($ro_comb, $quantity);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ( !empty($lp_settings['ropro_specials_addition']) && $ro_comb['specials'] && $ro_comb['specials'][0] ) {\n\t\t\t\t\t\t\t\t$ro_special_row = $ro_comb['specials'][0];\n\t\t\t\t\t\t\t\tif ( $ro_comb['price_prefix'] == '+' ) {\n\t\t\t\t\t\t\t\t\t$ro_special_addition_total+= $ro_special_row['price'];\n\t\t\t\t\t\t\t\t} else { // -\n\t\t\t\t\t\t\t\t\t$ro_special_addition_total-= $ro_special_row['price'];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t} elseif ( !empty($ro_comb['price']) && (float)$ro_comb['price'] ) {\n\t\t\t\t\t\t\t$ro_price = $ro_comb['price'];\n\t\t\t\t\t\t}\n\t\t\t\t\t//}\n\t\t\t\t\t\n\t\t\t\t\tif (isset($ro_comb['current_customer_group_special_price']) && $ro_comb['current_customer_group_special_price']) {\n\t\t\t\t\t\t$special = $ro_comb['current_customer_group_special_price'];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( !empty($ro_settings['spec_ofs']) ) {\n\t\t\t\t\t$stock = $ro_comb['stock'];\n\t\t\t\t} elseif ( $this->config->get('config_stock_display') ) {\n\t\t\t\t\t$stock = (int)$ro_comb['quantity'];\n\t\t\t\t} else {\n\t\t\t\t\t$stock = false;\n\t\t\t\t}\n\t\t\t\t$in_stock = $ro_comb['in_stock'];\n\t\t\t}\n\t\t\t$ro_price+= $ro_price_modificator; // apply + and - modifiers at the last step (after = )\n\t\t}\n\t\treturn array('price'=>$ro_price,\n\t\t\t\t\t\t\t\t 'special'=>$special,\n\t\t\t\t\t\t\t\t 'stock'=>$stock,\n\t\t\t\t\t\t\t\t 'in_stock'=>$in_stock,\n\t\t\t\t\t\t\t\t 'price_modificator'=>$ro_price_modificator,\n\t\t\t\t\t\t\t\t 'discount_addition'=>$ro_discount_addition_total,\n\t\t\t\t\t\t\t\t 'special_addition'=>$ro_special_addition_total,\n\t\t\t\t\t\t\t\t );\n\t\t\n\t}", "public function publishConcretePriceProductPriceListByIdPriceList(int $idPriceList): void;", "public function addProductSyncData(&$products)\n {\n $product_ids = [];\n $parent_ids = [];\n $product_stock_ids = []; //modification in config product stock management\n foreach ($products as $product) {\n $product_ids[] = $product['product_id'];\n $product_stock_ids[$product['product_id']] = $product['parent_id'];\n if ((int)$product['parent_id'] !== 0) {\n $product_ids[] = $product['parent_id'];\n $parent_ids[] = $product['parent_id'];\n $product_stock_ids[$product['parent_id']] = $product['parent_id'];\n }\n }\n $product_ids = array_unique($product_ids);\n $parent_ids = array_unique($parent_ids);\n try {\n $store = $this->_storeModelStoreManagerInterface->getStore();\n $website = $store->getWebsite();\n } catch (NoSuchEntityException $exception) {\n $this->_searchHelperData->log(\n LoggerConstants::ZEND_LOG_ERR,\n sprintf('Website Could not be loaded: %s', $exception->getMessage())\n );\n\n return $this;\n }\n\n $this->stockService->clearCache();\n $this->stockService->preloadKlevuStockStatus(array_merge($product_ids, $parent_ids), $website->getId());\n\n $isCollectionMethod = $this->_searchHelperConfig->isCollectionMethodEnabled();\n\n if ($isCollectionMethod) {\n $data = $this->loadProductDataCollection($product_ids);\n }\n\n // Get url product from database\n $url_rewrite_data = $this->getUrlRewriteData($product_ids);\n $attribute_map = $this->getAttributeMap();\n $baseUrl = $this->_productData->getBaseUrl($store);\n $currency = $this->_productData->getCurrency();\n try {\n $store->setCurrentCurrencyCode($currency);\n } catch (LocalizedException $e) {\n $this->_searchHelperData->log(\n LoggerConstants::ZEND_LOG_ERR,\n sprintf('Currency could not be set on store: %s', $e->getMessage())\n );\n\n return $this;\n }\n $rejectedProducts = [];\n $rp = 0;\n\n foreach ($products as $index => &$product) {\n try {\n if ($isCollectionMethod) {\n $item = $data->getItemById($product['product_id']);\n $parent = ((int)$product['parent_id'] !== 0) ? $data->getItemById($product['parent_id']) : null;\n $this->logLoadByMessage($product, true);\n } else {\n $origItem = $this->productRepository->getById(\n $product['product_id'],\n false,\n $store->getId()\n );\n $item = clone $origItem;\n $item->setData('customer_group_id', CustomerGroup::NOT_LOGGED_IN_ID);\n $parent = null;\n if ((int)$product['parent_id'] !== 0) {\n $origParent = $this->productRepository->getById(\n $product['parent_id'],\n false,\n $store->getId()\n );\n $parent = clone $origParent;\n $parent->setData('customer_group_id', CustomerGroup::NOT_LOGGED_IN_ID);\n }\n $this->logLoadByMessage($product);\n }\n\n if (!$item) {\n // Product data query did not return any data for this product\n // Remove it from the list to skip syncing it\n $rejectedProducts[$rp]['product_id'] = $product['product_id'];\n $rejectedProducts[$rp]['parent_id'] = $product['parent_id'];\n $this->_searchHelperData->log(\n LoggerConstants::ZEND_LOG_WARN,\n sprintf(\"Failed to retrieve data for product ID %d\", $product['product_id'])\n );\n unset($products[$index]);\n $rp++;\n continue;\n }\n if ((!isset($parent)) && isset($product['parent_id']) && (int)$product['parent_id'] !== 0) {\n $rejectedProducts[$rp]['product_id'] = $product['product_id'];\n $rejectedProducts[$rp]['parent_id'] = $product['parent_id'];\n $this->_searchHelperData->log(\n LoggerConstants::ZEND_LOG_WARN,\n sprintf(\"Failed to retrieve data for parent ID %d\", $product['parent_id'])\n );\n unset($products[$index]);\n $rp++;\n continue;\n }\n\n $this->processProductBefore($product, $parent, $item);\n // Add data from mapped attributes\n foreach ($attribute_map as $key => $attributes) {\n $product = $this->mapProductAttributes($item, $store, $product, $attributes, $key, $parent);\n }\n\n $product['product_type'] = $this->_productData->getProductType($parent, $item);\n $product['isCustomOptionsAvailable'] = $this->_productData->isCustomOptionsAvailable($parent, $item);\n $product['currency'] = $currency;\n $product['otherPrices'] = $this->_productData->getOtherPrices($item, $currency, $store);\n $product['category'] = $this->_productData->getCategory($parent, $item);\n $product['listCategory'] = $this->_productData->getListCategory($parent, $item);\n $product['categoryIds'] = $this->_productData->getAllCategoryId($parent, $item);\n $product['categoryPaths'] = $this->_productData->getAllCategoryPaths($parent, $item);\n $product['groupPrices'] = $this->_productData->getGroupPricesData($item, $store);\n $product['url'] = $this->_productData->getProductUrlData(\n $parent,\n $item,\n $url_rewrite_data,\n $product,\n $baseUrl\n );\n $product['inStock'] = $this->_stockHelper->getKlevuStockStatus($parent, $item, $website->getId());\n $product['itemGroupId'] = $this->_productData->getItemGroupId($product['parent_id'], $product) ?: '';\n if ((int)$product['itemGroupId'] === 0) {\n $product['itemGroupId'] = ''; // Ref: KS-15006\n }\n $product['id'] = $this->_productData->getId($product['product_id'], $product['parent_id']);\n $this->processProductAfter($product, $parent, $item);\n if ($item) {\n if (!$isCollectionMethod) {\n $item->clearInstance();\n }\n $item = null;\n }\n if ($parent) {\n if (!$isCollectionMethod) {\n $parent->clearInstance();\n }\n $parent = null;\n }\n } catch (\\Exception $e) {\n $this->_searchHelperData->log(\n LoggerConstants::ZEND_LOG_CRIT,\n sprintf(\"Exception thrown in %s::%s - %s\", __CLASS__, __METHOD__, $e->getMessage())\n );\n $markAsSync = [];\n if (!empty($product['parent_id']) && !empty($product['product_id'])) {\n $markAsSync[] = [\n $product['product_id'],\n $product['parent_id'],\n $store->getId(),\n 0,\n $this->_searchHelperCompat->now(),\n \"products\"\n ];\n $write = $this->_frameworkModelResource->getConnection(\"core_write\");\n $query = \"replace into \" . $this->_frameworkModelResource->getTableName('klevu_product_sync')\n . \"(product_id, parent_id, store_id, last_synced_at, type,error_flag) values \"\n . \"(:product_id, :parent_id, :store_id, :last_synced_at, :type,:error_flag)\";\n $binds = [\n 'product_id' => $markAsSync[0][0],\n 'parent_id' => $markAsSync[0][1],\n 'store_id' => $markAsSync[0][2],\n 'last_synced_at' => $markAsSync[0][4],\n 'type' => $markAsSync[0][5],\n 'error_flag' => 1\n ];\n $write->query($query, $binds);\n }\n continue;\n }\n unset($product['product_id'], $product['parent_id']);\n }\n\n if (count($rejectedProducts) > 0) {\n // Can not be injected via construct due to circular dependency\n $magentoProductActions = ObjectManager::getInstance()->get(MagentoProductActionsInterface::class);\n if (!$this->_searchHelperConfig->displayOutofstock()) {\n $rejectedProducts_data = [];\n $r = 0;\n foreach ($rejectedProducts as $rvalue) {\n $idData = $this->checkIdexitsInDb(\n $store->getId(),\n $rvalue[\"product_id\"],\n $rvalue[\"parent_id\"]\n );\n $ids = $idData->getData();\n if (count($ids) > 0) {\n $rejectedProducts_data[$r][\"product_id\"] = $rvalue[\"product_id\"];\n $rejectedProducts_data[$r][\"parent_id\"] = $rvalue[\"parent_id\"];\n $r++;\n }\n }\n $this->_searchHelperData->log(\n LoggerConstants::ZEND_LOG_WARN,\n sprintf(\n \"Because of indexing issue or invalid data we cannot synchronize product IDs %s\",\n implode(\n ',',\n array_map(\n static function ($el) {\n return $el['product_id'];\n },\n $rejectedProducts_data\n )\n )\n )\n );\n $magentoProductActions->deleteProducts($rejectedProducts_data);\n } else {\n $this->_searchHelperData->log(\n LoggerConstants::ZEND_LOG_WARN,\n sprintf(\n \"Because of indexing issue or invalid data we cannot synchronize product IDs %s\",\n implode(\n ',',\n array_map(\n static function ($el) {\n return $el['product_id'];\n },\n $rejectedProducts\n )\n )\n )\n );\n $magentoProductActions->deleteProducts($rejectedProducts);\n }\n }\n\n return $this;\n }", "protected function calculatePrices()\n {\n }", "private function setRecountProduct() {\n\n //$this->model->setDocumentNumber($this->getDocumentNumber);\n $sql = null;\n if ($this->getVendor() == self::MYSQL) {\n $sql = \"\n INSERT INTO `productrecount` \n (\n `companyId`,\n `warehouseId`,\n `productCode`,\n `productDescription`,\n `productRecountDate`,\n `productRecountSystemQuantity`,\n `productRecountPhysicalQuantity`,\n `isDefault`,\n `isNew`,\n `isDraft`,\n `isUpdate`,\n `isDelete`,\n `isActive`,\n `isApproved`,\n `isReview`,\n `isPost`,\n `executeBy`,\n `executeTime`\n ) VALUES ( \n '\" . $this->getCompanyId() . \"',\n '\" . $this->model->getWarehouseId() . \"',\n '\" . $this->model->getProductCode() . \"',\n '\" . $this->model->getProductDescription() . \"',\n '\" . $this->model->getProductRecountDate() . \"',\n '\" . $this->model->getProductRecountSystemQuantity() . \"',\n '\" . $this->model->getProductRecountPhysicalQuantity() . \"',\n '\" . $this->model->getIsDefault(0, 'single') . \"',\n '\" . $this->model->getIsNew(0, 'single') . \"',\n '\" . $this->model->getIsDraft(0, 'single') . \"',\n '\" . $this->model->getIsUpdate(0, 'single') . \"',\n '\" . $this->model->getIsDelete(0, 'single') . \"',\n '\" . $this->model->getIsActive(0, 'single') . \"',\n '\" . $this->model->getIsApproved(0, 'single') . \"',\n '\" . $this->model->getIsReview(0, 'single') . \"',\n '\" . $this->model->getIsPost(0, 'single') . \"',\n '\" . $this->model->getExecuteBy() . \"',\n \" . $this->model->getExecuteTime() . \"\n );\";\n } else {\n if ($this->getVendor() == self::MSSQL) {\n $sql = \"\n INSERT INTO [productRecount]\n (\n [productRecountId],\n [companyId],\n [warehouseId],\n [productCode],\n [productDescription],\n [productRecountDate],\n [productRecountSystemQuantity],\n [productRecountPhysicalQuantity],\n [isDefault],\n [isNew],\n [isDraft],\n [isUpdate],\n [isDelete],\n [isActive],\n [isApproved],\n [isReview],\n [isPost],\n [executeBy],\n [executeTime]\n) VALUES (\n '\" . $this->getCompanyId() . \"',\n '\" . $this->model->getWarehouseId() . \"',\n '\" . $this->model->getProductCode() . \"',\n '\" . $this->model->getProductDescription() . \"',\n '\" . $this->model->getProductRecountDate() . \"',\n '\" . $this->model->getProductRecountSystemQuantity() . \"',\n '\" . $this->model->getProductRecountPhysicalQuantity() . \"',\n '\" . $this->model->getIsDefault(0, 'single') . \"',\n '\" . $this->model->getIsNew(0, 'single') . \"',\n '\" . $this->model->getIsDraft(0, 'single') . \"',\n '\" . $this->model->getIsUpdate(0, 'single') . \"',\n '\" . $this->model->getIsDelete(0, 'single') . \"',\n '\" . $this->model->getIsActive(0, 'single') . \"',\n '\" . $this->model->getIsApproved(0, 'single') . \"',\n '\" . $this->model->getIsReview(0, 'single') . \"',\n '\" . $this->model->getIsPost(0, 'single') . \"',\n '\" . $this->model->getExecuteBy() . \"',\n \" . $this->model->getExecuteTime() . \"\n );\";\n } else {\n if ($this->getVendor() == self::ORACLE) {\n $sql = \"\n INSERT INTO PRODUCTRECOUNT\n (\n COMPANYID,\n WAREHOUSEID,\n PRODUCTCODE,\n PRODUCTDESCRIPTION,\n PRODUCTRECOUNTDATE,\n PRODUCTRECOUNTSYSTEMQUANTITY,\n PRODUCTRECOUNTPHYSICALQUANTITY,\n ISDEFAULT,\n ISNEW,\n ISDRAFT,\n ISUPDATE,\n ISDELETE,\n ISACTIVE,\n ISAPPROVED,\n ISREVIEW,\n ISPOST,\n EXECUTEBY,\n EXECUTETIME\n ) VALUES (\n '\" . $this->getCompanyId() . \"',\n '\" . $this->model->getWarehouseId() . \"',\n '\" . $this->model->getProductCode() . \"',\n '\" . $this->model->getProductDescription() . \"',\n '\" . $this->model->getProductRecountDate() . \"',\n '\" . $this->model->getProductRecountSystemQuantity() . \"',\n '\" . $this->model->getProductRecountPhysicalQuantity() . \"',\n '\" . $this->model->getIsDefault(0, 'single') . \"',\n '\" . $this->model->getIsNew(0, 'single') . \"',\n '\" . $this->model->getIsDraft(0, 'single') . \"',\n '\" . $this->model->getIsUpdate(0, 'single') . \"',\n '\" . $this->model->getIsDelete(0, 'single') . \"',\n '\" . $this->model->getIsActive(0, 'single') . \"',\n '\" . $this->model->getIsApproved(0, 'single') . \"',\n '\" . $this->model->getIsReview(0, 'single') . \"',\n '\" . $this->model->getIsPost(0, 'single') . \"',\n '\" . $this->model->getExecuteBy() . \"',\n \" . $this->model->getExecuteTime() . \"\n );\";\n }\n }\n }\n try {\n $this->q->create($sql);\n } catch (\\Exception $e) {\n $this->q->rollback();\n echo json_encode(array(\"success\" => false, \"message\" => $e->getMessage()));\n exit();\n }\n }", "public function test_comicEntityIsCreated_prices_setPrices()\n {\n $sut = $this->getSUT();\n $prices = $sut->getPrices();\n $expected = [\n Price::create(\n 'printPrice',\n 19.99\n ),\n ];\n\n $this->assertEquals($expected, $prices);\n }", "public function relatedProductsAction()\n {\n $productId = Mage::app()->getRequest()->getParam('productId');\n $relatedProducts = [];\n\n if ($productId != null) {\n $product = Mage::getModel('catalog/product')->load($productId);\n $relatedProductsId = $product->getRelatedProductIds();\n foreach ($relatedProductsId as $relatedProductId) {\n $relatedProducts[] = Mage::getModel('catalog/product')->load($relatedProductId)->getData();\n }\n }\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($relatedProducts));\n $this->getResponse()->setHeader('Content-type', 'application/json');\n }", "public function loadPriceData($storeId, $productIds)\r\n {\r\n $websiteId = $this->getStore($storeId)->getWebsiteId();\r\n\r\n // check if entities data exist in price index table\r\n $select = $this->getConnection()->select()\r\n ->from(['p' => $this->getTable('catalog_product_index_price')])\r\n ->where('p.customer_group_id = ?', 0) // for all customers\r\n ->where('p.website_id = ?', $websiteId)\r\n ->where('p.entity_id IN (?)', $productIds);\r\n\r\n $result = $this->getConnection()->fetchAll($select);\r\n\t\t\r\n\t\treturn $result;\r\n\r\n if ($this->limiter > 3) {\r\n return $result;\r\n }\r\n\r\n // new added product prices may not be populated into price index table in some reason,\r\n // try to force reindex for unprocessed entities\r\n $processedIds = [];\r\n foreach ($result as $priceData) {\r\n $processedIds[] = $priceData['entity_id'];\r\n }\r\n $diffIds = array_diff($productIds, $processedIds);\r\n if (!empty($diffIds)) {\r\n $this->getPriceIndexer()->executeList($diffIds);\r\n $this->limiter += 1;\r\n $this->loadPriceData($storeId, $productIds);\r\n }\r\n\r\n return $result;\r\n }", "public function products()\n {\n return $this->hasMany('App\\Core\\Catalog\\Entities\\Product', 'company_id', 'id');\n }", "public function setProductIds(array $product_ids): self\n {\n $this->product_ids = $product_ids;\n return $this;\n }", "public function testAddRelatedUpSellCrossSellProducts(): void\n {\n $postData = $this->getPostData();\n $this->getRequest()->setMethod(HttpRequest::METHOD_POST);\n $this->getRequest()->setPostValue($postData);\n $this->dispatch('backend/catalog/product/save');\n $this->assertSessionMessages(\n $this->equalTo(['You saved the product.']),\n MessageInterface::TYPE_SUCCESS\n );\n $product = $this->productRepository->get('simple');\n $this->assertEquals(\n $this->getExpectedLinks($postData['links']),\n $this->getActualLinks($product),\n \"Expected linked products do not match actual linked products!\"\n );\n }", "public function productPrices()\n {\n return $this->belongsToMany(ProductPrice::class, 'product_prices', null, 'product_id');\n }", "public function saveProductRelations($product)\n {\n parent::saveProductRelations($product);\n\n $data = $product->getCustomOneLinkData();\n if (!is_null($data)) {\n $this->_getResource()->saveProductLinks($product, $data, self::LINK_TYPE_CUSTOMONE);\n }\n\n $data = $product->getCustomTwoLinkData();\n if (!is_null($data)) {\n $this->_getResource()->saveProductLinks($product, $data, self::LINK_TYPE_CUSTOMTWO);\n }\n }", "function _update_product_mrp($prods)\r\n\t{\r\n\t\t$user = $this->erpm->auth();\r\n\t\t$c=0;\r\n\t\tforeach($prods as $i=>$pdet_arr)\r\n\t\t{\r\n\t\t\t\t$pid = $pdet_arr['product_id']; \r\n\t\t\t\t$mrp= $pdet_arr['mrp']; \r\n\t\t\t\tif(empty($mrp))\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t$c++;\r\n\t\t\t\t$pc_prod=$this->db->query(\"select * from m_product_info where product_id=? and mrp!=?\",array($pid,$mrp))->row_array();\r\n\t\t\t\tif(!empty($pc_prod))\r\n\t\t\t\t{\r\n\t\t\t\t\t$inp=array(\"product_id\"=>$pid,\"new_mrp\"=>$mrp,\"old_mrp\"=>$pc_prod['mrp'],\"reference_grn\"=>0,\"created_by\"=>$user['userid'],\"created_on\"=>time());\r\n\t\t\t\t\t$this->db->insert(\"product_price_changelog\",$inp);\r\n\t\t\t\t\t$this->db->query(\"update m_product_info set mrp=? where product_id=? limit 1\",array($mrp,$pid));\r\n\t\t\t\t\tforeach($this->db->query(\"select product_id from products_group_pids where group_id in (select group_id from products_group_pids where product_id=$pid) and product_id!=$pid\")->result_array() as $pg)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$inp=array(\"product_id\"=>$pg['product_id'],\"new_mrp\"=>$mrp,\"old_mrp\"=>$this->db->query(\"select mrp from m_product_info where product_id=?\",$pg['product_id'])->row()->mrp,\"reference_grn\"=>0,\"created_by\"=>$user['userid'],\"created_on\"=>time());\r\n\t\t\t\t\t\t$this->db->insert(\"product_price_changelog\",$inp);\r\n\t\t\t\t\t\t$this->db->query(\"update m_product_info set mrp=? where product_id=? limit 1\",array($mrp,$pg['product_id']));\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$r_itemids=$this->db->query(\"select itemid from m_product_deal_link where product_id=?\",$pid)->result_array();\r\n\t\t\t\t\t$r_itemids2=$this->db->query(\"select l.itemid from products_group_pids p join m_product_group_deal_link l on l.group_id=p.group_id where p.product_id=?\",$pid)->result_array();\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t$r_itemids_arr = array();\r\n\t\t\t\t\t\tif($r_itemids)\r\n\t\t\t\t\t\t\tforeach($r_itemids as $r_item_det)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif(!isset($r_itemids_arr[$r_item_det['itemid']]))\r\n\t\t\t\t\t\t\t\t\t$r_itemids_arr[$r_item_det['itemid']] = array();\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$r_itemids_arr[$r_item_det['itemid']] = $r_item_det; \r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif($r_itemids2)\r\n\t\t\t\t\t\t\tforeach($r_itemids2 as $r_item_det)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif(!isset($r_itemids_arr[$r_item_det['itemid']]))\r\n\t\t\t\t\t\t\t\t\t$r_itemids_arr[$r_item_det['itemid']] = array();\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$r_itemids_arr[$r_item_det['itemid']] = $r_item_det; \r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//$r_itemids=array_unique(array_merge($r_itemids,$r_itemids2));\r\n\t\t\t\t\t\t$r_itemids = array_values($r_itemids_arr);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tforeach($r_itemids as $d)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$itemid=$d['itemid'];\r\n\t\t\t\t\t\t$item=$this->db->query(\"select orgprice,price from king_dealitems where id=?\",$itemid)->row_array();\r\n\t\t\t\t\t\t$o_price=$item['price'];$o_mrp=$item['orgprice'];\r\n\t\t\t\t\t\t$n_mrp=$this->db->query(\"select ifnull(sum(p.mrp*l.qty),0) as mrp from m_product_deal_link l join m_product_info p on p.product_id=l.product_id where l.itemid=?\",$itemid)->row()->mrp+$this->db->query(\"select ifnull(sum((select avg(mrp) from m_product_group_deal_link l join products_group_pids pg on pg.group_id=l.group_id join m_product_info p on p.product_id=pg.product_id where l.itemid=$itemid)*(select qty from m_product_group_deal_link where itemid=$itemid)),0) as mrp\")->row()->mrp;\r\n\t\t\t\t\t\t$n_price=$item['price']/$o_mrp*$n_mrp;\r\n\t\t\t\t\t\t$inp=array(\"itemid\"=>$itemid,\"old_mrp\"=>$o_mrp,\"new_mrp\"=>$n_mrp,\"old_price\"=>$o_price,\"new_price\"=>$n_price,\"created_by\"=>$user['userid'],\"created_on\"=>time(),\"reference_grn\"=>0);\r\n\t\t\t\t\t\t$r=$this->db->insert(\"deal_price_changelog\",$inp);\r\n\t\t\t\t\t\t$this->db->query(\"update king_dealitems set orgprice=?,price=? where id=? limit 1\",array($n_mrp,$n_price,$itemid));\r\n\t\t\t\t\t\tif($this->db->query(\"select is_pnh as b from king_dealitems where id=?\",$itemid)->row()->b)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$o_s_price=$this->db->query(\"select store_price from king_dealitems where id=?\",$itemid)->row()->store_price;\r\n\t\t\t\t\t\t\t$n_s_price=$o_s_price/$o_mrp*$n_mrp;\r\n\t\t\t\t\t\t\t$this->db->query(\"update king_dealitems set store_price=? where id=? limit 1\",array($n_s_price,$itemid));\r\n\t\t\t\t\t\t\t$o_n_price=$this->db->query(\"select nyp_price as p from king_dealitems where id=?\",$itemid)->row()->p;\r\n\t\t\t\t\t\t\t$n_n_price=$o_n_price/$o_mrp*$n_mrp;\r\n\t\t\t\t\t\t\t$this->db->query(\"update king_dealitems set nyp_price=? where id=? limit 1\",array($n_n_price,$itemid));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tforeach($this->db->query(\"select * from partner_deal_prices where itemid=?\",$itemid)->result_array() as $r)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$o_c_price=$r['customer_price'];\r\n\t\t\t\t\t\t\t$n_c_price=$o_c_price/$o_mrp*$n_mrp;\r\n\t\t\t\t\t\t\t$o_p_price=$r['partner_price'];\r\n\t\t\t\t\t\t\t$n_p_price=$o_p_price/$o_mrp*$n_mrp;\r\n\t\t\t\t\t\t\t$this->db->query(\"update partner_deal_prices set customer_price=?,partner_price=? where itemid=? and partner_id=?\",array($n_c_price,$n_p_price,$itemid,$r['partner_id']));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t}\r\n\t\treturn $c;\r\n\t}", "public function publishAbstractPriceProductPriceListByIdPriceList(int $idPriceList): void;", "public function testProductGetPrices()\n {\n $product = $this->find('product', 1);\n $prices = $product->getPrices();\n $price = $prices[0];\n \n $currencies = $this->findAll('currency');\n $dollarCurrency = $currencies[0];\n \n $money = Money::create(10, $dollarCurrency); \n \n $this->assertEquals(\n $money,\n $price\n );\n }", "private function sync_products($erply_category_id, $oc_category_id)\n\t{\n\t\t$this->debug(\"@sync_products creating products for category with id \" . $oc_category_id);\n\n\t\t$offset = 0;\n\t\t$erply_products = array();\n\n\t\t$erply_response = $this->ErplyClient->get_products($offset, 100, 1, 1, null, $erply_category_id);\n\n\t\tif ($erply_response['status']['responseStatus'] == 'error') {\n\t\t\tthrow new Exception(\"Error in Erply response\");\n\t\t}\n\n\t\t$erply_products = $erply_response['records'];\n\n\t\twhile ($offset < $erply_response['status']['recordsTotal']) {\n\t\t\t$offset += 100;\n\t\t\t$erply_response = $this->ErplyClient->get_products($offset, 100, 1, 1, null, $erply_category_id);\n\n\t\t\tif ($erply_response['status']['responseStatus'] == 'error') {\n\t\t\t\tthrow new Exception(\"Error in Erply response\");\n\t\t\t}\n\n\t\t\t$erply_products = array_merge($erply_products, $erply_response['records']);\n\t\t}\n\n\t\tforeach ($erply_products as $erply_product) {\n\t\t\t$this->sync_product($erply_product, $oc_category_id);\n\t\t}\n\n\t\treturn sizeof($erply_products);\n\t}", "public function getRelatedProductsByChart()\r\n {\r\n $chartId = $this->getChart()->getId();\r\n return $this->getChart()->getRelatedProductsByChart($chartId);\r\n }", "public function packageProductRelations()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\SellerProductRelation','sp_id','sp_id');\n }", "function ppt_resources_get_consumptions_stocks_per_product($data)\n{\n if (!isset($data['year']) || (!isset($data['uid']))) {\n return services_error('Year or UID are not defined!', 500);\n }\n\n global $user;\n $year = $data['year'];\n $accounts = [];\n // If there is no uid sent with the api so get the current user id.\n if (isset($data['uid']) && !empty($data['uid'])) {\n $uid = $data['uid'];\n } else {\n $uid = $user->uid;\n }\n $countries = array();\n if (isset($data['countries'])) {\n $countries = $data['countries'];\n }\n $reps = array();\n if (isset($data['reps'])) {\n $reps = $data['reps'];\n } else {\n $is_rep = FALSE;\n if (is_rep($user)) {\n $is_rep = TRUE;\n }\n $reps = ppt_resources_get_sales_manager_reps($uid, $countries, $is_rep);\n }\n\n $user = user_load($uid);\n\n // Check if user selected accounts.\n if (isset($data['accounts'])) {\n $accounts = $data['accounts'];\n } else {\n $accounts = ppt_resources_get_role_accounts($user, $countries);\n }\n\n $products = [];\n // Check if user selected products.\n if (isset($data['products'])) {\n $products = get_products_dosages($data['products']);\n } else {\n // If the user is rep.\n if (is_rep($user)) {\n $products = get_products_for_current_user($uid);\n } else {\n $products = get_products_for_accounts($accounts);\n }\n }\n\n $entries = get_entries($accounts, $products, NULL, $reps);\n $entries_records = get_entries_records_for_year($entries, $year, 'consumption_stock_entry');\n $consumptions = sum_records_per_field_grouped_by_account($entries_records, 'field_product');\n\n return $consumptions;\n}", "protected function _saveProducts()\n {\n $priceIsGlobal = $this->_catalogData->isPriceGlobal();\n $productLimit = null;\n $productsQty = null;\n $entityLinkField = $this->getProductEntityLinkField();\n\n while ($bunch = $this->_dataSourceModel->getNextBunch()) {\n $entityRowsIn = [];\n $entityRowsUp = [];\n $attributes = [];\n $this->websitesCache = [];\n $this->categoriesCache = [];\n $tierPrices = [];\n $mediaGallery = [];\n $labelsForUpdate = [];\n $imagesForChangeVisibility = [];\n $uploadedImages = [];\n $previousType = null;\n $prevAttributeSet = null;\n $existingImages = $this->getExistingImages($bunch);\n\n foreach ($bunch as $rowNum => $rowData) {\n // reset category processor's failed categories array\n $this->categoryProcessor->clearFailedCategories();\n\n if (!$this->validateRow($rowData, $rowNum)) {\n continue;\n }\n if ($this->getErrorAggregator()->hasToBeTerminated()) {\n $this->getErrorAggregator()->addRowToSkip($rowNum);\n continue;\n }\n $rowScope = $this->getRowScope($rowData);\n\n $rowData[self::URL_KEY] = $this->getUrlKey($rowData);\n\n $rowSku = $rowData[self::COL_SKU];\n\n if (null === $rowSku) {\n $this->getErrorAggregator()->addRowToSkip($rowNum);\n continue;\n } elseif (self::SCOPE_STORE == $rowScope) {\n // set necessary data from SCOPE_DEFAULT row\n $rowData[self::COL_TYPE] = $this->skuProcessor->getNewSku($rowSku)['type_id'];\n $rowData['attribute_set_id'] = $this->skuProcessor->getNewSku($rowSku)['attr_set_id'];\n $rowData[self::COL_ATTR_SET] = $this->skuProcessor->getNewSku($rowSku)['attr_set_code'];\n }\n\n // 1. Entity phase\n if ($this->isSkuExist($rowSku)) {\n // existing row\n if (isset($rowData['attribute_set_code'])) {\n $attributeSetId = $this->catalogConfig->getAttributeSetId(\n $this->getEntityTypeId(),\n $rowData['attribute_set_code']\n );\n\n // wrong attribute_set_code was received\n if (!$attributeSetId) {\n throw new LocalizedException(\n __(\n 'Wrong attribute set code \"%1\", please correct it and try again.',\n $rowData['attribute_set_code']\n )\n );\n }\n } else {\n $attributeSetId = $this->skuProcessor->getNewSku($rowSku)['attr_set_id'];\n }\n\n $entityRowsUp[] = [\n 'updated_at' => (new \\DateTime())->format(DateTime::DATETIME_PHP_FORMAT),\n 'attribute_set_id' => $attributeSetId,\n $entityLinkField => $this->getExistingSku($rowSku)[$entityLinkField]\n ];\n } else {\n if (!$productLimit || $productsQty < $productLimit) {\n $entityRowsIn[strtolower($rowSku)] = [\n 'attribute_set_id' => $this->skuProcessor->getNewSku($rowSku)['attr_set_id'],\n 'type_id' => $this->skuProcessor->getNewSku($rowSku)['type_id'],\n 'sku' => $rowSku,\n 'has_options' => isset($rowData['has_options']) ? $rowData['has_options'] : 0,\n 'created_at' => (new \\DateTime())->format(DateTime::DATETIME_PHP_FORMAT),\n 'updated_at' => (new \\DateTime())->format(DateTime::DATETIME_PHP_FORMAT),\n ];\n $productsQty++;\n } else {\n $rowSku = null;\n // sign for child rows to be skipped\n $this->getErrorAggregator()->addRowToSkip($rowNum);\n continue;\n }\n }\n\n if (!array_key_exists($rowSku, $this->websitesCache)) {\n $this->websitesCache[$rowSku] = [];\n }\n // 2. Product-to-Website phase\n if (!empty($rowData[self::COL_PRODUCT_WEBSITES])) {\n $websiteCodes = explode($this->getMultipleValueSeparator(), $rowData[self::COL_PRODUCT_WEBSITES]);\n foreach ($websiteCodes as $websiteCode) {\n $websiteId = $this->storeResolver->getWebsiteCodeToId($websiteCode);\n $this->websitesCache[$rowSku][$websiteId] = true;\n }\n }\n\n // 3. Categories phase\n if (!array_key_exists($rowSku, $this->categoriesCache)) {\n $this->categoriesCache[$rowSku] = [];\n }\n $rowData['rowNum'] = $rowNum;\n $categoryIds = $this->processRowCategories($rowData);\n foreach ($categoryIds as $id) {\n $this->categoriesCache[$rowSku][$id] = true;\n }\n unset($rowData['rowNum']);\n\n // 4.1. Tier prices phase\n if (!empty($rowData['_tier_price_website'])) {\n $tierPrices[$rowSku][] = [\n 'all_groups' => $rowData['_tier_price_customer_group'] == self::VALUE_ALL,\n 'customer_group_id' => $rowData['_tier_price_customer_group'] ==\n self::VALUE_ALL ? 0 : $rowData['_tier_price_customer_group'],\n 'qty' => $rowData['_tier_price_qty'],\n 'value' => $rowData['_tier_price_price'],\n 'website_id' => self::VALUE_ALL == $rowData['_tier_price_website'] ||\n $priceIsGlobal ? 0 : $this->storeResolver->getWebsiteCodeToId($rowData['_tier_price_website']),\n ];\n }\n\n if (!$this->validateRow($rowData, $rowNum)) {\n continue;\n }\n\n // 5. Media gallery phase\n list($rowImages, $rowLabels) = $this->getImagesFromRow($rowData);\n $storeId = !empty($rowData[self::COL_STORE])\n ? $this->getStoreIdByCode($rowData[self::COL_STORE])\n : Store::DEFAULT_STORE_ID;\n $imageHiddenStates = $this->getImagesHiddenStates($rowData);\n foreach (array_keys($imageHiddenStates) as $image) {\n if (array_key_exists($rowSku, $existingImages)\n && array_key_exists($image, $existingImages[$rowSku])\n ) {\n $rowImages[self::COL_MEDIA_IMAGE][] = $image;\n $uploadedImages[$image] = $image;\n }\n\n if (empty($rowImages)) {\n $rowImages[self::COL_MEDIA_IMAGE][] = $image;\n }\n }\n\n $rowData[self::COL_MEDIA_IMAGE] = [];\n\n /*\n * Note: to avoid problems with undefined sorting, the value of media gallery items positions\n * must be unique in scope of one product.\n */\n $position = 0;\n foreach ($rowImages as $column => $columnImages) {\n foreach ($columnImages as $columnImageKey => $columnImage) {\n if (!isset($uploadedImages[$columnImage])) {\n $uploadedFile = $this->uploadMediaFiles($columnImage);\n $uploadedFile = $uploadedFile ?: $this->getSystemFile($columnImage);\n if ($uploadedFile) {\n $uploadedImages[$columnImage] = $uploadedFile;\n } else {\n $this->addRowError(\n ValidatorInterface::ERROR_MEDIA_URL_NOT_ACCESSIBLE,\n $rowNum,\n null,\n null,\n ProcessingError::ERROR_LEVEL_NOT_CRITICAL\n );\n }\n } else {\n $uploadedFile = $uploadedImages[$columnImage];\n }\n\n if ($uploadedFile && $column !== self::COL_MEDIA_IMAGE) {\n $rowData[$column] = $uploadedFile;\n }\n\n if ($uploadedFile && !isset($mediaGallery[$storeId][$rowSku][$uploadedFile])) {\n if (isset($existingImages[$rowSku][$uploadedFile])) {\n $currentFileData = $existingImages[$rowSku][$uploadedFile];\n if (isset($rowLabels[$column][$columnImageKey])\n && $rowLabels[$column][$columnImageKey] !=\n $currentFileData['label']\n ) {\n $labelsForUpdate[] = [\n 'label' => $rowLabels[$column][$columnImageKey],\n 'imageData' => $currentFileData\n ];\n }\n\n if (array_key_exists($uploadedFile, $imageHiddenStates)\n && $currentFileData['disabled'] != $imageHiddenStates[$uploadedFile]\n ) {\n $imagesForChangeVisibility[] = [\n 'disabled' => $imageHiddenStates[$uploadedFile],\n 'imageData' => $currentFileData\n ];\n }\n } else {\n if ($column == self::COL_MEDIA_IMAGE) {\n $rowData[$column][] = $uploadedFile;\n }\n $mediaGallery[$storeId][$rowSku][$uploadedFile] = [\n 'attribute_id' => $this->getMediaGalleryAttributeId(),\n 'label' => isset($rowLabels[$column][$columnImageKey])\n ? $rowLabels[$column][$columnImageKey]\n : '',\n 'position' => ++$position,\n 'disabled' => isset($imageHiddenStates[$columnImage])\n ? $imageHiddenStates[$columnImage] : '0',\n 'value' => $uploadedFile,\n ];\n }\n }\n }\n }\n\n // 6. Attributes phase\n $rowStore = (self::SCOPE_STORE == $rowScope)\n ? $this->storeResolver->getStoreCodeToId($rowData[self::COL_STORE])\n : 0;\n $productType = isset($rowData[self::COL_TYPE]) ? $rowData[self::COL_TYPE] : null;\n if ($productType !== null) {\n $previousType = $productType;\n }\n if (isset($rowData[self::COL_ATTR_SET])) {\n $prevAttributeSet = $rowData[self::COL_ATTR_SET];\n }\n if (self::SCOPE_NULL == $rowScope) {\n // for multiselect attributes only\n if ($prevAttributeSet !== null) {\n $rowData[self::COL_ATTR_SET] = $prevAttributeSet;\n }\n if ($productType === null && $previousType !== null) {\n $productType = $previousType;\n }\n if ($productType === null) {\n continue;\n }\n }\n\n $productTypeModel = $this->_productTypeModels[$productType];\n if (!empty($rowData['tax_class_name'])) {\n $rowData['tax_class_id'] =\n $this->taxClassProcessor->upsertTaxClass($rowData['tax_class_name'], $productTypeModel);\n }\n\n if ($this->getBehavior() == Import::BEHAVIOR_APPEND ||\n empty($rowData[self::COL_SKU])\n ) {\n $rowData = $productTypeModel->clearEmptyData($rowData);\n }\n\n $rowData = $productTypeModel->prepareAttributesWithDefaultValueForSave(\n $rowData,\n !$this->isSkuExist($rowSku)\n );\n $product = $this->_proxyProdFactory->create(['data' => $rowData]);\n\n foreach ($rowData as $attrCode => $attrValue) {\n $attribute = $this->retrieveAttributeByCode($attrCode);\n\n if ('multiselect' != $attribute->getFrontendInput() && self::SCOPE_NULL == $rowScope) {\n // skip attribute processing for SCOPE_NULL rows\n continue;\n }\n $attrId = $attribute->getId();\n $backModel = $attribute->getBackendModel();\n $attrTable = $attribute->getBackend()->getTable();\n $storeIds = [0];\n\n if ('datetime' == $attribute->getBackendType()\n && (\n in_array($attribute->getAttributeCode(), $this->dateAttrCodes)\n || $attribute->getIsUserDefined()\n )\n ) {\n $attrValue = $this->dateTime->formatDate($attrValue, false);\n } elseif ('datetime' == $attribute->getBackendType() && strtotime($attrValue)) {\n $attrValue = gmdate(\n 'Y-m-d H:i:s',\n $this->_localeDate->date($attrValue)->getTimestamp()\n );\n } elseif ($backModel) {\n $attribute->getBackend()->beforeSave($product);\n $attrValue = $product->getData($attribute->getAttributeCode());\n }\n if (self::SCOPE_STORE == $rowScope) {\n if (self::SCOPE_WEBSITE == $attribute->getIsGlobal()) {\n // check website defaults already set\n if (!isset($attributes[$attrTable][$rowSku][$attrId][$rowStore])) {\n $storeIds = $this->storeResolver->getStoreIdToWebsiteStoreIds($rowStore);\n }\n } elseif (self::SCOPE_STORE == $attribute->getIsGlobal()) {\n $storeIds = [$rowStore];\n }\n if (!$this->isSkuExist($rowSku)) {\n $storeIds[] = 0;\n }\n }\n foreach ($storeIds as $storeId) {\n if (!isset($attributes[$attrTable][$rowSku][$attrId][$storeId])) {\n $attributes[$attrTable][$rowSku][$attrId][$storeId] = $attrValue;\n }\n }\n // restore 'backend_model' to avoid 'default' setting\n $attribute->setBackendModel($backModel);\n }\n }\n\n foreach ($bunch as $rowNum => $rowData) {\n if ($this->getErrorAggregator()->isRowInvalid($rowNum)) {\n unset($bunch[$rowNum]);\n }\n }\n\n $this->saveProductEntity(\n $entityRowsIn,\n $entityRowsUp\n )->_saveProductWebsites(\n $this->websitesCache\n )->_saveProductCategories(\n $this->categoriesCache\n )->_saveProductTierPrices(\n $tierPrices\n )->_saveMediaGallery(\n $mediaGallery\n )->_saveProductAttributes(\n $attributes\n )->updateMediaGalleryVisibility(\n $imagesForChangeVisibility\n )->updateMediaGalleryLabels(\n $labelsForUpdate\n );\n\n $this->_eventManager->dispatch(\n 'catalog_product_import_bunch_save_after',\n ['adapter' => $this, 'bunch' => $bunch]\n );\n }\n\n return $this;\n }", "function fn_warehouses_gather_additional_products_data_post($product_ids, $params, &$products, $auth, $lang_code)\n{\n if (empty($product_ids) && !isset($params['get_warehouse_amount']) || $params['get_warehouse_amount'] === false) {\n return;\n }\n\n /** @var Tygh\\Addons\\Warehouses\\Manager $manager */\n $manager = Tygh::$app['addons.warehouses.manager'];\n $products = $manager->fetchProductsWarehousesAmounts($products);\n}", "public function LoadProductsForPrice()\n\t\t{\n\t\t\t$query = \"\n\t\t\t\tSELECT\n\t\t\t\t\tp.*,\n\t\t\t\t\tFLOOR(prodratingtotal / prodnumratings) AS prodavgrating,\n\t\t\t\t\timageisthumb,\n\t\t\t\t\timagefile,\n\t\t\t\t\t\" . GetProdCustomerGroupPriceSQL() . \"\n\t\t\t\tFROM\n\t\t\t\t\t(\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\tDISTINCT ca.productid,\n\t\t\t\t\t\t\tFLOOR(prodratingtotal / prodnumratings) AS prodavgrating\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t[|PREFIX|]categoryassociations ca\n\t\t\t\t\t\t\tINNER JOIN [|PREFIX|]products p ON p.productid = ca.productid\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\tp.prodvisible = 1 AND\n\t\t\t\t\t\t\tca.categoryid IN (\" . $this->GetProductCategoryIds() . \") AND\n\t\t\t\t\t\t\tp.prodcalculatedprice >= '\".(int)$this->GetMinPrice().\"' AND\n\t\t\t\t\t\t\tp.prodcalculatedprice <= '\".(int)$this->GetMaxPrice().\"'\n\t\t\t\t\t\tORDER BY\n\t\t\t\t\t\t\t\" . $this->GetSortField() . \", p.prodname ASC\n\t\t\t\t\t\t\" . $GLOBALS['ISC_CLASS_DB']->AddLimit($this->GetStart(), GetConfig('CategoryProductsPerPage')) . \"\n\t\t\t\t\t) AS ca\n\t\t\t\t\tINNER JOIN [|PREFIX|]products p ON p.productid = ca.productid\n\t\t\t\t\tLEFT JOIN [|PREFIX|]product_images pi ON (pi.imageisthumb = 1 AND p.productid = pi.imageprodid)\n\t\t\t\";\n\n\t\t\t//$query .= $GLOBALS['ISC_CLASS_DB']->AddLimit($this->GetStart(), GetConfig('CategoryProductsPerPage'));\n\t\t\t$result = $GLOBALS['ISC_CLASS_DB']->Query($query);\n\t\t\twhile ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {\n\t\t\t\t$row['prodavgrating'] = (int)$row['prodavgrating'];\n\t\t\t\t$this->_priceproducts[] = $row;\n\t\t\t}\n\t\t}", "public function providerDiscountPurchases()\r\n\t{\r\n\t\t$appleProduct = $this->getAppleProduct(self::PRODUCT_WITH_DISCOUNT_PRICE);\r\n\t\t$lightProduct = $this->getLightProduct(self::PRODUCT_WITH_DISCOUNT_PRICE);\r\n\t\t$starshipProduct = $this->getStarshipProduct(self::PRODUCT_WITH_DISCOUNT_PRICE);\r\n\r\n\t\treturn array(\r\n\t\t\tarray(\r\n\t\t\t\t7.0 * self::PRODUCT_APPLE_DISCOUNT_PRICE,\r\n\t\t\t\tarray(\r\n\t\t\t\t\tnew ProductToPurchase($appleProduct, 7.0),\r\n\t\t\t\t),\r\n\t\t\t),\r\n\t\t\tarray(\r\n\t\t\t\t5 * self::PRODUCT_LIGHT_PRICE + 8.0 * self::PRODUCT_APPLE_DISCOUNT_PRICE,\r\n\t\t\t\tarray(\r\n\t\t\t\t\tnew ProductToPurchase($lightProduct, 5),\r\n\t\t\t\t\tnew ProductToPurchase($appleProduct, 8.0),\r\n\t\t\t\t),\r\n\t\t\t),\r\n\t\t\tarray(\r\n\t\t\t\t4 * self::PRODUCT_STARSHIP_PRICE,\r\n\t\t\t\tarray(\r\n\t\t\t\t\tnew ProductToPurchase($starshipProduct, 6)\r\n\t\t\t\t),\r\n\t\t\t),\r\n\t\t);\r\n\t}", "public function prepareData($collection, $productIds)\n {\n foreach ($collection as &$item) {\n if ($item->getSpecialPrice()) {\n $product = $this->productRepository->get($item->getSku());\n $specialFromDate = $product->getSpecialFromDate();\n $specialToDate = $product->getSpecialToDate();\n\n if ($specialFromDate || $specialToDate) {\n $id = $product->getId();\n $this->effectiveDates[$id] = $this->getSpecialEffectiveDate($specialFromDate, $specialToDate);\n }\n }\n }\n }", "function getDeliveryCharges($product_id = null, $seller_id = null, $condition_id = null) {\n\t\tif(empty($product_id) && is_null($seller_id) ){\n\t\t}\n\t\tApp::import('Model','ProductSeller');\n\t\t$this->ProductSeller = & new ProductSeller();\n\t\t$prodSellerInfo = $this->ProductSeller->find('first', array('conditions'=>array('ProductSeller.product_id'=>$product_id ,'ProductSeller.seller_id'=>$seller_id , 'ProductSeller.condition_id'=>$condition_id ),'fields'=>array('ProductSeller.standard_delivery_price')));\n\t\t//pr($prodSellerInfo);\n\t\tif(is_array($prodSellerInfo)){\n\t\t\treturn $prodSellerInfo['ProductSeller']['standard_delivery_price'];\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function refreshPriceIndices($product)\n {\n $products = $this->getAllRelatedProducts($product);\n\n foreach ($products as $product) {\n $this->indexer->refreshPrice($product);\n }\n }", "private function send_products_to_quote(ck_quote $quote) {\n\t\tself::query_execute('INSERT INTO customer_quote_products (customer_quote_id, product_id, parent_products_id, option_type, price, quantity) SELECT :customer_quote_id, products_id, parent_products_id, option_type, IFNULL(quoted_price, unit_price), quantity FROM ck_cart_products WHERE cart_id = :cart_id', cardinality::NONE, [':customer_quote_id' => $quote->id(), ':cart_id' => $this->id()]);\n\t\tself::query_execute('DELETE FROM ck_cart_products WHERE cart_id = :cart_id', cardinality::NONE, [':cart_id' => $this->id()]);\n\t}", "public function price()\n {\n return $this->morphToMany('Sanatorium\\Pricing\\Models\\Money', 'priceable', 'priced');\n }", "public function getProducts()\n {\n foreach ($this->productIds as $id) {\n // Use a generator to save on memory/resources\n // load accounts from DB one at a time only when required\n yield (new ProductModel())->load($id);\n }\n }", "private function generateChangedProductUrls(\n MergeDataProvider $mergeDataProvider,\n Category $category,\n int $storeId,\n bool $saveRewriteHistory\n ) {\n $this->isSkippedProduct[$category->getEntityId()] = $category->getAffectedProductIds();\n\n $categoryStoreIds = [$storeId];\n // If category is changed in the Global scope when need to regenerate product URL rewrites for all other scopes.\n if ($this->productScopeRewriteGenerator->isGlobalScope($storeId)) {\n $categoryStoreIds = $this->getCategoryStoreIds($category);\n }\n\n foreach ($categoryStoreIds as $categoryStoreId) {\n /* @var Collection $collection */\n $collection = $this->productCollectionFactory->create()\n ->setStoreId($categoryStoreId)\n ->addIdFilter($category->getAffectedProductIds())\n ->addAttributeToSelect('visibility')\n ->addAttributeToSelect('name')\n ->addAttributeToSelect('url_key')\n ->addAttributeToSelect('url_path');\n\n $collection->setPageSize(1000);\n $pageCount = $collection->getLastPageNumber();\n $currentPage = 1;\n while ($currentPage <= $pageCount) {\n $collection->setCurPage($currentPage);\n foreach ($collection as $product) {\n $product->setData('save_rewrites_history', $saveRewriteHistory);\n $product->setStoreId($categoryStoreId);\n $mergeDataProvider->merge(\n $this->productUrlRewriteGenerator->generate($product, $category->getEntityId())\n );\n }\n $collection->clear();\n $currentPage++;\n }\n }\n }", "public function testConvertProductPrice()\n {\n $priceEur = 1000;\n $product = new Product();\n $product->setName('Product test');\n $product->setPrice(1000);\n $product->setCurrency('EUR');\n\n //test exchange method\n $conversorManager = new ConversorManager($this->entityManager);\n $response = $conversorManager->convertProductPrice($product, 'USD');\n\n //asserst\n $this->assertGreaterThan($priceEur ,$response);\n }", "protected function _getProductData() {\n\n\n $cat_id = Mage::getModel('catalog/layer')->getCurrentCategory()->getId();\n $category = Mage::getModel('catalog/category')->load($cat_id);\n $data['event'] = 'product';\n\n $finalPrice = $this->getFinalPriceDiscount();\n if($finalPrice):\n $google_tag_params = array();\n $google_tag_params['ecomm_prodid'] = $this->getProduct()->getSku();\n $google_tag_params['name'] = $this->getProduct()->getName();\n $google_tag_params['brand'] = $this->getProduct()->getBrand();\n $google_tag_params['ecomm_pagetype'] = 'product';\n $google_tag_params['ecomm_category'] = $category->getName();\n $google_tag_params['ecomm_totalvalue'] = (float)$this->formatNumber($finalPrice);\n \n $customer = Mage::getSingleton('customer/session');\n if ($customer->getCustomerId()){\n $google_tag_params['user_id'] = (string) $customer->getCustomerId(); \n }\n if($this->IsReturnedCustomer()){\n $google_tag_params['returnCustomer'] = 'true';\n }\n else {\n $google_tag_params['returnCustomer'] = 'false';\n }\n\n $data['google_tag_params'] = $google_tag_params;\n\n /* Facebook Conversion API Code */\n $custom_data = array(\n \"content_name\" => $this->getProduct()->getName(),\n \"content_ids\" => [$this->getProduct()->getSku()],\n \"content_category\" => $category->getName(),\n \"content_type\" => \"product\",\n \"value\" => (float)$this->formatNumber($finalPrice),\n \"currency\" => \"BRL\"\n );\n $this->createFacebookRequest(\"ViewContent\", [], [], $custom_data);\n /* End Facebook Conversion API Code */\n\n endif;\n\n return $data;\n }", "public function cleanProductsInCatalogPriceRule(Varien_Event_Observer $observer) {\n /**\n * @var $engine Brim_PageCache_Model_Engine\n * @var $rule Mage_CatalogRule_Model_Rule\n */\n\n $engine = Mage::getSingleton('brim_pagecache/engine');\n\n if (!$engine->isEnabled()) {\n return;\n }\n\n $engine->devDebug(__METHOD__);\n\n $tags = array();\n $rule = $observer->getEvent()->getRule();\n foreach ($rule->getMatchingProductIds() as $productId) {\n $tags[] = Brim_PageCache_Model_Engine::FPC_TAG . '_PRODUCT_' . $productId;\n }\n $engine->devDebug($tags);\n Mage::app()->getCacheInstance()->clean($tags);\n }", "private function calculateCost() : void\n {\n $graph = [];\n $data = $this->data->whereNotIn('container_id', $this->containers);\n\n $countAccumulateProductTypes = count($this->accumulateProductTypes);\n foreach ($data as $key => $value) {\n $graph[$key] = $this->getCost($this->accumulateProductTypes, $value, $countAccumulateProductTypes);\n }\n $this->graph = collect($graph);\n }", "public function getPricing()\n {\n // get current quantity as its the basis for pricing\n $quantity = $this->quantity;\n\n // Get pricing but maintain original unitPrice (only if post-CASS certification quantity drop is less than 10%),\n $adjustments = $this->quantity_adjustment + $this->count_adjustment;\n if ($adjustments < 0) {\n $originalQuantity = 0;\n $originalQuantity = $this->itemAddressFiles()->sum('count');\n $originalQuantity += $this->mail_to_me;\n if ((($originalQuantity + $adjustments) / $originalQuantity) > 0.90) { // (less than 10%)\n $quantity = $originalQuantity;\n }\n }\n\n // Get pricing based on quantity.\n // If quantity is less than minimum quantity required (only if post-CASS certification),\n // then use the minimum quantity required to retrieve pricing\n if ((\n $this->quantity_adjustment != 0 || $this->count_adjustment != 0) &&\n $this->quantity < $this->getMinimumQuantity()\n ) {\n $quantity = $this->getMinimumQuantity();\n }\n\n // Pricing date is based on submission date or now.\n $pricingDate = (!is_null($this->date_submitted) ? $this->date_submitted : time());\n\n if (!is_null($this->product_id) && !is_null($this->product)) {\n $newPricing = $this->product->getPricing(\n $quantity, $pricingDate,\n $this->invoice->getBaseSiteId()\n );\n $oldPricing = $this->getProductPrice();\n // TODO: refactor this pricing history section, it really shouldn't belong in this method\n if (!is_null($newPricing)) {\n $insert = true;\n if (!is_null($oldPricing) && $newPricing->id == $oldPricing->product_price_id) {\n $insert = false;\n }\n if ($insert) {\n try {\n InvoiceItemProductPrice::firstOrCreate(\n [\n 'invoice_item_id' => $this->id,\n 'product_price_id' => $newPricing->id,\n 'date_created' => date('Y-m-d H:i:s', time()),\n 'is_active' => 1\n ]\n );\n } catch (QueryException $e) {\n // TODO: fix this hack (e.g. why do we need integrity constraint on this table )\n if (strpos($e->getMessage(), 'Duplicate entry') === false) {\n throw $e;\n } else {\n Logger::error($e->getMessage());\n }\n }\n\n if (!is_null($oldPricing)) {\n $oldPricing->is_active = 0;\n $oldPricing->save();\n }\n }\n }\n\n return $newPricing;\n }\n if (!is_null($this->data_product_id) && $this->data_product_id != 0) {\n return $this->dataProduct->getPricing($pricingDate, $this->invoice->site_id);\n }\n if (!is_null($this->line_item_id) && $this->line_item_id != 0) {\n return $this->line_item->getPricing($pricingDate, $this->invoice->getBaseSiteId());\n }\n if ($this->isAdHocLineItem() && $this->unit_price) {\n return (object)array('price' => $this->unit_price);\n }\n return null;\n }", "public function fetchQuoteProducts()\n\t{\n\n\t\t$this->getDB()->query('SELECT * FROM product_orders WHERE quote_id = '.$this->getId());\n\t\t$res = $this->getDB()->results('arr');\n\t\tforeach($res as $quotedProd)\n\t\t{\n\t\t\t$product = new Product($quotedProd['product_id']);\n\t\t\t$product->setProductCost($quotedProd['product_cost']);\n\t\t\t$product->setProductQuantity($quotedProd['product_qty']);\n\t\t\t$product->setProductType($quotedProd['product_type']);\n\n\t\t\tarray_push($this->products, $product);\n\t\t}\n\t}", "public static function priceCalculation($shop_id, $product_id, $product_attribute_id, $country_id, $state_id, $zipcode, $currency_id, $group_id, $quantity, $use_tax,\n $decimals, $only_reduction, $use_reduction, $with_ecotax, &$specific_price, $use_group_reduction, $customer_id = 0, $use_customer_price = true, $cart_id = 0, $real_quantity = 0){\n static $address = null;\n static $context = null;\n\n if ($address === null){\n $address = new JeproshopAddressModelAddress();\n }\n\n if ($context == null){\n $context = JeproshopContext::getContext()->cloneContext();\n }\n\n if ($shop_id !== null && $context->shop->shop_id != (int)$shop_id){\n $context->shop = new JeproshopShopModelShop((int)$shop_id);\n }\n\n if (!$use_customer_price){\n $customer_id = 0;\n }\n\n if ($product_attribute_id === null){\n $product_attribute_id = JeproshopProductModelProduct::getDefaultAttribute($product_id);\n }\n\n $cache_id = $product_id . '_' .$shop_id . '_' . $currency_id . '_' . $country_id . '_' . $state_id . '_' . $zipcode . '_' . $group_id .\n '_' . $quantity . '_' . $product_attribute_id . '_' .($use_tax?'1':'0').'_' . $decimals.'_'. ($only_reduction ? '1' :'0').\n '_'.($use_reduction ?'1':'0') . '_' . $with_ecotax. '_' . $customer_id . '_'.(int)$use_group_reduction.'_'.(int)$cart_id.'-'.(int)$real_quantity;\n\n // reference parameter is filled before any returns\n $specific_price = JeproshopSpecificPriceModelSpecificPrice::getSpecificPrice((int)$product_id, $shop_id, $currency_id,\n $country_id, $group_id, $quantity, $product_attribute_id, $customer_id, $cart_id, $real_quantity\n );\n\n if (isset(self::$_prices[$cache_id])){\n return self::$_prices[$cache_id];\n }\n $db = JFactory::getDBO();\n // fetch price & attribute price\n $cache_id_2 = $product_id.'-'.$shop_id;\n if (!isset(self::$_pricesLevel2[$cache_id_2])){\n $select = \"SELECT product_shop.\" . $db->quoteName('price') . \", product_shop.\" . $db->quoteName('ecotax');\n $from = $db->quoteName('#__jeproshop_product') . \" AS product INNER JOIN \" . $db->quoteName('#__jeproshop_product_shop');\n $from .= \" AS product_shop ON (product_shop.product_id =product.product_id AND product_shop.shop_id = \" .(int)$shop_id . \")\";\n\n if (JeproshopCombinationModelCombination::isFeaturePublished()){\n $select .= \", product_attribute_shop.product_attribute_id, product_attribute_shop.\" . $db->quoteName('price') . \" AS attribute_price, product_attribute_shop.default_on\";\n $leftJoin = \" LEFT JOIN \" . $db->quoteName('#__jeproshop_product_attribute') . \" AS product_attribute ON product_attribute.\";\n $leftJoin .= $db->quoteName('product_id') . \" = product.\" . $db->quoteName('product_id') . \" LEFT JOIN \" . $db->quoteName('#__jeproshop_product_attribute_shop');\n $leftJoin .= \" AS product_attribute_shop ON (product_attribute_shop.product_attribute_id = product_attribute.product_attribute_id AND product_attribute_shop.shop_id = \" .(int)$shop_id .\")\";\n }else{\n $select .= \", 0 as product_attribute_id\";\n $leftJoin = \"\";\n }\n $query = $select . \" FROM \" . $from . $leftJoin . \" WHERE product.\" . $db->quoteName('product_id') . \" = \" . (int)$product_id;\n\n $db->setQuery($query);\n $results = $db->loadObjectList();\n\n foreach ($results as $row){\n $array_tmp = array(\n 'price' => $row->price, 'ecotax' => $row->ecotax,\n 'attribute_price' => (isset($row->attribute_price) ? $row->attribute_price : null)\n );\n\n self::$_pricesLevel2[$cache_id_2][(int)$row->product_attribute_id] = $array_tmp;\n\n if (isset($row->default_on) && $row->default_on == 1){\n self::$_pricesLevel2[$cache_id_2][0] = $array_tmp;\n }\n }\n }\n\n if (!isset(self::$_pricesLevel2[$cache_id_2][(int)$product_attribute_id])){\n return;\n }\n\n $result = self::$_pricesLevel2[$cache_id_2][(int)$product_attribute_id];\n\n if (!$specific_price || $specific_price->price < 0){\n $price = (float)$result['price'];\n }else{\n $price = (float)$specific_price->price;\n }\n\n // convert only if the specific price is in the default currency (id_currency = 0)\n if (!$specific_price || !($specific_price->price >= 0 && $specific_price->currency_id)){\n $price = JeproshopTools::convertPrice($price, $currency_id);\n }\n\n // Attribute price\n if (is_array($result) && (!$specific_price || !$specific_price->product_attribute_id || $specific_price->price < 0)){\n $attribute_price = JeproshopTools::convertPrice($result['attribute_price'] !== null ? (float)$result['attribute_price'] : 0, $currency_id);\n // If you want the default combination, please use NULL value instead\n if ($product_attribute_id !== false){\n $price += $attribute_price;\n }\n }\n\n // Tax\n $address->country_id = $country_id;\n $address->state_id = $state_id;\n $address->postcode = $zipcode;\n\n $tax_manager = JeproshopTaxManagerFactory::getManager($address, JeproshopProductModelProduct::getTaxRulesGroupIdByProductId((int)$product_id, $context));\n $product_tax_calculator = $tax_manager->getTaxCalculator();\n\n // Add Tax\n if ($use_tax){\n $price = $product_tax_calculator->addTaxes($price);\n }\n\n // Reduction\n $specific_price_reduction = 0;\n if (($only_reduction || $use_reduction) && $specific_price){\n if ($specific_price->reduction_type == 'amount'){\n $reduction_amount = $specific_price->reduction;\n\n if (!$specific_price->currency_id){\n $reduction_amount = JeproshopTools::convertPrice($reduction_amount, $currency_id);\n }\n $specific_price_reduction = !$use_tax ? $product_tax_calculator->removeTaxes($reduction_amount) : $reduction_amount;\n }else{\n $specific_price_reduction = $price * $specific_price->reduction;\n }\n }\n\n if ($use_reduction){\n $price -= $specific_price_reduction;\n }\n\n // Group reduction\n if($use_group_reduction){\n $reduction_from_category = JeproshopGroupReductionModelGroupReduction::getValueForProduct($product_id, $group_id);\n if ($reduction_from_category !== false){\n $group_reduction = $price * (float)$reduction_from_category;\n }else {\n // apply group reduction if there is no group reduction for this category\n $group_reduction = (($reduction = JeproshopGroupModelGroup::getReductionByGroupId($group_id)) != 0) ? ($price * $reduction / 100) : 0;\n }\n }else{\n $group_reduction = 0;\n }\n\n if ($only_reduction){\n return JeproshopTools::roundPrice($group_reduction + $specific_price_reduction, $decimals);\n }\n\n if ($use_reduction){ $price -= $group_reduction; }\n\n // Eco Tax\n if (($result['ecotax'] || isset($result['attribute_ecotax'])) && $with_ecotax){\n $ecotax = $result['ecotax'];\n if (isset($result['attribute_ecotax']) && $result['attribute_ecotax'] > 0){\n $ecotax = $result['attribute_ecotax'];\n }\n if ($currency_id){\n $ecotax = JeproshopTools::convertPrice($ecotax, $currency_id);\n }\n\n if ($use_tax){\n // reinit the tax manager for ecotax handling\n $tax_manager = JeproshopTaxManagerFactory::getManager($address, (int) JeproshopSettingModelSetting::getValue('ecotax_tax_rules_group_id'));\n $ecotax_tax_calculator = $tax_manager->getTaxCalculator();\n $price += $ecotax_tax_calculator->addTaxes($ecotax);\n }else{\n $price += $ecotax;\n }\n }\n $price = JeproshopTools::roundPrice($price, $decimals);\n if ($price < 0){\n $price = 0;\n }\n\n self::$_prices[$cache_id] = $price;\n return self::$_prices[$cache_id];\n }", "public function getCalculatedPrice($products, $quantityScale = 1) {\n return $this->getOSPrice($quantityScale, $products);\n }", "public function productsAction()\n {\n $this->_initCoursedoc();\n $this->loadLayout();\n $this->getLayout()->getBlock('coursedoc.edit.tab.product')\n ->setCoursedocProducts($this->getRequest()->getPost('coursedoc_products', null));\n $this->renderLayout();\n }", "public function Prices(){\n\t\treturn $this->hasMany('App\\ProductPrice','ID_Product');\n\t}", "function Sell() {\n\t\t//Send cusName, ID, single price, quantity and current date\n\t\t//Generate a recipte number\n\t\tdate_default_timezone_set('Australia/Melbourne');\n\t\t$date = date('y/m/d', time());\n\t\t$customerName = $_POST['custName'];\n\t\t\n\t\trequire_once(\"settings.php\");\n\t\t$conn = @mysqli_connect($host, $user, $pwd, $dbname);\n\t\t\n\t\t$query = \"INSERT INTO receipts (customerName, orderDate) VALUES\n\t\t('$customerName', '$date');\";\n\t\t\n\t\tmysqli_query($conn, $query);\n\t\t//echo \"<p>\", $query, \"</p>\";\n\t\t\n\t\t$query = \"SELECT receiptID FROM receipts\n\t\tORDER BY receiptID DESC LIMIT 1;\";\n\t\t\n\t\t$output = mysqli_query($conn, $query);\n\t\t$receiptID = mysqli_fetch_assoc($output)['receiptID'];\n\t\t//echo \"<p>\", $query, \"</p>\";\n\t\t\n\t\tfor ($i = 0; $i < $_POST['txtLength'] + 0; $i++) {\n\t\t\t//echo \"<p>\", $i, \"</p>\";\n\t\t\t$id = $_POST[\"id_\" . $i];\n\t\t\t$quantity = $_POST['quantity_' . $i];\n\t\t\t$price = $_POST['price_' . $i];\n\t\t\t\n\t\t\t$query = \"INSERT INTO purchases (receiptID, itemID, quantity, price) VALUES\n\t\t\t($receiptID, $id, $quantity, $price);\";\n\t\t\t\n\t\t\tmysqli_query($conn, $query);\n\t\t\t\n\t\t\t//echo \"<p>\", $query, \"</p>\";\n\t\t}\n\t\t//Commit changes\n\t\tmysqli_query($conn, 'COMMIT;');\n\t\t\n\t\t//echo \"<p>Finish commit</p>\";\n\t}", "public function setPricecomparisonProductView(Varien_Event_Observer $observer)\n\t{\n\t\t$helper = Mage::helper('pricecomparison');\n\t\t$product = $observer->getEvent()->getProduct();\n\t\t$productId = $product->getId();\n\t\t$cookieKey = $helper->getCookieKey();\n\t\t\n\t\t$pcsCookie = Mage::getModel('core/cookie')->get($cookieKey);\n\t\t$pcsId = Mage::app()->getRequest()->getParam('pcs', false);\n\t\t\n\t\tif ($pcsId) {\n\t\t\t$helper->captureReferral($pcsId, $productId, $cookieKey);\n\t\t\t\n\t\t\tif ($pcsPrice = $product->getData($pcsId)) {\n\t\t\t\t$product->setFinalPrice($pcsPrice);\n\t\t\t}\n\t\t}\n\t\telse if ($pcsCookie) {\n\t\t\t$cookieData = explode('|', $pcsCookie);\n\t\t\t$pcsId = $cookieData[0];\n\t\t\t$pcsProductId = $cookieData[1];\n\t\t\t\n\t\t\tif ($pcsProductId !== $productId) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tif ($pcsPrice = $product->getData($pcsId)) {\n\t\t\t\t$product->setFinalPrice($pcsPrice);\n\t\t\t}\n\t\t}\n\t}", "public function reindexProductsStandalone($productIds = null)\n {\n $readAdapter = $this->_getReadAdapter();\n $writeAdapter = $this->_getWriteAdapter();\n $selectConfig = $readAdapter->select();\n\n //columns expression\n $colCtlgCtgrView = $this->_getConfigGrantDbExpr('grant_catalog_category_view', 'permission_index_product');\n $colCtlgPrdctPrc = $this->_getConfigGrantDbExpr('grant_catalog_product_price', 'permission_index_product');\n $colChcktItms = $this->_getConfigGrantDbExpr('grant_checkout_items', 'permission_index_product');\n\n // Config depend index select\n $selectConfig\n ->from(\n array('category_product_index' => $this->getTable('catalog/category_product_index')),\n array())\n ->join(\n array('permission_index_product'=>$this->getTable('permission_index_product')),\n 'permission_index_product.product_id = category_product_index.product_id'\n . ' AND permission_index_product.store_id = category_product_index.store_id'\n . ' AND permission_index_product.is_config = 0',\n array('product_id', 'store_id'))\n ->joinLeft(\n array('permission_idx_product_exists'=>$this->getTable('permission_index_product')),\n 'permission_idx_product_exists.product_id = permission_index_product.product_id'\n . ' AND permission_idx_product_exists.store_id = permission_index_product.store_id'\n . ' AND permission_idx_product_exists.customer_group_id=permission_index_product.customer_group_id'\n . ' AND permission_idx_product_exists.category_id = category_product_index.category_id',\n array())\n ->columns('category_id')\n ->columns(array(\n 'customer_group_id',\n 'grant_catalog_category_view' => $colCtlgCtgrView,\n 'grant_catalog_product_price' => $colCtlgPrdctPrc,\n 'grant_checkout_items' => $colChcktItms,\n 'is_config' => new Zend_Db_Expr('1')),\n 'permission_index_product')\n ->group(array(\n 'category_product_index.category_id',\n 'permission_index_product.product_id',\n 'permission_index_product.store_id',\n 'permission_index_product.customer_group_id'))\n ->where('permission_idx_product_exists.category_id IS NULL');\n\n\n $exprCatalogCategoryView = $readAdapter->getCheckSql(\n $readAdapter->quoteInto(\n 'permission_index_product.grant_catalog_category_view = ?',\n Enterprise_CatalogPermissions_Model_Permission::PERMISSION_PARENT),\n 'NULL',\n 'permission_index_product.grant_catalog_category_view');\n\n\n $exprCatalogProductPrice = $readAdapter->getCheckSql(\n $readAdapter->quoteInto(\n 'permission_index_product.grant_catalog_product_price = ?',\n Enterprise_CatalogPermissions_Model_Permission::PERMISSION_PARENT),\n 'NULL',\n 'permission_index_product.grant_catalog_product_price');\n\n $exprCheckoutItems = $readAdapter->getCheckSql(\n $readAdapter->quoteInto(\n 'permission_index_product.grant_checkout_items = ?',\n Enterprise_CatalogPermissions_Model_Permission::PERMISSION_PARENT),\n 'NULL',\n 'permission_index_product.grant_checkout_items');\n\n // Select for standalone product index\n $selectStandalone = $readAdapter->select();\n $selectStandalone\n ->from(array('permission_index_product'=>$this->getTable('permission_index_product')),\n array(\n 'product_id',\n 'store_id'\n )\n )->columns(\n array(\n 'category_id' => new Zend_Db_Expr('NULL'),\n 'customer_group_id',\n 'grant_catalog_category_view' => 'MAX(' . $exprCatalogCategoryView . ')',\n 'grant_catalog_product_price' => 'MAX(' . $exprCatalogProductPrice . ')',\n 'grant_checkout_items' => 'MAX(' . $exprCheckoutItems . ')',\n 'is_config' => new Zend_Db_Expr('1')\n ),\n 'permission_index_product'\n )->group(array(\n 'permission_index_product.store_id',\n 'permission_index_product.product_id',\n 'permission_index_product.customer_group_id'\n ));\n\n $condition = array('is_config = 1');\n\n\n\n if ($productIds !== null && !empty($productIds)) {\n if (!is_array($productIds)) {\n $productIds = array($productIds);\n }\n $selectConfig->where('category_product_index.product_id IN(?)', $productIds);\n $selectStandalone->where('permission_index_product.product_id IN(?)', $productIds);\n $condition['product_id IN(?)'] = $productIds;\n }\n\n $fields = array(\n 'product_id', 'store_id', 'category_id', 'customer_group_id',\n 'grant_catalog_category_view', 'grant_catalog_product_price',\n 'grant_checkout_items', 'is_config'\n );\n\n $writeAdapter->delete($this->getTable('permission_index_product'), $condition);\n $writeAdapter->query($selectConfig->insertFromSelect($this->getTable('permission_index_product'), $fields));\n $writeAdapter->query($selectStandalone->insertFromSelect($this->getTable('permission_index_product'), $fields));\n // Fix inherited permissions\n $deny = (int) Enterprise_CatalogPermissions_Model_Permission::PERMISSION_DENY;\n\n $data = array(\n 'grant_catalog_product_price' => $readAdapter->getCheckSql(\n $readAdapter->quoteInto('grant_catalog_category_view = ?', $deny),\n $deny,\n 'grant_catalog_product_price'\n ),\n 'grant_checkout_items' => $readAdapter->getCheckSql(\n $readAdapter->quoteInto('grant_catalog_category_view = ?', $deny)\n . ' OR ' . $readAdapter->quoteInto('grant_catalog_product_price = ?', $deny),\n $deny,\n 'grant_checkout_items'\n )\n );\n $writeAdapter->update($this->getTable('permission_index_product'), $data, $condition);\n\n return $this;\n }", "public function getCrossSellProductCollection()\n {\n $collection = $this->getLinkInstance()->useCrossSellLinks()\n ->getProductCollection()\n ->setIsStrongMode();\n $collection->setProduct($this);\n return $collection;\n }", "public function setBestPrice($product_id) {\n $query = \"SELECT * FROM wp_pwgb_postmeta WHERE post_id=:product_id;\";\n $stm = $this->db->prepare($query);\n $stm->bindValue(\":product_id\", $product_id, PDO::PARAM_INT);\n $stm->execute();\n\n $response = $stm->fetchAll(PDO::FETCH_ASSOC);\n $tag_prices = $this->productPrice();\n $theBest = ['price' => 0];\n $otherPrices = [];\n $hasChanged = false;\n\n // Obtiene el mejor precio anterior\n foreach ($response as $metadata) {\n // Mejor precio\n if (isset($metadata['meta_key']) && $metadata['meta_key'] == 'price_best') {\n $theBest['price'] = $metadata['meta_value'];\n }\n\n // Mejor tienda\n if (isset($metadata['meta_key']) && $metadata['meta_key'] == 'best_shop') {\n $theBest['shop'] = $metadata['meta_value'];\n }\n\n // Obtiene el precio de otras tiendas\n foreach ($tag_prices as $price) {\n if (isset($metadata['meta_key']) && $metadata['meta_key'] == $price) {\n $otherPrices[$price] = (int) $metadata['meta_value'];\n }\n }\n }\n\n $oldPrice = $theBest['price'];\n // Obtiene el nuevo mejor precio\n foreach ($otherPrices as $store => $price) {\n if (($price > 0) && ($price < $theBest['price'])) {\n $theBest['price'] = $price;\n $theBest['shop'] = $store;\n $hasChanged = true;\n }\n }\n\n // Si el mejor precio cambio, lo actualiza y lo guarda en el historial\n if ($hasChanged) {\n $query = \"INSERT INTO dw_historial (product_id, price_old, price_new, created_at) VALUES \n (:product_id, :price_old, :price_new, NOW());\";\n $stm2 = $this->db->prepare($query);\n $stm2->bindValue(\":product_id\", $product_id, PDO::PARAM_INT);\n $stm2->bindValue(\":price_old\", $oldPrice, PDO::PARAM_INT);\n $stm2->bindValue(\":price_new\", $theBest['price'], PDO::PARAM_INT);\n $stm2->execute();\n\n $query = \"UPDATE wp_pwgb_postmeta SET meta_value=:price_new WHERE post_id=:product_id AND meta_key='price_best';\";\n $stm3 = $this->db->prepare($query);\n $stm3->bindValue(\":product_id\", $product_id, PDO::PARAM_INT);\n $stm3->bindValue(\":price_new\", $theBest['price'], PDO::PARAM_INT);\n $stm3->execute();\n\n $query = \"UPDATE wp_pwgb_postmeta SET meta_value=:best_shop WHERE post_id=:product_id AND meta_key='best_shop';\";\n $stm4 = $this->db->prepare($query);\n $stm4->bindValue(\":product_id\", $product_id, PDO::PARAM_INT);\n $stm4->bindValue(\":best_shop\", $theBest['shop'], PDO::PARAM_STR);\n $stm4->execute();\n }\n }", "public function hookActionUpdateQuantity($params)\n {\n if ($this->CheckModuleInstaled('mailalerts') && Configuration::get('DESCOMSMS_CHECK_PRODUCT_STOCK') == 'on') {\n //Avoid entering 2 times in the hook when modifying product with combinations stock\n if (!$params['id_product_attribute']) {\n $sql = 'SELECT count(*) FROM '._DB_PREFIX_.'product_attribute where id_product = '.$params['id_product'];\n if ($this->db->getValue($sql)) {\n return false;\n }\n }\n\n $sql = 'SELECT * FROM '._DB_PREFIX_.'mailalert_customer_oos WHERE id_product = '.$params['id_product'].' AND id_product_attribute = '.$params['id_product_attribute'];\n $results = $this->db->ExecuteS($sql);\n\n foreach ($results as $row) {\n $sql = 'SELECT id_address FROM '._DB_PREFIX_.'address WHERE id_customer = '.$row['id_customer'];\n $addresses = $this->db->ExecuteS($sql);\n $sended = false;\n foreach ($addresses as $address) {\n if (!$sended || Configuration::get('DESCOMSMS_CHECK_PRODUCT_STOCK_ALL_ADDRESSES') == 'on') {\n $address = new Address($address['id_address']);\n $country = new Country($address->id_country);\n if (!empty($this->GetPhoneMobile($address, $country))) {\n $sql = 'SELECT name FROM '._DB_PREFIX_.'product_lang pl, '._DB_PREFIX_.'customer c WHERE pl.id_lang = c.id_lang AND pl.id_product = '.$params['id_product'].' AND c.id_customer = '.$row['id_customer'];\n $name = $this->db->getValue($sql);\n\n $data = [\n 'user' => Configuration::get('DESCOMSMS_USER'),\n 'pass' => $this->MyDecrypt(Configuration::get('DESCOMSMS_PASS'), Configuration::get('DESCOMSMS_KEY')),\n 'sender' => Configuration::get('DESCOMSMS_SENDER'),\n 'message' => $this->GetSMSText(Configuration::get('DESCOMSMS_TEXT_PRODUCT_STOCK'), '', $name, $params['quantity']),\n ];\n $data['mobile'] = $this->GetPhoneMobile($address, $country);\n\n $result = $this->SendSMS($data);\n $sended = true;\n //error_log(json_encode($result)); //TODO\n }\n }\n }\n }\n }\n }", "public function setProductIDs($productIDs)\n {\n $parameters = $this->request->getParameters();\n $parameters['id'] = $productIDs;\n $this->recommendationsUpToDate = false;\n }", "public function editDeleteRelatedUpSellCrossSellProductsProvider(): array\n {\n return [\n 'update' => [\n 'data' => [\n 'defaultLinks' => $this->defaultDataFixture,\n 'productLinks' => $this->existingProducts,\n ],\n ],\n 'delete' => [\n 'data' => [\n 'defaultLinks' => $this->defaultDataFixture,\n 'productLinks' => []\n ],\n ],\n 'same' => [\n 'data' => [\n 'defaultLinks' => $this->existingProducts,\n 'productLinks' => $this->existingProducts,\n ],\n ],\n 'change_position' => [\n 'data' => [\n 'defaultLinks' => $this->existingProducts,\n 'productLinks' => array_replace_recursive(\n $this->existingProducts,\n [\n ['position' => 4],\n ['position' => 5],\n ['position' => 6],\n ]\n ),\n ],\n ],\n 'without_position' => [\n 'data' => [\n 'defaultLinks' => $this->defaultDataFixture,\n 'productLinks' => array_replace_recursive(\n $this->existingProducts,\n [\n ['position' => null],\n ['position' => null],\n ['position' => null],\n ]\n ),\n 'expectedProductLinks' => array_replace_recursive(\n $this->existingProducts,\n [\n ['position' => 1],\n ['position' => 2],\n ['position' => 3],\n ]\n ),\n ],\n ],\n ];\n }", "private function mapPrices(ProductInterface $magentoProduct, SkyLinkProduct $skyLinkProduct)\n {\n $magentoProduct->setPrice($skyLinkProduct->getPricingStructure()->getRegularPrice()->toNative());\n\n $magentoProduct->unsetData('special_price');\n $magentoProduct->unsetData('special_from_date');\n $magentoProduct->unsetData('special_to_date');\n\n if (false === $skyLinkProduct->getPricingStructure()->hasSpecialPrice()) {\n $this->removeSpecialPrices($magentoProduct);\n return;\n }\n\n $skyLinkSpecialPrice = $skyLinkProduct->getPricingStructure()->getSpecialPrice();\n\n // If the end date is before now, we do not need to put a new special price on at all, as\n // it cannot end in the past. In fact, Magento will let you save it, but won't let\n // subsequent saves from the admin interface occur.\n $now = new DateTimeImmutable();\n if ($skyLinkSpecialPrice->hasEndDate() && $skyLinkSpecialPrice->getEndDate() < $now) {\n $this->removeSpecialPrices($magentoProduct);\n return;\n }\n\n $magentoProduct->setCustomAttribute('special_price', $skyLinkSpecialPrice->getPrice()->toNative());\n\n // If there's a start date at least now or in the future, we'll use that...\n if ($skyLinkSpecialPrice->hasStartDate() && $skyLinkSpecialPrice->getStartDate() >= $now) {\n $magentoProduct->setCustomAttribute(\n 'special_from_date',\n $this->dateTimeToLocalisedAttributeValue($skyLinkSpecialPrice->getStartDate())\n );\n\n // Otherwise, we'll use a start date from now\n } else {\n $magentoProduct->setCustomAttribute('special_from_date', $this->dateTimeToLocalisedAttributeValue($now));\n }\n\n // If there's an end date, we'll just use that\n if ($skyLinkSpecialPrice->hasEndDate()) {\n $magentoProduct->setCustomAttribute(\n 'special_to_date',\n $this->dateTimeToLocalisedAttributeValue($skyLinkSpecialPrice->getEndDate())\n );\n\n // Otherwise, it's indefinite\n } else {\n $distantFuture = new DateTimeImmutable('2099-01-01');\n $magentoProduct->setCustomAttribute('special_to_date', $this->dateTimeToLocalisedAttributeValue($distantFuture));\n }\n }", "public function addCommentLine( $product_id = null, $combination_id = null, $quantity = 1.0, $params = [] )\n {\n // Do the Mambo!\n $line_type = array_key_exists('line_type', $params) \n ? $params['line_type'] \n : 'comment';\n\n // Customer\n $customer = $this->customer;\n $salesrep = $customer->salesrep;\n \n // Currency\n $currency = $this->document_currency;\n\n // Product\n // Consider \"not coded products\" only\n\n $reference = array_key_exists('reference', $params) \n ? $params['reference'] \n : '';\n\n $name = array_key_exists('name', $params) \n ? $params['name'] \n : $line_type;\n\n $cost_price = array_key_exists('cost_price', $params) \n ? $params['cost_price'] \n : 0.0;\n\n // Tax\n $tax_id = array_key_exists('tax_id', $params) \n ? $params['tax_id'] \n : Configuration::get('DEF_TAX');\n $tax = Tax::findOrFail($tax_id);\n $taxing_address = $this->taxingaddress;\n $tax_percent = $tax->getTaxPercent( $taxing_address );\n\n $sales_equalization = array_key_exists('sales_equalization', $params) \n ? $params['sales_equalization'] \n : 0;\n\n // Price Policy\n $pricetaxPolicy = array_key_exists('prices_entered_with_tax', $params) \n ? $params['prices_entered_with_tax'] \n : Configuration::get('PRICES_ENTERED_WITH_TAX');\n\n // Service Price\n $price = new Price($params['unit_customer_final_price'], $pricetaxPolicy, $currency);\n $price->applyTaxPercent( $tax_percent );\n// if ( $price->currency->id != $currency->id ) {\n// $price = $price->convert( $currency );\n// }\n $unit_price = $price->getPrice();\n\n // Calculate price per $customer_id now!\n // $customer_price = $product->getPriceByCustomer( $customer, $quantity, $currency );\n $customer_price = clone $price;\n\n // Is there a Price for this Customer?\n if (!$customer_price) return null; // Product not allowed for this Customer\n\n // $customer_price->applyTaxPercent( $tax_percent );\n $unit_customer_price = $customer_price->getPrice();\n\n // Customer Final Price\n if ( array_key_exists('prices_entered_with_tax', $params) && array_key_exists('unit_customer_final_price', $params) )\n {\n $unit_customer_final_price = new Price( $params['unit_customer_final_price'], $pricetaxPolicy, $currency );\n\n $unit_customer_final_price->applyTaxPercent( $tax_percent );\n\n } else {\n\n $unit_customer_final_price = clone $customer_price;\n }\n\n // Discount\n $discount_percent = array_key_exists('discount_percent', $params) \n ? $params['discount_percent'] \n : 0.0;\n\n // Final Price\n $unit_final_price = clone $unit_customer_final_price;\n if ( $discount_percent ) \n $unit_final_price->applyDiscountPercent( $discount_percent );\n\n // Sales Rep\n $sales_rep_id = array_key_exists('sales_rep_id', $params) \n ? $params['sales_rep_id'] \n : optional($salesrep)->id;\n \n $commission_percent = array_key_exists('sales_rep_id', $params) && array_key_exists('commission_percent', $params) \n ? $params['commission_percent'] \n : 0.0;\n\n\n\n // Misc\n $measure_unit_id = array_key_exists('measure_unit_id', $params) \n ? $params['measure_unit_id'] \n : Configuration::get('DEF_MEASURE_UNIT_FOR_PRODUCTS');\n\n $line_sort_order = array_key_exists('line_sort_order', $params) \n ? $params['line_sort_order'] \n : $this->getMaxLineSortOrder() + 10;\n\n $notes = array_key_exists('notes', $params) \n ? $params['notes'] \n : '';\n\n\n // Build OrderLine Object\n $data = [\n 'line_sort_order' => $line_sort_order,\n 'line_type' => $line_type,\n 'product_id' => $product_id,\n 'combination_id' => $combination_id,\n 'reference' => $reference,\n 'name' => $name,\n 'quantity' => $quantity,\n 'measure_unit_id' => $measure_unit_id,\n\n 'prices_entered_with_tax' => $pricetaxPolicy,\n \n 'cost_price' => $cost_price,\n 'unit_price' => $unit_price,\n 'unit_customer_price' => $unit_customer_price,\n 'unit_customer_final_price' => $unit_customer_final_price->getPrice(),\n 'unit_customer_final_price_tax_inc' => $unit_customer_final_price->getPriceWithTax(),\n 'unit_final_price' => $unit_final_price->getPrice(),\n 'unit_final_price_tax_inc' => $unit_final_price->getPriceWithTax(), \n 'sales_equalization' => $sales_equalization,\n 'discount_percent' => $discount_percent,\n 'discount_amount_tax_incl' => 0.0, // floatval( $request->input('discount_amount_tax_incl', 0.0) ),\n 'discount_amount_tax_excl' => 0.0, // floatval( $request->input('discount_amount_tax_excl', 0.0) ),\n\n 'total_tax_incl' => $quantity * $unit_final_price->getPriceWithTax(),\n 'total_tax_excl' => $quantity * $unit_final_price->getPrice(),\n\n 'tax_percent' => $tax_percent,\n 'commission_percent' => $commission_percent,\n 'notes' => $notes,\n 'locked' => 0,\n \n // 'customer_order_id',\n 'tax_id' => $tax->id,\n 'sales_rep_id' => $sales_rep_id,\n ];\n\n\n // Finishing touches\n $lineClass = $this->getClassName().'Line';\n $document_line = ( new $lineClass() )->create( $data );\n\n $this->lines()->save($document_line);\n\n\n // Good boy, bye then\n return $document_line;\n }", "public function get_RP_WCDPD( $field_price = NULL, $product, $cart_item_key = NULL, $force = FALSE ) {\n\t\t$price = NULL;\n\n\t\tif ( $this->is_elex_dpd_enabled() ) {\n\n\t\t\tif ( $field_price !== NULL && $cart_item_key !== NULL ) {\n\t\t\t\treturn $this->get_RP_WCDPD_single( $field_price, $cart_item_key, NULL, $force );\n\t\t\t}\n\n\t\t\t$product_rules = FALSE;\n\n\t\t\t$objRulesValidator = new Elex_dp_RulesValidator( 'all_match', TRUE, 'product_rules' );\n\n\t\t\t$price = array();\n\n\t\t\t$all_rules = array();\n\t\t\tif ( ! $product->is_type( 'variable' ) && ! $product->is_type( 'variation' ) ) {\n\n\t\t\t\t$price['is_multiprice'] = FALSE;\n\n\t\t\t\t$product_rules = $objRulesValidator->elex_dp_getValidRulesForProduct( $product );\n\n\t\t\t\tif ( ! $product_rules ) {\n\t\t\t\t\t$product_rules = array();\n\t\t\t\t}\n\t\t\t\t$all_rules = array();\n\t\t\t\tforeach ( $product_rules as $k => $rule ) {\n\t\t\t\t\t$all_rules[] = array(\n\t\t\t\t\t\t'product' => $product,\n\t\t\t\t\t\t'rule' => $rule,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tif ( $product->is_type( 'variation' ) ) {\n\t\t\t\t\t$product = wc_get_product( $product->get_parent_id() );//no support for WC<3x\n\t\t\t\t}\n\n\t\t\t\t$variation_rules = array();\n\t\t\t\tforeach ( $product->get_available_variations() as $variation_data ) {\n\t\t\t\t\t$variation = wc_get_product( $variation_data['variation_id'] );\n\n\t\t\t\t\t$product_rules = $objRulesValidator->elex_dp_getValidRulesForProduct( $variation );\n\n\t\t\t\t\tif ( ! $product_rules ) {\n\t\t\t\t\t\t$product_rules = array();\n\t\t\t\t\t}\n\t\t\t\t\tforeach ( $product_rules as $k => $rule ) {\n\t\t\t\t\t\t$variation_rules[ $variation_data['variation_id'] ][] = array(\n\t\t\t\t\t\t\t'product' => $variation,\n\t\t\t\t\t\t\t'rule' => $rule,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t$all_rules = $variation_rules;\n\t\t\t\t$price['is_multiprice'] = TRUE;\n\t\t\t}\n\n\t\t\t$table_data = array();\n\t\t\tif ( ! $price['is_multiprice'] ) {\n\t\t\t\tforeach ( $all_rules as $single ) {\n\t\t\t\t\t$_product = $single['product'];\n\t\t\t\t\t$_rule = $single['rule'];\n\t\t\t\t\tif ( ! $_rule ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( isset( $_rule['discount_type'] ) && isset( $_rule['value'] ) ) {\n\t\t\t\t\t\tswitch ( $_rule['discount_type'] ) {\n\t\t\t\t\t\t\tcase 'Percent Discount':\n\t\t\t\t\t\t\t\t$_rule['discount_type'] = 'percentage';\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'Flat Discount':\n\t\t\t\t\t\t\t\t$_rule['discount_type'] = 'price';\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'Fixed Price':\n\t\t\t\t\t\t\t\t$_rule['discount_type'] = 'fixed';\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t# code...\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$table_data[] = array(\n\t\t\t\t\t\t\t'min' => $_rule['min'],\n\t\t\t\t\t\t\t'max' => $_rule['max'] !== NULL ? $_rule['max'] : '',\n\t\t\t\t\t\t\t'type' => $_rule['discount_type'],\n\t\t\t\t\t\t\t'value' => $_rule['value'],\n\t\t\t\t\t\t\t'conditions' => array(),\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tforeach ( $all_rules as $vid => $vidsingle ) {\n\n\t\t\t\t\tforeach ( $vidsingle as $single ) {\n\n\t\t\t\t\t\t$_product = $single['product'];\n\t\t\t\t\t\t$_rule = $single['rule'];\n\t\t\t\t\t\tif ( ! $_rule ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( isset( $_rule['discount_type'] ) && isset( $_rule['value'] ) ) {\n\t\t\t\t\t\t\tswitch ( $_rule['discount_type'] ) {\n\t\t\t\t\t\t\t\tcase 'Percent Discount':\n\t\t\t\t\t\t\t\t\t$_rule['discount_type'] = 'percentage';\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'Flat Discount':\n\t\t\t\t\t\t\t\t\t$_rule['discount_type'] = 'price';\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'Fixed Price':\n\t\t\t\t\t\t\t\t\t$_rule['discount_type'] = 'fixed';\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t# code...\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$table_data[ $vid ][] = array(\n\t\t\t\t\t\t\t\t'min' => $_rule['min'],\n\t\t\t\t\t\t\t\t'max' => $_rule['max'] !== NULL ? $_rule['max'] : '',\n\t\t\t\t\t\t\t\t'type' => $_rule['discount_type'],\n\t\t\t\t\t\t\t\t'value' => $_rule['value'],\n\t\t\t\t\t\t\t\t'conditions' => array(),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$price['rules'] = $table_data;\n\n\t\t}\n\t\tif ( $field_price !== NULL ) {\n\t\t\t$price = $field_price;\n\t\t}\n\n\t\treturn $price;\n\t}", "public function run()\n {\n DB::table('product_prices')->insert([\n 'product_id' => 1,\n 'description' => 'single',\n 'price' => 100.00\n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 2,\n 'description' => 'single', \n 'price' => 200.00 \n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 3,\n 'description' => 'single', \n 'price' => 300.00 \n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 4,\n 'description' => 'single',\n 'price' => 400.00 \n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 5,\n 'description' => 'single',\n 'price' => 500.00\n ]);\n DB::table('product_prices')->insert([\n 'product_id' => 6,\n 'description' => 'single',\n 'price' => 600.00\n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 7,\n 'description' => 'single',\n 'price' => 700.00\n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 8,\n 'description' => 'single',\n 'price' => 800.00\n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 9,\n 'description' => 'single',\n 'price' => 9000.00\n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 1,\n 'description' => 'bundle (10 pcs)',\n 'price' => 1000.00\n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 2,\n 'description' => 'bundle (10 pcs)', \n 'price' => 2000.00 \n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 3,\n 'description' => 'bundle (10 pcs)', \n 'price' => 3000.00 \n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 4,\n 'description' => 'bundle (10 pcs)',\n 'price' => 4000.00 \n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 5,\n 'description' => 'bundle (10 pcs)',\n 'price' => 5000.00\n ]);\n DB::table('product_prices')->insert([\n 'product_id' => 6,\n 'description' => 'bundle (10 pcs)',\n 'price' => 6000.00\n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 7,\n 'description' => 'bundle (10 pcs)',\n 'price' => 7000.00\n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 8,\n 'description' => 'bundle (10 pcs)',\n 'price' => 8000.00\n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 9,\n 'description' => 'bundle (10 pcs)',\n 'price' => 9000.00\n ]);\n }", "public function prepareData($collection, $productIds)\n {\n $productCollection = clone $collection;\n $productCollection->addAttributeToFilter('entity_id', ['in' => $productIds]);\n while ($product = $productCollection->fetchItem()) {\n $variations = [];\n $collectionAttr = $this->getWeeAttributeCollection();\n if ($collectionAttr->getSize() > 0) {\n foreach ($collectionAttr as $item) {\n $item->setScopeGlobal(1);\n $tax = $this->getDataTax($product, $item);\n if (!empty($tax)) {\n foreach ($tax as $element) {\n $str = 'name=' . $item->getAttributeCode()\n . Import::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR .\n 'country=' . $element['country']\n . Import::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR .\n 'state=' . $element['state']\n . Import::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR .\n 'value=' . $element['value'];\n if (isset($element['website_id'])) {\n $str .= Import::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR .\n 'website_id=' . $element['website_id'];\n }\n $variations[] = $str;\n }\n }\n }\n }\n $result = '';\n if (!empty($variations)) {\n $result = [\n self::WEE_TAX_VARIATIONS_COLUMN => implode(\n ImportProduct::PSEUDO_MULTI_LINE_SEPARATOR,\n $variations\n )\n ];\n }\n $this->weeTaxData[$product->getId()] = $result;\n }\n }", "public function api_update_price(){\n $watchlists = $this->wr->all();\n foreach($watchlists as $watchlist)\n {\n $current_price = $this->get_quotes($watchlist->id);\n\n $this->wr->update([\n 'current_price' => $current_price,\n ],$watchlist->id);\n }\n }", "public function rentalPrice($values)\n {\n return $this->range_filter('rental_price', $values);\n }", "public function updatePrices($contractId, $priceList);", "public function releaseRefPointsOnEveryShoping()\n {\n \t//More you pay less you release.\n \t//Get the points for other shops.\n }", "public function products()\n {\n //$products = $api->getAllProducts();\n //var_dump($products);\n // TODO save products to database\n }", "public function prices()\n {\n return $this\n ->belongsToMany(PricingGroup::class, PriceListItem::getTableName(), 'item_unit_id', 'pricing_group_id')\n ->withPivot(['price', 'discount_value', 'discount_percent', 'date', 'pricing_group_id']);\n }", "public function allProducts()\r\n {\r\n // left join mshop_product_list as mpl on mpl.parentid = mp.id \r\n // left join mshop_media as mm on mm.id = mpl.refid\r\n // left JOIN mshop_price as mpri on mpri.id = mpl.refid\r\n // where mpl.pos = 0 and mpl.domain in ('media','price')\";\r\n $qry1 = \"select mp.id as product_id, mp.code as product_code, mp.label as product_name, mm.preview as image_url from mshop_product as mp \r\n left join mshop_product_list as mpl on mpl.parentid = mp.id \r\n left join mshop_media as mm on mm.id = mpl.refid\r\n where mpl.pos = 0 and mpl.domain in ('media')\";\r\n $qry2 = \"select mp.id as product_id, mp.label as product_name, mpri.value as product_price from mshop_product as mp \r\n left join mshop_product_list as mpl on mpl.parentid = mp.id \r\n left JOIN mshop_price as mpri on mpri.id = mpl.refid\r\n where mpl.pos = 0 and mpl.domain in ('price')\";\r\n $products1 = DB::select($qry1);\r\n $products2 = DB::select($qry2); \r\n $i = 0;\r\n foreach($products1 as $products) {\r\n foreach($products2 as $product) {\r\n if($product->product_id === $products->product_id) {\r\n $products1[$i]->product_price = $product->product_price;\r\n }\r\n }\r\n $i++;\r\n }\r\n return $products1;\r\n }", "function updatePriceLevel($siteDb)\n{\n global $db, $conf;\n\n if (!empty($conf->global->PRODUIT_MULTIPRICES) && $siteDb->price_level > 0 && $siteDb->price_level <= intval($conf->global->PRODUIT_MULTIPRICES_LIMIT)) {\n $sql = 'SELECT p.rowid';\n $sql.= ' FROM ' . MAIN_DB_PREFIX . 'product as p';\n $sql.= ' LEFT JOIN ' . MAIN_DB_PREFIX . \"categorie_product as cp ON p.rowid = cp.fk_product\";\n $sql.= ' WHERE p.entity IN (' . getEntity('product', 1) . ')';\n $sql.= ' AND cp.fk_categorie = ' . $siteDb->fk_cat_product;\n $sql.= ' GROUP BY p.rowid';\n\n $db->begin();\n\n dol_syslog(\"updatePriceLevel sql=\" . $sql);\n $resql = $db->query($sql);\n if ($resql) {\n $product = new Product($db);\n $eCommerceProduct = new eCommerceProduct($db);\n\n while ($obj = $db->fetch_object($resql)) {\n $product->fetch($obj->rowid);\n $eCommerceProduct->fetchByProductId($obj->rowid, $siteDb->id);\n\n if ($eCommerceProduct->remote_id > 0) {\n $eCommerceSynchro = new eCommerceSynchro($db, $siteDb);\n $eCommerceSynchro->connect();\n if (count($eCommerceSynchro->errors)) {\n dol_syslog(\"updatePriceLevel eCommerceSynchro->connect() \".$eCommerceSynchro->error, LOG_ERR);\n setEventMessages($eCommerceSynchro->error, $eCommerceSynchro->errors, 'errors');\n\n $db->rollback();\n return -1;\n }\n\n $product->price = $product->multiprices[$siteDb->price_level];\n\n $result = $eCommerceSynchro->eCommerceRemoteAccess->updateRemoteProduct($eCommerceProduct->remote_id, $product);\n if (!$result) {\n dol_syslog(\"updatePriceLevel eCommerceSynchro->eCommerceRemoteAccess->updateRemoteProduct() \".$eCommerceSynchro->eCommerceRemoteAccess->error, LOG_ERR);\n setEventMessages($eCommerceSynchro->eCommerceRemoteAccess->error, $eCommerceSynchro->eCommerceRemoteAccess->errors, 'errors');\n\n $db->rollback();\n return -2;\n }\n } else {\n dol_syslog(\"updatePriceLevel Product with id \" . $product->id . \" is not linked to an ecommerce record but has category flag to push on eCommerce. So we push it\");\n // TODO\n //$result = $eCommerceSynchro->eCommerceRemoteAccess->updateRemoteProduct($eCommerceProduct->remote_id);\n }\n }\n }\n\n $db->commit();\n }\n\n return 1;\n}", "public function updateProductStyleOptionPricingAll(){\n\t\t$all_products = $this->getAll();\n\t\t$this->load->model('catalog/product');\n\t\t$this->load->model('tshirtgang/pricing');\n\t\t$this->load->model('catalog/option');\n\t\t$tshirt_option_names = array('Tshirt Color', 'Tshirt Style', 'Tshirt Size');\n\t\t$tshirt_colored = array(\n\t\t\t\"Black\",\n\t\t\t\"Charcoal Grey\",\n\t\t\t\"Daisy\",\n\t\t\t\"Dark Chocolate\",\n\t\t\t\"Forest Green\",\n\t\t\t\"Gold\",\n\t\t\t\"Irish Green\",\n\t\t\t\"Light Blue\",\n\t\t\t\"Light Pink\",\n\t\t\t\"Military Green\",\n\t\t\t\"Navy\",\n\t\t\t\"Orange\",\n\t\t\t\"Purple\",\n\t\t\t\"Red\",\n\t\t\t\"Royal Blue\",\n\t\t\t\"Sport Grey\",\n\t\t\t\"Tan\",\n\t\t\t\"Burgundy\"\n\t\t);\n\t\t$tshirt_ringer = array(\n\t\t\t\"Navy Ringer\",\n\t\t\t\"Black Ringer\",\n\t\t\t\"Red Ringer\"\n\t\t);\n\t\t$tshirt_options = array();\n\t\t$tshirt_options_price = array();\n\t\t$options = $this->model_catalog_option->getOptions();\n\t\t$temp_price = 0.0;\n\t\tforeach($options as $option){\n\t\t\t//if($option['name'] == 'Tshirt Color'){\n\t\t\t//\t$tshirtcolor_option_id = $option['option_id'];\n\t\t\t//}\n\t\t\t//if($option['name'] == 'Tshirt Style'){\n\t\t\t//\t$tshirtstyle_option_id = $option['option_id'];\n\t\t\t//}\n\t\t\t//if($option['name'] == 'Tshirt Size'){\n\t\t\t//\t$tshirtsize_option_id = $option['option_id'];\n\t\t\t//}\n\t\t\tif(in_array($option['name'], $tshirt_option_names)){\n\t\t\t\t$tshirt_options[$option['name']] = array();\n\t\t\t\t$tshirt_options[$option['name']]['option_id'] = $option['option_id'];\n\t\t\t\t$tshirt_options[$option['name']]['prices'] = array();\n\t\t\t}\n\t\t}\n\t\tforeach($tshirt_option_names as $tshirt_option_name){\n\t\t\t$option_value_descriptions = $this->model_catalog_option->getOptionValueDescriptions($tshirt_options[$tshirt_option_name]['option_id']);\n\t\t\tforeach($option_value_descriptions as $opv){\n\t\t\t\t$temp_price = 0.0;\n\t\t\t\tif($tshirt_option_name=='Tshirt Color'){\n\t\t\t\t\tif( in_array($opv['option_value_description'][1]['name'], $tshirt_colored )){\n\t\t\t\t\t\t$temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'ColorShirt' ));\n\t\t\t\t\t} elseif( in_array($opv['option_value_description'][1]['name'], $tshirt_ringer )){\n\t\t\t\t\t\t$temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'RingerShirt' ));\n\t\t\t\t\t} else { // white\n\t\t\t\t\t\t$temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'WhiteShirt' ));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif($tshirt_option_name=='Tshirt Style'){\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"Mens Fitted\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'MensFittedIncremental' ));\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"Ladies\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'LadiesIncremental' ));\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"Hooded Pullover\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'HoodieIncremental' ));\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"Apron\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'ApronIncremental' ));\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"Vneck\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'VneckIncremental' ));\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"Tanktop\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'TanktopIncremental' ));\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"Baby One Piece\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'BabyOnePieceIncremental' ));\n\t\t\t\t}\n\t\t\t\tif($tshirt_option_name=='Tshirt Size'){\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"2 X-Large\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'Shirt_2XL_Incremental' ));\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"3 X-Large\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'Shirt_3XL6XL_Incremental' ));\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"4 X-Large\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'Shirt_3XL6XL_Incremental' ));\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"5 X-Large\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'Shirt_3XL6XL_Incremental' ));\n\t\t\t\t\tif($opv['option_value_description'][1]['name'] == \"6 X-Large\" ) $temp_price = $this->model_tshirtgang_pricing->get(array( 'code' => 'Shirt_3XL6XL_Incremental' ));\n\t\t\t\t}\n\t\t\t\tif($temp_price != 0.0){\n\t\t\t\t\t$tshirt_options_price = array(\n\t\t\t\t\t\t'option_value_id' => $opv['option_value_id'],\n\t\t\t\t\t\t'name' => $opv['option_value_description'][1]['name'],\n\t\t\t\t\t\t'price' => $temp_price\n\t\t\t\t\t);\n\t\t\t\t\t$tshirt_options[$tshirt_option_name]['prices'][] = $tshirt_options_price;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tforeach($tshirt_options as $tso1){\n\t\t\tforeach($tso1['prices'] as $tso2){\n\t\t\t\t$sql = \"UPDATE \" . DB_PREFIX . \"product_option_value ocpov \";\n\t\t\t\t$sql .= \"LEFT JOIN \" . DB_PREFIX . \"product ocp \";\n\t\t\t\t$sql .= \" ON ocp.product_id = ocpov.product_id \";\n\t\t\t\t$sql .= \"LEFT JOIN \" . DB_PREFIX . \"tshirtgang_products tsgp \";\n\t\t\t\t$sql .= \" ON tsgp.product_id = ocp.product_id \";\n\t\t\t\t$sql .= \"SET ocpov.price=\". (float)$tso2['price'] . \" \";\n\t\t\t\t$sql .= \"WHERE \";\n\t\t\t\t$sql .= \" ocpov.option_value_id = \" . (int)$tso2['option_value_id'] . \" \";\n\t\t\t\t//$sql .= \" AND \";\n\t\t\t\t//$sql .= \" tsgp.id IS NOT NULL \";\n\t\t\t\t$this->db->query($sql);\n\t\t\t}\n\t\t}\n\t}", "public function getReceiptsOfProducts($id_1c, $startDate, $endDate, $contractId = \"\") {\n return $this->client->GetReceiptsOfProducts(array(\n 'IDSuppliers' => (string) $id_1c,\n 'IDContract' => (string) $contractId,\n 'DateBegin' => (string) $startDate,\n 'DataEnd' => (string) $endDate));\n }", "public function prices()\n {\n return $this->hasMany(Price::class);\n }", "protected function updatePrices(Wear $wear, RequestVars $post)\n {\n $priser = $wear->getWearpriser();\n $pris_index = array_flip($this->extractIds($priser));\n $success = true;\n\n if (!empty($post->wearpriceid) && !empty($post->wearprice_category) && !empty($post->wearprice_price)) {\n foreach ($post->wearpriceid as $index => $id) {\n if (isset($pris_index[$id])) {\n $wearprice = $priser[$pris_index[$id]];\n $wearprice->pris = $post->wearprice_price[$index];\n $wearprice->update();\n\n unset($priser[$pris_index[$id]]);\n\n continue;\n\n } elseif ($id > 0) {\n continue;\n\n }\n\n $new_wearprice = $this->createEntity('WearPriser');\n $new_wearprice->wear_id = $wear->id;\n $new_wearprice->brugerkategori_id = $post->wearprice_category[$index];\n $new_wearprice->pris = $post->wearprice_price[$index];\n\n if (!$new_wearprice->insert()) {\n $success = false;\n }\n\n }\n\n }\n\n if (!$success) {\n return false;\n }\n\n foreach ($priser as $pris) {\n $pris->delete();\n\n }\n\n return true;\n }", "public function process(CartDataCollection $data, Cart $original, Cart $toCalculate, SalesChannelContext $context, CartBehavior $behavior): void\n {\n /** @var LineItemCollection $productLineItems */\n $productLineItems = $original->getLineItems()->filterType(LineItem::PRODUCT_LINE_ITEM_TYPE);\n if (\\count($productLineItems) === 0) {\n return;\n }\n\n foreach ($productLineItems as $productLineItem) {\n $promotions = $productLineItem->getChildren()->filterType(PromotionCartCollector::TYPE);\n $productPrice = $this->quantityPriceCalculator->calculate($productLineItem->getPriceDefinition(), $context);\n if ($promotions) {\n foreach ($promotions as $promotion) {\n $dataPromotion = $data->get($promotion->getReferencedId().PromotionCartCollector::DATA_KEY);\n $this->setPromotionPrice($promotion, $dataPromotion, $productPrice, $context, $productLineItem);\n }\n }\n\n $this->setLabelAndPriceSubProduct($productLineItem, $productPrice);\n\n $productLineItem->setPrice($productLineItem->getChildren()->getPrices()->sum());\n }\n\n }", "protected function _getProducts($refresh = false, $id_product = false, $id_country = null)\n {\n $products = parent::getProducts($refresh, $id_product, $id_country);\n if (_PS_VERSION_ >= 1.6) {\n $params = Hook::exec('ppbsGetProducts', array('products'=>$products), null, true);\n if (isset($params['productpricebysize']['products'])) {\n return $params['productpricebysize']['products'];\n } else {\n return $products;\n }\n } else {\n $params = Hook::exec('ppbsGetProducts', array('products'=>$products), null);\n $params = json_decode($params, true);\n if (isset($params['products'])) {\n return $params['products'];\n } else {\n return $products;\n }\n }\n }", "public function getProductors ()\n {\n if (empty($this->production)) {\n $this->getCompanyCredits();\n }\n\n return $this->production;\n }", "public function actionGetProductPrice($id=null)\n {\n $userData = User::find()->andFilterWhere(['u_id' => $id])->andWhere(['IS NOT', 'u_mws_seller_id', null])->all();\n\n foreach ($userData as $user) {\n \\Yii::$app->data->getMwsDetails($user->u_mws_seller_id, $user->u_mws_auth_token);\n $models = FbaAllListingData::find()->andWhere(['created_by' => $user->u_id])->all(); //->andWhere(['status' => 'Active'])\n\n foreach ($models as $model) {\n if ($model->seller_sku) {\n $productDetails = \\Yii::$app->api->getProductCompetitivePrice($model->seller_sku);\n if ($productDetails) {\n $model->buybox_price = $productDetails;\n if ($model->save(false)) {\n echo $model->asin1 . \" is Updated.\";\n }\n }\n }\n sleep(3);\n }\n }\n }", "public function all(array $params = [])\n {\n $product_id = $this->product_id;\n\n if (empty($product_id)) {\n throw new BadMethodCallException('Please specify a product id.');\n }\n\n return $this->get($this->getRelatedPath($product_id), $params);\n }", "public function prices()\n {\n return $this->morphToMany(Price::class, 'price_able');\n }", "public function run()\n {\n $prices = [\n [\n 'product_id' => 2,\n 'user_id' => 3,\n 'price' => 18,\n 'created_at' => now(),\n 'updated_at' => now()\n ],\n [\n 'product_id' => 3,\n 'user_id' => 3,\n 'price' => 15,\n 'created_at' => now(),\n 'updated_at' => now()\n ],\n [\n 'product_id' => 2,\n 'user_id' => 4,\n 'price' => 18,\n 'created_at' => now(),\n 'updated_at' => now()\n ],\n [\n 'product_id' => 3,\n 'user_id' => 4,\n 'price' => 15,\n 'created_at' => now(),\n 'updated_at' => now()\n ],\n ];\n ProductPrice::query()->insert($prices);\n }", "private function deleteRecountProduct() {\n $sql = null;\n if ($this->getVendor() == self::MYSQL) {\n $sql = \"\n UPDATE `productrecount` \n SET `isDefault` \t\t= '\" . $this->model->getIsDefault(0, 'single') . \"',\n `isNew` \t\t= '\" . $this->model->getIsNew(0, 'single') . \"',\n `isDraft` \t\t= '\" . $this->model->getIsDraft(0, 'single') . \"',\n `isUpdate` \t\t= '\" . $this->model->getIsUpdate(0, 'single') . \"',\n `isDelete` \t\t= '\" . $this->model->getIsDelete(0, 'single') . \"',\n `isActive` \t\t= '\" . $this->model->getIsActive(0, 'single') . \"',\n `isApproved` \t\t= '\" . $this->model->getIsApproved(0, 'single') . \"',\n `isReview` \t\t= '\" . $this->model->getIsReview(0, 'single') . \"',\n `isPost` \t\t= '\" . $this->model->getIsPost(0, 'single') . \"',\n `executeBy` \t\t= '\" . $this->model->getExecuteBy() . \"',\n `executeTime` \t\t= \" . $this->model->getExecuteTime() . \"\n WHERE `productCode` \t\t= \t'\" . $this->model->getProductCode() . \"'\n\t\t\t AND\t `productRecountDate`\t=\t'\" . $this->model->getProductRecountDate() . \"'\";\n } else {\n if ($this->getVendor() == self::MSSQL) {\n $sql = \"\n UPDATE [productRecount]\n SET [isDefault] \t\t= '\" . $this->model->getIsDefault(0, 'single') . \"',\n [isNew] \t\t= '\" . $this->model->getIsNew(0, 'single') . \"',\n [isDraft] \t\t= '\" . $this->model->getIsDraft(0, 'single') . \"',\n [isUpdate] \t\t= '\" . $this->model->getIsUpdate(0, 'single') . \"',\n [isDelete] \t\t= '\" . $this->model->getIsDelete(0, 'single') . \"',\n [isActive] \t\t= '\" . $this->model->getIsActive(0, 'single') . \"',\n [isApproved] \t\t= '\" . $this->model->getIsApproved(0, 'single') . \"',\n [isReview] \t\t= '\" . $this->model->getIsReview(0, 'single') . \"',\n [isPost] \t\t= '\" . $this->model->getIsPost(0, 'single') . \"',\n [executeBy] \t\t= '\" . $this->model->getExecuteBy() . \"',\n [executeTime] \t\t= \" . $this->model->getExecuteTime() . \"\n WHERE [productCode] \t\t= \t'\" . $this->model->getProductCode() . \"'\n\t\t\t AND\t [productRecountDate]\t=\t'\" . $this->model->getProductRecountDate() . \"'\";\n } else {\n if ($this->getVendor() == self::ORACLE) {\n $sql = \"\n UPDATE PRODUCTRECOUNT\n SET ISDEFAULT \t\t= '\" . $this->model->getIsDefault(0, 'single') . \"',\n ISNEW \t\t= '\" . $this->model->getIsNew(0, 'single') . \"',\n ISDRAFT \t\t= '\" . $this->model->getIsDraft(0, 'single') . \"',\n ISUPDATE \t\t= '\" . $this->model->getIsUpdate(0, 'single') . \"',\n ISDELETE \t\t= '\" . $this->model->getIsDelete(0, 'single') . \"',\n ISACTIVE \t\t= '\" . $this->model->getIsActive(0, 'single') . \"',\n ISAPPROVED \t\t= '\" . $this->model->getIsApproved(0, 'single') . \"',\n ISREVIEW \t\t= '\" . $this->model->getIsReview(0, 'single') . \"',\n ISPOST \t\t= '\" . $this->model->getIsPost(0, 'single') . \"',\n EXECUTEBY \t\t= '\" . $this->model->getExecuteBy() . \"',\n EXECUTETIME \t\t= \" . $this->model->getExecuteTime() . \"\n WHERE PRODUCTCODE \t\t= \t'\" . $this->model->getProductCode() . \"'\n\t\t\t AND\t PRODUCTRECOUNTDATE\t=\t'\" . $this->model->getProductRecountDate() . \"'\";\n }\n }\n }\n try {\n $this->q->update($sql);\n } catch (\\Exception $e) {\n $this->q->rollback();\n echo json_encode(array(\"success\" => false, \"message\" => $e->getMessage()));\n exit();\n }\n }", "function get_discounted_price( $values, $price, $add_totals = false ) {\n\t\n\t\t\tif ($this->applied_coupons) foreach ($this->applied_coupons as $code) :\n\t\t\t\t$coupon = new cmdeals_coupon( $code );\n\t\t\t\t\n\t\t\t\tif ( $coupon->apply_before_tax() && $coupon->is_valid() ) :\n\t\t\t\t\t\n\t\t\t\t\tswitch ($coupon->type) :\n\t\t\t\t\t\n\t\t\t\t\t\tcase \"fixed_deals\" :\n\t\t\t\t\t\tcase \"percent_deals\" :\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this_item_is_discounted = false;\n\t\t\t\t\n\t\t\t\t\t\t\t// Specific deals ID's get the discount\n\t\t\t\t\t\t\tif (sizeof($coupon->deal_ids)>0) :\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ((in_array($values['deal_id'], $coupon->deal_ids) || in_array($values['variation_id'], $coupon->deal_ids))) :\n\t\t\t\t\t\t\t\t\t$this_item_is_discounted = true;\n\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// No deals ids - all items discounted\n\t\t\t\t\t\t\t\t$this_item_is_discounted = true;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\n\t\t\t\t\t\t\t// Specific deals ID's excluded from the discount\n\t\t\t\t\t\t\tif (sizeof($coupon->exclude_deals_ids)>0) :\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ((in_array($values['deal_id'], $coupon->exclude_deals_ids) || in_array($values['variation_id'], $coupon->exclude_deals_ids))) :\n\t\t\t\t\t\t\t\t\t$this_item_is_discounted = false;\n\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Apply filter\n\t\t\t\t\t\t\t$this_item_is_discounted = apply_filters( 'cmdeals_item_is_discounted', $this_item_is_discounted, $values, $before_tax = true );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Apply the discount\n\t\t\t\t\t\t\tif ($this_item_is_discounted) :\n\t\t\t\t\t\t\t\tif ($coupon->type=='fixed_deals') :\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif ($price < $coupon->amount) :\n\t\t\t\t\t\t\t\t\t\t$discount_amount = $price;\n\t\t\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t\t\t$discount_amount = $coupon->amount;\n\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$price = $price - $coupon->amount;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif ($price<0) $price = 0;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif ($add_totals) :\n\t\t\t\t\t\t\t\t\t\t$this->discount_cart = $this->discount_cart + ( $discount_amount * $values['quantity'] );\n\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\telseif ($coupon->type=='percent_deals') :\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$percent_discount = ( $values['data']->get_price( false ) / 100 ) * $coupon->amount;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif ($add_totals) $this->discount_cart = $this->discount_cart + ( $percent_discount * $values['quantity'] );\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$price = $price - $percent_discount;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\tendif;\n\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase \"fixed_cart\" :\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/** \n\t\t\t\t\t\t\t * This is the most complex discount - we need to divide the discount between rows based on their price in\n\t\t\t\t\t\t\t * proportion to the subtotal. This is so rows with different tax rates get a fair discount, and so rows\n\t\t\t\t\t\t\t * with no price (free) don't get discount too.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Get item discount by dividing item cost by subtotal to get a %\n\t\t\t\t\t\t\t$discount_percent = ($values['data']->get_price( false )*$values['quantity']) / $this->subtotal_ex_tax;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Use pence to help prevent rounding errors\n\t\t\t\t\t\t\t$coupon_amount_pence = $coupon->amount * 100;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Work out the discount for the row\n\t\t\t\t\t\t\t$item_discount = $coupon_amount_pence * $discount_percent;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Work out discount per item\n\t\t\t\t\t\t\t$item_discount = $item_discount / $values['quantity'];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Pence\n\t\t\t\t\t\t\t$price = ( $price * 100 );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Check if discount is more than price\n\t\t\t\t\t\t\tif ($price < $item_discount) :\n\t\t\t\t\t\t\t\t$discount_amount = $price;\n\t\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t\t$discount_amount = $item_discount;\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Take discount off of price (in pence)\n\t\t\t\t\t\t\t$price = $price - $discount_amount;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Back to pounds\n\t\t\t\t\t\t\t$price = $price / 100; \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Cannot be below 0\n\t\t\t\t\t\t\tif ($price<0) $price = 0;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Add coupon to discount total (once, since this is a fixed cart discount and we don't want rounding issues)\n\t\t\t\t\t\t\tif ($add_totals) $this->discount_cart = $this->discount_cart + (($discount_amount*$values['quantity']) / 100);\n\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase \"percent\" :\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Get % off each item - this works out the same as doing the whole cart\n\t\t\t\t\t\t\t//$percent_discount = ( $values['data']->get_price( false ) / 100 ) * $coupon->amount;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$percent_discount = ( $values['data']->get_price( ) / 100 ) * $coupon->amount;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ($add_totals) $this->discount_cart = $this->discount_cart + ( $percent_discount * $values['quantity'] );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$price = $price - $percent_discount;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tendswitch;\n\t\t\t\t\t\n\t\t\t\tendif;\n\t\t\tendforeach;\n\t\t\t\n\t\t\treturn apply_filters( 'cmdeals_get_discounted_price_', $price, $values, $this );\n\t\t}", "function cartTotal ($cartItems) {\n\n$grouped = $cartItems->groupBy(\"product_id\");\n$product_quantities = $grouped->map(function ($item, $key) {\n return [$key => $item->sum(\"qty\")];\n});\n$products_ids = array_keys($product_quantities->all());\n$products = Product::whereIn(\"id\", $products_ids)->select([\"price\", \"name\", \"id\", \"item_value_discount\", \"items_value_discount\", \"items_items_discount\"])->get();\n$products = $products->groupBy(\"id\");\n\n$item_value_discounts = collect([]);\n$items_value_discounts = collect([]);\n$items_items_discounts = collect([]);\n\nforeach ($products as $product) {\n if ($product[0]->item_value_discount) {\n \n $item_value_discounts->put($product[0]->id, $product[0]->getActiveItemValueDiscount());\n\n // $item_value_discounts = item_value_discount::where(function ($query) {\n // $query->whereDate(\"starts_at\", \"<=\", date(\"Y-m-d\"))\n // ->whereDate(\"ends_at\", \">=\", date(\"Y-m-d\"));\n // })->orWhere(function ($query) {\n // $query->whereDate(\"starts_at\", \"<=\", date(\"Y-m-d\"))\n // ->whereNull(\"ends_at\");\n // })->get();\n }\n if ($product[0]->items_value_discounts) {\n $items_value_discounts->put($product[0]->id, $product[0]->getActiveItemsValueDiscount());\n // $items_value_discounts = items_value_discount::where(function ($query) {\n // $query->whereDate(\"starts_at\", \"<=\", date(\"Y-m-d\"))\n // ->whereDate(\"ends_at\", \">=\", date(\"Y-m-d\"));\n // })->orWhere(function ($query) {\n // $query->whereDate(\"starts_at\", \"<=\", date(\"Y-m-d\"))\n // ->whereNull(\"ends_at\");\n // })->get();\n }\n if ($product[0]->items_items_discounts) {\n $items_items_discounts->put($product[0]->id, $product[0]->getActiveItemsItemsDiscount());\n // $items_items_discounts = items_items_discount::where(function ($query) {\n // $query->whereDate(\"starts_at\", \"<=\", date(\"Y-m-d\"))\n // ->whereDate(\"ends_at\", \">=\", date(\"Y-m-d\"));\n // })->orWhere(function ($query) {\n // $query->whereDate(\"starts_at\", \"<=\", date(\"Y-m-d\"))\n // ->whereNull(\"ends_at\");\n // })->get();\n }\n}\n// return $item_value_discounts;\n// return $items_value_discounts;\n// return $items_items_discounts;\n\n// if ($item_value_discounts)\n// $item_value_discounts = $item_value_discounts->groupBy(\"product_id\");\n// if ($items_value_discounts)\n// $items_value_discounts = $items_value_discounts->groupBy(\"product_id\");\n// if ($items_items_discounts)\n// $items_items_discounts = $items_items_discounts->groupBy(\"product_id\");\n// return $item_value_discounts;\n\n// return $items_value_discounts;\n// return $items_items_discounts;\n$product_prices_qty = collect([]);\n$product_present = collect([]);\nforeach ($products_ids as $products_id) {\n $product_qty = $product_quantities[$products_id][$products_id];\n $items_items_discounts_product_qty = $product_quantities[$products_id][$products_id];\n if (isset($items_value_discounts[$products_id])) {\n if ($items_value_discounts[$products_id] !== []) {\n foreach ($items_value_discounts[$products_id] as $discount) {\n $count = floor($product_qty / $discount->items_count);\n if ($count) {\n $product_prices_qty->push([\n \"product_id\" => $products_id,\n \"product_name\" => $products[$products_id][0]->name,\n \"qty\" => $discount->items_count * $count,\n \"price\" => $count*$discount->items_value,\n ]);\n $product_qty = $product_qty - ($count * $discount->items_count);\n }\n }\n }\n }\n if (isset($item_value_discounts[$products_id])) {\n if ($item_value_discounts[$products_id] !== []) {\n foreach ($item_value_discounts[$products_id] as $discount) {\n if ($product_qty) {\n $price = $products[$products_id][0]->price;\n $value = $discount->value;\n $percent = $discount->percent;\n \n if ($value && $percent) {\n $price = $price - $value;\n } else if ($value && !$percent) {\n $price = $price - $value;\n } else {\n $price = $price - (($percent / 100) * $price);\n }\n $total = $price*$product_qty;\n $product_prices_qty->push([\n \"product_id\" => $products_id,\n \"product_name\" => $products[$products_id][0]->name,\n \"qty\" => $product_qty,\n \"price\" => $total,\n ]);\n }\n }\n }\n }\n if (isset($items_items_discounts[$products_id])) {\n if ($items_items_discounts[$products_id] !== []) {\n $items_number = $items_items_discounts_product_qty;\n $max_get_number = 0;\n // $product_present = collect([]);\n foreach ($items_items_discounts[$products_id] as $discount) {\n $count = floor($items_number / $discount->buy_items_count);\n if (!$product_prices_qty->contains('product_id', $products_id)){\n $price = $products[$products_id][0]->price;\n $total = $price * $items_items_discounts_product_qty;\n $product_prices_qty->push([\n \"product_id\" => $products_id,\n \"qty\" => $items_items_discounts_product_qty,\n \"product_name\" => $products[$products_id][0]->name,\n \"price\" => $total,\n ]);\n }\n if ($count) {\n if ($discount->get_items_count > $max_get_number) {\n $max_get_number = $discount->get_items_count * $count;\n \n $offer = [\n \"product_id\" => $products_id,\n \"buy_items_count\" => $discount->buy_items_count,\n \"presents_count\" => $max_get_number,\n \"present_product_id\" => $discount->present_product_id,\n ];\n }\n }\n }\n $product_present->push($offer);\n }\n }\n}\n$data = [\"totals\" => $product_prices_qty, \"presents\" => $product_present];\nreturn $data;\n}", "public function products() : object\n {\n\n // also, we'll need different product prices per market so we need another layer on top of Products to do this\n return $this->hasMany(MarketProduct::class, 'id');\n }", "public function addProductIDs($productIDs)\n {\n $parameters = $this->request->getParameters();\n $parameters->add('id', $productIDs);\n $this->recommendationsUpToDate = false;\n }", "public function applyCartDiscount(Varien_Event_Observer $observer)\n { \n try\n { \n $bundle_product_ids = [];\n $quote_product_ids = [];\n $cookieValue = Mage::getModel('core/cookie')->get('ivid');\n $userBundleCollection = Mage::getModel('increasingly_analytics/bundle')->getCollection()->addFieldToFilter('increasingly_visitor_id',$cookieValue);\n $items = $observer->getEvent()->getQuote()->getAllItems();\n $eligibleProducts = [];\n $discount = 0;\n foreach ($items as $item) {\n array_push($quote_product_ids, $item->getProductId());\n }\n foreach ($userBundleCollection as $bundle) {\n //First Bundle products\n $bundle_product_ids = explode(',', $bundle->getProductIds()); \n $productsIds = array_intersect($quote_product_ids, $bundle_product_ids);\n if(count($productsIds) == count($bundle_product_ids) )\n $discount += $bundle->getDiscountPrice();\n }\n\n if($discount > 0){\n $quote=$observer->getEvent()->getQuote();\n $quoteid=$quote->getId();\n $discountAmount=$discount;\n if($quoteid) { \n if($discountAmount>0) {\n $total=$quote->getBaseSubtotal();\n $quote->setSubtotal(0);\n $quote->setBaseSubtotal(0);\n\n $quote->setSubtotalWithDiscount(0);\n $quote->setBaseSubtotalWithDiscount(0);\n\n $quote->setGrandTotal(0);\n $quote->setBaseGrandTotal(0);\n \n\n $canAddItems = $quote->isVirtual()? ('billing') : ('shipping'); \n foreach ($quote->getAllAddresses() as $address) {\n\n $address->setSubtotal(0);\n $address->setBaseSubtotal(0);\n\n $address->setGrandTotal(0);\n $address->setBaseGrandTotal(0);\n\n $address->collectTotals();\n\n $quote->setSubtotal((float) $quote->getSubtotal() + $address->getSubtotal());\n $quote->setBaseSubtotal((float) $quote->getBaseSubtotal() + $address->getBaseSubtotal());\n\n $quote->setSubtotalWithDiscount(\n (float) $quote->getSubtotalWithDiscount() + $address->getSubtotalWithDiscount()\n );\n $quote->setBaseSubtotalWithDiscount(\n (float) $quote->getBaseSubtotalWithDiscount() + $address->getBaseSubtotalWithDiscount()\n );\n\n $quote->setGrandTotal((float) $quote->getGrandTotal() + $address->getGrandTotal());\n $quote->setBaseGrandTotal((float) $quote->getBaseGrandTotal() + $address->getBaseGrandTotal());\n\n $quote ->save(); \n\n $quote->setGrandTotal($quote->getBaseSubtotal()-$discountAmount)\n ->setBaseGrandTotal($quote->getBaseSubtotal()-$discountAmount)\n ->setSubtotalWithDiscount($quote->getBaseSubtotal()-$discountAmount)\n ->setBaseSubtotalWithDiscount($quote->getBaseSubtotal()-$discountAmount)\n ->save(); \n\n\n if($address->getAddressType()==$canAddItems) {\n //echo $address->setDiscountAmount; exit;\n $address->setSubtotalWithDiscount((float) $address->getSubtotalWithDiscount()-$discountAmount);\n $address->setGrandTotal((float) $address->getGrandTotal()-$discountAmount);\n $address->setBaseSubtotalWithDiscount((float) $address->getBaseSubtotalWithDiscount()-$discountAmount);\n $address->setBaseGrandTotal((float) $address->getBaseGrandTotal()-$discountAmount);\n if($address->getDiscountDescription()){\n $address->setDiscountAmount(-($address->getDiscountAmount()-$discountAmount));\n $address->setDiscountDescription($address->getDiscountDescription().', Custom Discount');\n $address->setBaseDiscountAmount(-($address->getBaseDiscountAmount()-$discountAmount));\n }else {\n $address->setDiscountAmount(-($discountAmount));\n $address->setDiscountDescription('Custom Discount');\n $address->setBaseDiscountAmount(-($discountAmount));\n }\n $address->save();\n }//end: if\n } //end: foreach\n //echo $quote->getGrandTotal();\n\n foreach($quote->getAllItems() as $item){\n //We apply discount amount based on the ratio between the GrandTotal and the RowTotal\n $rat=$item->getPriceInclTax()/$total;\n $ratdisc=$discountAmount*$rat;\n $item->setDiscountAmount(($item->getDiscountAmount()+$ratdisc) * $item->getQty());\n $item->setBaseDiscountAmount(($item->getBaseDiscountAmount()+$ratdisc) * $item->getQty())->save(); \n }\n } \n }\n }\n }\n catch(Exception $e)\n {\n Mage::log(\"Remove from cart tracking - \" . $e->getMessage(), null, 'Increasingly_Analytics.log');\n }\n\n }", "public function loadProductAttributeValues($productIds = array())\n {\n $selects = [];\n $storeId = $this->getIndex()->getStoreId();\n $storeIds = array(0, $storeId);\n \n $connection = $this->_attributeCollection->getConnection();\n \n $attributeTables = array();\n $attributesMap = array();\n \n $this->_dataProductAttributeValues = array();\n \n $attributesWithSelect = array();\n $attributesWithMultipleSelect = array();\n \n $productSearchWeightAttributes = $this->getProductAttrCodeUseForSearchWeight();\n if (!empty($productSearchWeightAttributes)) {\n $productSearchWeightAttributes = explode(',', $productSearchWeightAttributes);\n $conditions = 'main_table.attribute_code IN (?)';\n $this->_attributeCollection->getSelect()->orWhere($conditions, $productSearchWeightAttributes);\n }\n \n foreach ($this->_attributeCollection as $attribute) {\n $this->_dataProductAttributeData[$attribute->getAttributeCode()] = $attribute;\n $this->_dataProductAttributeData[$attribute->getAttributeId()] = $attribute;\n if (!$attribute->isStatic()) {\n //Collect attributes with frontendInput is select\n if ($attribute->getFrontendInput() == 'select') {\n //Ignore attribute has source model, those attributes will load option from source model\n $attributesWithSelect[$attribute->getAttributeId()] = $attribute->getBackend()->getTable();\n }\n //Collect attributes with frontendInput is multiple select\n if ($attribute->getFrontendInput() == 'multiselect') {\n $attributesWithMultipleSelect[$attribute->getAttributeId()] = $attribute->getBackend()->getTable();\n }\n $attributeTables[$attribute->getBackend()->getTable()][] = $attribute->getAttributeId();\n $attributesMap[$attribute->getAttributeId()] = $attribute->getAttributeCode();\n }\n }\n \n $productEntityLinkField = $this->getProductEntityLinkField();\n \n $index = 1;\n if (count($attributeTables)) {\n $attributeTables = array_keys($attributeTables);\n foreach ($productIds as $productId) {\n foreach ($attributeTables as $attributeTable) {\n $alias = 't'.$index;\n $aliasEntity = 'tf'.$index;\n $select = $connection->select()\n ->from(\n [$alias => $attributeTable],\n [\n 'value' => $alias.'.value',\n 'attribute_id' => $alias.'.attribute_id'\n ]\n )->joinInner(\n [$aliasEntity => 'catalog_product_entity'],\n \"{$alias}.{$productEntityLinkField} = {$aliasEntity}.{$productEntityLinkField}\",\n [\n 'product_id' => $aliasEntity.'.entity_id'\n ]\n )\n ->where($aliasEntity.'.entity_id = ?', $productId)\n ->where($alias.'.store_id' . ' IN (?)', $storeIds)\n ->order($alias.'.store_id' . ' DESC');\n $index++;\n $selects[] = $select;\n }\n }\n \n //Please be careful here Because $unionSelect can be nothing that is the reason for fetchAll throw error\n if (count($selects) > 0) {\n $unionSelect = new \\Magento\\Framework\\DB\\Sql\\UnionExpression(\n $selects,\n \\Magento\\Framework\\DB\\Select::SQL_UNION_ALL\n );\n \n foreach ($connection->fetchAll($unionSelect) as $attributeValue) {\n if (array_key_exists($attributeValue['attribute_id'], $attributesMap)) {\n $pId = $attributeValue['product_id'];\n $attrId = $attributeValue['attribute_id'];\n \n $this->_dataProductAttributeValues[$pId][$attributesMap[$attrId]] = $attributeValue['value'];\n \n //Collect data for attribute has options like select/multiple select\n if (in_array($attrId, array_keys($attributesWithSelect))) {\n //This function call may cause performance issue - need better way\n //load attribute option labels for autocomplete only, if laod attribute it may cause performance issue\n if ($this->_isAttributeRequiredToLoadOptionLabel($attrId)) {\n $attributeValue['option_label'] = $this->_getAttributeOptionLabels(\n $connection,\n $attrId,\n $attributeValue['value'],\n $storeIds\n );\n }\n \n $this->_dataProductAttributeValuesOptions[$pId][$attributesMap[$attrId]] = array($attributeValue['value']);\n }\n if (in_array($attrId, array_keys($attributesWithMultipleSelect))) {\n $this->_dataProductAttributeValuesOptions[$pId][$attributesMap[$attrId]] = explode(',', $attributeValue['value']);\n //This function call may cause performance issue - need better way\n //load attribute option labels for autocomplete only, if laod attribute it may cause performance issue\n if ($this->_isAttributeRequiredToLoadOptionLabel($attrId)) {\n $attributeValue['option_label'] = $this->_getAttributeOptionLabels(\n $connection,\n $attrId,\n explode(',', $attributeValue['value']),\n $storeIds\n );\n }\n }\n //TODO: for multiple select\n if (isset($attributeValue['option_label'])) {\n $this->_dataProductAttributeValuesOptionsLabels[$pId][$attributesMap[$attrId]] = $attributeValue['option_label'];\n }\n }\n }\n }\n }\n \n return $this;\n }", "protected function getConfigurableProductLinks()\n {\n if (!empty($this->fields['associated_product_ids'])) {\n return $this->fields['associated_product_ids'];\n }\n\n /** @var ConfigurableAttributesData $configurableAttributesData */\n $configurableAttributesData = $this->fixture->getDataFieldConfig('configurable_attributes_data')['source'];\n $associatedProductIds = [];\n\n $configurableAttributesData->generateProducts();\n foreach ($configurableAttributesData->getProducts() as $product) {\n $associatedProductIds[] = $product->getId();\n $this->fields['product']['attribute_set_id'] = $product->getDataFieldConfig('attribute_set_id')['source']\n ->getAttributeSet()->getAttributeSetId();\n }\n\n return $associatedProductIds;\n }", "function updateAmazonProductsPrices($items)\n{\n\tif (sizeof($items) > 0) {\n\t\t$data['lastmod'] = time();\n\t\t$data['lastmod_user'] = getAmazonSessionUserId();\n\t\t$data['lastpriceupdate'] = time();\n\t\t$data['submitedProduct'] = 0;\n\t\t$data['submitedPrice'] = 0;\n\t\t$data['upload'] = 1;\n\t\t$caseStandardPrice = \"StandardPrice = CASE\";\n\t\tforeach($items as $key => $item)\n\t\t{\n\t\t\t$caseStandardPrice.= \"\\n WHEN id_product = \" . $items[$key]['id_product'] . \" THEN \" . $items[$key]['price'];\n\t\t\t$productsIds[] = $items[$key]['id_product'];\n\t\t}\n\t\t$caseStandardPrice.= \"\n\t\t\tEND\n\t\t\tWHERE id_product IN (\" . implode(\", \", $productsIds) . \")\n\t\t\";\n\t\t$addWhere\t = $caseStandardPrice;\n\t\tSQLUpdate('amazon_products', $data, $addWhere, 'shop', __FILE__, __LINE__);\n\t}\n}", "public function refundMkpProducts($observer)\n {\n $debug = debug_backtrace(false);\n foreach ($debug as &$data) {\n unset($data['object']);\n unset($data['args']);\n }\n\n $body = $observer->getEvent()->getBody();\n $data = json_decode($body, true);\n\n if (json_last_error() != JSON_ERROR_NONE) {\n // Data sent in XML\n $xml = new SimpleXMLElement($body, LIBXML_NOCDATA);\n $json = json_encode($xml);\n $data = json_decode($json, true);\n }\n\n foreach ($data as $orders) {\n if (array_key_exists('amount', $orders)) {\n // Miss a level when data sent in XML\n $orders = array($orders);\n }\n\n foreach ($orders as $orderData) {\n $order = Mage::getModel('sales/order')->load($orderData['order_commercial_id'], 'increment_id');\n if ($order->getId()) {\n $amount = 0;\n foreach ($orderData['order_lines'] as $orderLines) {\n foreach ($orderLines as $line) {\n foreach ($line['refunds'] as $refunds) {\n foreach ($refunds as $refund) {\n $amount += $refund['amount'];\n }\n }\n }\n }\n \n try {\n $payment = $order->getPayment();\n $methodInstance = $payment->getMethodInstance();\n $res = $methodInstance->refundMkpProducts($payment, $amount, $orderData['order_id']);\n } catch (Exception $e) {\n Mage::logException($e);\n }\n\n $status = (isset($res) && $res->getResponseIsSuccess()) ? 'OK' : 'REFUSED';\n\n Mage::dispatchEvent('mirakl_trigger_order_refund', array(\n 'order_id' => $order->getId(),\n 'remote_id' => $orderData['order_id'],\n 'status' => $status\n ));\n }\n }\n }\n\n return $this;\n }", "public function payMultipleSuppliers($attributes);", "public function getProductPrice()\n {\n }", "public function updateAllStoreAssociations() {\n\n $allstores = $this->getStores(null, 1);\n $this->load->model('user/productset');\n\n //echo count($allstores);\n\n //print_r($allstores);\n foreach ($allstores as $store_info) {\n //KMC new category management, disabled all categories first.\n //\n // ???? SHOULD I DELETE CATEGORIES FOR THE STORE/PRODUCTSETS FIRST??\n // Yes, I think we should otherwise we will not pick up good changes.\n $this->db->query(\"DELETE FROM \". DB_PREFIX . \"category WHERE store_code='\".$store_info['code'].\"'\");\n \n unset($productset_ids);\n\n // This picks up whatever is already set (checked in their catalog list) for a dealer.\n $productset_array = $this->model_user_productset->getProductsetsForStoreId($store_info['store_id']);\n\n foreach ($productset_array as $pset)\n {\n $productset_ids[] = $pset['productset_id'];\n }\n print_r($productset_ids);\n \t \n // For each productset ...\n if ($productset_ids) {\n \t\tforeach ($productset_ids as $productset_id) {\n // Make sure that we have categories defined for this productset, \n // else we have to add them based on our ZZZ store which holds the defaults.\n $this->load->model('catalog/category');\n $this->model_catalog_category->createStoreCategoriesIfNeeded($store_info['code'], $productset_id);\n \t\t}\n \n // Create the product_to_category associations.\n $this->load->model('productset/product');\n $this->model_productset_product->buildProductToCategoryAssociations($store_info['code'], $productset_ids);\n \n // Re-build related products for the dealer based no the default set of ZZZ.\n $this->model_productset_product->buildRelatedProductAssociations($store_info['code'], $productset_ids);\n \n // Now update the store_product table.\n $this->load->model('store/product');\n $this->model_store_product->createUnjunctionedProductRecords($store_info['code']);\n }\n }\n }", "function get_product_pricebooks($id)\n\t{\n\t\tglobal $log,$singlepane_view;\n\t\t$log->debug(\"Entering get_product_pricebooks(\".$id.\") method ...\");\n\t\tglobal $mod_strings;\n\t\trequire_once('modules/PriceBooks/PriceBooks.php');\n\t\t$focus = new PriceBooks();\n\t\t$button = '';\n\t\tif($singlepane_view == 'true')\n\t\t\t$returnset = '&return_module=Products&return_action=DetailView&return_id='.$id;\n\t\telse\n\t\t\t$returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id;\n\n\n\t\t$query = \"SELECT ec_pricebook.pricebookid as crmid,\n\t\t\tec_pricebook.*,\n\t\t\tec_pricebookproductrel.productid as prodid\n\t\t\tFROM ec_pricebook\n\t\t\tINNER JOIN ec_pricebookproductrel\n\t\t\t\tON ec_pricebookproductrel.pricebookid = ec_pricebook.pricebookid\n\t\t\tWHERE ec_pricebook.deleted = 0\n\t\t\tAND ec_pricebookproductrel.productid = \".$id;\n\t\t$log->debug(\"Exiting get_product_pricebooks method ...\");\n\t\treturn GetRelatedList('Products','PriceBooks',$focus,$query,$button,$returnset);\n\t}", "public function woocommerce_reports_top_earners_order_items($products_data, $start_date, $end_date) {\n\t\tglobal $wpdb;\n\n\t\t$this->set_reporting_flag(true);\n\n\t\t// If no data was retrieved by WooCommerce, just return the empty dataset\n\t\tif(empty($products_data)) {\n\t\t\treturn $products_data;\n\t\t}\n\n\t\t$SQL = \"\n\t\t\tSELECT\n\t\t\t\torder_item_meta_2.meta_value as product_id\n\t\t\t\t-- ,SUM(order_item_meta_3.meta_value) AS line_total\n\t\t\t\t-- Return Line total converted to base currency\n\t\t\t\t,SUM(order_item_meta_3.meta_value * meta_order_base_curr.meta_value / meta_order.meta_value) AS line_total\n\t\t\tFROM\n\t\t\t\t{$wpdb->prefix}woocommerce_order_items AS order_items\n\t\t\tJOIN\n\t\t\t\t{$wpdb->prefix}woocommerce_order_itemmeta as order_item_meta_2 ON\n\t\t\t\t\t(order_item_meta_2.order_item_id = order_items.order_item_id) AND\n\t\t\t\t\t(order_item_meta_2.meta_key = '_product_id')\n\t\t\tJOIN\n\t\t\t\t{$wpdb->prefix}woocommerce_order_itemmeta as order_item_meta_3 ON\n\t\t\t\t\t(order_item_meta_3.order_item_id = order_items.order_item_id) AND\n\t\t\t\t\t(order_item_meta_3.meta_key = '_line_total')\n\t\t\tJOIN\n\t\t\t\t$wpdb->posts AS posts ON\n\t\t\t\t\t(posts.ID = order_items.order_id) AND\n\t\t\t\t\t(posts.post_type = 'shop_order') AND\n\t\t\t\t\t(posts.post_status = 'publish') AND\n\t\t\t\t\t(post_date > '\" . date('Y-m-d', $start_date) . \"') AND\n\t\t\t\t\t(post_date < '\" . date('Y-m-d', strtotime('+1 day', $end_date)) . \"')\n\t\t\tJOIN\n\t\t\t\t$wpdb->postmeta AS meta_order ON\n\t\t\t\t\t(meta_order.post_id = posts.ID) AND\n\t\t\t\t\t(meta_order.meta_key = '_order_total')\n\t\t\tJOIN\n\t\t\t\t$wpdb->postmeta AS meta_order_base_curr ON\n\t\t\t\t\t(meta_order_base_curr.post_id = posts.ID) AND\n\t\t\t\t\t(meta_order_base_curr.meta_key = '_order_total_base_currency')\n\t\t\tLEFT JOIN\n\t\t\t\t$wpdb->term_relationships AS rel ON\n\t\t\t\t\t(rel.object_ID = posts.ID)\n\t\t\tLEFT JOIN\n\t\t\t\t$wpdb->term_taxonomy AS taxonomy ON\n\t\t\t\t\t(taxonomy.term_taxonomy_id = rel.term_taxonomy_id) AND\n\t\t\t\t\t(taxonomy.taxonomy = 'shop_order_status')\n\t\t\tLEFT JOIN\n\t\t\t\t$wpdb->terms AS term ON\n\t\t\t\t\t(term.term_id = taxonomy.term_id) AND\n\t\t\t\t\t(term.slug IN ('\" . implode(\"','\", apply_filters('woocommerce_reports_order_statuses', array('completed', 'processing', 'on-hold'))) . \"'))\n\t\t\tWHERE\n\t\t\t\t(order_items.order_item_type = 'line_item')\n\t\t\tGROUP BY\n\t\t\t\torder_item_meta_2.meta_value\n\t\t\";\n\n\t\t$products_data_base_curr = $wpdb->get_results($SQL);\n\t\t$this->set_reporting_flag(false);\n\n\t\treturn $products_data_base_curr;\n\t}" ]
[ "0.6069264", "0.6034877", "0.57542175", "0.5383104", "0.5334785", "0.5250433", "0.51425743", "0.51398647", "0.51082295", "0.50999063", "0.50550056", "0.5009452", "0.49751654", "0.49522376", "0.4896038", "0.4885717", "0.4868063", "0.48626703", "0.4854262", "0.48180994", "0.48080987", "0.47924674", "0.47697985", "0.47568604", "0.47328085", "0.47281307", "0.47124562", "0.47101015", "0.47080424", "0.47049758", "0.46927184", "0.4692398", "0.4674542", "0.4670557", "0.46606934", "0.4643552", "0.46382445", "0.46067786", "0.459987", "0.45780984", "0.45747605", "0.456046", "0.45544586", "0.45503426", "0.45496646", "0.45456293", "0.45426086", "0.45368898", "0.45341215", "0.4534102", "0.45335457", "0.45321932", "0.45264855", "0.45220065", "0.4520952", "0.45198786", "0.4516669", "0.4514683", "0.45048615", "0.4501181", "0.44921097", "0.44830102", "0.44764555", "0.44745314", "0.4467321", "0.44639486", "0.44564518", "0.44542745", "0.44529286", "0.44510353", "0.4446284", "0.44390136", "0.44378752", "0.44336182", "0.44305408", "0.44290027", "0.44237787", "0.44139653", "0.4411972", "0.44115183", "0.44113332", "0.44111803", "0.440768", "0.44042453", "0.44016168", "0.43990913", "0.43814993", "0.4376891", "0.43707108", "0.43699387", "0.4369717", "0.4369033", "0.4368608", "0.4368192", "0.43615314", "0.4355479", "0.43521023", "0.43499285", "0.4337177", "0.433063" ]
0.69700253
0
Specification: Publish price list prices for products. Uses the given IDs of the `fos_price_product_price_list` table. Merges created or updated prices to the existing ones.
public function publishConcretePriceProductPriceList(array $priceProductPriceListIds): void;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function publishAbstractPriceProductPriceList(array $priceProductPriceListIds): void;", "public function publishAbstractPriceProductPriceListByIdPriceList(int $idPriceList): void;", "public function publishConcretePriceProductPriceListByIdPriceList(int $idPriceList): void;", "public function publishConcretePriceProductByProductIds(array $productIds): void;", "public function updatePrices($contractId, $priceList);", "public function updateprices()\n {\n\n $aParams = oxRegistry::getConfig()->getRequestParameter(\"updateval\");\n if (is_array($aParams)) {\n foreach ($aParams as $soxId => $aStockParams) {\n $this->addprice($soxId, $aStockParams);\n }\n }\n }", "protected function putProductsVariantsPricelistPriceRequest($body, $product_id, $variant_id, $pricelist_id)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling putProductsVariantsPricelistPrice'\n );\n }\n // verify the required parameter 'product_id' is set\n if ($product_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $product_id when calling putProductsVariantsPricelistPrice'\n );\n }\n if ($product_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$product_id\" when calling DefaultApi.putProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'variant_id' is set\n if ($variant_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $variant_id when calling putProductsVariantsPricelistPrice'\n );\n }\n if ($variant_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$variant_id\" when calling DefaultApi.putProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'pricelist_id' is set\n if ($pricelist_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pricelist_id when calling putProductsVariantsPricelistPrice'\n );\n }\n if ($pricelist_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$pricelist_id\" when calling DefaultApi.putProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n $resourcePath = '/products/{productId}/variants/{variantId}/prices/{pricelistId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($product_id !== null) {\n $resourcePath = str_replace(\n '{' . 'productId' . '}',\n ObjectSerializer::toPathValue($product_id),\n $resourcePath\n );\n }\n // path params\n if ($variant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'variantId' . '}',\n ObjectSerializer::toPathValue($variant_id),\n $resourcePath\n );\n }\n // path params\n if ($pricelist_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pricelistId' . '}',\n ObjectSerializer::toPathValue($pricelist_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n \n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function api_update_price(){\n $watchlists = $this->wr->all();\n foreach($watchlists as $watchlist)\n {\n $current_price = $this->get_quotes($watchlist->id);\n\n $this->wr->update([\n 'current_price' => $current_price,\n ],$watchlist->id);\n }\n }", "protected function patchProductsVariantsPricelistPriceRequest($body, $product_id, $variant_id, $pricelist_id)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling patchProductsVariantsPricelistPrice'\n );\n }\n // verify the required parameter 'product_id' is set\n if ($product_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $product_id when calling patchProductsVariantsPricelistPrice'\n );\n }\n if ($product_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$product_id\" when calling DefaultApi.patchProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'variant_id' is set\n if ($variant_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $variant_id when calling patchProductsVariantsPricelistPrice'\n );\n }\n if ($variant_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$variant_id\" when calling DefaultApi.patchProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'pricelist_id' is set\n if ($pricelist_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pricelist_id when calling patchProductsVariantsPricelistPrice'\n );\n }\n if ($pricelist_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$pricelist_id\" when calling DefaultApi.patchProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n $resourcePath = '/products/{productId}/variants/{variantId}/prices/{pricelistId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($product_id !== null) {\n $resourcePath = str_replace(\n '{' . 'productId' . '}',\n ObjectSerializer::toPathValue($product_id),\n $resourcePath\n );\n }\n // path params\n if ($variant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'variantId' . '}',\n ObjectSerializer::toPathValue($variant_id),\n $resourcePath\n );\n }\n // path params\n if ($pricelist_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pricelistId' . '}',\n ObjectSerializer::toPathValue($pricelist_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n \n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PATCH',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function updateAmazonProductsPrices($items)\n{\n\tif (sizeof($items) > 0) {\n\t\t$data['lastmod'] = time();\n\t\t$data['lastmod_user'] = getAmazonSessionUserId();\n\t\t$data['lastpriceupdate'] = time();\n\t\t$data['submitedProduct'] = 0;\n\t\t$data['submitedPrice'] = 0;\n\t\t$data['upload'] = 1;\n\t\t$caseStandardPrice = \"StandardPrice = CASE\";\n\t\tforeach($items as $key => $item)\n\t\t{\n\t\t\t$caseStandardPrice.= \"\\n WHEN id_product = \" . $items[$key]['id_product'] . \" THEN \" . $items[$key]['price'];\n\t\t\t$productsIds[] = $items[$key]['id_product'];\n\t\t}\n\t\t$caseStandardPrice.= \"\n\t\t\tEND\n\t\t\tWHERE id_product IN (\" . implode(\", \", $productsIds) . \")\n\t\t\";\n\t\t$addWhere\t = $caseStandardPrice;\n\t\tSQLUpdate('amazon_products', $data, $addWhere, 'shop', __FILE__, __LINE__);\n\t}\n}", "public function syncProductList()\n {\n // Evaluation only needed for custom product list and product tag\n if (!$this->isCustomList() && !$this->model_type !== ProductTag::class) return;\n\n $product_ids = $this->isCustomList() ? $this->product_ids : $this->getProductQuery()->get('id')->pluck('id')->all();\n\n $this->products()->sync($product_ids);\n }", "public function run()\n {\n $prices = [\n [\n 'product_id' => 2,\n 'user_id' => 3,\n 'price' => 18,\n 'created_at' => now(),\n 'updated_at' => now()\n ],\n [\n 'product_id' => 3,\n 'user_id' => 3,\n 'price' => 15,\n 'created_at' => now(),\n 'updated_at' => now()\n ],\n [\n 'product_id' => 2,\n 'user_id' => 4,\n 'price' => 18,\n 'created_at' => now(),\n 'updated_at' => now()\n ],\n [\n 'product_id' => 3,\n 'user_id' => 4,\n 'price' => 15,\n 'created_at' => now(),\n 'updated_at' => now()\n ],\n ];\n ProductPrice::query()->insert($prices);\n }", "public function get_prices($ids)\n\t{\n\t\t$data = '';\n\n\t\t// create comma sepearted lists\n\t\t$items = '';\n\t\tforeach ($ids as $id) {\n\t\t\tif ($items != '') {\n\t\t\t\t$items .= ',';\n\t\t\t}\n\t\t\t$items .= $id;\n\t\t}\n\n\t\t// get multiple product info based on list of ids\n\t\tif($result = $this->Database->query(\"SELECT id, price FROM $this->db_table WHERE id IN ($items) ORDER BY name\" ))\n\t\t{\n\t\t\tif($result->num_rows > 0)\n\t\t\t{\n\t\t\t\twhile($row = $result->fetch_array())\n\t\t\t\t{\n\t\t\t\t\t$data[] = array(\n\t\t\t\t\t\t'id' => $row['id'],\n\t\t\t\t\t\t'price' => $row['price']\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $data;\n\n\t}", "protected function saveUpdateProducts()\r\n\t{\r\n\t\tif (count($this->newProducts) > 0) {\r\n\t\t\t// inserir as novas\r\n\t\t\tforeach ($this->newProducts as $product) {\r\n\t\t\t\t$result = $this->client->catalogProductUpdate($this->sessionid, $product->sku, $product);\r\n\t\t\t\t$this->log->addInfo('updated', array(\"sku\" => $product->sku, \"result\" => $result));\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->newProducts = array();\r\n\t}", "public function addProductIDs($productIDs)\n {\n $parameters = $this->request->getParameters();\n $parameters->add('id', $productIDs);\n $this->recommendationsUpToDate = false;\n }", "public function execute($ids = [])\n {\n /**\n * @var $idCollection \\Bazaarvoice\\Connector\\Model\\ResourceModel\\Index\\Collection \n */\n\n if (!$this->canIndex()) {\n return false;\n }\n try {\n $this->logger->debug('Partial Product Feed Index');\n\n if (empty($ids)) {\n $idCollection = $this->bvIndexCollectionFactory->create()->addFieldToFilter('version_id', 0);\n $idCollection->getSelect()->group('product_id');\n $idCollection->addFieldToSelect('product_id');\n $ids = $idCollection->getColumnValues('product_id');\n }\n\n $this->logger->debug('Found '.count($ids).' products to update.');\n\n /**\n * Break ids into pages \n */\n $productIdSets = array_chunk($ids, 50);\n\n /**\n * Time throttling \n */\n $limit = ($this->configProvider->getCronjobDurationLimit() * 60) - 10;\n $stop = time() + $limit;\n $counter = 0;\n do {\n if (time() > $stop) {\n break;\n }\n\n $productIds = array_pop($productIdSets);\n if (!is_array($productIds)\n || count($productIds) == 0\n ) {\n break;\n }\n\n $this->logger->debug('Updating product ids '.implode(',', $productIds));\n\n $this->reindexProducts($productIds);\n $counter += count($productIds);\n } while (1);\n\n if ($counter) {\n if ($counter < count($ids)) {\n $changelogTable = $this->resourceConnection->getTableName('bazaarvoice_product_cl');\n $indexTable = $this->resourceConnection->getTableName('bazaarvoice_index_product');\n $this->resourceConnection->getConnection('core_write')\n ->query(\"INSERT INTO `$changelogTable` (`entity_id`) SELECT `product_id` FROM `$indexTable` WHERE `version_id` = 0;\");\n }\n $this->logStats();\n }\n } catch (Exception $e) {\n $this->logger->crit($e->getMessage().\"\\n\".$e->getTraceAsString());\n }\n\n return true;\n }", "public function gETPriceIdPriceListRequest($price_id)\n {\n // verify the required parameter 'price_id' is set\n if ($price_id === null || (is_array($price_id) && count($price_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $price_id when calling gETPriceIdPriceList'\n );\n }\n\n $resourcePath = '/prices/{priceId}/price_list';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($price_id !== null) {\n $resourcePath = str_replace(\n '{' . 'priceId' . '}',\n ObjectSerializer::toPathValue($price_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function deleteProductsVariantsPricelistPriceRequest($product_id, $variant_id, $pricelist_id)\n {\n // verify the required parameter 'product_id' is set\n if ($product_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $product_id when calling deleteProductsVariantsPricelistPrice'\n );\n }\n if ($product_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$product_id\" when calling DefaultApi.deleteProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'variant_id' is set\n if ($variant_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $variant_id when calling deleteProductsVariantsPricelistPrice'\n );\n }\n if ($variant_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$variant_id\" when calling DefaultApi.deleteProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'pricelist_id' is set\n if ($pricelist_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pricelist_id when calling deleteProductsVariantsPricelistPrice'\n );\n }\n if ($pricelist_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$pricelist_id\" when calling DefaultApi.deleteProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n $resourcePath = '/products/{productId}/variants/{variantId}/prices/{pricelistId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($product_id !== null) {\n $resourcePath = str_replace(\n '{' . 'productId' . '}',\n ObjectSerializer::toPathValue($product_id),\n $resourcePath\n );\n }\n // path params\n if ($variant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'variantId' . '}',\n ObjectSerializer::toPathValue($variant_id),\n $resourcePath\n );\n }\n // path params\n if ($pricelist_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pricelistId' . '}',\n ObjectSerializer::toPathValue($pricelist_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n \n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function updateProductListPivot()\n {\n $model = $this->productListable;\n $products = $model->products()->get('id');\n $this->products()->sync($products->pluck('id'));\n }", "protected function getProductsVariantsPricelistPriceRequest($product_id, $variant_id, $pricelist_id)\n {\n // verify the required parameter 'product_id' is set\n if ($product_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $product_id when calling getProductsVariantsPricelistPrice'\n );\n }\n if ($product_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$product_id\" when calling DefaultApi.getProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'variant_id' is set\n if ($variant_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $variant_id when calling getProductsVariantsPricelistPrice'\n );\n }\n if ($variant_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$variant_id\" when calling DefaultApi.getProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'pricelist_id' is set\n if ($pricelist_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pricelist_id when calling getProductsVariantsPricelistPrice'\n );\n }\n if ($pricelist_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$pricelist_id\" when calling DefaultApi.getProductsVariantsPricelistPrice, must be bigger than or equal to 1.');\n }\n $resourcePath = '/products/{productId}/variants/{variantId}/prices/{pricelistId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($product_id !== null) {\n $resourcePath = str_replace(\n '{' . 'productId' . '}',\n ObjectSerializer::toPathValue($product_id),\n $resourcePath\n );\n }\n // path params\n if ($variant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'variantId' . '}',\n ObjectSerializer::toPathValue($variant_id),\n $resourcePath\n );\n }\n // path params\n if ($pricelist_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pricelistId' . '}',\n ObjectSerializer::toPathValue($pricelist_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n \n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function publishAbstractPriceProductByByProductAbstractIds(array $productAbstractIds): void;", "public function execute($ids)\n {\n // TODO: check configurable products\n\n $storeIds = array_keys($this->storeManager->getStores());\n foreach ($storeIds as $storeId) {\n if (!$this->configHelper->isEnabled($storeId)) {\n $this->logger->info('[LOGSHUBSEARCH] Synchronizing disabled for #'.$storeId);\n return;\n }\n if (!$this->configHelper->isReadyToIndex($storeId)) {\n $this->logger->error('[LOGSHUBSEARCH] Unable to update products index. Configuration error #'.$storeId);\n return;\n }\n\n if (!is_array($ids) || empty($ids)) {\n $ids = $this->getAllProductIds();\n $this->logger->info('[LOGSHUBSEARCH] Synchronizing all the '.count($ids).' products, store: #'.$storeId);\n }\n \n $sender = $this->helper->getProductsSender($storeId);\n $pageLength = $this->configHelper->getProductsIndexerPageLength($storeId);\n foreach (array_chunk($ids, $pageLength) as $chunk) {\n $apiProducts = $this->helper->getApiProducts($chunk);\n $sender->synch($apiProducts);\n }\n }\n }", "public function addShippingPrice($productID, $shippingPriceList){\n\n global $db;\n\n if(!is_numeric($productID) || !is_array($shippingPriceList) || count($shippingPriceList) < 1){\n return;\n }\n\n foreach($shippingPriceList as $shippingPrice){\n $param = ['productID' => $productID, 'locationID' => $shippingPrice['locationID'], 'price' => fn_buckys_get_btc_price_formated($shippingPrice['price']),];\n\n $db->insertFromArray(TABLE_SHOP_SHIPPING_PRICE, $param);\n\n }\n\n }", "protected function doActionSetSalePrice()\n {\n $form = new \\XLite\\Module\\CDev\\Sale\\View\\Form\\SaleSelectedDialog();\n $form->getRequestData();\n\n if ($form->getValidationMessage()) {\n \\XLite\\Core\\TopMessage::addError($form->getValidationMessage());\n } elseif (!$this->getSelected() && $ids = $this->getActionProductsIds()) {\n $qb = \\XLite\\Core\\Database::getRepo('XLite\\Model\\Product')->createQueryBuilder();\n $alias = $qb->getMainAlias();\n $qb->update('\\XLite\\Model\\Product', $alias)\n ->andWhere($qb->expr()->in(\"{$alias}.product_id\", $ids));\n\n foreach ($this->getUpdateInfoElement() as $key => $value) {\n $qb->set(\"{$alias}.{$key}\", \":{$key}\")\n ->setParameter($key, $value);\n }\n\n $qb->execute();\n\n \\XLite\\Core\\TopMessage::addInfo('Products information has been successfully updated');\n } else {\n \\XLite\\Core\\Database::getRepo('\\XLite\\Model\\Product')->updateInBatchById($this->getUpdateInfo());\n \\XLite\\Core\\TopMessage::addInfo('Products information has been successfully updated');\n }\n\n $this->setReturnURL($this->buildURL('product_list', '', ['mode' => 'search']));\n }", "function editPrices() {\n\t\tglobal $HTML;\n\t\tglobal $page;\n\t\tglobal $id;\n\t\t$HTML->details(1);\n\n\t\t$this->getPrices();\n\n\t\t$price_groups = $this->priceGroupClass->getItems();\n\t\t$countries = $this->countryClass->getItems();\n\n\t\t$_ = '';\n\t\t$_ .= '<div class=\"c init:form form:action:'.$page->url.'\" id=\"container:prices\">';\n\t\t$_ .= '<div class=\"c\">';\n\n\t\t$_ .= $HTML->inputHidden(\"id\", $id);\n\t\t$_ .= $HTML->inputHidden(\"item_id\", $id);\n\n\t\t$_ .= $HTML->head(\"Prices\", \"2\");\n\n\t\tif(Session::getLogin()->validatePage(\"prices_update\")) {\n\t\t\t$_ .= $HTML->inputHidden(\"page_status\", \"prices_update\");\n\t\t}\n\n\t\tif($this->item() && count($this->item[\"id\"]) == 1) {\n\n\t\t\tforeach($countries[\"id\"] as $country_key => $country_id) {\n\n\t\t\t\t$_ .= '<div class=\"ci33\">';\n\n\t\t\t\t\t$_ .= $HTML->head($countries[\"values\"][$country_key], 3);\n\n\t\t\t\t\tforeach($price_groups[\"uid\"] as $index => $price_group_uid) {\n\t\t\t\t\t\t$price = ($this->item[\"price\"][0] && isset($this->item[\"price\"][0][$country_id][$price_group_uid])) ? $this->item[\"price\"][0][$country_id][$price_group_uid] : \"\";\n\t\t\t\t\t\t$_ .= $HTML->input($price_groups[\"values\"][$index], \"prices[$country_id][$price_group_uid]\", $price);\n\t\t\t\t\t}\n\n\t\t\t\t\t$_ .= $HTML->separator();\n\t\t\t\t$_ .= '</div>';\n\n\t\t\t}\n\t\t}\n\n\t\t$_ .= '</div>';\n\n\t\t$_ .= $HTML->smartButton($this->translate(\"Cancel\"), false, \"prices_cancel\", \"fleft key:esc\");\n\t\t$_ .= $HTML->smartButton($this->translate(\"Save\"), false, \"prices_update\", \"fright key:s\");\n\n\t\t$_ .= '</div>';\n\n\t\treturn $_;\n\t}", "public function getOnSaleProducts_List (array $listOptions = array()) {\n // global $app;\n // $options['sort'] = 'shop_products.DateUpdated';\n // $options['order'] = 'DESC';\n // $options['_fshop_products.Status'] = join(',', dbquery::getProductStatusesWhenAvailable()) . ':IN';\n // $options['_fshop_products.Price'] = 'PrevPrice:>';\n // $options['_fshop_products.Status'] = 'DISCOUNT';\n // $config = dbquery::shopGetProductList_NewItems($options);\n // if (empty($config))\n // return null;\n // $self = $this;\n // $callbacks = array(\n // \"parse\" => function ($items) use($self) {\n // $_items = array();\n // foreach ($items as $key => $orderRawItem) {\n // $_items[] = $self->getProductByID($orderRawItem['ID']);\n // }\n // return $_items;\n // }\n // );\n // $dataList = $app->getDB()->getDataList($config, $options, $callbacks);\n // return $dataList;\n\n\n $self = $this;\n $params = array();\n $params['list'] = $listOptions;\n $params['callbacks'] = array(\n 'parse' => function ($dbRawItem) use ($self) {\n return $self->getProductByID($dbRawItem['ID']);\n }\n );\n\n return dbquery::fetchOnSaleProducts_List($params);\n }", "public function setListPrice(float $listPrice)\n\t{\n\t\t$this->addKeyValue('list_price', $listPrice); \n\n\t}", "public function bulkproducts() {\n\n $this->checkPlugin();\n\n if ( $_SERVER['REQUEST_METHOD'] === 'POST' ){\n //insert products\n $requestjson = file_get_contents('php://input');\n\n $requestjson = json_decode($requestjson, true);\n\n if (!empty($requestjson) && count($requestjson) > 0) {\n\n $this->addProducts($requestjson);\n }else {\n $this->response->setOutput(json_encode(array('success' => false)));\n }\n\n }else if ( $_SERVER['REQUEST_METHOD'] === 'PUT' ){\n //update products\n $requestjson = file_get_contents('php://input');\n $requestjson = json_decode($requestjson, true);\n\n if (!empty($requestjson) && count($requestjson) > 0) {\n $this->updateProducts($requestjson);\n }else {\n $this->response->setOutput(json_encode(array('success' => false)));\n }\n\n }\n }", "public function actionGetProductPrice($id=null)\n {\n $userData = User::find()->andFilterWhere(['u_id' => $id])->andWhere(['IS NOT', 'u_mws_seller_id', null])->all();\n\n foreach ($userData as $user) {\n \\Yii::$app->data->getMwsDetails($user->u_mws_seller_id, $user->u_mws_auth_token);\n $models = FbaAllListingData::find()->andWhere(['created_by' => $user->u_id])->all(); //->andWhere(['status' => 'Active'])\n\n foreach ($models as $model) {\n if ($model->seller_sku) {\n $productDetails = \\Yii::$app->api->getProductCompetitivePrice($model->seller_sku);\n if ($productDetails) {\n $model->buybox_price = $productDetails;\n if ($model->save(false)) {\n echo $model->asin1 . \" is Updated.\";\n }\n }\n }\n sleep(3);\n }\n }\n }", "public function Save($id, $desc, $rating, $genre, $developer, $listPrice, $releaseDate)\n {\t\n\t\ttry\n\t\t{\t\n\t\t\t$response = $this->_obj->Execute(\"Product(\" . $id . \")\" );\n\t\t\t$products = $response->Result;\n\t\t\tforeach ($products as $product) \n\t\t\t{\n\t\t\t\t$product->ProductDescription = $desc;\n\t\t\t\t$product->ListPrice = str_replace('$', '', $listPrice);\n\t\t\t\t$product->ReleaseDate = $releaseDate;\n\t\t\t\t$product->ProductVersion = $product->ProductVersion;\n\t\t\t\t$this->_obj->UpdateObject($product);\n\t\t\t}\n\t\t\t$this->_obj->SaveChanges(); \n\t\t\t$response = $this->_obj->Execute(\"Game?\\$filter=ProductID eq \" . $id );;\n\t\t\t$games = $response->Result;\n\t\t\tforeach ($games as $game) \n\t\t\t{\n\t\t\t\t$game->Rating = str_replace('%20', ' ', $rating);\n\t\t\t\t$game->Genre = str_replace('%20', ' ', $genre);\n\t\t\t\t$game->Developer = $developer;\n\t\t\t\t$game->GameVersion = $game->GameVersion;\n\t\t\t\t$this->_obj->UpdateObject($game);\n\t\t\t}\n\t\t\t$this->_obj->SaveChanges();\n\t\t\t$products[0]->Game = $games;\n\t\t\treturn $products[0];\n }\n catch(ADODotNETDataServicesException $e)\n {\n\t\t\t echo \"Error: \" . $e->getError() . \"<br>\" . \"Detailed Error: \" . $e->getDetailedError();\n }\n }", "function updateRetailerProductList($con, $ProductIdList, $TypeList, $QuantityList, $PriceList){\n $result = true;\n\n // iterate through each card and process individually\n foreach($ProductIdList as $key => $ProductId){\n\n if(doesSellsExist($con, $ProductId, $TypeList[$key])){\n\n // if card exists, update\n $result = updateSells($con, $ProductId, $TypeList[$key], $QuantityList[$key], $PriceList[$key]);\n\n } else if(doesSellsExist($con, abs($ProductId), $TypeList[$key])){\n // if card id is negative it has been marked for deletion\n $result = deleteSells($con, abs($ProductId), $TypeList[$key]);\n\n }\n\n if(!$result) return $result;\n }\n\n return $result;\n}", "protected function _getCatalogProductPriceData($productIds = null)\n {\n $connection = $this->getConnection();\n $catalogProductIndexPriceSelect = [];\n\n foreach ($this->dimensionCollectionFactory->create() as $dimensions) {\n if (!isset($dimensions[WebsiteDimensionProvider::DIMENSION_NAME]) ||\n $this->websiteId === null ||\n $dimensions[WebsiteDimensionProvider::DIMENSION_NAME]->getValue() === $this->websiteId) {\n $select = $connection->select()->from(\n $this->tableResolver->resolve('catalog_product_index_price', $dimensions),\n ['entity_id', 'customer_group_id', 'website_id', 'min_price']\n );\n if ($productIds) {\n $select->where('entity_id IN (?)', $productIds);\n }\n $catalogProductIndexPriceSelect[] = $select;\n }\n }\n\n $catalogProductIndexPriceUnionSelect = $connection->select()->union($catalogProductIndexPriceSelect);\n\n $result = [];\n foreach ($connection->fetchAll($catalogProductIndexPriceUnionSelect) as $row) {\n $result[$row['website_id']][$row['entity_id']][$row['customer_group_id']] = round($row['min_price'], 2);\n }\n\n return $result;\n }", "public function create_individual_product_list ($all_product_ids, $all_qtys) {\n \n foreach(array_combine($all_product_ids, $all_qtys) as $value => $tally){\n \n $key_location = array_search($value, array_column($this->json_source_array['products'], 'id'));\n \n // Add multiple entries when there are multiples of a product\n \n while ($this->qty_counter < $tally) {\n $this->category_price[$this->counter]['category'] = $this->json_source_array['products'][$key_location]['category'];\n $this->category_price[$this->counter]['price'] = $this->json_source_array['products'][$key_location]['price'];\n \n $this->qty_counter += 1;\n $this->counter += 1;\n } \n \n $this->qty_counter = 0;\n }\n\n }", "public function test_comicEntityIsCreated_prices_setPrices()\n {\n $sut = $this->getSUT();\n $prices = $sut->getPrices();\n $expected = [\n Price::create(\n 'printPrice',\n 19.99\n ),\n ];\n\n $this->assertEquals($expected, $prices);\n }", "public function loadPriceData($storeId, $productIds)\r\n {\r\n $websiteId = $this->getStore($storeId)->getWebsiteId();\r\n\r\n // check if entities data exist in price index table\r\n $select = $this->getConnection()->select()\r\n ->from(['p' => $this->getTable('catalog_product_index_price')])\r\n ->where('p.customer_group_id = ?', 0) // for all customers\r\n ->where('p.website_id = ?', $websiteId)\r\n ->where('p.entity_id IN (?)', $productIds);\r\n\r\n $result = $this->getConnection()->fetchAll($select);\r\n\t\t\r\n\t\treturn $result;\r\n\r\n if ($this->limiter > 3) {\r\n return $result;\r\n }\r\n\r\n // new added product prices may not be populated into price index table in some reason,\r\n // try to force reindex for unprocessed entities\r\n $processedIds = [];\r\n foreach ($result as $priceData) {\r\n $processedIds[] = $priceData['entity_id'];\r\n }\r\n $diffIds = array_diff($productIds, $processedIds);\r\n if (!empty($diffIds)) {\r\n $this->getPriceIndexer()->executeList($diffIds);\r\n $this->limiter += 1;\r\n $this->loadPriceData($storeId, $productIds);\r\n }\r\n\r\n return $result;\r\n }", "public function saved(Price $price)\n {\n PriceItem::where('price_id', $price->id)->delete();\n\n $productId = request()->input('product_id');\n\n foreach (request()->input('prices', []) as $priceInput) {\n $priceCategoryAttributes = [\n 'product_id' => $productId,\n ];\n\n foreach (config('app.locales') as $lang => $locale) {\n $priceCategoryAttributes[\"title_{$lang}\"] = $priceInput['category'][$lang];\n }\n\n $priceCategory = PriceCategory::firstOrCreate($priceCategoryAttributes);\n\n $priceItemAttributes = [\n 'price_id' => $price->id,\n 'price_category_id' => $priceCategory->id,\n ];\n foreach ($priceInput['items'] as $item) {\n $priceItemAttributes['price'] = $item['price'];\n $priceItemAttributes['date_start'] = $item['date_start'];\n $priceItemAttributes['date_end'] = $item['date_end'];\n\n foreach (config('app.locales') as $lang => $locale) {\n $priceItemAttributes[\"title_{$lang}\"] = $item['title'][$lang];\n }\n }\n\n PriceItem::create($priceItemAttributes);\n }\n }", "protected function listProductsVariantsPricelistPricesRequest($product_id, $variant_id)\n {\n // verify the required parameter 'product_id' is set\n if ($product_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $product_id when calling listProductsVariantsPricelistPrices'\n );\n }\n if ($product_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$product_id\" when calling DefaultApi.listProductsVariantsPricelistPrices, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'variant_id' is set\n if ($variant_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $variant_id when calling listProductsVariantsPricelistPrices'\n );\n }\n if ($variant_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$variant_id\" when calling DefaultApi.listProductsVariantsPricelistPrices, must be bigger than or equal to 1.');\n }\n $resourcePath = '/products/{productId}/variants/{variantId}/prices';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($product_id !== null) {\n $resourcePath = str_replace(\n '{' . 'productId' . '}',\n ObjectSerializer::toPathValue($product_id),\n $resourcePath\n );\n }\n // path params\n if ($variant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'variantId' . '}',\n ObjectSerializer::toPathValue($variant_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n \n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public static function updateDealProducts($deal_id, $order_data, $deal_info) {\n\t\t$result = false;\n\t\tif (self::checkConnection()) {\n\t\t\t$old_prod_rows = Rest::execute('crm.deal.productrows.get', [\n\t\t\t\t'id' => $deal_id\n\t\t\t]);\n\t\t\t$new_rows = [];\n\t\t\t// Products list of deal\n\t\t\tforeach ($order_data['PRODUCTS'] as $k => $item) {\n\t\t\t\t// Discount\n\t\t\t\t$price = $item['PRICE'];\n\t\t\t\t// Product fields\n\t\t\t\t$deal_prod = [\n\t\t\t\t\t'PRODUCT_NAME' => $item['PRODUCT_NAME'],\n\t\t\t\t\t'QUANTITY' => $item['QUANTITY'],\n\t\t\t\t\t'DISCOUNT_TYPE_ID' => 1,\n\t\t\t\t\t'DISCOUNT_SUM' => $item['DISCOUNT_SUM'],\n\t\t\t\t\t'MEASURE_CODE' => $item['MEASURE_CODE'],\n\t\t\t\t\t'TAX_RATE' => $item['TAX_RATE'],\n\t\t\t\t\t'TAX_INCLUDED' => $item['TAX_INCLUDED'],\n\t\t\t\t];\n\t\t\t\tif ($item['TAX_INCLUDED']) {\n\t\t\t\t\t$deal_prod['PRICE_EXCLUSIVE'] = $price;\n\t\t\t\t\t$deal_prod['PRICE'] = $price + $price * 0.01 * (int)$item['TAX_RATE'];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$deal_prod['PRICE'] = $price;\n\t\t\t\t}\n\t\t\t\t$new_rows[] = $deal_prod;\n\t\t\t}\n//\t\t\t// Delivery\n//\t\t\t$delivery_sync_type = Settings::get('products_delivery');\n//\t\t\tif (!$delivery_sync_type || ($delivery_sync_type == 'notnull' && $order_data['DELIVERY_PRICE'])) {\n//\t\t\t\t$new_rows[] = [\n//\t\t\t\t\t'PRODUCT_ID' => 'delivery',\n//\t\t\t\t\t'PRODUCT_NAME' => Loc::getMessage(\"SP_CI_PRODUCTS_DELIVERY\"),\n//\t\t\t\t\t'PRICE' => $order_data['DELIVERY_PRICE'],\n//\t\t\t\t\t'QUANTITY' => 1,\n//\t\t\t\t];\n//\t\t\t}\n\t\t\t// Check changes\n\t\t\t$new_rows = self::convEncForDeal($new_rows);\n\t\t\t$has_changes = false;\n\t\t\tif (count($new_rows) != count($old_prod_rows)) {\n\t\t\t\t$has_changes = true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tforeach ($new_rows as $j => $row) {\n\t\t\t\t\tforeach ($row as $k => $value) {\n\t\t\t\t\t\tif ($value != $old_prod_rows[$j][$k]) {\n\t\t\t\t\t\t\t$has_changes = true;\n\t\t\t\t\t\t\tcontinue 2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Send request\n\t\t\tif ($has_changes) {\n\t\t\t\t//\\Helper::Log('(updateDealProducts) deal '.$deal_id.' changed products '.print_r($new_rows, true));\n\t\t\t\t$resp = Rest::execute('crm.deal.productrows.set', [\n\t\t\t\t\t'id' => $deal_id,\n\t\t\t\t\t'rows' => $new_rows\n\t\t\t\t]);\n\t\t\t\tif ($resp) {\n\t\t\t\t\t$result = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "public function setProductIDs($productIDs)\n {\n $parameters = $this->request->getParameters();\n $parameters['id'] = $productIDs;\n $this->recommendationsUpToDate = false;\n }", "public function import_products() {\n\n\t\t// Make sure this was triggered by a real person\n\t\tif ( ! check_admin_referer( 'amazon_product_import') ) {\n\t\t\twp_die( \n\t\t\t\t__( 'Invalid nonce specified', $this->plugin_name ), \n\t\t\t\t__( 'Error', $this->plugin_name ), \n\t\t\t\t[\n\t\t\t\t\t'response' \t=> 403,\n\t\t\t\t\t'back_link' => 'admin.php?page=' . $this->plugin_name,\n\t\t\t\t]\n\t\t\t);\n\t\t\texit;\n\t\t}\n\n\t\t// Get a list of all the product IDs that we want to update\n\t\t$products = $this->collect_product_identifiers();\n\n\t\t// If we have some IDs\n\t\tif ( !empty($products) ) {\n\n\t\t\t// Lets fetch the updates from Amazon via the SDK\n\t\t\t$updates = $this->fetch_items($products);\n\n\t\t\t// Remove the error key in the array\n\t\t\t$errors = $updates['error'];\n\t\t\tunset($updates['error']);\n\n\t\t\tif ( !empty($updates) && count($errors) === 0 ) {\n\t\t\t\t// Now lets update our DB with the new information\n\t\t\t\t$this->update_items($updates);\n\n\t\t\t\t// Finally lets throw up a confirmation box to the user and redirect\n\t\t\t\twp_redirect( admin_url( 'admin.php?page=amazon-product-import%2Fadmin%2Fpartials%2Famazon-product-import-admin-display.php&success=true' ) );\n exit;\n\t\t\t}\n\t\t\telse if (count($errors) > 0) {\n\t\t\t\t// Store the errors in a transient\n\t\t\t\tset_transient( 'amazon-import-errors', $errors, MINUTE_IN_SECONDS );\n\t\t\t\t// Finally lets throw up an error box to the user and redirect\n\t\t\t\twp_redirect( admin_url( 'admin.php?page=amazon-product-import%2Fadmin%2Fpartials%2Famazon-product-import-admin-display.php&success=false' ) );\n exit;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// No updates\n\t\t\t\t// Finally lets throw up a confirmation box to the user and redirect\n\t\t\t\twp_redirect( admin_url( 'admin.php?page=amazon-product-import%2Fadmin%2Fpartials%2Famazon-product-import-admin-display.php&success=true' ) );\n exit;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t// No products to import\n\t\t\t// Finally lets throw up a confirmation box to the user and redirect\n\t\t\twp_redirect( admin_url( 'admin.php?page=amazon-product-import%2Fadmin%2Fpartials%2Famazon-product-import-admin-display.php&success=true' ) );\n\t\t\texit;\n\t\t}\n\n\t\n\t}", "public function hookActionProductUpdate($params)\n {\n $config = Tools::jsonDecode(Configuration::get('KB_PUSH_NOTIFICATION'), true);\n \n if (!empty($config) && isset($config['module_config']['enable'])) {\n $module_config = $config['module_config'];\n if (!empty($params) && isset($params['id_product'])) {\n $product = $params['product'];\n $id_product = $params['id_product'];\n $subscribed_products = DB::getInstance()->executeS(\n 'SELECT sm.*,s.reg_id as id_reg FROM ' . _DB_PREFIX_ . 'kb_web_push_product_subscriber_mapping sm INNER JOIN '._DB_PREFIX_.'kb_web_push_subscribers s on (s.id_subscriber=sm.id_subscriber AND s.id_shop='.(int)$this->context->shop->id.') '\n . ' where sm.id_shop='.(int)$this->context->shop->id.' AND sm.id_product=' . (int) $id_product\n );\n $stock_reg_ids = array();\n $price_reg_ids = array();\n $fcm_setting = Tools::jsonDecode(Configuration::get('KB_PUSH_FCM_SERVER_SETTING'), true);\n if (!empty($fcm_setting)) {\n $fcm_server_key = $fcm_setting['server_key'];\n $headers = array(\n 'Authorization:key=' . $fcm_server_key,\n 'Content-Type:application/json'\n );\n if (!empty($subscribed_products)) {\n foreach ($subscribed_products as $sub_product) {\n $id_lang = $sub_product['id_lang'];\n $id_shop = $sub_product['id_shop'];\n $product_list = new Product($id_product, $id_lang, $id_shop);\n \n $id_customer = Db::getInstance()->getValue('SELECT id_customer FROM ' . _DB_PREFIX_ . 'guest where id_guest=' . (int) $sub_product['id_guest']);\n $id_product_attribute = $sub_product['id_product_attribute'];\n $priceDisplay = Product::getTaxCalculationMethod($id_customer);\n $productPrice = Product::getPriceStatic($id_product, false, $id_product_attribute, 6);\n if (!$priceDisplay || $priceDisplay == 2) {\n $productPrice = Product::getPriceStatic($id_product, true, $id_product_attribute, 6);\n }\n $subscriber_usr = KbPushSubscribers::getSubscriberRegIDs($sub_product['id_guest'], $id_shop);\n if ($module_config['enable_product_stock_alert']) {\n if (($sub_product['subscribe_type'] == 'stock') && ($sub_product['is_sent'] == 0)) {\n $stock_quantity = StockAvailable::getQuantityAvailableByProduct($id_product, $id_product_attribute, $id_shop);\n if ($stock_quantity > 0) {\n $reg_id = $sub_product['id_reg'];\n// if (!empty($subscriber_usr)) {\n// $reg_id = $subscriber_usr[count($subscriber_usr)-1]['reg_id'];\n// }\n// d($reg_id);\n $kbProduct = new KbPushProductSubscribers($sub_product['id_mapping']);\n $kbProduct->is_sent = 1;\n $kbProduct->sent_at = date('Y-m-d H:i:s');\n $kbProduct->update();\n $id_template = KbPushTemplates::getNotificationTemplateIDByType(self::KBPN_BACK_IN_STOCK_ALERT);\n if (!empty($id_template)) {\n $fields = array();\n $productURL = $this->context->link->getProductLink($id_product);\n $fields = $this->getNotificationPushData($id_template, $id_lang, $id_shop, $productURL);\n if (!empty($fields) && !empty($reg_id)) {\n $message = '';\n if (isset($fields['data']['body'])) {\n $message = $fields['data']['body'];\n $message = str_replace('{{kb_item_name}}', $product_list->name, $message);\n $message = str_replace('{{kb_item_current_price}}', Tools::displayPrice($productPrice), $message);\n $fields['data']['body'] = $message;\n }\n $fields['to'] = $reg_id;\n $fields[\"data\"][\"base_url\"] = $this->getBaseUrl();\n $fields[\"data\"][\"click_url\"] = $this->context->link->getModuleLink($this->name, 'serviceworker', array('action' => 'updateClickPush'), (bool) Configuration::get('PS_SSL_ENABLED'));\n $is_sent = 1;\n $kbTemplate = new KbPushTemplates($id_template, false, $id_shop);\n if (!empty($kbTemplate) && !empty($kbTemplate->id)) {\n $push_id = $this->savePushNotification($kbTemplate, $is_sent, array($reg_id));\n if (!empty($push_id)) {\n $fields[\"data\"][\"push_id\"] = $push_id;\n $result = $this->sendPushRequestToFCM($headers, $fields);\n }\n }\n }\n }\n }\n }\n }\n if ($module_config['enable_product_price_alert']) {\n if (($sub_product['subscribe_type'] == 'price') && ($sub_product['is_sent'] == 0)) {\n if ($productPrice < $sub_product['product_price']) {\n $reg_id = $sub_product['id_reg'];\n //d($reg_id);\n// d($subscriber_usr);\n// if (!empty($subscriber_usr)) {\n// $reg_id = $subscriber_usr[count($subscriber_usr)-1]['reg_id'];\n// }\n $kbProduct = new KbPushProductSubscribers($sub_product['id_mapping']);\n $kbProduct->product_price = $productPrice;\n $kbProduct->is_sent = 0;\n $kbProduct->sent_at = date('Y-m-d H:i:s');\n $kbProduct->update();\n $id_template = KbPushTemplates::getNotificationTemplateIDByType(self::KBPN_PRICE_ALERT);\n if (!empty($id_template)) {\n $fields = array();\n $productURL = $this->context->link->getProductLink($id_product);\n $fields = $this->getNotificationPushData($id_template, $id_lang, $id_shop, $productURL);\n if (!empty($fields) && !empty($reg_id)) {\n $message = '';\n if (isset($fields['data']['body'])) {\n $message = $fields['data']['body'];\n $message = str_replace('{{kb_item_name}}', $product_list->name, $message);\n $message = str_replace('{{kb_item_current_price}}', Tools::displayPrice($productPrice), $message);\n $message = str_replace('{{kb_item_old_price}}', Tools::displayPrice($sub_product['product_price']), $message);\n $fields['data']['body'] = $message;\n }\n $fields['to'] = $reg_id;\n $fields[\"data\"][\"base_url\"] = $this->getBaseUrl();\n $fields[\"data\"][\"click_url\"] = $this->context->link->getModuleLink($this->name, 'serviceworker', array('action' => 'updateClickPush'), (bool) Configuration::get('PS_SSL_ENABLED'));\n $is_sent = 1;\n $kbTemplate = new KbPushTemplates($id_template, false, $id_shop);\n $push_id = $this->savePushNotification($kbTemplate, $is_sent, array($reg_id));\n if (!empty($push_id)) {\n $fields[\"data\"][\"push_id\"] = $push_id;\n $result = $this->sendPushRequestToFCM($headers, $fields);\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n return true;\n }", "public function executeList(array $ids)\n {\n $this->smartCollectionsHelper->createSmartCollections();\n }", "public function putMany($ids, $data)\n {\n $sql = \"UPDATE `%s` SET `%s` = ? WHERE `%s` IN (%s)\";\n $column = array_keys($data)[0];\n $placeholders = implode(\", \", array_fill(0, count($ids), \"?\"));\n $this->_sql[] = sprintf($sql, $this->_table, $column, $this->_key, $placeholders);\n $parameters = array(\n array($column => $data[$column])\n );\n foreach ($ids as $id) {\n $parameters[] = array($this->_key => $id);\n }\n $this->_parameters[] = $this->parameterize($parameters);\n return $this->run();\n }", "public function removeShippingPriceByIDs($idList){\n\n global $db;\n\n if(!is_array($idList)){\n $idList = [$idList];\n }\n\n if(!is_array($idList) || count($idList) < 1)\n return;\n\n $query = sprintf('DELETE FROM %s WHERE id IN (%s)', TABLE_SHOP_SHIPPING_PRICE, implode(',', $idList));\n\n return $db->query($query);\n\n }", "public function processPurchaseOrder($productIds)\r\n {\r\n // process every products for PO creation\r\n foreach ($productIds as $productId) {\r\n // get the additional stock received from PO\r\n $this->Inventory->addStock($productId, 20);\r\n\r\n // update PO data after receiving\r\n $this->ProductsPurchased->updatePurchaseOrderAfterReceiving($productId);\r\n }\r\n }", "function woocommerce_rrp_add_bulk_on_edit() {\n\t\t\tglobal $typenow;\n\t\t\t$post_type = $typenow;\n\t\t\t\n\t\t\tif($post_type == 'product') {\n\t\t\t\t\n\t\t\t\t// get the action\n\t\t\t\t$wp_list_table = _get_list_table('WP_Posts_List_Table'); // depending on your resource type this could be WP_Users_List_Table, WP_Comments_List_Table, etc\n\t\t\t\t$action = $wp_list_table->current_action();\n\t\t\t\t\n\t\t\t\t$allowed_actions = array(\"set_price_to_rrp\");\n\t\t\t\tif(!in_array($action, $allowed_actions)) return;\n\t\t\t\t\n\t\t\t\t// security check\n\t\t\t\tcheck_admin_referer('bulk-posts');\n\t\t\t\t\n\t\t\t\t// make sure ids are submitted. depending on the resource type, this may be 'media' or 'ids'\n\t\t\t\tif(isset($_REQUEST['post'])) {\n\t\t\t\t\t$post_ids = array_map('intval', $_REQUEST['post']);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(empty($post_ids)) return;\n\t\t\t\t\n\t\t\t\t// this is based on wp-admin/edit.php\n\t\t\t\t$sendback = remove_query_arg( array('price_setted_to_rrp', 'untrashed', 'deleted', 'ids'), wp_get_referer() );\n\t\t\t\tif ( ! $sendback )\n\t\t\t\t\t$sendback = admin_url( \"edit.php?post_type=$post_type\" );\n\t\t\t\t\n\t\t\t\t$pagenum = $wp_list_table->get_pagenum();\n\t\t\t\t$sendback = add_query_arg( 'paged', $pagenum, $sendback );\n\t\t\t\t\n\t\t\t\tswitch($action) {\n\t\t\t\t\tcase 'set_price_to_rrp':\n\t\t\t\t\t\t\n\t\t\t\t\t\t// if we set up user permissions/capabilities, the code might look like:\n\t\t\t\t\t\t//if ( !current_user_can($post_type_object->cap->export_post, $post_id) )\n\t\t\t\t\t\t//\twp_die( __('You are not allowed to export this post.') );\n\t\t\t\t\t\t\n\t\t\t\t\t\t$price_setted_to_rrp = 0;\n\t\t\t\t\t\tforeach( $post_ids as $post_id ) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$buy_price = get_post_meta($post_id, 'buy_price', true);\n\t\t\t\t\t\t\t$rrp_calc_params = array(\n\t\t\t\t\t\t\t\t'ads_cost' => get_rrp_param($post_id, 'ads_cost'),\t\n\t\t\t\t\t\t\t\t'shipping_cost' => get_rrp_param($post_id, 'shipping_cost'),\t\n\t\t\t\t\t\t\t\t'package_cost' => get_rrp_param($post_id, 'package_cost'),\t\n\t\t\t\t\t\t\t\t'min_profit' => get_rrp_param($post_id, 'min_profit'),\t\n\t\t\t\t\t\t\t\t'desired_profit' => get_rrp_param($post_id, 'desired_profit'),\t\n\t\t\t\t\t\t\t\t'tax_rate' => get_rrp_param($post_id, 'tax_rate'),\n\t\t\t\t\t\t\t);\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$caluculated_rrp = calculate_rrp($buy_price, $rrp_calc_params);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tupdate_post_meta( $post_id, '_regular_price', $caluculated_rrp );\n\t\t\t\n\t\t\t\t\t\t\t$price_setted_to_rrp++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$sendback = add_query_arg( array('price_setted_to_rrp' => $price_setted_to_rrp, 'ids' => join(',', $post_ids) ), $sendback );\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tdefault: return;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$sendback = remove_query_arg( array('action', 'action2', 'tags_input', 'post_author', 'comment_status', 'ping_status', '_status', 'post', 'bulk_edit', 'post_view'), $sendback );\n\t\t\t\t\n\t\t\t\twp_redirect($sendback);\n\t\t\t\texit();\n\t\t\t}\n\t\t}", "function findsAmazonProductsForPriceUpdate($amazonAccountsSitesId)\n{\n\t$data['from'] = 'amazon_products';\n\t$data['select'] = 'id_product, accountsite_id, SKU, lastpriceupdate';\n\t$data['where'] = \"\n\t\taccountsite_id = '\" . $amazonAccountsSitesId . \"'\n\t\";\n\treturn SQLSelect($data['from'], $data['select'], $data['where'], 0, 0, 0, 'shop', __FILE__, __LINE__);\n}", "public function calculatePrices(): void\n {\n $orders = ServiceContainer::orders();\n $pizzaPrice = $orders->calculatePizzaPrice($this->items);\n $deliveryPrice = $orders->calculateDeliveryPrice($pizzaPrice, $this->outside, $this->currency);\n $this->delivery_price = $deliveryPrice;\n $this->total_price = $pizzaPrice + $deliveryPrice;\n }", "public static function updateFlashSaleTime($listUpdate){\n $tmp = $listUpdate;\n $p = new Products();\n foreach ($p as $item => $tmp){\n\n }\n }", "public function updateBulkProductsInventory($products);", "function get_product_pricebooks($id)\n\t{\n\t\tglobal $log,$singlepane_view;\n\t\t$log->debug(\"Entering get_product_pricebooks(\".$id.\") method ...\");\n\t\tglobal $mod_strings;\n\t\trequire_once('modules/PriceBooks/PriceBooks.php');\n\t\t$focus = new PriceBooks();\n\t\t$button = '';\n\t\tif($singlepane_view == 'true')\n\t\t\t$returnset = '&return_module=Products&return_action=DetailView&return_id='.$id;\n\t\telse\n\t\t\t$returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id;\n\n\n\t\t$query = \"SELECT ec_pricebook.pricebookid as crmid,\n\t\t\tec_pricebook.*,\n\t\t\tec_pricebookproductrel.productid as prodid\n\t\t\tFROM ec_pricebook\n\t\t\tINNER JOIN ec_pricebookproductrel\n\t\t\t\tON ec_pricebookproductrel.pricebookid = ec_pricebook.pricebookid\n\t\t\tWHERE ec_pricebook.deleted = 0\n\t\t\tAND ec_pricebookproductrel.productid = \".$id;\n\t\t$log->debug(\"Exiting get_product_pricebooks method ...\");\n\t\treturn GetRelatedList('Products','PriceBooks',$focus,$query,$button,$returnset);\n\t}", "public static function productLists()\n {\n array_push(self::$products, \n [\n CART::ID => self::$id,\n CART::NAME => self::$name,\n CART::PRICE => self::$price,\n CART::QUANTITY => self::$quantity\n ]);\n }", "protected function updateQuoteProducts($quote, $products)\n {\n foreach ($products['cart'] as $id => $product) {\n $product['quote_id'] = $quote->id;\n $product['product_id'] = $id;\n\n ProductQuote::create($product);\n }\n }", "public function processOperations(\\Magento\\AsynchronousOperations\\Api\\Data\\OperationListInterface $operationList)\n {\n $pricesUpdateDto = [];\n $pricesDeleteDto = [];\n $operationSkus = [];\n foreach ($operationList->getItems() as $index => $operation) {\n $serializedData = $operation->getSerializedData();\n $unserializedData = $this->serializer->unserialize($serializedData);\n $operationSkus[$index] = $unserializedData['product_sku'];\n $pricesUpdateDto = array_merge(\n $pricesUpdateDto,\n $this->priceProcessor->createPricesUpdate($unserializedData)\n );\n $pricesDeleteDto = array_merge(\n $pricesDeleteDto,\n $this->priceProcessor->createPricesDelete($unserializedData)\n );\n }\n\n $failedDeleteItems = [];\n $failedUpdateItems = [];\n $uncompletedOperations = [];\n try {\n $failedDeleteItems = $this->tierPriceStorage->delete($pricesDeleteDto);\n $failedUpdateItems = $this->tierPriceStorage->update($pricesUpdateDto);\n } catch (\\Magento\\Framework\\Exception\\CouldNotSaveException $e) {\n $uncompletedOperations['status'] = OperationInterface::STATUS_TYPE_RETRIABLY_FAILED;\n $uncompletedOperations['error_code'] = $e->getCode();\n $uncompletedOperations['message'] = $e->getMessage();\n } catch (\\Magento\\Framework\\Exception\\CouldNotDeleteException $e) {\n $uncompletedOperations['status'] = OperationInterface::STATUS_TYPE_RETRIABLY_FAILED;\n $uncompletedOperations['error_code'] = $e->getCode();\n $uncompletedOperations['message'] = $e->getMessage();\n } catch (\\Exception $e) {\n $uncompletedOperations['status'] = OperationInterface::STATUS_TYPE_RETRIABLY_FAILED;\n $uncompletedOperations['error_code'] = $e->getCode();\n $uncompletedOperations['message'] =\n __('Sorry, something went wrong during product prices update. Please see log for details.');\n }\n\n $failedItems = array_merge($failedDeleteItems, $failedUpdateItems);\n $failedOperations = [];\n foreach ($failedItems as $failedItem) {\n if (isset($failedItem->getParameters()['SKU'])) {\n $failedOperations[$failedItem->getParameters()['SKU']] = $this->priceProcessor->prepareErrorMessage(\n $failedItem\n );\n }\n }\n\n try {\n $this->changeOperationStatus($operationList, $failedOperations, $uncompletedOperations, $operationSkus);\n } catch (\\Exception $exception) {\n // prevent consumer from failing, silently log exception\n $this->logger->critical($exception->getMessage());\n }\n }", "function addListPrice($request) {\n\t\t$sourceModule = $request->getModule();\n\t\t$sourceRecordId = $request->get('src_record');\n\t\t$relatedModule = $request->get('related_module');\n\t\t$relInfos = $request->get('relinfo');\n\n\t\t$sourceModuleModel = Vtiger_Module_Model::getInstance($sourceModule);\n\t\t$relatedModuleModel = Vtiger_Module_Model::getInstance($relatedModule);\n\t\t$relationModel = Vtiger_Relation_Model::getInstance($sourceModuleModel, $relatedModuleModel);\n\t\tforeach($relInfos as $relInfo) {\n\t\t\t$price = CurrencyField::convertToDBFormat($relInfo['price'], null, true);\n\t\t\t$relationModel->addListPrice($sourceRecordId, $relInfo['id'], $price);\n\t\t}\n\t}", "private function createMultipleProductsPlaceHolders($multipleProducts, $translations, &$args)\n\t{\n\t\t$formId = (int) $args['form']->FormId;\n\t\t$submissionId = (int) $args['submission']->SubmissionId;\n\t\t$multipleSeparator = nl2br($args['form']->MultipleSeparator);\n\t\t$properties = RSFormProHelper::getComponentProperties($multipleProducts, false);\n\t\t$priceHelper = new Price($this->loadFormSettings($formId));\n\t\t$this->translate($properties, $translations);\n\n\t\tforeach ($multipleProducts as $product)\n\t\t{\n\t\t\t$data = $properties[$product];\n\t\t\t$value = $this->getSubmissionValue($submissionId, (int) $product);\n\n\t\t\tif ($value === '' || $value === null)\n\t\t\t{\n\t\t\t\t$args['placeholders'][] = '{' . $data['NAME'] . ':amount}';\n\t\t\t\t$args['values'][] = '';\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$values = explode(\"\\n\", $value);\n\n\t\t\t$field = new MultipleProducts(\n\t\t\t\t[\n\t\t\t\t\t'formId' => $formId,\n\t\t\t\t\t'componentId' => $product,\n\t\t\t\t\t'data' => $data,\n\t\t\t\t\t'value' => ['formId' => $formId, $data['NAME'] => $values],\n\t\t\t\t\t'invalid' => false,\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t$replace = '{' . $data['NAME'] . ':price}';\n\t\t\t$with = [];\n\t\t\t$withAmount = [];\n\n\t\t\tif ($items = $field->getItems())\n\t\t\t{\n\t\t\t\tforeach ($items as $item)\n\t\t\t\t{\n\t\t\t\t\tif (empty($item))\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$item = new RSFormProFieldItem($item);\n\n\t\t\t\t\tforeach ($values as $value)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (stristr($value, $item->label))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$with[] = $priceHelper->getPriceMask(\n\t\t\t\t\t\t\t\t$value, $item->value, ($data['CURRENCY'] ?? '')\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$quantity = trim(str_ireplace($item->label, '', $value));\n\n\t\t\t\t\t\t\tif (strlen($quantity) === 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$quantity = 1;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$withAmount[] = $quantity * $item->value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (($position = array_search($replace, $args['placeholders'])) !== false)\n\t\t\t{\n\t\t\t\t$args['placeholders'][$position] = $replace;\n\t\t\t\t$args['values'][$position] = implode($multipleSeparator, $with);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$args['placeholders'][] = $replace;\n\t\t\t\t$args['values'][] = implode($multipleSeparator, $with);\n\t\t\t}\n\n\t\t\t$args['placeholders'][] = '{' . $data['NAME'] . ':amount}';\n\t\t\t$args['values'][] = $priceHelper->getAmountMask(\n\t\t\t\t($withAmount ? array_sum($withAmount) : 0), ($data['CURRENCY'] ?? '')\n\t\t\t);\n\t\t}\n\t}", "protected function createProductVariantPricelistPriceRequest($body, $product_id, $variant_id)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling createProductVariantPricelistPrice'\n );\n }\n // verify the required parameter 'product_id' is set\n if ($product_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $product_id when calling createProductVariantPricelistPrice'\n );\n }\n if ($product_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$product_id\" when calling DefaultApi.createProductVariantPricelistPrice, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'variant_id' is set\n if ($variant_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $variant_id when calling createProductVariantPricelistPrice'\n );\n }\n if ($variant_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$variant_id\" when calling DefaultApi.createProductVariantPricelistPrice, must be bigger than or equal to 1.');\n }\n $resourcePath = '/products/{productId}/variants/{variantId}/prices';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($product_id !== null) {\n $resourcePath = str_replace(\n '{' . 'productId' . '}',\n ObjectSerializer::toPathValue($product_id),\n $resourcePath\n );\n }\n // path params\n if ($variant_id !== null) {\n $resourcePath = str_replace(\n '{' . 'variantId' . '}',\n ObjectSerializer::toPathValue($variant_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n \n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function addProducts(array $products);", "public function update(Request $request, $id)\n {\n $pricelist = $this->pricelist->find($id);\n $pricelist->fill($request->except('pricelist_items'));\n $pricelist->save();\n\n $priceListItem = [];\n $requestPricelistItems = json_decode($request->pricelist_items);\n\n foreach ( $requestPricelistItems as $pricelistItem) {\n $priceListItem = [\n 'price_list_id' => $id,\n 'waste_id' => $pricelistItem->pivot->waste_id,\n 'unit_id' => $pricelistItem->unit_id,\n 'unit_price' => (double)$pricelistItem->pivot->unit_price\n ];\n $priceListItemToBeUpdated = $this->pricelistItem->where('waste_id',$pricelistItem->pivot->waste_id)\n ->where('price_list_id',$id)->first();\n if ($priceListItemToBeUpdated->count() > 0) {\n \n $priceListItemToBeUpdated->unit_price = (double)$pricelistItem->pivot->unit_price;\n $priceListItemToBeUpdated->unit_id = $pricelistItem->unit_id;\n $priceListItemToBeUpdated->save();\n\n } else {\n $pricelist->wastes()->attach($priceListItem);\n }\n }\n\n return redirect()->route('settings.pricelists')\n ->with('success', 'Pricelist has been updated!');\n }", "function fn_warehouses_gather_additional_products_data_post($product_ids, $params, &$products, $auth, $lang_code)\n{\n if (empty($product_ids) && !isset($params['get_warehouse_amount']) || $params['get_warehouse_amount'] === false) {\n return;\n }\n\n /** @var Tygh\\Addons\\Warehouses\\Manager $manager */\n $manager = Tygh::$app['addons.warehouses.manager'];\n $products = $manager->fetchProductsWarehousesAmounts($products);\n}", "public function setPriceAttribute($value)\n {\n if ( ! is_array($value)) {\n return;\n }\n foreach ($value as $currency => $price) {\n ProductPrice::updateOrCreate([\n 'product_id' => $this->id,\n 'currency_id' => Currency::where('code', $currency)->firstOrFail()->id,\n ], [\n 'price' => $price,\n ]);\n }\n }", "public function updateShippingPrice($productID, $newShippingPriceList){\n\n global $db;\n\n if(!is_numeric($productID)){\n return;\n }\n\n $newShippingLocationList = [];\n $delShippingPriceIDList = [];\n foreach($newShippingPriceList as $shippingData){\n $newShippingLocationList[$shippingData['locationID']] = $shippingData['price'];\n }\n\n $oldShippingPriceList = $this->getShippingPrice($productID);\n\n if(isset($oldShippingPriceList) && is_array($oldShippingPriceList) && count($oldShippingPriceList) > 0){\n foreach($oldShippingPriceList as $shippingData){\n if(array_key_exists($shippingData['locationID'], $newShippingLocationList)){\n $query = sprintf('UPDATE %s SET price=%s WHERE id=%d', TABLE_SHOP_SHIPPING_PRICE, $newShippingLocationList[$shippingData['locationID']], $shippingData['id']);\n $db->query($query);\n unset($newShippingLocationList[$shippingData['locationID']]);\n\n }else{\n $delShippingPriceIDList[] = $shippingData['id'];\n }\n }\n }\n\n $this->removeShippingPriceByIDs($delShippingPriceIDList);\n\n if(count($newShippingLocationList) > 0){\n foreach($newShippingLocationList as $key => $val){\n $param = ['productID' => $productID, 'locationID' => $key, 'price' => $val,];\n\n $db->insertFromArray(TABLE_SHOP_SHIPPING_PRICE, $param);\n }\n }\n\n return true;\n\n }", "function _prepareGroupedProductPriceData($entityIds = null) {\n\t\t\t$write = $this->_getWriteAdapter( );\n\t\t\t$table = $this->getIdxTable( );\n\t\t\t$select = $write->select( )->from( array( 'e' => $this->getTable( 'catalog/product' ) ), 'entity_id' )->joinLeft( array( 'l' => $this->getTable( 'catalog/product_link' ) ), 'e.entity_id = l.product_id AND l.link_type_id=' . LINK_TYPE_GROUPED, array( ) )->join( array( 'cg' => $this->getTable( 'customer/customer_group' ) ), '', array( 'customer_group_id' ) );\n\t\t\t$this->_addWebsiteJoinToSelect( $select, true );\n\t\t\t$this->_addProductWebsiteJoinToSelect( $select, 'cw.website_id', 'e.entity_id' );\n\n\t\t\tif ($this->getVersionHelper( )->isGe1600( )) {\n\t\t\t\t$minCheckSql = $write->getCheckSql( 'le.required_options = 0', 'i.min_price', 0 );\n\t\t\t\t$maxCheckSql = $write->getCheckSql( 'le.required_options = 0', 'i.max_price', 0 );\n\t\t\t\t$taxClassId = $this->_getReadAdapter( )->getCheckSql( 'MIN(i.tax_class_id) IS NULL', '0', 'MIN(i.tax_class_id)' );\n\t\t\t\t$minPrice = new Zend_Db_Expr( 'MIN(' . $minCheckSql . ')' );\n\t\t\t\t$maxPrice = new Zend_Db_Expr( 'MAX(' . $maxCheckSql . ')' );\n\t\t\t} \nelse {\n\t\t\t\t$taxClassId = new Zend_Db_Expr( 'IFNULL(i.tax_class_id, 0)' );\n\t\t\t\t$minPrice = new Zend_Db_Expr( 'MIN(IF(le.required_options = 0, i.min_price, 0))' );\n\t\t\t\t$maxPrice = new Zend_Db_Expr( 'MAX(IF(le.required_options = 0, i.max_price, 0))' );\n\t\t\t}\n\n\t\t\t$stockId = 'IF (i.stock_id IS NOT NULL, i.stock_id, 1)';\n\t\t\t$select->columns( 'website_id', 'cw' )->joinLeft( array( 'le' => $this->getTable( 'catalog/product' ) ), 'le.entity_id = l.linked_product_id', array( ) );\n\n\t\t\tif ($this->getVersionHelper( )->isGe1700( )) {\n\t\t\t\t$columns = array( 'tax_class_id' => $taxClassId, 'price' => new Zend_Db_Expr( 'NULL' ), 'final_price' => new Zend_Db_Expr( 'NULL' ), 'min_price' => $minPrice, 'max_price' => $maxPrice, 'tier_price' => new Zend_Db_Expr( 'NULL' ), 'group_price' => new Zend_Db_Expr( 'NULL' ), 'stock_id' => $stockId, 'currency' => 'i.currency', 'store_id' => 'i.store_id' );\n\t\t\t} \nelse {\n\t\t\t\t$columns = array( 'tax_class_id' => $taxClassId, 'price' => new Zend_Db_Expr( 'NULL' ), 'final_price' => new Zend_Db_Expr( 'NULL' ), 'min_price' => $minPrice, 'max_price' => $maxPrice, 'tier_price' => new Zend_Db_Expr( 'NULL' ), 'stock_id' => $stockId, 'currency' => 'i.currency', 'store_id' => 'i.store_id' );\n\t\t\t}\n\n\t\t\t$select->joinLeft( array( 'i' => $table ), '(i.entity_id = l.linked_product_id) AND (i.website_id = cw.website_id) AND ' . '(i.customer_group_id = cg.customer_group_id)', $columns );\n\t\t\t$select->group( array( 'e.entity_id', 'cg.customer_group_id', 'cw.website_id', $stockId, 'i.currency', 'i.store_id' ) )->where( 'e.type_id=?', $this->getTypeId( ) );\n\n\t\t\tif (!is_null( $entityIds )) {\n\t\t\t\t$select->where( 'l.product_id IN(?)', $entityIds );\n\t\t\t}\n\n\t\t\t$eventData = array( 'select' => $select, 'entity_field' => new Zend_Db_Expr( 'e.entity_id' ), 'website_field' => new Zend_Db_Expr( 'cw.website_id' ), 'stock_field' => new Zend_Db_Expr( $stockId ), 'currency_field' => new Zend_Db_Expr( 'i.currency' ), 'store_field' => new Zend_Db_Expr( 'cs.store_id' ) );\n\n\t\t\tif (!$this->getWarehouseHelper( )->getConfig( )->isMultipleMode( )) {\n\t\t\t\t$eventData['stock_field'] = new Zend_Db_Expr( 'i.stock_id' );\n\t\t\t}\n\n\t\t\tMage::dispatchEvent( 'catalog_product_prepare_index_select', $eventData );\n\t\t\t$query = $select->insertFromSelect( $table );\n\t\t\t$write->query( $query );\n\t\t\treturn $this;\n\t\t}", "public function populate_stocks($products) {\n\n foreach($products as &$p) {\n $this->db->select('s.id, s.name, st.stock');\n $this->db->from('stores AS s');\n $this->db->join('stocks AS st', 's.id = st.store_id', 'left');\n $this->db->where('st.products_id', $p->id);\n $p->stocks = $this->db->get()->result();\n }\n\n return $products;\n }", "public function execute($ids)\n {\n $this->smartCollectionsHelper->createSmartCollections();\n }", "public function productPrices()\n {\n return $this->belongsToMany(ProductPrice::class, 'product_prices', null, 'product_id');\n }", "function publish($ids) {\n if (!is_array($ids)) {\n $ids = array(intval($ids));\n }\n $ids = join(', ', $ids);\n $this->query(\"UPDATE {$this->useTable} SET draft = 0 WHERE id IN ($ids)\");\n }", "public function setProductIds(array $product_ids): self\n {\n $this->product_ids = $product_ids;\n return $this;\n }", "public static function getPrice(&$products_table = NULL, $uid = NULL) {\n Yii::import('application.controllers.ProfileController');\n\n if (!$products_table) { //if it's cart products table\n $table = 'store_cart';\n } else {\n $table = 'temp_order_product_' . (Yii::app()->user->id ? Yii::app()->user->id : 'exchange');\n $query = \"DROP TABLE IF EXISTS {$table};\";\n $query .= \"CREATE TEMPORARY TABLE {$table} (product_id int(11) unsigned, quantity smallint(5) unsigned);\";\n foreach ($products_table as $item) {\n\n if ($item instanceof OrderProduct || $item instanceof stdClass || $item instanceof Cart) {\n $product = Product::model()->findByAttributes(array('id' => (string) $item->product_id));\n } else {\n $product = Product::model()->findByAttributes(array('code' => (string) $item->code));\n }\n\n if ($product) {\n $query .= \"INSERT INTO {$table} VALUES ({$product->id}, {$item->quantity});\";\n } else {\n throw new Exception('Product not found. Product code: ' . $item->code);\n }\n }\n Yii::app()->db->createCommand($query)->execute();\n }\n $query = Yii::app()->db->createCommand()\n ->select('SUM(c.quantity*round(prices.price*(1-greatest(ifnull(disc.percent,0),ifnull(disc1.percent,0),ifnull(disc2.percent,0))/100))) as c_summ, prices.price_id')\n ->from($table . ' c')\n ->join('store_product product', 'c.product_id=product.id')\n ->join('store_product_price prices', 'product.id=prices.product_id')\n ->join('store_price price', 'price.id=prices.price_id')\n ->leftJoin('store_discount disc', \"disc.product_id=0 and disc.actual=1 and (disc.begin_date='0000-00-00' or disc.begin_date<=CURDATE()) and (disc.end_date='0000-00-00' or disc.end_date>=CURDATE())\")\n ->leftJoin('store_product_category cat', 'cat.product_id=product.id')\n ->leftJoin('store_discount_category discat', 'discat.category_id=cat.category_id')\n ->leftJoin('store_discount disc1', \"disc1.product_id=1 and disc1.id=discat.discount_id and disc1.actual=1 and (disc1.begin_date='0000-00-00' or disc1.begin_date<=CURDATE()) and (disc1.end_date='0000-00-00' or disc1.end_date>=CURDATE())\")\n ->leftJoin('store_discount_product dispro', 'dispro.product_id=product.id')\n ->leftJoin('store_discount disc2', \"disc2.product_id=2 and disc2.id=dispro.discount_id and disc2.actual=1 and (disc2.begin_date='0000-00-00' or disc2.begin_date<=CURDATE()) and (disc2.end_date='0000-00-00' or disc2.end_date>=CURDATE())\")\n ->order('price.summ DESC')\n ->group('prices.price_id, price.summ')\n ->having('c_summ>price.summ');\n\n if (!$products_table){\n $sid = ProfileController::getSession();\n $query->where(\"(session_id=:sid AND :sid<>'') OR (user_id=:uid AND :sid<>'')\", array(\n ':sid' => $sid,\n ':uid' => Yii::app()->user->isGuest ? '' : Yii::app()->user->id,\n ));\n }\n\n// $text = $query->getText();\n $row = $query->queryRow();\n if ($row)\n $price = self::model()->findByPk($row['price_id']);\n else\n $price = self::model()->find(array('order' => 'summ'));\n\n if ($products_table)\n Yii::app()->db->createCommand(\"DROP TABLE IF EXISTS {$table};\")->execute();\n\n if ($uid)\n $profile = CustomerProfile::model()->with('price')->findByAttributes(array('user_id' => $uid));\n else\n $profile = ProfileController::getProfile();\n\n if ($profile && $profile->price_id && $profile->price->summ > $price->summ)\n return $profile->price;\n else\n return $price;\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $model->prices = $model->getAllPrices();\n $modelPrice = [new InventoryPrice()];\n\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n $prices = Yii::$app->request->post();\n $oldPrices = ArrayHelper::map($model->prices, 'id', 'id');\n $currentPrices = ArrayHelper::map($prices['Inventory']['prices'], 'id', 'id');\n $deletedPrices = array_diff($oldPrices, array_filter($currentPrices));\n\n $transaction = Yii::$app->db->beginTransaction();\n try {\n $model->save();\n\n // detete price\n if (!empty($deletedPrices)) {\n InventoryPrice::deleteAll(['id' => $deletedPrices]);\n }\n\n foreach ($prices['Inventory']['prices'] as $key => $item) {\n if (empty($item['id'])) {\n $modelPrice = new InventoryPrice();\n $modelPrice->created_at = time();\n $modelPrice->created_by = Yii::$app->user->id;\n } else {\n $modelPrice = InventoryPrice::find()->where(['id' => $item['id']])->one();\n }\n $modelPrice->inventory_id = $model->id;\n $modelPrice->vendor_id = $item['vendor_id'];\n $modelPrice->vendor_name = @Inventory::getVendorName($modelPrice->vendor_id);\n $modelPrice->price = $item['price'];\n $modelPrice->due_date = $item['due_date'];\n $modelPrice->active = !isset($item['active']) ? InventoryPrice::STATUS_INACTIVE : $item['active'];\n\n\n if ($modelPrice->price && $modelPrice->vendor_id) {\n $modelPrice->save(false);\n }\n }\n\n\n $transaction->commit();\n Yii::$app->session->setFlash('success', 'เพิ่มสินค้าใหม่เรียบร้อย');\n return $this->redirect(['view', 'id' => $model->id]);\n } catch (Exception $e) {\n $transaction->rollBack();\n Yii::$app->session->setFlash('error', $e->getMessage());\n return $this->redirect(['update', 'id' => $model->id]);\n }\n\n\n } else {\n return $this->render('update', [\n 'model' => $model,\n 'modelPrice' => $modelPrice,\n ]);\n }\n }", "public function execute(ProductListTransfer $productListTransfer): void;", "protected function saveNewProducts()\r\n\t{\r\n\t\tif (count($this->newProducts) > 0) {\r\n\t\t\t// create new product in catalog\r\n\t\t\tforeach ($this->newProducts as $product) {\r\n\t\t\t \r\n\t\t\t $result = $this->client->catalogProductCreate($this->sessionid, $product->getProductType(), $product->getAttributeSet(), $product->sku, $product);\r\n\t\t\t \r\n\t\t\t\t$this->log->addInfo('created', array(\"sku\" => $product->sku, \"result\" => $result));\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->newProducts = array();\t\t\r\n\t}", "public function updateBulkProductsInventorySource($products);", "public function updateItems($products)\n {\n }", "public function actionUpdateProductBuyBoxPrice()\n {\n $userData = User::find()->andWhere(['IS NOT', 'u_mws_seller_id', null])->all();\n\n foreach ($userData as $user) {\n $productData = FbaAllListingData::find()->andWhere(['created_by' => $user->u_id])->all();\n $skuData = AppliedRepriserRule::find()->select(['arr_sku'])->where(['arr_user_id' => $userData->u_id])->column();\n\n foreach ($productData as $product) {\n $productBuyBox = \\Yii::$app->api->getProductCompetitivePrice($product->seller_sku);\n $product->buybox_price = $productBuyBox;\n\n if(in_array($product->seller_sku, $skuData)) {\n $magicPrice = \\Yii::$app->api->getMagicRepricerPrice($product->seller_sku, $productBuyBox, $product->repricing_min_price, $product->repricing_max_price, $product->repricing_rule_id);\n if($magicPrice) {\n $product->repricing_cost_price = $magicPrice;\n }\n }\n\n if ($product->save(false)) {\n echo $product->asin1 . \" is Updated.\";\n }\n sleep(2);\n }\n sleep(1);\n }\n }", "public function run()\n {\n ProductPrice::insert(\n \t[\n \t[\"product_id\" => 1,\n \t \"description\" => \"economical\",\n \t \"price\" => 10000\n \t],\n \t[\"product_id\" => 1,\n \t \"description\" => \"default\",\n \t \"price\" => 100000\n \t],\n \t[\"product_id\" => 1,\n \t \"description\" => \"plus\",\n \t \"price\" => 1000000\n \t],\n \t[\"product_id\" => 2,\n \t \"description\" => \"economical\",\n \t \"price\" => 10000\n \t],\n \t[\"product_id\" => 2,\n \t \"description\" => \"default\",\n \t \"price\" => 100000\n \t],\n \t[\"product_id\" => 2,\n \t \"description\" => \"plus\",\n \t \"price\" => 1000000\n \t],\n \t[\"product_id\" => 3,\n \t \"description\" => \"economical\",\n \t \"price\" => 10000\n \t],\n \t[\"product_id\" => 3,\n \t \"description\" => \"default\",\n \t \"price\" => 100000\n \t],\n \t[\"product_id\" => 3,\n \t \"description\" => \"plus\",\n \t \"price\" => 1000000\n \t],\n \t[\"product_id\" => 4,\n \t \"description\" => \"economical\",\n \t \"price\" => 10000\n \t],\n \t[\"product_id\" => 4,\n \t \"description\" => \"default\",\n \t \"price\" => 100000\n \t],\n \t[\"product_id\" => 4,\n \t \"description\" => \"plus\",\n \t \"price\" => 1000000\n \t],\n \t[\"product_id\" => 5,\n \t \"description\" => \"economical\",\n \t \"price\" => 10000\n \t],\n \t[\"product_id\" => 5,\n \t \"description\" => \"default\",\n \t \"price\" => 100000\n \t],\n \t[\"product_id\" => 5,\n \t \"description\" => \"plus\",\n \t \"price\" => 1000000\n \t]\n \t]);\n }", "public function price(StoreProductPriceRequest $request, $id){\n\n $product = Product::findOrFail($id);\n $productPrice = new ProductQuantityPrice();\n $productPrice->fill($request->all());\n $productPrice->product_id = $product->id;\n $productPrice->save();\n\n return (new ProductPrice($productPrice))\n ->response()\n ->setStatusCode(201);\n }", "public function productsAction()\n {\n $this->_initCoursedoc();\n $this->loadLayout();\n $this->getLayout()->getBlock('coursedoc.edit.tab.product')\n ->setCoursedocProducts($this->getRequest()->getPost('coursedoc_products', null));\n $this->renderLayout();\n }", "public function save($data)\n {\n /* Prices */\n $data['price_low'] = preg_replace(\"/[^0-9\\.]/\", \"\", $data['price_low']);\n $data['special_price_low'] = preg_replace(\"/[^0-9\\.]/\", \"\", $data['special_price_low']);\n\n /* Attributes */\n $attributes = array();\n foreach ($data['attributes']['title'] as $key => $title) {\n $attributes[] = array(\n 'title' => str_replace('\"', '\\\"', $title),\n 'value' => str_replace('\"', '\\\"', $data['attributes']['value'][$key]),\n 'is_variation' => ($data['attributes']['is_variation'][$key] === 'on')\n );\n }\n\n $data['attributes'] = $attributes;\n\n /* Variations */\n if (!empty($data['variations'])) {\n $variations = array();\n foreach ($data['variations']['name'] as $key => $name) {\n $variations[] = array(\n 'name' => str_replace('\"', '\\\"', $name),\n 'available_quantity' => $data['variations']['available_quantity'][$key],\n 'price' => $data['variations']['price'][$key],\n 'special_price' => $data['variations']['special_price'][$key],\n 'advertised' => $data['variations']['advertised'][$key],\n 'final_price' => $data['variations']['final_price'][$key],\n 'image' => $data['variations']['image'][$key]\n );\n }\n\n $data['variations'] = $variations;\n }\n \n $data['short_description'] = str_replace('\"', '\\\"', $data['short_description']);\n $data['description'] = str_replace('\"', '\\\"', $data['description']);\n $data['short_description'] = str_replace(PHP_EOL, '<br />', $data['short_description']);\n $data['description'] = str_replace(PHP_EOL, '<br />', $data['description']);\n \n $productId = $data['product_id'];\n $dataJson = str_replace(\"'\", \"\\'\", json_encode($data));\n \n $query = \"UPDATE products SET processed_data = '{$dataJson}', last_status_change = NOW() WHERE id = {$productId}\";\n $this->query($query);\n\n $errors = $this->getLastError();\n if ($errors) {\n die($errors);\n }\n \n return $this;\n }", "public function products()\n {\n //$products = $api->getAllProducts();\n //var_dump($products);\n // TODO save products to database\n }", "public function editDeleteRelatedUpSellCrossSellProductsProvider(): array\n {\n return [\n 'update' => [\n 'data' => [\n 'defaultLinks' => $this->defaultDataFixture,\n 'productLinks' => $this->existingProducts,\n ],\n ],\n 'delete' => [\n 'data' => [\n 'defaultLinks' => $this->defaultDataFixture,\n 'productLinks' => []\n ],\n ],\n 'same' => [\n 'data' => [\n 'defaultLinks' => $this->existingProducts,\n 'productLinks' => $this->existingProducts,\n ],\n ],\n 'change_position' => [\n 'data' => [\n 'defaultLinks' => $this->existingProducts,\n 'productLinks' => array_replace_recursive(\n $this->existingProducts,\n [\n ['position' => 4],\n ['position' => 5],\n ['position' => 6],\n ]\n ),\n ],\n ],\n 'without_position' => [\n 'data' => [\n 'defaultLinks' => $this->defaultDataFixture,\n 'productLinks' => array_replace_recursive(\n $this->existingProducts,\n [\n ['position' => null],\n ['position' => null],\n ['position' => null],\n ]\n ),\n 'expectedProductLinks' => array_replace_recursive(\n $this->existingProducts,\n [\n ['position' => 1],\n ['position' => 2],\n ['position' => 3],\n ]\n ),\n ],\n ],\n ];\n }", "private function sync_products($erply_category_id, $oc_category_id)\n\t{\n\t\t$this->debug(\"@sync_products creating products for category with id \" . $oc_category_id);\n\n\t\t$offset = 0;\n\t\t$erply_products = array();\n\n\t\t$erply_response = $this->ErplyClient->get_products($offset, 100, 1, 1, null, $erply_category_id);\n\n\t\tif ($erply_response['status']['responseStatus'] == 'error') {\n\t\t\tthrow new Exception(\"Error in Erply response\");\n\t\t}\n\n\t\t$erply_products = $erply_response['records'];\n\n\t\twhile ($offset < $erply_response['status']['recordsTotal']) {\n\t\t\t$offset += 100;\n\t\t\t$erply_response = $this->ErplyClient->get_products($offset, 100, 1, 1, null, $erply_category_id);\n\n\t\t\tif ($erply_response['status']['responseStatus'] == 'error') {\n\t\t\t\tthrow new Exception(\"Error in Erply response\");\n\t\t\t}\n\n\t\t\t$erply_products = array_merge($erply_products, $erply_response['records']);\n\t\t}\n\n\t\tforeach ($erply_products as $erply_product) {\n\t\t\t$this->sync_product($erply_product, $oc_category_id);\n\t\t}\n\n\t\treturn sizeof($erply_products);\n\t}", "public static function addProductsFromOrder($orderId = 0)\n\t{\n\t\t$orderId = (int)$orderId;\n\n\t\tif (Sale\\OrderProcessingTable::hasAddedProducts($orderId))\n\t\t\treturn;\n\n\t\t$connection = Main\\Application::getConnection();\n\t\t$type = $connection->getType();\n\n\t\t// Update existing\n\t\tif ($type == \"mysql\" && $connection->isTableExists('b_sale_order_product_stat'))\n\t\t{\n\t\t\t$sqlUpdate = \"\n\t\t\t\tINSERT INTO b_sale_order_product_stat (PRODUCT_ID, RELATED_PRODUCT_ID, ORDER_DATE) \n\t\t\t\tSELECT b.PRODUCT_ID, b1.PRODUCT_ID, DATE(b.DATE_INSERT)\n\t\t\t\tFROM b_sale_basket b, b_sale_basket b1\n\t\t\t\tWHERE b.ORDER_ID = b1.ORDER_ID AND\n\t\t\t\t\tb.ORDER_ID = $orderId AND\n\t\t\t\t\tb.ID <> b1.ID \n \t\t\t\tON DUPLICATE KEY UPDATE CNT = CNT + 1;\n\t\t\t\";\n\t\t\t$connection->query($sqlUpdate);\n\n\t\t\t$sqlUpdate = \"UPDATE b_sale_product2product p2p, b_sale_basket b, b_sale_basket b1\n\t\t\t\tSET p2p.CNT = p2p.CNT + 1\n\t\t\t\tWHERE b.ORDER_ID = b1.ORDER_ID AND\n\t\t\t\t\tb.ID <> b1.ID AND\n\t\t\t\t\tb.ORDER_ID = $orderId AND\n\t\t\t\t\tp2p.PRODUCT_ID = b.PRODUCT_ID AND\n\t\t\t\t\tp2p.PARENT_PRODUCT_ID = b1.PRODUCT_ID\";\n\t\t}\n\t\telseif ($type == \"mssql\")\n\t\t{\n\t\t\t$sqlUpdate = \"UPDATE b_sale_product2product\n\t\t\t\tSET CNT = CNT + 1\n\t\t\t\tFROM b_sale_product2product p2p, b_sale_basket b, b_sale_basket b1\n\t\t\t\tWHERE b.ORDER_ID = b1.ORDER_ID AND\n\t\t\t\t\tb.ID <> b1.ID AND\n\t\t\t\t\tb.ORDER_ID = $orderId AND\n\t\t\t\t\tp2p.PRODUCT_ID = b.PRODUCT_ID AND\n\t\t\t\t\tp2p.PARENT_PRODUCT_ID = b1.PRODUCT_ID\";\n\t\t}\n\t\telse // Oracle\n\t\t{\n\t\t\t$sqlUpdate = \"UPDATE b_sale_product2product\n\t\t\t\tSET CNT = CNT + 1\n\t\t\t\tWHERE ID IN (\n\t\t\t\t\tSELECT p2p.ID FROM b_sale_product2product p2p, b_sale_basket b, b_sale_basket b1\n\t\t\t\t\tWHERE b.ORDER_ID = b1.ORDER_ID AND\n\t\t\t\t\t\tb.ID <> b1.ID AND\n\t\t\t\t\t\tb.ORDER_ID = $orderId AND\n\t\t\t\t\t\tp2p.PRODUCT_ID = b.PRODUCT_ID AND\n\t\t\t\t\t\tp2p.PARENT_PRODUCT_ID = b1.PRODUCT_ID\n\t\t\t\t\t)\";\n\t\t}\n\n\t\t$connection->query($sqlUpdate);\n\n\t\t// Insert new\n\t\t$sqlInsert = \"INSERT INTO b_sale_product2product (PRODUCT_ID, PARENT_PRODUCT_ID, CNT)\n\t\t\tSELECT b.PRODUCT_ID, b1.PRODUCT_ID, 1\n\t\t\tFROM b_sale_basket b, b_sale_basket b1\n\t\t\tWHERE b.ORDER_ID = b1.ORDER_ID AND\n\t\t\t\tb.ORDER_ID = $orderId AND\n\t\t\t\tb.ID <> b1.ID AND\n\t\t\t\tNOT EXISTS (SELECT 1 FROM b_sale_product2product d WHERE d.PRODUCT_ID = b.PRODUCT_ID AND d.PARENT_PRODUCT_ID = b1.PRODUCT_ID)\";\n\n\t\t$connection->query($sqlInsert);\n\n\t\tSale\\OrderProcessingTable::markProductsAdded($orderId);\n\n\t\tif (defined(\"BX_COMP_MANAGED_CACHE\"))\n\t\t{\n\t\t\t$app = Main\\Application::getInstance();\n\t\t\t$app->getTaggedCache()->clearByTag('sale_product_buy');\n\t\t}\n\t}", "public function allProducts()\r\n {\r\n // left join mshop_product_list as mpl on mpl.parentid = mp.id \r\n // left join mshop_media as mm on mm.id = mpl.refid\r\n // left JOIN mshop_price as mpri on mpri.id = mpl.refid\r\n // where mpl.pos = 0 and mpl.domain in ('media','price')\";\r\n $qry1 = \"select mp.id as product_id, mp.code as product_code, mp.label as product_name, mm.preview as image_url from mshop_product as mp \r\n left join mshop_product_list as mpl on mpl.parentid = mp.id \r\n left join mshop_media as mm on mm.id = mpl.refid\r\n where mpl.pos = 0 and mpl.domain in ('media')\";\r\n $qry2 = \"select mp.id as product_id, mp.label as product_name, mpri.value as product_price from mshop_product as mp \r\n left join mshop_product_list as mpl on mpl.parentid = mp.id \r\n left JOIN mshop_price as mpri on mpri.id = mpl.refid\r\n where mpl.pos = 0 and mpl.domain in ('price')\";\r\n $products1 = DB::select($qry1);\r\n $products2 = DB::select($qry2); \r\n $i = 0;\r\n foreach($products1 as $products) {\r\n foreach($products2 as $product) {\r\n if($product->product_id === $products->product_id) {\r\n $products1[$i]->product_price = $product->product_price;\r\n }\r\n }\r\n $i++;\r\n }\r\n return $products1;\r\n }", "public function updateProduct()\n {\n \t$quote=$this->getQuote();\n \tif($quote)\n \t{\n \t\t$detailproduct=$this->getProduct();\n \t\t$quoteproduct=$quote->getProduct();\n \t\tif(\n\t\t\t\t$quote->getPrice()!=$this->getPrice() or\n\t\t\t\t$quote->getDiscrate()!=$this->getDiscrate() or\n\t\t\t\t$quote->getDiscamt()!=$this->getDiscamt() or\n\t\t\t\t$quote->getProductId()!=$this->getProductId()\n\t\t\t)\n\t\t\t{\n\t\t\t\t$quote->setPrice($this->getPrice());\n\t\t\t\t$quote->setDiscrate($this->getDiscrate());\n\t\t\t\t$quote->setDiscamt($this->getDiscamt());\n\t\t\t\t$quote->setProductId($this->getProductId());\n\t\t\t\t$quote->calc(); //auto save\n\t\t\t\t$detailproduct->calcSalePrices();\n\t\t\t\t\n\t\t\t\t//if product changed, calc old product\n\t\t\t\tif($quoteproduct->getId()!=$detailproduct->getId())\n\t\t\t\t\t$quoteproduct->calcSalePrices();\n\t\t\t}\n \t}\n \telse\n \t{\n\t\t\t//if none, see if product quote by vendor with similar pricing exists. \n\t\t\t$quote=Fetcher::fetchOne(\"Quote\",array('total'=>$this->getUnittotal(),'vendor_id'=>SettingsTable::fetch(\"me_vendor_id\"),'product_id'=>$this->getProductId()));\n\n\t\t\t//if it doesn't exist, create it, and product->calc()\n\t\t\tif(!$quote)\n\t\t\t{\n\t\t\t\tQuoteTable::createOne(array(\n\t\t\t\t\t'date'=>$this->getInvoice()->getDate(),\n\t\t\t\t\t'price'=>$this->getPrice(),\n\t\t\t\t\t'discrate'=>$this->getDiscrate(),\n\t\t\t\t\t'discamt'=>$this->getDiscamt(),\n\t\t\t\t\t'vendor_id'=>SettingsTable::fetch(\"me_vendor_id\"),\n\t\t\t\t\t'product_id'=>$this->getProductId(),\n\t\t\t\t\t'ref_class'=>\"Invoicedetail\",\n\t\t\t\t\t'ref_id'=>$this->getId(),\n\t\t\t\t\t'mine'=>1,\n\t\t\t\t\t));\n\t\t\t\t$this->getProduct()->calcSalePrices();\n\t\t\t}\n \t}\n }", "public function LoadProductsForPrice()\n\t\t{\n\t\t\t$query = \"\n\t\t\t\tSELECT\n\t\t\t\t\tp.*,\n\t\t\t\t\tFLOOR(prodratingtotal / prodnumratings) AS prodavgrating,\n\t\t\t\t\timageisthumb,\n\t\t\t\t\timagefile,\n\t\t\t\t\t\" . GetProdCustomerGroupPriceSQL() . \"\n\t\t\t\tFROM\n\t\t\t\t\t(\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\tDISTINCT ca.productid,\n\t\t\t\t\t\t\tFLOOR(prodratingtotal / prodnumratings) AS prodavgrating\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t[|PREFIX|]categoryassociations ca\n\t\t\t\t\t\t\tINNER JOIN [|PREFIX|]products p ON p.productid = ca.productid\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\tp.prodvisible = 1 AND\n\t\t\t\t\t\t\tca.categoryid IN (\" . $this->GetProductCategoryIds() . \") AND\n\t\t\t\t\t\t\tp.prodcalculatedprice >= '\".(int)$this->GetMinPrice().\"' AND\n\t\t\t\t\t\t\tp.prodcalculatedprice <= '\".(int)$this->GetMaxPrice().\"'\n\t\t\t\t\t\tORDER BY\n\t\t\t\t\t\t\t\" . $this->GetSortField() . \", p.prodname ASC\n\t\t\t\t\t\t\" . $GLOBALS['ISC_CLASS_DB']->AddLimit($this->GetStart(), GetConfig('CategoryProductsPerPage')) . \"\n\t\t\t\t\t) AS ca\n\t\t\t\t\tINNER JOIN [|PREFIX|]products p ON p.productid = ca.productid\n\t\t\t\t\tLEFT JOIN [|PREFIX|]product_images pi ON (pi.imageisthumb = 1 AND p.productid = pi.imageprodid)\n\t\t\t\";\n\n\t\t\t//$query .= $GLOBALS['ISC_CLASS_DB']->AddLimit($this->GetStart(), GetConfig('CategoryProductsPerPage'));\n\t\t\t$result = $GLOBALS['ISC_CLASS_DB']->Query($query);\n\t\t\twhile ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {\n\t\t\t\t$row['prodavgrating'] = (int)$row['prodavgrating'];\n\t\t\t\t$this->_priceproducts[] = $row;\n\t\t\t}\n\t\t}", "public function sendProductApi($products, $id_shop, $id_lang, $id_currency, $action = 'update')\n {\n if (empty($products)) {\n return;\n }\n\n $hashid = $this->getHashId($id_lang, $id_currency);\n\n if ($hashid) {\n if ($action == 'update') {\n require_once dirname(__FILE__) . '/lib/dfProduct_build.php';\n $builder = new DfProductBuild($id_shop, $id_lang, $id_currency);\n $builder->setProducts($products);\n $payload = $builder->build();\n\n $this->updateItemsApi($hashid, 'product', $payload);\n } elseif ($action == 'delete') {\n $this->deleteItemsApi($hashid, 'product', $products);\n }\n }\n }", "public function addprice($sOXID = null, $aUpdateParams = null)\n {\n $myConfig = $this->getConfig();\n\n $this->resetContentCache();\n\n $sOxArtId = $this->getEditObjectId();\n\n\n\n $aParams = oxRegistry::getConfig()->getRequestParameter(\"editval\");\n\n if (!is_array($aParams)) {\n return;\n }\n\n if (isset($aUpdateParams) && is_array($aUpdateParams)) {\n $aParams = array_merge($aParams, $aUpdateParams);\n }\n\n //replacing commas\n foreach ($aParams as $key => $sParam) {\n $aParams[$key] = str_replace(\",\", \".\", $sParam);\n }\n\n $aParams['oxprice2article__oxshopid'] = $myConfig->getShopID();\n\n if (isset($sOXID)) {\n $aParams['oxprice2article__oxid'] = $sOXID;\n }\n\n $aParams['oxprice2article__oxartid'] = $sOxArtId;\n if (!isset($aParams['oxprice2article__oxamount']) || !$aParams['oxprice2article__oxamount']) {\n $aParams['oxprice2article__oxamount'] = \"1\";\n }\n\n if (!$myConfig->getConfigParam('blAllowUnevenAmounts')) {\n $aParams['oxprice2article__oxamount'] = round(( string ) $aParams['oxprice2article__oxamount']);\n $aParams['oxprice2article__oxamountto'] = round(( string ) $aParams['oxprice2article__oxamountto']);\n }\n\n $dPrice = $aParams['price'];\n $sType = $aParams['pricetype'];\n\n $oArticlePrice = oxNew(\"oxbase\");\n $oArticlePrice->init(\"oxprice2article\");\n $oArticlePrice->assign($aParams);\n\n $oArticlePrice->$sType = new oxField($dPrice);\n\n //validating\n if ($oArticlePrice->$sType->value &&\n $oArticlePrice->oxprice2article__oxamount->value &&\n $oArticlePrice->oxprice2article__oxamountto->value &&\n is_numeric($oArticlePrice->$sType->value) &&\n is_numeric($oArticlePrice->oxprice2article__oxamount->value) &&\n is_numeric($oArticlePrice->oxprice2article__oxamountto->value) &&\n $oArticlePrice->oxprice2article__oxamount->value <= $oArticlePrice->oxprice2article__oxamountto->value\n ) {\n $oArticlePrice->save();\n }\n\n // check if abs price is lower than base price\n $oArticle = oxNew(\"oxArticle\");\n $oArticle->loadInLang($this->_iEditLang, $sOxArtId);\n $sPriceField = 'oxarticles__oxprice';\n if (($aParams['price'] >= $oArticle->$sPriceField->value) &&\n ($aParams['pricetype'] == 'oxprice2article__oxaddabs')) {\n if (is_null($sOXID)) {\n $sOXID = $oArticlePrice->getId();\n }\n $this->_aViewData[\"errorscaleprice\"][] = $sOXID;\n }\n\n }", "public function index() {\n\t\t\n\t\t$this->document->setTitle($this->language->get('商品批量修改')); \n $this->data['breadcrumbs'] = array();\n\n\t\t$this->data['breadcrumbs'][] = array(\n\t\t\t'text' => $this->language->get('text_home'),\n\t\t\t'href' => $this->url->link('common/home', 'token=' . $this->session->data['token'], 'SSL'),\n\t\t\t'separator' => false\n\t\t);\n\n\t\t$this->data['breadcrumbs'][] = array(\n\t\t\t'text' => \"商品批量修改\",\n\t\t\t'href' => $this->url->link('batch/product_update', 'token=' . $this->session->data['token'], 'SSL'), \t\t\n\t\t\t'separator' => ' :: '\n\t\t);\n\n\t\t$this->data['download'] = $this->url->link('batch/product_update/download', 'token=' . $this->session->data['token'], 'SSL');\n\t\t$this->data['upload'] = $this->url->link('batch/product_update/upload', 'token=' . $this->session->data['token'], 'SSL');\t\n $this->data['token'] = $this->session->data['token'];\n\t\t\n\t\tif (isset($this->error['warning'])) {\n\t\t\t$this->data['error_warning'] = $this->error['warning'];\n\t\t} else {\n\t\t\t$this->data['error_warning'] = '';\n\t\t}\n\n\t\tif (isset($this->session->data['success'])) {\n\t\t\t$this->data['success'] = $this->session->data['success'];\n\n\t\t\tunset($this->session->data['success']);\n\t\t} else {\n\t\t\t$this->data['success'] = '';\n\t\t}\n\t $this->template = 'batch/product_update.tpl';\n\t\t$this->children = array(\n\t\t\t'common/header',\n\t\t\t'common/footer'\n\t\t);\n\n\t\t$this->response->setOutput($this->render());\n\t}", "public function actionAddProductList()\n\t{\n\t\t$order_id=Yii::app()->request->getQuery('id');\n\t\t$model = $this->_loadModel($order_id);\n\t\t$dataProvider = new StoreProduct('search');\n\n\t\tif(isset($_GET['StoreProduct']))\n\t\t\t$dataProvider->attributes = $_GET['StoreProduct'];\n\n\t\t$this->renderPartial('_addProduct', array(\n\t\t\t'dataProvider' => $dataProvider,\n\t\t\t'order_id' => $order_id,\n\t\t\t'model' => $model,\n\t\t));\n\t}", "public function bulkUpdate(array $payload) {\n $collection = collect($payload);\n\n $products = $collection->map(function ($product) {\n $newProduct = new Product([\n 'id' => $product['id'],\n 'name' => $product['name'],\n 'price' => $product['price'],\n 'quantity' => $product['quantity'],\n ]);\n\n $product = $this->findById($product['id']);\n\n if ($product->quantity !== $newProduct->quantity) {\n $product->history()->create([\n 'quantity' => $newProduct->quantity,\n ]);\n }\n\n return $newProduct;\n });\n\n $this->model->upsert(\n $products->toArray(),\n ['id'],\n $this->model->fillable,\n );\n\n return $products;\n }", "public function UpdateProducts(UpdateProducts $parameters)\n {\n return $this->__soapCall('UpdateProducts', array($parameters));\n }", "public function get_prices()\n\t{\n\t\t$product_price_old = 0;\n\t\t$product_price_sale = 0;\n\t\t$price = 0;\n\t\t$eco = 0;\n\t\t$taxes = 0;\n\t\t$dataoc = isset($this->request->post['dataoc']) ? $this->request->post['dataoc'] : '';\n\n\t\tif (!empty($dataoc)) {\n\t\t\t$dataoc = str_replace('&quot;', '\"', $dataoc);\n\t\t\t$json = @json_decode($dataoc, true);\n\t\t\t$product_quantity = isset($json['quantity']) ? $json['quantity'] : 0;\n\t\t\t$product_id_oc = isset($json['product_id_oc']) ? $json['product_id_oc'] : 0;\n\t\t\tif ($product_id_oc == 0) $product_id_oc = isset($json['_product_id_oc']) ? $json['_product_id_oc'] : 0;\n\n\t\t\t// get options\n\t\t\t$options = isset($json['option_oc']) ? $json['option_oc'] : array();\n\t\t\tforeach ($options as $key => $value) {\n\t\t\t\tif ($value == null || empty($value)) unset($options[$key]);\n\t\t\t}\n\n\t\t\t// get all options of product\n\t\t\t$options_temp = $this->get_options_oc($product_id_oc);\n\n\t\t\t// Calc price for ajax\n\t\t\tforeach ($options_temp as $value) {\n\t\t\t\tforeach ($options as $k => $option_val) {\n\t\t\t\t\tif ($k == $value['product_option_id']) {\n\t\t\t\t\t\tif ($value['type'] == 'checkbox' && is_array($option_val) && count($option_val) > 0) {\n\t\t\t\t\t\t\tforeach ($option_val as $val) {\n\t\t\t\t\t\t\t\tforeach ($value['product_option_value'] as $op) {\n\t\t\t\t\t\t\t\t\t// calc price\n\t\t\t\t\t\t\t\t\tif ($val == $op['product_option_value_id']) {\n\t\t\t\t\t\t\t\t\t\tif ($op['price_prefix'] == $this->minus) $price -= isset($op['price_no_tax']) ? $op['price_no_tax'] : 0;\n\t\t\t\t\t\t\t\t\t\telse $price += isset($op['price_no_tax']) ? $op['price_no_tax'] : 0;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} elseif ($value['type'] == 'radio' || $value['type'] == 'select') {\n\t\t\t\t\t\t\tforeach ($value['product_option_value'] as $op) {\n\t\t\t\t\t\t\t\tif ($option_val == $op['product_option_value_id']) {\n\t\t\t\t\t\t\t\t\tif ($op['price_prefix'] == $this->minus) $price -= isset($op['price_no_tax']) ? $op['price_no_tax'] : 0;\n\t\t\t\t\t\t\t\t\telse $price += isset($op['price_no_tax']) ? $op['price_no_tax'] : 0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// the others have not price, so don't need calc\n\t\t\t\t\t}\n\t\t\t\t\t// if not same -> return.\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$product_prices = $this->get_product_price($product_id_oc, $product_quantity);\n\t\t\t$product_price_old = isset($product_prices['price_old']) ? $product_prices['price_old'] : 0;\n\t\t\t$product_price_sale = isset($product_prices['price_sale']) ? $product_prices['price_sale'] : 0;\n\t\t\t$enable_taxes = $this->config->get('tshirtecommerce_allow_taxes');\n\t\t\tif ($enable_taxes === null || $enable_taxes == 1) {\n\t\t\t\t$taxes = isset($product_prices['taxes']) ? $product_prices['taxes'] : 0;\n\t\t\t\t$eco = isset($product_prices['eco']) ? $product_prices['eco'] : 0;\n\t\t\t} else {\n\t\t\t\t$taxes = 0;\n\t\t\t\t$eco = 0;\n\t\t\t}\n\t\t\t\n\t\t} // do nothing when empty/blank\n\n\t\t// return price for ajax\n\t\techo @json_encode(array(\n\t\t\t'price' => $price, \n\t\t\t'price_old' => $product_price_old, \n\t\t\t'price_sale' => $product_price_sale, \n\t\t\t'taxes' => $taxes,\n\t\t\t'eco' => $eco\n\t\t));\n\t\treturn;\n\t}", "public function createAction()\n {\n $entity = new Pricelist();\n $request = $this->getRequest();\n $form = $this->createForm(new PricelistType(), $entity);\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('Price_show', array('id' => $entity->getId())));\n \n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView()\n );\n }", "public function executeList(array $ids)\n {\n $this->execute($ids);\n }", "public function listProductprices(){\n try{\n $sql = \"Select * from productforsale pr inner join product p on pr.id_product = p.id_product inner join categoryp c on p.id_categoryp = c.id_categoryp inner join medida m on p.product_unid_type = m.medida_id\";\n $stm = $this->pdo->prepare($sql);\n $stm->execute();\n $result = $stm->fetchAll();\n } catch (Exception $e){\n $this->log->insert($e->getMessage(), 'Inventory|listProductprices');\n $result = 2;\n }\n\n return $result;\n }", "public function run()\n {\n DB::table('product_prices')->insert([\n 'product_id' => 1,\n 'description' => 'single',\n 'price' => 100.00\n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 2,\n 'description' => 'single', \n 'price' => 200.00 \n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 3,\n 'description' => 'single', \n 'price' => 300.00 \n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 4,\n 'description' => 'single',\n 'price' => 400.00 \n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 5,\n 'description' => 'single',\n 'price' => 500.00\n ]);\n DB::table('product_prices')->insert([\n 'product_id' => 6,\n 'description' => 'single',\n 'price' => 600.00\n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 7,\n 'description' => 'single',\n 'price' => 700.00\n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 8,\n 'description' => 'single',\n 'price' => 800.00\n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 9,\n 'description' => 'single',\n 'price' => 9000.00\n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 1,\n 'description' => 'bundle (10 pcs)',\n 'price' => 1000.00\n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 2,\n 'description' => 'bundle (10 pcs)', \n 'price' => 2000.00 \n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 3,\n 'description' => 'bundle (10 pcs)', \n 'price' => 3000.00 \n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 4,\n 'description' => 'bundle (10 pcs)',\n 'price' => 4000.00 \n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 5,\n 'description' => 'bundle (10 pcs)',\n 'price' => 5000.00\n ]);\n DB::table('product_prices')->insert([\n 'product_id' => 6,\n 'description' => 'bundle (10 pcs)',\n 'price' => 6000.00\n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 7,\n 'description' => 'bundle (10 pcs)',\n 'price' => 7000.00\n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 8,\n 'description' => 'bundle (10 pcs)',\n 'price' => 8000.00\n ]);\n\n DB::table('product_prices')->insert([\n 'product_id' => 9,\n 'description' => 'bundle (10 pcs)',\n 'price' => 9000.00\n ]);\n }", "public function testProductGetPrices()\n {\n $product = $this->find('product', 1);\n $prices = $product->getPrices();\n $price = $prices[0];\n \n $currencies = $this->findAll('currency');\n $dollarCurrency = $currencies[0];\n \n $money = Money::create(10, $dollarCurrency); \n \n $this->assertEquals(\n $money,\n $price\n );\n }", "private function product_batch()\n\t{\n\t\t// add call to trigger datagrab here\n\t\t//file_get_contents(ee()->config->item('base_url') . '?ACT=25&id=9');\n\n\t\tee()->sync_db = ee()->load->database('sync_db', true);\n\t\t$update_count = ee()->sync_db->count_all_results('products');\n\n\t\tif($update_count > 0)\n\t\t{\t\n\t\t\t// create curl resource \n\t $ch = curl_init(); \n\n\t // set url \n\t curl_setopt($ch, CURLOPT_URL, ee()->config->item('base_url') . '?ACT=25&id=' . ee()->config->item('integration_product_import_id')); \n\t curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0); \n\t curl_setopt($ch, CURLOPT_TIMEOUT, 300); \n\t curl_exec($ch); \n\t curl_close($ch);\n \t}\n\t}", "private function updateProductVariants($params)\n {\n if ($params['variants']) {\n foreach ($params['variants'] as $productParams) {\n $product = Product::find($productParams['id']);\n $product->update($productParams);\n\n $product->status = $params['status'];\n $product->save();\n\n ProductInventory::updateOrCreate(['product_id' => $product->id], ['qty' => $productParams['qty']]);\n }\n }\n }" ]
[ "0.7937263", "0.7360526", "0.7211644", "0.66703296", "0.65506303", "0.5937376", "0.5862801", "0.58348763", "0.5828097", "0.5784281", "0.5727903", "0.5665608", "0.5644147", "0.556371", "0.5546642", "0.55460227", "0.5511881", "0.5511405", "0.5502406", "0.5485018", "0.5443037", "0.53973275", "0.53923357", "0.53751177", "0.53437775", "0.5333481", "0.5301541", "0.52282256", "0.5217819", "0.5215498", "0.5191905", "0.51829153", "0.51709795", "0.5145279", "0.5138076", "0.5128497", "0.5115545", "0.5112122", "0.5091075", "0.5086615", "0.5077488", "0.50675917", "0.50587505", "0.5052364", "0.5052052", "0.50458634", "0.5022406", "0.5021117", "0.5017037", "0.50109285", "0.50044286", "0.5001045", "0.4997866", "0.49937013", "0.49912187", "0.4989321", "0.4976789", "0.4966177", "0.4942359", "0.49409696", "0.49264097", "0.4908134", "0.48973697", "0.48943144", "0.48895678", "0.48839527", "0.48721883", "0.48648193", "0.4857295", "0.4853267", "0.4849899", "0.48415533", "0.48373923", "0.48358864", "0.4824366", "0.48190284", "0.48174053", "0.47762373", "0.47732916", "0.4769778", "0.4762572", "0.47516027", "0.4751251", "0.47506708", "0.4746458", "0.4743748", "0.47379097", "0.47369224", "0.47348753", "0.47263443", "0.47257653", "0.4720152", "0.47151995", "0.46992388", "0.46968287", "0.46940386", "0.46864405", "0.46814418", "0.46717665", "0.46640942" ]
0.7818697
1
Handle what to do when an object changes
public function update($subject) { prinft("State Change, new subject: %s", $subject); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _changed()\n {\n // Clean up caches\n $this->_subClasses = array();\n $this->_notSubClasses = array();\n }", "abstract public function change();", "private function changed()\n {\n $this->isDirty = true;\n }", "public function setChanged()\n {\n\n $this->_changed = true;\n\n }", "public function propertyChanged(object $sender, string $propertyName, $oldValue, $newValue);", "protected final function _markModified()\n {\n DomainWatcher::addModifiedObject($this);\n }", "public function onUpdate($object)\n\t{\n\t\tparent::init();\n\t\t$this->checkDateAvailable($object);\n\t}", "public function update( &$object );", "protected function postUpdateHook($object) { }", "function onModelUpdated($object, $data){\n // $object is the object with the updated data\n // A Ticket was updated\n if(get_class($object) === \"Ticket\"){\n $ticket = $object;\n // Authenticate to Trello\n $config = $this->getConfig();\n $client = new Client();\n $client->authenticate($config->get('trello_api_key'), $config->get('trello_api_token'), Client::AUTH_URL_CLIENT_ID);\n\n // If the status was updated\n if(isset($data['dirty']['status_id'])){\n // $data['dirty']['status_id'] - is the old status id\n // $ticket->getStatusId(); is the new status id\n\n // Matching the status in OSTicket to a List in Trello\n $trelloCardId = TrelloPlugin::getTrelloCardId($ticket, $client, $config);\n $trelloListId = TrelloPlugin::getTrelloListId($ticket->getStatusId(), $client, $config);\n if(!empty($trelloCardId) && !empty($trelloListId)){\n // Updating the list/status in Trello\n $client->cards()->setList($trelloCardId, $trelloListId);\n }\n }\n }\n }", "function onSave()\n {\n $object = parent::onSave();\n }", "function modified() { $this->_modified=1; }", "function modified() { $this->_modified=1; }", "public function _changed($orig, $final)\n {\n }", "public function _update()\n\t {\n\t \t$this->notifyObservers(__FUNCTION__);\n\t }", "public abstract function update($object);", "public function setUpdated(): void\n {\n $this->originalData = $this->itemReflection->dehydrate($this->item);\n }", "public function update($object): void;", "public function getObjectForChange(): ObjectForChange\n {\n return $this->objectForChange;\n }", "function callbackSetValue($object,$field) {\n \n\n //echo get_class($object);\n switch ($field) {\n case 'name':\n // name does not set dirty flag - its a simple rename..\n $value = $object->get_text();\n if (@$this->$field == $value) {\n return;\n }\n $this->$field = $value;\n //print_r($this->data['TABLES'][$table]['FIELDS']);\n $this->table->database->dirty=true;\n break;\n case 'length':\n case 'default':\n $value = $object->get_text();\n if (@$this->$field == $value) {\n return;\n }\n // echo \"CHANGE?\";\n $this->$field = $value;\n //print_r($this->data['TABLES'][$table]['FIELDS']);\n $this->table->database->dirty=true;\n $this->dirty = true;\n break;\n case 'notnull':\n case 'isIndex':\n case 'sequence':\n case 'unique': \n $value = (int) $object->get_active();\n if (@$this->$field == $value) {\n return;\n }\n //echo \"CHANGE?\";\n $this->$field = $value;\n //print_r($this->data['TABLES'][$table]['FIELDS']);\n $this->table->database->dirty=true;\n $this->table->database->save();\n $this->setVisable();\n $this->dirty = true;\n break;\n default: \n echo \"opps forgot :$field\\n\";\n \n \n }\n //print_r(func_get_args());\n }", "public function notify() {\n $this->observers->rewind();\n while($this->observers->valid()) {\n $object = $this->observers->current();\n // dump($object);die;\n $object->update($this);\n $this->observers->next();\n }\n }", "public function hasChanged();", "public function hasChanged();", "protected function updateObjectBeforePersist(&$object)\n {\n\n }", "abstract protected function setModifiedState();", "public function observe() {}", "function notify()\n {\n foreach ($this->observers as $obKey => $obValue) {\n $obValue->update($this);\n }\n }", "protected function preUpdateHook($object) { }", "public function __construct($changed) {\n $this->changed = $changed;\n }", "public function setChanged($changed = true) { $this->changed = $changed; }", "public function notify($event, $object = null) {\r\n\t\tif ($event == self::EVENT_BEFORECREATE) {\r\n\t\t\tself::$_newest[get_called_class()] = $object;\r\n\t\t} else if ($event == self::EVENT_BEFORESAVE) {\r\n\t\t\tself::$_lastModified[get_called_class()] = $object;\r\n\t\t}\r\n\t\tif (isset($this->_eventObservers[$event])) {\r\n\t\t\tif (is_null($object)) $object = $this;\r\n\t\t\tforeach ($this->_eventObservers[$event] as $observer) {\r\n\t\t\t\t$observer->update($object);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function eventObjectChange(Zend_Db_Table_Row_Abstract $new, Zend_Db_Table_Row_Abstract $old)\n {\n $tableClass = $new->getTableClass();\n\n if ($tableClass !== $old->getTableClass()) {\n Throw new Exception('Repository critical error');\n }\n\n if ($tableClass !== 'Application_Model_Upowaznienia') {\n //vd($new, $old);\n }\n\n foreach ($this->versionedObjects as $objectName => $objectConfig) {\n if (!empty($objectConfig['updatedOn'])) {\n foreach ($objectConfig['updatedOn'] as $updateOnModel) {\n if ($updateOnModel === $tableClass) {\n $versionModel = $objectConfig['versionModel'];\n\n $newData = $new->toArray();\n $oldData = $old->toArray();\n\n list ($checkData, $uniqueIndex) = $versionModel->prepareDataForCheck($newData, $oldData);\n\n $versionData = $this->processCheckData($checkData, $newData, $uniqueIndex);\n\n if ($versionData !== false) {\n //we know that were changes\n //store data for further repository update\n $this->addObjectToUpdate($objectConfig, $versionData, $uniqueIndex);\n }\n\n //there can be only one\n break;\n }\n }\n }\n }\n }", "protected function _markNew() \n {\n DomainWatcher::addNewObject($this);\n }", "public function _isDirty() {}", "public function update(AbstractObject $obj)\n {\n\n }", "public function setObject(object $object): void;", "public function update($obj)\n {\n }", "public function measurementsChanged()\n {\n $this->notifyObservers();\n }", "public function _postUpdate()\n\t{\n\t\t$this->notifyObservers(__FUNCTION__);\n\t}", "function _isDirty() ;", "public function onUpdateRecord()\n {\n $this->updated = new \\DateTime();\n $this->rev++;\n }", "protected function after_update($new_instance, $old_instance){\n\t}", "abstract public function updateItem(&$object);", "public function refresh($object);", "protected function handleItself()\n {\n if ($this->isMoved($this->event)) {\n if ($this->getResource()->exists() && $this->addWatch() === $this->id) {\n return;\n }\n\n $this->unwatch($this->id);\n }\n\n if ($this->getResource()->exists()) {\n if ($this->isIgnored($this->event) || $this->isMoved($this->event) || !$this->id) {\n $this->setEvent($this->id ? IN_MODIFY : IN_CREATE);\n $this->watch();\n }\n } elseif ($this->id) {\n $this->event = IN_DELETE;\n $this->getBag()->remove($this);\n $this->unwatch($this->id);\n $this->id = null;\n }\n }", "public function measurementsChanged(): void\n {\n $this->notifyObservers();\n }", "function isChanged(): bool;", "public static function update($event, $type, $object) {\n\t\t\n\t\tif ($object instanceof \\ElggEntity) {\n\t\t\tself::updateEntity($object);\n\t\t}\n\t\t\n\t\tself::checkComments($object);\n\t\tself::updateEntityForAnnotation($object);\n\t}", "public function touch()\n {\n $this->_factory->markAsModified($this);\n }", "public function before_update(Model $obj) {\n\t\t$this->validate ( $obj );\n\t}", "abstract protected function update ();", "public function update_object ($obj)\n {\n parent::update_object ($obj);\n $this->access_id = $obj->id;\n }", "public function update_object ($obj)\n {\n parent::update_object ($obj);\n $this->access_id = $obj->id;\n }", "protected function afterUpdating()\n {\n }", "function updateObject($object) {\n\t\t// Register a hook for the required additional\n\t\t// object fields. We do this on a temporary\n\t\t// basis as the hook adds a performance overhead\n\t\t// and the field will \"stealthily\" survive even\n\t\t// when the DAO does not know about it.\n\t\t$dao = $object->getDAO();\n\t\t$this->registerDaoHook(get_class($dao));\n\t\t$dao->updateObject($object);\n\t}", "public function identifierChanged($sender, $propertyName, $oldValue, $newValue): void;", "public function saveObjectState() {\n $this->objectState = base64_encode(serialize($this));\n $this->isNewRecord = false;\n $this->update();\n $this->reconstructCombatants();\n }", "public function change($changes);", "public function clearChangedState()\n {\n\n $this->_changed = false;\n\n }", "protected function _store_to_object ($obj)\n {\n parent::_store_to_object ($obj);\n \n switch ($this->value_for ('state'))\n {\n case Testing:\n $obj->test (Defer_database_update);\n break;\n case Shipped:\n $obj->ship (Defer_database_update);\n break;\n case Locked:\n $obj->lock (Defer_database_update);\n break;\n }\n }", "public function ___changed($what, $old = null, $new = null) {\n\t\t// for hooks to listen to \n\t}", "public function onUpdate();", "public function onUpdate();", "public function onUpdate();", "public function setModified($value) {}", "public function getChange();", "public function notify() {\n\t\tforeach($this->_observers as $key => $val) {\n\t\t\t$val->update($this);\n\t\t}\n\t}", "public function setChanged($changed) {\n $this->changed = $changed;\n }", "public function notify() {\n // Updates all classes subscribed to this object\n foreach ($this->observers as $obs) {\n $obs->update($this);\n }\n }", "public function markUnchanged();", "public function ApplyChanges()\n {\n parent::ApplyChanges();\n\n }", "public function update(MappableObject $object)\n {\n }", "public function afterUpdate(&$id, \\stdClass $data, Entity $entity) { }", "public function notify()\n {\n foreach ($this->storage as $obs){\n $obs->update($this);\n }\n }", "public function testGeneralGetterAndSetter()\n {\n\n $this->assertNull($this->object->getId());\n\n $date = new \\DateTime();\n $this->object->setCreatedAt($date);\n $this->assertEquals($date, $this->object->getCreatedAt());\n $this->object->setUpdatedAt($date);\n $this->assertEquals($date, $this->object->getUpdatedAt());\n\n $city = $this->object2;\n $city->prePersist();\n $this->assertTrue(is_object($city->getCreatedAt()));\n $city->preUpdate();\n $this->assertTrue(is_object($city->getUpdatedAt()));\n }", "public function after_update() {}", "abstract public function update();", "abstract public function update();", "protected function onChange()\n {\n $this->markAsChanged();\n if ($this->parent !== null) {\n $this->parent->onChange();\n }\n }", "public function hasChanged(): bool;", "public function hasChanged(): bool;", "public function markAsChanged()\n {\n // the stream is not closed because $this->contentStream may still be\n // attached to it. GuzzleHttp will clean it up when destroyed.\n $this->stream = null;\n }", "public function notifyObservers()\n {\n foreach ($this->observers as $obj) {\n $obj->update(\n $this->temperature,\n $this->humidity,\n $this->pressure\n );\n }\n }", "public function isModified();", "public function setModifiedValue()\n {\n $this->setModified(new \\DateTime());\n }", "abstract public function update(&$sender, $arg);", "protected function markAsChanged($objectId)\n {\n if (!is_string($objectId)) {\n throw new \\InvalidArgumentException(\"Invalid object ID supplied.\");\n }\n if (!isset($this->cacheInfo[\"objects\"][$objectId])) {\n throw new \\RuntimeException(\"Specified object does not exist.\");\n }\n if (!in_array($objectId, $this->changed)) {\n $this->changed[] = $objectId;\n }\n }", "function opensky_islandora_view_object_alter (&$object, &$rendered) {\n // dpm (\"VIEW_OBJECT_ALTER\");\n // dpm ($object->models[0]);\n // dpm ($rendered);\n\n}", "public abstract function update();", "public function notify()\n {\n foreach ($this->observers as $value) {\n $value->update($this);\n }\n }", "public function updatedStateEmployee(){\n $this->clearTime();\n }", "public function ApplyChanges()\n {\n parent::ApplyChanges();\n\n // Update data\n $this->Update();\n }", "public static function stateChanged($event)\r\n {\r\n }", "protected function beforeUpdating()\n {\n }", "function getChanged() {\n return $this->changed;\n }", "public static function changed() {\n\treturn self::$instance->changed();\n }", "function set_obj(&$obj)\n{\n\t$this->_obj = $obj;\n}", "abstract function update();", "public function changeFunc() {}", "protected function _update()\n\t{\n\t}", "function after_change()\n\t{\n\t\treturn true;\n\t}" ]
[ "0.6513385", "0.6490074", "0.64644885", "0.63738763", "0.63718605", "0.6272325", "0.61873233", "0.61611474", "0.614508", "0.61152816", "0.6110041", "0.6104861", "0.6104861", "0.59878993", "0.5967754", "0.59387153", "0.59301466", "0.59068435", "0.58873016", "0.5871215", "0.58487463", "0.58422625", "0.58422625", "0.5836757", "0.5815597", "0.5803761", "0.58024746", "0.57752", "0.5774978", "0.575161", "0.56962544", "0.5682735", "0.56613326", "0.56238604", "0.56115454", "0.5584793", "0.5582144", "0.5573002", "0.55645466", "0.5558352", "0.55538344", "0.5553109", "0.55444163", "0.55228066", "0.5476645", "0.5455708", "0.5449274", "0.543314", "0.5400974", "0.53933114", "0.5391713", "0.5385262", "0.5385262", "0.53841007", "0.53666025", "0.5356786", "0.5344695", "0.5323318", "0.5305506", "0.5301157", "0.52962464", "0.5292512", "0.5292512", "0.5292512", "0.52756965", "0.5272777", "0.5270639", "0.5267447", "0.5253885", "0.5246645", "0.5246476", "0.5239637", "0.5226468", "0.52126163", "0.5212237", "0.5211363", "0.5209768", "0.5209768", "0.5208393", "0.5206986", "0.5206986", "0.5205473", "0.52009606", "0.52004987", "0.51990604", "0.5192227", "0.51869506", "0.5183152", "0.51756644", "0.5167368", "0.5165688", "0.51576036", "0.51566404", "0.5153218", "0.5150045", "0.5147565", "0.5147091", "0.51442957", "0.5135482", "0.51272553", "0.51203793" ]
0.0
-1
You could call this: listen, register, etc
public function attach(Observer $observer) { $this->observers[] = $observer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function listen();", "public function startListening();", "public function listen() {\n $this->source->listen($this->id);\n }", "public function __construct(){\n\n\t\t\t$this->listen();\n\n\t\t}", "public function listen(): void\n {\n $receive = function () {\n each($this->receiveMessages(), $this->parseAndConsumeMessage());\n };\n\n $this->settings->beforeReceive($receive);\n }", "public function listen(): bool;", "abstract public function onRegister(): void;", "public function run()\n {\n $this->router->listen();\n }", "public function register()\n\t{\n\t\t$this->runListeners();\n\t}", "public function onRegister();", "protected function registerListeners()\n {\n }", "public function listen()\n {\n $this->openWorker();\n while (!Signal::isExit()) {\n if (($payload = $this->pop(3)) !== null) {\n list($id, $message) = explode(':', $payload, 2);\n $this->handleMessage($message);\n }\n }\n $this->closeWorker();\n }", "public function register();", "public function register();", "public function register();", "public function register();", "public function register();", "public function register();", "public function register();", "public function register();", "public function register() {}", "public function listen($listener);", "protected function registerListeners()\n {\n $this->container['listener.server'] = $this->container->share(function ($c) {\n return new \\Symfttpd\\EventDispatcher\\Listener\\ServerListener($c['filesystem'], $c['generator.server']);\n });\n\n $this->container['listener.gateway'] = $this->container->share(function ($c) {\n return new \\Symfttpd\\EventDispatcher\\Listener\\GatewayListener($c['filesystem'], $c['generator.gateway']);\n });\n }", "public function register(){}", "protected static function register() {}", "public function subscribe();", "protected function listen()\n {\n do {\n $data = fgets($this->socket, 512);\n if (!empty($data)) {\n $request = $this->receive($data);\n $cmd = strtolower($request->getCommand());\n\n if ($cmd === 'privmsg') {\n $event_name = 'message.' . ($request->isPrivateMessage() ? 'private' : 'channel');\n } else {\n $event_name = 'server.' . $cmd;\n }\n\n // Skip processing if the incoming message is from the bot\n if ($request->getSendingUser() === $this->config['nick']) {\n continue;\n }\n\n $event = new Event($request);\n $this->dispatcher->dispatch($event_name, $event);\n $responses = $event->getResponses();\n\n if (!empty($responses)) {\n $this->send($responses);\n }\n }\n } while (!feof($this->socket));\n }", "public function listen() {\n\t\t// Checks the user agents match\n\t\tif ( $this->user_agent == $this->request_user_agent ) {\n\t\t\t// Determine if a key request has been made\n\t\t\tif ( isset( $_GET['key'] ) ) {\n\t\t\t\t$this->download_update();\n\t\t\t} else {\n\t\t\t\t// Determine the action requested\n\t\t\t\t$action = filter_input( INPUT_POST, 'action', FILTER_SANITIZE_STRING );\n\n\t\t\t\t// If that method exists, call it\n\t\t\t\tif ( method_exists( $this, $action ) )\n\t\t\t\t\t$this->{$action}();\n\t\t\t}\n\t\t}\n\t}", "public function start()\n {\n $this->server->on(\"open\", [$this, 'wsOpen']);\n $this->server->on(\"message\", [$this, 'wsMessage']);\n $this->server->on(\"close\", [$this, 'wsClose']);\n\n $this->server->start();\n }", "public function subscribes();", "public function listen()\n\t{\n\t\t$uri = $_REQUEST['uri'] ?? '';\n\t\t$uri = trim($uri, '/\\^$');\n\t\t$replacementValues = array();\n\n\t\t// List through the stored URI's\n\t\tforeach ($this->urls as $step => $url)\n\t\t{\n\t\t\t// See if there is a match\n\t\t\tif (preg_match(\"#^$url$#\", $uri))\n\t\t\t{\n\t\t\t\t// Replace the values\n\t\t\t\t$realUri = explode('/', $uri);\n\t\t\t\t$fakeUri = explode('/', $url);\n\n\t\t\t\t// Gather the .+ values with the real values in the URI\n\t\t\t\tforeach ($fakeUri as $key => $value) {\n\t\t\t\t\tif ($value == '.+')\t$replacementValues[] = $realUri[$key];\n\t\t\t\t}\n\n\t\t\t\t// Pass an array for arguments\n\t\t\t\tcall_user_func_array($this->functions[$step], $replacementValues);\n\t\t\t\texit;\n\t\t\t}\n\n\t\t} // End of Loop\n\n\t}", "public function init()\n\t{\n\t\t$this->update();\n\t\t\n\t\tif ($this->config->enable->value)\n\t\t{\n\t\t\t$this->bindSockets(\n\t\t\t\t$this->config->listen->value,\n\t\t\t\t$this->config->listenport->value\n\t\t\t);\n\t\t}\n\t}", "private function listeners()\n {\n foreach ($this['config']['listeners'] as $eventName => $classService) {\n $this['dispatcher']->addListener($classService::NAME, [new $classService($this), 'dispatch']);\n }\n }", "function listen($listener)\n{\n return XPSPL::instance()->listen($listener);\n}", "public function listenTo($file);", "public function _register()\n {\n }", "function listen()\n {\n $method = strtoupper($_SERVER['REQUEST_METHOD']);\n $path = trim($_SERVER['REQUEST_URI']);\n\n print $this->match_and_exec($method, $path);\n }", "public function accept();", "public function listen(\\ReflectionClass $class): void;", "public function register(): void;", "abstract public function register();", "abstract public function register();", "abstract public function register();", "protected function listen() {\n\t\t// Sanity check\n\t\tif ( ! isset( $_GET['_wpnonce'] ) || ! wp_verify_nonce( $_GET['_wpnonce'], 'timezone-settings' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Update request?\n\t\tif ( isset( $_GET['timezone-update'] ) ) {\n\t\t\t$updater = new Tribe__Events__Admin__Timezone_Updater;\n\t\t\t$updater->init_update();\n\t\t}\n\t}", "public function subscribe(): void\n {\n foreach (static::$eventHandlerMap as $eventName => $handler) {\n $this->events->listen($eventName, [$this, $handler]);\n }\n }", "public function subscribe(): void;", "public function initListeningEvent()\n {\n if(!$this->server instanceof \\Swoole\\WebSocket\\Server){\n throw new \\Exception('swoole的websocket服务还未开启');\n }\n try{\n $processor = new LoginCommonCallServiceProcessor(new LoginCommonService($this->server));\n $tFactory = new TTransportFactory();\n $pFactory = new TBinaryProtocolFactory();\n $transport = new ServerTransport($this->server);\n $server = new \\src\\Thrift\\Server\\Server($processor, $transport, $tFactory, $tFactory, $pFactory, $pFactory);\n $server->serve();\n }catch (\\TException $e){\n throw new \\Exception('thrift启动失败');\n }\n }", "public function __construct()\n {\n Hook::listen(__CLASS__);\n }", "protected function setupListeners()\n {\n //\n }", "public function register()\n {\n if($this->catch) $this->bind();\n if($this->raw) $this->raw();\n }", "public function onReady() {\n\t\t$appInstance = $this; // a reference to this application instance for ExampleWebSocketRoute\n\t\t\\PHPDaemon\\WebSocket\\WebSocketServer::getInstance()->addRoute('ExamplePubSub', function ($client) use ($appInstance) {\n\t\t\treturn new ExamplePubSubWebSocketRoute($client, $appInstance);\n\t\t});\n\t\t$this->sql = \\PHPDaemon\\Clients\\MySQLClient::getInstance();\n\t\t$this->pubsub = new \\PHPDaemon\\PubSub();\n\t\t$this->pubsub->addEvent('usersNum', \\PHPDaemon\\PubSubEvent::init()\n\t\t\t\t\t\t\t\t\t\t\t\t ->onActivation(function ($pubsub) use ($appInstance) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t \\PHPDaemon\\Daemon::log('onActivation');\n\t\t\t\t\t\t\t\t\t\t\t\t\t if (isset($pubsub->event)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \\PHPDaemon\\Timer::setTimeout($pubsub->event, 0);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t return;\n\t\t\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t\t\t\t $pubsub->event = setTimeout(function ($timer) use ($pubsub, $appInstance) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t $appInstance->sql->getConnection(function ($sql) use ($pubsub) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t if (!$sql->connected) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t return;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $sql->query('SELECT COUNT(*) `num` FROM `dle_users`', function ($sql, $success) use ($pubsub) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $pubsub->pub(sizeof($sql->resultRows) ? $sql->resultRows[0]['num'] : 'null');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t });\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t });\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t $timer->timeout(5e6); // 5 seconds\n\t\t\t\t\t\t\t\t\t\t\t\t\t }, 0);\n\t\t\t\t\t\t\t\t\t\t\t\t })\n\t\t\t\t\t\t\t\t\t\t\t\t ->onDeactivation(function ($pubsub) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t if (isset($pubsub->event)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \\PHPDaemon\\Timer::cancelTimeout($pubsub->event);\n\t\t\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t\t\t })\n\t\t);\n\t}", "public function listen(): void\n {\n $this->logger->debug('Start listening to the queue.');\n $handler = function (MessageInterface $message) {\n $this->worker->process($message, $this);\n };\n\n $this->driver->subscribe($handler);\n $this->logger->debug('Finish listening to the queue.');\n }", "public function register():void\n {\n //returning a concrete Client request interface depending on the config. Mainly for testing\n $this->app->singleton(ClientRequestInterface::class, function($app){\n if(\\config('app')['env'] === 'live') {\n return new LiveClientRequest();\n }\n return new TestClientRequest();\n });\n }", "private function listenSocket() {\n $result = socket_listen($this->listeningSocket);\n $this->checkResult($result);\n }", "protected function setSwooleServerListeners()\n {\n foreach ($this->events as $event) {\n $listener = Str::camel(\"on_$event\");\n $callback = method_exists($this, $listener) ? [$this, $listener] : function () use ($event) {\n $this->triggerEvent($event, func_get_args());\n };\n\n $this->getServer()->on($event, $callback);\n }\n }", "protected function registerEvents()\n {\n $events = $this->app->make(Dispatcher::class);\n\n foreach ($this->events as $event => $listeners) {\n foreach ($listeners as $listener) {\n $events->listen($event, $listener);\n }\n }\n }", "protected function registerEvents(): void\n {\n $events = $this->app->make(Dispatcher::class);\n\n foreach ($this->events as $event => $listeners) {\n foreach ($listeners as $listener) {\n $events->listen($event, $listener);\n }\n }\n }", "function servicemain() {\n $http = new \\Higgs\\HttpServer();\n/*\n $http->addExtension(new \\Higgs\\Extensions\\Misc\\AddHeader([\n \"header\" => \"x-foo\",\n \"value\" => \"Hello World\"\n ]));\n*/\n $cfg = ObjMan::getObject(\"local:/config/higgs\");\n\n $exts = $cfg->query(\"/httpd/server[default]/extension\");\n foreach($exts as $ext) {\n $cn = \\Utils::getClassFromDotted($ext[0]);\n class_exists($cn);\n }\n foreach($exts as $ext) {\n $cn = \\Utils::getClassFromDotted($ext[0]);\n if (class_exists($cn)) {\n $ext = new $cn($ext->getAttributes());\n $http->addExtension($ext);\n } else {\n $this->warn(\"Could not load extension '{$ext[0]}'\");\n }\n }\n\n //$ctrl = new \\Higgs\\HttpControl();\n\n $server = new SocketServer();\n\n $ports = $cfg->query(\"/httpd/server[default]/listen\");\n foreach($ports as $ep) {\n $endpoint = $ep[0];\n if ($ep->hasAttribute(\"certificate\")) {\n $cert = new Certificate(\"server.pem\");\n $this->debug(\"Using certificate %s\", \"server.pem\");\n $info = $cert->getCertificateInfo();\n list($vfrom,$vto) = $cert->getValidity();\n $this->debug(\" Issued to: %s\", $info[\"name\"]);\n $this->debug(\" Issuer: %s (%s)\", $info[\"issuer\"][\"O\"], $info[\"issuer\"][\"OU\"]);\n $this->debug(\" Hash: 0x%s\", $info[\"hash\"]);\n $this->debug(\" Valid from: %s\", $vfrom);\n $this->debug(\" Valid until: %s\", $vto);\n if ($cert->isSelfSigned()) {\n $this->warn(\"Warning! The certificate in use is self-signed. Consider getting a proper certificate for production use.\");\n $this->warn(\"HSTS by design does not allow self-signed certificates. Enabling HSTS will not work.\");\n }\n $server->addListener($endpoint, $http, $cert);\n } else {\n $server->addListener($endpoint, $http);\n }\n }\n /*\n $server->addListener(\"tcp://127.0.0.1:9700\", $http);\n $server->addListener(\"ssl://127.0.0.1:9701\", $http, $cert);\n $server->addListener(\"tcp://127.0.0.1:9799\", $http);\n */\n while($server->process()) {\n usleep(5000);\n if ($this->stop) break;\n }\n }", "public function listen(): static\n {\n $this->breakLoop = false;\n $this->listening = true;\n\n $baseTime = microtime(true);\n $times = [];\n $lastCycle = $baseTime;\n $this->generateMaps = false;\n $this->generateMaps();\n\n $this->startSignalHandlers();\n $this->breakLoop = false;\n\n while (!$this->breakLoop) {\n $socketCount = count($this->sockets);\n $streamCount = count($this->streams);\n $signalCount = count($this->signals);\n $timerCount = count($this->timers);\n\n if ($this->generateMaps) {\n $this->generateMaps();\n }\n\n $hasHandler = false;\n\n\n // Timers\n if (!empty($this->timers)) {\n $hasHandler = true;\n $time = microtime(true);\n\n foreach ($this->timers as $id => $binding) {\n if ($binding->frozen) {\n continue;\n }\n\n $dTime = $times[$id] ?? $baseTime;\n $diff = $time - $dTime;\n\n if ($diff > $binding->duration) {\n $times[$id] = $time;\n $binding->trigger(null);\n }\n }\n }\n\n\n\n // Signals\n if (!empty($this->signals) && $this->hasPcntl) {\n $hasHandler = true;\n pcntl_signal_dispatch();\n }\n\n // Sockets\n if (!empty($this->socketMap)) {\n $hasHandler = true;\n $e = null;\n\n /** @var array<int, resource|Socket> $read */\n $read = $this->socketMap[self::RESOURCE][self::READ];\n /** @var array<int, resource|Socket> $write */\n $write = $this->socketMap[self::RESOURCE][self::WRITE];\n\n try {\n /* @phpstan-ignore-next-line */\n $res = socket_select($read, $write, $e, 0, 10000);\n } catch (Throwable $e) {\n $res = false;\n }\n\n if ($res === false) {\n // TODO: deal with error\n } elseif ($res > 0) {\n foreach ($read as $resourceId => $socket) {\n foreach (Coercion::toArray(\n $this->socketMap[self::HANDLER][self::READ][$resourceId]\n ) as $id => $binding) {\n /** @var Binding $binding */\n $binding->trigger($socket);\n }\n }\n\n foreach ($write as $resourceId => $socket) {\n foreach (Coercion::toArray(\n $this->socketMap[self::HANDLER][self::WRITE][$resourceId]\n ) as $id => $binding) {\n /** @var Binding $binding */\n $binding->trigger($socket);\n }\n }\n }\n\n // TODO: add timeout handler\n }\n\n // Streams\n if (!empty($this->streamMap)) {\n $hasHandler = true;\n $e = null;\n\n /** @var array<int, resource> $read */\n $read = $this->streamMap[self::RESOURCE][self::READ];\n /** @var array<int, resource> $write */\n $write = $this->streamMap[self::RESOURCE][self::WRITE];\n\n try {\n $res = stream_select($read, $write, $e, 0, 10000);\n } catch (Throwable $e) {\n $res = false;\n }\n\n\n if ($res === false) {\n // TODO: deal with error\n } elseif ($res > 0) {\n foreach ($read as $resourceId => $stream) {\n foreach (Coercion::toArray(\n $this->streamMap[self::HANDLER][self::READ][$resourceId]\n ) as $id => $binding) {\n /** @var Binding $binding */\n $binding->trigger($stream);\n }\n }\n\n foreach ($write as $resourceId => $stream) {\n foreach (Coercion::toArray(\n $this->streamMap[self::HANDLER][self::WRITE][$resourceId]\n ) as $id => $binding) {\n /** @var Binding $binding */\n $binding->trigger($stream);\n }\n }\n }\n\n // TODO: add timeout handler\n }\n\n\n // Tick\n if (\n !$this->breakLoop &&\n $this->tickHandler\n ) {\n if (false === ($this->tickHandler)($this)) {\n $this->breakLoop = true;\n }\n }\n\n // Cycle\n if (\n !$this->breakLoop &&\n $this->cycleHandler\n ) {\n $time = microtime(true);\n\n if ($time - $lastCycle > 1) {\n $lastCycle = $time;\n\n if (false === ($this->cycleHandler)(++$this->cycles, $this)) {\n $this->breakLoop = true;\n }\n }\n }\n\n\n if (!$hasHandler) {\n $this->breakLoop = true;\n } elseif (\n $socketCount !== count($this->sockets) ||\n $streamCount !== count($this->streams) ||\n $signalCount !== count($this->signals) ||\n $timerCount !== count($this->timers)\n ) {\n $this->generateMaps = true;\n }\n\n usleep(30000);\n }\n\n $this->breakLoop = false;\n $this->listening = false;\n\n $this->stopSignalHandlers();\n\n return $this;\n }", "public function createSubscriber();", "public function listen(callable $callback);", "public function botman()\n {\n $botman = app('botman');\n\n $botman->middleware->received(ApiAi::create(config('services.dialogflow.key'))->listenForAction());\n\n $botman->hears('{something}', __CLASS__ . '@telegram');\n\n $botman->listen();\n }", "protected function registered()\n {\n //\n }", "public function register()\n {\n // Bind any implementations.\n }", "public function setup()\n {\n $this->getClient()->addSubscriber($this);\n }", "protected function listen()\n {\n // Set time limit to indefinite execution\n set_time_limit (0);\n\n $this->socket = socket_create(\n AF_INET,\n SOCK_DGRAM,\n SOL_UDP\n );\n\n if (!is_resource($this->socket))\n {\n $this->logger->log(\"Failed to create a socket for the discovery server. The reason was: \" .\n socket_strerror(socket_last_error()));\n }\n\n if (!@socket_bind(\n $this->socket,\n $this->config->getSetting('discovery-address'),\n $this->config->getSetting('discovery-port')))\n {\n $this->logger->log(\"Failed to bind to socket while initialising the discovery server.\");\n }\n\n // enter an infinite loop, waiting for data\n $data = '';\n while (true)\n {\n if (@socket_recv($this->socket, $data, 9999, MSG_WAITALL))\n {\n $this->logger->log(\"Discovery server received the following: $data\");\n\n $this->handleMessage($data);\n }\n }\n }", "protected function setSwooleServerListeners()\n {\n foreach ($this->events as $event) {\n $listener = 'on' . ucfirst($event);\n\n if (method_exists($this, $listener)) {\n $this->server->on($event, [$this, $listener]);\n } else {\n $this->server->on($event, function () use ($event) {\n $event = sprintf('swoole.%s', $event);\n\n $this->container['events']->fire($event, func_get_args());\n });\n }\n }\n }", "protected function registerListeners()\n {\n // Login event listener\n #Event::listen('auth.login', function($user) {\n //\n #});\n\n // Logout event subscriber\n #Event::subscribe('Mrcore\\Parser\\Listeners\\MyEventSubscription');\n }", "abstract public function register ( );", "public static function register_connections()\n {\n }", "public static function register_connections()\n {\n }", "public static function register_connections()\n {\n }", "public static function register_connections()\n {\n }", "public static function register_connections()\n {\n }", "public static function register_connections()\n {\n }", "public static function register_connections()\n {\n }", "public static function register_connections()\n {\n }", "public static function register_connections()\n {\n }", "public static function register_connections()\n {\n }", "public static function register_connections()\n {\n }", "public static function register_connections()\n {\n }", "public static function register_connections()\n {\n }", "public static function register_connections()\n {\n }", "public function register(): void\n {\n }", "public function register(): void\n {\n }", "public function register(): void\n {\n }", "public function register(): void\n {\n }", "public function register(): void\n {\n }", "public function listen() {\n add_filter( \"the_content\", array($this, \"theContent\"));\n add_filter( \"the_title\", array($this, \"theTitle\"));\n }", "public function register()\n {\n // maybe something, one day\n }", "public function start()\n {\n $this->registerDefaultServices();\n\n $this->handle($this->request->createFromGlobals());\n }", "public function register()\n\t{\n\t\t\n\t}", "public static function registerListeners()\n {\n static::creating('Wildside\\Userstamps\\Listeners\\Creating@handle');\n static::updating('Wildside\\Userstamps\\Listeners\\Updating@handle');\n\n if( method_exists(get_called_class(), 'deleting') )\n {\n static::deleting('Wildside\\Userstamps\\Listeners\\Deleting@handle');\n }\n\n if( method_exists(get_called_class(), 'restoring') )\n {\n static::restoring('Wildside\\Userstamps\\Listeners\\Restoring@handle');\n }\n }", "public function subscription();", "protected function _start_listening(){\r\n\t\t\tset_error_handler(array($this->_reporter, 'handle_error'));\r\n\t\t\tset_exception_handler(array($this->_reporter, 'handle_exception'));\r\n\t\t\terror_reporting(-1);\r\n\t\t\tini_set('display_errors', false);\r\n\t\t}", "public function register(): void\n {\n\n }", "public function register()\r\n\t{\r\n\r\n\t}", "public function register()\r\n\t{\r\n\r\n\t}", "public function register()\r\n\t{\r\n\r\n\t}", "public function start() {}", "public function start() {}" ]
[ "0.8224262", "0.76087373", "0.72176516", "0.7040603", "0.6965995", "0.6789159", "0.67548424", "0.6731088", "0.65945244", "0.6588859", "0.65837795", "0.65804136", "0.65543073", "0.65543073", "0.65543073", "0.65543073", "0.65543073", "0.65543073", "0.65543073", "0.65543073", "0.6545715", "0.64290124", "0.64057964", "0.63808787", "0.6375473", "0.6368658", "0.63577145", "0.6328821", "0.63180524", "0.630941", "0.62893003", "0.62855625", "0.6276278", "0.62735504", "0.6272483", "0.62667954", "0.62654227", "0.626317", "0.6255637", "0.62138915", "0.6203715", "0.6203715", "0.6203715", "0.6195709", "0.61764896", "0.61622113", "0.6155756", "0.61549973", "0.6152712", "0.6152158", "0.6150503", "0.61338156", "0.6129568", "0.6128667", "0.6109698", "0.60938644", "0.6084956", "0.6081862", "0.6069326", "0.6062393", "0.60568845", "0.60460377", "0.6037545", "0.60332114", "0.60033727", "0.59996736", "0.5992533", "0.5988008", "0.5984608", "0.59760195", "0.59760195", "0.59760195", "0.59760195", "0.59760195", "0.59760195", "0.59760195", "0.59760195", "0.59760195", "0.59760195", "0.59760195", "0.59760195", "0.59760195", "0.59760195", "0.59716874", "0.59716874", "0.59716874", "0.59716874", "0.59716874", "0.59661037", "0.595038", "0.5948595", "0.59315586", "0.59306747", "0.5929916", "0.5910887", "0.5908955", "0.5907415", "0.5907415", "0.5907415", "0.59005725", "0.5900552" ]
0.0
-1
You call call this: unlisten, remove, et
public function detach(Observer $observer) { foreach ($this->observers as $key => $obs) { if ($observer == $obs) { unset($this->observers[$key]); break; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __destruct() {\n\t\tif($this->_listeningenabled)\n\t\t\t$this->unlisten();\n\t}", "public function clearListeners()\n {\n $this->listeners = array();\n }", "public function unsubscribe(): void;", "public function unSubscribe()\n {\n }", "public function testRemoveListener()\n {\n // Arrange\n $listenerCalled = false;\n $communicator = new Communicator();\n\n $callback = function () use (&$listenerCalled) {\n $listenerCalled = true;\n };\n\n // Act\n $communicator->addListener($callback);\n $communicator->removeListener($callback);\n $communicator->broadcast([], 'channel', [], []);\n\n // Assert\n static::assertFalse($listenerCalled);\n }", "public function remove($listener);", "public function removeSubscribes();", "public function listen();", "public function onRemove();", "public function releaseEvents();", "public function releaseEvents();", "protected function _unsubscribeFromEngineEvents()\n {\n $events = array(\n Streamwide_Engine_Events_Event::SDP,\n Streamwide_Engine_Events_Event::CHILD,\n Streamwide_Engine_Events_Event::OKMOVED,\n Streamwide_Engine_Events_Event::MOVED,\n Streamwide_Engine_Events_Event::FAILMOVED\n );\n \n $controller = $this->getController();\n foreach ( $events as $event ) {\n $controller->removeEventListener( $event, array( 'callback' => array( $this, 'onSignalReceived' ) ) );\n }\n }", "public function clearSubscribers();", "public function stopListeningForEvents()\n\t\t{\n\n\t\t\t// Initialize the crontab manager if this has not been done before\n\t\t\tif(is_null($this->CronManager)) $this->CronManager = new ssh2_crontab_manager();\n\n\t\t\t// Stop cronjob to call $this-->captureSongHistory()\n\t\t\t$this->CronManager->remove_cronjob(\"checkTimeEventExecutionNeeds\");\n\n\t\t\t// Write status to the config\n\t\t\t$this->data['config']['mod_time__checkTimeEventExecutionNeedsCron'] = \"disabled\";\n\t\t\t$this->writeConfFile($this->data['config'], true);\n\n\t\t}", "public function unregister(): void;", "public function unregister(): void;", "public function clearListeners(string $event): void;", "public function removeObserver() {\n //$this->__observers = array();\n foreach($this->__observers as $obj) {\n unset($obj);\n }\n }", "public function remove() {}", "public function remove() {}", "public function destroy()\n {\n $this->stop();\n $this->setupListeners();\n }", "public static function offAll()\n {\n self::$_events = [];\n self::$_eventWildcards = [];\n }", "public function unSubscribe()\n {\n $this->disconnect();\n $this->queue = $this->currentEnvelope = null;\n }", "function eventUnRegister($eventName, $id);", "function destroy()\n {\n eval(PUBSUB_MUTATE);\n $this->_evl->clearInterestOnReadable($this->_insock);\n if ($this->_insock != $this->_outsock)\n {\n @socket_close($this->_insock);\n }\n $this->_read_eof = true;\n\n $this->_evl->clearInterestOnWritable($this->_outsock);\n @socket_close($this->_outsock);\n $this->_output_shutdown = true;\n $this->_finished_writing = true;\n\n $this->_call_close_callback();\n }", "protected function _unsubscribeFromEngineEvents()\n {\n $controller = $this->getController();\n $controller->removeEventListener(\n Streamwide_Engine_Events_Event::ENDOFFAX,\n array( 'callback' => array( $this, 'onEndOfFax' ) )\n );\n $controller->removeEventListener(\n Streamwide_Engine_Events_Event::FAXPAGE,\n array( 'callback' => array( $this, 'onFaxPage' ) )\n );\n }", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "public function onQuit()\n {\n $nick = trim($this->event->getNick());\n\n foreach ($this->store as $chan => $store) {\n if (isset($store[$nick])) {\n unset($this->store[$chan][$nick]);\n }\n }\n }", "public function detach(): void\n\t{\n\t\t$this->events->detach($this->type, $this->hook);\n\t}", "public function clear(): void\n {\n $this->eventRegistry->dequeueEvents();\n }", "function UnInstallEvents()\n\t{\n\t}", "public function __destruct()\n\t{\n\t\tif (static::$instance != NULL)\n\t\t\tstatic::$instance = NULL;\n\t\tforeach (static::$events as $event => $events)\n\t\t\tstatic::$events[$event] = [];\n\t}", "public function clearEvents()\n {\n $this->recorded = [];\n }", "public function unsetEventDispatcher()\n {\n $this->events = null;\n }", "public function remove() {\n }", "public function removeParseListeners(): void\n {\n $this->parseListeners = [];\n }", "public function truncateEventClosures(): void\n {\n $this->listeners = [];\n }", "public function postEventDel();", "public function listen() {\n $this->source->listen($this->id);\n }", "private function unsubscribe()\n {\n $this->botman->hears('unsubscribe', function(BotMan $bot) {\n $userId = $bot->getUser()->getId();\n Subscriber::where('telegram_user_id', $userId)->delete();\n $bot->reply('You have just unsubscribed from our updates!');\n });\n }", "function drop() {}", "function drop() {}", "public static function flushEventListeners()\n {\n if (!isset(static::$dispatcher)) {\n return;\n }\n\n $instance = new static;\n\n foreach ($instance->getObservableEvents() as $event) {\n static::$dispatcher->forget(\"halcyon.{$event}: \".get_called_class());\n }\n\n static::$eventsBooted = [];\n }", "public function __destruct() {\n\t\t$this->Unsubscribe();\n\t\t$this->CloseConnections();\n\t}", "public function remove($event, $listener);", "public function shutdown(): void\n {\n $this->handleOnShutDownListeners();\n }", "public function shutdown(): void\n {\n $this->handleOnShutDownListeners();\n }", "public function removeMe()\n {\n $this->current_signal=self::SIGNAL_NONE;\n $this->sigtable=[];\n Bot::remove($this->bot_slot,0);\n }", "protected function _stop_listening(){\r\n\t\t\trestore_error_handler();\r\n\t\t\trestore_exception_handler();\r\n\t\t\terror_reporting();\r\n\t\t\tini_set('display_errors', true);\r\n\t\t}", "public function forgetPushed()\n {\n foreach ($this->listeners as $key => $value) {\n if (Str::endsWith($key, '_pushed')) {\n $this->forget($key);\n }\n }\n }", "abstract public function remove();", "abstract public function remove();", "abstract public function remove();", "static function remove() {\n }", "public function clearEvents()\n\t{\n\t\t$this->collEvents = null; // important to set this to NULL since that means it is uninitialized\n\t}", "public function startListening();", "public function delSignal(): bool {}", "protected function removeInstance() {}", "public function removeListener($name, $listener);", "public function remove_hooks()\n {\n }", "public function remove_hooks()\n {\n }", "private function _unsetSetup()\n\t{\n\t\tforeach ( $this->_setup as $setup )\n\t\t{\n\t\t\t$setup->disconnect();\n\t\t}\n\n\t\t$this->_setup = null;\n\t\t$this->_setup = array();\n\t}", "public function drop(): void;", "public function tearDown() {\n $this->listener = null;\n $this->event = null;\n $this->request = null;\n }", "public function detach()\n {\n // dummy implementation\n }", "public function removeAllListeners($eventName);", "public function resetCurrentSubscribers()\n {\n $this->currentSubscribers = [];\n }", "public function detach(\\SplObserver $observer) {}", "public function removeListeners($event = NULL)\n\t{\n\t\tif (!empty($event) && array_key_exists($event, static::$events)) {\n\t\t\tstatic::$events[$event] = [];\n\t\t} else {\n\t\t\tforeach (static::$events as $evt => $events)\n\t\t\t\tstatic::$events[$evt] = [];\n\t\t}\n\t}", "public function unsubscribe()\n {\n echo \"<br>\";\n echo \"Action: Cancelling Subscription !\";\n unset($this->plan);\n unset($this->server);\n unset($this->serverList);\n\n }", "function Unregister($client, $msg);", "static public function deleteHandlers()\n\t{\n\t\tself::$handlers = array();\n\t}", "public function remove()\n {\n }", "public function off($name)\n {\n foreach ($this->events as $key => $events) {\n if (preg_match(\"/^$name$|$name\\.)/\", $key)) {\n unset($this->events[$key]);\n }\n }\n }", "public function listen()\n {\n $this->openWorker();\n while (!Signal::isExit()) {\n if (($payload = $this->pop(3)) !== null) {\n list($id, $message) = explode(':', $payload, 2);\n $this->handleMessage($message);\n }\n }\n $this->closeWorker();\n }", "public function onStop();", "protected function setSwooleServerListeners()\n {\n foreach ($this->events as $event) {\n $listener = Str::camel(\"on_$event\");\n $callback = method_exists($this, $listener) ? [$this, $listener] : function () use ($event) {\n $this->triggerEvent($event, func_get_args());\n };\n\n $this->getServer()->on($event, $callback);\n }\n }", "function detach($observer, $eventIDArray)\n {\n foreach ($eventIDArray as $eventID) {\n $nameHash = md5(get_class($observer) . $eventID);\n base::unsetStaticObserver($nameHash);\n }\n }", "public function tearDown() {\n $this->subscriber = null;\n }", "public function detach() {}", "public function detach() {}", "public static function unsetEventDispatcher()\n {\n static::$dispatcher = null;\n }", "public function removeSubRequests();", "public function __destruct() {\n $this->closeSocketResource($this->listeningSocket);\n $this->closeSocketResource($this->communicationSocket);\n }", "public function unbind(string $name): void;", "public function dispatchLoopShutdown()\n {\n\n }", "protected function setSwooleServerListeners()\n {\n foreach ($this->events as $event) {\n $listener = 'on' . ucfirst($event);\n\n if (method_exists($this, $listener)) {\n $this->server->on($event, [$this, $listener]);\n } else {\n $this->server->on($event, function () use ($event) {\n $event = sprintf('swoole.%s', $event);\n\n $this->container['events']->fire($event, func_get_args());\n });\n }\n }\n }", "public function reset() {\n $this->_events->reset();\n }", "public function afterRemove()\n\t{}", "public function detachShared(SharedEventManagerInterface $events)\n\t\t{\n\t\t\tforeach ($this->listeners as $index => $listener) {\n\t\t\t if ($events->detach($index, $listener)) {\n\t\t\t\t unset($this->listeners[$index]);\n\t\t\t }\n\t\t }\n\t\t}", "protected function __del__() { }", "public function __destruct() {\n\t\t$this->stopRinging();\n\t}", "public static function getSubscribedEvents();", "public static function getSubscribedEvents();", "public function unregister()\n {\n $previousHandlers = $this->previousHandlers;\n\n foreach ($previousHandlers as $signal => $handler) {\n if (is_null($handler)) {\n pcntl_signal($signal, SIG_DFL);\n\n unset($previousHandlers[$signal]);\n }\n }\n\n $this->setHandlers($previousHandlers);\n }", "public function removeListener($name) {\n\t\t$listeners = $this->config('listeners');\n\t\tif (!array_key_exists($name, $listeners)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (isset($this->_listenerInstances[$name])) {\n\t\t\t$this->_eventManager->detach($this->_listenerInstances[$name]);\n\t\t\tunset($this->_listenerInstances[$name]);\n\t\t}\n\n\t\tunset($listeners[$name]);\n\t\t$this->settings['listeners'] = $listeners;\n\t}", "public function subscribe(): void;", "public function remove()\n {\n\n }" ]
[ "0.7123141", "0.6706404", "0.6591549", "0.6434183", "0.6400936", "0.6361379", "0.6290306", "0.62532556", "0.62300926", "0.6049125", "0.6049125", "0.60374266", "0.60308427", "0.60060024", "0.59300137", "0.59300137", "0.5853193", "0.58416015", "0.5818158", "0.58168507", "0.5779595", "0.57778066", "0.57306457", "0.5723774", "0.57186866", "0.5690611", "0.56903404", "0.56903404", "0.56903404", "0.56903404", "0.5673531", "0.5652649", "0.5595467", "0.55349034", "0.55064327", "0.5501476", "0.5474631", "0.5455163", "0.54448307", "0.5440129", "0.54399675", "0.5433857", "0.542615", "0.5424295", "0.5424295", "0.54231924", "0.54115015", "0.5409083", "0.5406747", "0.5406747", "0.53732336", "0.5371591", "0.5360746", "0.5359491", "0.5359491", "0.5359491", "0.534396", "0.53382385", "0.5322298", "0.5316377", "0.53137064", "0.5293055", "0.52713996", "0.52713996", "0.52709866", "0.5263336", "0.5261325", "0.52590334", "0.52346665", "0.5230205", "0.52259696", "0.52238476", "0.5222735", "0.5216157", "0.5212789", "0.5210826", "0.52099514", "0.52053374", "0.5203133", "0.5200037", "0.51921856", "0.5190912", "0.51901644", "0.51901644", "0.51847506", "0.51805204", "0.51711214", "0.5166953", "0.51606023", "0.51572096", "0.515701", "0.5149252", "0.51359034", "0.51223063", "0.51143736", "0.51139283", "0.51139283", "0.51138496", "0.5111879", "0.5107845", "0.5103981" ]
0.0
-1
You could call this: update, push, etc
public function notify() { // Updates all classes subscribed to this object foreach ($this->observers as $obs) { $obs->update($this); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function update() {}", "public function update();", "public function update();", "public function update();", "public function update();", "public function update() {\r\n\r\n\t}", "abstract protected function update ();", "function update() {\n\n\t\t\t}", "public abstract function update();", "abstract public function update();", "abstract public function update();", "public function update() {\r\n }", "public function update()\r\n {\r\n //\r\n }", "public function update()\r\n {\r\n \r\n }", "public function update()\n\t{\n\n\t}", "public function push();", "public function push();", "protected function _update()\n\t{\n\t}", "public function update()\n {\n //\n }", "public function update()\n {\n //\n }", "protected function _update()\n {\n \n }", "protected function _update()\n {\n \n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "abstract function update();", "public function update () {\n\n }", "public function update()\n {\n }", "public function updating()\n {\n # code...\n }", "public function update() {\n \n }", "public function update()\n {\n\n }", "public function update()\n {\n\n }", "public static function update(){\n }", "abstract public function updateData();", "public function update()\n {\n \n }", "public function update()\n {\n \n }", "public function update() {\n\t\treturn;\n\t}", "public static function update(){\r\n }", "public function update()\n {\n # code...\n }", "public function _update()\n\t {\n\t \t$this->notifyObservers(__FUNCTION__);\n\t }", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function notify()\n {\n foreach ($this->storage as $obs){\n $obs->update($this);\n }\n }", "function push_raw_ref ( ) {\n\t\t$this->raw_refs[] = $this->raw_ref;\n\t\t$this->clear_raw_ref();\n\t}", "public function update(): void\n {\n }", "public function testUpdateStore()\n {\n\n }", "function add()\n\t{\n\t\t$this->_updatedata();\n\t}", "public function update()\n {\n return [\n [self::DRUSH, 'updatedb']\n ];\n }", "public function fetchUpdates()\n\t{\n\t}", "public function update(){\n\n }", "public function update(){\n\n }", "public function update( &$object );", "abstract public function mass_update();", "public function onUpdate();", "public function onUpdate();", "public function onUpdate();", "public function testUpdate(): void { }", "protected function performUpdate() {}", "public function db_update() {}", "function addUpdate() {\n\t\tif ($this->id) $this->update();\n\t\telse $this->insert();\n\t}", "public function update(){\n\t\t$modifications[] = new Modification();\n\t}", "public function commitUpdate();", "function sync() {\n\t\t// TODO\n\t}", "function before_update() {}", "function put() \n {\n \n }", "public function pushUpdate($update) {\n Event::fire($this->getEventID(), [$this->type, $this->filter, $update, $this->getCache('wake')]);\n }", "public function update() {\n parent::update();\n }", "public function update()\n {\n \n foreach($this->feed->sources as $source){\n \n //Find the right source handler.\n switch($source->type->get()){\n \n case 'TWITTER_TIMELINE':\n $handler = new TwitterTimelineSourceHandler($source);\n break;\n \n case 'TWITTER_SEARCH':\n $handler = new TwitterSearchSourceHandler($source);\n break;\n \n }\n \n //Query for new messages.\n $messages = $handler->query();\n \n //Save those messages.\n mk('Logging')->log('Message board', 'New messages', $messages->size());\n foreach($messages as $message){\n $message\n ->save()\n ->save_webpages()\n ->save_images();\n }\n \n }\n \n }", "public function touch()\n {\n $this->_memManager->processUpdate($this, $this->_id);\n }", "public static function updateAll()\r\n\t{\r\n\t}", "public function push($value): void {}", "public function push($value): void {}", "public function getUpdated();", "public function getUpdated();", "function after_update() {}", "public function put();", "public function put();", "protected function _preupdate() {\n }", "public function after_update() {}", "abstract public function update(&$sender, $arg);", "public function testUpdateServiceData()\n {\n\n }", "protected function afterUpdating()\n {\n }", "public function updateMultiple_data()\n {\n \n }", "private function pushCurrent()\n {\n if (!empty($this->data)) {\n $this->json .= 'dataLayer.push('.json_encode($this->data).');';\n $this->data = array();\n }\n }", "public function pushRecord()\r\n {\r\n\r\n }", "public function pull()\n {\n }", "protected function beforeUpdating()\n {\n }", "protected function listUpdates() {}", "public function update($data) {}", "public function update($data) {}", "public function onUpdateRecord()\n {\n $this->updated = new \\DateTime();\n $this->rev++;\n }", "function Update($array){\n\n }", "public function update(array $data);" ]
[ "0.7096601", "0.6950617", "0.6950617", "0.6950617", "0.6950617", "0.68675125", "0.68128335", "0.6690069", "0.66814363", "0.6680121", "0.6680121", "0.6679089", "0.6675179", "0.66539216", "0.66444767", "0.65971935", "0.65971935", "0.6575465", "0.6566636", "0.6566636", "0.65636295", "0.65636295", "0.6532512", "0.6532512", "0.6532512", "0.6532512", "0.6532512", "0.6532512", "0.6532512", "0.6532512", "0.6532512", "0.6532512", "0.6532512", "0.6532512", "0.6525948", "0.65101725", "0.6455629", "0.6448688", "0.64383435", "0.64155346", "0.64155346", "0.6378395", "0.6373841", "0.6348331", "0.6348331", "0.6329497", "0.6315454", "0.63074034", "0.62318385", "0.61951756", "0.6187466", "0.61862165", "0.61580944", "0.6088446", "0.60832334", "0.60749066", "0.60518175", "0.60484993", "0.60484993", "0.6004478", "0.596725", "0.5959578", "0.5959578", "0.5959578", "0.59595", "0.5925359", "0.58947945", "0.5892991", "0.5891805", "0.58826506", "0.5873575", "0.58655673", "0.5838309", "0.5828792", "0.58018297", "0.5800829", "0.5797175", "0.57913876", "0.57890433", "0.57890433", "0.57834166", "0.57834166", "0.5783082", "0.57823586", "0.57823586", "0.57789487", "0.5774293", "0.5758786", "0.57519865", "0.5750157", "0.5748453", "0.5742733", "0.574053", "0.5735662", "0.57140404", "0.57139194", "0.57086164", "0.57086164", "0.5708562", "0.57025373", "0.56942654" ]
0.0
-1
Example of notifying the observer state change
public function updateName($name) { $this->name = $name; // This triggers all attached observers $this->notify(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function notify()\n {\n foreach ($this->observers as $obKey => $obValue) {\n $obValue->update($this);\n }\n }", "public function observe() {}", "public function notify() {\n\t\tforeach($this->_observers as $key => $val) {\n\t\t\t$val->update($this);\n\t\t}\n\t}", "public function notify()\n\t{\n\t\tforeach ($this->observers as $obs)\n\t\t{\n\t\t\t$obs->update($this);\n\t\t}\n\t}", "public function notify(){\n foreach ($this->observers as $observer){\n $observer->update();\n }\n }", "public function notify()\n {\n foreach ($this->observers as $value) {\n $value->update($this);\n }\n }", "function notify()\n {\n foreach ($this->observers as $observer) {\n $observer->update($this);\n }\n }", "public function notify()\r\n {\r\n foreach( $this->observers as $observer )\r\n $observer->update( $this );\r\n\r\n }", "public function notify() {\n $this->observers->rewind();\n while($this->observers->valid()) {\n $object = $this->observers->current();\n // dump($object);die;\n $object->update($this);\n $this->observers->next();\n }\n }", "public function notify()\n {\n foreach ($this->observers as $observer) {\n $observer->update();\n }\n }", "public function notifyObserver()\n {\n if (!empty($this->observers)) {\n foreach ($this->observers as $observer) {\n $observer->update($this->getTemperature(), $this->getPressure(), $this->getHumidity());\n }\n }\n }", "public function notify()\n {\n foreach ($this->_observers as $observer) {\n $observer->update($this);\n }\n }", "public function _update()\n\t {\n\t \t$this->notifyObservers(__FUNCTION__);\n\t }", "public function observers();", "public function notifyObservers() {\n\t\tforeach ( $this->observers as $obs => $key )\n\t\t\t$key->update ( $this->actTemp, $this->maxTemp, $this->minTemp, $this->actPressure );\n\t}", "public function notify()\n {\n $eventName = $this->getEventName();\n if (empty($this->observers[$eventName])) {\n $observerNames = Model::factory('Observer')->getByEventName($eventName);\n foreach ($observerNames as $observerName) {\n $this->observers[$eventName][] = new $observerName();\n }\n }\n if (!empty($this->observers[$eventName])) {\n foreach ($this->observers[$eventName] as $observer) {\n $observer->update($this);\n }\n }\n }", "public function notifyObservers()\n {\n foreach ($this->observers as $obj) {\n $obj->update(\n $this->temperature,\n $this->humidity,\n $this->pressure\n );\n }\n }", "public function notify() {\n // Updates all classes subscribed to this object\n foreach ($this->observers as $obs) {\n $obs->update($this);\n }\n }", "public function notify()\n {\n foreach($this->_storage AS $observer) {\n $observer->update($this);\n }\n }", "public function notify()\n {\n foreach ($this->storage as $obs){\n $obs->update($this);\n }\n }", "public function notify() {}", "public function notify() {}", "public function notify() {}", "public function notify($instance);", "function notify();", "public function _postUpdate()\n\t{\n\t\t$this->notifyObservers(__FUNCTION__);\n\t}", "public function measurementsChanged(): void\n {\n $this->notifyObservers();\n }", "public function testObserversAreUpdated()\n {\n // only mock the update() method.\n $observer = $this->getMockBuilder('Company\\Product\\Observer')\n ->setMethods(array('update'))\n ->getMock();\n\n // Set up the expectation for the update() method\n // to be called only once and with the string 'something'\n // as its parameter.\n $observer->expects($this->once())\n ->method('update')\n ->with($this->equalTo('something'));\n\n // Create a Subject object and attach the mocked\n // Observer object to it.\n $subject = new \\Company\\Product\\Subject('My subject');\n $subject->attach($observer);\n\n // Call the doSomething() method on the $subject object\n // which we expect to call the mocked Observer object's\n // update() method with the string 'something'.\n $subject->doSomething();\n }", "public function measurementsChanged()\n {\n $this->notifyObservers();\n }", "public static function onStateChanged(callable $invoker)\n {\n }", "public function hasChanged();", "public function hasChanged();", "public function notify() : bool{}", "function update(AbstractSubject $subject)\n {\n write_in(\"Alert to observer\");\n write_in($subject->favorite);\n }", "public function testUpdateObserver() {\n\t\t$this->testSave();\n\t\t/** @var \\arConnector $observerConnector */\n\t\t$observerConnector = Mockery::namedMock(\"observerConnectorMock\", \\arConnector::class);\n\n\t\t\\arConnectorMap::register(new BucketContainer(), $observerConnector);\n\n\t\t// Observer is updated after tasks are added.\n\t\t$observerConnector->shouldReceive(\"read\")->once()->andReturn(1);\n\t\t$observerConnector->shouldReceive(\"update\")->once()->andReturn(true);\n\n\t\t$this->persistence->setConnector($observerConnector);\n\t\t$this->persistence->updateBucket($this->bucket);\n\t}", "#[@test]\n public function observe() {\n $observer= newinstance('util.Observer', array(), '{\n protected $observations= array();\n \n public function numberOfObservations() {\n return sizeof($this->observations);\n }\n \n public function observationAt($i) {\n return $this->observations[$i][\"arg\"];\n }\n \n public function update($obs, $arg= NULL) {\n $this->observations[]= array(\"observable\" => $obs, \"arg\" => $arg);\n }\n }');\n \n $db= $this->db();\n $db->addObserver($observer);\n $db->query('select 1');\n \n $this->assertEquals(2, $observer->numberOfObservations());\n \n with ($o0= $observer->observationAt(0)); {\n $this->assertInstanceOf('rdbms.DBEvent', $o0);\n $this->assertEquals('query', $o0->getName());\n $this->assertEquals('select 1', $o0->getArgument());\n }\n\n with ($o1= $observer->observationAt(1)); {\n $this->assertInstanceOf('rdbms.DBEvent', $o1);\n $this->assertEquals('queryend', $o1->getName());\n $this->assertInstanceOf('rdbms.ResultSet', $o1->getArgument());\n }\n }", "public function notifyWritable(StreamObserver $observer): void;", "public function notifyOne() : bool{}", "public function attach(\\SplObserver $observer) {}", "public function attach(\\SplObserver $observer) {}", "public function attach(\\SplObserver $observer) {}", "function isChanged(): bool;", "public function attach(\\SplObserver $observer) {}", "public function attach(\\SplObserver $observer) {}", "public function attach(\\SplObserver $observer) {}", "public static function observe( &$varname )\n\t\t{\n\t\t\t$this->observer_list[] =& $var;\n\t\t}", "public function eventMethod1()\n {\n // some code here...\n\n $this->notify(\"action1\");\n }", "public function result() {\n echo \"this is observer1\";\n }", "public function setChanged()\n {\n\n $this->_changed = true;\n\n }", "public function notify()\n {\n // @TODO: Needs to handle the various types of bounces: References, Recommendations, and general bounces that should be purged\n }", "public static function stateChanged($event)\r\n {\r\n }", "function notify($event) {\r\n\t\tif ( count($this->_listeners) > 0 ) {\r\n\t\t\tif ( false ) $listener = new ftpClientObserver();\r\n\t\t\tforeach ( $this->_listeners as $id => $listener ) {\r\n\t\t\t\t$listener->notify($event);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function result() {\n echo \"this is observer2\";\n }", "public function isObserved() {}", "public function activityNotify();", "public function notifyReadable(StreamObserver $observer): void;", "public function hasChanged(): bool;", "public function hasChanged(): bool;", "private function changed()\n {\n $this->isDirty = true;\n }", "final public function notifyOrderUpdated(): void\n {\n $this->dirtyIndex = true;\n }", "static public function status()\n {\n $GLOBALS['notification']->notify(array('listeners' => array('status', 'audio')));\n }", "public function result() {\n echo \"this is observer3\";\n }", "public function notify()\n\t\t{\n\t\t\techo \"Notifying via YM\\n\";\n\t\t}", "public function notification();", "public function notification();", "public function update( \\Aimeos\\MW\\Observer\\Publisher\\Iface $p, $action, $value = null );", "function notifyAnimate()\n {\n self::notifyAllPlayers(\"animate\", \"\", array());\n }", "public function setChanged($changed = true) { $this->changed = $changed; }", "public function onEvent();", "protected function notify_changes_saved() {\n $this->notify->good('gradessubmitted');\n }", "public function notify(ParameterBag $params);", "public function onUpdate();", "public function onUpdate();", "public function onUpdate();", "public function notify( mixed $extras = null ) : IObservable\n {\n\n if ( 1 < \\count( $this->_cache ) )\n {\n $this->_cache[] = $extras;\n }\n else\n {\n $this->_cache = $extras;\n }\n\n foreach ( $this->_observers as $ob )\n {\n $ob->onUpdate( $this, $this->_cache );\n }\n\n $this->_cache = [];\n\n return $this;\n\n }", "public function execute(EventObserver $observer)\n {\n $product = $observer->getEvent()->getProduct();\n if ($product instanceof \\Magento\\Catalog\\Model\\Product) {\n $this->stockHelper->assignStatusToProduct($product);\n }\n }", "protected function notify($event, WorkflowEntityInterface $entity)\n {\n foreach ($this->observers as $observer) {\n $observer->$event($entity);\n }\n }", "protected function notifyObservers($event_type_key, $date_occurred, $event_amount, $track_key, $space_key)\n\t{\n\t\tforeach ($this->observers as $d)\n\t\t{\n\t\t\t$d->invoke($this, $event_type_key, $date_occurred, $event_amount, $track_key, $space_key);\n\t\t}\n\t}", "public function checkOrdersStatusForUpdateCheckout($observer)\n {\n Mage::log('update status');\n $order = $observer->getOrder();\n $configStatusTrigger = Mage::getStoreConfig('carriers/' . Vaimo_UrbIt_Model_System_Config_Source_Environment::CARRIER_CODE . '/order_status_trigger');\n $checkoutId = $order->getUrbitCheckoutId();\n $isTriggered = $order->getUrbitTriggered();\n\n if ($checkoutId && $isTriggered == 'false') {\n $orderStatus = $order->getState();\n\n if ($orderStatus == $configStatusTrigger) {\n $this->sendUpdateCheckout($order->getId());\n $order->setData('urbit_triggered', 'true');\n $order->save();\n }\n }\n\n }", "public function update($subject) {\n prinft(\"State Change, new subject: %s\", $subject);\n }", "public function changeStatus()\n {\n }", "public function registerObserver($observer)\n {\n $this->observers[] = $observer;\n }", "protected function emitPackageStatesUpdated(): void\n {\n if ($this->bootstrap === null) {\n return;\n }\n\n if ($this->dispatcher === null) {\n $this->dispatcher = $this->bootstrap->getEarlyInstance(Dispatcher::class);\n }\n\n $this->dispatcher->dispatch(self::class, 'packageStatesUpdated');\n }", "protected final function _markModified()\n {\n DomainWatcher::addModifiedObject($this);\n }", "public function updateObserver (Observable $subject) {\n /* @var $subject Repository\\AbstractRepository */\n $measureId = $subject->getMeasureId();\n $executor = $this->_commander->getExecutor(__CLASS__)->clean(); /* @var $executor Executor */\n\n $executor->add('getMeasure', $this->_measureService)\n ->getResult()\n ->setMeasureId($measureId)\n ->setType(Type::MYSQL);\n\n $measure = $executor->execute()->getData(); /* @var $measure Entity\\Measure */\n $testId = $measure->getTestId();\n\n $executor->clean()\n ->add('updateTestState', $this->_testService)\n ->getResult()\n ->setTestId($testId);\n $executor->execute();\n\n return true;\n }", "public function subscribes();", "protected static function on_change_order_state($order)\n {\n \n }", "public function subscription();", "protected function notifyAll()\n\t{\n\t\t$this->notifyBorrowers();\n\t\t$this->notifyLenders();\n\t}", "function notify($event)\n {\n return;\n }", "function attach( &$observer)\r\n\t{\r\n\t\tif (is_object($observer))\r\n\t\t{\r\n\t\t\t$class = get_class($observer);\r\n\t\t\tforeach ($this->_observers as $check) {\r\n\t\t\t\tif (is_a($check, $class)) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$this->_observers[] =& $observer;\r\n\t\t} else {\r\n\t\t\t$this->_observers[] =& $observer;\r\n\t\t}\r\n\t}", "public function notify($event, $object = null) {\r\n\t\tif ($event == self::EVENT_BEFORECREATE) {\r\n\t\t\tself::$_newest[get_called_class()] = $object;\r\n\t\t} else if ($event == self::EVENT_BEFORESAVE) {\r\n\t\t\tself::$_lastModified[get_called_class()] = $object;\r\n\t\t}\r\n\t\tif (isset($this->_eventObservers[$event])) {\r\n\t\t\tif (is_null($object)) $object = $this;\r\n\t\t\tforeach ($this->_eventObservers[$event] as $observer) {\r\n\t\t\t\t$observer->update($object);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function notify($instance)\n {\n app(Dispatcher::class)->send($this, $instance);\n }", "public function updateState($state);", "public static function updated($callback)\n {\n self::listenEvent('updated', $callback);\n }", "function addObserver(Observer $observer_in) {\n $this->observers[] = $observer_in;\n }", "function setNotify($notify) {\r\r\n\t\t$this->notify = $notify;\r\r\n\t}", "public function onEnterState() {\n\n }", "function testSecondEventObserver($data) {\n return $data;\n}", "function _note_is_connected()\n {\n eval(PUBSUB_MUTATE);\n if (!$this->_connected)\n {\n $this->_connected = 1;\n kn_apply($this->_handlers['onConnect'],\n array_merge(array($this),\n $this->_handlers['args']));\n }\n }", "public function notifyDisconnected(StreamObserver $observer): void;" ]
[ "0.7414289", "0.73216397", "0.72376585", "0.71443546", "0.7127745", "0.7114149", "0.70887387", "0.7047205", "0.70084375", "0.6888783", "0.6845307", "0.6838668", "0.6817705", "0.6765522", "0.6661663", "0.6636497", "0.6635054", "0.6596162", "0.6543789", "0.64141446", "0.63476324", "0.63476324", "0.63476324", "0.62887526", "0.62714446", "0.6231431", "0.60299754", "0.6007447", "0.6006013", "0.5948533", "0.59407204", "0.59407204", "0.59294033", "0.5869032", "0.5868156", "0.5865434", "0.5861464", "0.585364", "0.57916236", "0.57916236", "0.57916236", "0.57914966", "0.5791076", "0.5791076", "0.5791076", "0.5760538", "0.5721348", "0.5699068", "0.565127", "0.5623849", "0.5620507", "0.55948734", "0.5580072", "0.557317", "0.55680525", "0.5518316", "0.5495497", "0.5495497", "0.54863644", "0.5480977", "0.54577607", "0.5420563", "0.5406034", "0.5383625", "0.5383625", "0.53635585", "0.5345197", "0.5343309", "0.53254366", "0.52794355", "0.52746207", "0.52590215", "0.52590215", "0.52590215", "0.5218484", "0.51933396", "0.51932067", "0.5176856", "0.51607203", "0.5154462", "0.5148512", "0.51447845", "0.51321965", "0.51301587", "0.5129497", "0.51205134", "0.5114146", "0.5095427", "0.50947523", "0.50922495", "0.508906", "0.5083904", "0.5059846", "0.5056161", "0.50392294", "0.502245", "0.5020029", "0.50181913", "0.50091946", "0.50085163", "0.50047153" ]
0.0
-1
Add version to $region_default_args properties
public function __construct () { $this->region_default_args['properties'][] = array( 'name' => 'version', 'value' => Upfront_Layout::$version ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function default(&$args) {\n\n\t\t// Check args\n\t\tif (empty($args) || !is_array($args))\n\t\t\t$args = [];\n\n\t\t// Set agency slug\n\t\t$args['agency'] = $this->agency;\n\n\t\t// Check language\n\t\tif (!isset($args['language']) && isset($this->language))\n\t\t\t$args['language'] = $this->language;\n\t}", "public function addDefaultEntriesAndValues() {}", "public function setDefaultArgs($args);", "private function setDefaultArgs()\n {\n $args = [\n 'title' => get_bloginfo('name'),\n 'url' => get_bloginfo('url'),\n 'desc' => get_bloginfo('description'),\n ];\n\n if (is_page() || is_singular()) {\n $args = [\n 'title' => get_the_title(),\n 'url' => get_permalink(),\n 'desc' => $this->getPostExcerpt(),\n ];\n }\n\n $this->setArgs(apply_filters('cgit_socialize_default_args', $args));\n }", "protected function _create_defaults( $args ) {\n\t\t\t$defaults = array(\n\t\t\t\t'help_tabs' => array(),\n\t\t\t\t'help_sidebar' => '',\n\t\t\t);\n\t\t\t$args = wp_parse_args( $args, $defaults );\n\t\t\t$this->args = json_decode( json_encode( $args ) );\n\t\t}", "function caldol_hook_widget_tag_cloud_args($args = array()){\n\n\n$newArgs = array(\n'smallest' => 8,\n'largest' => 15,\n'number' => 20,\n\n);\nreturn array_merge($args, $newArgs);\n}", "function apply_default_args($args) {\r\n\t\t$defaults = array(\r\n\t\t\t'width'=>'',\r\n\t\t\t'height'=>'',\r\n\t\t\t'placeholder'=>'',\r\n\t\t\t'description'=>''\r\n\t\t);\r\n\t\t$args = wp_parse_args( $args, $defaults );\r\n\t\treturn $args;\t\r\n\t}", "public function get_default_args(){ return $this->default_args; }", "public function getDefaultVariantId();", "private function default_args() {\n\t\n\t\t$defaults = array(\n\t\t\t'container' \t=> 'nav',\n\t\t\t'separator' \t=> '&raquo;',\n\t\t\t'before' \t\t=> 'Viewing:',\n\t\t\t'home' \t\t\t=> 'Home',\n\t\t);\n\t\treturn $defaults;\n\t}", "private function setArgs(){\n\t\t$this->args = array(\n\t\t\t'label' => $this->label,\n\t\t\t'labels' => $this->labels,\n\t\t\t'description' => $this->description,\n\t\t\t'public' => $this->public,\n\t\t\t'exclude_from_search' => $this->excludeSearch,\n\t\t\t'publicly_queryable' => $this->publiclyQueryable,\n\t\t\t'show_ui' => $this->show_ui ,\n\t\t\t'show_in_nav_menus' => $this->showInNavMenus,\n\t\t\t'show_in_menu' => $this->showInMenu,\n\t\t\t'show_in_admin_bar' => $this->showInAdminBar,\n\t\t\t'menu_position' => $this->menuPosition,\n\t\t\t'menu_icon' => $this->menuIcon,\n\t\t\t'capability_type' => $this->capabilityType,\n\t\t\t'map_meta_cap' => $this->mapMetaCap,\n\t\t\t'hierarchical' => $this->hierarchical,\n\t\t\t'supports' => $this->supports,\n\t\t\t'register_meta_box_cb' => $this->registerMetaBoxCb,\n\t\t\t'taxonomies' => $this->taxonomies,\n\t\t\t'has_archive' => $this->hasArchive,\n\t\t\t'permalink_epmask' => $this->permalinkEpmask,\n\t\t\t'rewrite' => $this->rewrite,\n\t\t\t'query_var' => $this->queryVar,\n\t\t\t'can_export' => $this->canExport,\n\t\t\t'_builtin' => $this->builtin\n\t\t);\n\t}", "function options($default) {\r\n $default = array_merge(\r\n $default,\r\n array(\r\n \"maximum_result_set\" => \"3\",\r\n \"default_title\" => __(\"Find nearby locations\", 'slp-experience'),\r\n 'radius_label' => __('Within', 'slp-experience'),\r\n \"search_label\" => __(\"Zip Code\", 'slp-experience'),\r\n \"button_label\" => __(\"Go!\", 'slp-experience'),\r\n )\r\n );\r\n\r\n return $default;\r\n }", "function my_wp_default_styles($styles)\n{\n\tglobal $stylesVersion;\n\t//use release date for version\n\t\n\t$styles->default_version = $stylesVersion;\n}", "public function set_defaults($args, $overwrite=false) {\n\t\t\n\t\t$args = (array) $args;\n\t\t$overwrite = (bool) $overwrite;\n\t\t\n\t\tif ($overwrite) {\n foreach ($this->defaults as $k =>$v) {\n if (isset($args[$k])) {\n $this->defaults[$k] = $v;\n }\n else {\n $this->defaults[$k] = null;\n }\n }\n\t\t}\n\t\t// Line item override\n\t\telse {\n\t\t\tforeach ($args as $k => $v) {\n\t\t\t\t$this->defaults[$k] = $v;\n\t\t\t\t$this->$k = $v; // set the args\n\t\t\t}\n\t\t}\t\t\n\t}", "protected function vedConstructArg(array $args = array()) {\n }", "public function singleBundleCreationWithOverrides() {\n $entityTypeInfo = $this->createEntityType();\n\n $title_overrides = [];\n foreach ($this->getConfigurableBaseFields() as $field) {\n $title_overrides[$field] = $this->randomMachineName(16);\n }\n\n $this->createEntityBundle($entityTypeInfo['id'], '', $title_overrides);\n }", "function initializeObjectAttribute( $contentObjectAttribute, $currentVersion, $originalContentObjectAttribute )\n {\n if ( $currentVersion != false )\n {\n $dataText = $originalContentObjectAttribute->content();\n $contentObjectAttribute->setContent( $dataText );\n }\n else\n {\n $default = array( 'value' => array() );\n $contentObjectAttribute->setContent( $default );\n }\n }", "public function getDefaultRegion() : ?string;", "public function getDefaultVersionJsn()\n {\n return [\n 'name' => APP_NAME,\n 'tag' => '0.0.0',\n 'desc' => APP_DESC,\n 'codename' => '',\n ];\n }", "public static function getDefaultAgentVersion()\n {\n return 'google.com/gcp-php/' . self::VERSION;\n }", "public function __construct( $name, $version) {\n\n $this->settings_prefix = $name;\n\n\n $version_option = $this->settings_prefix . '_version';\n\n if( get_option($version_option) !== $version) {\n //Version\n $current_version = get_option( $version_option, null );\n $major_version = substr( $version, 0, strrpos( $version, '.' ) );\n\n delete_option( $version_option );\n add_option( $version_option, $version );\n\n do_action( $version_option . '_update', $version, $current_version );\n }\n\n self::$_instance[$name]['version'] = $version;\n }", "private static function add_version_info( $params = array() ) {\n\t\t\t// if any parameter is passed in the pixel, do not overwrite it\n\t\t\treturn array_replace( self::get_version_info(), $params );\n\t\t}", "public function version( $args = array(), $assoc_args = array() ) {\n\t\tself::run( 'core version', $args, $assoc_args );\n\t}", "function initDefaultOptions(){\n\n\t\t\t$defaults = $this->defaultOptions();\n\t\t\treturn update_option( $this->optionsKey, $defaults );\n\t\t}", "private static function get_default_args() {\n $careerjet_api_key = get_option('jobsearch_integration_careerjet_affid');\n \n return array(\n 'affid' => $careerjet_api_key,\n 'keywords' => '',\n 'location' => '',\n 'page' => 1,\n );\n }", "public function singleBundleEditWithOverrides() {\n $entityTypeInfo = $this->createEntityType();\n\n $title_overrides = [];\n foreach ($this->getConfigurableBaseFields() as $field) {\n $title_overrides[$field] = $this->randomMachineName(16);\n }\n\n $bundle_info = $this->createEntityBundle($entityTypeInfo['id'], '', $title_overrides);\n\n $new_title_overrides = [];\n foreach ($this->getConfigurableBaseFields() as $field) {\n $new_title_overrides[$field] = $this->randomMachineName(16);\n }\n\n $this->editEntityBundle($entityTypeInfo['id'], $bundle_info['type'], $this->randomMachineName(16), $new_title_overrides);\n }", "private function getDefaultColumnArgs(){\n\n\t\t$args = array(\n\n\t\t\t\t'hasLightbox'\t=> true,\n\t\t\t\t'buttonText'\t=> __( 'Save Column', 'cuisinesections' )\n\t\t);\n\n\t\t$args = apply_filters( 'chef_sections_default_column_args', $args );\n\n\t\treturn $args;\n\n\t}", "function _wp_register_meta_args_allowed_list($args, $default_args)\n {\n }", "function _wp_register_meta_args_whitelist($args, $default_args)\n {\n }", "function upgradeDefaultOptions_2_2 ()\n\t{\n\t\t// Keep hardcoded name, in case we change the name at a later stage\n\t\t$oldvalues = get_option( 'avhamazon' );\n\t\t$newvalues = array ('general' => array (), 'widget_wishlist' => array () );\n\n\t\tforeach ( $oldvalues as $name => $value ) {\n\t\t\tif ( array_key_exists( $name, $this->default_options['general'] ) ) {\n\t\t\t\t$newvalues['general'][$name] = $value;\n\t\t\t}\n\t\t\tif ( array_key_exists( $name, $this->default_options['widget_wishlist'] ) ) {\n\t\t\t\t$newvalues['widget_wishlist'][$name] = $value;\n\t\t\t}\n\t\t}\n\t\tdelete_option( 'avhamazon' );\n\t\tadd_option( $this->db_options_name_core, $newvalues );\n\t}", "private function _setArgsRegister( $args )\n\t{\t\t\n\t\t$this->argsRegister\t= $args;\t\t\n\t}", "function default_image_options() {\n update_option('image_default_align', 'center' );\n update_option('image_default_size', 'medium' );\n}", "public function GetVersionInfo(&$args) {\n $composer = json_decode(file_get_contents(__DIR__ . '/../composer.json'));\n $args['commit'] = file_get_contents(__DIR__ . '/../version.txt');\n $args['version'] = 'git';\n $args['copy'] = '&copy; <a href=\"'.\n $composer->homepage.\n '\" target=\"_blank\">'.\n $composer->authors[0]->name.\n \"</a> \".\n date('Y').\n \". All rights reserved.\";\n }", "function scribbles_custom_logo_args( $args ) {\n\n\t$args['width'] = 325;\n\t$args['height'] = 80;\n\n\treturn $args;\n\n}", "function change_arguments( $args ) {\n //$args['dev_mode'] = true;\n\n return $args;\n }", "function options_init() {\n return array(\n 'layer_type' => 'openlayers_layer_type_openlayers_taxonomy_vector',\n 'layer_handler' => 'openlayers_taxonomy_vector',\n 'vector' => TRUE,\n );\n }", "function setAppVersion($major,$minor,$build,$codename=\"\",$nc_salt=false)\n{\n\t$major = intval($major);\n\t$minor = intval($minor);\n\t$build = intval($build);\n\t$GLOBALS['APP_VERSION'] = compact('major','minor','build','codename');\n\t$GLOBALS['APP_VERSION']['string'] = \"$major.$minor.$build\";\n\tif( $codename )\n\t\t$GLOBALS['APP_VERSION']['string'] .= \" ($codename)\";\n\t$GLOBALS['APP_VERSION']['nc'] = 'nc'.substr(preg_replace('/[^0-9]/', '', md5($GLOBALS['APP_VERSION']['string'].$nc_salt)), 0, 8);\n}", "function change_arguments( $args ) {\n //$args['dev_mode'] = true;\n\n return $args;\n }", "function add_specific_menu_location_atts( $atts, $item, $args ) {\n if( $args->theme_location == 'header' ) {\n // add the desired attributes:\n $atts['class'] = 'navbar-item';\n }\n return $atts;\n}", "protected function loadDefaultOptions()\r\n {\r\n $this->options = [\r\n 'offsettop' => 0,\r\n 'offsetleft' => 0,\r\n 'merge' => false,\r\n 'backcolor' => 0xffffff,\r\n ];\r\n }", "public function setRegion($region)\n {\n \t$this->aws_as_region = $region;\n }", "public function sdk_version(){\n WP_CLI::line( $this->aws_sdk_version );\n }", "function option_definition() {\n $options = parent::option_definition();\n $options['year_range'] = array('default' => '-3:+3');\n $options['granularity'] = array('default' => 'month');\n $options['default_argument_type']['default'] = 'date';\n $options['add_delta'] = array('default' => '');\n $options['use_fromto'] = array('default' => '');\n $options['title_format'] = array('default' => '');\n $options['title_format_custom'] = array('default' => '');\n return $options;\n }", "public function hookConfig($args)\n {\n $post = $args['post'];\n set_option('viewer3d_options', $post['options']);\n \n }", "protected function setDefaultValueExtra()\n {\n $this->default_data['address'] = 'xxx.atlassian.net';\n $this->default_data['rest_api_resource'] = '/rest/api/latest/';\n $this->default_data['timeout'] = 60;\n\n $this->default_data['clones']['mappingTicket'] = array(\n array(\n 'Arg' => self::ARG_SUMMARY,\n 'Value' => 'Issue {include file=\"file:$centreon_open_tickets_path/providers/' .\n 'Abstract/templates/display_title.ihtml\"}'\n ),\n array('Arg' => self::ARG_DESCRIPTION, 'Value' => '{$body}'),\n array('Arg' => self::ARG_PROJECT, 'Value' => '{$select.jira_project.id}'),\n array('Arg' => self::ARG_ASSIGNEE, 'Value' => '{$select.jira_assignee.id}'),\n array('Arg' => self::ARG_PRIORITY, 'Value' => '{$select.jira_priority.id}'),\n array('Arg' => self::ARG_ISSUETYPE, 'Value' => '{$select.jira_issuetype.id}'),\n );\n }", "function initializeObjectAttribute( $contentObjectAttribute, $currentVersion, $originalContentObjectAttribute )\n {\n if ( $currentVersion != false )\n {\n $dataText = $originalContentObjectAttribute->attribute( \"data_text\" );\n if( $dataText != '' )\n {\n // update the path top newest image version\n $contentObject = eZContentObject::fetch( $originalContentObjectAttribute->attribute( 'contentobject_id' ) );\n if( $contentObject instanceof eZContentObject && $dataText != NULL && $dataText != '' )\n {\n $data = $this->updateImagePath( $dataText, $contentObject, $originalContentObjectAttribute );\n $dataText = $data['data_text'];\n }\n $dataInt = $originalContentObjectAttribute->attribute( \"data_int\" );\n $contentObjectAttribute->setAttribute( \"data_text\", $dataText );\n $contentObjectAttribute->setAttribute( \"data_int\", $dataInt );\n }\n }\n }", "public function init( $vargs )\n {\n // Noop\n }", "public function moveAllOtherUserdefinedPropertiesToAdditionalArguments() {}", "public function __construct()\n {\n if (2 == func_num_args()) {\n $this->apiVersion = func_get_arg(0);\n $this->kind = func_get_arg(1);\n }\n }", "function onInit() {\n\t\t// this needs to be set in the init section\n\t\t$this->setVersion('0.5.0');\n\t\t$this->setPublicMethod('getVersion');\n\t}", "protected function get_default_args() {\n\t\t$existing = parent::get_default_args();\n\n\t\t$new = array(\n\t\t\t'id' => '',\n\t\t\t'id__in' => array(),\n\t\t\t'id__not_in' => array(),\n\t\t\t'transaction' => '',\n\t\t\t'transaction__in' => array(),\n\t\t\t'transaction__not_in' => array(),\n\t\t\t'customer' => '',\n\t\t\t'customer__in' => array(),\n\t\t\t'customer__not_in' => array(),\n\t\t\t'membership' => '',\n\t\t\t'membership__in' => array(),\n\t\t\t'membership__not_in' => array(),\n\t\t\t'seats' => '',\n\t\t\t'seats_gt' => '',\n\t\t\t'seats_lt' => '',\n\t\t\t'active' => ''\n\t\t);\n\n\t\treturn wp_parse_args( $new, $existing );\n\t}", "protected function assignVersion()\n {\n\n }", "public function defaults() {\n\t\t$cmdArgs = [];\n\t\t$cmdArgs[] = escapeshellarg($this->name);\n\t\t$cmdArgs[] = \"defaults\";\n\t\t$cmd = new \\OMV\\System\\Process(\"update-rc.d\", $cmdArgs);\n\t\t$cmd->setRedirect2to1();\n\t\t$cmd->execute();\n\t}", "private function extendParamsWithGazetteer($params) {\r\n if(!isset($params['searchTerms']) && !isset($params['geo:lon']) && !isset($params['geo:geometry']) && !isset($params['geo:box'])) {\r\n if (isset($this->context->modules['GazetteerPro'])) {\r\n $gazetteer = RestoUtil::instantiate($this->context->modules['GazetteerPro']['className'], array($this->context, $this->user));\r\n }\r\n else if (isset($this->context->modules['Gazetteer'])) {\r\n $gazetteer = RestoUtil::instantiate($this->context->modules['Gazetteer']['className'], array($this->context, $this->user));\r\n }\r\n if ($gazetteer) {\r\n $location = $gazetteer->search(array(\r\n 'q' => $params['geo:name'],\r\n 'wkt' => true\r\n ));\r\n if (count($location['results']) > 0) {\r\n if (isset($location['results'][0]['hash'])) {\r\n $params['searchTerms'] = 'geohash:' . $location['results'][0]['hash'];\r\n }\r\n else if (isset($location['results'][0]['geo:geometry'])) {\r\n $params['geo:geometry'] = $location['results'][0]['geo:geometry'];\r\n }\r\n else if (isset($location['results'][0]['geo:lon'])) {\r\n $params['geo:lon'] = $location['results'][0]['geo:lon'];\r\n $params['geo:lat'] = $location['results'][0]['geo:lat'];\r\n }\r\n }\r\n }\r\n }\r\n return $params;\r\n }", "public function initializeVersionPress()\n {\n $this->runWpCliCommand('plugin', 'activate', ['versionpress']);\n $this->runWpCliCommand('vp', 'activate', ['yes' => null]);\n }", "function ibm_apim_theme_process_region(&$vars) {\r\n // Add the click handle inside region menu bar\r\n if ($vars['region'] === 'menu_bar') {\r\n $vars['inner_prefix'] = '<h2 class=\"menu-toggle\"><a href=\"#\">' . t('Menu') . '</a></h2>';\r\n }\r\n}", "public function __construct($args)\n\t{\n\t\tparent::__construct($args);\n\n\t\tUtils::log('{g}Next Version! {w}I promise! {y} ;)');\n\t}", "function appendFormidableSelectImageQueryArgsCredentials( $queryArgs ) {\n\t$queryArgs['order_key'] = get_option( FormidableSelectImageManager::getShort() . 'licence_key', '' );\n\n\treturn $queryArgs;\n}", "function setNombre_region($snombre_region = '')\n {\n $this->snombre_region = $snombre_region;\n }", "public static function getShortcodeDefaults()\n\t{\n\t\treturn array_merge( static::$JETPACK_SHORTCODE_EXTRAS, static::$SHORTCODE_DEFAULTS );\n\t}", "function setDefaultOverrideOptions() {\n\tglobal $fm_module_options;\n\t\n\t$config = null;\n\t$server_os_distro = isDebianSystem($_POST['server_os_distro']) ? 'debian' : strtolower($_POST['server_os_distro']);\n\t\n\tswitch ($server_os_distro) {\n\t\tcase 'debian':\n\t\t\t$config = array(\n\t\t\t\t\t\t\tarray('cfg_type' => 'global', 'server_serial_no' => $_POST['SERIALNO'], 'cfg_name' => 'pid-file', 'cfg_data' => '/var/run/named/named.pid')\n\t\t\t\t\t\t);\n\t}\n\t\n\tif (is_array($config)) {\n\t\tif (!isset($fm_module_options)) include(ABSPATH . 'fm-modules/' . $_SESSION['module'] . '/classes/class_options.php');\n\t\t\n\t\tforeach ($config as $config_data) {\n\t\t\t$fm_module_options->add($config_data);\n\t\t}\n\t}\n}", "public function initializeArguments() {}", "public function initializeArguments() {}", "public function initializeArguments() {}", "public function initializeArguments() {}", "function hello_pro_onboarding_set_genesis_defaults( $content, $imported_post_ids ) {\n\n\tif ( ! function_exists( 'genesis_update_settings' ) ) {\n\t\treturn;\n\t}\n\n\t$settings = array(\n\t\t'content_archive' => 'excerpts', // Show excerpts, not full entries.\n\t\t'content_archive_thumbnail' => 1, // Show the blog post Featured Images.\n\t\t'image_size' => 'blogroll', // Use the 'blogroll' size Featured Image on blog archives.\n\t\t'image_alignment' => 'none', // Set default alignment for Featured Images on blog archives.\n\t);\n\n\tgenesis_update_settings( $settings );\n\n}", "public function set_default_field_args( $field_args, $tab_key, $section_key ) {\n\n $type = isset($field_args['type']) ? $field_args['type'] : 'text';\n $conditions = isset($field_args['conditions']) ? $field_args['conditions'] : false;\n\n $disable = isset($field_args['disable']) ? boolval($field_args['disable']) : false;\n\n if ( isset($field_args['global']) && $field_args['global'] === true) {\n $disable = $this->is_disabled( $field_args['name'] ) ? true : $disable;\n $name_id = $this->get_option_prefix( $field_args['name'] );\n }\n else if ( isset($field_args['parent']) ) {\n $disable = $this->is_disabled( $field_args['name'], false, $section_key ) ? true : $disable;\n $name_id = $field_args['parent']['name_id'] . '[' . $field_args['name'] . ']';\n }\n else {\n $disable = $this->is_disabled( $field_args['name'], false, $section_key ) ? true : $disable;\n $name_id = $this->get_option_prefix($section_key . '[' . $field_args['name'] . ']');\n }\n\n $args = array(\n 'id' => $field_args['name'],\n 'name_id' => $name_id,\n 'label_for' => $args['label_for'] = \"{$section_key}[{$field_args['name']}]\",\n 'desc' => isset($field_args['desc']) ? $field_args['desc'] : '',\n 'placeholder' => isset($field_args['placeholder']) ? $field_args['placeholder'] : '',\n 'global' => isset($field_args['global']) ? boolval($field_args['global']) : false,\n 'label' => isset($field_args['label']) ? $field_args['label'] : '',\n 'title' => isset($field_args['title']) ? $field_args['title'] : '',\n 'tab' => $tab_key,\n 'section' => $section_key,\n 'parent' => isset($field_args['parent']) ? $field_args['parent'] : false,\n 'size' => isset($field_args['size']) ? $field_args['size'] : null,\n 'options' => isset($field_args['options']) ? $field_args['options'] : '',\n 'std' => isset($field_args['default']) ? $field_args['default'] : '',\n 'disable' => $disable,\n 'sanitize_callback' => isset($field_args['sanitize_callback']) ? $field_args['sanitize_callback'] : '',\n 'type' => $type,\n 'sub_fields' => ( $type === 'sub_fields' && isset($field_args['sub_fields']) ) ? $field_args['sub_fields'] : false,\n 'display' => (isset($field_args['display'])) ? $field_args['display'] : '',\n 'conditions' => $conditions\n );\n\n return $args;\n }", "public function setRequestedVersion($version)\n {\n $this->_options['requested_version'] = $version;\n }", "function _setDefaults() {}", "function genesis_sample_primary_menu_args( $args ) {\n\n\tif ( 'primary' != $args['theme_location'] ) {\n\t\treturn $args;\n\t}\n\n\t$args['depth'] = 2;\n\n\treturn $args;\n\n}", "protected function _getDefaultOptions()\n {\n }", "function sitemgr_upgrade1_4_002()\n{\n\treturn $GLOBALS['setup_info']['sitemgr']['currentver'] = '1.5.001';\n}", "function get_arguments_views_plugins() {\n return array(\n 'argument default' => array(\n 'param' => array(\n 'title' => t('GET parameter from URL'),\n 'handler' => 'get_arguments_plugin_argument_default_param',\n ),\n ),\n );\n}", "public function __construct($region = false) {\n global $CFG;\n //once we are set up we enable this\n if (!$region) {\n $this->region = $CFG->filter_poodll_aws_region;\n } else {\n $this->region = self::parse_region($region);\n }\n }", "function plugin_version_itilcategorygroups() {\n return array('name' => __('ItilCategory Groups', 'itilcategorygroups'),\n 'version' => '0.90+1.0.3',\n 'author' => \"<a href='http://www.teclib.com'>TECLIB'</a>\",\n 'homepage' => 'http://www.teclib.com');\n}", "public function Init() {\n\t\t\n\t\t$version = array();\n\t}", "function nndnewgravatar ($avatar_defaults) {\r\n$nnddefaultgravatar = plugins_url('/images/nnddefgrav.png', __FILE__);\r\n$currentoptions = get_option('nndcustgrav_options');\r\n$nndcustomgravatar = $currentoptions['grav_url'];\r\n$avatar_defaults[$nndcustomgravatar] = \"NND Custom Gravatar\";\r\n$avatar_defaults[$nnddefaultgravatarNND] = \"NND Default Gravatar\";\r\nreturn $avatar_defaults;}", "function locations_init(&$options, $memberInfo, &$args){\n\n\t\treturn TRUE;\n\t}", "public function init()\n\t\t{\n\t\t\t$sitename = strtolower($_SERVER[ 'SERVER_NAME' ]);\n\t\t\tif (substr($sitename, 0, 4) == 'www.'):\n\t\t\t\t$sitename = substr($sitename, 4);\n\t\t\tendif;\n\n\t\t\t$region = (defined('MAILGUN_REGION') && MAILGUN_REGION) ? MAILGUN_REGION : $this->get_option('region');\n\t\t\t$regionDefault = $region ?: 'us';\n\n\t\t\t$this->defaults = array(\n\t\t\t\t'region' => $regionDefault,\n\t\t\t\t'useAPI' => '1',\n\t\t\t\t'apiKey' => '',\n\t\t\t\t'domain' => '',\n\t\t\t\t'username' => '',\n\t\t\t\t'password' => '',\n\t\t\t\t'secure' => '1',\n\t\t\t\t'sectype' => 'tls',\n\t\t\t\t'track-clicks' => '',\n\t\t\t\t'track-opens' => '',\n\t\t\t\t'campaign-id' => '',\n\t\t\t\t'override-from' => '0',\n\t\t\t\t'tag' => $sitename,\n\t\t\t);\n\t\t\tif (!$this->options):\n\t\t\t\t$this->options = $this->defaults;\n\t\t\t\tadd_option('mailgun', $this->options);\n\t\t\tendif;\n\t\t}", "function inspiry_gallery_defaults( WP_Customize_Manager $wp_customize ) {\n\t\t$gallery_settings_ids = array(\n\t\t\t'inspiry_gallery_header_variation',\n\t\t\t'theme_gallery_banner_title',\n\t\t\t'theme_gallery_banner_sub_title',\n\t\t);\n\t\tinspiry_initialize_defaults( $wp_customize, $gallery_settings_ids );\n\t}", "function inspiry_gallery_defaults( WP_Customize_Manager $wp_customize ) {\n\t\t$gallery_settings_ids = array(\n\t\t\t'inspiry_gallery_header_variation',\n\t\t\t'theme_gallery_banner_title',\n\t\t\t'theme_gallery_banner_sub_title',\n\t\t);\n\t\tinspiry_initialize_defaults( $wp_customize, $gallery_settings_ids );\n\t}", "public function generatorVersionProvider()\n {\n return [[\"a string\"]];\n }", "public function setDefaultArgs($args)\n {\n $this->defaultArgs = (array)$args;\n return $this;\n }", "function add_site_inner_attribute( $attributes ) {\n\n\t$attributes = wp_parse_args( $attributes, genesis_attributes_entry( array() ) );\n\treturn $attributes;\n\n}", "function build_default_core_options() {\n\n $core_options = array(\n 'key' => '',\n 'title' => '',\n 'menu_order' => 0,\n 'position' => 'normal',\n 'style' => 'default',\n 'label_placement' => 'top',\n 'instruction_placement' => 'label',\n 'hide_on_screen' => array()\n );\n\n return $core_options;\n }", "public function version(){\n WP_CLI::line( $this->version );\n }", "function wp_install_defaults($user_id)\n {\n }", "function VM_setVBoxAddonAsDefault($version)\n{\n\t//Delete old default addons\n\t@unlink(VBOX_addonStoreDir.\"VBoxLinuxAdditions-amd64.run\");\n\t@unlink(VBOX_addonStoreDir.\"VBoxLinuxAdditions-x86.run\");\n\t\n\tsymlink(VBOX_addonStoreDir.\"VBoxLinuxAdditions-amd64-$version.run\",VBOX_addonStoreDir.\"VBoxLinuxAdditions-amd64.run\");\n\tsymlink(VBOX_addonStoreDir.\"VBoxLinuxAdditions-x86-$version.run\",VBOX_addonStoreDir.\"VBoxLinuxAdditions-x86.run\");\n}", "function _option_merge_callback($option_name, $current_value, $new_value) {\t\t\t\t\r\r\n\t\t// This is to make sure that active_modules['payment'] doesn't contain the default options incase user deletes disables any one of them.\r\r\n\t\t// issue#: 526\r\r\n\t\tswitch($option_name){\r\r\n\t\t\t// active modules\r\r\n\t\t\tcase 'active_modules':\r\r\n\t\t\t\t// to copy options array as it is:\r\r\n\t\t\t\tif( isset($new_value['payment']) ) {\r\r\n\t\t\t\t\t$current_value['payment'] = array(); \r\r\n\t\t\t\t}\t\r\r\n\t\t\tbreak;\r\r\n\t\t\tcase 'setting':\r\r\n\t\t\t\t// check array keys\r\r\n\t\t\t\tif( isset($new_value['rest_output_formats']) && isset($new_value['rest_input_methods'])) {\r\r\n\t\t\t\t\t// reset\r\r\n\t\t\t\t\t$current_value['rest_output_formats'] = $current_value['rest_input_methods'] = array(); \r\r\n\t\t\t\t}\r\r\n\t\t\t\t// purchase options links\r\r\n\t\t\t\tif( isset($new_value['guest_content_purchase_options_links']) ) {\r\r\n\t\t\t\t\t// reset\r\r\n\t\t\t\t\t$current_value['guest_content_purchase_options_links'] = array(); \r\r\n\t\t\t\t}\t\t\t\r\r\n\t\t\tbreak;\t\t\t\r\r\n\t\t}\r\r\n\t\t// update class var\r\r\n\t\t$this->{$option_name} = mgm_array_merge_recursive_unique($current_value,$new_value);\t\t\r\r\n\t}", "protected function whenNewVersionWasRequested()\n {\n }", "function tb_default_options() {\n $defaults = array (\n 'banner_id' => '',\n 'banner_link' => '',\n 'city' => ''\n );\n return apply_filters( \"tb_default_options\", $defaults );\n}", "public function __invoke() {\n\t\t\\WP_CLI::success( 'Version E.' );\n\t}", "public function piSetPiVarDefaultsStdWrapProvider() {}", "public function version( $args = array(), $assoc_args = array() ) {\n\t\tglobal $wp_version, $wp_db_version, $tinymce_version, $manifest_version;\n\n\t\t$color = '%G';\n\t\t$version_text = $wp_version;\n\t\t$version_types = array(\n\t\t\t'-RC' => array( 'release candidate', '%y' ),\n\t\t\t'-beta' => array( 'beta', '%B' ),\n\t\t\t'-' => array( 'in development', '%R' ),\n\t\t);\n\t\tforeach( $version_types as $needle => $type ) {\n\t\t\tif ( stristr( $wp_version, $needle ) ) {\n\t\t\t\tlist( $version_text, $color ) = $type;\n\t\t\t\t$version_text = \"$color$wp_version%n (stability: $version_text)\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif ( isset( $assoc_args['extra'] ) ) {\n\t\t\tWP_CLI::line( \"WordPress version:\\t$version_text\" );\n\n\t\t\tWP_CLI::line( \"Database revision:\\t$wp_db_version\" );\n\n\t\t\tpreg_match( '/(\\d)(\\d+)-/', $tinymce_version, $match );\n\t\t\t$human_readable_tiny_mce = $match? $match[1] . '.' . $match[2] : '';\n\t\t\tWP_CLI::line( \"TinyMCE version:\\t\" . ( $human_readable_tiny_mce? \"$human_readable_tiny_mce ($tinymce_version)\" : $tinymce_version ) );\n\n\t\t\tWP_CLI::line( \"Manifest revision:\\t$manifest_version\" );\n\t\t} else {\n\t\t\tWP_CLI::line( $version_text );\n\t\t}\n\t}", "function register_block_core_site_logo_setting()\n {\n }", "function als_alert_default_args() {\n\n\t/**\n\t * Filters the default alert args.\n\t *\n\t * @since 1.0.0\n\t */\n\treturn apply_filters( 'als_alert_default_args', array(\n\t\t'post_ID' => 0,\n\t\t'content' => '',\n\t\t'color' => 'default',\n\t\t'type' => 'inset-banner',\n\t\t'icon' => 'default',\n\t\t'time_range' => '',\n\t\t'popup_image' => '',\n\t\t'popup_image_small'=> '',\n\t\t'user_interaction' => 'none',\n\t\t'button_text' => '',\n\t\t'button_link' => '',\n\t\t'button_new_tab' => '',\n\t) );\n}", "public function testOptionMergeWithAdditional()\n {\n $argv = [\n '/Users/tom/Sites/_MyCode/PHP/twRobo/src/tg',\n 'list',\n '--raw'\n ];\n\n\n $merger = new Merger();\n $merger->setArgs($argv, $this->configfile);\n $merged = $merger->merge();\n\n $this->assertCount(4, $merged);\n $this->assertEquals('--raw', $merged[2]);\n $this->assertEquals('--format=xml', $merged[3]);\n }", "public function __construct()\n {\n //when using transient and options for update core we need to for forcing the core version\n add_filter('option_update_core', [$this, 'addCoreUpdateVersion']);\n add_filter('site_transient_update_core', [$this, 'addCoreUpdateVersion']);\n\n //when we've finished updating we need to remove the option so updates can work as normal\n add_action('upgrader_process_complete', [$this, 'removeUpdateVersion'], 10, 2);\n }", "function _dataone_admin_version_options() {\n\n $options = array();\n\n $versions = _dataone_api_versions();\n if (!empty($versions)) {\n foreach ($versions as $version_id => $version_data) {\n $options[$version_id] = $version_data['name'];\n }\n }\n\n return $options;\n}", "private function _log_version_number () {\n update_option( $this->_token . '_version', $this->_version );\n }" ]
[ "0.55579317", "0.5379492", "0.5293333", "0.5138704", "0.51216877", "0.51020133", "0.5101698", "0.50603426", "0.500928", "0.49329698", "0.49038213", "0.48948243", "0.48662868", "0.48136237", "0.4804192", "0.47919914", "0.47913826", "0.47816938", "0.4768469", "0.47440848", "0.4719238", "0.4694356", "0.46793157", "0.46653733", "0.4654762", "0.46529332", "0.46496263", "0.4644118", "0.46254843", "0.46124312", "0.46122402", "0.46013957", "0.4592931", "0.4587555", "0.4582976", "0.45806423", "0.4564975", "0.45528007", "0.45454118", "0.45428196", "0.45400372", "0.4537868", "0.45321795", "0.45210674", "0.45210424", "0.45175728", "0.44998407", "0.44845766", "0.44823676", "0.44810098", "0.447486", "0.44626942", "0.444246", "0.44414827", "0.4438597", "0.44385785", "0.44376934", "0.44315842", "0.44177932", "0.4407809", "0.44021717", "0.43899083", "0.43899083", "0.43899083", "0.43893796", "0.43885505", "0.43807352", "0.43748683", "0.4372326", "0.43722653", "0.43691048", "0.43677276", "0.43662736", "0.43650606", "0.43637148", "0.4360113", "0.43571332", "0.43507996", "0.43507496", "0.4350307", "0.4350307", "0.43449858", "0.43414754", "0.43384236", "0.43360436", "0.43335256", "0.43322086", "0.43307185", "0.4328426", "0.43280786", "0.43264595", "0.43138793", "0.43101206", "0.43036315", "0.43025208", "0.4296885", "0.42919746", "0.4291688", "0.42884955", "0.4288306" ]
0.71187365
0
Gets a specific, ready made layout for a slug
public function get_theme_layout ($layout_slug='') { if (empty($layout_slug)) return ''; $filenames = array( 'layouts/index-' . $layout_slug . '.php', 'layouts/' . $layout_slug . '.php', ); return function_exists('upfront_locate_template') ? upfront_locate_template($filenames) : locate_template($filenames) ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mai_get_layout( $layout ) {\n\tremove_filter( 'genesis_pre_get_option_site_layout', 'genesiswooc_archive_layout' );\n\n\t// Setup cache.\n\tstatic $layout_cache = '';\n\n\t// If cache is populated, return value.\n\tif ( '' !== $layout_cache ) {\n\t\treturn esc_attr( $layout_cache );\n\t}\n\n\t$site_layout = '';\n\n\tglobal $wp_query;\n\n\t// If home page.\n\tif ( is_home() ) {\n\t\t$site_layout = genesis_get_custom_field( '_genesis_layout', get_option( 'page_for_posts' ) );\n\t\tif ( ! $site_layout ) {\n\t\t\t$site_layout = genesis_get_option( 'layout_archive' );\n\t\t}\n\t}\n\n\t// If viewing a singular page, post, or CPT.\n\telseif ( is_singular() ) {\n\t\t$site_layout = genesis_get_custom_field( '_genesis_layout', get_the_ID() );\n\t\tif ( ! $site_layout ) {\n\t\t\t$site_layout = genesis_get_option( sprintf( 'layout_%s', get_post_type() ) );\n\t\t}\n\t}\n\n\t// If viewing a post taxonomy archive.\n\telseif ( is_category() || is_tag() || is_tax( get_object_taxonomies( 'post', 'names' ) ) ) {\n\t\t$term = $wp_query->get_queried_object();\n\t\t$site_layout = $term ? get_term_meta( $term->term_id, 'layout', true) : '';\n\t\t$site_layout = $site_layout ? $site_layout : genesis_get_option( 'layout_archive' );\n\t}\n\n\t// If viewing a custom taxonomy archive.\n\telseif ( is_tax() ) {\n\t\t$term = $wp_query->get_queried_object();\n\t\t$site_layout = $term ? get_term_meta( $term->term_id, 'layout', true) : '';\n\t\tif ( ! $site_layout ) {\n\t\t\t$tax = get_taxonomy( $wp_query->get_queried_object()->taxonomy );\n\t\t\tif ( $tax ) {\n\t\t\t\t/**\n\t\t\t\t * If we have a tax, get the first one.\n\t\t\t\t * Changed to reset() when hit an error on a term archive that object_type array didn't start with [0]\n\t\t\t\t */\n\t\t\t\t$post_type = reset( $tax->object_type );\n\t\t\t\t// If we have a post type and it supports genesis-cpt-archive-settings\n\t\t\t\tif ( post_type_exists( $post_type ) && genesis_has_post_type_archive_support( $post_type ) ) {\n\t\t\t\t\t// $site_layout = genesis_get_option( sprintf( 'layout_archive_%s', $post_type ) );\n\t\t\t\t\t$site_layout = genesis_get_cpt_option( 'layout', $post_type );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$site_layout = $site_layout ? $site_layout : genesis_get_option( 'layout_archive' );\n\t}\n\n\t// If viewing a supported post type.\n\t// elseif ( is_post_type_archive() && genesis_has_post_type_archive_support() ) {\n\telseif ( is_post_type_archive() ) {\n\t\t// $site_layout = genesis_get_option( sprintf( 'layout_archive_%s', get_post_type() ) );\n\t\t$site_layout = genesis_get_cpt_option( 'layout', get_post_type() );\n\t\t$site_layout = $site_layout ? $site_layout : genesis_get_option( 'layout_archive' );\n\t}\n\n\t// If viewing an author archive.\n\telseif ( is_author() ) {\n\t\t$site_layout = get_the_author_meta( 'layout', (int) get_query_var( 'author' ) );\n\t\t$site_layout = $site_layout ? $site_layout : genesis_get_option( 'layout_archive' );\n\t}\n\n\t// Pull the theme option.\n\tif ( ! $site_layout ) {\n\t\t$site_layout = genesis_get_option( 'site_layout' );\n\t}\n\n\t// Use default layout as a fallback, if necessary.\n\tif ( ! genesis_get_layout( $site_layout ) ) {\n\t\t$site_layout = genesis_get_default_layout();\n\t}\n\t// Push layout into cache.\n\t$layout_cache = $site_layout;\n\n\t// Return site layout.\n\treturn esc_attr( $site_layout );\n\n}", "function layout(string $layout)\n {\n return the_layout($layout);\n }", "function the_layout(string $layout)\n {\n return app('armin.layout')->layout($layout);\n }", "function layout_first()\n { \n foreach (func_get_args() as $name) {\n if(! empty($name) && $layout = the_layout($name)) {\n return $layout;\n }\n } \n\n $error = 'Not Found Layout(s) '. collect(func_get_args())->filter()->implode(', ') . '.';\n\n return abort(500, $error);\n }", "public function get_layout($id)\n\t{\n\t\treturn $this->get_single($id);\n\t}", "function get_where_used( $layout_id, $slug = false, $group = false, $posts_per_page = -1 )\n\t{\n\t\t$layout = $this->get_layout_from_id( $layout_id );\n\n\t\tif( is_object( $layout ) === false && method_exists($layout,'get_post_slug') === false ) return;\n\n\t\t$args = array(\n\t\t\t'posts_per_page' => $posts_per_page,\n\t\t\t'post_type' => 'any',\n\t\t\t'meta_query' => array (\n\t\t\t\tarray (\n\t\t\t\t\t'key' => '_layouts_template',\n\t\t\t\t\t'value' => $slug ? $slug : $layout->get_post_slug(),\n\t\t\t\t\t'compare' => '=',\n\t\t\t\t)\n\t\t\t) );\n\n\t\t$new_query = new WP_Query( $args );\n\n if( $group === true )\n {\n add_filter('posts_orderby', array(&$this, 'order_by_post_type'), 10, 2);\n $new_query->group_posts_by_type = $group;\n }\n\n\t\t$posts = $new_query->get_posts();\n\n\t\treturn $posts;\n\t}", "protected function getLayout() {\n\t\treturn $this->getFrontcontroller()->getResource('layout');\n\t}", "public function getLayout() {\n\n return $this->asset_array['default']['layout']['name'];\n }", "public function getSingle($slug){\n \t// izvuci post iz 'posts' tabele koristeci $slug posta koji je stigao \n $post = Post::where('slug', '=', $slug)->first(); \n // posalji ga u vju single.blade.php iz foldera 'blogg\\resources\\views\\blog' da ga prikaze\n return view('blog.single')->withPost($post); \n }", "protected function getLayout($id='default'){\n\t\tinclude($this->layoutsPath.'/'.$id.'.php');\n\t}", "public function getLayout()\n\t{\n\t\t$input = JFactory::getApplication()->input;\n\t\treturn $input->getCmd('tmpl') ? $input->getCmd('tmpl') : $this->getParam('mainlayout', 'default');\n\t}", "public function getPageBySlug( $slug ) {\n\n\t\tif ( !$page = $this->pageRepo->getBySlug( $slug ) ) {\n\t\t\tabort( 404 );\n\t\t}\n\n\t\t// default view\n\t\t$view = 'pages.inner';\n\n\t\t// default banner - child views can override the default one.\n\t\t$banner = $page->hasBanner() ? $page->bannerImageUrl() : null;\n\t\tif ( $page->isContactUs() ) {\n\t\t\t$view = 'pages.contact-us';\n\t\t}\n\n\t\treturn view( toolbox()->frontend()->view( $view ), compact( 'page', 'banner') );\n\n\t}", "function get_page_layout() {\n\t\tif (is_page() || (is_front_page() && get_option('show_on_front') == 'page')) {\n\t\t\t// WP page,\n\t\t\t// get the page template setting\n\t\t\t$page_id = get_the_ID();\n\t\t\t$page_template = noo_get_post_meta($page_id, '_wp_page_template', 'default');\n\t\t\t\n\t\t\tif (strpos($page_template, 'sidebar') !== false) {\n\t\t\t\tif (strpos($page_template, 'left') !== false) {\n\t\t\t\t\treturn 'left_sidebar';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn 'sidebar';\n\t\t\t}\n\t\t\t\n\t\t\treturn 'fullwidth';\n\t\t}\n\t\t\n\t\t// NOO Resume\n\t\tif( is_post_type_archive( 'noo_resume' ) ) {\n\t\t\treturn noo_get_option('noo_resumes_layout', 'sidebar');\n\t\t}\n\t\tif( is_singular( 'noo_resume' ) ) {\n\t\t\treturn 'fullwidth';\n\t\t}\n\t\t\n\t\t// NOO Company\n\t\tif( is_post_type_archive( 'noo_company' ) ) {\n\t\t\treturn noo_get_option('noo_companies_layout', 'fullwidth');\n\t\t}\n\n\t\tif( is_singular( 'noo_company' ) ) {\n\t\t\tif(noo_get_option('noo_companies_layout', 'fullwidth') == 'fullwidth'){\n\t\t\t\treturn 'sidebar';\n\t\t\t} else{\n\t\t\t\treturn noo_get_option('noo_companies_layout', 'fullwidth');\n\t\t\t}\n\t\t}\n\t\t\n\t\t// NOO Job\n\t\tif( is_post_type_archive( 'noo_job' )\n\t\t\t|| is_tax( 'job_category' )\n\t\t\t|| is_tax( 'job_type' )\n\t\t\t|| is_tax( 'job_tag' ) \n\t\t\t|| is_tax( 'job_location' ) ) {\n\n\t\t\treturn noo_get_option('noo_jobs_layout', 'sidebar');\n\t\t}\n\t\t\n\t\t// Single Job\n\t\tif( is_singular( 'noo_job' ) ) {\n\t\t\treturn noo_get_option('noo_single_jobs_layout', 'right_company');\n\t\t}\n\n\t\t// WooCommerce\n\t\tif( NOO_WOOCOMMERCE_EXIST ) {\n\t\t\tif( is_shop() || is_product_category() || is_product_tag() ){\n\t\t\t\treturn noo_get_option('noo_shop_layout', 'fullwidth');\n\t\t\t}\n\n\t\t\tif( is_product() ) {\n\t\t\t\t$product_layout = noo_get_option('noo_woocommerce_product_layout', 'same_as_shop');\n\t\t\t\tif ($product_layout == 'same_as_shop') {\n\t\t\t\t\t$product_layout = noo_get_option('noo_shop_layout', 'fullwidth');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $product_layout;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Single post page\n\t\tif (is_single()) {\n\n\t\t\t// WP post,\n\t\t\t// check if there's overrode setting in this post.\n\t\t\t$post_id = get_the_ID();\n\t\t\t$override_setting = noo_get_post_meta($post_id, '_noo_wp_post_override_layout', false);\n\t\t\t\n\t\t\tif ( !$override_setting ) {\n\t\t\t\t$post_layout = noo_get_option('noo_blog_post_layout', 'same_as_blog');\n\t\t\t\tif ($post_layout == 'same_as_blog') {\n\t\t\t\t\t$post_layout = noo_get_option('noo_blog_layout', 'sidebar');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $post_layout;\n\t\t\t}\n\n\t\t\t// overrode\n\t\t\treturn noo_get_post_meta($post_id, '_noo_wp_post_layout', 'sidebar-main');\n\t\t}\n\n\t\t// Archive\n\t\tif (is_archive()) {\n\t\t\t$archive_layout = noo_get_option('noo_blog_archive_layout', 'same_as_blog');\n\t\t\tif ($archive_layout == 'same_as_blog') {\n\t\t\t\t$archive_layout = noo_get_option('noo_blog_layout', 'sidebar');\n\t\t\t}\n\t\t\t\n\t\t\treturn $archive_layout;\n\t\t}\n\n\t\t// Index or Home\n\t\tif (is_home() || (is_front_page() && get_option('show_on_front') == 'posts')) {\n\t\t\t\n\t\t\treturn noo_get_option('noo_blog_layout', 'sidebar');\n\t\t}\n\t\t\n\t\treturn '';\n\t}", "function getLayout($id){\r\n \r\n $transform = ucfirst(str_replace('-', \"_\", $id));\r\n $layout_name = \"\\\\LK\\PXEdit\\\\Layouts\\\\\" . $transform;\r\n \r\n // Force an Autoload\r\n \\PXEdit_Autoload($layout_name);\r\n \r\n if(!class_exists($layout_name)){\r\n $this ->sendError('Layout ' . $layout_name . \" is not existing.\");\r\n } \r\n \r\n $layout = new $layout_name();\r\n return $layout;\r\n }", "function get_template_section( $slug, $name = null ) {\n\tdo_action( \"get_template_part_{$slug}\", $slug, $name );\n\n\t$templates = array();\n\tif ( isset($name) )\n\t\t$templates[] = \"template-sections/{$slug}-{$name}.php\";\n\n\t$templates[] = \"template-sections/{$slug}.php\";\n\n\tlocate_template($templates, true, false);\n\t\n}", "public function getLayouts();", "public function getSingle($slug) {\n // $post = Post::where('slug', '=', $slug)->first();\n $this->post = Post::where('slug', '=', $slug)->first();\n\n // return the view and pass in the post object\n // return view('m/blog/blog.single')->withPost($post);\n\n $this->page->title = $this->post->title;\n $this->page->view = 'blog-single';\n return view($this->page->view)\n ->with('page', $this->page)\n ->with('post', $this->post);\n }", "function pi_get_content_layout()\n{\n return piBlogCustomize::pi_refresh_in_customize('pi_options[content][layout]') ? piBlogCustomize::pi_refresh_in_customize('pi_options[content][layout]') : piBlogFramework::$piOptions['content']['layout'];\n}", "function deals_get_template_part( $slug, $name = '' ) {\n\tif ($name == 'deals') :\n\t\tif (!locate_template(array( $slug.'-'.$name.'.php', DEALS_TEMPLATE.$slug.'-'.$name.'.php' ))) :\n\t\t\tload_template( DEALS_TEMPLATE_DIR . $slug.'-'.$name.'.php',false );\n\t\t\treturn;\n\t\tendif;\n endif; \n get_template_part(DEALS_TEMPLATE. $slug, $name );\n}", "protected function getRandomLayout(): string {\n\t\t$key = array_rand($this->layouts);\n\t\t\n\t\treturn $this->layouts[$key];\n\t}", "function cmdeals_get_template_part( $slug, $name = '' ) {\n\tglobal $cmdeals, $post;\n\tif ($name=='store') :\n\t\tif (!locate_template(array( $slug.'-store.php', WPDEALS_TEMPLATE_URL . $slug.'-store.php' ))) :\n\t\t\tload_template( $cmdeals->plugin_path() . '/cmdeals-templates/'.$slug.'-store.php',false );\n\t\t\treturn;\n\t\tendif;\n\tendif;\n\tget_template_part( WPDEALS_TEMPLATE_URL . $slug, $name );\n}", "public function getPage($slug = 'home')\n {\n\n $page = Page::where(['slug' => $slug, 'status' => 'ACTIVE'])->firstOrFail();\n $blocks = $page->blocks()\n ->where('is_hidden', '=', '0')\n ->orderBy('order', 'asc')\n ->get()\n ->map(function ($block) {\n return (object)[\n 'id' => $block->id,\n 'page_id' => $block->page_id,\n 'updated_at' => $block->updated_at,\n 'cache_ttl' => $block->cache_ttl,\n 'template' => $block->template()->template,\n 'data' => $block->cachedData,\n 'path' => $block->path,\n 'type' => $block->type,\n ];\n });\n\n // Override standard body content, with page block content\n $page['body'] = view('voyager-page-blocks::default', [\n 'page' => $page,\n 'blocks' => $this->prepareEachBlock($blocks),\n ]);\n\n // Check that the page Layout and its View exists\n if (empty($page->layout)) {\n $page->layout = 'default';\n }\n if (!View::exists(\"{$this->viewPath}::layouts.{$page->layout}\")) {\n $page->layout = 'default';\n }\n\n // Return the full page\n return view(\"{$this->viewPath}::modules.pages.default\", [\n 'page' => $page,\n 'layout' => $page->layout,\n ]);\n }", "public function getSingle($slug) {\n // get() fetch a collection of object, must be iterated or collection[0]\n // first() get a single object\n $post = Post::where('slug', '=', $slug)->first();\n\n $comments = $post->comments->sortByDesc('id');\n \n // return the view and pass in the post object\n return view('blog.single')->withPost($post)->withComments($comments);\n\n }", "function get_template_part( $slug, $name = null ) {\n\n $templates = array();\n $name = (string) $name;\n if ( '' !== $name )\n $templates[] = \"{$slug}-{$name}.php\";\n\n $templates[] = \"{$slug}.php\";\n\n locate_template($templates, true, false);\n}", "public function getSingle($slug) {\n\n $post = Post::where('slug', '=', $slug)->first();\n\n // return the view and pass in the post object\n\n return view('project.single')->withPost($post);\n\n }", "public static function custom_page_layout()\n {\n\n // get wp post\n global $post;\n // get post name\n $page_slug = $post->post_name;\n // check post name\n if ($page_slug == 'my_events') {\n $page_template = PLUGIN_PATH_INCLUDES_PUBLIC . 'page_template.php';\n }\n return $page_template;\n }", "public function getLayout(): string;", "function publisher_get_header_layout() {\n\n\t\t// Return from cache\n\t\tif ( publisher_get_global( 'header-layout' ) ) {\n\t\t\treturn publisher_get_global( 'header-layout' );\n\t\t}\n\n\t\t$layout = 'default';\n\n\t\tif ( publisher_is_valid_tax() ) {\n\t\t\t$layout = bf_get_term_meta( 'header_layout' );\n\t\t} elseif ( publisher_is_valid_cpt() ) {\n\n\n\t\t\t$layout = bf_get_post_meta( 'header_layout' );\n\t\t\t// default -> Retrieve from parent category\n\t\t\tif ( $layout === 'default' ) {\n\n\t\t\t\t$main_term = publisher_get_post_primary_cat();\n\n\t\t\t\tif ( ! is_wp_error( $main_term ) && is_object( $main_term ) && bf_get_term_meta( 'override_in_posts', $main_term ) ) {\n\t\t\t\t\t$layout = bf_get_term_meta( 'header_layout', $main_term );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( $layout === 'default' ) {\n\t\t\t$layout = publisher_get_option( 'header_layout' );\n\t\t}\n\n\t\t// Cache\n\t\tpublisher_set_global( 'header-layout', $layout );\n\n\t\treturn $layout;\n\n\t}", "function fanwood_plugin_layouts( $layout ) {\n\n\tif ( current_theme_supports( 'theme-layouts' ) ) {\n\t\n\t\t$global_layout = hybrid_get_setting( 'fanwood_global_layout' );\n\t\t$buddypress_layout = hybrid_get_setting( 'fanwood_buddypress_layout' );\n\n\t\tif ( function_exists( 'bp_loaded' ) && !bp_is_blog_page() && $layout == 'layout-default' ) {\n\t\t\n\t\t\tif ( $buddypress_layout !== 'layout_default' ) {\n\t\t\t\n\t\t\t\tif ( $buddypress_layout == 'layout_1c' )\n\t\t\t\t\t$layout = 'layout-1c';\n\t\t\t\telseif ( $buddypress_layout == 'layout_2c_l' )\n\t\t\t\t\t$layout = 'layout-2c-l';\n\t\t\t\telseif ( $buddypress_layout == 'layout_2c_r' )\n\t\t\t\t\t$layout = 'layout-2c-r';\n\t\t\t\telseif ( $buddypress_layout == 'layout_3c_c' )\n\t\t\t\t\t$layout = 'layout-3c-c';\n\t\t\t\telseif ( $buddypress_layout == 'layout_3c_l' )\n\t\t\t\t\t$layout = 'layout-3c-l';\n\t\t\t\telseif ( $buddypress_layout == 'layout_3c_r' )\n\t\t\t\t\t$layout = 'layout-3c-r';\n\t\t\t\telseif ( $buddypress_layout == 'layout_hl_1c' )\n\t\t\t\t\t$layout = 'layout-hl-1c';\n\t\t\t\telseif ( $buddypress_layout == 'layout_hl_2c_l' )\n\t\t\t\t\t$layout = 'layout-hl-2c-l';\n\t\t\t\telseif ( $buddypress_layout == 'layout_hl_2c_r' )\n\t\t\t\t\t$layout = 'layout-hl-2c-r';\n\t\t\t\telseif ( $buddypress_layout == 'layout_hr_1c' )\n\t\t\t\t\t$layout = 'layout-hr-1c';\n\t\t\t\telseif ( $buddypress_layout == 'layout_hr_2c_l' )\n\t\t\t\t\t$layout = 'layout-hr-2c-l';\n\t\t\t\telseif ( $buddypress_layout == 'layout_hr_2c_r' )\n\t\t\t\t\t$layout = 'layout-hr-2c-r';\n\t\t\t\t\n\t\t\t} elseif ( $buddypress_layout == 'layout_default' ) {\n\t\t\t\n\t\t\t\tif ( $global_layout == 'layout_1c' )\n\t\t\t\t\t$layout = 'layout-1c';\n\t\t\t\telseif ( $global_layout == 'layout_2c_l' )\n\t\t\t\t\t$layout = 'layout-2c-l';\n\t\t\t\telseif ( $global_layout == 'layout_2c_r' )\n\t\t\t\t\t$layout = 'layout-2c-r';\n\t\t\t\telseif ( $global_layout == 'layout_3c_c' )\n\t\t\t\t\t$layout = 'layout-3c-c';\n\t\t\t\telseif ( $global_layout == 'layout_3c_l' )\n\t\t\t\t\t$layout = 'layout-3c-l';\n\t\t\t\telseif ( $global_layout == 'layout_3c_r' )\n\t\t\t\t\t$layout = 'layout-3c-r';\n\t\t\t\telseif ( $global_layout == 'layout_hl_1c' )\n\t\t\t\t\t$layout = 'layout-hl-1c';\n\t\t\t\telseif ( $global_layout == 'layout_hl_2c_l' )\n\t\t\t\t\t$layout = 'layout-hl-2c-l';\n\t\t\t\telseif ( $global_layout == 'layout_hl_2c_r' )\n\t\t\t\t\t$layout = 'layout-hl-2c-r';\n\t\t\t\telseif ( $global_layout == 'layout_hr_1c' )\n\t\t\t\t\t$layout = 'layout-hr-1c';\n\t\t\t\telseif ( $global_layout == 'layout_hr_2c_l' )\n\t\t\t\t\t$layout = 'layout-hr-2c-l';\n\t\t\t\telseif ( $global_layout == 'layout_hr_2c_r' )\n\t\t\t\t\t$layout = 'layout-hr-2c-r';\n\t\t\t\n\t\t\t}\n\n\t\t}\n\t\t\n\t}\n\t\n\treturn $layout;\n\n}", "function custom_set_single_posts_layout() {\n if (is_single('post') || is_singular('post')) {\n return 'content-sidebar';\n }\n \n}", "public function getLayout() {}", "public function getLayout();", "function load_composer_layout( $layout_type = 'header' ) {\n\t\tglobal $post;\n\t\t$default_layout = '';\n\t\t\n\t\t$postID = is_home() ? get_option( 'page_for_posts' ) : ( $post ? $post->ID : 0 );\n\t\t\n\t\tif ( $postID && ( is_singular() || is_home() ) && ( $this_layout_id = get_post_meta( $postID, '_this_' . $layout_type, true ) ) ) { // appointment: may be anyone\n\t\t\tif ( $this_layout_id === '_none_' ) { // layout disabled;\n\t\t\t\treturn '';\n\t\t\t}\n\t\t\t$layout = get_post( $this_layout_id );\n\t\t\tif ( $layout && $layout->post_status === 'publish' ) {\n\t\t\t\treturn do_shortcode( apply_filters( 'the_content', $layout->post_content ) );\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$default_layout_query = Trends()->model->layout->get_default_layout( $layout_type );\n\t\t\t\t\n\t\t\t\tif ( $default_layout_query->posts && $default_layout_query->posts[0]->post_status === 'publish' ) {\n\t\t\t\t\treturn do_shortcode( apply_filters( 'the_content', $default_layout_query->posts[0]->post_content ) );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\t$layouts = Trends()->model->layout->get_layouts( $layout_type );\n\t\t\t\n\t\t\tif ( $layouts->posts ) {\n\t\t\t\tforeach ( $layouts->posts as $layout ) {\n\t\t\t\t\t$_appointment = get_post_meta( $layout->ID, '_appointment', true );\n\t\t\t\t\t\n\t\t\t\t\tif ( ( $postID && ( $post_type = get_post_type( $postID ) ) && $_appointment === $post_type && is_singular() ) || // appointment: Any from Post Types (compatibility:post)\n\t\t\t\t\t ( $_appointment === 'is-home' && is_home() ) || // appointment: is-home\n\t\t\t\t\t ( $_appointment === 'is-search' && is_search() ) || // appointment: is-search\n\t\t\t\t\t ( $_appointment === 'is-archive' && is_archive() ) || // appointment: is-archive\n\t\t\t\t\t ( $_appointment === 'is-404' && is_404() ) // appointment: is-404\n\t\t\t\t\t\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn do_shortcode( apply_filters( 'the_content', $layout->post_content ) );\n\t\t\t\t\t} elseif ( $_appointment === 'default' ) { // appointment: default\n\t\t\t\t\t\t$default_layout = $layout;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( $default_layout ) {\n\t\t\t\t\treturn do_shortcode( apply_filters( 'the_content', $default_layout->post_content ) );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn '';\n\t}", "public function get_layout( $layout_id = '' ) {\n // Globals\n\t\tglobal $wpdb;\n \n try {\n // Layout ID is not optional\n if( @$layout_id != '' ) {\n $layout_id = sanitize_text_field( $layout_id );\n } else {\n throw new Exception( 'Layout ID is required.' );\n }\n \n // Get the layout from the database\n $sql = \"SELECT * FROM `\" . rpids_tableprefix() . \"rpids_layouts` WHERE `id` = '\" . $layout_id . \"';\";\n $layout = $wpdb->get_row( $sql, ARRAY_A );\n \n // Make sure we found something\n if( $layout == null ) {\n // Nope\n throw new Exception( 'Layout not found.' );\n } else {\n // Got it! Put it in an object.\n $return = new StdClass();\n $return->status = 'success';\n $return->id = $layout['id'];\n $return->name = $layout['name'];\n $return->description = $layout['description'];\n $return->type = $layout['type'];\n $return->width = $layout['width'];\n $return->height = $layout['height'];\n $return->bgimage = $layout['bgimage'];\n $return->bgimagetype = $layout['bgimagetype'];\n $return->bgcolor = $layout['bgcolor'];\n $return->startimage = $layout['startimage'];\n $return->items = (object) unserialize( $layout['items'] );\n $return->lastmodified = $layout['lastmodified'];\n \n // Return it!\n return $return;\n }\n } catch ( Exception $e ) {\n return (object) array(\n\t\t\t\t\"status\" => \"error\",\n\t\t\t\t\"message\" => $e->getMessage()\n\t\t\t);\n }\n }", "function ffd_get_template_part( $slug, $name = '' ) {\r\n\t$template = '';\r\n\r\n\t// Look in yourtheme/slug-name.php and yourtheme/ffd-templates/slug-name.php.\r\n\tif ( $name && ! FFD_TEMPLATE_DEBUG_MODE ) {\r\n\t\t$template = locate_template( array( \"{$slug}-{$name}.php\", FFD()->template_path() . \"{$slug}-{$name}.php\" ) );\r\n\t}\r\n\r\n\t// Get default slug-name.php.\r\n\tif ( ! $template && $name && file_exists( FFD()->plugin_path() . \"/templates/{$slug}-{$name}.php\" ) ) {\r\n\t\t$template = FFD()->plugin_path() . \"/templates/{$slug}-{$name}.php\";\r\n\t}\r\n\r\n\t// If template file doesn't exist, look in yourtheme/slug.php and yourtheme/ffd-templates/slug.php.\r\n\tif ( ! $template && ! FFD_TEMPLATE_DEBUG_MODE ) {\r\n\t\t$template = locate_template( array( \"{$slug}.php\", FFD()->template_path() . \"{$slug}.php\" ) );\r\n\t}\r\n\r\n\t// Allow 3rd party plugins to filter template file from their plugin.\r\n\t$template = apply_filters( 'ffd_get_template_part', $template, $slug, $name );\r\n\r\n\tif ( $template ) {\r\n\t\tload_template( $template, false );\r\n\t}\r\n}", "function anyPageView($slug = \"\") {\r\n\r\n $uri = \\Request::path();\r\n if ($uri == \"cms\") {\r\n $uri = $uri . '/';\r\n }\r\n\r\n $languages = array_column(\\Sinevia\\Cms\\Helpers\\Languages::$data, 0);\r\n\r\n if (strlen(\\Request::segment(1)) == 2 AND in_array(\\Request::segment(1), $languages)) {\r\n $uri = substr($uri, 3);\r\n }\r\n\r\n $alias = \\Illuminate\\Support\\Str::replaceFirst('cms/', '', $uri);\r\n\r\n $page = \\Sinevia\\Cms\\Models\\Page::where('Alias', $alias)\r\n ->orWhere('Alias', '=', '/' . $alias)\r\n //->where('Status', '=', 'Published')\r\n ->first();\r\n\r\n if ($page == null) {\r\n $patterns = array(\r\n ':any' => '([^/]+)',\r\n ':num' => '([0-9]+)',\r\n ':all' => '(.*)',\r\n ':string' => '([a-zA-Z]+)',\r\n ':number' => '([0-9]+)',\r\n ':numeric' => '([0-9-.]+)',\r\n ':alpha' => '([a-zA-Z0-9-_]+)',\r\n );\r\n $aliases = \\Sinevia\\Cms\\Models\\Page::pluck('Alias', 'Id')->toArray();\r\n $aliases = array_filter($aliases, function ($alias) {\r\n return \\Illuminate\\Support\\Str::contains($alias, [':']);\r\n });\r\n foreach ($aliases as $pageId => $alias) {\r\n $alias = strtr($alias, $patterns);\r\n if (preg_match('#^' . $alias . '$#', '/' . $uri, $matched)) {\r\n $page = \\Sinevia\\Cms\\Models\\Page::find($pageId);\r\n };\r\n }\r\n if ($page == null) {\r\n return 'Page not found';\r\n }\r\n }\r\n\r\n $pageTranslation = $page->translation('en');\r\n if ($pageTranslation == null) {\r\n die('Page Translation not found ' . $page->Id);\r\n }\r\n $pageTitle = $pageTranslation->Title;\r\n $pageContent = $pageTranslation->Content;\r\n $pageMetaKeywords = $page->MetaKeywords;\r\n $pageMetaDescription = $page->MetaDescription;\r\n $pageMetaRobots = $page->MetaRobots;\r\n $pageCanonicalUrl = $page->CanonicalUrl != \"\" ? $page->CanonicalUrl : $page->url();\r\n $templateId = $page->TemplateId;\r\n $wysiwyg = $page->Wysiwyg;\r\n\r\n if ($wysiwyg == 'BlockEditor') {\r\n $blocks = json_decode($pageContent);\r\n if (is_array($blocks)) {\r\n $pageContent = $this->blockEditorBlocksToHtml($blocks);\r\n } else {\r\n $pageContent = 'Un-blocking error occurred';\r\n }\r\n }\r\n\r\n\r\n $template = \\Sinevia\\Cms\\Models\\Template::find($page->TemplateId);\r\n\r\n if ($template != null) {\r\n $templateTranslation = $template->translation('en');\r\n if ($templateTranslation == null) {\r\n die('Transation for template #' . $template->Id . ' not found');\r\n }\r\n $templateContent = $templateTranslation->Content;\r\n\r\n $webpage = \\Sinevia\\Cms\\Helpers\\Template::fromString($templateContent, [\r\n 'page_meta_description' => $pageMetaDescription,\r\n 'page_meta_keywords' => $pageMetaKeywords,\r\n 'page_meta_robots' => $pageMetaRobots,\r\n 'page_canonical_url' => $pageCanonicalUrl,\r\n 'page_title' => $pageTitle,\r\n 'page_content' => \\Sinevia\\Cms\\Helpers\\Template::fromString($pageContent),\r\n ]);\r\n } else {\r\n $webpage = \\Sinevia\\Cms\\Helpers\\Template::fromString($pageContent, [\r\n 'page' => $page,\r\n 'pageTranslation' => $pageTranslation,\r\n ]);\r\n }\r\n\r\n\r\n $webpageRenderedWithBlade = \\Sinevia\\Cms\\Helpers\\CmsHelper::blade($webpage);\r\n\r\n $webpageWithBlocks = \\Sinevia\\Cms\\Models\\Block::renderBlocks($webpageRenderedWithBlade);\r\n $webpageWithWidgets = \\Sinevia\\Cms\\Models\\Widget::renderWidgets($webpageWithBlocks);\r\n \r\n return $webpageWithWidgets;\r\n }", "public function getPost($slug)\n {\n return view('pages.singlepost2')\n ->with('custompost', Custompost::where('slug', $slug)->first());\n }", "function get_page_template_slug($post = \\null)\n {\n }", "function yt_bbpres_site_layout( $current_layout ){\r\n\tif( yt_is_bbpress() )\r\n\t\treturn 'right-sidebar';\r\n\r\n\treturn $current_layout;\r\n}", "function loadLayout($get_where=\"\",$layoutPath=\"layout/\",$layoutFile=\"layout.php\") {\n\t\tglobal $__;\n\t\t$__['main'] = $__['pathPage'].$get_where;\n include $layoutPath.$layoutFile;\n\t}", "public function getThemeLayout();", "function it_exchange_custom_url_tracking_addon_builder_layout( $layout ) {\n\n\t$var = get_query_var( 'it_exchange_custom_url' );\n\tif ( empty( $var ) || ! is_singular() )\n\t\treturn $layout;\n\n\t$post_id = empty( $GLOBALS['post']->ID ) ? 0 : $GLOBALS['post']->ID;\n\t$custom_urls = get_post_meta( $post_id, '_it-exchange-product-feature-custom-url-tracking', true );\n\tforeach( $custom_urls as $url => $data ) {\n\t\tif ( $data['slug'] == $var && ! empty( $data['builder-layout'] ) )\n\t\t\treturn $data['builder-layout'];\n\t}\n\n\treturn $layout;\n}", "public function getLayout()\n {\n return 'layouts/layout-full-width.tpl';\n }", "public function get_view($slug) {\n //Search for a post matching the slug, where status = 1\n $post = Post::where_slug($slug)->where_status('1')->first();\n\n //If we find results\n if(!is_null($post)) {\n //Create a data array\n $data = array(\n 'pageTitle' => $post->title,\n 'pageDescription' => $post->description,\n 'pageContent' => $post->content,\n );\n\n //Build the view\n \t\treturn View::make('public.post.view', $data);\n }\n //No post found\n else {\n //404\n return Response::error('404');\n }\n\t}", "public function getSingle($slug) {\n $post = Post::where('slug', '=', $slug)->first();\n $popular = Post::inRandomOrder()->get()->take(5);\n $categories = Category::all();\n $tags = Tag::all();\n $previous= Post::where('id', '<', $post->id)->orderBy('id','desc')->first();\n $next= Post::where('id', '>', $post->id)->orderBy('id')->first();\n // return the view and pass in the post object\n return view('blog.single')->with(compact('post','previous', 'next'))->withPopulars($popular)->withCategories\n ($categories)->withTags($tags);\n }", "public function layout($name = null) {\n\t\t$request = $this->container->get('request');\n\t\tif (!is_null($name) && $this->container->hasParameter('oxygen_framework.templating.layouts.'.$name)) {\n\t\t\treturn $this->container->getParameter('oxygen_framework.templating.layouts.'.$name);\n\t\t}\n\t\tif ($request->isXmlHttpRequest() && $this->container->hasParameter('oxygen_framework.templating.layouts.light')) {\n\t\t\treturn $this->container->getParameter('oxygen_framework.templating.layouts.light');\n\t\t} elseif ($this->container->hasParameter('oxygen_framework.templating.layouts.full')) {\n\t\t\treturn $this->container->getParameter('oxygen_framework.templating.layouts.full');\n\t\t}\n\t\tthrow new \\Exception(\"Layout undefined in oxygen_framework configuration\");\n\t}", "public function show($slug)\n {\n $page = $this->page->where('slug', $slug)->firstOrFail();\n return $page;\n }", "public function get_layout ( $layout_name )\n {\n $layouts = $this->get_layouts();\n\n if ( isset( $layouts[$layout_name] ) /* @perf array_key_exists( $layout_name, $layouts ) */ )\n {\n return $layouts[ $layout_name ];\n }\n\n throw new \\Exception( 'No layout exists with the name \"' . $layout_name . '\"' );\n }", "function getDiv($slug){\n\tglobal $conn;\n\t// Get single div slug\n\t$div_slug = $_GET['div-slug'];\n\t$sql = \"SELECT * FROM division WHERE slug='$div_slug'\";\n\t$result = mysqli_query($conn, $sql);\n\n\t// fetch query results as associative array.\n\t$divdetails = mysqli_fetch_assoc($result);\n\t/* if ($post) {\n\t\t// get the topic to which this post belongs\n\t\t$post['topic'] = getPostTopic($post['id']);\n\t} */\n\treturn $divdetails;\n}", "function carton_get_template_part( $slug, $name = '' ) {\n\tglobal $carton;\n\t$template = '';\n\n\t// Look in yourtheme/slug-name.php and yourtheme/carton/slug-name.php\n\tif ( $name )\n\t\t$template = locate_template( array ( \"{$slug}-{$name}.php\", \"{$carton->template_url}{$slug}-{$name}.php\" ) );\n\n\t// Get default slug-name.php\n\tif ( !$template && $name && file_exists( $carton->plugin_path() . \"/templates/{$slug}-{$name}.php\" ) )\n\t\t$template = $carton->plugin_path() . \"/templates/{$slug}-{$name}.php\";\n\n\t// If template file doesn't exist, look in yourtheme/slug.php and yourtheme/carton/slug.php\n\tif ( !$template )\n\t\t$template = locate_template( array ( \"{$slug}.php\", \"{$carton->template_url}{$slug}.php\" ) );\n\n\tif ( $template )\n\t\tload_template( $template, false );\n}", "public function getThemeLayouts();", "function klippe_mikado_sidebar_layout() {\n\t\t$sidebar_layout = '';\n\t\t$sidebar_layout_meta = klippe_mikado_get_meta_field_intersect( 'sidebar_layout' );\n\t\t$archive_sidebar_layout = klippe_mikado_options()->getOptionValue( 'archive_sidebar_layout' );\n\t\t$search_sidebar_layout = klippe_mikado_options()->getOptionValue( 'search_page_sidebar_layout' );\n\t\t$single_sidebar_layout = klippe_mikado_get_meta_field_intersect( 'blog_single_sidebar_layout' );\n\t\t\n\t\tif ( ! empty( $sidebar_layout_meta ) ) {\n\t\t\t$sidebar_layout = $sidebar_layout_meta;\n\t\t}\n\t\t\n\t\tif ( is_singular( 'post' ) && ! empty( $single_sidebar_layout ) ) {\n\t\t\t$sidebar_layout = $single_sidebar_layout;\n\t\t}\n\t\t\n\t\tif ( is_search() && ! klippe_mikado_is_woocommerce_shop() && ! empty( $search_sidebar_layout ) ) {\n\t\t\t$sidebar_layout = $search_sidebar_layout;\n\t\t}\n\t\t\n\t\tif ( ( is_archive() || ( is_home() && is_front_page() ) ) && ! klippe_mikado_is_woocommerce_page() && ! empty( $archive_sidebar_layout ) ) {\n\t\t\t$sidebar_layout = $archive_sidebar_layout;\n\t\t}\n\t\t\n\t\treturn apply_filters( 'klippe_mikado_sidebar_layout', $sidebar_layout );\n\t}", "public static function get_layout() {\n\t\tglobal $post;\n\n\t\tif(!defined('WPV_LAYOUT_TYPE')) {\n\t\t\tif(wpv_has_woocommerce()) {\n\t\t\t\t$id_override = is_single() ? $post->ID : (woocommerce_get_page_id( 'shop' ) ? woocommerce_get_page_id( 'shop' ) : null);\n\t\t\t\tif(is_shop() || is_product_category() || is_product_tag()) {\n\t\t\t\t\tdefine('WPV_LAYOUT_TYPE', wpv_post_meta_default('layout-type', 'default-body-layout', $id_override));\n\t\t\t\t\treturn WPV_LAYOUT_TYPE;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(WpvFancyPortfolio::has('page') || is_404() || is_page_template('page-blank.php')) {\n\t\t\t\tdefine('WPV_LAYOUT_TYPE', 'full');\n\t\t\t\tdefine('WPV_LAYOUT', 'no-sidebars');\n\t\t\t\treturn WPV_LAYOUT_TYPE;\n\t\t\t}\n\n\t\t\t$layout_type = '';\n\t\t\tif(is_singular(array('page', 'post', 'portfolio', 'product', 'wpv_sermon', 'tribe_events')) || (wpv_has_woocommerce() && is_woocommerce())) {\n\t\t\t\t$layout_type = wpv_post_meta_default('layout-type', 'default-body-layout');\n\t\t\t} else {\n\t\t\t\t$layout_type = wpv_get_option('default-body-layout');\n\t\t\t}\n\n\t\t\tif(empty($layout_type)) {\n\t\t\t\t$layout_type = 'full';\n\t\t\t}\n\n\t\t\tdefine('WPV_LAYOUT_TYPE', $layout_type);\n\n\t\t\tswitch($layout_type) {\n\t\t\t\tcase 'left-only':\n\t\t\t\t\tdefine('WPV_LAYOUT', 'left-sidebar');\n\t\t\t\tbreak;\n\t\t\t\tcase 'right-only':\n\t\t\t\t\tdefine('WPV_LAYOUT', 'right-sidebar');\n\t\t\t\tbreak;\n\t\t\t\tcase 'left-right':\n\t\t\t\t\tdefine('WPV_LAYOUT', 'two-sidebars');\n\t\t\t\tbreak;\n\t\t\t\tcase 'full':\n\t\t\t\t\tdefine('WPV_LAYOUT', 'no-sidebars');\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\treturn $layout_type;\n\t\t}\n\n\t\treturn WPV_LAYOUT_TYPE;\n\t}", "public function getPage( $slug = null ) \n\t{\n\t\t$page = Page::where( 'slug', $slug );\n\t\t$page = $page->firstOrFail();\n\n return view('pages.templates.default')\n\t\t\t->with( [\n\t\t\t\t'page' => $page,\n\t\t\t] );\n\t}", "function custom_set_single_posts_layout() {\n if (is_single('evento') || is_singular('evento')) {\n return 'content-sidebar';\n }\n \n}", "private function getPage($slug=''){\n if (empty($slug)){\n $slug = array('index');\n }\n\n //try initial path\n $page = APP_ROOT .'/pages/'. rtrim(implode('/', $slug), '/') . '.md';\n if (file_exists($page)){\n return $page;\n }\n $page = APP_ROOT .'/pages/'. rtrim(implode('/', $slug), '/') . '/index.md';\n if (file_exists($page)){\n return $page;\n }\n return false;\n\n }", "public function getMenu()\n {\n if($slug){\n $page = Page::where('slug', $slug)->first();\n return view('page')->with('page', $page);\n }else{\n return view('errors.404');\n }\n \n }", "public function getPage($slug)\n { \n $data = StaticPage::where('page_slug',$slug)->first();\n return $data;\n }", "public function show3($slug)\n {\n $post = Post::whereSlug($slug)->firstOrFail();\n return view('pages.post', compact('post'));\n }", "public function theme_layout( $layout ) {\n\t\tif ( is_module( 'users' ) ) {\n\t\t\t$layout = 'clean';\n\t\t}\n\t\t// In case of admin area.\n\t\telseif ( is_controller( 'admin' ) ) {\n\t\t\treturn 'admin';\n\t\t}\n\n\t\treturn $layout;\n\t}", "public function getSingle($slug) {\n if(App::getLocale() == 'fr') {\n $post = Post::where('slug', '=', $slug)->first();}\n\n if(App::getLocale() == 'en') {\n $post = enPost::where('slug', '=', $slug)->first();}\n\n\n //$post->load('translations');\n\n // return the view ans pass in the post object\n return view('view')->withPost($post);\n }", "public function show($slug) {\n $article = Article::where('url_key', $slug)->first();\n return view('article::show', compact('article'));\n }", "public function show($slug)\n {\n $column = is_numeric($slug) ? 'id' : 'slug';\n\n return Post::where($column, $slug)->firstOrFail();\n }", "public function show($slug) {\n\t\t$article = $this->article->findByKey('slug', $slug, array('user', 'comments'));\n\t\tif ($article) {\n\t\t\treturn view('articles.single', compact('article'));\n\t\t}\n\t\t//404\n\t}", "function ss_get_slug( $id ) {\r\n\tif ( $id==null ) $id=$post->ID;\r\n\t$post_data = get_post( $id, ARRAY_A );\r\n\t$slug = $post_data['post_name'];\r\n\treturn $slug;\r\n}", "function mrseo_elated_sidebar_layout() {\n\t\t$sidebar_layout = '';\n\t\t$sidebar_layout_meta = mrseo_elated_get_meta_field_intersect('sidebar_layout');\n\t\t$archive_sidebar_layout = mrseo_elated_options()->getOptionValue('archive_sidebar_layout');\n\t\t$search_sidebar_layout = mrseo_elated_options()->getOptionValue('search_page_sidebar_layout');\n\t\t$single_sidebar_layout = mrseo_elated_get_meta_field_intersect('blog_single_sidebar_layout');\n\t\t\n\t\tif (!empty($sidebar_layout_meta)) {\n\t\t\t$sidebar_layout = $sidebar_layout_meta;\n\t\t}\n\t\t\n\t\tif (is_singular('post') && !empty($single_sidebar_layout)) {\n\t\t\t$sidebar_layout = $single_sidebar_layout;\n\t\t}\n\t\t\n\t\tif(is_search() && !mrseo_elated_is_woocommerce_shop() && !empty($search_sidebar_layout)) {\n\t\t\t$sidebar_layout = $search_sidebar_layout;\n\t\t}\n\t\t\n\t\tif ((is_archive() || (is_home() && is_front_page())) && !mrseo_elated_is_woocommerce_page() && !empty($archive_sidebar_layout)) {\n\t\t\t$sidebar_layout = $archive_sidebar_layout;\n\t\t}\n\t\t\n\t\tif (is_archive() && mrseo_elated_is_woocommerce_installed()) {\n\t\t\tif (is_product_category() || is_product_tag()) {\n\t\t\t\t$shop_id = get_option('woocommerce_shop_page_id');\n\t\t\t\t$sidebar_layout = mrseo_elated_get_meta_field_intersect('sidebar_layout', $shop_id);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn apply_filters('mrseo_elated_sidebar_layout', $sidebar_layout);\n\t}", "public function getManifest(string $slug);", "public function getView($slug)\n\t{\n\t\t// Get this blog post data\n\t\t$post = $this->post->where('slug', '=', $slug)->first();\n\n\t\t// Check if the blog post exists\n\t\tif (is_null($post))\n\t\t{\n\t\t\t// If we ended up in here, it means that\n\t\t\t// a page or a blog post didn't exist.\n\t\t\t// So, this means that it is time for\n\t\t\t// 404 error page.\n\t\t\treturn App::abort(404);\n\t\t}\n\n\t\t// Get this post comments\n\t\t$comments = $post->comments()->orderBy('created_at', 'ASC')->get();\n\n // Get current user and check permission\n $user = $this->user->currentUser();\n $canComment = false;\n if(!empty($user)) {\n $canComment = $user->can('post_comment');\n }\n\n\t\t// Show the page\n\t\treturn View::make('site/blog/view_post', compact('post', 'comments', 'canComment'));\n\t}", "public function show($slug)\n\t{\n\t\t//GET THE PAGE\n\t\t$data['post'] \t\t\t\t\t= Posts::posts()->where('slug', $slug)->first();\n\t\t$data['post']['categories'] \t= Posts::find($data['post']->id_post)->categories;\n\t\t$data['author'] \t\t\t\t= User::find($data['post']->id_user);\n\n\t\t$this->layout->content \t= View::make('front.'.$this->theme->theme.'.post', $data);\n\t}", "function psa_get_template_part( $slug, $name, $echo = true, $params = array() ) {\n\tglobal $posts, $post, $wp_did_header, $wp_query, $wp_rewrite, $wpdb, $wp_version, $wp, $id, $comment, $user_ID;\n\n\tdo_action( \"get_template_part_{$slug}\", $slug, $name );\n\n\t$templates = array();\n\tif ( isset( $name ) ) {\n\t\t$templates[] = \"{$slug}/{$name}.php\";\n\t\t$templates[] = \"{$slug}-{$name}.php\";\n\t}\n\t$templates[] = \"{$slug}.php\";\n\n\t$template_file = locate_template( $templates, false, false );\n\n\t// Add query vars and params to scope\n\tif ( is_array( $wp_query->query_vars ) ) {\n\t\textract( $wp_query->query_vars, EXTR_SKIP );\n\t}\n\textract( $params, EXTR_SKIP );\n\n\t// Buffer output and return if echo is false\n\tif( !$echo ) ob_start();\n\trequire( $template_file );\n\tif( !$echo ) return ob_get_clean();\n}", "protected function getLayout()\n {\n return $this->layout;\n }", "protected function getLayout()\n {\n return $this->layout;\n }", "public function show($slug) {\n\n // post = \\DB::table('posts')->where('slug', $slug)->first(); \\ required if not imported at the top\n // $post = DB::table('posts')->where('slug', $slug)->first();\n\n // firstOrFail: return first post that matches or throw an error creating a model not found exception returning a 404\n $post = Post::where('slug', $slug)->firstOrFail(); \n\n return view('post', [\n 'post' => $post\n ]);\n\n }", "public function getBySlug(string $slug);", "public function show($id)\n {\n return May::where('slug', $id)->first();\n }", "public function index($slug = null) {\n $this->viewBuilder()->layout('default');\n $mData = $this->Contents->find()->where(['Contents.page_slug' => $slug])->first()->toArray();\n //pr($mData); exit;\n \n $pageSeo['site_meta_title'] = $mData['meta_title'];\n $pageSeo['site_meta_description'] = $mData['meta_description'];\n $pageSeo['site_meta_key'] = $mData['meta_key']; \n \n \n $this->set(compact('mData','pageSeo')); \n $this->render($slug);\n }", "public function getSingle($slug)\n {\n // fetch from db based on slug\n $event = Event::where('slug', '=', $slug)->where('status', '=', 1)->firstOrFail();\n $comments = $event->comments()->paginate(4);\n $threeRecentEvent = Event::orderBy('created_at', 'desc')->where('status', '=', 1)->take(3)->get();\n //$comment = $event->comment->paginate(15);\n\n // return the view and pass in the post object\n return view('event')\n ->withEvent($event)\n ->withComments($comments)\n ->withThreeRecentEvent($threeRecentEvent);\n }", "public function show($slug)\n {\n // Retrieving models\n $site_infos = SiteInfo::first();\n $google_analytic = GoogleAnalytic::first();\n $breadcrumb = Breadcrumbs::first();\n $color_picker = ColorPicker::first();\n $social_media = Social::all();\n\n $blog = Blog::where('blogs.slug', '=', $slug)\n ->firstOrFail();\n\n // Update view column\n Blog::find($blog->id)->update(\n ['view' => $blog->view + 1]\n );\n $blog_categories = Blog::select(DB::raw('count(*) as category_count, category_id'))\n ->groupBy('category_id')\n ->get();\n $recent_posts = Blog::join(\"categories\",'categories.id', '=', 'blogs.category_id')\n ->where('categories.status',1)\n ->orderBy('blogs.id', 'desc')\n ->take(3)\n ->get();\n $comments = Comment::where('blog_id', '=', $blog->id)->where('approval', '=', 1)->get();\n $other_sections = OtherSection::all();\n\n // For Section Enable/Disable\n foreach ($other_sections as $other_section) {\n $section_arr[$other_section->section] = $other_section->status;\n }\n\n return view('frontend.blog-page.show', compact('site_infos', 'google_analytic', 'breadcrumb', 'color_picker',\n 'social_media', 'blog', 'blog_categories', 'recent_posts', 'comments', 'section_arr'));\n }", "function voyage_mikado_get_blog_single() {\n $sidebar = voyage_mikado_sidebar_layout();\n $single_template = voyage_mikado_options()->getOptionValue('blog_single_type');\n\n if ($single_template == ''){\n \t$single_template = 'standard';\n }\n\n $params = array(\n \"sidebar\" => $sidebar,\n \"single_template\" => 'mkdf-blog-'.$single_template\n );\n\n voyage_mikado_get_module_template_part('templates/single/holder', 'blog', '', $params);\n }", "public function getLayouts(){\n\n $defaultTheme = env('THEME', 'default');\n $path = app_path() . \"/../resources/views/themes/$defaultTheme/\";\n $layoutPath = $path . \"layouts\";\n $metaFilePath = $path . \"$defaultTheme.json\";\n try{\n $validator = file_exists($metaFilePath) && is_dir($layoutPath);\n if ($validator){\n\n // Read layouts\n $layouts = [];\n if ($dh = opendir($layoutPath)){\n while (($file = readdir($dh)) !== false){\n $filePath = $layoutPath . '/' . $file; \n if ($file == '.' || $file == '..') {\n continue;\n }\n $content = file_get_contents($filePath);\n $info = $this->extractInfo($content);\n $layouts[] = [\n 'name' => $file,\n 'info' => isset($info[1]) ? json_decode($info[1], true) : null\n ];\n }\n closedir($dh);\n }\n return $layouts;\n }\n else{\n return [];\n }\n }\n catch (\\Exception $e){ \n return [];\n }\n }", "protected function getComponentId(): string {\n if ($this->isPageTemplate()) {\n return \"{$this->layout}-{$this->post->post_type}\";\n }\n\n if (str_contains($this->layout, '-')) {\n return implode('-', \\__::chain($this->layout)\n ->split('-')\n ->map(fn ($string) => \\__::lowerCase($string))\n ->value());\n }\n\n return \\__::lowerCase($this->layout);\n }", "protected function _get_layout($layout_name)\n {\n $filename = $layout_name . '.html';\n $content = '';\n $configStr = '';\n $handle = @fopen(\"$this->layout_folder/$filename\", \"r\");\n if ($handle) {\n $cnt = 0;\n while (($buffer = fgets($handle, 4096)) !== false) {\n if (false !== strpos($buffer, '---')){\n ++$cnt;\n if ($cnt > 1)\n break;\n }\n $configStr .= $buffer;\n }\n\n while (($buffer = fgets($handle, 4096)) !== false) {\n $content .= $buffer;\n }\n\n if (!feof($handle)) {\n echo \"Error: unexpected fgets() fail\\n\";\n }\n fclose($handle);\n }\n\n if ($content == \"\") {\n $content = $configStr;\n $configStr = \"\";\n }\n $config = Spyc::YAMLLoadString($configStr);\n $config['content'] = $content;\n return $config;\n }", "function getLayout() {return $this->readLayout();}", "function my_church_timetable_single_event_layout($cmsmasters_layout) {\r\n\tif (is_singular('events')) {\r\n\t\t$cmsmasters_layout = 'fullwidth';\r\n\t}\r\n\t\r\n\t\r\n\treturn $cmsmasters_layout;\r\n}", "public function getBySlug()\n {\n }", "public function getTemplateSlug(): string;", "function wp6tools_get_template_part( $slug, $name = '' ) {\n \n $tpl_path = SIXTOOLS_DIR . '/templates/wp6tools_' . $slug . '-' . $name . '.php';\n \n if(file_exists( $tpl_path ))\n load_template( $tpl_path );\n else\n get_template_part($slug);\n}", "static function get_post_by_slug($slug){\n\t\treturn self::$db->where('slug',$slug)->get('blog')->row();\n\t}", "public function view($slug) {\n $post = Post::with('user')\n ->where([\n ['slug','=', $slug],\n ['published_at', '<', Carbon::now()]\n ])\n ->firstOrFail();\n \n return view('blog.view')->with('post', $post);\n }", "public function getTemplatePart($slug, $name = null)\n {\n \\get_template_part('templates/template-parts/' . $slug, $name);\n }", "public function blogpostActionGet($slug) : object\n {\n $page = $this->app->page;\n $title = \"BlogPost: ${slug}\";\n $db = $this->app->db;\n $filter = new MyTextFilter();\n\n $db->connect();\n $sql = <<<EOD\nSELECT\n *,\n DATE_FORMAT(COALESCE(updated, published), '%Y-%m-%dT%TZ') AS published_iso8601,\n DATE_FORMAT(COALESCE(updated, published), '%Y-%m-%d') AS published\nFROM content\nWHERE \n slug = ?\n AND type = ?\n AND (deleted IS NULL OR deleted > NOW())\n AND published <= NOW()\nORDER BY published DESC\n;\nEOD;\n $content = $db->executeFetch($sql, [$slug, \"post\"]);\n if (!($content)) {\n $page->add(\"cms/404\");\n } elseif ($content->filter) {\n $text = $content->data;\n $filters = explode(\",\", $content->filter);\n $filteredText = $filter->parse($text, $filters);\n $content->data = $filteredText;\n }\n $page->add(\"cms/blogpost\", [\n \"content\" => $content\n ]);\n return $page->render([\n \"title\" => $title\n ]);\n }", "public function layout() {\n return $this->layout;\n }", "public function show($idOrSlug)\n {\n if (ctype_digit($idOrSlug)) {\n $page = Page::where('id', $idOrSlug)->firstOrFail();\n } else {\n $page = Page::where('slug', $idOrSlug)->firstOrFail();\n }\n\t MetaTag::set('title', $page->name);\n\t MetaTag::set('description', $page->description);\n\t MetaTag::set('image', asset($page->hasThumbnail() ? asset('storage/uploads/media/page/' . $page->thumbnail()->filename) : ''));\n return view('blog.page.index', compact('page'));\n }", "public function all_layouts() {\n\t\t// Globals\n\t\tglobal $wpdb;\n\t\t\n\t\t// Load the layouts from the database as an array\n\t\t$sql = \"SELECT * FROM `\" . rpids_tableprefix() . \"rpids_layouts` ORDER BY `name` ASC;\";\n\t\t$sqlret = $wpdb->get_results( $sql, ARRAY_A );\n\t\t\n\t\t// Create the return object\n\t\t$return = new StdClass();\n\t\t\n\t\t// Loop through each layout\n\t\tforeach( $sqlret as $layout ) {\n\t\t\t// Add the screen info to the return object\n\t\t\t$return->$layout['id'] = new StdClass();\n\t\t\t$return->$layout['id']->name = $layout['name'];\n\t\t\t$return->$layout['id']->id = $layout['id'];\n\t\t}\n\t\treturn $return;\n\t}", "public static function getPracticeAreaBasedonSlug($websitId, $SlugTitle){\n $sql = Doctrine_Query::create()\n ->from('WebsitePracticeArea w')\n ->where('w.WebsiteId = ?', $websitId)\n ->andWhere('w.Slug = ?', $SlugTitle);\n $result = $sql->fetchArray();\n #clsCommon::pr($returnHome, 1);\n $sql->free();\n return $result[0]['Id'];\n\n }", "public function getLayout(){\n\n return $this->layout;\n\n }", "function get_id_from_blogname($slug)\n {\n }", "function medigroup_mikado_get_blog_single() {\n $sidebar = medigroup_mikado_sidebar_layout();\n\n $params = array(\n \"sidebar\" => $sidebar,\n \"single_template\" => 'mkd-blog-standard'\n );\n\n medigroup_mikado_get_module_template_part('templates/single/holder', 'blog', '', $params);\n }", "public function show($slug)\n {\n // $post=Post::where('slug',$slug)->firstOrFail();\n\n\n //forma de hacerlo in-line\n return view('post', ['post' => Post::where('slug', $slug)->firstOrFail()]\n );\n }", "public function show($slug,$id)\n {\n // $material = Material::find($id);\n\n // if(!$material)\n // App::abort(404);\n\n // return 'showing '.$material->nome; \n }" ]
[ "0.63985", "0.6339494", "0.6308496", "0.6254587", "0.6122208", "0.6072583", "0.6004632", "0.5933843", "0.5924246", "0.589248", "0.58846366", "0.5828512", "0.5801484", "0.57628727", "0.5731636", "0.5721796", "0.57142305", "0.57123977", "0.5711441", "0.5699014", "0.5693212", "0.56849986", "0.56759065", "0.5670702", "0.5654186", "0.56289256", "0.56255734", "0.56161505", "0.5579828", "0.5565766", "0.55646217", "0.5529514", "0.5519286", "0.5517327", "0.55017257", "0.5501538", "0.5501266", "0.5497947", "0.5494522", "0.54717636", "0.5471474", "0.5470469", "0.54700583", "0.5462937", "0.5461517", "0.5460108", "0.54539293", "0.54448897", "0.5436653", "0.542993", "0.5428056", "0.5425104", "0.54244083", "0.5423623", "0.54235435", "0.5401528", "0.5390291", "0.53884745", "0.5379627", "0.53735346", "0.5370548", "0.5344079", "0.53371537", "0.5331501", "0.53283095", "0.53214216", "0.53172773", "0.5313057", "0.5306314", "0.528566", "0.5279882", "0.5279882", "0.52694243", "0.5268447", "0.52671224", "0.52669287", "0.52661765", "0.5248124", "0.52474666", "0.524657", "0.5240245", "0.5224432", "0.52136", "0.5199286", "0.51943815", "0.5192198", "0.5188741", "0.5188318", "0.5186929", "0.51823586", "0.5181823", "0.5176243", "0.5174512", "0.5174297", "0.51742065", "0.5172755", "0.517071", "0.5169675", "0.5166501", "0.5165304" ]
0.6854128
0
Checks whether we have a specific, ready made layout for a slug
public function has_theme_layout ($layout_slug='') { $layout = $this->get_theme_layout($layout_slug); return !empty($layout); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasLayout() {}", "protected function isPageTemplate(): bool {\n return (\n $this->layout === 'single' || \n $this->layout === 'archive'\n );\n }", "function hasLayout() ;", "public function layout_exists( $layout ) {\n // If there is a theme, check it exists in there\n if ( !empty( $this->_theme ) AND in_array( $layout, self::get_theme_layouts() ) ) {\n return TRUE;\n }\n\n // Otherwise look in the normal places\n return file_exists( self::_find_view_folder() . 'layouts/' . $layout . self::_ext( $layout ) );\n }", "public function exists()\n {\n return file_exists($this->path('layout.php'));\n }", "function isPage( $slug ) {\n // Get all page summaries (the smallest sets of data about posts)\n $pages = $this->getAll();\n // Return boolean if a page exists with this slug.\n return !empty( $pages[$slug] );\n }", "function voyage_mikado_is_masonry_template() {\n\n $page_id = voyage_mikado_get_page_id();\n $page_template = get_page_template_slug($page_id);\n $page_options_template = voyage_mikado_options()->getOptionValue('blog_list_type');\n\n if(!is_archive()) {\n if($page_template == 'blog-masonry.php' || $page_template == 'blog-masonry-full-width.php') {\n return true;\n }\n } elseif(is_archive() || is_home()) {\n if($page_options_template == 'masonry' || $page_options_template == 'masonry-full-width') {\n return true;\n }\n } else {\n return false;\n }\n }", "function medigroup_mikado_is_masonry_template() {\n\n $page_id = medigroup_mikado_get_page_id();\n $page_template = get_page_template_slug($page_id);\n $page_options_template = medigroup_mikado_options()->getOptionValue('blog_list_type');\n\n if(!is_archive()) {\n if($page_template == 'blog-masonry.php' || $page_template == 'blog-masonry-full-width.php') {\n return true;\n }\n } elseif(is_archive() || is_home()) {\n if($page_options_template == 'masonry' || $page_options_template == 'masonry-full-width') {\n return true;\n }\n } else {\n return false;\n }\n }", "protected function isLayoutExistsByName($name, $layoutType){\n\t\t\n\t\t$isExists = UniteFunctionsWPUC::isPostNameExists($name);\n\t\t\n\t\treturn($isExists);\n\t}", "public function has_reserved_slug() {\n\t\t$reserved_slugs = array(\n\t\t\t// Reserve \"twenty\" names for wordpressdotorg.\n\t\t\t'twentyten', 'twentyeleven', 'twentytwelve','twentythirteen', 'twentyfourteen', 'twentyfifteen',\n\t\t\t'twentysixteen', 'twentyseventeen','twentyeighteen', 'twentynineteen', 'twentytwenty',\n\t\t\t'twentytwentyone', 'twentytwentytwo', 'twentytwentythree', 'twentytwentyfour', 'twentytwentyfive',\n\t\t\t'twentytwentysix', 'twentytwentyseven', 'twentytwentyeight', 'twentytwentynine', 'twentythirty',\n\n\t\t\t// Theme Showcase URL parameters.\n\t\t\t'browse', 'tag', 'search', 'filter', 'upload', 'commercial',\n\t\t\t'featured', 'popular', 'new', 'updated',\n\t\t);\n\n\t\t// If it's not a reserved slug, they can have it.\n\t\tif ( ! in_array( $this->theme_slug, $reserved_slugs, true ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// WordPress.org user is always allowed to upload reserved slugs.\n\t\tif ( 'wordpressdotorg' === $this->author->user_login ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Slug is reserved, user is not authorized.\n\t\treturn true;\n\t}", "public function isLayoutExistsByTitle($title, $layoutType = null){\n\t\t\n\t\t$isExists = UniteFunctionsWPUC::isPostExistsByTitle($title);\n\t\t\n\t\treturn($isExists);\n\t}", "protected function isLayoutExistsByTitle($title, $layoutType){\n\t\t\n\t\t$isExists = UniteFunctionsWPUC::isPostExistsByTitle($title);\n\t\t\n\t\treturn($isExists);\n\t}", "function custom_theme_is_view_with_layout_option()\n{\n // This option is available on all pages. It's also available on archives when there isn't a sidebar.\n return (is_page() || (is_archive() && ! is_active_sidebar('sidebar-1')));\n}", "private function style_matches_slug( $slug ) {\n\t\treturn ( $slug === $this->slplus->SmartOptions->style->value );\n\t}", "function custom_theme_sanitize_page_layout($input)\n{\n $valid = array(\n 'one-column' => __('One Column', 'theme'),\n 'two-column' => __('Two Column', 'theme'),\n );\n\n if (array_key_exists($input, $valid)) {\n return $input;\n }\n\n return '';\n}", "public function is_layout ()\n {\n return is_a( $this, __NAMESPACE__ . '\\\\Layout' );\n }", "function layout_first()\n { \n foreach (func_get_args() as $name) {\n if(! empty($name) && $layout = the_layout($name)) {\n return $layout;\n }\n } \n\n $error = 'Not Found Layout(s) '. collect(func_get_args())->filter()->implode(', ') . '.';\n\n return abort(500, $error);\n }", "private function layoutExists($file) {\n\t\treturn file_exists($this->getLayoutFile($file));\n\t}", "function cinerama_edge_dashboard_page() {\n\t\treturn is_page_template('user-dashboard.php');\n\t}", "public function validSlug($slug){\n $course = Course::where('slug', $slug)->first();\n if($course):\n return false;\n else:\n return true;\n endif; \n }", "public function get_theme_layout ($layout_slug='') {\r\n\t\tif (empty($layout_slug)) return '';\r\n\r\n\t\t$filenames = array(\r\n\t\t\t'layouts/index-' . $layout_slug . '.php',\r\n\t\t\t'layouts/' . $layout_slug . '.php',\r\n\t\t);\r\n\t\treturn function_exists('upfront_locate_template')\r\n\t\t\t? upfront_locate_template($filenames)\r\n\t\t\t: locate_template($filenames)\r\n\t\t;\r\n\t}", "public function checkNewPostLayoutContent(){\n\t\t\n\t\t$this->validateInited();\n\t\t\t\t\n\t\t//check meta data\n\t\tif(!empty($this->metaData))\n\t\t\treturn(false);\n\t\t\n\t\t//get post content\n\t\t$postContent = $this->post->post_content;\n\t\t$postContent = trim($postContent);\n\t\t\n\t\tif(empty($postContent))\n\t\t\treturn(false);\n\t\t\t\n\t\t//generate addon data\n\t\t$arrAddonContent = $this->generateHtmlAddonContentForLayout($postContent);\n\t\tif(empty($arrAddonContent))\n\t\t\treturn(false);\n\t\t\n\t\t//add row to empty layout with the addon data\n\t\t$this->addRowWithHtmlAddon($arrAddonContent);\n\t\t\n\t}", "public function isOnepage()\r\n {\r\n if($this->_params['layout'] != 'onepage'){\r\n return false;\r\n }\r\n return true;\r\n }", "private function slug_exists($slug)\n\t\t{\n\t\t\t$where = '@slug=\"'.utf8_encode($slug).'\"';\n\t\t\t$node = $this->xml->xpath('/post/friendly/url['.$where.']');\n\n\t\t\tif($node==array())\n\t\t\t\treturn false;\n\n\t\t\treturn true;\n\t\t}", "function _layout_builder_bundle_has_no_layouts($entity_type_id, $bundle) {\n $entity_update_manager = \\Drupal::entityDefinitionUpdateManager();\n $entity_type = $entity_update_manager->getEntityType($entity_type_id);\n $bundle_key = $entity_type->getKey('bundle');\n $query = \\Drupal::entityTypeManager()->getStorage($entity_type_id)->getQuery();\n if ($bundle_key) {\n $query->condition($bundle_key, $bundle);\n }\n if ($entity_type->isRevisionable()) {\n $query->allRevisions();\n }\n $query->exists(OverridesSectionStorage::FIELD_NAME)\n ->accessCheck(FALSE)\n ->range(0, 1);\n $results = $query->execute();\n return empty($results);\n}", "public function is_on_dashboard() {\n return ($this->page->pagelayout == 'mydashboard');\n }", "function condition() {\n\t\treturn ! empty( $_GET['page'] ) && $this->args['page_slug'] === $_GET['page']; // Input var okay.\n\t}", "public static function should_enqueue_masonry() {\n\t\tif ( self::is_blog() === false ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$hestia_alternative_blog_layout = get_theme_mod( 'hestia_alternative_blog_layout', 'blog_normal_layout' );\n\t\tif ( $hestia_alternative_blog_layout !== 'blog_alternative_layout2' ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$hestia_grid_layout = get_theme_mod( 'hestia_grid_layout', 1 );\n\t\tif ( $hestia_grid_layout === 1 ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn get_theme_mod( 'hestia_enable_masonry', false );\n\t}", "public function is_on_page_with_description() {\n return ($this->page->pagelayout == 'pagewithdescription');\n }", "public function hasSlug($slug);", "private function has_postname_in_permalink() {\n\t\treturn ( strpos( get_option( 'permalink_structure' ), '%postname%' ) !== false );\n\t}", "public function autoLayout() \n {\n $path = 'layouts/'.$_SESSION['language'].'/'.$this->params['controller_id'].'.php';\n\n if (file_exists($path))\n {\n return $path;\n }\n else \n {\n $path = 'layouts/polyglot/'.$this->params['controller_id'].'.php';\n\n if (file_exists($path))\n {\n return $path;\n }\n else\n {\n return false;\n }\n }\n\t}", "public function is_needed() {\n\t\treturn is_singular( PostType::get_instance()->get_post_type() );\n\t}", "private function check_section() {\n $cond = NULL;\n if($this->type_post != 'add') {\n $cond = \"AND sec_id != {$this->get_id}\";\n }\n $ch = $this->select(\"*\", \"jops_sections\", \"WHERE sec_unique = ? {$cond}\");\n $ch->execute(array($this->unique));\n $info = $ch->rowCount();\n if($info > 0) {\n return true;\n }\n return false;\n }", "function condition() {\n\t\treturn ! empty( $_GET['page'] ) && $this->page_slug === $_GET['page']; // Input var okay.\n\t}", "function LocationUsesLayout($layout_id){\n\t//Building the query\n\t$stringBuilder = \"SELECT COUNT(location_id) \";\n\t$stringBuilder .= \"FROM location \";\n\t$stringBuilder .= \"WHERE layout_id=? \";\t\n\n\t// Preparing query\n\t$query = GetDatabaseConnection()->prepare($stringBuilder);\n\t$query->execute(array($layout_id)); //Putting in the parameters\n\t$result = $query->fetchAll(); //Fetching it\n\n\tif($result[0][0] > 0){\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "function is_main_blog()\n {\n }", "private function SlugExists($slug = '')\n\t{\t$sql = 'SELECT pageid FROM pages WHERE pagename=\"' . $slug . '\"';\n\t\tif ($this->id)\n\t\t{\t$sql .= ' AND NOT pageid=' . $this->id;\n\t\t}\n\t\tif ($result = $this->db->Query($sql))\n\t\t{\tif ($row = $this->db->FetchArray($result))\n\t\t\t{\treturn $row['pageid'];\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function hasTemplate() {\n return $this->intendedTemplate() == $this->template();\n }", "function eazy_check_page_exists($page_slug) {\n $page = get_page_by_path( $page_slug , OBJECT );\n\n if ( isset($page) ) :\n return true;\n else:\n return false;\n endif;\n}", "function has_landing_page() {\n\n\tif ( is_archive() || is_tax() || is_category() || is_tag()) {\n\n\t\tif ( is_date() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$page = get_landing_page();\n\n\t\tif ($page) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\n\treturn false;\n}", "private function getValidSlug($inputSlug)\n {\n $validSlug = false;\n $i = 0;\n do {\n $inputSlug .= $i;\n $sql = \"SELECT COUNT(*) AS count FROM content WHERE slug = ?\";\n $res = $this->db->executeFetchAll($sql, [$inputSlug]);\n //print_r($count);\n $validSlug = ($res[0]->count == 0) ? true : false;\n } while (!$validSlug);\n return $inputSlug;\n }", "function check_plugin_mainscreen_name()\r\r\n{\r\r\n $screen = get_current_screen();\r\r\n if (is_object($screen) && $screen->id == 'toplevel_page_oneclick-google-map') {\r\r\n return true;\r\r\n }\r\r\n else {\r\r\n return false;\r\r\n }\r\r\n}", "static function is_requested_post_type()\n {\n $retval = FALSE;\n $screen = get_current_screen();\n foreach (self::get_instance()->get_all() as $slug => $properties) {\n // Are we rendering a NGG post type?\n if (isset($properties['post_type']) && $screen->post_type == $properties['post_type']) {\n $retval = $slug;\n break;\n }\n }\n return $retval;\n }", "public function isOnRoute(): bool\n {\n $lang = $this->grav['language']->getActive();\n\n $path = $this->grav['uri']->rootUrl() ?: '/';\n $routes = $this->config->get('plugins.' . $this->name . '.routes');\n\n foreach ($routes as $route) {\n ['blog' => $blog, 'items' => $items] = $route;\n if ($path === $blog || str_starts_with($path, $items)) {\n if ($lang) {\n $route['blog'] = '/' . $lang . $route['blog'];\n $route['items'] = '/' . $lang . $route['items'];\n }\n $this->routes = $route;\n\n return true;\n }\n }\n\n return false;\n }", "static function is_requested_page()\n {\n $retval = FALSE;\n // First, check the screen for the \"ngg\" property. This is how ngglegacy pages register themselves\n $screen = get_current_screen();\n if (property_exists($screen, 'ngg') && $screen->ngg) {\n $retval = $screen->id;\n } else {\n foreach (self::get_instance()->get_all() as $slug => $properties) {\n // Are we rendering a NGG added page?\n if (isset($properties['hook_suffix'])) {\n $hook_suffix = $properties['hook_suffix'];\n if (did_action(\"load-{$hook_suffix}\")) {\n $retval = $slug;\n break;\n }\n }\n }\n }\n return $retval;\n }", "function mai_get_layout( $layout ) {\n\tremove_filter( 'genesis_pre_get_option_site_layout', 'genesiswooc_archive_layout' );\n\n\t// Setup cache.\n\tstatic $layout_cache = '';\n\n\t// If cache is populated, return value.\n\tif ( '' !== $layout_cache ) {\n\t\treturn esc_attr( $layout_cache );\n\t}\n\n\t$site_layout = '';\n\n\tglobal $wp_query;\n\n\t// If home page.\n\tif ( is_home() ) {\n\t\t$site_layout = genesis_get_custom_field( '_genesis_layout', get_option( 'page_for_posts' ) );\n\t\tif ( ! $site_layout ) {\n\t\t\t$site_layout = genesis_get_option( 'layout_archive' );\n\t\t}\n\t}\n\n\t// If viewing a singular page, post, or CPT.\n\telseif ( is_singular() ) {\n\t\t$site_layout = genesis_get_custom_field( '_genesis_layout', get_the_ID() );\n\t\tif ( ! $site_layout ) {\n\t\t\t$site_layout = genesis_get_option( sprintf( 'layout_%s', get_post_type() ) );\n\t\t}\n\t}\n\n\t// If viewing a post taxonomy archive.\n\telseif ( is_category() || is_tag() || is_tax( get_object_taxonomies( 'post', 'names' ) ) ) {\n\t\t$term = $wp_query->get_queried_object();\n\t\t$site_layout = $term ? get_term_meta( $term->term_id, 'layout', true) : '';\n\t\t$site_layout = $site_layout ? $site_layout : genesis_get_option( 'layout_archive' );\n\t}\n\n\t// If viewing a custom taxonomy archive.\n\telseif ( is_tax() ) {\n\t\t$term = $wp_query->get_queried_object();\n\t\t$site_layout = $term ? get_term_meta( $term->term_id, 'layout', true) : '';\n\t\tif ( ! $site_layout ) {\n\t\t\t$tax = get_taxonomy( $wp_query->get_queried_object()->taxonomy );\n\t\t\tif ( $tax ) {\n\t\t\t\t/**\n\t\t\t\t * If we have a tax, get the first one.\n\t\t\t\t * Changed to reset() when hit an error on a term archive that object_type array didn't start with [0]\n\t\t\t\t */\n\t\t\t\t$post_type = reset( $tax->object_type );\n\t\t\t\t// If we have a post type and it supports genesis-cpt-archive-settings\n\t\t\t\tif ( post_type_exists( $post_type ) && genesis_has_post_type_archive_support( $post_type ) ) {\n\t\t\t\t\t// $site_layout = genesis_get_option( sprintf( 'layout_archive_%s', $post_type ) );\n\t\t\t\t\t$site_layout = genesis_get_cpt_option( 'layout', $post_type );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$site_layout = $site_layout ? $site_layout : genesis_get_option( 'layout_archive' );\n\t}\n\n\t// If viewing a supported post type.\n\t// elseif ( is_post_type_archive() && genesis_has_post_type_archive_support() ) {\n\telseif ( is_post_type_archive() ) {\n\t\t// $site_layout = genesis_get_option( sprintf( 'layout_archive_%s', get_post_type() ) );\n\t\t$site_layout = genesis_get_cpt_option( 'layout', get_post_type() );\n\t\t$site_layout = $site_layout ? $site_layout : genesis_get_option( 'layout_archive' );\n\t}\n\n\t// If viewing an author archive.\n\telseif ( is_author() ) {\n\t\t$site_layout = get_the_author_meta( 'layout', (int) get_query_var( 'author' ) );\n\t\t$site_layout = $site_layout ? $site_layout : genesis_get_option( 'layout_archive' );\n\t}\n\n\t// Pull the theme option.\n\tif ( ! $site_layout ) {\n\t\t$site_layout = genesis_get_option( 'site_layout' );\n\t}\n\n\t// Use default layout as a fallback, if necessary.\n\tif ( ! genesis_get_layout( $site_layout ) ) {\n\t\t$site_layout = genesis_get_default_layout();\n\t}\n\t// Push layout into cache.\n\t$layout_cache = $site_layout;\n\n\t// Return site layout.\n\treturn esc_attr( $site_layout );\n\n}", "function wpcom_vip_is_main_feed_requested() {\n\t$toMatch = '#^/(wp-(rdf|rss|rss2|atom|rssfeed).php|index.xml|feed|rss)/?$#i';\n\t$request = $_SERVER['REQUEST_URI'];\n\treturn (bool) preg_match( $toMatch, $request );\n}", "public function checkSiteSlug($slug\t= null)\n\t{\n\n\t\t## get slug from param or named request (if null param)\n\t\t$slug\t= !$slug?reqs::named(\"site-slug\"):$slug;\n\t\t$slug\t= trim($slug);\n\n\t\t## query.\n\t\t$result\t= db::from(\"site\")->where(\"siteSlug\",$slug)->get()->result();\t\n\t\treturn !$result?false:true;\n\t}", "function my_church_timetable_single_event_layout($cmsmasters_layout) {\r\n\tif (is_singular('events')) {\r\n\t\t$cmsmasters_layout = 'fullwidth';\r\n\t}\r\n\t\r\n\t\r\n\treturn $cmsmasters_layout;\r\n}", "function get_where_used( $layout_id, $slug = false, $group = false, $posts_per_page = -1 )\n\t{\n\t\t$layout = $this->get_layout_from_id( $layout_id );\n\n\t\tif( is_object( $layout ) === false && method_exists($layout,'get_post_slug') === false ) return;\n\n\t\t$args = array(\n\t\t\t'posts_per_page' => $posts_per_page,\n\t\t\t'post_type' => 'any',\n\t\t\t'meta_query' => array (\n\t\t\t\tarray (\n\t\t\t\t\t'key' => '_layouts_template',\n\t\t\t\t\t'value' => $slug ? $slug : $layout->get_post_slug(),\n\t\t\t\t\t'compare' => '=',\n\t\t\t\t)\n\t\t\t) );\n\n\t\t$new_query = new WP_Query( $args );\n\n if( $group === true )\n {\n add_filter('posts_orderby', array(&$this, 'order_by_post_type'), 10, 2);\n $new_query->group_posts_by_type = $group;\n }\n\n\t\t$posts = $new_query->get_posts();\n\n\t\treturn $posts;\n\t}", "function custom_set_single_posts_layout() {\n if (is_single('evento') || is_singular('evento')) {\n return 'content-sidebar';\n }\n \n}", "function custom_set_single_posts_layout() {\n if (is_single('post') || is_singular('post')) {\n return 'content-sidebar';\n }\n \n}", "protected\n function needsScaffolding($template)\n {\n return str_contains($template, 'scaffold');\n }", "function isPageLayoutMobile( $templateFileName )\n{\n\treturn false;\n}", "function flatsome_archive_title(){\n if(flatsome_option('blog_archive_title') && (is_archive() || is_search())){\n echo get_template_part( 'template-parts/posts/partials/archive-title');\n }\n}", "public\tfunction\tpanel($slug) {\n\t\t\t//Declare variables.\n\t\t\t$panel\t=\tsprintf(\"%s/panels/%s.php\", dirname(__FILE__), $slug);\n\t\t\t$uniqid\t=\tuniqid(true);\n\t\t\t\n\t\t\t//If the panel does not exist. \n\t\t\tif (!file_exists($panel)) {\n\t\t\t\t//Return false.\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\t//Include the panel.\n\t\t\t\tinclude_once($panel);\n\t\t\t}\n\t\t}", "function ts_check_if_sidebar( )\r\n{\r\n\t$single_post_sidebar_position = ts_get_single_post_sidebar_position();\r\n\tif ($single_post_sidebar_position == 'no')\r\n\t{\r\n\t\treturn false;\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn true;\r\n\t}\r\n}", "function check_collection_landing() {\n $keys = array('medium', 'time', 'tag', 'source');\n foreach ($keys as $key) {\n if ('' != get_query_var( $key ) ) {\n return False;\n }\n }\n return True;\n }", "function rssmi_is_plugin_page() {\n\t$screen = get_current_screen();\n\tif ( ( isset( $_GET['post_type'] ) ) && ( strpos( $_GET['post_type'], 'rssmi_feed', 0 ) !== false ) || ( isset( $_GET['page'] ) ) && ( ( strpos( $_GET['page'], 'wprssmi', 0 ) !== false ) || ( strpos( $_GET['page'], 'wprssmi', 0 ) !== false ) || ( strpos( $_GET['page'], 'wprssmi_options', 0 ) !== false ) || ( strpos( $_GET['page'], 'wprssmi_options2', 0 ) !== false ) || ( strpos( $_GET['page'], 'wprssmi_options3', 0 ) !== false ) || ( strpos( $_GET['page'], 'wprssmi_options4', 0 ) !== false ) || ( strpos( $_GET['page'], 'wprssmi_options9', 0 ) !== false ) || ( isset( $_GET['post_type'] ) ) && ( strpos( $_GET['post_type'], 'rssmi_feed_item', 0 ) !== false ) || ( strpos( $_GET['page'], 'wprssmi_options5', 0 ) !== false ) || ( strpos( $_GET['page'], 'wprssmi_options8', 0 ) !== false ) || ( strpos( $_GET['page'], 'wprssmi_options7', 0 ) !== false ) ) ) {\n\t\t$msg = 1;\n\t}\n\telse {\n\t\t$msg = 0;\n\t}\n\n\treturn $msg;\n}", "public function valid() {\n\t\tif( ! defined( 'WPV_VERSION' ) )\n\t\t\treturn false;\n\n\t\t// opposite of parent \"Views exists\"\n\t\treturn ! parent::valid();\n\t}", "public function hasLocalizedSlug()\n {\n if ($this->hasLocalizedSlug !== null) {\n return $this->hasLocalizedSlug;\n }\n\n if ( !($slugcolumn = $this->getProperty('sluggable'))) {\n return;\n }\n\n return $this->hasLocalizedSlug = $this->hasFieldParam($slugcolumn, 'locale', true);\n }", "protected function findLayout($action)\n {\n foreach ($this->layouts as $layout => $actions) {\n if (in_array($action, $actions, true)) {\n return $layout;\n }\n }\n return false;\n }", "public function is_parent_available() {\n\t\t$parent = get_posts( array(\n\t\t\t'fields' => 'ids',\n\t\t\t'name' => $this->theme->get_template(),\n\t\t\t'posts_per_page' => 1,\n\t\t\t'post_type' => 'repopackage',\n\t\t\t'orderby' => 'ID',\n\t\t\t'suppress_filters' => false,\n\t\t) );\n\t\t$this->theme->post_parent = current( $parent );\n\n\t\treturn ! empty( $parent );\n\t}", "function it_exchange_custom_url_tracking_addon_builder_layout( $layout ) {\n\n\t$var = get_query_var( 'it_exchange_custom_url' );\n\tif ( empty( $var ) || ! is_singular() )\n\t\treturn $layout;\n\n\t$post_id = empty( $GLOBALS['post']->ID ) ? 0 : $GLOBALS['post']->ID;\n\t$custom_urls = get_post_meta( $post_id, '_it-exchange-product-feature-custom-url-tracking', true );\n\tforeach( $custom_urls as $url => $data ) {\n\t\tif ( $data['slug'] == $var && ! empty( $data['builder-layout'] ) )\n\t\t\treturn $data['builder-layout'];\n\t}\n\n\treturn $layout;\n}", "public function isSitemap(): bool;", "function checkTemplatePage()\t{\n\t\t\n\t\t// Get the record\n\t\t$template = t3lib_BEfunc::getRecord('pages', $this->templateUid);\n\n\t\tif($template['doktype'] != '71') {\n\t\t\treturn false;\t\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "private function isStaticPage($url) {\n\t\treturn substr($url, 0, 1) !== '_' && file_exists($this->getTemplateForPage($url));\n\t}", "function fanwood_plugin_layouts( $layout ) {\n\n\tif ( current_theme_supports( 'theme-layouts' ) ) {\n\t\n\t\t$global_layout = hybrid_get_setting( 'fanwood_global_layout' );\n\t\t$buddypress_layout = hybrid_get_setting( 'fanwood_buddypress_layout' );\n\n\t\tif ( function_exists( 'bp_loaded' ) && !bp_is_blog_page() && $layout == 'layout-default' ) {\n\t\t\n\t\t\tif ( $buddypress_layout !== 'layout_default' ) {\n\t\t\t\n\t\t\t\tif ( $buddypress_layout == 'layout_1c' )\n\t\t\t\t\t$layout = 'layout-1c';\n\t\t\t\telseif ( $buddypress_layout == 'layout_2c_l' )\n\t\t\t\t\t$layout = 'layout-2c-l';\n\t\t\t\telseif ( $buddypress_layout == 'layout_2c_r' )\n\t\t\t\t\t$layout = 'layout-2c-r';\n\t\t\t\telseif ( $buddypress_layout == 'layout_3c_c' )\n\t\t\t\t\t$layout = 'layout-3c-c';\n\t\t\t\telseif ( $buddypress_layout == 'layout_3c_l' )\n\t\t\t\t\t$layout = 'layout-3c-l';\n\t\t\t\telseif ( $buddypress_layout == 'layout_3c_r' )\n\t\t\t\t\t$layout = 'layout-3c-r';\n\t\t\t\telseif ( $buddypress_layout == 'layout_hl_1c' )\n\t\t\t\t\t$layout = 'layout-hl-1c';\n\t\t\t\telseif ( $buddypress_layout == 'layout_hl_2c_l' )\n\t\t\t\t\t$layout = 'layout-hl-2c-l';\n\t\t\t\telseif ( $buddypress_layout == 'layout_hl_2c_r' )\n\t\t\t\t\t$layout = 'layout-hl-2c-r';\n\t\t\t\telseif ( $buddypress_layout == 'layout_hr_1c' )\n\t\t\t\t\t$layout = 'layout-hr-1c';\n\t\t\t\telseif ( $buddypress_layout == 'layout_hr_2c_l' )\n\t\t\t\t\t$layout = 'layout-hr-2c-l';\n\t\t\t\telseif ( $buddypress_layout == 'layout_hr_2c_r' )\n\t\t\t\t\t$layout = 'layout-hr-2c-r';\n\t\t\t\t\n\t\t\t} elseif ( $buddypress_layout == 'layout_default' ) {\n\t\t\t\n\t\t\t\tif ( $global_layout == 'layout_1c' )\n\t\t\t\t\t$layout = 'layout-1c';\n\t\t\t\telseif ( $global_layout == 'layout_2c_l' )\n\t\t\t\t\t$layout = 'layout-2c-l';\n\t\t\t\telseif ( $global_layout == 'layout_2c_r' )\n\t\t\t\t\t$layout = 'layout-2c-r';\n\t\t\t\telseif ( $global_layout == 'layout_3c_c' )\n\t\t\t\t\t$layout = 'layout-3c-c';\n\t\t\t\telseif ( $global_layout == 'layout_3c_l' )\n\t\t\t\t\t$layout = 'layout-3c-l';\n\t\t\t\telseif ( $global_layout == 'layout_3c_r' )\n\t\t\t\t\t$layout = 'layout-3c-r';\n\t\t\t\telseif ( $global_layout == 'layout_hl_1c' )\n\t\t\t\t\t$layout = 'layout-hl-1c';\n\t\t\t\telseif ( $global_layout == 'layout_hl_2c_l' )\n\t\t\t\t\t$layout = 'layout-hl-2c-l';\n\t\t\t\telseif ( $global_layout == 'layout_hl_2c_r' )\n\t\t\t\t\t$layout = 'layout-hl-2c-r';\n\t\t\t\telseif ( $global_layout == 'layout_hr_1c' )\n\t\t\t\t\t$layout = 'layout-hr-1c';\n\t\t\t\telseif ( $global_layout == 'layout_hr_2c_l' )\n\t\t\t\t\t$layout = 'layout-hr-2c-l';\n\t\t\t\telseif ( $global_layout == 'layout_hr_2c_r' )\n\t\t\t\t\t$layout = 'layout-hr-2c-r';\n\t\t\t\n\t\t\t}\n\n\t\t}\n\t\t\n\t}\n\t\n\treturn $layout;\n\n}", "function portfolio_maybe_include() {\n\t// Include in back-end only\n\tif ( ! defined( 'WP_ADMIN' ) || ! WP_ADMIN )\n\t\treturn false;\n\n\t// Always include for ajax\n\tif ( defined( 'DOING_AJAX' ) && DOING_AJAX )\n\t\treturn true;\n\n\tif ( isset( $_GET['post'] ) )\n\t\t$post_id = $_GET['post'];\n\telseif ( isset( $_POST['post_ID'] ) )\n\t\t$post_id = $_POST['post_ID'];\n\telse\n\t\t$post_id = false;\n\n\t$post_id = (int) $post_id;\n\n\t// Check for page template\n\t$checked_templates = array( 'portfolio.php' );\n\n\t$template = get_post_meta( $post_id, '_wp_page_template', true );\n\tif ( in_array( $template, $checked_templates ) )\n\t\treturn true;\n\n\t// If no condition matched\n\treturn false;\n}", "private function hasView($page) {\r\n return file_exists($this->getView($page));\r\n }", "function checkVisual($contentId=0) {\r\n\t\t$option = JRequest::getVar('option');\r\n\t\t$view = JRequest::getVar('view');\r\n\r\n\t\treturn ( $option == $this->component\r\n\t\t&& $view == $this->singleView\r\n\t\t);\r\n\t}", "public function should_display_sandwitch_menu() {\n if ($this->page->pagelayout == 'frontpage' || !isloggedin() || isguestuser()) {\n return false;\n }\n return true;\n }", "function check_existing_standards($slug, $isCompetency) {\n\t$tax;\n\tif ($isCompetency)\n\t\t$tax = \"asn_index\";\n\telse $tax = \"asn_topic_index\";\n\t$term = get_term_by( \"slug\", $slug, $tax);\n\tif ($term !== false) {\n\t return true;\n\t}\n\telse return false;\t\n}", "public function should_render() {\n\t\t\t\treturn is_singular();\n\t\t\t}", "function mrseo_elated_sidebar_layout() {\n\t\t$sidebar_layout = '';\n\t\t$sidebar_layout_meta = mrseo_elated_get_meta_field_intersect('sidebar_layout');\n\t\t$archive_sidebar_layout = mrseo_elated_options()->getOptionValue('archive_sidebar_layout');\n\t\t$search_sidebar_layout = mrseo_elated_options()->getOptionValue('search_page_sidebar_layout');\n\t\t$single_sidebar_layout = mrseo_elated_get_meta_field_intersect('blog_single_sidebar_layout');\n\t\t\n\t\tif (!empty($sidebar_layout_meta)) {\n\t\t\t$sidebar_layout = $sidebar_layout_meta;\n\t\t}\n\t\t\n\t\tif (is_singular('post') && !empty($single_sidebar_layout)) {\n\t\t\t$sidebar_layout = $single_sidebar_layout;\n\t\t}\n\t\t\n\t\tif(is_search() && !mrseo_elated_is_woocommerce_shop() && !empty($search_sidebar_layout)) {\n\t\t\t$sidebar_layout = $search_sidebar_layout;\n\t\t}\n\t\t\n\t\tif ((is_archive() || (is_home() && is_front_page())) && !mrseo_elated_is_woocommerce_page() && !empty($archive_sidebar_layout)) {\n\t\t\t$sidebar_layout = $archive_sidebar_layout;\n\t\t}\n\t\t\n\t\tif (is_archive() && mrseo_elated_is_woocommerce_installed()) {\n\t\t\tif (is_product_category() || is_product_tag()) {\n\t\t\t\t$shop_id = get_option('woocommerce_shop_page_id');\n\t\t\t\t$sidebar_layout = mrseo_elated_get_meta_field_intersect('sidebar_layout', $shop_id);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn apply_filters('mrseo_elated_sidebar_layout', $sidebar_layout);\n\t}", "public function isMain() {\n\t\treturn $this->_page == null;\n\t}", "function dev_is_plugin_page( $slug = '' ) {\n\n\tglobal $post;\n\n\t$ticket_list = dev_get_option( 'ticket_list' );\n\t$ticket_submit = dev_get_option( 'ticket_submit' );\n\n\t/* Make sure these are arrays. Multiple selects were only used since 3.2, in earlier versions those options are strings */\n\tif( ! is_array( $ticket_list ) ) { $ticket_list = (array) $ticket_list; }\n\tif( ! is_array( $ticket_submit ) ) { $ticket_submit = (array) $ticket_submit; }\n\n\t$plugin_post_types = apply_filters( 'dev_plugin_post_types', array( 'ticket' ) );\n\t$plugin_admin_pages = apply_filters( 'dev_plugin_admin_pages', array( 'dev-status', 'dev-addons', 'dev-settings' ) );\n\t$plugin_frontend_pages = apply_filters( 'dev_plugin_frontend_pages', array_merge( $ticket_list, $ticket_submit ) );\n\n\t/* Check for plugin pages in the admin */\n\tif ( is_admin() ) {\n\n\t\t/* First of all let's check if there is a specific slug given */\n\t\tif ( ! empty( $slug ) && in_array( $slug, $plugin_admin_pages ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t/* If the current post if of one of our post types */\n\t\tif ( isset( $post ) && isset( $post->post_type ) && in_array( $post->post_type, $plugin_post_types ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t/* If the page we're in relates to one of our post types */\n\t\tif ( isset( $_GET['post_type'] ) && in_array( $_GET['post_type'], $plugin_post_types ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t/* If the page belongs to the plugin */\n\t\tif ( isset( $_GET['page'] ) && in_array( $_GET['page'], $plugin_admin_pages ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t/* In none of the previous conditions was true, return false by default. */\n\n\t\treturn false;\n\n\t} else {\n\n\t\tglobal $post;\n\n\t\tif ( empty( $post ) ) {\n\t\t\t$protocol = stripos( $_SERVER['SERVER_PROTOCOL'], 'https' ) === true ? 'https://' : 'http://';\n\t\t\t$post_id = url_to_postid( $protocol . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'] );\n\t\t\t$post = get_post( $post_id );\n\t\t}\n\n\t\tif ( is_singular( 'ticket' ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( isset( $post ) && is_object( $post ) && is_a( $post, 'WP_Post' ) ) {\n\n\t\t\t// Check for post IDs\n\t\t\tif ( in_array( $post->ID, $plugin_frontend_pages ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// Check for post types\n\t\t\tif ( in_array( $post->post_type,$plugin_post_types ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t}\n\n\t\treturn false;\n\n\t}\n\n}", "function aurum_check_fullwidth_page() {\n\tglobal $post;\n\n\tif ( $post && $post->post_type == 'page' ) {\n\t\t$is_fullwidth = false;\n\n\t\tif ( in_array( $post->page_template, array( 'full-width-page.php' ) ) ) {\n\t\t\t$is_fullwidth = true;\n\t\t} elseif ( aurum_get_field( 'fullwidth_page' ) ) {\n\t\t\t$is_fullwidth = true;\n\t\t}\n\n\t\tif ( $is_fullwidth ) {\n\t\t\tdefine( 'IS_FULLWIDTH_PAGE', true );\n\t\t}\n\t}\n}", "protected function isSinglePage()\n {\n return ($this->request->view == 'products' && $this->request->task == 'view');\n }", "public function validURLSegment()\n {\n if (self::config()->get('nested_urls') && $this->ParentID) {\n // Guard against url segments for sub-pages\n $parent = $this->Parent();\n if ($controller = ModelAsController::controller_for($parent)) {\n if ($controller instanceof Controller && $controller->hasAction($this->URLSegment)) {\n return false;\n }\n }\n } elseif (in_array(strtolower($this->URLSegment ?? ''), $this->getExcludedURLSegments() ?? [])) {\n // Guard against url segments for the base page\n // Default to '-2', onBeforeWrite takes care of further possible clashes\n return false;\n }\n\n // If any of the extensions return `0` consider the segment invalid\n $extensionResponses = array_filter(\n (array)$this->extend('augmentValidURLSegment'),\n function ($response) {\n return !is_null($response);\n }\n );\n if ($extensionResponses) {\n return min($extensionResponses);\n }\n\n // Check for clashing pages by url, id, and parent\n $source = NestedObject::get()->filter([\n 'ClassName' => $this->ClassName,\n 'URLSegment' => $this->URLSegment,\n ]);\n\n if ($this->ID) {\n $source = $source->exclude('ID', $this->ID);\n }\n\n if (self::config()->get('nested_urls')) {\n $source = $source->filter('ParentID', $this->ParentID ? $this->ParentID : 0);\n }\n\n return !$source->exists();\n }", "function load_composer_layout( $layout_type = 'header' ) {\n\t\tglobal $post;\n\t\t$default_layout = '';\n\t\t\n\t\t$postID = is_home() ? get_option( 'page_for_posts' ) : ( $post ? $post->ID : 0 );\n\t\t\n\t\tif ( $postID && ( is_singular() || is_home() ) && ( $this_layout_id = get_post_meta( $postID, '_this_' . $layout_type, true ) ) ) { // appointment: may be anyone\n\t\t\tif ( $this_layout_id === '_none_' ) { // layout disabled;\n\t\t\t\treturn '';\n\t\t\t}\n\t\t\t$layout = get_post( $this_layout_id );\n\t\t\tif ( $layout && $layout->post_status === 'publish' ) {\n\t\t\t\treturn do_shortcode( apply_filters( 'the_content', $layout->post_content ) );\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$default_layout_query = Trends()->model->layout->get_default_layout( $layout_type );\n\t\t\t\t\n\t\t\t\tif ( $default_layout_query->posts && $default_layout_query->posts[0]->post_status === 'publish' ) {\n\t\t\t\t\treturn do_shortcode( apply_filters( 'the_content', $default_layout_query->posts[0]->post_content ) );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\t$layouts = Trends()->model->layout->get_layouts( $layout_type );\n\t\t\t\n\t\t\tif ( $layouts->posts ) {\n\t\t\t\tforeach ( $layouts->posts as $layout ) {\n\t\t\t\t\t$_appointment = get_post_meta( $layout->ID, '_appointment', true );\n\t\t\t\t\t\n\t\t\t\t\tif ( ( $postID && ( $post_type = get_post_type( $postID ) ) && $_appointment === $post_type && is_singular() ) || // appointment: Any from Post Types (compatibility:post)\n\t\t\t\t\t ( $_appointment === 'is-home' && is_home() ) || // appointment: is-home\n\t\t\t\t\t ( $_appointment === 'is-search' && is_search() ) || // appointment: is-search\n\t\t\t\t\t ( $_appointment === 'is-archive' && is_archive() ) || // appointment: is-archive\n\t\t\t\t\t ( $_appointment === 'is-404' && is_404() ) // appointment: is-404\n\t\t\t\t\t\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn do_shortcode( apply_filters( 'the_content', $layout->post_content ) );\n\t\t\t\t\t} elseif ( $_appointment === 'default' ) { // appointment: default\n\t\t\t\t\t\t$default_layout = $layout;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( $default_layout ) {\n\t\t\t\t\treturn do_shortcode( apply_filters( 'the_content', $default_layout->post_content ) );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn '';\n\t}", "private function checkForView($name)\n {\n $viewFile = $this->config['views'] . '/' . $name . '.blade.php';\n if (!file_exists($viewFile)) {\n return false;\n }\n\n return true;\n }", "function is_ss_widget($widget_id_base){\n\t\t$arr_ss_widget = array(\n\t\t\t\t\t\t\t'ss_logo_widget', \n\t\t\t\t\t\t\t'ss_menu_widget', \n\t\t\t\t\t\t\t'ss_page_widget', \n\t\t\t\t\t\t\t'ss_current_page_widget', \n\t\t\t\t\t\t\t'ss_parent_child_links_widget', \n\t\t\t\t\t\t\t'ss_part_widget',\n\t\t\t\t\t\t\t'ss_container_open_widget',\n\t\t\t\t\t\t\t'ss_container_close_widget',\n\t\t\t\t\t\t\t'ss_parts_accordion_widget',\n\t\t\t\t\t\t\t'ss_parts_slider_widget',\n\t\t\t\t\t\t\t'ss_parts_widget',\n\t\t\t\t\t\t\t'ss_ypnz_footer_widget'\n\t\t\t\t\t\t);\n\n\t\tif(in_array($widget_id_base, $arr_ss_widget)){\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "function yz_is_ad_widget( $widget_name ) {\n if ( false !== strpos( $widget_name, 'yz_ad_' ) ) {\n return true;\n }\n return false;\n}", "function medigroup_mikado_is_blog_template($current_page = '') {\n\n if($current_page == '') {\n $current_page = medigroup_mikado_get_page_template_name();\n }\n\n $blog_templates = medigroup_mikado_blog_templates();\n\n return in_array($current_page, $blog_templates);\n }", "private function is_dashboard_page() {\n\t\t\t$current_screen = \\get_current_screen();\n\n\t\t\tif (\n\t\t\t\t'dashboard_page_woocart-dashboard' !== $current_screen->id &&\n\t\t\t\t'dashboard_page_woocart-dashboard-network' !== $current_screen->id\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Dadolun_ThemeLayoutBlock::theme_layout_block');\n }", "function kusurinotakagi_has_table_of_contents() {\n//\tif ( is_singular( 'blog' ) ) {\n//\t\treturn true;\n//\t}\n//\tif ( is_single() ) {\n//\t\treturn true;\n//\t}\n\n\treturn false;\n}", "private function is_wpforms_plugin( $slug ) {\n\n\t\treturn strpos( $slug, 'wpforms' ) === 0 && $slug !== 'wpforms-lite';\n\t}", "function voyage_mikado_is_blog_template($current_page = '') {\n\n if($current_page == '') {\n $current_page = voyage_mikado_get_page_template_name();\n }\n\n $blog_templates = voyage_mikado_blog_templates();\n\n return in_array($current_page, $blog_templates);\n }", "public function exists(string $slug);", "function is_location() {\n return ( is_post_type_archive( 'location' ) || ( is_single() && get_post_type() == 'location' ) ) ? true : false;\n}", "function theme_exists( $theme_slug ) {\n\t\treturn is_dir( WP_CONTENT_DIR . '/themes/' . $theme_slug );\n\t}", "public function get_id_by_slug( $name = false ){\n\n\t\tif( $name ){\n\t\t\tglobal $wpdb;\n\n\t\t\t$query = $wpdb->prepare( \"SELECT ID FROM {$wpdb->posts} WHERE post_status = 'publish' AND post_type = 'wp_simple_flexslider' AND post_title = %s\", $name );\n\n\t\t\t$post = $wpdb->get_row( $query );\n\n\t\t\tif( isset( $post->ID ) ){\n\n\t\t\t\treturn $post->ID;\n\n\t\t\t} else {\n\n\t\t\t\treturn false;\n\n\t\t\t}\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "private function isDynamicPage()\n\t{\n\t\tif ( isset( $this->request['directories'] ) === true && count( $this->request['directories'] ) > 0 )\n\t\t{\n\t\t\t/**\n\t\t\t * Check if either the base directory is a store or a call to a file in the apps folder\n\t\t\t * or if it is the base directory for a blog (meaning the base directory is also a file in published data)\n\t\t\t */\n\t\t\tif ( $this->isDynamicRoute( $this->request['directories'][0] ) ||\n\t\t\t\t( is_numeric( $this->request['directories'][0] ) === true )\n\t\t\t)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "protected function projectSpecificSectionsCondition()\n {\n return\n isset($this->get['urls']) ||\n //F\n isset($this->get['divisions-products']) ||\n isset($this->get['translations']) ||\n //A\n isset($this->get['products']) ||\n isset($this->get['pages']);\n }", "function publisher_is_valid_header_style( $layout ) {\n\n\t\treturn ( is_string( $layout ) || is_int( $layout ) ) &&\n\t\t array_key_exists( $layout, publisher_header_style_option_list() );\n\t}", "private function requested_post_is_valid(){\n return (get_post_type((int) $_GET['post_id']) === $this->post_type && get_post_status((int) $_GET['post_id']) === 'publish');\n }", "static function is_requested()\n {\n $retval = FALSE;\n if (self::is_requested_page()) {\n $retval = self::is_requested_page();\n } elseif (self::is_requested_post_type()) {\n $retval = self::is_requested_post_type();\n }\n return apply_filters('is_ngg_admin_page', $retval);\n }" ]
[ "0.6541276", "0.65177697", "0.63184744", "0.6231651", "0.6229931", "0.6144456", "0.61089736", "0.60230285", "0.5954641", "0.59452987", "0.59440255", "0.58904546", "0.58605665", "0.5769495", "0.57340306", "0.5714853", "0.5679132", "0.5677173", "0.5646282", "0.5607264", "0.5603999", "0.5583978", "0.5527843", "0.552178", "0.5510028", "0.55059993", "0.5482826", "0.5480829", "0.54595774", "0.5453388", "0.543684", "0.5425347", "0.54218936", "0.5420393", "0.5399847", "0.53949994", "0.5371914", "0.5363324", "0.5361833", "0.5357018", "0.5352719", "0.5350396", "0.534771", "0.53448725", "0.5339682", "0.53321713", "0.53255", "0.529606", "0.5286833", "0.52846223", "0.5281577", "0.52741563", "0.527103", "0.52683234", "0.5259988", "0.52561677", "0.5255832", "0.5243615", "0.52343124", "0.52244556", "0.52242374", "0.5222474", "0.52191377", "0.521803", "0.5212969", "0.5211967", "0.52035135", "0.52001727", "0.51899076", "0.5187397", "0.5178766", "0.51734453", "0.5170369", "0.5162449", "0.5159606", "0.5154565", "0.51524836", "0.5152385", "0.51511365", "0.51511014", "0.51500297", "0.5149391", "0.51427364", "0.51396066", "0.51351607", "0.5135026", "0.51309186", "0.51291513", "0.5115912", "0.5109236", "0.5104732", "0.5099148", "0.5096691", "0.5095656", "0.50907415", "0.5089769", "0.50857276", "0.5084767", "0.50838846", "0.5082145" ]
0.6903078
0
Get filename for export.
protected function filename() { return 'ReclassExport_' . time(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function filename()\n {\n return 'Export_' . date('YmdHis');\n }", "protected function filename () : string {\n return sprintf('%s/%s.csv', $this->instanceDirectory(), $this->guessName());\n }", "public function getFileName()\n {\n $fileName = $this->getInfo('fileName');\n if (!$fileName) {\n $fileName = $this->getInfo('title');\n }\n if (!$fileName) {\n $fileName = Zend_Controller_Front::getInstance()->getRequest()->getParam('controller') . '-' . date(\"Ymd\");\n }\n return $fileName . '.csv';\n }", "private static function getFileName()\n {\n return sprintf('Export %s.csv', Carbon::now()->toDateTimeString());\n }", "public function getFilename()\n {\n return static::filename($this->path);\n }", "public function getFilename();", "public function getFilename();", "public function getFilename() {}", "public function getFilename()\n {\n return $this->filename . '.pdf';\n }", "public function getFilename(): string\n {\n return $this->filename;\n }", "public function getFilename(): string\n {\n return $this->filename;\n }", "public function getFilename()\n {\n $file = basename($this->srcPath);\n\n $ops = str_replace(array('&', ':', ';', '?', '.', ','), '-', $this->operations);\n return trim($ops . '-' . $file, './');\n }", "public function getFilename() : string\n {\n return $this->fileName;\n }", "private function pathFilename() {\n return $this->directory . \"/\" . $this->formatFilename();\n }", "public function filename()\n\t{\n\t\treturn $this->_filename();\n\t}", "public function getFileName()\n {\n $value = $this->get(self::FILENAME);\n return $value === null ? (string)$value : $value;\n }", "private function getExportFileName($extension = 'csv')\n\t{\n\t\t$datetime = new DateTime();\n\t\t$timezone = new DateTimeZone(Mage::getStoreConfig('general/locale/timezone'));\n\t\t$datetime->setTimezone($timezone);\n\t\t$date = $datetime->format(\"Y-m-d\");\n\t\t$time = $datetime->format(\"His\");\n\t\treturn sprintf(\"%s-%s-%d.%s\",self::EXPORT_FILE_NAME, $date, $time, $extension);\n\t}", "private function getOutputFileName()\n {\n $formattedDate = date(self::DATE_FORMAT);\n $fileName = sprintf(self::FILE_NAME_PATTERN, $formattedDate);\n\n return $fileName;\n }", "public function getFileNameForExport($report, $file_type) {\r\n return $this->prefix_project_name . '_' . $report . '_' . time() . '.' . $file_type;\r\n }", "protected function filename()\n {\n return 'Reports_' . date('YmdHis');\n }", "public function getFileName()\n {\n return basename($this->path);\n }", "public function getFileName(): string\n {\n if (strpos($this->savefileName, '.php') === false) {\n return $this->savefileName . $this->extension;\n }\n return $this->savefileName;\n }", "private function getFilename()\n {\n if ($this->uniqueFile) {\n return $this->filename;\n }\n\n return $this->filename . self::SEPARATOR . $this->getCurrentSitemap();\n }", "public function getFileName()\n {\n return \"{$this->getUserOS()}-{$this->getDriver()}{$this->getFileExtension()}\";\n }", "public function getFileName();", "public function getFileName();", "public function getFileName();", "public function getFilename() {\n return $this->path;\n }", "public function getFilename()\n {\n return __FILE__;\n }", "public function getFilename() {\n return $this->getData('file');\n }", "public function getFilename()\n {\n return $this->filename;\n }", "public function getFilename()\n {\n return $this->filename;\n }", "public function getFilename()\n {\n return $this->filename;\n }", "public function getFilename()\n {\n return $this->filename;\n }", "public function getFilename()\n {\n return $this->filename;\n }", "public function getFilename()\n {\n return $this->filename;\n }", "protected function filename()\n {\n return 'Payment_'.date('YmdHis');\n }", "public function getFileName()\n {\n return $this->prefix.$this->scope.'_'.$this->comName;\n }", "public function myFilename()\r\n {\r\n $reflection = new ReflectionClass($this);\r\n\r\n return $reflection->getFileName();\r\n }", "public function get_filename()\n {\n }", "public function filename() : string {\n return $this->name;\n }", "public function getFilename()\n {\n return '';\n }", "public function getFilename(): string\n {\n return $this->getServer(self::SCRIPT_FILENAME);\n }", "protected function ___filename() {\n\t\treturn $this->pagefiles->path . $this->basename;\n\t}", "protected function filename()\n {\n return 'Delivery_' . date('YmdHis');\n }", "function getFilename()\n {\n return __FILE__;\n }", "public function getFilename()\r\n {\r\n return pathinfo($this->filename, PATHINFO_BASENAME);\r\n }", "public function getFileName()\n {\n return $this->getParam('flowFilename');\n }", "protected function filename()\n {\n return 'Egreso_' . date('YmdHis');\n }", "public function getFileName()\n {\n return $this->filename;\n }", "public function getFileName()\n {\n return $this->filename;\n }", "protected function filename()\n {\n return 'Orders_' . date('YmdHis');\n }", "public function getFileName()\n {\n return basename($this->file, '.' . $this->getExtension());\n }", "public function filename(): string\n {\n return Str::random(6) . '_' . $this->type . $this->fileExtension();\n }", "public function getFileName(){\n\t\t$filename = sprintf($this->format, $this->classname) . '.php';\n\t\t\n\t\treturn $filename;\n\t}", "public function getFilename()\n {\n return $this->_filename;\n }", "public function getFileName()\n {\n return $this->language.'/'.strtolower($this->getName());\n }", "public function fullFilename()\n {\n $ext = '.xml';\n if (strpos(strtolower($this->url), '.csv') > 0)\n $ext = '.csv';\n return $this->filename . $ext;\n }", "public function getFilename() {\n\t\treturn $this->filename;\n\t}", "public function getFilename() {\n\t\treturn $this->filename;\n\t}", "public function getFilename()\n {\n if (!$this->fileName) {\n $matcher = $this->getFileMatcher();\n $this->fileName = $this->searchFile($matcher);\n }\n\n return $this->fileName;\n }", "public function getFilename()\n\t\t{\n\t\t\treturn $this->_fileName;\n\t\t}", "public function getFileName() {\n\t\treturn $this->filename;\n\t}", "function rlip_get_export_filename($plugin, $tz = 99) {\n global $CFG;\n $tempexportdir = $CFG->dataroot . sprintf(RLIP_EXPORT_TEMPDIR, $plugin);\n $export = basename(get_config($plugin, 'export_file'));\n $timestamp = get_config($plugin, 'export_file_timestamp');\n if (!empty($timestamp)) {\n $timestamp = userdate(time(), get_string('export_file_timestamp',\n $plugin), $tz);\n if (($extpos = strrpos($export, '.')) !== false) {\n $export = substr($export, 0, $extpos) .\n \"_{$timestamp}\" . substr($export, $extpos);\n } else {\n $export .= \"_{$timestamp}.csv\";\n }\n }\n if (!file_exists($tempexportdir) && !@mkdir($tempexportdir, 0777, true)) {\n error_log(\"/blocks/rlip/lib.php::rlip_get_export_filename('{$plugin}', {$tz}) - Error creating directory: '{$tempexportdir}'\");\n }\n return $tempexportdir . $export;\n}", "protected function filename() {\n return 'Passport_report_' . date('YmdHis');\n }", "public function getFilename()\n\t\t{\n\t\t\treturn $this->filename;\n\t\t}", "protected function getFileName() {\n return $this->_dateTime->format('YmdHis') . '.xml';\n }", "protected function getFileName() {\n // Full file path.\n $path = $this->urls[$this->activeUrl];\n\n // Explode with the '/' to get the last element.\n $files = explode('/', $path);\n\n // File name without extension.\n $file_name = explode('.', end($files))[0];\n return $file_name;\n }", "protected function filename()\n {\n return 'account_list_' . date('Y_m_d_H_i_s');\n }", "public function getFilename() {\n return $this->filename;\n }", "public function getFilename() {\n\t\t\n\t\t$filename = $this->filename;\n\t\t\n\t\tif(file_exists($this->path . $filename) && $this->rename_if_exists === true) {\n\t\t\n\t\t\t//Explode the filename, pop off the extension and put it back together\n\t\t\t$parts = explode('.', $filename);\n\n\t\t\t$extension = array_pop($parts);\n\n\t\t\t$base_filename = implode('.', $parts);\n\t\t\t\n\t\t\t$count = 1;\n\t\t\t\n\t\t\tdo {\n\t\t\t\t$count++;\n\t\t\t} while(file_exists($this->path . $base_filename . '_' . $count . '.' . $extension));\n\t\t\t\n\t\t\t$filename = $base_filename . '_' . $count . '.' . $extension;\n\t\t\n\t\t}\n\t\t\n\t\treturn $filename;\n\t\t\n\t}", "protected function filename()\n {\n return 'playerBetFlowLogs';\n }", "private function exportFileName($attachment): string\n {\n\n return sprintf('%s-Attachment nr. %s - %s', $this->job->key, strval($attachment->id), $attachment->filename);\n }", "public function getFileName() {\n\t\t$spec = self::$specs[$this->id];\n\t\treturn array_value($spec, \"filename\", FALSE);\n\t}", "public function getFileName(): string\n {\n return Str::studly(\n $this->getTable()\n );\n }", "function getExportFileName($objectsFileNamePart, $context) {\n\t\treturn $this->getExportPath() . date('Ymd-His') .'-' . $objectsFileNamePart .'-' . $context->getId() . '.xml';\n\t}", "public function getFileName() {\n return $this->name;\n }", "protected function filename()\n {\n return 'InvoicesSale_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'Document_' . date('YeamdHis');\n }", "public function getFileName()\n {\n return $this->fileName;\n }", "public function getFileName()\n {\n return $this->fileName;\n }", "public function getFileName()\n {\n return $this->fileName;\n }", "public function getFileName()\n {\n return $this->fileName;\n }", "public function getFileName()\n {\n return $this->fileName;\n }", "protected function filename()\n {\n return 'Order_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'Contracts_' . date('YmdHis');\n }", "function _getFileName()\r\n\t{\r\n\t\t$f = $this->pathHomeDir . '/' . $this->pathLocale . '/' . $this->pathFile . \".\" . $this->pathEx;\r\n\t\treturn $f;\r\n\t}", "function getFilename();", "public function getFileName() {\n\n return $this->fileName;\n }", "public function getFilename(): string\n {\n return DIR_TESTS . '/' . $this->module . '/Controller/' . $this->controller . 'Test.php';\n }", "protected function filename()\n {\n return 'owe_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'Invoices_' . date('YmdHis');\n }", "public function getBulkFilename()\n {\n return $this->filename . '.pdf';\n }", "public function getFileName()\n\t{\n\t\treturn $this->fileName;\n\t}", "public function getFileName()\n\t{\n\t\treturn $this->fileName;\n\t}", "private function genereteFilename(){\n return strtolower(md5(uniqid($this->document->baseName)) . '.' . $this->document->extension);\n }", "protected function filename() {\n\t\treturn 'Order_' . date('YmdHis');\n\t}", "public function getFileName(){\n return $this->finalFileName;\n }", "public function getFilename()\n {\n return 'test-file';\n }", "public function filename(): string;" ]
[ "0.8196528", "0.80591613", "0.7949222", "0.7926228", "0.76592237", "0.7587201", "0.7587201", "0.7554733", "0.75451165", "0.750201", "0.750201", "0.7494168", "0.74720484", "0.7440598", "0.7438713", "0.74358875", "0.7413326", "0.7389984", "0.735199", "0.7335797", "0.73351353", "0.7334927", "0.7316822", "0.73054564", "0.728245", "0.728245", "0.728245", "0.7275521", "0.7269254", "0.7268183", "0.7258453", "0.7258453", "0.7258453", "0.7258453", "0.7258453", "0.7258453", "0.7250907", "0.7248147", "0.72442096", "0.72418547", "0.72405916", "0.72378516", "0.7231945", "0.7228207", "0.72274476", "0.7219302", "0.72191083", "0.72168005", "0.7213594", "0.72070825", "0.72070825", "0.7201815", "0.719634", "0.71956646", "0.7194918", "0.71839637", "0.71804535", "0.71567154", "0.71563834", "0.71563834", "0.7155306", "0.7146139", "0.7140778", "0.7128196", "0.7126538", "0.71086234", "0.7108268", "0.71058804", "0.71036285", "0.7088248", "0.7085628", "0.7077877", "0.70729536", "0.7064761", "0.7060098", "0.70597196", "0.70442694", "0.70408803", "0.70382166", "0.7035906", "0.7035906", "0.7035906", "0.7035906", "0.7035906", "0.70327896", "0.70262915", "0.7025894", "0.70084685", "0.70043564", "0.70036155", "0.7002965", "0.69966114", "0.69959754", "0.6994067", "0.6994067", "0.69926775", "0.69908285", "0.69870937", "0.6978238", "0.69774413" ]
0.7431382
16
Display a listing of the resource.
public function index() { $tags = Tag::latest() ->when(request()->search, function ($query) { $query->where('name', 'like', '%' . request()->search . '%'); }) ->paginate(10); return view('tags.index', [ 'tags' => $tags ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { return view('tags.create', [ 'tag' => new Tag(), ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { $validator = Validator::make($request->all(), [ 'name' => 'required|unique:tags,name|string|min:3|max:255', 'description' => 'nullable|string|min:3|max:255', ]); if ($validator->fails()) { return back()->with('toast_error', $validator->messages()->all()[0])->withInput(); } Tag::create([ 'name' => $request->name, 'description' => $request->description, ]); return redirect(route('tags.index'))->with('success', 'Your Tag has been submited!'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show(Tag $tag) { return view('tags.show', [ 'tag' => $tag ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit(Tag $tag) { return view('tags.edit', [ 'tag' => $tag, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, Tag $tag) { $validator = Validator::make($request->all(), [ 'name' => 'required|unique:tags,name,' . $tag->id . '|string|min:3|max:255', 'description' => 'nullable|string|min:3|max:255', ]); if ($validator->fails()) { return back()->with('toast_error', $validator->messages()->all()[0])->withInput(); } $tag->update([ 'name' => $request->name, 'description' => $request->description, ]); return redirect(route('tags.index'))->with('success', 'Tag has been updated!');; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy(Tag $tag) { $tag->delete(); return back()->with('toast_success', 'Tag has been deleted!'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Display a listing of the resource.
public function index() { $halaman = 'siswa'; $siswa_list = Siswa::orderBy('created_at', 'desc')->paginate(2); $jumlah_siswa = Siswa::count(); return view('siswa.index', compact('halaman', 'siswa_list', 'jumlah_siswa')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { $list_kelas = Kelas::all(); $jumlah_kelas = Kelas::count(); $list_hobi = hobi::all(); $jumlah_hobi = hobi::count(); return view('siswa.create', compact('list_kelas', 'jumlah_kelas', 'list_hobi', 'jumlah_hobi')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1